weave-typescript 0.29.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3175 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.6
5
+ // protoc unknown
6
+ // source: weaveapi/auth/v1/auth.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.SupportAccessSession = exports.ScimGroupMapping = exports.ScimTokenRotation = exports.ScimConnection = exports.SsoConnection = exports.RbacPermission = exports.RbacRole = exports.RbacResource = exports.RbacPolicySummary = exports.OrganizationMember = exports.OrganizationAuthSettings = exports.UserProfile = exports.DiscoveryOrganization = exports.AuthOrganization = exports.AuthUser = exports.AuthSession = exports.AuthProvider = exports.ScimConnectionStatus = exports.SsoConnectionStatus = exports.SsoConnectionType = exports.OrganizationKind = exports.MembershipStatus = exports.DiscoveryOrganizationStatus = exports.AuthMethod = exports.protobufPackage = void 0;
9
+ exports.authMethodFromJSON = authMethodFromJSON;
10
+ exports.authMethodToJSON = authMethodToJSON;
11
+ exports.discoveryOrganizationStatusFromJSON = discoveryOrganizationStatusFromJSON;
12
+ exports.discoveryOrganizationStatusToJSON = discoveryOrganizationStatusToJSON;
13
+ exports.membershipStatusFromJSON = membershipStatusFromJSON;
14
+ exports.membershipStatusToJSON = membershipStatusToJSON;
15
+ exports.organizationKindFromJSON = organizationKindFromJSON;
16
+ exports.organizationKindToJSON = organizationKindToJSON;
17
+ exports.ssoConnectionTypeFromJSON = ssoConnectionTypeFromJSON;
18
+ exports.ssoConnectionTypeToJSON = ssoConnectionTypeToJSON;
19
+ exports.ssoConnectionStatusFromJSON = ssoConnectionStatusFromJSON;
20
+ exports.ssoConnectionStatusToJSON = ssoConnectionStatusToJSON;
21
+ exports.scimConnectionStatusFromJSON = scimConnectionStatusFromJSON;
22
+ exports.scimConnectionStatusToJSON = scimConnectionStatusToJSON;
23
+ exports.authProviderFromJSON = authProviderFromJSON;
24
+ exports.authProviderToJSON = authProviderToJSON;
25
+ /* eslint-disable */
26
+ const wire_1 = require("@bufbuild/protobuf/wire");
27
+ const struct_pb_1 = require("../../../google/protobuf/struct.pb");
28
+ const timestamp_pb_1 = require("../../../google/protobuf/timestamp.pb");
29
+ exports.protobufPackage = "weaveapi.auth.v1";
30
+ var AuthMethod;
31
+ (function (AuthMethod) {
32
+ AuthMethod[AuthMethod["AUTH_METHOD_UNSPECIFIED"] = 0] = "AUTH_METHOD_UNSPECIFIED";
33
+ AuthMethod[AuthMethod["AUTH_METHOD_PASSWORD"] = 1] = "AUTH_METHOD_PASSWORD";
34
+ AuthMethod[AuthMethod["AUTH_METHOD_OAUTH_GOOGLE"] = 2] = "AUTH_METHOD_OAUTH_GOOGLE";
35
+ AuthMethod[AuthMethod["AUTH_METHOD_OAUTH_MICROSOFT"] = 3] = "AUTH_METHOD_OAUTH_MICROSOFT";
36
+ AuthMethod[AuthMethod["AUTH_METHOD_SSO_SAML"] = 4] = "AUTH_METHOD_SSO_SAML";
37
+ AuthMethod[AuthMethod["AUTH_METHOD_SSO_OIDC"] = 5] = "AUTH_METHOD_SSO_OIDC";
38
+ AuthMethod[AuthMethod["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
39
+ })(AuthMethod || (exports.AuthMethod = AuthMethod = {}));
40
+ function authMethodFromJSON(object) {
41
+ switch (object) {
42
+ case 0:
43
+ case "AUTH_METHOD_UNSPECIFIED":
44
+ return AuthMethod.AUTH_METHOD_UNSPECIFIED;
45
+ case 1:
46
+ case "AUTH_METHOD_PASSWORD":
47
+ return AuthMethod.AUTH_METHOD_PASSWORD;
48
+ case 2:
49
+ case "AUTH_METHOD_OAUTH_GOOGLE":
50
+ return AuthMethod.AUTH_METHOD_OAUTH_GOOGLE;
51
+ case 3:
52
+ case "AUTH_METHOD_OAUTH_MICROSOFT":
53
+ return AuthMethod.AUTH_METHOD_OAUTH_MICROSOFT;
54
+ case 4:
55
+ case "AUTH_METHOD_SSO_SAML":
56
+ return AuthMethod.AUTH_METHOD_SSO_SAML;
57
+ case 5:
58
+ case "AUTH_METHOD_SSO_OIDC":
59
+ return AuthMethod.AUTH_METHOD_SSO_OIDC;
60
+ case -1:
61
+ case "UNRECOGNIZED":
62
+ default:
63
+ return AuthMethod.UNRECOGNIZED;
64
+ }
65
+ }
66
+ function authMethodToJSON(object) {
67
+ switch (object) {
68
+ case AuthMethod.AUTH_METHOD_UNSPECIFIED:
69
+ return "AUTH_METHOD_UNSPECIFIED";
70
+ case AuthMethod.AUTH_METHOD_PASSWORD:
71
+ return "AUTH_METHOD_PASSWORD";
72
+ case AuthMethod.AUTH_METHOD_OAUTH_GOOGLE:
73
+ return "AUTH_METHOD_OAUTH_GOOGLE";
74
+ case AuthMethod.AUTH_METHOD_OAUTH_MICROSOFT:
75
+ return "AUTH_METHOD_OAUTH_MICROSOFT";
76
+ case AuthMethod.AUTH_METHOD_SSO_SAML:
77
+ return "AUTH_METHOD_SSO_SAML";
78
+ case AuthMethod.AUTH_METHOD_SSO_OIDC:
79
+ return "AUTH_METHOD_SSO_OIDC";
80
+ case AuthMethod.UNRECOGNIZED:
81
+ default:
82
+ return "UNRECOGNIZED";
83
+ }
84
+ }
85
+ var DiscoveryOrganizationStatus;
86
+ (function (DiscoveryOrganizationStatus) {
87
+ DiscoveryOrganizationStatus[DiscoveryOrganizationStatus["DISCOVERY_ORGANIZATION_STATUS_UNSPECIFIED"] = 0] = "DISCOVERY_ORGANIZATION_STATUS_UNSPECIFIED";
88
+ DiscoveryOrganizationStatus[DiscoveryOrganizationStatus["DISCOVERY_ORGANIZATION_STATUS_ACTIVE_MEMBER"] = 1] = "DISCOVERY_ORGANIZATION_STATUS_ACTIVE_MEMBER";
89
+ DiscoveryOrganizationStatus[DiscoveryOrganizationStatus["DISCOVERY_ORGANIZATION_STATUS_INVITED_MEMBER"] = 2] = "DISCOVERY_ORGANIZATION_STATUS_INVITED_MEMBER";
90
+ DiscoveryOrganizationStatus[DiscoveryOrganizationStatus["DISCOVERY_ORGANIZATION_STATUS_ELIGIBLE"] = 3] = "DISCOVERY_ORGANIZATION_STATUS_ELIGIBLE";
91
+ DiscoveryOrganizationStatus[DiscoveryOrganizationStatus["DISCOVERY_ORGANIZATION_STATUS_MFA_REQUIRED"] = 4] = "DISCOVERY_ORGANIZATION_STATUS_MFA_REQUIRED";
92
+ DiscoveryOrganizationStatus[DiscoveryOrganizationStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
93
+ })(DiscoveryOrganizationStatus || (exports.DiscoveryOrganizationStatus = DiscoveryOrganizationStatus = {}));
94
+ function discoveryOrganizationStatusFromJSON(object) {
95
+ switch (object) {
96
+ case 0:
97
+ case "DISCOVERY_ORGANIZATION_STATUS_UNSPECIFIED":
98
+ return DiscoveryOrganizationStatus.DISCOVERY_ORGANIZATION_STATUS_UNSPECIFIED;
99
+ case 1:
100
+ case "DISCOVERY_ORGANIZATION_STATUS_ACTIVE_MEMBER":
101
+ return DiscoveryOrganizationStatus.DISCOVERY_ORGANIZATION_STATUS_ACTIVE_MEMBER;
102
+ case 2:
103
+ case "DISCOVERY_ORGANIZATION_STATUS_INVITED_MEMBER":
104
+ return DiscoveryOrganizationStatus.DISCOVERY_ORGANIZATION_STATUS_INVITED_MEMBER;
105
+ case 3:
106
+ case "DISCOVERY_ORGANIZATION_STATUS_ELIGIBLE":
107
+ return DiscoveryOrganizationStatus.DISCOVERY_ORGANIZATION_STATUS_ELIGIBLE;
108
+ case 4:
109
+ case "DISCOVERY_ORGANIZATION_STATUS_MFA_REQUIRED":
110
+ return DiscoveryOrganizationStatus.DISCOVERY_ORGANIZATION_STATUS_MFA_REQUIRED;
111
+ case -1:
112
+ case "UNRECOGNIZED":
113
+ default:
114
+ return DiscoveryOrganizationStatus.UNRECOGNIZED;
115
+ }
116
+ }
117
+ function discoveryOrganizationStatusToJSON(object) {
118
+ switch (object) {
119
+ case DiscoveryOrganizationStatus.DISCOVERY_ORGANIZATION_STATUS_UNSPECIFIED:
120
+ return "DISCOVERY_ORGANIZATION_STATUS_UNSPECIFIED";
121
+ case DiscoveryOrganizationStatus.DISCOVERY_ORGANIZATION_STATUS_ACTIVE_MEMBER:
122
+ return "DISCOVERY_ORGANIZATION_STATUS_ACTIVE_MEMBER";
123
+ case DiscoveryOrganizationStatus.DISCOVERY_ORGANIZATION_STATUS_INVITED_MEMBER:
124
+ return "DISCOVERY_ORGANIZATION_STATUS_INVITED_MEMBER";
125
+ case DiscoveryOrganizationStatus.DISCOVERY_ORGANIZATION_STATUS_ELIGIBLE:
126
+ return "DISCOVERY_ORGANIZATION_STATUS_ELIGIBLE";
127
+ case DiscoveryOrganizationStatus.DISCOVERY_ORGANIZATION_STATUS_MFA_REQUIRED:
128
+ return "DISCOVERY_ORGANIZATION_STATUS_MFA_REQUIRED";
129
+ case DiscoveryOrganizationStatus.UNRECOGNIZED:
130
+ default:
131
+ return "UNRECOGNIZED";
132
+ }
133
+ }
134
+ var MembershipStatus;
135
+ (function (MembershipStatus) {
136
+ MembershipStatus[MembershipStatus["MEMBERSHIP_STATUS_UNSPECIFIED"] = 0] = "MEMBERSHIP_STATUS_UNSPECIFIED";
137
+ MembershipStatus[MembershipStatus["MEMBERSHIP_STATUS_ACTIVE"] = 1] = "MEMBERSHIP_STATUS_ACTIVE";
138
+ MembershipStatus[MembershipStatus["MEMBERSHIP_STATUS_INVITED"] = 2] = "MEMBERSHIP_STATUS_INVITED";
139
+ MembershipStatus[MembershipStatus["MEMBERSHIP_STATUS_SUSPENDED"] = 3] = "MEMBERSHIP_STATUS_SUSPENDED";
140
+ MembershipStatus[MembershipStatus["MEMBERSHIP_STATUS_DEPROVISIONED"] = 4] = "MEMBERSHIP_STATUS_DEPROVISIONED";
141
+ MembershipStatus[MembershipStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
142
+ })(MembershipStatus || (exports.MembershipStatus = MembershipStatus = {}));
143
+ function membershipStatusFromJSON(object) {
144
+ switch (object) {
145
+ case 0:
146
+ case "MEMBERSHIP_STATUS_UNSPECIFIED":
147
+ return MembershipStatus.MEMBERSHIP_STATUS_UNSPECIFIED;
148
+ case 1:
149
+ case "MEMBERSHIP_STATUS_ACTIVE":
150
+ return MembershipStatus.MEMBERSHIP_STATUS_ACTIVE;
151
+ case 2:
152
+ case "MEMBERSHIP_STATUS_INVITED":
153
+ return MembershipStatus.MEMBERSHIP_STATUS_INVITED;
154
+ case 3:
155
+ case "MEMBERSHIP_STATUS_SUSPENDED":
156
+ return MembershipStatus.MEMBERSHIP_STATUS_SUSPENDED;
157
+ case 4:
158
+ case "MEMBERSHIP_STATUS_DEPROVISIONED":
159
+ return MembershipStatus.MEMBERSHIP_STATUS_DEPROVISIONED;
160
+ case -1:
161
+ case "UNRECOGNIZED":
162
+ default:
163
+ return MembershipStatus.UNRECOGNIZED;
164
+ }
165
+ }
166
+ function membershipStatusToJSON(object) {
167
+ switch (object) {
168
+ case MembershipStatus.MEMBERSHIP_STATUS_UNSPECIFIED:
169
+ return "MEMBERSHIP_STATUS_UNSPECIFIED";
170
+ case MembershipStatus.MEMBERSHIP_STATUS_ACTIVE:
171
+ return "MEMBERSHIP_STATUS_ACTIVE";
172
+ case MembershipStatus.MEMBERSHIP_STATUS_INVITED:
173
+ return "MEMBERSHIP_STATUS_INVITED";
174
+ case MembershipStatus.MEMBERSHIP_STATUS_SUSPENDED:
175
+ return "MEMBERSHIP_STATUS_SUSPENDED";
176
+ case MembershipStatus.MEMBERSHIP_STATUS_DEPROVISIONED:
177
+ return "MEMBERSHIP_STATUS_DEPROVISIONED";
178
+ case MembershipStatus.UNRECOGNIZED:
179
+ default:
180
+ return "UNRECOGNIZED";
181
+ }
182
+ }
183
+ var OrganizationKind;
184
+ (function (OrganizationKind) {
185
+ OrganizationKind[OrganizationKind["ORGANIZATION_KIND_UNSPECIFIED"] = 0] = "ORGANIZATION_KIND_UNSPECIFIED";
186
+ OrganizationKind[OrganizationKind["ORGANIZATION_KIND_CUSTOMER"] = 1] = "ORGANIZATION_KIND_CUSTOMER";
187
+ OrganizationKind[OrganizationKind["ORGANIZATION_KIND_WEAVE_INTERNAL"] = 2] = "ORGANIZATION_KIND_WEAVE_INTERNAL";
188
+ OrganizationKind[OrganizationKind["ORGANIZATION_KIND_SANDBOX"] = 3] = "ORGANIZATION_KIND_SANDBOX";
189
+ OrganizationKind[OrganizationKind["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
190
+ })(OrganizationKind || (exports.OrganizationKind = OrganizationKind = {}));
191
+ function organizationKindFromJSON(object) {
192
+ switch (object) {
193
+ case 0:
194
+ case "ORGANIZATION_KIND_UNSPECIFIED":
195
+ return OrganizationKind.ORGANIZATION_KIND_UNSPECIFIED;
196
+ case 1:
197
+ case "ORGANIZATION_KIND_CUSTOMER":
198
+ return OrganizationKind.ORGANIZATION_KIND_CUSTOMER;
199
+ case 2:
200
+ case "ORGANIZATION_KIND_WEAVE_INTERNAL":
201
+ return OrganizationKind.ORGANIZATION_KIND_WEAVE_INTERNAL;
202
+ case 3:
203
+ case "ORGANIZATION_KIND_SANDBOX":
204
+ return OrganizationKind.ORGANIZATION_KIND_SANDBOX;
205
+ case -1:
206
+ case "UNRECOGNIZED":
207
+ default:
208
+ return OrganizationKind.UNRECOGNIZED;
209
+ }
210
+ }
211
+ function organizationKindToJSON(object) {
212
+ switch (object) {
213
+ case OrganizationKind.ORGANIZATION_KIND_UNSPECIFIED:
214
+ return "ORGANIZATION_KIND_UNSPECIFIED";
215
+ case OrganizationKind.ORGANIZATION_KIND_CUSTOMER:
216
+ return "ORGANIZATION_KIND_CUSTOMER";
217
+ case OrganizationKind.ORGANIZATION_KIND_WEAVE_INTERNAL:
218
+ return "ORGANIZATION_KIND_WEAVE_INTERNAL";
219
+ case OrganizationKind.ORGANIZATION_KIND_SANDBOX:
220
+ return "ORGANIZATION_KIND_SANDBOX";
221
+ case OrganizationKind.UNRECOGNIZED:
222
+ default:
223
+ return "UNRECOGNIZED";
224
+ }
225
+ }
226
+ var SsoConnectionType;
227
+ (function (SsoConnectionType) {
228
+ SsoConnectionType[SsoConnectionType["SSO_CONNECTION_TYPE_UNSPECIFIED"] = 0] = "SSO_CONNECTION_TYPE_UNSPECIFIED";
229
+ SsoConnectionType[SsoConnectionType["SSO_CONNECTION_TYPE_SAML"] = 1] = "SSO_CONNECTION_TYPE_SAML";
230
+ SsoConnectionType[SsoConnectionType["SSO_CONNECTION_TYPE_OIDC"] = 2] = "SSO_CONNECTION_TYPE_OIDC";
231
+ SsoConnectionType[SsoConnectionType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
232
+ })(SsoConnectionType || (exports.SsoConnectionType = SsoConnectionType = {}));
233
+ function ssoConnectionTypeFromJSON(object) {
234
+ switch (object) {
235
+ case 0:
236
+ case "SSO_CONNECTION_TYPE_UNSPECIFIED":
237
+ return SsoConnectionType.SSO_CONNECTION_TYPE_UNSPECIFIED;
238
+ case 1:
239
+ case "SSO_CONNECTION_TYPE_SAML":
240
+ return SsoConnectionType.SSO_CONNECTION_TYPE_SAML;
241
+ case 2:
242
+ case "SSO_CONNECTION_TYPE_OIDC":
243
+ return SsoConnectionType.SSO_CONNECTION_TYPE_OIDC;
244
+ case -1:
245
+ case "UNRECOGNIZED":
246
+ default:
247
+ return SsoConnectionType.UNRECOGNIZED;
248
+ }
249
+ }
250
+ function ssoConnectionTypeToJSON(object) {
251
+ switch (object) {
252
+ case SsoConnectionType.SSO_CONNECTION_TYPE_UNSPECIFIED:
253
+ return "SSO_CONNECTION_TYPE_UNSPECIFIED";
254
+ case SsoConnectionType.SSO_CONNECTION_TYPE_SAML:
255
+ return "SSO_CONNECTION_TYPE_SAML";
256
+ case SsoConnectionType.SSO_CONNECTION_TYPE_OIDC:
257
+ return "SSO_CONNECTION_TYPE_OIDC";
258
+ case SsoConnectionType.UNRECOGNIZED:
259
+ default:
260
+ return "UNRECOGNIZED";
261
+ }
262
+ }
263
+ var SsoConnectionStatus;
264
+ (function (SsoConnectionStatus) {
265
+ SsoConnectionStatus[SsoConnectionStatus["SSO_CONNECTION_STATUS_UNSPECIFIED"] = 0] = "SSO_CONNECTION_STATUS_UNSPECIFIED";
266
+ SsoConnectionStatus[SsoConnectionStatus["SSO_CONNECTION_STATUS_DRAFT"] = 1] = "SSO_CONNECTION_STATUS_DRAFT";
267
+ SsoConnectionStatus[SsoConnectionStatus["SSO_CONNECTION_STATUS_ACTIVE"] = 2] = "SSO_CONNECTION_STATUS_ACTIVE";
268
+ SsoConnectionStatus[SsoConnectionStatus["SSO_CONNECTION_STATUS_DISABLED"] = 3] = "SSO_CONNECTION_STATUS_DISABLED";
269
+ SsoConnectionStatus[SsoConnectionStatus["SSO_CONNECTION_STATUS_ERROR"] = 4] = "SSO_CONNECTION_STATUS_ERROR";
270
+ SsoConnectionStatus[SsoConnectionStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
271
+ })(SsoConnectionStatus || (exports.SsoConnectionStatus = SsoConnectionStatus = {}));
272
+ function ssoConnectionStatusFromJSON(object) {
273
+ switch (object) {
274
+ case 0:
275
+ case "SSO_CONNECTION_STATUS_UNSPECIFIED":
276
+ return SsoConnectionStatus.SSO_CONNECTION_STATUS_UNSPECIFIED;
277
+ case 1:
278
+ case "SSO_CONNECTION_STATUS_DRAFT":
279
+ return SsoConnectionStatus.SSO_CONNECTION_STATUS_DRAFT;
280
+ case 2:
281
+ case "SSO_CONNECTION_STATUS_ACTIVE":
282
+ return SsoConnectionStatus.SSO_CONNECTION_STATUS_ACTIVE;
283
+ case 3:
284
+ case "SSO_CONNECTION_STATUS_DISABLED":
285
+ return SsoConnectionStatus.SSO_CONNECTION_STATUS_DISABLED;
286
+ case 4:
287
+ case "SSO_CONNECTION_STATUS_ERROR":
288
+ return SsoConnectionStatus.SSO_CONNECTION_STATUS_ERROR;
289
+ case -1:
290
+ case "UNRECOGNIZED":
291
+ default:
292
+ return SsoConnectionStatus.UNRECOGNIZED;
293
+ }
294
+ }
295
+ function ssoConnectionStatusToJSON(object) {
296
+ switch (object) {
297
+ case SsoConnectionStatus.SSO_CONNECTION_STATUS_UNSPECIFIED:
298
+ return "SSO_CONNECTION_STATUS_UNSPECIFIED";
299
+ case SsoConnectionStatus.SSO_CONNECTION_STATUS_DRAFT:
300
+ return "SSO_CONNECTION_STATUS_DRAFT";
301
+ case SsoConnectionStatus.SSO_CONNECTION_STATUS_ACTIVE:
302
+ return "SSO_CONNECTION_STATUS_ACTIVE";
303
+ case SsoConnectionStatus.SSO_CONNECTION_STATUS_DISABLED:
304
+ return "SSO_CONNECTION_STATUS_DISABLED";
305
+ case SsoConnectionStatus.SSO_CONNECTION_STATUS_ERROR:
306
+ return "SSO_CONNECTION_STATUS_ERROR";
307
+ case SsoConnectionStatus.UNRECOGNIZED:
308
+ default:
309
+ return "UNRECOGNIZED";
310
+ }
311
+ }
312
+ var ScimConnectionStatus;
313
+ (function (ScimConnectionStatus) {
314
+ ScimConnectionStatus[ScimConnectionStatus["SCIM_CONNECTION_STATUS_UNSPECIFIED"] = 0] = "SCIM_CONNECTION_STATUS_UNSPECIFIED";
315
+ ScimConnectionStatus[ScimConnectionStatus["SCIM_CONNECTION_STATUS_NOT_CONFIGURED"] = 1] = "SCIM_CONNECTION_STATUS_NOT_CONFIGURED";
316
+ ScimConnectionStatus[ScimConnectionStatus["SCIM_CONNECTION_STATUS_ACTIVE"] = 2] = "SCIM_CONNECTION_STATUS_ACTIVE";
317
+ ScimConnectionStatus[ScimConnectionStatus["SCIM_CONNECTION_STATUS_DISABLED"] = 3] = "SCIM_CONNECTION_STATUS_DISABLED";
318
+ ScimConnectionStatus[ScimConnectionStatus["SCIM_CONNECTION_STATUS_TOKEN_ROTATION_PENDING"] = 4] = "SCIM_CONNECTION_STATUS_TOKEN_ROTATION_PENDING";
319
+ ScimConnectionStatus[ScimConnectionStatus["SCIM_CONNECTION_STATUS_ERROR"] = 5] = "SCIM_CONNECTION_STATUS_ERROR";
320
+ ScimConnectionStatus[ScimConnectionStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
321
+ })(ScimConnectionStatus || (exports.ScimConnectionStatus = ScimConnectionStatus = {}));
322
+ function scimConnectionStatusFromJSON(object) {
323
+ switch (object) {
324
+ case 0:
325
+ case "SCIM_CONNECTION_STATUS_UNSPECIFIED":
326
+ return ScimConnectionStatus.SCIM_CONNECTION_STATUS_UNSPECIFIED;
327
+ case 1:
328
+ case "SCIM_CONNECTION_STATUS_NOT_CONFIGURED":
329
+ return ScimConnectionStatus.SCIM_CONNECTION_STATUS_NOT_CONFIGURED;
330
+ case 2:
331
+ case "SCIM_CONNECTION_STATUS_ACTIVE":
332
+ return ScimConnectionStatus.SCIM_CONNECTION_STATUS_ACTIVE;
333
+ case 3:
334
+ case "SCIM_CONNECTION_STATUS_DISABLED":
335
+ return ScimConnectionStatus.SCIM_CONNECTION_STATUS_DISABLED;
336
+ case 4:
337
+ case "SCIM_CONNECTION_STATUS_TOKEN_ROTATION_PENDING":
338
+ return ScimConnectionStatus.SCIM_CONNECTION_STATUS_TOKEN_ROTATION_PENDING;
339
+ case 5:
340
+ case "SCIM_CONNECTION_STATUS_ERROR":
341
+ return ScimConnectionStatus.SCIM_CONNECTION_STATUS_ERROR;
342
+ case -1:
343
+ case "UNRECOGNIZED":
344
+ default:
345
+ return ScimConnectionStatus.UNRECOGNIZED;
346
+ }
347
+ }
348
+ function scimConnectionStatusToJSON(object) {
349
+ switch (object) {
350
+ case ScimConnectionStatus.SCIM_CONNECTION_STATUS_UNSPECIFIED:
351
+ return "SCIM_CONNECTION_STATUS_UNSPECIFIED";
352
+ case ScimConnectionStatus.SCIM_CONNECTION_STATUS_NOT_CONFIGURED:
353
+ return "SCIM_CONNECTION_STATUS_NOT_CONFIGURED";
354
+ case ScimConnectionStatus.SCIM_CONNECTION_STATUS_ACTIVE:
355
+ return "SCIM_CONNECTION_STATUS_ACTIVE";
356
+ case ScimConnectionStatus.SCIM_CONNECTION_STATUS_DISABLED:
357
+ return "SCIM_CONNECTION_STATUS_DISABLED";
358
+ case ScimConnectionStatus.SCIM_CONNECTION_STATUS_TOKEN_ROTATION_PENDING:
359
+ return "SCIM_CONNECTION_STATUS_TOKEN_ROTATION_PENDING";
360
+ case ScimConnectionStatus.SCIM_CONNECTION_STATUS_ERROR:
361
+ return "SCIM_CONNECTION_STATUS_ERROR";
362
+ case ScimConnectionStatus.UNRECOGNIZED:
363
+ default:
364
+ return "UNRECOGNIZED";
365
+ }
366
+ }
367
+ var AuthProvider;
368
+ (function (AuthProvider) {
369
+ AuthProvider[AuthProvider["AUTH_PROVIDER_UNSPECIFIED"] = 0] = "AUTH_PROVIDER_UNSPECIFIED";
370
+ AuthProvider[AuthProvider["AUTH_PROVIDER_GOOGLE"] = 1] = "AUTH_PROVIDER_GOOGLE";
371
+ AuthProvider[AuthProvider["AUTH_PROVIDER_MICROSOFT"] = 2] = "AUTH_PROVIDER_MICROSOFT";
372
+ AuthProvider[AuthProvider["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
373
+ })(AuthProvider || (exports.AuthProvider = AuthProvider = {}));
374
+ function authProviderFromJSON(object) {
375
+ switch (object) {
376
+ case 0:
377
+ case "AUTH_PROVIDER_UNSPECIFIED":
378
+ return AuthProvider.AUTH_PROVIDER_UNSPECIFIED;
379
+ case 1:
380
+ case "AUTH_PROVIDER_GOOGLE":
381
+ return AuthProvider.AUTH_PROVIDER_GOOGLE;
382
+ case 2:
383
+ case "AUTH_PROVIDER_MICROSOFT":
384
+ return AuthProvider.AUTH_PROVIDER_MICROSOFT;
385
+ case -1:
386
+ case "UNRECOGNIZED":
387
+ default:
388
+ return AuthProvider.UNRECOGNIZED;
389
+ }
390
+ }
391
+ function authProviderToJSON(object) {
392
+ switch (object) {
393
+ case AuthProvider.AUTH_PROVIDER_UNSPECIFIED:
394
+ return "AUTH_PROVIDER_UNSPECIFIED";
395
+ case AuthProvider.AUTH_PROVIDER_GOOGLE:
396
+ return "AUTH_PROVIDER_GOOGLE";
397
+ case AuthProvider.AUTH_PROVIDER_MICROSOFT:
398
+ return "AUTH_PROVIDER_MICROSOFT";
399
+ case AuthProvider.UNRECOGNIZED:
400
+ default:
401
+ return "UNRECOGNIZED";
402
+ }
403
+ }
404
+ function createBaseAuthSession() {
405
+ return {
406
+ sessionId: "",
407
+ user: undefined,
408
+ activeOrganization: undefined,
409
+ roleIds: [],
410
+ allowedActions: [],
411
+ platformAdmin: false,
412
+ expiresAt: undefined,
413
+ };
414
+ }
415
+ exports.AuthSession = {
416
+ encode(message, writer = new wire_1.BinaryWriter()) {
417
+ if (message.sessionId !== "") {
418
+ writer.uint32(10).string(message.sessionId);
419
+ }
420
+ if (message.user !== undefined) {
421
+ exports.AuthUser.encode(message.user, writer.uint32(18).fork()).join();
422
+ }
423
+ if (message.activeOrganization !== undefined) {
424
+ exports.AuthOrganization.encode(message.activeOrganization, writer.uint32(26).fork()).join();
425
+ }
426
+ for (const v of message.roleIds) {
427
+ writer.uint32(34).string(v);
428
+ }
429
+ for (const v of message.allowedActions) {
430
+ writer.uint32(42).string(v);
431
+ }
432
+ if (message.platformAdmin !== false) {
433
+ writer.uint32(48).bool(message.platformAdmin);
434
+ }
435
+ if (message.expiresAt !== undefined) {
436
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.expiresAt), writer.uint32(58).fork()).join();
437
+ }
438
+ return writer;
439
+ },
440
+ decode(input, length) {
441
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
442
+ const end = length === undefined ? reader.len : reader.pos + length;
443
+ const message = createBaseAuthSession();
444
+ while (reader.pos < end) {
445
+ const tag = reader.uint32();
446
+ switch (tag >>> 3) {
447
+ case 1: {
448
+ if (tag !== 10) {
449
+ break;
450
+ }
451
+ message.sessionId = reader.string();
452
+ continue;
453
+ }
454
+ case 2: {
455
+ if (tag !== 18) {
456
+ break;
457
+ }
458
+ message.user = exports.AuthUser.decode(reader, reader.uint32());
459
+ continue;
460
+ }
461
+ case 3: {
462
+ if (tag !== 26) {
463
+ break;
464
+ }
465
+ message.activeOrganization = exports.AuthOrganization.decode(reader, reader.uint32());
466
+ continue;
467
+ }
468
+ case 4: {
469
+ if (tag !== 34) {
470
+ break;
471
+ }
472
+ message.roleIds.push(reader.string());
473
+ continue;
474
+ }
475
+ case 5: {
476
+ if (tag !== 42) {
477
+ break;
478
+ }
479
+ message.allowedActions.push(reader.string());
480
+ continue;
481
+ }
482
+ case 6: {
483
+ if (tag !== 48) {
484
+ break;
485
+ }
486
+ message.platformAdmin = reader.bool();
487
+ continue;
488
+ }
489
+ case 7: {
490
+ if (tag !== 58) {
491
+ break;
492
+ }
493
+ message.expiresAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
494
+ continue;
495
+ }
496
+ }
497
+ if ((tag & 7) === 4 || tag === 0) {
498
+ break;
499
+ }
500
+ reader.skip(tag & 7);
501
+ }
502
+ return message;
503
+ },
504
+ fromJSON(object) {
505
+ return {
506
+ sessionId: isSet(object.sessionId)
507
+ ? globalThis.String(object.sessionId)
508
+ : isSet(object.session_id)
509
+ ? globalThis.String(object.session_id)
510
+ : "",
511
+ user: isSet(object.user) ? exports.AuthUser.fromJSON(object.user) : undefined,
512
+ activeOrganization: isSet(object.activeOrganization)
513
+ ? exports.AuthOrganization.fromJSON(object.activeOrganization)
514
+ : isSet(object.active_organization)
515
+ ? exports.AuthOrganization.fromJSON(object.active_organization)
516
+ : undefined,
517
+ roleIds: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.roleIds)
518
+ ? object.roleIds.map((e) => globalThis.String(e))
519
+ : globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.role_ids)
520
+ ? object.role_ids.map((e) => globalThis.String(e))
521
+ : [],
522
+ allowedActions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.allowedActions)
523
+ ? object.allowedActions.map((e) => globalThis.String(e))
524
+ : globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.allowed_actions)
525
+ ? object.allowed_actions.map((e) => globalThis.String(e))
526
+ : [],
527
+ platformAdmin: isSet(object.platformAdmin)
528
+ ? globalThis.Boolean(object.platformAdmin)
529
+ : isSet(object.platform_admin)
530
+ ? globalThis.Boolean(object.platform_admin)
531
+ : false,
532
+ expiresAt: isSet(object.expiresAt)
533
+ ? fromJsonTimestamp(object.expiresAt)
534
+ : isSet(object.expires_at)
535
+ ? fromJsonTimestamp(object.expires_at)
536
+ : undefined,
537
+ };
538
+ },
539
+ toJSON(message) {
540
+ var _a, _b;
541
+ const obj = {};
542
+ if (message.sessionId !== "") {
543
+ obj.sessionId = message.sessionId;
544
+ }
545
+ if (message.user !== undefined) {
546
+ obj.user = exports.AuthUser.toJSON(message.user);
547
+ }
548
+ if (message.activeOrganization !== undefined) {
549
+ obj.activeOrganization = exports.AuthOrganization.toJSON(message.activeOrganization);
550
+ }
551
+ if ((_a = message.roleIds) === null || _a === void 0 ? void 0 : _a.length) {
552
+ obj.roleIds = message.roleIds;
553
+ }
554
+ if ((_b = message.allowedActions) === null || _b === void 0 ? void 0 : _b.length) {
555
+ obj.allowedActions = message.allowedActions;
556
+ }
557
+ if (message.platformAdmin !== false) {
558
+ obj.platformAdmin = message.platformAdmin;
559
+ }
560
+ if (message.expiresAt !== undefined) {
561
+ obj.expiresAt = message.expiresAt.toISOString();
562
+ }
563
+ return obj;
564
+ },
565
+ create(base) {
566
+ return exports.AuthSession.fromPartial(base !== null && base !== void 0 ? base : {});
567
+ },
568
+ fromPartial(object) {
569
+ var _a, _b;
570
+ var _c, _d, _e;
571
+ const message = createBaseAuthSession();
572
+ message.sessionId = (_c = object.sessionId) !== null && _c !== void 0 ? _c : "";
573
+ message.user = (object.user !== undefined && object.user !== null) ? exports.AuthUser.fromPartial(object.user) : undefined;
574
+ message.activeOrganization = (object.activeOrganization !== undefined && object.activeOrganization !== null)
575
+ ? exports.AuthOrganization.fromPartial(object.activeOrganization)
576
+ : undefined;
577
+ message.roleIds = ((_a = object.roleIds) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
578
+ message.allowedActions = ((_b = object.allowedActions) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
579
+ message.platformAdmin = (_d = object.platformAdmin) !== null && _d !== void 0 ? _d : false;
580
+ message.expiresAt = (_e = object.expiresAt) !== null && _e !== void 0 ? _e : undefined;
581
+ return message;
582
+ },
583
+ };
584
+ function createBaseAuthUser() {
585
+ return { id: "", displayName: "", email: "", avatarUrl: "", jobTitle: "", theme: "" };
586
+ }
587
+ exports.AuthUser = {
588
+ encode(message, writer = new wire_1.BinaryWriter()) {
589
+ if (message.id !== "") {
590
+ writer.uint32(10).string(message.id);
591
+ }
592
+ if (message.displayName !== "") {
593
+ writer.uint32(18).string(message.displayName);
594
+ }
595
+ if (message.email !== "") {
596
+ writer.uint32(26).string(message.email);
597
+ }
598
+ if (message.avatarUrl !== "") {
599
+ writer.uint32(34).string(message.avatarUrl);
600
+ }
601
+ if (message.jobTitle !== "") {
602
+ writer.uint32(42).string(message.jobTitle);
603
+ }
604
+ if (message.theme !== "") {
605
+ writer.uint32(50).string(message.theme);
606
+ }
607
+ return writer;
608
+ },
609
+ decode(input, length) {
610
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
611
+ const end = length === undefined ? reader.len : reader.pos + length;
612
+ const message = createBaseAuthUser();
613
+ while (reader.pos < end) {
614
+ const tag = reader.uint32();
615
+ switch (tag >>> 3) {
616
+ case 1: {
617
+ if (tag !== 10) {
618
+ break;
619
+ }
620
+ message.id = reader.string();
621
+ continue;
622
+ }
623
+ case 2: {
624
+ if (tag !== 18) {
625
+ break;
626
+ }
627
+ message.displayName = reader.string();
628
+ continue;
629
+ }
630
+ case 3: {
631
+ if (tag !== 26) {
632
+ break;
633
+ }
634
+ message.email = reader.string();
635
+ continue;
636
+ }
637
+ case 4: {
638
+ if (tag !== 34) {
639
+ break;
640
+ }
641
+ message.avatarUrl = reader.string();
642
+ continue;
643
+ }
644
+ case 5: {
645
+ if (tag !== 42) {
646
+ break;
647
+ }
648
+ message.jobTitle = reader.string();
649
+ continue;
650
+ }
651
+ case 6: {
652
+ if (tag !== 50) {
653
+ break;
654
+ }
655
+ message.theme = reader.string();
656
+ continue;
657
+ }
658
+ }
659
+ if ((tag & 7) === 4 || tag === 0) {
660
+ break;
661
+ }
662
+ reader.skip(tag & 7);
663
+ }
664
+ return message;
665
+ },
666
+ fromJSON(object) {
667
+ return {
668
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
669
+ displayName: isSet(object.displayName)
670
+ ? globalThis.String(object.displayName)
671
+ : isSet(object.display_name)
672
+ ? globalThis.String(object.display_name)
673
+ : "",
674
+ email: isSet(object.email) ? globalThis.String(object.email) : "",
675
+ avatarUrl: isSet(object.avatarUrl)
676
+ ? globalThis.String(object.avatarUrl)
677
+ : isSet(object.avatar_url)
678
+ ? globalThis.String(object.avatar_url)
679
+ : "",
680
+ jobTitle: isSet(object.jobTitle)
681
+ ? globalThis.String(object.jobTitle)
682
+ : isSet(object.job_title)
683
+ ? globalThis.String(object.job_title)
684
+ : "",
685
+ theme: isSet(object.theme) ? globalThis.String(object.theme) : "",
686
+ };
687
+ },
688
+ toJSON(message) {
689
+ const obj = {};
690
+ if (message.id !== "") {
691
+ obj.id = message.id;
692
+ }
693
+ if (message.displayName !== "") {
694
+ obj.displayName = message.displayName;
695
+ }
696
+ if (message.email !== "") {
697
+ obj.email = message.email;
698
+ }
699
+ if (message.avatarUrl !== "") {
700
+ obj.avatarUrl = message.avatarUrl;
701
+ }
702
+ if (message.jobTitle !== "") {
703
+ obj.jobTitle = message.jobTitle;
704
+ }
705
+ if (message.theme !== "") {
706
+ obj.theme = message.theme;
707
+ }
708
+ return obj;
709
+ },
710
+ create(base) {
711
+ return exports.AuthUser.fromPartial(base !== null && base !== void 0 ? base : {});
712
+ },
713
+ fromPartial(object) {
714
+ var _a, _b, _c, _d, _e, _f;
715
+ const message = createBaseAuthUser();
716
+ message.id = (_a = object.id) !== null && _a !== void 0 ? _a : "";
717
+ message.displayName = (_b = object.displayName) !== null && _b !== void 0 ? _b : "";
718
+ message.email = (_c = object.email) !== null && _c !== void 0 ? _c : "";
719
+ message.avatarUrl = (_d = object.avatarUrl) !== null && _d !== void 0 ? _d : "";
720
+ message.jobTitle = (_e = object.jobTitle) !== null && _e !== void 0 ? _e : "";
721
+ message.theme = (_f = object.theme) !== null && _f !== void 0 ? _f : "";
722
+ return message;
723
+ },
724
+ };
725
+ function createBaseAuthOrganization() {
726
+ return { id: "", slug: "", name: "", kind: 0, stytchOrganizationId: "", roleIds: [], membershipStatus: 0 };
727
+ }
728
+ exports.AuthOrganization = {
729
+ encode(message, writer = new wire_1.BinaryWriter()) {
730
+ if (message.id !== "") {
731
+ writer.uint32(10).string(message.id);
732
+ }
733
+ if (message.slug !== "") {
734
+ writer.uint32(18).string(message.slug);
735
+ }
736
+ if (message.name !== "") {
737
+ writer.uint32(26).string(message.name);
738
+ }
739
+ if (message.kind !== 0) {
740
+ writer.uint32(32).int32(message.kind);
741
+ }
742
+ if (message.stytchOrganizationId !== "") {
743
+ writer.uint32(42).string(message.stytchOrganizationId);
744
+ }
745
+ for (const v of message.roleIds) {
746
+ writer.uint32(50).string(v);
747
+ }
748
+ if (message.membershipStatus !== 0) {
749
+ writer.uint32(56).int32(message.membershipStatus);
750
+ }
751
+ return writer;
752
+ },
753
+ decode(input, length) {
754
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
755
+ const end = length === undefined ? reader.len : reader.pos + length;
756
+ const message = createBaseAuthOrganization();
757
+ while (reader.pos < end) {
758
+ const tag = reader.uint32();
759
+ switch (tag >>> 3) {
760
+ case 1: {
761
+ if (tag !== 10) {
762
+ break;
763
+ }
764
+ message.id = reader.string();
765
+ continue;
766
+ }
767
+ case 2: {
768
+ if (tag !== 18) {
769
+ break;
770
+ }
771
+ message.slug = reader.string();
772
+ continue;
773
+ }
774
+ case 3: {
775
+ if (tag !== 26) {
776
+ break;
777
+ }
778
+ message.name = reader.string();
779
+ continue;
780
+ }
781
+ case 4: {
782
+ if (tag !== 32) {
783
+ break;
784
+ }
785
+ message.kind = reader.int32();
786
+ continue;
787
+ }
788
+ case 5: {
789
+ if (tag !== 42) {
790
+ break;
791
+ }
792
+ message.stytchOrganizationId = reader.string();
793
+ continue;
794
+ }
795
+ case 6: {
796
+ if (tag !== 50) {
797
+ break;
798
+ }
799
+ message.roleIds.push(reader.string());
800
+ continue;
801
+ }
802
+ case 7: {
803
+ if (tag !== 56) {
804
+ break;
805
+ }
806
+ message.membershipStatus = reader.int32();
807
+ continue;
808
+ }
809
+ }
810
+ if ((tag & 7) === 4 || tag === 0) {
811
+ break;
812
+ }
813
+ reader.skip(tag & 7);
814
+ }
815
+ return message;
816
+ },
817
+ fromJSON(object) {
818
+ return {
819
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
820
+ slug: isSet(object.slug) ? globalThis.String(object.slug) : "",
821
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
822
+ kind: isSet(object.kind) ? organizationKindFromJSON(object.kind) : 0,
823
+ stytchOrganizationId: isSet(object.stytchOrganizationId)
824
+ ? globalThis.String(object.stytchOrganizationId)
825
+ : isSet(object.stytch_organization_id)
826
+ ? globalThis.String(object.stytch_organization_id)
827
+ : "",
828
+ roleIds: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.roleIds)
829
+ ? object.roleIds.map((e) => globalThis.String(e))
830
+ : globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.role_ids)
831
+ ? object.role_ids.map((e) => globalThis.String(e))
832
+ : [],
833
+ membershipStatus: isSet(object.membershipStatus)
834
+ ? membershipStatusFromJSON(object.membershipStatus)
835
+ : isSet(object.membership_status)
836
+ ? membershipStatusFromJSON(object.membership_status)
837
+ : 0,
838
+ };
839
+ },
840
+ toJSON(message) {
841
+ var _a;
842
+ const obj = {};
843
+ if (message.id !== "") {
844
+ obj.id = message.id;
845
+ }
846
+ if (message.slug !== "") {
847
+ obj.slug = message.slug;
848
+ }
849
+ if (message.name !== "") {
850
+ obj.name = message.name;
851
+ }
852
+ if (message.kind !== 0) {
853
+ obj.kind = organizationKindToJSON(message.kind);
854
+ }
855
+ if (message.stytchOrganizationId !== "") {
856
+ obj.stytchOrganizationId = message.stytchOrganizationId;
857
+ }
858
+ if ((_a = message.roleIds) === null || _a === void 0 ? void 0 : _a.length) {
859
+ obj.roleIds = message.roleIds;
860
+ }
861
+ if (message.membershipStatus !== 0) {
862
+ obj.membershipStatus = membershipStatusToJSON(message.membershipStatus);
863
+ }
864
+ return obj;
865
+ },
866
+ create(base) {
867
+ return exports.AuthOrganization.fromPartial(base !== null && base !== void 0 ? base : {});
868
+ },
869
+ fromPartial(object) {
870
+ var _a;
871
+ var _b, _c, _d, _e, _f, _g;
872
+ const message = createBaseAuthOrganization();
873
+ message.id = (_b = object.id) !== null && _b !== void 0 ? _b : "";
874
+ message.slug = (_c = object.slug) !== null && _c !== void 0 ? _c : "";
875
+ message.name = (_d = object.name) !== null && _d !== void 0 ? _d : "";
876
+ message.kind = (_e = object.kind) !== null && _e !== void 0 ? _e : 0;
877
+ message.stytchOrganizationId = (_f = object.stytchOrganizationId) !== null && _f !== void 0 ? _f : "";
878
+ message.roleIds = ((_a = object.roleIds) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
879
+ message.membershipStatus = (_g = object.membershipStatus) !== null && _g !== void 0 ? _g : 0;
880
+ return message;
881
+ },
882
+ };
883
+ function createBaseDiscoveryOrganization() {
884
+ return {
885
+ organizationId: "",
886
+ organizationSlug: "",
887
+ organizationName: "",
888
+ stytchOrganizationId: "",
889
+ stytchOrganizationSlug: "",
890
+ organizationKind: 0,
891
+ status: 0,
892
+ domains: [],
893
+ roleIds: [],
894
+ };
895
+ }
896
+ exports.DiscoveryOrganization = {
897
+ encode(message, writer = new wire_1.BinaryWriter()) {
898
+ if (message.organizationId !== "") {
899
+ writer.uint32(10).string(message.organizationId);
900
+ }
901
+ if (message.organizationSlug !== "") {
902
+ writer.uint32(18).string(message.organizationSlug);
903
+ }
904
+ if (message.organizationName !== "") {
905
+ writer.uint32(26).string(message.organizationName);
906
+ }
907
+ if (message.stytchOrganizationId !== "") {
908
+ writer.uint32(34).string(message.stytchOrganizationId);
909
+ }
910
+ if (message.stytchOrganizationSlug !== "") {
911
+ writer.uint32(42).string(message.stytchOrganizationSlug);
912
+ }
913
+ if (message.organizationKind !== 0) {
914
+ writer.uint32(48).int32(message.organizationKind);
915
+ }
916
+ if (message.status !== 0) {
917
+ writer.uint32(56).int32(message.status);
918
+ }
919
+ for (const v of message.domains) {
920
+ writer.uint32(66).string(v);
921
+ }
922
+ for (const v of message.roleIds) {
923
+ writer.uint32(74).string(v);
924
+ }
925
+ return writer;
926
+ },
927
+ decode(input, length) {
928
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
929
+ const end = length === undefined ? reader.len : reader.pos + length;
930
+ const message = createBaseDiscoveryOrganization();
931
+ while (reader.pos < end) {
932
+ const tag = reader.uint32();
933
+ switch (tag >>> 3) {
934
+ case 1: {
935
+ if (tag !== 10) {
936
+ break;
937
+ }
938
+ message.organizationId = reader.string();
939
+ continue;
940
+ }
941
+ case 2: {
942
+ if (tag !== 18) {
943
+ break;
944
+ }
945
+ message.organizationSlug = reader.string();
946
+ continue;
947
+ }
948
+ case 3: {
949
+ if (tag !== 26) {
950
+ break;
951
+ }
952
+ message.organizationName = reader.string();
953
+ continue;
954
+ }
955
+ case 4: {
956
+ if (tag !== 34) {
957
+ break;
958
+ }
959
+ message.stytchOrganizationId = reader.string();
960
+ continue;
961
+ }
962
+ case 5: {
963
+ if (tag !== 42) {
964
+ break;
965
+ }
966
+ message.stytchOrganizationSlug = reader.string();
967
+ continue;
968
+ }
969
+ case 6: {
970
+ if (tag !== 48) {
971
+ break;
972
+ }
973
+ message.organizationKind = reader.int32();
974
+ continue;
975
+ }
976
+ case 7: {
977
+ if (tag !== 56) {
978
+ break;
979
+ }
980
+ message.status = reader.int32();
981
+ continue;
982
+ }
983
+ case 8: {
984
+ if (tag !== 66) {
985
+ break;
986
+ }
987
+ message.domains.push(reader.string());
988
+ continue;
989
+ }
990
+ case 9: {
991
+ if (tag !== 74) {
992
+ break;
993
+ }
994
+ message.roleIds.push(reader.string());
995
+ continue;
996
+ }
997
+ }
998
+ if ((tag & 7) === 4 || tag === 0) {
999
+ break;
1000
+ }
1001
+ reader.skip(tag & 7);
1002
+ }
1003
+ return message;
1004
+ },
1005
+ fromJSON(object) {
1006
+ return {
1007
+ organizationId: isSet(object.organizationId)
1008
+ ? globalThis.String(object.organizationId)
1009
+ : isSet(object.organization_id)
1010
+ ? globalThis.String(object.organization_id)
1011
+ : "",
1012
+ organizationSlug: isSet(object.organizationSlug)
1013
+ ? globalThis.String(object.organizationSlug)
1014
+ : isSet(object.organization_slug)
1015
+ ? globalThis.String(object.organization_slug)
1016
+ : "",
1017
+ organizationName: isSet(object.organizationName)
1018
+ ? globalThis.String(object.organizationName)
1019
+ : isSet(object.organization_name)
1020
+ ? globalThis.String(object.organization_name)
1021
+ : "",
1022
+ stytchOrganizationId: isSet(object.stytchOrganizationId)
1023
+ ? globalThis.String(object.stytchOrganizationId)
1024
+ : isSet(object.stytch_organization_id)
1025
+ ? globalThis.String(object.stytch_organization_id)
1026
+ : "",
1027
+ stytchOrganizationSlug: isSet(object.stytchOrganizationSlug)
1028
+ ? globalThis.String(object.stytchOrganizationSlug)
1029
+ : isSet(object.stytch_organization_slug)
1030
+ ? globalThis.String(object.stytch_organization_slug)
1031
+ : "",
1032
+ organizationKind: isSet(object.organizationKind)
1033
+ ? organizationKindFromJSON(object.organizationKind)
1034
+ : isSet(object.organization_kind)
1035
+ ? organizationKindFromJSON(object.organization_kind)
1036
+ : 0,
1037
+ status: isSet(object.status) ? discoveryOrganizationStatusFromJSON(object.status) : 0,
1038
+ domains: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.domains)
1039
+ ? object.domains.map((e) => globalThis.String(e))
1040
+ : [],
1041
+ roleIds: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.roleIds)
1042
+ ? object.roleIds.map((e) => globalThis.String(e))
1043
+ : globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.role_ids)
1044
+ ? object.role_ids.map((e) => globalThis.String(e))
1045
+ : [],
1046
+ };
1047
+ },
1048
+ toJSON(message) {
1049
+ var _a, _b;
1050
+ const obj = {};
1051
+ if (message.organizationId !== "") {
1052
+ obj.organizationId = message.organizationId;
1053
+ }
1054
+ if (message.organizationSlug !== "") {
1055
+ obj.organizationSlug = message.organizationSlug;
1056
+ }
1057
+ if (message.organizationName !== "") {
1058
+ obj.organizationName = message.organizationName;
1059
+ }
1060
+ if (message.stytchOrganizationId !== "") {
1061
+ obj.stytchOrganizationId = message.stytchOrganizationId;
1062
+ }
1063
+ if (message.stytchOrganizationSlug !== "") {
1064
+ obj.stytchOrganizationSlug = message.stytchOrganizationSlug;
1065
+ }
1066
+ if (message.organizationKind !== 0) {
1067
+ obj.organizationKind = organizationKindToJSON(message.organizationKind);
1068
+ }
1069
+ if (message.status !== 0) {
1070
+ obj.status = discoveryOrganizationStatusToJSON(message.status);
1071
+ }
1072
+ if ((_a = message.domains) === null || _a === void 0 ? void 0 : _a.length) {
1073
+ obj.domains = message.domains;
1074
+ }
1075
+ if ((_b = message.roleIds) === null || _b === void 0 ? void 0 : _b.length) {
1076
+ obj.roleIds = message.roleIds;
1077
+ }
1078
+ return obj;
1079
+ },
1080
+ create(base) {
1081
+ return exports.DiscoveryOrganization.fromPartial(base !== null && base !== void 0 ? base : {});
1082
+ },
1083
+ fromPartial(object) {
1084
+ var _a, _b;
1085
+ var _c, _d, _e, _f, _g, _h, _j;
1086
+ const message = createBaseDiscoveryOrganization();
1087
+ message.organizationId = (_c = object.organizationId) !== null && _c !== void 0 ? _c : "";
1088
+ message.organizationSlug = (_d = object.organizationSlug) !== null && _d !== void 0 ? _d : "";
1089
+ message.organizationName = (_e = object.organizationName) !== null && _e !== void 0 ? _e : "";
1090
+ message.stytchOrganizationId = (_f = object.stytchOrganizationId) !== null && _f !== void 0 ? _f : "";
1091
+ message.stytchOrganizationSlug = (_g = object.stytchOrganizationSlug) !== null && _g !== void 0 ? _g : "";
1092
+ message.organizationKind = (_h = object.organizationKind) !== null && _h !== void 0 ? _h : 0;
1093
+ message.status = (_j = object.status) !== null && _j !== void 0 ? _j : 0;
1094
+ message.domains = ((_a = object.domains) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
1095
+ message.roleIds = ((_b = object.roleIds) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
1096
+ return message;
1097
+ },
1098
+ };
1099
+ function createBaseUserProfile() {
1100
+ return {
1101
+ userId: "",
1102
+ displayName: "",
1103
+ jobTitle: "",
1104
+ email: "",
1105
+ avatarUrl: "",
1106
+ theme: "",
1107
+ emailManagedByProvider: false,
1108
+ createdAt: undefined,
1109
+ updatedAt: undefined,
1110
+ };
1111
+ }
1112
+ exports.UserProfile = {
1113
+ encode(message, writer = new wire_1.BinaryWriter()) {
1114
+ if (message.userId !== "") {
1115
+ writer.uint32(10).string(message.userId);
1116
+ }
1117
+ if (message.displayName !== "") {
1118
+ writer.uint32(18).string(message.displayName);
1119
+ }
1120
+ if (message.jobTitle !== "") {
1121
+ writer.uint32(26).string(message.jobTitle);
1122
+ }
1123
+ if (message.email !== "") {
1124
+ writer.uint32(34).string(message.email);
1125
+ }
1126
+ if (message.avatarUrl !== "") {
1127
+ writer.uint32(42).string(message.avatarUrl);
1128
+ }
1129
+ if (message.theme !== "") {
1130
+ writer.uint32(50).string(message.theme);
1131
+ }
1132
+ if (message.emailManagedByProvider !== false) {
1133
+ writer.uint32(56).bool(message.emailManagedByProvider);
1134
+ }
1135
+ if (message.createdAt !== undefined) {
1136
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(66).fork()).join();
1137
+ }
1138
+ if (message.updatedAt !== undefined) {
1139
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(74).fork()).join();
1140
+ }
1141
+ return writer;
1142
+ },
1143
+ decode(input, length) {
1144
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1145
+ const end = length === undefined ? reader.len : reader.pos + length;
1146
+ const message = createBaseUserProfile();
1147
+ while (reader.pos < end) {
1148
+ const tag = reader.uint32();
1149
+ switch (tag >>> 3) {
1150
+ case 1: {
1151
+ if (tag !== 10) {
1152
+ break;
1153
+ }
1154
+ message.userId = reader.string();
1155
+ continue;
1156
+ }
1157
+ case 2: {
1158
+ if (tag !== 18) {
1159
+ break;
1160
+ }
1161
+ message.displayName = reader.string();
1162
+ continue;
1163
+ }
1164
+ case 3: {
1165
+ if (tag !== 26) {
1166
+ break;
1167
+ }
1168
+ message.jobTitle = reader.string();
1169
+ continue;
1170
+ }
1171
+ case 4: {
1172
+ if (tag !== 34) {
1173
+ break;
1174
+ }
1175
+ message.email = reader.string();
1176
+ continue;
1177
+ }
1178
+ case 5: {
1179
+ if (tag !== 42) {
1180
+ break;
1181
+ }
1182
+ message.avatarUrl = reader.string();
1183
+ continue;
1184
+ }
1185
+ case 6: {
1186
+ if (tag !== 50) {
1187
+ break;
1188
+ }
1189
+ message.theme = reader.string();
1190
+ continue;
1191
+ }
1192
+ case 7: {
1193
+ if (tag !== 56) {
1194
+ break;
1195
+ }
1196
+ message.emailManagedByProvider = reader.bool();
1197
+ continue;
1198
+ }
1199
+ case 8: {
1200
+ if (tag !== 66) {
1201
+ break;
1202
+ }
1203
+ message.createdAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
1204
+ continue;
1205
+ }
1206
+ case 9: {
1207
+ if (tag !== 74) {
1208
+ break;
1209
+ }
1210
+ message.updatedAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
1211
+ continue;
1212
+ }
1213
+ }
1214
+ if ((tag & 7) === 4 || tag === 0) {
1215
+ break;
1216
+ }
1217
+ reader.skip(tag & 7);
1218
+ }
1219
+ return message;
1220
+ },
1221
+ fromJSON(object) {
1222
+ return {
1223
+ userId: isSet(object.userId)
1224
+ ? globalThis.String(object.userId)
1225
+ : isSet(object.user_id)
1226
+ ? globalThis.String(object.user_id)
1227
+ : "",
1228
+ displayName: isSet(object.displayName)
1229
+ ? globalThis.String(object.displayName)
1230
+ : isSet(object.display_name)
1231
+ ? globalThis.String(object.display_name)
1232
+ : "",
1233
+ jobTitle: isSet(object.jobTitle)
1234
+ ? globalThis.String(object.jobTitle)
1235
+ : isSet(object.job_title)
1236
+ ? globalThis.String(object.job_title)
1237
+ : "",
1238
+ email: isSet(object.email) ? globalThis.String(object.email) : "",
1239
+ avatarUrl: isSet(object.avatarUrl)
1240
+ ? globalThis.String(object.avatarUrl)
1241
+ : isSet(object.avatar_url)
1242
+ ? globalThis.String(object.avatar_url)
1243
+ : "",
1244
+ theme: isSet(object.theme) ? globalThis.String(object.theme) : "",
1245
+ emailManagedByProvider: isSet(object.emailManagedByProvider)
1246
+ ? globalThis.Boolean(object.emailManagedByProvider)
1247
+ : isSet(object.email_managed_by_provider)
1248
+ ? globalThis.Boolean(object.email_managed_by_provider)
1249
+ : false,
1250
+ createdAt: isSet(object.createdAt)
1251
+ ? fromJsonTimestamp(object.createdAt)
1252
+ : isSet(object.created_at)
1253
+ ? fromJsonTimestamp(object.created_at)
1254
+ : undefined,
1255
+ updatedAt: isSet(object.updatedAt)
1256
+ ? fromJsonTimestamp(object.updatedAt)
1257
+ : isSet(object.updated_at)
1258
+ ? fromJsonTimestamp(object.updated_at)
1259
+ : undefined,
1260
+ };
1261
+ },
1262
+ toJSON(message) {
1263
+ const obj = {};
1264
+ if (message.userId !== "") {
1265
+ obj.userId = message.userId;
1266
+ }
1267
+ if (message.displayName !== "") {
1268
+ obj.displayName = message.displayName;
1269
+ }
1270
+ if (message.jobTitle !== "") {
1271
+ obj.jobTitle = message.jobTitle;
1272
+ }
1273
+ if (message.email !== "") {
1274
+ obj.email = message.email;
1275
+ }
1276
+ if (message.avatarUrl !== "") {
1277
+ obj.avatarUrl = message.avatarUrl;
1278
+ }
1279
+ if (message.theme !== "") {
1280
+ obj.theme = message.theme;
1281
+ }
1282
+ if (message.emailManagedByProvider !== false) {
1283
+ obj.emailManagedByProvider = message.emailManagedByProvider;
1284
+ }
1285
+ if (message.createdAt !== undefined) {
1286
+ obj.createdAt = message.createdAt.toISOString();
1287
+ }
1288
+ if (message.updatedAt !== undefined) {
1289
+ obj.updatedAt = message.updatedAt.toISOString();
1290
+ }
1291
+ return obj;
1292
+ },
1293
+ create(base) {
1294
+ return exports.UserProfile.fromPartial(base !== null && base !== void 0 ? base : {});
1295
+ },
1296
+ fromPartial(object) {
1297
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1298
+ const message = createBaseUserProfile();
1299
+ message.userId = (_a = object.userId) !== null && _a !== void 0 ? _a : "";
1300
+ message.displayName = (_b = object.displayName) !== null && _b !== void 0 ? _b : "";
1301
+ message.jobTitle = (_c = object.jobTitle) !== null && _c !== void 0 ? _c : "";
1302
+ message.email = (_d = object.email) !== null && _d !== void 0 ? _d : "";
1303
+ message.avatarUrl = (_e = object.avatarUrl) !== null && _e !== void 0 ? _e : "";
1304
+ message.theme = (_f = object.theme) !== null && _f !== void 0 ? _f : "";
1305
+ message.emailManagedByProvider = (_g = object.emailManagedByProvider) !== null && _g !== void 0 ? _g : false;
1306
+ message.createdAt = (_h = object.createdAt) !== null && _h !== void 0 ? _h : undefined;
1307
+ message.updatedAt = (_j = object.updatedAt) !== null && _j !== void 0 ? _j : undefined;
1308
+ return message;
1309
+ },
1310
+ };
1311
+ function createBaseOrganizationAuthSettings() {
1312
+ return {
1313
+ organizationId: "",
1314
+ organizationSlug: "",
1315
+ stytchOrganizationId: "",
1316
+ stytchOrganizationSlug: "",
1317
+ organizationKind: 0,
1318
+ allowedAuthMethods: [],
1319
+ allowedDomains: [],
1320
+ jitProvisioningEnabled: false,
1321
+ passwordAuthEnabled: false,
1322
+ googleOauthEnabled: false,
1323
+ microsoftOauthEnabled: false,
1324
+ ssoRequired: false,
1325
+ scimEnabled: false,
1326
+ rbacPolicySummary: undefined,
1327
+ authPolicySummary: undefined,
1328
+ };
1329
+ }
1330
+ exports.OrganizationAuthSettings = {
1331
+ encode(message, writer = new wire_1.BinaryWriter()) {
1332
+ if (message.organizationId !== "") {
1333
+ writer.uint32(10).string(message.organizationId);
1334
+ }
1335
+ if (message.organizationSlug !== "") {
1336
+ writer.uint32(18).string(message.organizationSlug);
1337
+ }
1338
+ if (message.stytchOrganizationId !== "") {
1339
+ writer.uint32(26).string(message.stytchOrganizationId);
1340
+ }
1341
+ if (message.stytchOrganizationSlug !== "") {
1342
+ writer.uint32(34).string(message.stytchOrganizationSlug);
1343
+ }
1344
+ if (message.organizationKind !== 0) {
1345
+ writer.uint32(40).int32(message.organizationKind);
1346
+ }
1347
+ writer.uint32(50).fork();
1348
+ for (const v of message.allowedAuthMethods) {
1349
+ writer.int32(v);
1350
+ }
1351
+ writer.join();
1352
+ for (const v of message.allowedDomains) {
1353
+ writer.uint32(58).string(v);
1354
+ }
1355
+ if (message.jitProvisioningEnabled !== false) {
1356
+ writer.uint32(64).bool(message.jitProvisioningEnabled);
1357
+ }
1358
+ if (message.passwordAuthEnabled !== false) {
1359
+ writer.uint32(72).bool(message.passwordAuthEnabled);
1360
+ }
1361
+ if (message.googleOauthEnabled !== false) {
1362
+ writer.uint32(80).bool(message.googleOauthEnabled);
1363
+ }
1364
+ if (message.microsoftOauthEnabled !== false) {
1365
+ writer.uint32(88).bool(message.microsoftOauthEnabled);
1366
+ }
1367
+ if (message.ssoRequired !== false) {
1368
+ writer.uint32(96).bool(message.ssoRequired);
1369
+ }
1370
+ if (message.scimEnabled !== false) {
1371
+ writer.uint32(104).bool(message.scimEnabled);
1372
+ }
1373
+ if (message.rbacPolicySummary !== undefined) {
1374
+ exports.RbacPolicySummary.encode(message.rbacPolicySummary, writer.uint32(114).fork()).join();
1375
+ }
1376
+ if (message.authPolicySummary !== undefined) {
1377
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.authPolicySummary), writer.uint32(122).fork()).join();
1378
+ }
1379
+ return writer;
1380
+ },
1381
+ decode(input, length) {
1382
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1383
+ const end = length === undefined ? reader.len : reader.pos + length;
1384
+ const message = createBaseOrganizationAuthSettings();
1385
+ while (reader.pos < end) {
1386
+ const tag = reader.uint32();
1387
+ switch (tag >>> 3) {
1388
+ case 1: {
1389
+ if (tag !== 10) {
1390
+ break;
1391
+ }
1392
+ message.organizationId = reader.string();
1393
+ continue;
1394
+ }
1395
+ case 2: {
1396
+ if (tag !== 18) {
1397
+ break;
1398
+ }
1399
+ message.organizationSlug = reader.string();
1400
+ continue;
1401
+ }
1402
+ case 3: {
1403
+ if (tag !== 26) {
1404
+ break;
1405
+ }
1406
+ message.stytchOrganizationId = reader.string();
1407
+ continue;
1408
+ }
1409
+ case 4: {
1410
+ if (tag !== 34) {
1411
+ break;
1412
+ }
1413
+ message.stytchOrganizationSlug = reader.string();
1414
+ continue;
1415
+ }
1416
+ case 5: {
1417
+ if (tag !== 40) {
1418
+ break;
1419
+ }
1420
+ message.organizationKind = reader.int32();
1421
+ continue;
1422
+ }
1423
+ case 6: {
1424
+ if (tag === 48) {
1425
+ message.allowedAuthMethods.push(reader.int32());
1426
+ continue;
1427
+ }
1428
+ if (tag === 50) {
1429
+ const end2 = reader.uint32() + reader.pos;
1430
+ while (reader.pos < end2) {
1431
+ message.allowedAuthMethods.push(reader.int32());
1432
+ }
1433
+ continue;
1434
+ }
1435
+ break;
1436
+ }
1437
+ case 7: {
1438
+ if (tag !== 58) {
1439
+ break;
1440
+ }
1441
+ message.allowedDomains.push(reader.string());
1442
+ continue;
1443
+ }
1444
+ case 8: {
1445
+ if (tag !== 64) {
1446
+ break;
1447
+ }
1448
+ message.jitProvisioningEnabled = reader.bool();
1449
+ continue;
1450
+ }
1451
+ case 9: {
1452
+ if (tag !== 72) {
1453
+ break;
1454
+ }
1455
+ message.passwordAuthEnabled = reader.bool();
1456
+ continue;
1457
+ }
1458
+ case 10: {
1459
+ if (tag !== 80) {
1460
+ break;
1461
+ }
1462
+ message.googleOauthEnabled = reader.bool();
1463
+ continue;
1464
+ }
1465
+ case 11: {
1466
+ if (tag !== 88) {
1467
+ break;
1468
+ }
1469
+ message.microsoftOauthEnabled = reader.bool();
1470
+ continue;
1471
+ }
1472
+ case 12: {
1473
+ if (tag !== 96) {
1474
+ break;
1475
+ }
1476
+ message.ssoRequired = reader.bool();
1477
+ continue;
1478
+ }
1479
+ case 13: {
1480
+ if (tag !== 104) {
1481
+ break;
1482
+ }
1483
+ message.scimEnabled = reader.bool();
1484
+ continue;
1485
+ }
1486
+ case 14: {
1487
+ if (tag !== 114) {
1488
+ break;
1489
+ }
1490
+ message.rbacPolicySummary = exports.RbacPolicySummary.decode(reader, reader.uint32());
1491
+ continue;
1492
+ }
1493
+ case 15: {
1494
+ if (tag !== 122) {
1495
+ break;
1496
+ }
1497
+ message.authPolicySummary = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1498
+ continue;
1499
+ }
1500
+ }
1501
+ if ((tag & 7) === 4 || tag === 0) {
1502
+ break;
1503
+ }
1504
+ reader.skip(tag & 7);
1505
+ }
1506
+ return message;
1507
+ },
1508
+ fromJSON(object) {
1509
+ return {
1510
+ organizationId: isSet(object.organizationId)
1511
+ ? globalThis.String(object.organizationId)
1512
+ : isSet(object.organization_id)
1513
+ ? globalThis.String(object.organization_id)
1514
+ : "",
1515
+ organizationSlug: isSet(object.organizationSlug)
1516
+ ? globalThis.String(object.organizationSlug)
1517
+ : isSet(object.organization_slug)
1518
+ ? globalThis.String(object.organization_slug)
1519
+ : "",
1520
+ stytchOrganizationId: isSet(object.stytchOrganizationId)
1521
+ ? globalThis.String(object.stytchOrganizationId)
1522
+ : isSet(object.stytch_organization_id)
1523
+ ? globalThis.String(object.stytch_organization_id)
1524
+ : "",
1525
+ stytchOrganizationSlug: isSet(object.stytchOrganizationSlug)
1526
+ ? globalThis.String(object.stytchOrganizationSlug)
1527
+ : isSet(object.stytch_organization_slug)
1528
+ ? globalThis.String(object.stytch_organization_slug)
1529
+ : "",
1530
+ organizationKind: isSet(object.organizationKind)
1531
+ ? organizationKindFromJSON(object.organizationKind)
1532
+ : isSet(object.organization_kind)
1533
+ ? organizationKindFromJSON(object.organization_kind)
1534
+ : 0,
1535
+ allowedAuthMethods: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.allowedAuthMethods)
1536
+ ? object.allowedAuthMethods.map((e) => authMethodFromJSON(e))
1537
+ : globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.allowed_auth_methods)
1538
+ ? object.allowed_auth_methods.map((e) => authMethodFromJSON(e))
1539
+ : [],
1540
+ allowedDomains: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.allowedDomains)
1541
+ ? object.allowedDomains.map((e) => globalThis.String(e))
1542
+ : globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.allowed_domains)
1543
+ ? object.allowed_domains.map((e) => globalThis.String(e))
1544
+ : [],
1545
+ jitProvisioningEnabled: isSet(object.jitProvisioningEnabled)
1546
+ ? globalThis.Boolean(object.jitProvisioningEnabled)
1547
+ : isSet(object.jit_provisioning_enabled)
1548
+ ? globalThis.Boolean(object.jit_provisioning_enabled)
1549
+ : false,
1550
+ passwordAuthEnabled: isSet(object.passwordAuthEnabled)
1551
+ ? globalThis.Boolean(object.passwordAuthEnabled)
1552
+ : isSet(object.password_auth_enabled)
1553
+ ? globalThis.Boolean(object.password_auth_enabled)
1554
+ : false,
1555
+ googleOauthEnabled: isSet(object.googleOauthEnabled)
1556
+ ? globalThis.Boolean(object.googleOauthEnabled)
1557
+ : isSet(object.google_oauth_enabled)
1558
+ ? globalThis.Boolean(object.google_oauth_enabled)
1559
+ : false,
1560
+ microsoftOauthEnabled: isSet(object.microsoftOauthEnabled)
1561
+ ? globalThis.Boolean(object.microsoftOauthEnabled)
1562
+ : isSet(object.microsoft_oauth_enabled)
1563
+ ? globalThis.Boolean(object.microsoft_oauth_enabled)
1564
+ : false,
1565
+ ssoRequired: isSet(object.ssoRequired)
1566
+ ? globalThis.Boolean(object.ssoRequired)
1567
+ : isSet(object.sso_required)
1568
+ ? globalThis.Boolean(object.sso_required)
1569
+ : false,
1570
+ scimEnabled: isSet(object.scimEnabled)
1571
+ ? globalThis.Boolean(object.scimEnabled)
1572
+ : isSet(object.scim_enabled)
1573
+ ? globalThis.Boolean(object.scim_enabled)
1574
+ : false,
1575
+ rbacPolicySummary: isSet(object.rbacPolicySummary)
1576
+ ? exports.RbacPolicySummary.fromJSON(object.rbacPolicySummary)
1577
+ : isSet(object.rbac_policy_summary)
1578
+ ? exports.RbacPolicySummary.fromJSON(object.rbac_policy_summary)
1579
+ : undefined,
1580
+ authPolicySummary: isObject(object.authPolicySummary)
1581
+ ? object.authPolicySummary
1582
+ : isObject(object.auth_policy_summary)
1583
+ ? object.auth_policy_summary
1584
+ : undefined,
1585
+ };
1586
+ },
1587
+ toJSON(message) {
1588
+ var _a, _b;
1589
+ const obj = {};
1590
+ if (message.organizationId !== "") {
1591
+ obj.organizationId = message.organizationId;
1592
+ }
1593
+ if (message.organizationSlug !== "") {
1594
+ obj.organizationSlug = message.organizationSlug;
1595
+ }
1596
+ if (message.stytchOrganizationId !== "") {
1597
+ obj.stytchOrganizationId = message.stytchOrganizationId;
1598
+ }
1599
+ if (message.stytchOrganizationSlug !== "") {
1600
+ obj.stytchOrganizationSlug = message.stytchOrganizationSlug;
1601
+ }
1602
+ if (message.organizationKind !== 0) {
1603
+ obj.organizationKind = organizationKindToJSON(message.organizationKind);
1604
+ }
1605
+ if ((_a = message.allowedAuthMethods) === null || _a === void 0 ? void 0 : _a.length) {
1606
+ obj.allowedAuthMethods = message.allowedAuthMethods.map((e) => authMethodToJSON(e));
1607
+ }
1608
+ if ((_b = message.allowedDomains) === null || _b === void 0 ? void 0 : _b.length) {
1609
+ obj.allowedDomains = message.allowedDomains;
1610
+ }
1611
+ if (message.jitProvisioningEnabled !== false) {
1612
+ obj.jitProvisioningEnabled = message.jitProvisioningEnabled;
1613
+ }
1614
+ if (message.passwordAuthEnabled !== false) {
1615
+ obj.passwordAuthEnabled = message.passwordAuthEnabled;
1616
+ }
1617
+ if (message.googleOauthEnabled !== false) {
1618
+ obj.googleOauthEnabled = message.googleOauthEnabled;
1619
+ }
1620
+ if (message.microsoftOauthEnabled !== false) {
1621
+ obj.microsoftOauthEnabled = message.microsoftOauthEnabled;
1622
+ }
1623
+ if (message.ssoRequired !== false) {
1624
+ obj.ssoRequired = message.ssoRequired;
1625
+ }
1626
+ if (message.scimEnabled !== false) {
1627
+ obj.scimEnabled = message.scimEnabled;
1628
+ }
1629
+ if (message.rbacPolicySummary !== undefined) {
1630
+ obj.rbacPolicySummary = exports.RbacPolicySummary.toJSON(message.rbacPolicySummary);
1631
+ }
1632
+ if (message.authPolicySummary !== undefined) {
1633
+ obj.authPolicySummary = message.authPolicySummary;
1634
+ }
1635
+ return obj;
1636
+ },
1637
+ create(base) {
1638
+ return exports.OrganizationAuthSettings.fromPartial(base !== null && base !== void 0 ? base : {});
1639
+ },
1640
+ fromPartial(object) {
1641
+ var _a, _b;
1642
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1643
+ const message = createBaseOrganizationAuthSettings();
1644
+ message.organizationId = (_c = object.organizationId) !== null && _c !== void 0 ? _c : "";
1645
+ message.organizationSlug = (_d = object.organizationSlug) !== null && _d !== void 0 ? _d : "";
1646
+ message.stytchOrganizationId = (_e = object.stytchOrganizationId) !== null && _e !== void 0 ? _e : "";
1647
+ message.stytchOrganizationSlug = (_f = object.stytchOrganizationSlug) !== null && _f !== void 0 ? _f : "";
1648
+ message.organizationKind = (_g = object.organizationKind) !== null && _g !== void 0 ? _g : 0;
1649
+ message.allowedAuthMethods = ((_a = object.allowedAuthMethods) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
1650
+ message.allowedDomains = ((_b = object.allowedDomains) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
1651
+ message.jitProvisioningEnabled = (_h = object.jitProvisioningEnabled) !== null && _h !== void 0 ? _h : false;
1652
+ message.passwordAuthEnabled = (_j = object.passwordAuthEnabled) !== null && _j !== void 0 ? _j : false;
1653
+ message.googleOauthEnabled = (_k = object.googleOauthEnabled) !== null && _k !== void 0 ? _k : false;
1654
+ message.microsoftOauthEnabled = (_l = object.microsoftOauthEnabled) !== null && _l !== void 0 ? _l : false;
1655
+ message.ssoRequired = (_m = object.ssoRequired) !== null && _m !== void 0 ? _m : false;
1656
+ message.scimEnabled = (_o = object.scimEnabled) !== null && _o !== void 0 ? _o : false;
1657
+ message.rbacPolicySummary = (object.rbacPolicySummary !== undefined && object.rbacPolicySummary !== null)
1658
+ ? exports.RbacPolicySummary.fromPartial(object.rbacPolicySummary)
1659
+ : undefined;
1660
+ message.authPolicySummary = (_p = object.authPolicySummary) !== null && _p !== void 0 ? _p : undefined;
1661
+ return message;
1662
+ },
1663
+ };
1664
+ function createBaseOrganizationMember() {
1665
+ return {
1666
+ id: "",
1667
+ userId: "",
1668
+ organizationId: "",
1669
+ stytchMemberId: "",
1670
+ email: "",
1671
+ displayName: "",
1672
+ avatarUrl: "",
1673
+ status: 0,
1674
+ roleIds: [],
1675
+ createdAt: undefined,
1676
+ updatedAt: undefined,
1677
+ };
1678
+ }
1679
+ exports.OrganizationMember = {
1680
+ encode(message, writer = new wire_1.BinaryWriter()) {
1681
+ if (message.id !== "") {
1682
+ writer.uint32(10).string(message.id);
1683
+ }
1684
+ if (message.userId !== "") {
1685
+ writer.uint32(18).string(message.userId);
1686
+ }
1687
+ if (message.organizationId !== "") {
1688
+ writer.uint32(26).string(message.organizationId);
1689
+ }
1690
+ if (message.stytchMemberId !== "") {
1691
+ writer.uint32(34).string(message.stytchMemberId);
1692
+ }
1693
+ if (message.email !== "") {
1694
+ writer.uint32(42).string(message.email);
1695
+ }
1696
+ if (message.displayName !== "") {
1697
+ writer.uint32(50).string(message.displayName);
1698
+ }
1699
+ if (message.avatarUrl !== "") {
1700
+ writer.uint32(58).string(message.avatarUrl);
1701
+ }
1702
+ if (message.status !== 0) {
1703
+ writer.uint32(64).int32(message.status);
1704
+ }
1705
+ for (const v of message.roleIds) {
1706
+ writer.uint32(74).string(v);
1707
+ }
1708
+ if (message.createdAt !== undefined) {
1709
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(82).fork()).join();
1710
+ }
1711
+ if (message.updatedAt !== undefined) {
1712
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(90).fork()).join();
1713
+ }
1714
+ return writer;
1715
+ },
1716
+ decode(input, length) {
1717
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1718
+ const end = length === undefined ? reader.len : reader.pos + length;
1719
+ const message = createBaseOrganizationMember();
1720
+ while (reader.pos < end) {
1721
+ const tag = reader.uint32();
1722
+ switch (tag >>> 3) {
1723
+ case 1: {
1724
+ if (tag !== 10) {
1725
+ break;
1726
+ }
1727
+ message.id = reader.string();
1728
+ continue;
1729
+ }
1730
+ case 2: {
1731
+ if (tag !== 18) {
1732
+ break;
1733
+ }
1734
+ message.userId = reader.string();
1735
+ continue;
1736
+ }
1737
+ case 3: {
1738
+ if (tag !== 26) {
1739
+ break;
1740
+ }
1741
+ message.organizationId = reader.string();
1742
+ continue;
1743
+ }
1744
+ case 4: {
1745
+ if (tag !== 34) {
1746
+ break;
1747
+ }
1748
+ message.stytchMemberId = reader.string();
1749
+ continue;
1750
+ }
1751
+ case 5: {
1752
+ if (tag !== 42) {
1753
+ break;
1754
+ }
1755
+ message.email = reader.string();
1756
+ continue;
1757
+ }
1758
+ case 6: {
1759
+ if (tag !== 50) {
1760
+ break;
1761
+ }
1762
+ message.displayName = reader.string();
1763
+ continue;
1764
+ }
1765
+ case 7: {
1766
+ if (tag !== 58) {
1767
+ break;
1768
+ }
1769
+ message.avatarUrl = reader.string();
1770
+ continue;
1771
+ }
1772
+ case 8: {
1773
+ if (tag !== 64) {
1774
+ break;
1775
+ }
1776
+ message.status = reader.int32();
1777
+ continue;
1778
+ }
1779
+ case 9: {
1780
+ if (tag !== 74) {
1781
+ break;
1782
+ }
1783
+ message.roleIds.push(reader.string());
1784
+ continue;
1785
+ }
1786
+ case 10: {
1787
+ if (tag !== 82) {
1788
+ break;
1789
+ }
1790
+ message.createdAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
1791
+ continue;
1792
+ }
1793
+ case 11: {
1794
+ if (tag !== 90) {
1795
+ break;
1796
+ }
1797
+ message.updatedAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
1798
+ continue;
1799
+ }
1800
+ }
1801
+ if ((tag & 7) === 4 || tag === 0) {
1802
+ break;
1803
+ }
1804
+ reader.skip(tag & 7);
1805
+ }
1806
+ return message;
1807
+ },
1808
+ fromJSON(object) {
1809
+ return {
1810
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
1811
+ userId: isSet(object.userId)
1812
+ ? globalThis.String(object.userId)
1813
+ : isSet(object.user_id)
1814
+ ? globalThis.String(object.user_id)
1815
+ : "",
1816
+ organizationId: isSet(object.organizationId)
1817
+ ? globalThis.String(object.organizationId)
1818
+ : isSet(object.organization_id)
1819
+ ? globalThis.String(object.organization_id)
1820
+ : "",
1821
+ stytchMemberId: isSet(object.stytchMemberId)
1822
+ ? globalThis.String(object.stytchMemberId)
1823
+ : isSet(object.stytch_member_id)
1824
+ ? globalThis.String(object.stytch_member_id)
1825
+ : "",
1826
+ email: isSet(object.email) ? globalThis.String(object.email) : "",
1827
+ displayName: isSet(object.displayName)
1828
+ ? globalThis.String(object.displayName)
1829
+ : isSet(object.display_name)
1830
+ ? globalThis.String(object.display_name)
1831
+ : "",
1832
+ avatarUrl: isSet(object.avatarUrl)
1833
+ ? globalThis.String(object.avatarUrl)
1834
+ : isSet(object.avatar_url)
1835
+ ? globalThis.String(object.avatar_url)
1836
+ : "",
1837
+ status: isSet(object.status) ? membershipStatusFromJSON(object.status) : 0,
1838
+ roleIds: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.roleIds)
1839
+ ? object.roleIds.map((e) => globalThis.String(e))
1840
+ : globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.role_ids)
1841
+ ? object.role_ids.map((e) => globalThis.String(e))
1842
+ : [],
1843
+ createdAt: isSet(object.createdAt)
1844
+ ? fromJsonTimestamp(object.createdAt)
1845
+ : isSet(object.created_at)
1846
+ ? fromJsonTimestamp(object.created_at)
1847
+ : undefined,
1848
+ updatedAt: isSet(object.updatedAt)
1849
+ ? fromJsonTimestamp(object.updatedAt)
1850
+ : isSet(object.updated_at)
1851
+ ? fromJsonTimestamp(object.updated_at)
1852
+ : undefined,
1853
+ };
1854
+ },
1855
+ toJSON(message) {
1856
+ var _a;
1857
+ const obj = {};
1858
+ if (message.id !== "") {
1859
+ obj.id = message.id;
1860
+ }
1861
+ if (message.userId !== "") {
1862
+ obj.userId = message.userId;
1863
+ }
1864
+ if (message.organizationId !== "") {
1865
+ obj.organizationId = message.organizationId;
1866
+ }
1867
+ if (message.stytchMemberId !== "") {
1868
+ obj.stytchMemberId = message.stytchMemberId;
1869
+ }
1870
+ if (message.email !== "") {
1871
+ obj.email = message.email;
1872
+ }
1873
+ if (message.displayName !== "") {
1874
+ obj.displayName = message.displayName;
1875
+ }
1876
+ if (message.avatarUrl !== "") {
1877
+ obj.avatarUrl = message.avatarUrl;
1878
+ }
1879
+ if (message.status !== 0) {
1880
+ obj.status = membershipStatusToJSON(message.status);
1881
+ }
1882
+ if ((_a = message.roleIds) === null || _a === void 0 ? void 0 : _a.length) {
1883
+ obj.roleIds = message.roleIds;
1884
+ }
1885
+ if (message.createdAt !== undefined) {
1886
+ obj.createdAt = message.createdAt.toISOString();
1887
+ }
1888
+ if (message.updatedAt !== undefined) {
1889
+ obj.updatedAt = message.updatedAt.toISOString();
1890
+ }
1891
+ return obj;
1892
+ },
1893
+ create(base) {
1894
+ return exports.OrganizationMember.fromPartial(base !== null && base !== void 0 ? base : {});
1895
+ },
1896
+ fromPartial(object) {
1897
+ var _a;
1898
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1899
+ const message = createBaseOrganizationMember();
1900
+ message.id = (_b = object.id) !== null && _b !== void 0 ? _b : "";
1901
+ message.userId = (_c = object.userId) !== null && _c !== void 0 ? _c : "";
1902
+ message.organizationId = (_d = object.organizationId) !== null && _d !== void 0 ? _d : "";
1903
+ message.stytchMemberId = (_e = object.stytchMemberId) !== null && _e !== void 0 ? _e : "";
1904
+ message.email = (_f = object.email) !== null && _f !== void 0 ? _f : "";
1905
+ message.displayName = (_g = object.displayName) !== null && _g !== void 0 ? _g : "";
1906
+ message.avatarUrl = (_h = object.avatarUrl) !== null && _h !== void 0 ? _h : "";
1907
+ message.status = (_j = object.status) !== null && _j !== void 0 ? _j : 0;
1908
+ message.roleIds = ((_a = object.roleIds) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
1909
+ message.createdAt = (_k = object.createdAt) !== null && _k !== void 0 ? _k : undefined;
1910
+ message.updatedAt = (_l = object.updatedAt) !== null && _l !== void 0 ? _l : undefined;
1911
+ return message;
1912
+ },
1913
+ };
1914
+ function createBaseRbacPolicySummary() {
1915
+ return { resources: [], roles: [], updatedAt: undefined };
1916
+ }
1917
+ exports.RbacPolicySummary = {
1918
+ encode(message, writer = new wire_1.BinaryWriter()) {
1919
+ for (const v of message.resources) {
1920
+ exports.RbacResource.encode(v, writer.uint32(10).fork()).join();
1921
+ }
1922
+ for (const v of message.roles) {
1923
+ exports.RbacRole.encode(v, writer.uint32(18).fork()).join();
1924
+ }
1925
+ if (message.updatedAt !== undefined) {
1926
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(26).fork()).join();
1927
+ }
1928
+ return writer;
1929
+ },
1930
+ decode(input, length) {
1931
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1932
+ const end = length === undefined ? reader.len : reader.pos + length;
1933
+ const message = createBaseRbacPolicySummary();
1934
+ while (reader.pos < end) {
1935
+ const tag = reader.uint32();
1936
+ switch (tag >>> 3) {
1937
+ case 1: {
1938
+ if (tag !== 10) {
1939
+ break;
1940
+ }
1941
+ message.resources.push(exports.RbacResource.decode(reader, reader.uint32()));
1942
+ continue;
1943
+ }
1944
+ case 2: {
1945
+ if (tag !== 18) {
1946
+ break;
1947
+ }
1948
+ message.roles.push(exports.RbacRole.decode(reader, reader.uint32()));
1949
+ continue;
1950
+ }
1951
+ case 3: {
1952
+ if (tag !== 26) {
1953
+ break;
1954
+ }
1955
+ message.updatedAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
1956
+ continue;
1957
+ }
1958
+ }
1959
+ if ((tag & 7) === 4 || tag === 0) {
1960
+ break;
1961
+ }
1962
+ reader.skip(tag & 7);
1963
+ }
1964
+ return message;
1965
+ },
1966
+ fromJSON(object) {
1967
+ return {
1968
+ resources: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.resources)
1969
+ ? object.resources.map((e) => exports.RbacResource.fromJSON(e))
1970
+ : [],
1971
+ roles: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.roles) ? object.roles.map((e) => exports.RbacRole.fromJSON(e)) : [],
1972
+ updatedAt: isSet(object.updatedAt)
1973
+ ? fromJsonTimestamp(object.updatedAt)
1974
+ : isSet(object.updated_at)
1975
+ ? fromJsonTimestamp(object.updated_at)
1976
+ : undefined,
1977
+ };
1978
+ },
1979
+ toJSON(message) {
1980
+ var _a, _b;
1981
+ const obj = {};
1982
+ if ((_a = message.resources) === null || _a === void 0 ? void 0 : _a.length) {
1983
+ obj.resources = message.resources.map((e) => exports.RbacResource.toJSON(e));
1984
+ }
1985
+ if ((_b = message.roles) === null || _b === void 0 ? void 0 : _b.length) {
1986
+ obj.roles = message.roles.map((e) => exports.RbacRole.toJSON(e));
1987
+ }
1988
+ if (message.updatedAt !== undefined) {
1989
+ obj.updatedAt = message.updatedAt.toISOString();
1990
+ }
1991
+ return obj;
1992
+ },
1993
+ create(base) {
1994
+ return exports.RbacPolicySummary.fromPartial(base !== null && base !== void 0 ? base : {});
1995
+ },
1996
+ fromPartial(object) {
1997
+ var _a, _b;
1998
+ var _c;
1999
+ const message = createBaseRbacPolicySummary();
2000
+ message.resources = ((_a = object.resources) === null || _a === void 0 ? void 0 : _a.map((e) => exports.RbacResource.fromPartial(e))) || [];
2001
+ message.roles = ((_b = object.roles) === null || _b === void 0 ? void 0 : _b.map((e) => exports.RbacRole.fromPartial(e))) || [];
2002
+ message.updatedAt = (_c = object.updatedAt) !== null && _c !== void 0 ? _c : undefined;
2003
+ return message;
2004
+ },
2005
+ };
2006
+ function createBaseRbacResource() {
2007
+ return { id: "", displayName: "", actions: [] };
2008
+ }
2009
+ exports.RbacResource = {
2010
+ encode(message, writer = new wire_1.BinaryWriter()) {
2011
+ if (message.id !== "") {
2012
+ writer.uint32(10).string(message.id);
2013
+ }
2014
+ if (message.displayName !== "") {
2015
+ writer.uint32(18).string(message.displayName);
2016
+ }
2017
+ for (const v of message.actions) {
2018
+ writer.uint32(26).string(v);
2019
+ }
2020
+ return writer;
2021
+ },
2022
+ decode(input, length) {
2023
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2024
+ const end = length === undefined ? reader.len : reader.pos + length;
2025
+ const message = createBaseRbacResource();
2026
+ while (reader.pos < end) {
2027
+ const tag = reader.uint32();
2028
+ switch (tag >>> 3) {
2029
+ case 1: {
2030
+ if (tag !== 10) {
2031
+ break;
2032
+ }
2033
+ message.id = reader.string();
2034
+ continue;
2035
+ }
2036
+ case 2: {
2037
+ if (tag !== 18) {
2038
+ break;
2039
+ }
2040
+ message.displayName = reader.string();
2041
+ continue;
2042
+ }
2043
+ case 3: {
2044
+ if (tag !== 26) {
2045
+ break;
2046
+ }
2047
+ message.actions.push(reader.string());
2048
+ continue;
2049
+ }
2050
+ }
2051
+ if ((tag & 7) === 4 || tag === 0) {
2052
+ break;
2053
+ }
2054
+ reader.skip(tag & 7);
2055
+ }
2056
+ return message;
2057
+ },
2058
+ fromJSON(object) {
2059
+ return {
2060
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
2061
+ displayName: isSet(object.displayName)
2062
+ ? globalThis.String(object.displayName)
2063
+ : isSet(object.display_name)
2064
+ ? globalThis.String(object.display_name)
2065
+ : "",
2066
+ actions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.actions) ? object.actions.map((e) => globalThis.String(e)) : [],
2067
+ };
2068
+ },
2069
+ toJSON(message) {
2070
+ var _a;
2071
+ const obj = {};
2072
+ if (message.id !== "") {
2073
+ obj.id = message.id;
2074
+ }
2075
+ if (message.displayName !== "") {
2076
+ obj.displayName = message.displayName;
2077
+ }
2078
+ if ((_a = message.actions) === null || _a === void 0 ? void 0 : _a.length) {
2079
+ obj.actions = message.actions;
2080
+ }
2081
+ return obj;
2082
+ },
2083
+ create(base) {
2084
+ return exports.RbacResource.fromPartial(base !== null && base !== void 0 ? base : {});
2085
+ },
2086
+ fromPartial(object) {
2087
+ var _a;
2088
+ var _b, _c;
2089
+ const message = createBaseRbacResource();
2090
+ message.id = (_b = object.id) !== null && _b !== void 0 ? _b : "";
2091
+ message.displayName = (_c = object.displayName) !== null && _c !== void 0 ? _c : "";
2092
+ message.actions = ((_a = object.actions) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
2093
+ return message;
2094
+ },
2095
+ };
2096
+ function createBaseRbacRole() {
2097
+ return { id: "", displayName: "", description: "", permissions: [] };
2098
+ }
2099
+ exports.RbacRole = {
2100
+ encode(message, writer = new wire_1.BinaryWriter()) {
2101
+ if (message.id !== "") {
2102
+ writer.uint32(10).string(message.id);
2103
+ }
2104
+ if (message.displayName !== "") {
2105
+ writer.uint32(18).string(message.displayName);
2106
+ }
2107
+ if (message.description !== "") {
2108
+ writer.uint32(26).string(message.description);
2109
+ }
2110
+ for (const v of message.permissions) {
2111
+ exports.RbacPermission.encode(v, writer.uint32(34).fork()).join();
2112
+ }
2113
+ return writer;
2114
+ },
2115
+ decode(input, length) {
2116
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2117
+ const end = length === undefined ? reader.len : reader.pos + length;
2118
+ const message = createBaseRbacRole();
2119
+ while (reader.pos < end) {
2120
+ const tag = reader.uint32();
2121
+ switch (tag >>> 3) {
2122
+ case 1: {
2123
+ if (tag !== 10) {
2124
+ break;
2125
+ }
2126
+ message.id = reader.string();
2127
+ continue;
2128
+ }
2129
+ case 2: {
2130
+ if (tag !== 18) {
2131
+ break;
2132
+ }
2133
+ message.displayName = reader.string();
2134
+ continue;
2135
+ }
2136
+ case 3: {
2137
+ if (tag !== 26) {
2138
+ break;
2139
+ }
2140
+ message.description = reader.string();
2141
+ continue;
2142
+ }
2143
+ case 4: {
2144
+ if (tag !== 34) {
2145
+ break;
2146
+ }
2147
+ message.permissions.push(exports.RbacPermission.decode(reader, reader.uint32()));
2148
+ continue;
2149
+ }
2150
+ }
2151
+ if ((tag & 7) === 4 || tag === 0) {
2152
+ break;
2153
+ }
2154
+ reader.skip(tag & 7);
2155
+ }
2156
+ return message;
2157
+ },
2158
+ fromJSON(object) {
2159
+ return {
2160
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
2161
+ displayName: isSet(object.displayName)
2162
+ ? globalThis.String(object.displayName)
2163
+ : isSet(object.display_name)
2164
+ ? globalThis.String(object.display_name)
2165
+ : "",
2166
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
2167
+ permissions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.permissions)
2168
+ ? object.permissions.map((e) => exports.RbacPermission.fromJSON(e))
2169
+ : [],
2170
+ };
2171
+ },
2172
+ toJSON(message) {
2173
+ var _a;
2174
+ const obj = {};
2175
+ if (message.id !== "") {
2176
+ obj.id = message.id;
2177
+ }
2178
+ if (message.displayName !== "") {
2179
+ obj.displayName = message.displayName;
2180
+ }
2181
+ if (message.description !== "") {
2182
+ obj.description = message.description;
2183
+ }
2184
+ if ((_a = message.permissions) === null || _a === void 0 ? void 0 : _a.length) {
2185
+ obj.permissions = message.permissions.map((e) => exports.RbacPermission.toJSON(e));
2186
+ }
2187
+ return obj;
2188
+ },
2189
+ create(base) {
2190
+ return exports.RbacRole.fromPartial(base !== null && base !== void 0 ? base : {});
2191
+ },
2192
+ fromPartial(object) {
2193
+ var _a;
2194
+ var _b, _c, _d;
2195
+ const message = createBaseRbacRole();
2196
+ message.id = (_b = object.id) !== null && _b !== void 0 ? _b : "";
2197
+ message.displayName = (_c = object.displayName) !== null && _c !== void 0 ? _c : "";
2198
+ message.description = (_d = object.description) !== null && _d !== void 0 ? _d : "";
2199
+ message.permissions = ((_a = object.permissions) === null || _a === void 0 ? void 0 : _a.map((e) => exports.RbacPermission.fromPartial(e))) || [];
2200
+ return message;
2201
+ },
2202
+ };
2203
+ function createBaseRbacPermission() {
2204
+ return { resourceId: "", actions: [] };
2205
+ }
2206
+ exports.RbacPermission = {
2207
+ encode(message, writer = new wire_1.BinaryWriter()) {
2208
+ if (message.resourceId !== "") {
2209
+ writer.uint32(10).string(message.resourceId);
2210
+ }
2211
+ for (const v of message.actions) {
2212
+ writer.uint32(18).string(v);
2213
+ }
2214
+ return writer;
2215
+ },
2216
+ decode(input, length) {
2217
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2218
+ const end = length === undefined ? reader.len : reader.pos + length;
2219
+ const message = createBaseRbacPermission();
2220
+ while (reader.pos < end) {
2221
+ const tag = reader.uint32();
2222
+ switch (tag >>> 3) {
2223
+ case 1: {
2224
+ if (tag !== 10) {
2225
+ break;
2226
+ }
2227
+ message.resourceId = reader.string();
2228
+ continue;
2229
+ }
2230
+ case 2: {
2231
+ if (tag !== 18) {
2232
+ break;
2233
+ }
2234
+ message.actions.push(reader.string());
2235
+ continue;
2236
+ }
2237
+ }
2238
+ if ((tag & 7) === 4 || tag === 0) {
2239
+ break;
2240
+ }
2241
+ reader.skip(tag & 7);
2242
+ }
2243
+ return message;
2244
+ },
2245
+ fromJSON(object) {
2246
+ return {
2247
+ resourceId: isSet(object.resourceId)
2248
+ ? globalThis.String(object.resourceId)
2249
+ : isSet(object.resource_id)
2250
+ ? globalThis.String(object.resource_id)
2251
+ : "",
2252
+ actions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.actions) ? object.actions.map((e) => globalThis.String(e)) : [],
2253
+ };
2254
+ },
2255
+ toJSON(message) {
2256
+ var _a;
2257
+ const obj = {};
2258
+ if (message.resourceId !== "") {
2259
+ obj.resourceId = message.resourceId;
2260
+ }
2261
+ if ((_a = message.actions) === null || _a === void 0 ? void 0 : _a.length) {
2262
+ obj.actions = message.actions;
2263
+ }
2264
+ return obj;
2265
+ },
2266
+ create(base) {
2267
+ return exports.RbacPermission.fromPartial(base !== null && base !== void 0 ? base : {});
2268
+ },
2269
+ fromPartial(object) {
2270
+ var _a;
2271
+ var _b;
2272
+ const message = createBaseRbacPermission();
2273
+ message.resourceId = (_b = object.resourceId) !== null && _b !== void 0 ? _b : "";
2274
+ message.actions = ((_a = object.actions) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
2275
+ return message;
2276
+ },
2277
+ };
2278
+ function createBaseSsoConnection() {
2279
+ return {
2280
+ id: "",
2281
+ organizationId: "",
2282
+ type: 0,
2283
+ status: 0,
2284
+ displayName: "",
2285
+ identityProvider: "",
2286
+ issuer: "",
2287
+ ssoUrl: "",
2288
+ acsUrl: "",
2289
+ entityId: "",
2290
+ jitProvisioningEnabled: false,
2291
+ createdAt: undefined,
2292
+ updatedAt: undefined,
2293
+ };
2294
+ }
2295
+ exports.SsoConnection = {
2296
+ encode(message, writer = new wire_1.BinaryWriter()) {
2297
+ if (message.id !== "") {
2298
+ writer.uint32(10).string(message.id);
2299
+ }
2300
+ if (message.organizationId !== "") {
2301
+ writer.uint32(18).string(message.organizationId);
2302
+ }
2303
+ if (message.type !== 0) {
2304
+ writer.uint32(24).int32(message.type);
2305
+ }
2306
+ if (message.status !== 0) {
2307
+ writer.uint32(32).int32(message.status);
2308
+ }
2309
+ if (message.displayName !== "") {
2310
+ writer.uint32(42).string(message.displayName);
2311
+ }
2312
+ if (message.identityProvider !== "") {
2313
+ writer.uint32(50).string(message.identityProvider);
2314
+ }
2315
+ if (message.issuer !== "") {
2316
+ writer.uint32(58).string(message.issuer);
2317
+ }
2318
+ if (message.ssoUrl !== "") {
2319
+ writer.uint32(66).string(message.ssoUrl);
2320
+ }
2321
+ if (message.acsUrl !== "") {
2322
+ writer.uint32(74).string(message.acsUrl);
2323
+ }
2324
+ if (message.entityId !== "") {
2325
+ writer.uint32(82).string(message.entityId);
2326
+ }
2327
+ if (message.jitProvisioningEnabled !== false) {
2328
+ writer.uint32(88).bool(message.jitProvisioningEnabled);
2329
+ }
2330
+ if (message.createdAt !== undefined) {
2331
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(98).fork()).join();
2332
+ }
2333
+ if (message.updatedAt !== undefined) {
2334
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(106).fork()).join();
2335
+ }
2336
+ return writer;
2337
+ },
2338
+ decode(input, length) {
2339
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2340
+ const end = length === undefined ? reader.len : reader.pos + length;
2341
+ const message = createBaseSsoConnection();
2342
+ while (reader.pos < end) {
2343
+ const tag = reader.uint32();
2344
+ switch (tag >>> 3) {
2345
+ case 1: {
2346
+ if (tag !== 10) {
2347
+ break;
2348
+ }
2349
+ message.id = reader.string();
2350
+ continue;
2351
+ }
2352
+ case 2: {
2353
+ if (tag !== 18) {
2354
+ break;
2355
+ }
2356
+ message.organizationId = reader.string();
2357
+ continue;
2358
+ }
2359
+ case 3: {
2360
+ if (tag !== 24) {
2361
+ break;
2362
+ }
2363
+ message.type = reader.int32();
2364
+ continue;
2365
+ }
2366
+ case 4: {
2367
+ if (tag !== 32) {
2368
+ break;
2369
+ }
2370
+ message.status = reader.int32();
2371
+ continue;
2372
+ }
2373
+ case 5: {
2374
+ if (tag !== 42) {
2375
+ break;
2376
+ }
2377
+ message.displayName = reader.string();
2378
+ continue;
2379
+ }
2380
+ case 6: {
2381
+ if (tag !== 50) {
2382
+ break;
2383
+ }
2384
+ message.identityProvider = reader.string();
2385
+ continue;
2386
+ }
2387
+ case 7: {
2388
+ if (tag !== 58) {
2389
+ break;
2390
+ }
2391
+ message.issuer = reader.string();
2392
+ continue;
2393
+ }
2394
+ case 8: {
2395
+ if (tag !== 66) {
2396
+ break;
2397
+ }
2398
+ message.ssoUrl = reader.string();
2399
+ continue;
2400
+ }
2401
+ case 9: {
2402
+ if (tag !== 74) {
2403
+ break;
2404
+ }
2405
+ message.acsUrl = reader.string();
2406
+ continue;
2407
+ }
2408
+ case 10: {
2409
+ if (tag !== 82) {
2410
+ break;
2411
+ }
2412
+ message.entityId = reader.string();
2413
+ continue;
2414
+ }
2415
+ case 11: {
2416
+ if (tag !== 88) {
2417
+ break;
2418
+ }
2419
+ message.jitProvisioningEnabled = reader.bool();
2420
+ continue;
2421
+ }
2422
+ case 12: {
2423
+ if (tag !== 98) {
2424
+ break;
2425
+ }
2426
+ message.createdAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
2427
+ continue;
2428
+ }
2429
+ case 13: {
2430
+ if (tag !== 106) {
2431
+ break;
2432
+ }
2433
+ message.updatedAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
2434
+ continue;
2435
+ }
2436
+ }
2437
+ if ((tag & 7) === 4 || tag === 0) {
2438
+ break;
2439
+ }
2440
+ reader.skip(tag & 7);
2441
+ }
2442
+ return message;
2443
+ },
2444
+ fromJSON(object) {
2445
+ return {
2446
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
2447
+ organizationId: isSet(object.organizationId)
2448
+ ? globalThis.String(object.organizationId)
2449
+ : isSet(object.organization_id)
2450
+ ? globalThis.String(object.organization_id)
2451
+ : "",
2452
+ type: isSet(object.type) ? ssoConnectionTypeFromJSON(object.type) : 0,
2453
+ status: isSet(object.status) ? ssoConnectionStatusFromJSON(object.status) : 0,
2454
+ displayName: isSet(object.displayName)
2455
+ ? globalThis.String(object.displayName)
2456
+ : isSet(object.display_name)
2457
+ ? globalThis.String(object.display_name)
2458
+ : "",
2459
+ identityProvider: isSet(object.identityProvider)
2460
+ ? globalThis.String(object.identityProvider)
2461
+ : isSet(object.identity_provider)
2462
+ ? globalThis.String(object.identity_provider)
2463
+ : "",
2464
+ issuer: isSet(object.issuer) ? globalThis.String(object.issuer) : "",
2465
+ ssoUrl: isSet(object.ssoUrl)
2466
+ ? globalThis.String(object.ssoUrl)
2467
+ : isSet(object.sso_url)
2468
+ ? globalThis.String(object.sso_url)
2469
+ : "",
2470
+ acsUrl: isSet(object.acsUrl)
2471
+ ? globalThis.String(object.acsUrl)
2472
+ : isSet(object.acs_url)
2473
+ ? globalThis.String(object.acs_url)
2474
+ : "",
2475
+ entityId: isSet(object.entityId)
2476
+ ? globalThis.String(object.entityId)
2477
+ : isSet(object.entity_id)
2478
+ ? globalThis.String(object.entity_id)
2479
+ : "",
2480
+ jitProvisioningEnabled: isSet(object.jitProvisioningEnabled)
2481
+ ? globalThis.Boolean(object.jitProvisioningEnabled)
2482
+ : isSet(object.jit_provisioning_enabled)
2483
+ ? globalThis.Boolean(object.jit_provisioning_enabled)
2484
+ : false,
2485
+ createdAt: isSet(object.createdAt)
2486
+ ? fromJsonTimestamp(object.createdAt)
2487
+ : isSet(object.created_at)
2488
+ ? fromJsonTimestamp(object.created_at)
2489
+ : undefined,
2490
+ updatedAt: isSet(object.updatedAt)
2491
+ ? fromJsonTimestamp(object.updatedAt)
2492
+ : isSet(object.updated_at)
2493
+ ? fromJsonTimestamp(object.updated_at)
2494
+ : undefined,
2495
+ };
2496
+ },
2497
+ toJSON(message) {
2498
+ const obj = {};
2499
+ if (message.id !== "") {
2500
+ obj.id = message.id;
2501
+ }
2502
+ if (message.organizationId !== "") {
2503
+ obj.organizationId = message.organizationId;
2504
+ }
2505
+ if (message.type !== 0) {
2506
+ obj.type = ssoConnectionTypeToJSON(message.type);
2507
+ }
2508
+ if (message.status !== 0) {
2509
+ obj.status = ssoConnectionStatusToJSON(message.status);
2510
+ }
2511
+ if (message.displayName !== "") {
2512
+ obj.displayName = message.displayName;
2513
+ }
2514
+ if (message.identityProvider !== "") {
2515
+ obj.identityProvider = message.identityProvider;
2516
+ }
2517
+ if (message.issuer !== "") {
2518
+ obj.issuer = message.issuer;
2519
+ }
2520
+ if (message.ssoUrl !== "") {
2521
+ obj.ssoUrl = message.ssoUrl;
2522
+ }
2523
+ if (message.acsUrl !== "") {
2524
+ obj.acsUrl = message.acsUrl;
2525
+ }
2526
+ if (message.entityId !== "") {
2527
+ obj.entityId = message.entityId;
2528
+ }
2529
+ if (message.jitProvisioningEnabled !== false) {
2530
+ obj.jitProvisioningEnabled = message.jitProvisioningEnabled;
2531
+ }
2532
+ if (message.createdAt !== undefined) {
2533
+ obj.createdAt = message.createdAt.toISOString();
2534
+ }
2535
+ if (message.updatedAt !== undefined) {
2536
+ obj.updatedAt = message.updatedAt.toISOString();
2537
+ }
2538
+ return obj;
2539
+ },
2540
+ create(base) {
2541
+ return exports.SsoConnection.fromPartial(base !== null && base !== void 0 ? base : {});
2542
+ },
2543
+ fromPartial(object) {
2544
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
2545
+ const message = createBaseSsoConnection();
2546
+ message.id = (_a = object.id) !== null && _a !== void 0 ? _a : "";
2547
+ message.organizationId = (_b = object.organizationId) !== null && _b !== void 0 ? _b : "";
2548
+ message.type = (_c = object.type) !== null && _c !== void 0 ? _c : 0;
2549
+ message.status = (_d = object.status) !== null && _d !== void 0 ? _d : 0;
2550
+ message.displayName = (_e = object.displayName) !== null && _e !== void 0 ? _e : "";
2551
+ message.identityProvider = (_f = object.identityProvider) !== null && _f !== void 0 ? _f : "";
2552
+ message.issuer = (_g = object.issuer) !== null && _g !== void 0 ? _g : "";
2553
+ message.ssoUrl = (_h = object.ssoUrl) !== null && _h !== void 0 ? _h : "";
2554
+ message.acsUrl = (_j = object.acsUrl) !== null && _j !== void 0 ? _j : "";
2555
+ message.entityId = (_k = object.entityId) !== null && _k !== void 0 ? _k : "";
2556
+ message.jitProvisioningEnabled = (_l = object.jitProvisioningEnabled) !== null && _l !== void 0 ? _l : false;
2557
+ message.createdAt = (_m = object.createdAt) !== null && _m !== void 0 ? _m : undefined;
2558
+ message.updatedAt = (_o = object.updatedAt) !== null && _o !== void 0 ? _o : undefined;
2559
+ return message;
2560
+ },
2561
+ };
2562
+ function createBaseScimConnection() {
2563
+ return {
2564
+ id: "",
2565
+ organizationId: "",
2566
+ status: 0,
2567
+ baseUrl: "",
2568
+ tokenAvailable: false,
2569
+ createdAt: undefined,
2570
+ updatedAt: undefined,
2571
+ };
2572
+ }
2573
+ exports.ScimConnection = {
2574
+ encode(message, writer = new wire_1.BinaryWriter()) {
2575
+ if (message.id !== "") {
2576
+ writer.uint32(10).string(message.id);
2577
+ }
2578
+ if (message.organizationId !== "") {
2579
+ writer.uint32(18).string(message.organizationId);
2580
+ }
2581
+ if (message.status !== 0) {
2582
+ writer.uint32(24).int32(message.status);
2583
+ }
2584
+ if (message.baseUrl !== "") {
2585
+ writer.uint32(34).string(message.baseUrl);
2586
+ }
2587
+ if (message.tokenAvailable !== false) {
2588
+ writer.uint32(40).bool(message.tokenAvailable);
2589
+ }
2590
+ if (message.createdAt !== undefined) {
2591
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(50).fork()).join();
2592
+ }
2593
+ if (message.updatedAt !== undefined) {
2594
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(58).fork()).join();
2595
+ }
2596
+ return writer;
2597
+ },
2598
+ decode(input, length) {
2599
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2600
+ const end = length === undefined ? reader.len : reader.pos + length;
2601
+ const message = createBaseScimConnection();
2602
+ while (reader.pos < end) {
2603
+ const tag = reader.uint32();
2604
+ switch (tag >>> 3) {
2605
+ case 1: {
2606
+ if (tag !== 10) {
2607
+ break;
2608
+ }
2609
+ message.id = reader.string();
2610
+ continue;
2611
+ }
2612
+ case 2: {
2613
+ if (tag !== 18) {
2614
+ break;
2615
+ }
2616
+ message.organizationId = reader.string();
2617
+ continue;
2618
+ }
2619
+ case 3: {
2620
+ if (tag !== 24) {
2621
+ break;
2622
+ }
2623
+ message.status = reader.int32();
2624
+ continue;
2625
+ }
2626
+ case 4: {
2627
+ if (tag !== 34) {
2628
+ break;
2629
+ }
2630
+ message.baseUrl = reader.string();
2631
+ continue;
2632
+ }
2633
+ case 5: {
2634
+ if (tag !== 40) {
2635
+ break;
2636
+ }
2637
+ message.tokenAvailable = reader.bool();
2638
+ continue;
2639
+ }
2640
+ case 6: {
2641
+ if (tag !== 50) {
2642
+ break;
2643
+ }
2644
+ message.createdAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
2645
+ continue;
2646
+ }
2647
+ case 7: {
2648
+ if (tag !== 58) {
2649
+ break;
2650
+ }
2651
+ message.updatedAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
2652
+ continue;
2653
+ }
2654
+ }
2655
+ if ((tag & 7) === 4 || tag === 0) {
2656
+ break;
2657
+ }
2658
+ reader.skip(tag & 7);
2659
+ }
2660
+ return message;
2661
+ },
2662
+ fromJSON(object) {
2663
+ return {
2664
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
2665
+ organizationId: isSet(object.organizationId)
2666
+ ? globalThis.String(object.organizationId)
2667
+ : isSet(object.organization_id)
2668
+ ? globalThis.String(object.organization_id)
2669
+ : "",
2670
+ status: isSet(object.status) ? scimConnectionStatusFromJSON(object.status) : 0,
2671
+ baseUrl: isSet(object.baseUrl)
2672
+ ? globalThis.String(object.baseUrl)
2673
+ : isSet(object.base_url)
2674
+ ? globalThis.String(object.base_url)
2675
+ : "",
2676
+ tokenAvailable: isSet(object.tokenAvailable)
2677
+ ? globalThis.Boolean(object.tokenAvailable)
2678
+ : isSet(object.token_available)
2679
+ ? globalThis.Boolean(object.token_available)
2680
+ : false,
2681
+ createdAt: isSet(object.createdAt)
2682
+ ? fromJsonTimestamp(object.createdAt)
2683
+ : isSet(object.created_at)
2684
+ ? fromJsonTimestamp(object.created_at)
2685
+ : undefined,
2686
+ updatedAt: isSet(object.updatedAt)
2687
+ ? fromJsonTimestamp(object.updatedAt)
2688
+ : isSet(object.updated_at)
2689
+ ? fromJsonTimestamp(object.updated_at)
2690
+ : undefined,
2691
+ };
2692
+ },
2693
+ toJSON(message) {
2694
+ const obj = {};
2695
+ if (message.id !== "") {
2696
+ obj.id = message.id;
2697
+ }
2698
+ if (message.organizationId !== "") {
2699
+ obj.organizationId = message.organizationId;
2700
+ }
2701
+ if (message.status !== 0) {
2702
+ obj.status = scimConnectionStatusToJSON(message.status);
2703
+ }
2704
+ if (message.baseUrl !== "") {
2705
+ obj.baseUrl = message.baseUrl;
2706
+ }
2707
+ if (message.tokenAvailable !== false) {
2708
+ obj.tokenAvailable = message.tokenAvailable;
2709
+ }
2710
+ if (message.createdAt !== undefined) {
2711
+ obj.createdAt = message.createdAt.toISOString();
2712
+ }
2713
+ if (message.updatedAt !== undefined) {
2714
+ obj.updatedAt = message.updatedAt.toISOString();
2715
+ }
2716
+ return obj;
2717
+ },
2718
+ create(base) {
2719
+ return exports.ScimConnection.fromPartial(base !== null && base !== void 0 ? base : {});
2720
+ },
2721
+ fromPartial(object) {
2722
+ var _a, _b, _c, _d, _e, _f, _g;
2723
+ const message = createBaseScimConnection();
2724
+ message.id = (_a = object.id) !== null && _a !== void 0 ? _a : "";
2725
+ message.organizationId = (_b = object.organizationId) !== null && _b !== void 0 ? _b : "";
2726
+ message.status = (_c = object.status) !== null && _c !== void 0 ? _c : 0;
2727
+ message.baseUrl = (_d = object.baseUrl) !== null && _d !== void 0 ? _d : "";
2728
+ message.tokenAvailable = (_e = object.tokenAvailable) !== null && _e !== void 0 ? _e : false;
2729
+ message.createdAt = (_f = object.createdAt) !== null && _f !== void 0 ? _f : undefined;
2730
+ message.updatedAt = (_g = object.updatedAt) !== null && _g !== void 0 ? _g : undefined;
2731
+ return message;
2732
+ },
2733
+ };
2734
+ function createBaseScimTokenRotation() {
2735
+ return { rotationId: "", status: 0, expiresAt: undefined };
2736
+ }
2737
+ exports.ScimTokenRotation = {
2738
+ encode(message, writer = new wire_1.BinaryWriter()) {
2739
+ if (message.rotationId !== "") {
2740
+ writer.uint32(10).string(message.rotationId);
2741
+ }
2742
+ if (message.status !== 0) {
2743
+ writer.uint32(16).int32(message.status);
2744
+ }
2745
+ if (message.expiresAt !== undefined) {
2746
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.expiresAt), writer.uint32(26).fork()).join();
2747
+ }
2748
+ return writer;
2749
+ },
2750
+ decode(input, length) {
2751
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2752
+ const end = length === undefined ? reader.len : reader.pos + length;
2753
+ const message = createBaseScimTokenRotation();
2754
+ while (reader.pos < end) {
2755
+ const tag = reader.uint32();
2756
+ switch (tag >>> 3) {
2757
+ case 1: {
2758
+ if (tag !== 10) {
2759
+ break;
2760
+ }
2761
+ message.rotationId = reader.string();
2762
+ continue;
2763
+ }
2764
+ case 2: {
2765
+ if (tag !== 16) {
2766
+ break;
2767
+ }
2768
+ message.status = reader.int32();
2769
+ continue;
2770
+ }
2771
+ case 3: {
2772
+ if (tag !== 26) {
2773
+ break;
2774
+ }
2775
+ message.expiresAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
2776
+ continue;
2777
+ }
2778
+ }
2779
+ if ((tag & 7) === 4 || tag === 0) {
2780
+ break;
2781
+ }
2782
+ reader.skip(tag & 7);
2783
+ }
2784
+ return message;
2785
+ },
2786
+ fromJSON(object) {
2787
+ return {
2788
+ rotationId: isSet(object.rotationId)
2789
+ ? globalThis.String(object.rotationId)
2790
+ : isSet(object.rotation_id)
2791
+ ? globalThis.String(object.rotation_id)
2792
+ : "",
2793
+ status: isSet(object.status) ? scimConnectionStatusFromJSON(object.status) : 0,
2794
+ expiresAt: isSet(object.expiresAt)
2795
+ ? fromJsonTimestamp(object.expiresAt)
2796
+ : isSet(object.expires_at)
2797
+ ? fromJsonTimestamp(object.expires_at)
2798
+ : undefined,
2799
+ };
2800
+ },
2801
+ toJSON(message) {
2802
+ const obj = {};
2803
+ if (message.rotationId !== "") {
2804
+ obj.rotationId = message.rotationId;
2805
+ }
2806
+ if (message.status !== 0) {
2807
+ obj.status = scimConnectionStatusToJSON(message.status);
2808
+ }
2809
+ if (message.expiresAt !== undefined) {
2810
+ obj.expiresAt = message.expiresAt.toISOString();
2811
+ }
2812
+ return obj;
2813
+ },
2814
+ create(base) {
2815
+ return exports.ScimTokenRotation.fromPartial(base !== null && base !== void 0 ? base : {});
2816
+ },
2817
+ fromPartial(object) {
2818
+ var _a, _b, _c;
2819
+ const message = createBaseScimTokenRotation();
2820
+ message.rotationId = (_a = object.rotationId) !== null && _a !== void 0 ? _a : "";
2821
+ message.status = (_b = object.status) !== null && _b !== void 0 ? _b : 0;
2822
+ message.expiresAt = (_c = object.expiresAt) !== null && _c !== void 0 ? _c : undefined;
2823
+ return message;
2824
+ },
2825
+ };
2826
+ function createBaseScimGroupMapping() {
2827
+ return { id: "", organizationId: "", scimGroupId: "", scimGroupName: "", orgTeamId: "", mappingStatus: "" };
2828
+ }
2829
+ exports.ScimGroupMapping = {
2830
+ encode(message, writer = new wire_1.BinaryWriter()) {
2831
+ if (message.id !== "") {
2832
+ writer.uint32(10).string(message.id);
2833
+ }
2834
+ if (message.organizationId !== "") {
2835
+ writer.uint32(18).string(message.organizationId);
2836
+ }
2837
+ if (message.scimGroupId !== "") {
2838
+ writer.uint32(26).string(message.scimGroupId);
2839
+ }
2840
+ if (message.scimGroupName !== "") {
2841
+ writer.uint32(34).string(message.scimGroupName);
2842
+ }
2843
+ if (message.orgTeamId !== "") {
2844
+ writer.uint32(42).string(message.orgTeamId);
2845
+ }
2846
+ if (message.mappingStatus !== "") {
2847
+ writer.uint32(50).string(message.mappingStatus);
2848
+ }
2849
+ return writer;
2850
+ },
2851
+ decode(input, length) {
2852
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2853
+ const end = length === undefined ? reader.len : reader.pos + length;
2854
+ const message = createBaseScimGroupMapping();
2855
+ while (reader.pos < end) {
2856
+ const tag = reader.uint32();
2857
+ switch (tag >>> 3) {
2858
+ case 1: {
2859
+ if (tag !== 10) {
2860
+ break;
2861
+ }
2862
+ message.id = reader.string();
2863
+ continue;
2864
+ }
2865
+ case 2: {
2866
+ if (tag !== 18) {
2867
+ break;
2868
+ }
2869
+ message.organizationId = reader.string();
2870
+ continue;
2871
+ }
2872
+ case 3: {
2873
+ if (tag !== 26) {
2874
+ break;
2875
+ }
2876
+ message.scimGroupId = reader.string();
2877
+ continue;
2878
+ }
2879
+ case 4: {
2880
+ if (tag !== 34) {
2881
+ break;
2882
+ }
2883
+ message.scimGroupName = reader.string();
2884
+ continue;
2885
+ }
2886
+ case 5: {
2887
+ if (tag !== 42) {
2888
+ break;
2889
+ }
2890
+ message.orgTeamId = reader.string();
2891
+ continue;
2892
+ }
2893
+ case 6: {
2894
+ if (tag !== 50) {
2895
+ break;
2896
+ }
2897
+ message.mappingStatus = reader.string();
2898
+ continue;
2899
+ }
2900
+ }
2901
+ if ((tag & 7) === 4 || tag === 0) {
2902
+ break;
2903
+ }
2904
+ reader.skip(tag & 7);
2905
+ }
2906
+ return message;
2907
+ },
2908
+ fromJSON(object) {
2909
+ return {
2910
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
2911
+ organizationId: isSet(object.organizationId)
2912
+ ? globalThis.String(object.organizationId)
2913
+ : isSet(object.organization_id)
2914
+ ? globalThis.String(object.organization_id)
2915
+ : "",
2916
+ scimGroupId: isSet(object.scimGroupId)
2917
+ ? globalThis.String(object.scimGroupId)
2918
+ : isSet(object.scim_group_id)
2919
+ ? globalThis.String(object.scim_group_id)
2920
+ : "",
2921
+ scimGroupName: isSet(object.scimGroupName)
2922
+ ? globalThis.String(object.scimGroupName)
2923
+ : isSet(object.scim_group_name)
2924
+ ? globalThis.String(object.scim_group_name)
2925
+ : "",
2926
+ orgTeamId: isSet(object.orgTeamId)
2927
+ ? globalThis.String(object.orgTeamId)
2928
+ : isSet(object.org_team_id)
2929
+ ? globalThis.String(object.org_team_id)
2930
+ : "",
2931
+ mappingStatus: isSet(object.mappingStatus)
2932
+ ? globalThis.String(object.mappingStatus)
2933
+ : isSet(object.mapping_status)
2934
+ ? globalThis.String(object.mapping_status)
2935
+ : "",
2936
+ };
2937
+ },
2938
+ toJSON(message) {
2939
+ const obj = {};
2940
+ if (message.id !== "") {
2941
+ obj.id = message.id;
2942
+ }
2943
+ if (message.organizationId !== "") {
2944
+ obj.organizationId = message.organizationId;
2945
+ }
2946
+ if (message.scimGroupId !== "") {
2947
+ obj.scimGroupId = message.scimGroupId;
2948
+ }
2949
+ if (message.scimGroupName !== "") {
2950
+ obj.scimGroupName = message.scimGroupName;
2951
+ }
2952
+ if (message.orgTeamId !== "") {
2953
+ obj.orgTeamId = message.orgTeamId;
2954
+ }
2955
+ if (message.mappingStatus !== "") {
2956
+ obj.mappingStatus = message.mappingStatus;
2957
+ }
2958
+ return obj;
2959
+ },
2960
+ create(base) {
2961
+ return exports.ScimGroupMapping.fromPartial(base !== null && base !== void 0 ? base : {});
2962
+ },
2963
+ fromPartial(object) {
2964
+ var _a, _b, _c, _d, _e, _f;
2965
+ const message = createBaseScimGroupMapping();
2966
+ message.id = (_a = object.id) !== null && _a !== void 0 ? _a : "";
2967
+ message.organizationId = (_b = object.organizationId) !== null && _b !== void 0 ? _b : "";
2968
+ message.scimGroupId = (_c = object.scimGroupId) !== null && _c !== void 0 ? _c : "";
2969
+ message.scimGroupName = (_d = object.scimGroupName) !== null && _d !== void 0 ? _d : "";
2970
+ message.orgTeamId = (_e = object.orgTeamId) !== null && _e !== void 0 ? _e : "";
2971
+ message.mappingStatus = (_f = object.mappingStatus) !== null && _f !== void 0 ? _f : "";
2972
+ return message;
2973
+ },
2974
+ };
2975
+ function createBaseSupportAccessSession() {
2976
+ return {
2977
+ id: "",
2978
+ actingUserId: "",
2979
+ targetOrganizationId: "",
2980
+ reason: "",
2981
+ allowedActions: [],
2982
+ startedAt: undefined,
2983
+ endedAt: undefined,
2984
+ };
2985
+ }
2986
+ exports.SupportAccessSession = {
2987
+ encode(message, writer = new wire_1.BinaryWriter()) {
2988
+ if (message.id !== "") {
2989
+ writer.uint32(10).string(message.id);
2990
+ }
2991
+ if (message.actingUserId !== "") {
2992
+ writer.uint32(18).string(message.actingUserId);
2993
+ }
2994
+ if (message.targetOrganizationId !== "") {
2995
+ writer.uint32(26).string(message.targetOrganizationId);
2996
+ }
2997
+ if (message.reason !== "") {
2998
+ writer.uint32(34).string(message.reason);
2999
+ }
3000
+ for (const v of message.allowedActions) {
3001
+ writer.uint32(42).string(v);
3002
+ }
3003
+ if (message.startedAt !== undefined) {
3004
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.startedAt), writer.uint32(50).fork()).join();
3005
+ }
3006
+ if (message.endedAt !== undefined) {
3007
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.endedAt), writer.uint32(58).fork()).join();
3008
+ }
3009
+ return writer;
3010
+ },
3011
+ decode(input, length) {
3012
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3013
+ const end = length === undefined ? reader.len : reader.pos + length;
3014
+ const message = createBaseSupportAccessSession();
3015
+ while (reader.pos < end) {
3016
+ const tag = reader.uint32();
3017
+ switch (tag >>> 3) {
3018
+ case 1: {
3019
+ if (tag !== 10) {
3020
+ break;
3021
+ }
3022
+ message.id = reader.string();
3023
+ continue;
3024
+ }
3025
+ case 2: {
3026
+ if (tag !== 18) {
3027
+ break;
3028
+ }
3029
+ message.actingUserId = reader.string();
3030
+ continue;
3031
+ }
3032
+ case 3: {
3033
+ if (tag !== 26) {
3034
+ break;
3035
+ }
3036
+ message.targetOrganizationId = reader.string();
3037
+ continue;
3038
+ }
3039
+ case 4: {
3040
+ if (tag !== 34) {
3041
+ break;
3042
+ }
3043
+ message.reason = reader.string();
3044
+ continue;
3045
+ }
3046
+ case 5: {
3047
+ if (tag !== 42) {
3048
+ break;
3049
+ }
3050
+ message.allowedActions.push(reader.string());
3051
+ continue;
3052
+ }
3053
+ case 6: {
3054
+ if (tag !== 50) {
3055
+ break;
3056
+ }
3057
+ message.startedAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
3058
+ continue;
3059
+ }
3060
+ case 7: {
3061
+ if (tag !== 58) {
3062
+ break;
3063
+ }
3064
+ message.endedAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
3065
+ continue;
3066
+ }
3067
+ }
3068
+ if ((tag & 7) === 4 || tag === 0) {
3069
+ break;
3070
+ }
3071
+ reader.skip(tag & 7);
3072
+ }
3073
+ return message;
3074
+ },
3075
+ fromJSON(object) {
3076
+ return {
3077
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
3078
+ actingUserId: isSet(object.actingUserId)
3079
+ ? globalThis.String(object.actingUserId)
3080
+ : isSet(object.acting_user_id)
3081
+ ? globalThis.String(object.acting_user_id)
3082
+ : "",
3083
+ targetOrganizationId: isSet(object.targetOrganizationId)
3084
+ ? globalThis.String(object.targetOrganizationId)
3085
+ : isSet(object.target_organization_id)
3086
+ ? globalThis.String(object.target_organization_id)
3087
+ : "",
3088
+ reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
3089
+ allowedActions: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.allowedActions)
3090
+ ? object.allowedActions.map((e) => globalThis.String(e))
3091
+ : globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.allowed_actions)
3092
+ ? object.allowed_actions.map((e) => globalThis.String(e))
3093
+ : [],
3094
+ startedAt: isSet(object.startedAt)
3095
+ ? fromJsonTimestamp(object.startedAt)
3096
+ : isSet(object.started_at)
3097
+ ? fromJsonTimestamp(object.started_at)
3098
+ : undefined,
3099
+ endedAt: isSet(object.endedAt)
3100
+ ? fromJsonTimestamp(object.endedAt)
3101
+ : isSet(object.ended_at)
3102
+ ? fromJsonTimestamp(object.ended_at)
3103
+ : undefined,
3104
+ };
3105
+ },
3106
+ toJSON(message) {
3107
+ var _a;
3108
+ const obj = {};
3109
+ if (message.id !== "") {
3110
+ obj.id = message.id;
3111
+ }
3112
+ if (message.actingUserId !== "") {
3113
+ obj.actingUserId = message.actingUserId;
3114
+ }
3115
+ if (message.targetOrganizationId !== "") {
3116
+ obj.targetOrganizationId = message.targetOrganizationId;
3117
+ }
3118
+ if (message.reason !== "") {
3119
+ obj.reason = message.reason;
3120
+ }
3121
+ if ((_a = message.allowedActions) === null || _a === void 0 ? void 0 : _a.length) {
3122
+ obj.allowedActions = message.allowedActions;
3123
+ }
3124
+ if (message.startedAt !== undefined) {
3125
+ obj.startedAt = message.startedAt.toISOString();
3126
+ }
3127
+ if (message.endedAt !== undefined) {
3128
+ obj.endedAt = message.endedAt.toISOString();
3129
+ }
3130
+ return obj;
3131
+ },
3132
+ create(base) {
3133
+ return exports.SupportAccessSession.fromPartial(base !== null && base !== void 0 ? base : {});
3134
+ },
3135
+ fromPartial(object) {
3136
+ var _a;
3137
+ var _b, _c, _d, _e, _f, _g;
3138
+ const message = createBaseSupportAccessSession();
3139
+ message.id = (_b = object.id) !== null && _b !== void 0 ? _b : "";
3140
+ message.actingUserId = (_c = object.actingUserId) !== null && _c !== void 0 ? _c : "";
3141
+ message.targetOrganizationId = (_d = object.targetOrganizationId) !== null && _d !== void 0 ? _d : "";
3142
+ message.reason = (_e = object.reason) !== null && _e !== void 0 ? _e : "";
3143
+ message.allowedActions = ((_a = object.allowedActions) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
3144
+ message.startedAt = (_f = object.startedAt) !== null && _f !== void 0 ? _f : undefined;
3145
+ message.endedAt = (_g = object.endedAt) !== null && _g !== void 0 ? _g : undefined;
3146
+ return message;
3147
+ },
3148
+ };
3149
+ function toTimestamp(date) {
3150
+ const seconds = Math.trunc(date.getTime() / 1000);
3151
+ const nanos = (date.getTime() % 1000) * 1000000;
3152
+ return { seconds, nanos };
3153
+ }
3154
+ function fromTimestamp(t) {
3155
+ let millis = (t.seconds || 0) * 1000;
3156
+ millis += (t.nanos || 0) / 1000000;
3157
+ return new globalThis.Date(millis);
3158
+ }
3159
+ function fromJsonTimestamp(o) {
3160
+ if (o instanceof globalThis.Date) {
3161
+ return o;
3162
+ }
3163
+ else if (typeof o === "string") {
3164
+ return new globalThis.Date(o);
3165
+ }
3166
+ else {
3167
+ return fromTimestamp(timestamp_pb_1.Timestamp.fromJSON(o));
3168
+ }
3169
+ }
3170
+ function isObject(value) {
3171
+ return typeof value === "object" && value !== null;
3172
+ }
3173
+ function isSet(value) {
3174
+ return value !== null && value !== undefined;
3175
+ }