@riffdb/better-auth 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/DESIGN.md +197 -0
  2. package/LICENSE-APACHE +201 -0
  3. package/LICENSE-MIT +27 -0
  4. package/README.md +191 -2
  5. package/dist/adapter.d.ts +28 -0
  6. package/dist/adapter.d.ts.map +1 -0
  7. package/dist/adapter.js +1262 -0
  8. package/dist/adapter.js.map +1 -0
  9. package/dist/generated/client.d.ts +1925 -0
  10. package/dist/generated/client.d.ts.map +1 -0
  11. package/dist/generated/client.js +2044 -0
  12. package/dist/generated/client.js.map +1 -0
  13. package/dist/index.d.ts +5 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +5 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/profile-contract.d.ts +60 -0
  18. package/dist/profile-contract.d.ts.map +1 -0
  19. package/dist/profile-contract.js +535 -0
  20. package/dist/profile-contract.js.map +1 -0
  21. package/dist/profile-plan.d.ts +69 -0
  22. package/dist/profile-plan.d.ts.map +1 -0
  23. package/dist/profile-plan.js +180 -0
  24. package/dist/profile-plan.js.map +1 -0
  25. package/dist/profile.d.ts +47 -0
  26. package/dist/profile.d.ts.map +1 -0
  27. package/dist/profile.js +131 -0
  28. package/dist/profile.js.map +1 -0
  29. package/dist/testing.d.ts +11 -0
  30. package/dist/testing.d.ts.map +1 -0
  31. package/dist/testing.js +12 -0
  32. package/dist/testing.js.map +1 -0
  33. package/generated/go/client.go +1996 -0
  34. package/generated/mcp/tools.json +12352 -0
  35. package/generated/python/client.py +3877 -0
  36. package/generated/riffdb.application.exact.json +1 -0
  37. package/generated/riffdb.contract.bundle +0 -0
  38. package/generated/rust/client.rs +6028 -0
  39. package/package.json +62 -4
  40. package/profiles/organization-security/materialization.json +48 -0
  41. package/profiles/organization-security/riffdb/contract.riff +766 -0
  42. package/profiles/organization-security/riffdb/queries/find_account_by_id.riffq +18 -0
  43. package/profiles/organization-security/riffdb/queries/find_invitation_by_email.riffq +17 -0
  44. package/profiles/organization-security/riffdb/queries/find_invitation_by_id.riffq +18 -0
  45. package/profiles/organization-security/riffdb/queries/find_invitation_by_organization_id.riffq +17 -0
  46. package/profiles/organization-security/riffdb/queries/find_member_by_id.riffq +18 -0
  47. package/profiles/organization-security/riffdb/queries/find_member_by_user_id.riffq +17 -0
  48. package/profiles/organization-security/riffdb/queries/find_organization_by_id.riffq +16 -0
  49. package/profiles/organization-security/riffdb/queries/find_organization_by_slug.riffq +16 -0
  50. package/profiles/organization-security/riffdb/queries/find_session_by_id.riffq +18 -0
  51. package/profiles/organization-security/riffdb/queries/find_session_by_token.riffq +16 -0
  52. package/profiles/organization-security/riffdb/queries/find_team_by_id.riffq +18 -0
  53. package/profiles/organization-security/riffdb/queries/find_team_member_by_id.riffq +18 -0
  54. package/profiles/organization-security/riffdb/queries/find_team_member_by_team_id.riffq +17 -0
  55. package/profiles/organization-security/riffdb/queries/find_two_factor_by_id.riffq +18 -0
  56. package/profiles/organization-security/riffdb/queries/find_two_factor_by_secret.riffq +17 -0
  57. package/profiles/organization-security/riffdb/queries/find_user_by_email.riffq +16 -0
  58. package/profiles/organization-security/riffdb/queries/find_user_by_id.riffq +16 -0
  59. package/profiles/organization-security/riffdb/queries/find_verification_by_id.riffq +16 -0
  60. package/profiles/organization-security/riffdb/queries/find_verification_by_identifier.riffq +17 -0
  61. package/profiles/organization-security/riffdb.application.json +167 -0
  62. package/profiles/organization-security/riffdb.toml +7 -0
  63. package/profiles/organization-security.profile.json +954 -0
  64. package/riffdb/contract.riff +489 -0
  65. package/riffdb/queries/admin_users_all_email_asc.riffq +24 -0
  66. package/riffdb/queries/admin_users_contains_asc.riffq +24 -0
  67. package/riffdb/queries/admin_users_contains_desc.riffq +24 -0
  68. package/riffdb/queries/admin_users_email_contains_created_desc.riffq +24 -0
  69. package/riffdb/queries/admin_users_email_contains_image_asc.riffq +24 -0
  70. package/riffdb/queries/admin_users_ends_with_asc.riffq +24 -0
  71. package/riffdb/queries/admin_users_ends_with_desc.riffq +24 -0
  72. package/riffdb/queries/admin_users_starts_with_asc.riffq +24 -0
  73. package/riffdb/queries/admin_users_starts_with_desc.riffq +24 -0
  74. package/riffdb/queries/find_account_by_id.riffq +24 -0
  75. package/riffdb/queries/find_account_by_provider.riffq +26 -0
  76. package/riffdb/queries/find_accounts_by_user_id.riffq +25 -0
  77. package/riffdb/queries/find_accounts_by_user_provider.riffq +27 -0
  78. package/riffdb/queries/find_active_sessions_by_user_id.riffq +23 -0
  79. package/riffdb/queries/find_expired_verification_ids.riffq +17 -0
  80. package/riffdb/queries/find_latest_verification.riffq +20 -0
  81. package/riffdb/queries/find_session_by_id.riffq +20 -0
  82. package/riffdb/queries/find_session_by_token.riffq +20 -0
  83. package/riffdb/queries/find_sessions_by_token_set.riffq +20 -0
  84. package/riffdb/queries/find_sessions_by_user_id.riffq +21 -0
  85. package/riffdb/queries/find_user_by_email.riffq +16 -0
  86. package/riffdb/queries/find_user_by_id.riffq +15 -0
  87. package/riffdb/queries/find_verification_by_id.riffq +19 -0
  88. package/riffdb/queries/find_verifications_by_identifier.riffq +21 -0
  89. package/riffdb.application.json +107 -0
  90. package/riffdb.application.lock.json +1 -0
  91. package/scripts/real-riffdb-runner.mjs +333 -0
@@ -0,0 +1,3877 @@
1
+ # @generated by riffdb-query-module; do not edit.
2
+ from __future__ import annotations
3
+
4
+ from collections.abc import Callable, Sequence
5
+ from dataclasses import dataclass, field
6
+ from decimal import Decimal
7
+ from enum import StrEnum
8
+ from typing import Annotated, Final, Literal, TypeAlias
9
+ from uuid import UUID
10
+
11
+ from riffdb_application import (
12
+ AsyncApplicationTransport, AttemptBudget, CommandBatchOptions,
13
+ CommandBatchProgress, CommandBatchResult, Money, QueryOptions, RiffDate,
14
+ SyncApplicationTransport, Timestamp, TypedCommandResult, TypedQueryResult, WorkflowSuccessorRevision,
15
+ )
16
+ from riffdb_application._binding import decode_variant, encode_record
17
+
18
+ def _compact_tag(value: object, tag: str, keys: frozenset[str]) -> dict[str, object]:
19
+ if not isinstance(value, dict) or value.get("$riffdb") != tag or frozenset(value) != keys:
20
+ raise ValueError("invalid RiffDB compact value")
21
+ return value
22
+
23
+ CONTRACT_LINEAGE: Final[str] = "RiffDBBetterAuthCore"
24
+ CONTRACT_VERSION: Final[int] = 1
25
+ CONTRACT_BUNDLE_HASH: Final[str] = "11c5a37724f40b92bf10b195e6a66ef30037f73f3df79a98e4c4ed1076883d2e"
26
+ QUERY_MODULE_HASH: Final[str] = "18cfd99921406e15722f3ac45867d3fbe0cebd4f2ecdd86c0ba099547c58cd91"
27
+
28
+ @dataclass(frozen=True, slots=True, kw_only=True)
29
+ class User:
30
+ name: str
31
+ email: str
32
+ image: str | None
33
+ user_id: UUID
34
+ revision: Annotated[int, "u64"]
35
+ created_at: Timestamp
36
+ updated_at: Timestamp
37
+ email_verified: bool
38
+ organization_id: UUID
39
+
40
+ @dataclass(frozen=True, slots=True, kw_only=True)
41
+ class Account:
42
+ id: UUID
43
+ scope: str | None
44
+ user_id: UUID
45
+ id_token: str | None
46
+ password: str | None
47
+ revision: Annotated[int, "u64"]
48
+ account_id: str
49
+ created_at: Timestamp
50
+ updated_at: Timestamp
51
+ provider_id: str
52
+ access_token: str | None
53
+ refresh_token: str | None
54
+ organization_id: UUID
55
+ access_token_expires_at: Timestamp | None
56
+ refresh_token_expires_at: Timestamp | None
57
+
58
+ @dataclass(frozen=True, slots=True, kw_only=True)
59
+ class Session:
60
+ id: UUID
61
+ token: str
62
+ user_id: UUID
63
+ revision: Annotated[int, "u64"]
64
+ created_at: Timestamp
65
+ expires_at: Timestamp
66
+ ip_address: str | None
67
+ updated_at: Timestamp
68
+ user_agent: str | None
69
+ organization_id: UUID
70
+
71
+ @dataclass(frozen=True, slots=True, kw_only=True)
72
+ class Verification:
73
+ value: str
74
+ revision: Annotated[int, "u64"]
75
+ created_at: Timestamp
76
+ expires_at: Timestamp
77
+ identifier: str
78
+ updated_at: Timestamp
79
+ organization_id: UUID
80
+ verification_id: UUID
81
+
82
+ @dataclass(frozen=True, slots=True, kw_only=True)
83
+ class AccountPasswordUpdate:
84
+ user_id: UUID
85
+ password: str | None
86
+ account_id: UUID
87
+ updated_at: Timestamp
88
+ provider_id: str
89
+ organization_id: UUID
90
+ expected_revision: Annotated[int, "u64"]
91
+
92
+ ADMIN_USERS_ALL_EMAIL_ASC_QUERY_PLAN_HASH: Final[str] = "ea5056df116418329d03bc536a195247148360378e11444c10e7ca37df54c547"
93
+
94
+ @dataclass(frozen=True, slots=True, kw_only=True)
95
+ class AdminUsersAllEmailAscParams:
96
+ organization_id: UUID
97
+ minimum_email: str
98
+ user_id: UUID | None = None
99
+ limit: Annotated[int, "u64"] | None = None
100
+ offset: Annotated[int, "u64"] | None = None
101
+
102
+ @dataclass(frozen=True, slots=True, kw_only=True)
103
+ class AdminUsersAllEmailAscFoundUsers:
104
+ organization_id: UUID
105
+ user_id: UUID
106
+ name: str
107
+ email: str
108
+ email_verified: bool
109
+ image: str | None
110
+ created_at: Timestamp
111
+ updated_at: Timestamp
112
+ revision: Annotated[int, "u64"]
113
+
114
+ @dataclass(frozen=True, slots=True, kw_only=True)
115
+ class AdminUsersAllEmailAscFoundTotal:
116
+ value: Annotated[int, "u64"]
117
+
118
+ @dataclass(frozen=True, slots=True, kw_only=True)
119
+ class AdminUsersAllEmailAscFound:
120
+ users: tuple[AdminUsersAllEmailAscFoundUsers, ...]
121
+ total: AdminUsersAllEmailAscFoundTotal
122
+ outcome: Literal["Found"] = field(default="Found", init=False)
123
+
124
+ def is_found(self) -> bool:
125
+ return True
126
+
127
+ def unwrap_found(self) -> AdminUsersAllEmailAscFound:
128
+ return self
129
+
130
+ AdminUsersAllEmailAscResult: TypeAlias = AdminUsersAllEmailAscFound
131
+
132
+ ADMIN_USERS_CONTAINS_ASC_QUERY_PLAN_HASH: Final[str] = "56132d4a48f43731e36b69e0fe922d67491bc0ad611375fbc3d372a840b739df"
133
+
134
+ @dataclass(frozen=True, slots=True, kw_only=True)
135
+ class AdminUsersContainsAscParams:
136
+ organization_id: UUID
137
+ needle: str
138
+ user_id: UUID | None = None
139
+ limit: Annotated[int, "u64"] | None = None
140
+ offset: Annotated[int, "u64"] | None = None
141
+
142
+ @dataclass(frozen=True, slots=True, kw_only=True)
143
+ class AdminUsersContainsAscFoundUsers:
144
+ organization_id: UUID
145
+ user_id: UUID
146
+ name: str
147
+ email: str
148
+ email_verified: bool
149
+ image: str | None
150
+ created_at: Timestamp
151
+ updated_at: Timestamp
152
+ revision: Annotated[int, "u64"]
153
+
154
+ @dataclass(frozen=True, slots=True, kw_only=True)
155
+ class AdminUsersContainsAscFoundTotal:
156
+ value: Annotated[int, "u64"]
157
+
158
+ @dataclass(frozen=True, slots=True, kw_only=True)
159
+ class AdminUsersContainsAscFound:
160
+ users: tuple[AdminUsersContainsAscFoundUsers, ...]
161
+ total: AdminUsersContainsAscFoundTotal
162
+ outcome: Literal["Found"] = field(default="Found", init=False)
163
+
164
+ def is_found(self) -> bool:
165
+ return True
166
+
167
+ def unwrap_found(self) -> AdminUsersContainsAscFound:
168
+ return self
169
+
170
+ AdminUsersContainsAscResult: TypeAlias = AdminUsersContainsAscFound
171
+
172
+ ADMIN_USERS_CONTAINS_DESC_QUERY_PLAN_HASH: Final[str] = "470b720e68aa2261d902378ebc7fb1ce5be51582761672da7ecb87bece977f0f"
173
+
174
+ @dataclass(frozen=True, slots=True, kw_only=True)
175
+ class AdminUsersContainsDescParams:
176
+ organization_id: UUID
177
+ needle: str
178
+ user_id: UUID | None = None
179
+ limit: Annotated[int, "u64"] | None = None
180
+ offset: Annotated[int, "u64"] | None = None
181
+
182
+ @dataclass(frozen=True, slots=True, kw_only=True)
183
+ class AdminUsersContainsDescFoundUsers:
184
+ organization_id: UUID
185
+ user_id: UUID
186
+ name: str
187
+ email: str
188
+ email_verified: bool
189
+ image: str | None
190
+ created_at: Timestamp
191
+ updated_at: Timestamp
192
+ revision: Annotated[int, "u64"]
193
+
194
+ @dataclass(frozen=True, slots=True, kw_only=True)
195
+ class AdminUsersContainsDescFoundTotal:
196
+ value: Annotated[int, "u64"]
197
+
198
+ @dataclass(frozen=True, slots=True, kw_only=True)
199
+ class AdminUsersContainsDescFound:
200
+ users: tuple[AdminUsersContainsDescFoundUsers, ...]
201
+ total: AdminUsersContainsDescFoundTotal
202
+ outcome: Literal["Found"] = field(default="Found", init=False)
203
+
204
+ def is_found(self) -> bool:
205
+ return True
206
+
207
+ def unwrap_found(self) -> AdminUsersContainsDescFound:
208
+ return self
209
+
210
+ AdminUsersContainsDescResult: TypeAlias = AdminUsersContainsDescFound
211
+
212
+ ADMIN_USERS_EMAIL_CONTAINS_CREATED_DESC_QUERY_PLAN_HASH: Final[str] = "51def4488ff2a35fee0c5d7f267daaca11e60a03521be0fdaf8923c5486c5485"
213
+
214
+ @dataclass(frozen=True, slots=True, kw_only=True)
215
+ class AdminUsersEmailContainsCreatedDescParams:
216
+ organization_id: UUID
217
+ needle: str
218
+ user_id: UUID | None = None
219
+ limit: Annotated[int, "u64"] | None = None
220
+ offset: Annotated[int, "u64"] | None = None
221
+
222
+ @dataclass(frozen=True, slots=True, kw_only=True)
223
+ class AdminUsersEmailContainsCreatedDescFoundUsers:
224
+ organization_id: UUID
225
+ user_id: UUID
226
+ name: str
227
+ email: str
228
+ email_verified: bool
229
+ image: str | None
230
+ created_at: Timestamp
231
+ updated_at: Timestamp
232
+ revision: Annotated[int, "u64"]
233
+
234
+ @dataclass(frozen=True, slots=True, kw_only=True)
235
+ class AdminUsersEmailContainsCreatedDescFoundTotal:
236
+ value: Annotated[int, "u64"]
237
+
238
+ @dataclass(frozen=True, slots=True, kw_only=True)
239
+ class AdminUsersEmailContainsCreatedDescFound:
240
+ users: tuple[AdminUsersEmailContainsCreatedDescFoundUsers, ...]
241
+ total: AdminUsersEmailContainsCreatedDescFoundTotal
242
+ outcome: Literal["Found"] = field(default="Found", init=False)
243
+
244
+ def is_found(self) -> bool:
245
+ return True
246
+
247
+ def unwrap_found(self) -> AdminUsersEmailContainsCreatedDescFound:
248
+ return self
249
+
250
+ AdminUsersEmailContainsCreatedDescResult: TypeAlias = AdminUsersEmailContainsCreatedDescFound
251
+
252
+ ADMIN_USERS_EMAIL_CONTAINS_IMAGE_ASC_QUERY_PLAN_HASH: Final[str] = "fd5dc86099567113dcce8ef61c280b22f35a2c3b9e6fc592f0bcfaded4008f80"
253
+
254
+ @dataclass(frozen=True, slots=True, kw_only=True)
255
+ class AdminUsersEmailContainsImageAscParams:
256
+ organization_id: UUID
257
+ needle: str
258
+ user_id: UUID | None = None
259
+ limit: Annotated[int, "u64"] | None = None
260
+ offset: Annotated[int, "u64"] | None = None
261
+
262
+ @dataclass(frozen=True, slots=True, kw_only=True)
263
+ class AdminUsersEmailContainsImageAscFoundUsers:
264
+ organization_id: UUID
265
+ user_id: UUID
266
+ name: str
267
+ email: str
268
+ email_verified: bool
269
+ image: str | None
270
+ created_at: Timestamp
271
+ updated_at: Timestamp
272
+ revision: Annotated[int, "u64"]
273
+
274
+ @dataclass(frozen=True, slots=True, kw_only=True)
275
+ class AdminUsersEmailContainsImageAscFoundTotal:
276
+ value: Annotated[int, "u64"]
277
+
278
+ @dataclass(frozen=True, slots=True, kw_only=True)
279
+ class AdminUsersEmailContainsImageAscFound:
280
+ users: tuple[AdminUsersEmailContainsImageAscFoundUsers, ...]
281
+ total: AdminUsersEmailContainsImageAscFoundTotal
282
+ outcome: Literal["Found"] = field(default="Found", init=False)
283
+
284
+ def is_found(self) -> bool:
285
+ return True
286
+
287
+ def unwrap_found(self) -> AdminUsersEmailContainsImageAscFound:
288
+ return self
289
+
290
+ AdminUsersEmailContainsImageAscResult: TypeAlias = AdminUsersEmailContainsImageAscFound
291
+
292
+ ADMIN_USERS_ENDS_WITH_ASC_QUERY_PLAN_HASH: Final[str] = "a83229249df961abbc113e7b808af6beca7ca915835ddcd06cd5c28bb7d3c920"
293
+
294
+ @dataclass(frozen=True, slots=True, kw_only=True)
295
+ class AdminUsersEndsWithAscParams:
296
+ organization_id: UUID
297
+ needle: str
298
+ user_id: UUID | None = None
299
+ limit: Annotated[int, "u64"] | None = None
300
+ offset: Annotated[int, "u64"] | None = None
301
+
302
+ @dataclass(frozen=True, slots=True, kw_only=True)
303
+ class AdminUsersEndsWithAscFoundUsers:
304
+ organization_id: UUID
305
+ user_id: UUID
306
+ name: str
307
+ email: str
308
+ email_verified: bool
309
+ image: str | None
310
+ created_at: Timestamp
311
+ updated_at: Timestamp
312
+ revision: Annotated[int, "u64"]
313
+
314
+ @dataclass(frozen=True, slots=True, kw_only=True)
315
+ class AdminUsersEndsWithAscFoundTotal:
316
+ value: Annotated[int, "u64"]
317
+
318
+ @dataclass(frozen=True, slots=True, kw_only=True)
319
+ class AdminUsersEndsWithAscFound:
320
+ users: tuple[AdminUsersEndsWithAscFoundUsers, ...]
321
+ total: AdminUsersEndsWithAscFoundTotal
322
+ outcome: Literal["Found"] = field(default="Found", init=False)
323
+
324
+ def is_found(self) -> bool:
325
+ return True
326
+
327
+ def unwrap_found(self) -> AdminUsersEndsWithAscFound:
328
+ return self
329
+
330
+ AdminUsersEndsWithAscResult: TypeAlias = AdminUsersEndsWithAscFound
331
+
332
+ ADMIN_USERS_ENDS_WITH_DESC_QUERY_PLAN_HASH: Final[str] = "ac6fdfacb6f36e2a68e36429171b5d8d502b2fd43f781d72541ece961f1da93c"
333
+
334
+ @dataclass(frozen=True, slots=True, kw_only=True)
335
+ class AdminUsersEndsWithDescParams:
336
+ organization_id: UUID
337
+ needle: str
338
+ user_id: UUID | None = None
339
+ limit: Annotated[int, "u64"] | None = None
340
+ offset: Annotated[int, "u64"] | None = None
341
+
342
+ @dataclass(frozen=True, slots=True, kw_only=True)
343
+ class AdminUsersEndsWithDescFoundUsers:
344
+ organization_id: UUID
345
+ user_id: UUID
346
+ name: str
347
+ email: str
348
+ email_verified: bool
349
+ image: str | None
350
+ created_at: Timestamp
351
+ updated_at: Timestamp
352
+ revision: Annotated[int, "u64"]
353
+
354
+ @dataclass(frozen=True, slots=True, kw_only=True)
355
+ class AdminUsersEndsWithDescFoundTotal:
356
+ value: Annotated[int, "u64"]
357
+
358
+ @dataclass(frozen=True, slots=True, kw_only=True)
359
+ class AdminUsersEndsWithDescFound:
360
+ users: tuple[AdminUsersEndsWithDescFoundUsers, ...]
361
+ total: AdminUsersEndsWithDescFoundTotal
362
+ outcome: Literal["Found"] = field(default="Found", init=False)
363
+
364
+ def is_found(self) -> bool:
365
+ return True
366
+
367
+ def unwrap_found(self) -> AdminUsersEndsWithDescFound:
368
+ return self
369
+
370
+ AdminUsersEndsWithDescResult: TypeAlias = AdminUsersEndsWithDescFound
371
+
372
+ ADMIN_USERS_STARTS_WITH_ASC_QUERY_PLAN_HASH: Final[str] = "e9594b9b9631b78e8cbd9a89c4a2f1b43cb40b62ef55bb18b704f790044b2332"
373
+
374
+ @dataclass(frozen=True, slots=True, kw_only=True)
375
+ class AdminUsersStartsWithAscParams:
376
+ organization_id: UUID
377
+ needle: str
378
+ user_id: UUID | None = None
379
+ limit: Annotated[int, "u64"] | None = None
380
+ offset: Annotated[int, "u64"] | None = None
381
+
382
+ @dataclass(frozen=True, slots=True, kw_only=True)
383
+ class AdminUsersStartsWithAscFoundUsers:
384
+ organization_id: UUID
385
+ user_id: UUID
386
+ name: str
387
+ email: str
388
+ email_verified: bool
389
+ image: str | None
390
+ created_at: Timestamp
391
+ updated_at: Timestamp
392
+ revision: Annotated[int, "u64"]
393
+
394
+ @dataclass(frozen=True, slots=True, kw_only=True)
395
+ class AdminUsersStartsWithAscFoundTotal:
396
+ value: Annotated[int, "u64"]
397
+
398
+ @dataclass(frozen=True, slots=True, kw_only=True)
399
+ class AdminUsersStartsWithAscFound:
400
+ users: tuple[AdminUsersStartsWithAscFoundUsers, ...]
401
+ total: AdminUsersStartsWithAscFoundTotal
402
+ outcome: Literal["Found"] = field(default="Found", init=False)
403
+
404
+ def is_found(self) -> bool:
405
+ return True
406
+
407
+ def unwrap_found(self) -> AdminUsersStartsWithAscFound:
408
+ return self
409
+
410
+ AdminUsersStartsWithAscResult: TypeAlias = AdminUsersStartsWithAscFound
411
+
412
+ ADMIN_USERS_STARTS_WITH_DESC_QUERY_PLAN_HASH: Final[str] = "1f52bcc4f1f3e778f33e3e47299009ce70d3f4c541d1bed35e6f953d0e79ffea"
413
+
414
+ @dataclass(frozen=True, slots=True, kw_only=True)
415
+ class AdminUsersStartsWithDescParams:
416
+ organization_id: UUID
417
+ needle: str
418
+ user_id: UUID | None = None
419
+ limit: Annotated[int, "u64"] | None = None
420
+ offset: Annotated[int, "u64"] | None = None
421
+
422
+ @dataclass(frozen=True, slots=True, kw_only=True)
423
+ class AdminUsersStartsWithDescFoundUsers:
424
+ organization_id: UUID
425
+ user_id: UUID
426
+ name: str
427
+ email: str
428
+ email_verified: bool
429
+ image: str | None
430
+ created_at: Timestamp
431
+ updated_at: Timestamp
432
+ revision: Annotated[int, "u64"]
433
+
434
+ @dataclass(frozen=True, slots=True, kw_only=True)
435
+ class AdminUsersStartsWithDescFoundTotal:
436
+ value: Annotated[int, "u64"]
437
+
438
+ @dataclass(frozen=True, slots=True, kw_only=True)
439
+ class AdminUsersStartsWithDescFound:
440
+ users: tuple[AdminUsersStartsWithDescFoundUsers, ...]
441
+ total: AdminUsersStartsWithDescFoundTotal
442
+ outcome: Literal["Found"] = field(default="Found", init=False)
443
+
444
+ def is_found(self) -> bool:
445
+ return True
446
+
447
+ def unwrap_found(self) -> AdminUsersStartsWithDescFound:
448
+ return self
449
+
450
+ AdminUsersStartsWithDescResult: TypeAlias = AdminUsersStartsWithDescFound
451
+
452
+ FIND_ACCOUNT_BY_ID_QUERY_PLAN_HASH: Final[str] = "51ece0c8e7396f3f9efea7595a4224f856ae7984ff9bf15bcf9049427ad1f110"
453
+ FIND_ACCOUNT_BY_ID_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
454
+ ("FindAccountById", "Account", "access_token"),
455
+ ("FindAccountById", "Account", "refresh_token"),
456
+ ("FindAccountById", "Account", "id_token"),
457
+ ("FindAccountById", "Account", "password"),
458
+ )
459
+
460
+
461
+ @dataclass(frozen=True, slots=True, kw_only=True)
462
+ class FindAccountByIdParams:
463
+ organization_id: UUID
464
+ id: UUID
465
+
466
+ @dataclass(frozen=True, slots=True, kw_only=True)
467
+ class FindAccountByIdFoundAccounts:
468
+ id: UUID = field(repr=False)
469
+ user_id: UUID = field(repr=False)
470
+ account_id: str = field(repr=False)
471
+ provider_id: str = field(repr=False)
472
+ access_token: str | None = field(repr=False)
473
+ refresh_token: str | None = field(repr=False)
474
+ access_token_expires_at: Timestamp | None = field(repr=False)
475
+ refresh_token_expires_at: Timestamp | None = field(repr=False)
476
+ scope: str | None = field(repr=False)
477
+ id_token: str | None = field(repr=False)
478
+ password: str | None = field(repr=False)
479
+ created_at: Timestamp = field(repr=False)
480
+ updated_at: Timestamp = field(repr=False)
481
+ revision: Annotated[int, "u64"] = field(repr=False)
482
+
483
+ @dataclass(frozen=True, slots=True, kw_only=True)
484
+ class FindAccountByIdFound:
485
+ accounts: tuple[FindAccountByIdFoundAccounts, ...] = field(repr=False)
486
+ outcome: Literal["Found"] = field(default="Found", init=False)
487
+
488
+ def is_found(self) -> bool:
489
+ return True
490
+
491
+ def unwrap_found(self) -> FindAccountByIdFound:
492
+ return self
493
+
494
+ FindAccountByIdResult: TypeAlias = FindAccountByIdFound
495
+
496
+ FIND_ACCOUNT_BY_PROVIDER_QUERY_PLAN_HASH: Final[str] = "b104b38050396d747e59735cea4b562c305dccb7614a973f5177501825c91089"
497
+ FIND_ACCOUNT_BY_PROVIDER_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
498
+ ("FindAccountByProvider", "Account", "access_token"),
499
+ ("FindAccountByProvider", "Account", "refresh_token"),
500
+ ("FindAccountByProvider", "Account", "id_token"),
501
+ ("FindAccountByProvider", "Account", "password"),
502
+ )
503
+
504
+
505
+ @dataclass(frozen=True, slots=True, kw_only=True)
506
+ class FindAccountByProviderParams:
507
+ organization_id: UUID
508
+ account_id: str
509
+ provider_id: str
510
+
511
+ @dataclass(frozen=True, slots=True, kw_only=True)
512
+ class FindAccountByProviderFoundAccounts:
513
+ id: UUID = field(repr=False)
514
+ user_id: UUID = field(repr=False)
515
+ account_id: str = field(repr=False)
516
+ provider_id: str = field(repr=False)
517
+ access_token: str | None = field(repr=False)
518
+ refresh_token: str | None = field(repr=False)
519
+ access_token_expires_at: Timestamp | None = field(repr=False)
520
+ refresh_token_expires_at: Timestamp | None = field(repr=False)
521
+ scope: str | None = field(repr=False)
522
+ id_token: str | None = field(repr=False)
523
+ password: str | None = field(repr=False)
524
+ created_at: Timestamp = field(repr=False)
525
+ updated_at: Timestamp = field(repr=False)
526
+ revision: Annotated[int, "u64"] = field(repr=False)
527
+
528
+ @dataclass(frozen=True, slots=True, kw_only=True)
529
+ class FindAccountByProviderFound:
530
+ accounts: tuple[FindAccountByProviderFoundAccounts, ...] = field(repr=False)
531
+ outcome: Literal["Found"] = field(default="Found", init=False)
532
+
533
+ def is_found(self) -> bool:
534
+ return True
535
+
536
+ def unwrap_found(self) -> FindAccountByProviderFound:
537
+ return self
538
+
539
+ FindAccountByProviderResult: TypeAlias = FindAccountByProviderFound
540
+
541
+ FIND_ACCOUNTS_BY_USER_ID_QUERY_PLAN_HASH: Final[str] = "0e517c2b2a10d95c12812d6374107379c80ce4638b962fad6f9092cc6b8b6c2e"
542
+ FIND_ACCOUNTS_BY_USER_ID_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
543
+ ("FindAccountsByUserId", "Account", "access_token"),
544
+ ("FindAccountsByUserId", "Account", "refresh_token"),
545
+ ("FindAccountsByUserId", "Account", "id_token"),
546
+ ("FindAccountsByUserId", "Account", "password"),
547
+ )
548
+
549
+
550
+ @dataclass(frozen=True, slots=True, kw_only=True)
551
+ class FindAccountsByUserIdParams:
552
+ organization_id: UUID
553
+ user_id: UUID
554
+ after: str | None = None
555
+
556
+ @dataclass(frozen=True, slots=True, kw_only=True)
557
+ class FindAccountsByUserIdFoundAccounts:
558
+ id: UUID = field(repr=False)
559
+ user_id: UUID = field(repr=False)
560
+ account_id: str = field(repr=False)
561
+ provider_id: str = field(repr=False)
562
+ access_token: str | None = field(repr=False)
563
+ refresh_token: str | None = field(repr=False)
564
+ access_token_expires_at: Timestamp | None = field(repr=False)
565
+ refresh_token_expires_at: Timestamp | None = field(repr=False)
566
+ scope: str | None = field(repr=False)
567
+ id_token: str | None = field(repr=False)
568
+ password: str | None = field(repr=False)
569
+ created_at: Timestamp = field(repr=False)
570
+ updated_at: Timestamp = field(repr=False)
571
+ revision: Annotated[int, "u64"] = field(repr=False)
572
+
573
+ @dataclass(frozen=True, slots=True, kw_only=True)
574
+ class FindAccountsByUserIdFound:
575
+ accounts: tuple[FindAccountsByUserIdFoundAccounts, ...] = field(repr=False)
576
+ outcome: Literal["Found"] = field(default="Found", init=False)
577
+
578
+ def is_found(self) -> bool:
579
+ return True
580
+
581
+ def unwrap_found(self) -> FindAccountsByUserIdFound:
582
+ return self
583
+
584
+ FindAccountsByUserIdResult: TypeAlias = FindAccountsByUserIdFound
585
+
586
+ FIND_ACCOUNTS_BY_USER_PROVIDER_QUERY_PLAN_HASH: Final[str] = "44124fb19b8f7fe35bb15824b87a0ed593c86b5821e81ad7fae1ab8636725183"
587
+ FIND_ACCOUNTS_BY_USER_PROVIDER_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
588
+ ("FindAccountsByUserProvider", "Account", "access_token"),
589
+ ("FindAccountsByUserProvider", "Account", "refresh_token"),
590
+ ("FindAccountsByUserProvider", "Account", "id_token"),
591
+ ("FindAccountsByUserProvider", "Account", "password"),
592
+ )
593
+
594
+
595
+ @dataclass(frozen=True, slots=True, kw_only=True)
596
+ class FindAccountsByUserProviderParams:
597
+ organization_id: UUID
598
+ user_id: UUID
599
+ provider_id: str
600
+ after: str | None = None
601
+
602
+ @dataclass(frozen=True, slots=True, kw_only=True)
603
+ class FindAccountsByUserProviderFoundAccounts:
604
+ id: UUID = field(repr=False)
605
+ user_id: UUID = field(repr=False)
606
+ account_id: str = field(repr=False)
607
+ provider_id: str = field(repr=False)
608
+ access_token: str | None = field(repr=False)
609
+ refresh_token: str | None = field(repr=False)
610
+ access_token_expires_at: Timestamp | None = field(repr=False)
611
+ refresh_token_expires_at: Timestamp | None = field(repr=False)
612
+ scope: str | None = field(repr=False)
613
+ id_token: str | None = field(repr=False)
614
+ password: str | None = field(repr=False)
615
+ created_at: Timestamp = field(repr=False)
616
+ updated_at: Timestamp = field(repr=False)
617
+ revision: Annotated[int, "u64"] = field(repr=False)
618
+
619
+ @dataclass(frozen=True, slots=True, kw_only=True)
620
+ class FindAccountsByUserProviderFound:
621
+ accounts: tuple[FindAccountsByUserProviderFoundAccounts, ...] = field(repr=False)
622
+ outcome: Literal["Found"] = field(default="Found", init=False)
623
+
624
+ def is_found(self) -> bool:
625
+ return True
626
+
627
+ def unwrap_found(self) -> FindAccountsByUserProviderFound:
628
+ return self
629
+
630
+ FindAccountsByUserProviderResult: TypeAlias = FindAccountsByUserProviderFound
631
+
632
+ FIND_ACTIVE_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH: Final[str] = "218dbdff73dce68ba48b7f8a179791e6b46139ee84da3edbd96438045f60f8dc"
633
+ FIND_ACTIVE_SESSIONS_BY_USER_ID_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
634
+ ("FindActiveSessionsByUserId", "Session", "token"),
635
+ )
636
+
637
+
638
+ @dataclass(frozen=True, slots=True, kw_only=True)
639
+ class FindActiveSessionsByUserIdParams:
640
+ organization_id: UUID
641
+ user_id: UUID
642
+ expires_after: Timestamp
643
+ after: str | None = None
644
+
645
+ @dataclass(frozen=True, slots=True, kw_only=True)
646
+ class FindActiveSessionsByUserIdFoundSessions:
647
+ id: UUID = field(repr=False)
648
+ user_id: UUID = field(repr=False)
649
+ token: str = field(repr=False)
650
+ expires_at: Timestamp = field(repr=False)
651
+ ip_address: str | None = field(repr=False)
652
+ user_agent: str | None = field(repr=False)
653
+ created_at: Timestamp = field(repr=False)
654
+ updated_at: Timestamp = field(repr=False)
655
+ revision: Annotated[int, "u64"] = field(repr=False)
656
+
657
+ @dataclass(frozen=True, slots=True, kw_only=True)
658
+ class FindActiveSessionsByUserIdFound:
659
+ sessions: tuple[FindActiveSessionsByUserIdFoundSessions, ...] = field(repr=False)
660
+ outcome: Literal["Found"] = field(default="Found", init=False)
661
+
662
+ def is_found(self) -> bool:
663
+ return True
664
+
665
+ def unwrap_found(self) -> FindActiveSessionsByUserIdFound:
666
+ return self
667
+
668
+ FindActiveSessionsByUserIdResult: TypeAlias = FindActiveSessionsByUserIdFound
669
+
670
+ FIND_EXPIRED_VERIFICATION_IDS_QUERY_PLAN_HASH: Final[str] = "e24fe82a3a724a9d45044dc668d450e61b1177f5866423c07bd33100d49428c1"
671
+
672
+ @dataclass(frozen=True, slots=True, kw_only=True)
673
+ class FindExpiredVerificationIdsParams:
674
+ organization_id: UUID
675
+ expires_before: Timestamp
676
+ after: str | None = None
677
+
678
+ @dataclass(frozen=True, slots=True, kw_only=True)
679
+ class FindExpiredVerificationIdsFoundVerifications:
680
+ verification_id: UUID
681
+
682
+ @dataclass(frozen=True, slots=True, kw_only=True)
683
+ class FindExpiredVerificationIdsFound:
684
+ verifications: tuple[FindExpiredVerificationIdsFoundVerifications, ...]
685
+ outcome: Literal["Found"] = field(default="Found", init=False)
686
+
687
+ def is_found(self) -> bool:
688
+ return True
689
+
690
+ def unwrap_found(self) -> FindExpiredVerificationIdsFound:
691
+ return self
692
+
693
+ FindExpiredVerificationIdsResult: TypeAlias = FindExpiredVerificationIdsFound
694
+
695
+ FIND_LATEST_VERIFICATION_QUERY_PLAN_HASH: Final[str] = "54336205fa315da75d390d062055723e36d07ef6596e19f756d319a8bc875023"
696
+ FIND_LATEST_VERIFICATION_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
697
+ ("FindLatestVerification", "Verification", "value"),
698
+ )
699
+
700
+
701
+ @dataclass(frozen=True, slots=True, kw_only=True)
702
+ class FindLatestVerificationParams:
703
+ organization_id: UUID
704
+ identifier: str
705
+
706
+ @dataclass(frozen=True, slots=True, kw_only=True)
707
+ class FindLatestVerificationFoundVerifications:
708
+ verification_id: UUID = field(repr=False)
709
+ identifier: str = field(repr=False)
710
+ value: str = field(repr=False)
711
+ expires_at: Timestamp = field(repr=False)
712
+ created_at: Timestamp = field(repr=False)
713
+ updated_at: Timestamp = field(repr=False)
714
+ revision: Annotated[int, "u64"] = field(repr=False)
715
+
716
+ @dataclass(frozen=True, slots=True, kw_only=True)
717
+ class FindLatestVerificationFound:
718
+ verifications: tuple[FindLatestVerificationFoundVerifications, ...] = field(repr=False)
719
+ outcome: Literal["Found"] = field(default="Found", init=False)
720
+
721
+ def is_found(self) -> bool:
722
+ return True
723
+
724
+ def unwrap_found(self) -> FindLatestVerificationFound:
725
+ return self
726
+
727
+ FindLatestVerificationResult: TypeAlias = FindLatestVerificationFound
728
+
729
+ FIND_SESSION_BY_ID_QUERY_PLAN_HASH: Final[str] = "653cfab6a75b5e2624620b0b5504b19d36f778c8775606fa0f3bb0c1d51e6bc0"
730
+ FIND_SESSION_BY_ID_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
731
+ ("FindSessionById", "Session", "token"),
732
+ )
733
+
734
+
735
+ @dataclass(frozen=True, slots=True, kw_only=True)
736
+ class FindSessionByIdParams:
737
+ organization_id: UUID
738
+ id: UUID
739
+
740
+ @dataclass(frozen=True, slots=True, kw_only=True)
741
+ class FindSessionByIdFoundSessions:
742
+ id: UUID = field(repr=False)
743
+ user_id: UUID = field(repr=False)
744
+ token: str = field(repr=False)
745
+ expires_at: Timestamp = field(repr=False)
746
+ ip_address: str | None = field(repr=False)
747
+ user_agent: str | None = field(repr=False)
748
+ created_at: Timestamp = field(repr=False)
749
+ updated_at: Timestamp = field(repr=False)
750
+ revision: Annotated[int, "u64"] = field(repr=False)
751
+
752
+ @dataclass(frozen=True, slots=True, kw_only=True)
753
+ class FindSessionByIdFound:
754
+ sessions: tuple[FindSessionByIdFoundSessions, ...] = field(repr=False)
755
+ outcome: Literal["Found"] = field(default="Found", init=False)
756
+
757
+ def is_found(self) -> bool:
758
+ return True
759
+
760
+ def unwrap_found(self) -> FindSessionByIdFound:
761
+ return self
762
+
763
+ FindSessionByIdResult: TypeAlias = FindSessionByIdFound
764
+
765
+ FIND_SESSION_BY_TOKEN_QUERY_PLAN_HASH: Final[str] = "b5e701701b0ac99b4328200089b2507f31c0be55df78a275d83f7be99f8b7061"
766
+ FIND_SESSION_BY_TOKEN_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
767
+ ("FindSessionByToken", "Session", "token"),
768
+ )
769
+
770
+
771
+ @dataclass(frozen=True, slots=True, kw_only=True)
772
+ class FindSessionByTokenParams:
773
+ organization_id: UUID
774
+ token: str
775
+
776
+ @dataclass(frozen=True, slots=True, kw_only=True)
777
+ class FindSessionByTokenFoundSessions:
778
+ id: UUID = field(repr=False)
779
+ user_id: UUID = field(repr=False)
780
+ token: str = field(repr=False)
781
+ expires_at: Timestamp = field(repr=False)
782
+ ip_address: str | None = field(repr=False)
783
+ user_agent: str | None = field(repr=False)
784
+ created_at: Timestamp = field(repr=False)
785
+ updated_at: Timestamp = field(repr=False)
786
+ revision: Annotated[int, "u64"] = field(repr=False)
787
+
788
+ @dataclass(frozen=True, slots=True, kw_only=True)
789
+ class FindSessionByTokenFound:
790
+ sessions: tuple[FindSessionByTokenFoundSessions, ...] = field(repr=False)
791
+ outcome: Literal["Found"] = field(default="Found", init=False)
792
+
793
+ def is_found(self) -> bool:
794
+ return True
795
+
796
+ def unwrap_found(self) -> FindSessionByTokenFound:
797
+ return self
798
+
799
+ FindSessionByTokenResult: TypeAlias = FindSessionByTokenFound
800
+
801
+ FIND_SESSIONS_BY_TOKEN_SET_QUERY_PLAN_HASH: Final[str] = "56c683d1815bf0c3e14c0585f314de378b43f9f4e401312c645efc70bd42969b"
802
+ FIND_SESSIONS_BY_TOKEN_SET_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
803
+ ("FindSessionsByTokenSet", "Session", "token"),
804
+ )
805
+
806
+
807
+ @dataclass(frozen=True, slots=True, kw_only=True)
808
+ class FindSessionsByTokenSetParams:
809
+ organization_id: UUID
810
+ tokens: tuple[str, ...]
811
+
812
+ @dataclass(frozen=True, slots=True, kw_only=True)
813
+ class FindSessionsByTokenSetFoundSessions:
814
+ id: UUID = field(repr=False)
815
+ user_id: UUID = field(repr=False)
816
+ token: str = field(repr=False)
817
+ expires_at: Timestamp = field(repr=False)
818
+ ip_address: str | None = field(repr=False)
819
+ user_agent: str | None = field(repr=False)
820
+ created_at: Timestamp = field(repr=False)
821
+ updated_at: Timestamp = field(repr=False)
822
+ revision: Annotated[int, "u64"] = field(repr=False)
823
+
824
+ @dataclass(frozen=True, slots=True, kw_only=True)
825
+ class FindSessionsByTokenSetFound:
826
+ sessions: tuple[FindSessionsByTokenSetFoundSessions, ...] = field(repr=False)
827
+ outcome: Literal["Found"] = field(default="Found", init=False)
828
+
829
+ def is_found(self) -> bool:
830
+ return True
831
+
832
+ def unwrap_found(self) -> FindSessionsByTokenSetFound:
833
+ return self
834
+
835
+ FindSessionsByTokenSetResult: TypeAlias = FindSessionsByTokenSetFound
836
+
837
+ FIND_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH: Final[str] = "84de4cd840d30dc9cd575e1f1daea8de94f0efa63187b646e273ba633a5d693f"
838
+ FIND_SESSIONS_BY_USER_ID_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
839
+ ("FindSessionsByUserId", "Session", "token"),
840
+ )
841
+
842
+
843
+ @dataclass(frozen=True, slots=True, kw_only=True)
844
+ class FindSessionsByUserIdParams:
845
+ organization_id: UUID
846
+ user_id: UUID
847
+ after: str | None = None
848
+
849
+ @dataclass(frozen=True, slots=True, kw_only=True)
850
+ class FindSessionsByUserIdFoundSessions:
851
+ id: UUID = field(repr=False)
852
+ user_id: UUID = field(repr=False)
853
+ token: str = field(repr=False)
854
+ expires_at: Timestamp = field(repr=False)
855
+ ip_address: str | None = field(repr=False)
856
+ user_agent: str | None = field(repr=False)
857
+ created_at: Timestamp = field(repr=False)
858
+ updated_at: Timestamp = field(repr=False)
859
+ revision: Annotated[int, "u64"] = field(repr=False)
860
+
861
+ @dataclass(frozen=True, slots=True, kw_only=True)
862
+ class FindSessionsByUserIdFound:
863
+ sessions: tuple[FindSessionsByUserIdFoundSessions, ...] = field(repr=False)
864
+ outcome: Literal["Found"] = field(default="Found", init=False)
865
+
866
+ def is_found(self) -> bool:
867
+ return True
868
+
869
+ def unwrap_found(self) -> FindSessionsByUserIdFound:
870
+ return self
871
+
872
+ FindSessionsByUserIdResult: TypeAlias = FindSessionsByUserIdFound
873
+
874
+ FIND_USER_BY_EMAIL_QUERY_PLAN_HASH: Final[str] = "ef647a48d55b825dbe566c29b03dd3fb97444df49f991bd0441d60cbb4115078"
875
+
876
+ @dataclass(frozen=True, slots=True, kw_only=True)
877
+ class FindUserByEmailParams:
878
+ organization_id: UUID
879
+ email: str
880
+
881
+ @dataclass(frozen=True, slots=True, kw_only=True)
882
+ class FindUserByEmailFoundUsers:
883
+ user_id: UUID
884
+ name: str
885
+ email: str
886
+ email_verified: bool
887
+ image: str | None
888
+ created_at: Timestamp
889
+ updated_at: Timestamp
890
+ revision: Annotated[int, "u64"]
891
+
892
+ @dataclass(frozen=True, slots=True, kw_only=True)
893
+ class FindUserByEmailFound:
894
+ users: tuple[FindUserByEmailFoundUsers, ...]
895
+ outcome: Literal["Found"] = field(default="Found", init=False)
896
+
897
+ def is_found(self) -> bool:
898
+ return True
899
+
900
+ def unwrap_found(self) -> FindUserByEmailFound:
901
+ return self
902
+
903
+ FindUserByEmailResult: TypeAlias = FindUserByEmailFound
904
+
905
+ def _decode_find_user_by_email_compact(value: object) -> FindUserByEmailResult:
906
+ if not isinstance(value, dict) or frozenset(value) != frozenset(("$riffdb_compact",)):
907
+ raise ValueError("invalid RiffDB compact result")
908
+ compact = value["$riffdb_compact"]
909
+ if not isinstance(compact, dict) or frozenset(compact) != frozenset(("outcome", "result_name", "entity", "fields", "rows")) or compact["outcome"] != "Found" or compact["result_name"] != "users" or compact["entity"] != "User" or compact["fields"] != ["created_at", "email", "email_verified", "image", "name", "revision", "updated_at", "user_id"] or not isinstance(compact["rows"], list) or len(compact["rows"]) > 1:
910
+ raise ValueError("invalid RiffDB compact result")
911
+ decoded: list[FindUserByEmailFoundUsers] = []
912
+ for row in compact["rows"]:
913
+ if not isinstance(row, list) or len(row) != 8:
914
+ raise ValueError("invalid RiffDB compact result")
915
+ decoded.append(FindUserByEmailFoundUsers(
916
+
917
+ created_at=Timestamp(seconds=int(_compact_tag(row[0], "timestamp", frozenset(("$riffdb", "seconds", "nanos")))["seconds"]), nanos=int(_compact_tag(row[0], "timestamp", frozenset(("$riffdb", "seconds", "nanos")))["nanos"])),
918
+ email=(row[1] if isinstance(row[1], str) and len(row[1].encode("utf-8")) <= 320 else (_ for _ in ()).throw(ValueError("invalid RiffDB compact string"))),
919
+ email_verified=(row[2] if type(row[2]) is bool else (_ for _ in ()).throw(ValueError("invalid RiffDB compact bool"))),
920
+ image=None if row[3] is None else (row[3] if isinstance(row[3], str) and len(row[3].encode("utf-8")) <= 2048 else (_ for _ in ()).throw(ValueError("invalid RiffDB compact string"))),
921
+ name=(row[4] if isinstance(row[4], str) and len(row[4].encode("utf-8")) <= 256 else (_ for _ in ()).throw(ValueError("invalid RiffDB compact string"))),
922
+ revision=(row[5] if type(row[5]) is int and 0 <= row[5] < 2**64 else (_ for _ in ()).throw(ValueError("invalid RiffDB compact u64"))),
923
+ updated_at=Timestamp(seconds=int(_compact_tag(row[6], "timestamp", frozenset(("$riffdb", "seconds", "nanos")))["seconds"]), nanos=int(_compact_tag(row[6], "timestamp", frozenset(("$riffdb", "seconds", "nanos")))["nanos"])),
924
+ user_id=UUID(str(_compact_tag(row[7], "uuid", frozenset(("$riffdb", "value")))["value"])),
925
+ ))
926
+ return FindUserByEmailFound(users=tuple(decoded))
927
+
928
+ FIND_USER_BY_ID_QUERY_PLAN_HASH: Final[str] = "45fe0e1bda91ecd52e3a5c64c656c168c1200b1869b0f68665fd9e578439b9fd"
929
+
930
+ @dataclass(frozen=True, slots=True, kw_only=True)
931
+ class FindUserByIdParams:
932
+ organization_id: UUID
933
+ id: UUID
934
+
935
+ @dataclass(frozen=True, slots=True, kw_only=True)
936
+ class FindUserByIdFoundUser:
937
+ user_id: UUID
938
+ name: str
939
+ email: str
940
+ email_verified: bool
941
+ image: str | None
942
+ created_at: Timestamp
943
+ updated_at: Timestamp
944
+ revision: Annotated[int, "u64"]
945
+
946
+ @dataclass(frozen=True, slots=True, kw_only=True)
947
+ class FindUserByIdFound:
948
+ user: FindUserByIdFoundUser
949
+ outcome: Literal["Found"] = field(default="Found", init=False)
950
+
951
+ def is_found(self) -> bool:
952
+ return True
953
+
954
+ def is_missing(self) -> bool:
955
+ return False
956
+
957
+ def unwrap_found(self) -> FindUserByIdFound:
958
+ return self
959
+
960
+ @dataclass(frozen=True, slots=True, kw_only=True)
961
+ class FindUserByIdMissing:
962
+ outcome: Literal["Missing"] = field(default="Missing", init=False)
963
+
964
+ def is_found(self) -> bool:
965
+ return False
966
+
967
+ def is_missing(self) -> bool:
968
+ return True
969
+
970
+ def unwrap_found(self) -> FindUserByIdFound:
971
+ raise ValueError("expected FindUserById outcome found")
972
+
973
+ FindUserByIdResult: TypeAlias = FindUserByIdFound | FindUserByIdMissing
974
+
975
+ FIND_VERIFICATION_BY_ID_QUERY_PLAN_HASH: Final[str] = "3755eceb567801c6795c13a9e8868955cfe1bf185d204196f4c614d29f78c6aa"
976
+ FIND_VERIFICATION_BY_ID_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
977
+ ("FindVerificationById", "Verification", "value"),
978
+ )
979
+
980
+
981
+ @dataclass(frozen=True, slots=True, kw_only=True)
982
+ class FindVerificationByIdParams:
983
+ organization_id: UUID
984
+ id: UUID
985
+
986
+ @dataclass(frozen=True, slots=True, kw_only=True)
987
+ class FindVerificationByIdFoundVerification:
988
+ verification_id: UUID = field(repr=False)
989
+ identifier: str = field(repr=False)
990
+ value: str = field(repr=False)
991
+ expires_at: Timestamp = field(repr=False)
992
+ created_at: Timestamp = field(repr=False)
993
+ updated_at: Timestamp = field(repr=False)
994
+ revision: Annotated[int, "u64"] = field(repr=False)
995
+
996
+ @dataclass(frozen=True, slots=True, kw_only=True)
997
+ class FindVerificationByIdFound:
998
+ verification: FindVerificationByIdFoundVerification = field(repr=False)
999
+ outcome: Literal["Found"] = field(default="Found", init=False)
1000
+
1001
+ def is_found(self) -> bool:
1002
+ return True
1003
+
1004
+ def is_missing(self) -> bool:
1005
+ return False
1006
+
1007
+ def unwrap_found(self) -> FindVerificationByIdFound:
1008
+ return self
1009
+
1010
+ @dataclass(frozen=True, slots=True, kw_only=True)
1011
+ class FindVerificationByIdMissing:
1012
+ outcome: Literal["Missing"] = field(default="Missing", init=False)
1013
+
1014
+ def is_found(self) -> bool:
1015
+ return False
1016
+
1017
+ def is_missing(self) -> bool:
1018
+ return True
1019
+
1020
+ def unwrap_found(self) -> FindVerificationByIdFound:
1021
+ raise ValueError("expected FindVerificationById outcome found")
1022
+
1023
+ FindVerificationByIdResult: TypeAlias = FindVerificationByIdFound | FindVerificationByIdMissing
1024
+
1025
+ FIND_VERIFICATIONS_BY_IDENTIFIER_QUERY_PLAN_HASH: Final[str] = "d98f43e146032b3cd1d0dfb2eacd432795f1545fcfa00e0e45b0fbd891d8b3ed"
1026
+ FIND_VERIFICATIONS_BY_IDENTIFIER_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
1027
+ ("FindVerificationsByIdentifier", "Verification", "value"),
1028
+ )
1029
+
1030
+
1031
+ @dataclass(frozen=True, slots=True, kw_only=True)
1032
+ class FindVerificationsByIdentifierParams:
1033
+ organization_id: UUID
1034
+ identifier: str
1035
+ after: str | None = None
1036
+
1037
+ @dataclass(frozen=True, slots=True, kw_only=True)
1038
+ class FindVerificationsByIdentifierFoundVerifications:
1039
+ verification_id: UUID = field(repr=False)
1040
+ identifier: str = field(repr=False)
1041
+ value: str = field(repr=False)
1042
+ expires_at: Timestamp = field(repr=False)
1043
+ created_at: Timestamp = field(repr=False)
1044
+ updated_at: Timestamp = field(repr=False)
1045
+ revision: Annotated[int, "u64"] = field(repr=False)
1046
+
1047
+ @dataclass(frozen=True, slots=True, kw_only=True)
1048
+ class FindVerificationsByIdentifierFound:
1049
+ verifications: tuple[FindVerificationsByIdentifierFoundVerifications, ...] = field(repr=False)
1050
+ outcome: Literal["Found"] = field(default="Found", init=False)
1051
+
1052
+ def is_found(self) -> bool:
1053
+ return True
1054
+
1055
+ def unwrap_found(self) -> FindVerificationsByIdentifierFound:
1056
+ return self
1057
+
1058
+ FindVerificationsByIdentifierResult: TypeAlias = FindVerificationsByIdentifierFound
1059
+
1060
+ CONSUME_VERIFICATION_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str, str], ...]] = (
1061
+ ("VerificationConsumed", "value", "Verification", "value"),
1062
+ )
1063
+
1064
+ @dataclass(frozen=True, slots=True, kw_only=True)
1065
+ class ConsumeVerificationInput:
1066
+ request_id: UUID
1067
+ organization_id: UUID
1068
+ verification_id: UUID
1069
+
1070
+ CONSUME_VERIFICATION_PLAN_HASH: Final[str] = "22a3f3b01aeb537ae2b8b3f758aa19d8f8a6a58a0e284b3b347d1079972adef2"
1071
+ @dataclass(frozen=True, slots=True, kw_only=True, repr=False)
1072
+ class ConsumeVerificationVerificationConsumed:
1073
+ value: str
1074
+ revision: Annotated[int, "u64"]
1075
+ created_at: Timestamp
1076
+ expires_at: Timestamp
1077
+ identifier: str
1078
+ updated_at: Timestamp
1079
+ verification_id: UUID
1080
+ outcome: Literal["VerificationConsumed"] = field(default="VerificationConsumed", init=False)
1081
+
1082
+ def is_verification_consumed(self) -> bool:
1083
+ return True
1084
+
1085
+ def is_verification_consume_missing(self) -> bool:
1086
+ return False
1087
+
1088
+ def __repr__(self) -> str:
1089
+ return "ConsumeVerificationVerificationConsumed(<secret outputs redacted>)"
1090
+
1091
+ @dataclass(frozen=True, slots=True, kw_only=True)
1092
+ class ConsumeVerificationVerificationConsumeMissing:
1093
+ outcome: Literal["VerificationConsumeMissing"] = field(default="VerificationConsumeMissing", init=False)
1094
+
1095
+ def is_verification_consumed(self) -> bool:
1096
+ return False
1097
+
1098
+ def is_verification_consume_missing(self) -> bool:
1099
+ return True
1100
+
1101
+ ConsumeVerificationOutcome: TypeAlias = ConsumeVerificationVerificationConsumed | ConsumeVerificationVerificationConsumeMissing
1102
+
1103
+ @dataclass(frozen=True, slots=True, kw_only=True)
1104
+ class ConsumeVerificationSetInput:
1105
+ request_id: UUID
1106
+ organization_id: UUID
1107
+ verification_ids: tuple[UUID, ...]
1108
+
1109
+ CONSUME_VERIFICATION_SET_PLAN_HASH: Final[str] = "cc5e0d69851c61f11bbbca45ad00bec80b32687a94272379e133fbf854d59780"
1110
+ @dataclass(frozen=True, slots=True, kw_only=True)
1111
+ class ConsumeVerificationSetVerificationSetConsumed:
1112
+ outcome: Literal["VerificationSetConsumed"] = field(default="VerificationSetConsumed", init=False)
1113
+
1114
+ def is_verification_set_consumed(self) -> bool:
1115
+ return True
1116
+
1117
+ def is_verification_consume_missing(self) -> bool:
1118
+ return False
1119
+
1120
+ @dataclass(frozen=True, slots=True, kw_only=True)
1121
+ class ConsumeVerificationSetVerificationConsumeMissing:
1122
+ outcome: Literal["VerificationConsumeMissing"] = field(default="VerificationConsumeMissing", init=False)
1123
+
1124
+ def is_verification_set_consumed(self) -> bool:
1125
+ return False
1126
+
1127
+ def is_verification_consume_missing(self) -> bool:
1128
+ return True
1129
+
1130
+ ConsumeVerificationSetOutcome: TypeAlias = ConsumeVerificationSetVerificationSetConsumed | ConsumeVerificationSetVerificationConsumeMissing
1131
+
1132
+ @dataclass(frozen=True, slots=True, kw_only=True)
1133
+ class CreateAccountInput:
1134
+ id: UUID
1135
+ scope: str | None
1136
+ user_id: UUID
1137
+ id_token: str | None
1138
+ password: str | None
1139
+ account_id: str
1140
+ created_at: Timestamp
1141
+ request_id: UUID
1142
+ updated_at: Timestamp
1143
+ provider_id: str
1144
+ access_token: str | None
1145
+ refresh_token: str | None
1146
+ organization_id: UUID
1147
+ access_token_expires_at: Timestamp | None
1148
+ refresh_token_expires_at: Timestamp | None
1149
+
1150
+ CREATE_ACCOUNT_PLAN_HASH: Final[str] = "53f2e7b330780eb514a299ceb673da4f1eeaea81beb45253267a52e41a7fd0b2"
1151
+ @dataclass(frozen=True, slots=True, kw_only=True)
1152
+ class CreateAccountAccountCreated:
1153
+ outcome: Literal["AccountCreated"] = field(default="AccountCreated", init=False)
1154
+
1155
+ def is_account_created(self) -> bool:
1156
+ return True
1157
+
1158
+ def is_account_user_missing(self) -> bool:
1159
+ return False
1160
+
1161
+ def is_account_already_exists(self) -> bool:
1162
+ return False
1163
+
1164
+ @dataclass(frozen=True, slots=True, kw_only=True)
1165
+ class CreateAccountAccountUserMissing:
1166
+ outcome: Literal["AccountUserMissing"] = field(default="AccountUserMissing", init=False)
1167
+
1168
+ def is_account_created(self) -> bool:
1169
+ return False
1170
+
1171
+ def is_account_user_missing(self) -> bool:
1172
+ return True
1173
+
1174
+ def is_account_already_exists(self) -> bool:
1175
+ return False
1176
+
1177
+ @dataclass(frozen=True, slots=True, kw_only=True)
1178
+ class CreateAccountAccountAlreadyExists:
1179
+ outcome: Literal["AccountAlreadyExists"] = field(default="AccountAlreadyExists", init=False)
1180
+
1181
+ def is_account_created(self) -> bool:
1182
+ return False
1183
+
1184
+ def is_account_user_missing(self) -> bool:
1185
+ return False
1186
+
1187
+ def is_account_already_exists(self) -> bool:
1188
+ return True
1189
+
1190
+ CreateAccountOutcome: TypeAlias = CreateAccountAccountCreated | CreateAccountAccountUserMissing | CreateAccountAccountAlreadyExists
1191
+
1192
+ @dataclass(frozen=True, slots=True, kw_only=True)
1193
+ class CreateOAuthUserGraphInput:
1194
+ scope: str | None
1195
+ user_id: UUID
1196
+ id_token: str | None
1197
+ password: str | None
1198
+ user_name: str
1199
+ account_id: UUID
1200
+ request_id: UUID
1201
+ user_email: str
1202
+ user_image: str | None
1203
+ provider_id: str
1204
+ access_token: str | None
1205
+ refresh_token: str | None
1206
+ organization_id: UUID
1207
+ user_created_at: Timestamp
1208
+ user_updated_at: Timestamp
1209
+ account_created_at: Timestamp
1210
+ account_updated_at: Timestamp
1211
+ external_account_id: str
1212
+ user_email_verified: bool
1213
+ access_token_expires_at: Timestamp | None
1214
+ refresh_token_expires_at: Timestamp | None
1215
+
1216
+ CREATE_OAUTH_USER_GRAPH_PLAN_HASH: Final[str] = "a30c6faca9666ff17536e1f4ec35f0306e970430a064e0d72a66adccefad7407"
1217
+ @dataclass(frozen=True, slots=True, kw_only=True)
1218
+ class CreateOAuthUserGraphOAuthUserExists:
1219
+ outcome: Literal["OAuthUserExists"] = field(default="OAuthUserExists", init=False)
1220
+
1221
+ def is_oauth_user_exists(self) -> bool:
1222
+ return True
1223
+
1224
+ def is_oauth_account_exists(self) -> bool:
1225
+ return False
1226
+
1227
+ def is_oauth_user_graph_created(self) -> bool:
1228
+ return False
1229
+
1230
+ @dataclass(frozen=True, slots=True, kw_only=True)
1231
+ class CreateOAuthUserGraphOAuthAccountExists:
1232
+ outcome: Literal["OAuthAccountExists"] = field(default="OAuthAccountExists", init=False)
1233
+
1234
+ def is_oauth_user_exists(self) -> bool:
1235
+ return False
1236
+
1237
+ def is_oauth_account_exists(self) -> bool:
1238
+ return True
1239
+
1240
+ def is_oauth_user_graph_created(self) -> bool:
1241
+ return False
1242
+
1243
+ @dataclass(frozen=True, slots=True, kw_only=True)
1244
+ class CreateOAuthUserGraphOAuthUserGraphCreated:
1245
+ outcome: Literal["OAuthUserGraphCreated"] = field(default="OAuthUserGraphCreated", init=False)
1246
+
1247
+ def is_oauth_user_exists(self) -> bool:
1248
+ return False
1249
+
1250
+ def is_oauth_account_exists(self) -> bool:
1251
+ return False
1252
+
1253
+ def is_oauth_user_graph_created(self) -> bool:
1254
+ return True
1255
+
1256
+ CreateOAuthUserGraphOutcome: TypeAlias = CreateOAuthUserGraphOAuthUserExists | CreateOAuthUserGraphOAuthAccountExists | CreateOAuthUserGraphOAuthUserGraphCreated
1257
+
1258
+ @dataclass(frozen=True, slots=True, kw_only=True)
1259
+ class CreateSessionInput:
1260
+ id: UUID
1261
+ token: str
1262
+ user_id: UUID
1263
+ created_at: Timestamp
1264
+ expires_at: Timestamp
1265
+ ip_address: str | None
1266
+ request_id: UUID
1267
+ updated_at: Timestamp
1268
+ user_agent: str | None
1269
+ organization_id: UUID
1270
+
1271
+ CREATE_SESSION_PLAN_HASH: Final[str] = "c5e41496adb0a45f87503008fa43da87c6c729674bb1f521625ff16183059050"
1272
+ @dataclass(frozen=True, slots=True, kw_only=True)
1273
+ class CreateSessionSessionCreated:
1274
+ outcome: Literal["SessionCreated"] = field(default="SessionCreated", init=False)
1275
+
1276
+ def is_session_created(self) -> bool:
1277
+ return True
1278
+
1279
+ def is_session_user_missing(self) -> bool:
1280
+ return False
1281
+
1282
+ def is_session_already_exists(self) -> bool:
1283
+ return False
1284
+
1285
+ @dataclass(frozen=True, slots=True, kw_only=True)
1286
+ class CreateSessionSessionUserMissing:
1287
+ outcome: Literal["SessionUserMissing"] = field(default="SessionUserMissing", init=False)
1288
+
1289
+ def is_session_created(self) -> bool:
1290
+ return False
1291
+
1292
+ def is_session_user_missing(self) -> bool:
1293
+ return True
1294
+
1295
+ def is_session_already_exists(self) -> bool:
1296
+ return False
1297
+
1298
+ @dataclass(frozen=True, slots=True, kw_only=True)
1299
+ class CreateSessionSessionAlreadyExists:
1300
+ outcome: Literal["SessionAlreadyExists"] = field(default="SessionAlreadyExists", init=False)
1301
+
1302
+ def is_session_created(self) -> bool:
1303
+ return False
1304
+
1305
+ def is_session_user_missing(self) -> bool:
1306
+ return False
1307
+
1308
+ def is_session_already_exists(self) -> bool:
1309
+ return True
1310
+
1311
+ CreateSessionOutcome: TypeAlias = CreateSessionSessionCreated | CreateSessionSessionUserMissing | CreateSessionSessionAlreadyExists
1312
+
1313
+ @dataclass(frozen=True, slots=True, kw_only=True)
1314
+ class CreateSignupGraphInput:
1315
+ user_id: UUID
1316
+ user_name: str
1317
+ account_id: UUID
1318
+ request_id: UUID
1319
+ session_id: UUID
1320
+ user_email: str
1321
+ user_image: str | None
1322
+ provider_id: str
1323
+ session_token: str
1324
+ organization_id: UUID
1325
+ user_created_at: Timestamp
1326
+ user_updated_at: Timestamp
1327
+ account_password: str | None
1328
+ account_created_at: Timestamp
1329
+ account_updated_at: Timestamp
1330
+ session_created_at: Timestamp
1331
+ session_expires_at: Timestamp
1332
+ session_ip_address: str | None
1333
+ session_updated_at: Timestamp
1334
+ session_user_agent: str | None
1335
+ external_account_id: str
1336
+ user_email_verified: bool
1337
+
1338
+ CREATE_SIGNUP_GRAPH_PLAN_HASH: Final[str] = "01e4e118b1cc5c3a16c19259284cd0845e8a2e405fc02f81ab9b1fcafc79d0b8"
1339
+ @dataclass(frozen=True, slots=True, kw_only=True)
1340
+ class CreateSignupGraphSignupUserExists:
1341
+ outcome: Literal["SignupUserExists"] = field(default="SignupUserExists", init=False)
1342
+
1343
+ def is_signup_user_exists(self) -> bool:
1344
+ return True
1345
+
1346
+ def is_signup_graph_created(self) -> bool:
1347
+ return False
1348
+
1349
+ def is_signup_account_exists(self) -> bool:
1350
+ return False
1351
+
1352
+ def is_signup_session_exists(self) -> bool:
1353
+ return False
1354
+
1355
+ @dataclass(frozen=True, slots=True, kw_only=True)
1356
+ class CreateSignupGraphSignupGraphCreated:
1357
+ outcome: Literal["SignupGraphCreated"] = field(default="SignupGraphCreated", init=False)
1358
+
1359
+ def is_signup_user_exists(self) -> bool:
1360
+ return False
1361
+
1362
+ def is_signup_graph_created(self) -> bool:
1363
+ return True
1364
+
1365
+ def is_signup_account_exists(self) -> bool:
1366
+ return False
1367
+
1368
+ def is_signup_session_exists(self) -> bool:
1369
+ return False
1370
+
1371
+ @dataclass(frozen=True, slots=True, kw_only=True)
1372
+ class CreateSignupGraphSignupAccountExists:
1373
+ outcome: Literal["SignupAccountExists"] = field(default="SignupAccountExists", init=False)
1374
+
1375
+ def is_signup_user_exists(self) -> bool:
1376
+ return False
1377
+
1378
+ def is_signup_graph_created(self) -> bool:
1379
+ return False
1380
+
1381
+ def is_signup_account_exists(self) -> bool:
1382
+ return True
1383
+
1384
+ def is_signup_session_exists(self) -> bool:
1385
+ return False
1386
+
1387
+ @dataclass(frozen=True, slots=True, kw_only=True)
1388
+ class CreateSignupGraphSignupSessionExists:
1389
+ outcome: Literal["SignupSessionExists"] = field(default="SignupSessionExists", init=False)
1390
+
1391
+ def is_signup_user_exists(self) -> bool:
1392
+ return False
1393
+
1394
+ def is_signup_graph_created(self) -> bool:
1395
+ return False
1396
+
1397
+ def is_signup_account_exists(self) -> bool:
1398
+ return False
1399
+
1400
+ def is_signup_session_exists(self) -> bool:
1401
+ return True
1402
+
1403
+ CreateSignupGraphOutcome: TypeAlias = CreateSignupGraphSignupUserExists | CreateSignupGraphSignupGraphCreated | CreateSignupGraphSignupAccountExists | CreateSignupGraphSignupSessionExists
1404
+
1405
+ @dataclass(frozen=True, slots=True, kw_only=True)
1406
+ class CreateUserInput:
1407
+ id: UUID
1408
+ name: str
1409
+ email: str
1410
+ image: str | None
1411
+ created_at: Timestamp
1412
+ request_id: UUID
1413
+ updated_at: Timestamp
1414
+ email_verified: bool
1415
+ organization_id: UUID
1416
+
1417
+ CREATE_USER_PLAN_HASH: Final[str] = "752d7d404aa418b5c1a08065ce9a8efbb28ab2b62f18969c98a13a06092fd8b3"
1418
+ @dataclass(frozen=True, slots=True, kw_only=True)
1419
+ class CreateUserUserCreated:
1420
+ outcome: Literal["UserCreated"] = field(default="UserCreated", init=False)
1421
+
1422
+ def is_user_created(self) -> bool:
1423
+ return True
1424
+
1425
+ def is_user_already_exists(self) -> bool:
1426
+ return False
1427
+
1428
+ @dataclass(frozen=True, slots=True, kw_only=True)
1429
+ class CreateUserUserAlreadyExists:
1430
+ outcome: Literal["UserAlreadyExists"] = field(default="UserAlreadyExists", init=False)
1431
+
1432
+ def is_user_created(self) -> bool:
1433
+ return False
1434
+
1435
+ def is_user_already_exists(self) -> bool:
1436
+ return True
1437
+
1438
+ CreateUserOutcome: TypeAlias = CreateUserUserCreated | CreateUserUserAlreadyExists
1439
+
1440
+ @dataclass(frozen=True, slots=True, kw_only=True)
1441
+ class CreateVerificationInput:
1442
+ id: UUID
1443
+ value: str
1444
+ created_at: Timestamp
1445
+ expires_at: Timestamp
1446
+ identifier: str
1447
+ request_id: UUID
1448
+ updated_at: Timestamp
1449
+ organization_id: UUID
1450
+
1451
+ CREATE_VERIFICATION_PLAN_HASH: Final[str] = "82bce005457b1fcf1d069a69304f7bf4e2eeb7d2718d5289dc9d25e197309e35"
1452
+ @dataclass(frozen=True, slots=True, kw_only=True)
1453
+ class CreateVerificationVerificationCreated:
1454
+ outcome: Literal["VerificationCreated"] = field(default="VerificationCreated", init=False)
1455
+
1456
+ def is_verification_created(self) -> bool:
1457
+ return True
1458
+
1459
+ def is_verification_already_exists(self) -> bool:
1460
+ return False
1461
+
1462
+ @dataclass(frozen=True, slots=True, kw_only=True)
1463
+ class CreateVerificationVerificationAlreadyExists:
1464
+ outcome: Literal["VerificationAlreadyExists"] = field(default="VerificationAlreadyExists", init=False)
1465
+
1466
+ def is_verification_created(self) -> bool:
1467
+ return False
1468
+
1469
+ def is_verification_already_exists(self) -> bool:
1470
+ return True
1471
+
1472
+ CreateVerificationOutcome: TypeAlias = CreateVerificationVerificationCreated | CreateVerificationVerificationAlreadyExists
1473
+
1474
+ @dataclass(frozen=True, slots=True, kw_only=True)
1475
+ class DeleteAccountInput:
1476
+ user_id: UUID
1477
+ request_id: UUID
1478
+ account_ids: tuple[UUID, ...]
1479
+ organization_id: UUID
1480
+
1481
+ DELETE_ACCOUNT_PLAN_HASH: Final[str] = "6429ebe6e70797c57c44a4738c8a511bbe5304e5bf58148dfc0c2721ffaff382"
1482
+ @dataclass(frozen=True, slots=True, kw_only=True)
1483
+ class DeleteAccountAccountDeleted:
1484
+ outcome: Literal["AccountDeleted"] = field(default="AccountDeleted", init=False)
1485
+
1486
+ def is_account_deleted(self) -> bool:
1487
+ return True
1488
+
1489
+ def is_account_missing(self) -> bool:
1490
+ return False
1491
+
1492
+ @dataclass(frozen=True, slots=True, kw_only=True)
1493
+ class DeleteAccountAccountMissing:
1494
+ outcome: Literal["AccountMissing"] = field(default="AccountMissing", init=False)
1495
+
1496
+ def is_account_deleted(self) -> bool:
1497
+ return False
1498
+
1499
+ def is_account_missing(self) -> bool:
1500
+ return True
1501
+
1502
+ DeleteAccountOutcome: TypeAlias = DeleteAccountAccountDeleted | DeleteAccountAccountMissing
1503
+
1504
+ @dataclass(frozen=True, slots=True, kw_only=True)
1505
+ class DeleteSessionInput:
1506
+ user_id: UUID
1507
+ request_id: UUID
1508
+ session_ids: tuple[UUID, ...]
1509
+ organization_id: UUID
1510
+
1511
+ DELETE_SESSION_PLAN_HASH: Final[str] = "a3901beb6c2d2754fd3d2c64252b6f5059cd1792c0a0560741c94da4668a0524"
1512
+ @dataclass(frozen=True, slots=True, kw_only=True)
1513
+ class DeleteSessionSessionDeleted:
1514
+ outcome: Literal["SessionDeleted"] = field(default="SessionDeleted", init=False)
1515
+
1516
+ def is_session_deleted(self) -> bool:
1517
+ return True
1518
+
1519
+ def is_session_missing(self) -> bool:
1520
+ return False
1521
+
1522
+ @dataclass(frozen=True, slots=True, kw_only=True)
1523
+ class DeleteSessionSessionMissing:
1524
+ outcome: Literal["SessionMissing"] = field(default="SessionMissing", init=False)
1525
+
1526
+ def is_session_deleted(self) -> bool:
1527
+ return False
1528
+
1529
+ def is_session_missing(self) -> bool:
1530
+ return True
1531
+
1532
+ DeleteSessionOutcome: TypeAlias = DeleteSessionSessionDeleted | DeleteSessionSessionMissing
1533
+
1534
+ @dataclass(frozen=True, slots=True, kw_only=True)
1535
+ class DeleteUserInput:
1536
+ user_ids: tuple[UUID, ...]
1537
+ request_id: UUID
1538
+ organization_id: UUID
1539
+
1540
+ DELETE_USER_PLAN_HASH: Final[str] = "f7195857c4f50a68b37ee0f8516c27dd03b08d5cd5ba45f53d9f9345d2f90985"
1541
+ @dataclass(frozen=True, slots=True, kw_only=True)
1542
+ class DeleteUserUserDeleted:
1543
+ outcome: Literal["UserDeleted"] = field(default="UserDeleted", init=False)
1544
+
1545
+ def is_user_deleted(self) -> bool:
1546
+ return True
1547
+
1548
+ def is_delete_user_missing(self) -> bool:
1549
+ return False
1550
+
1551
+ def is_delete_user_cascade_limit_exceeded(self) -> bool:
1552
+ return False
1553
+
1554
+ @dataclass(frozen=True, slots=True, kw_only=True)
1555
+ class DeleteUserDeleteUserMissing:
1556
+ outcome: Literal["DeleteUserMissing"] = field(default="DeleteUserMissing", init=False)
1557
+
1558
+ def is_user_deleted(self) -> bool:
1559
+ return False
1560
+
1561
+ def is_delete_user_missing(self) -> bool:
1562
+ return True
1563
+
1564
+ def is_delete_user_cascade_limit_exceeded(self) -> bool:
1565
+ return False
1566
+
1567
+ @dataclass(frozen=True, slots=True, kw_only=True)
1568
+ class DeleteUserDeleteUserCascadeLimitExceeded:
1569
+ outcome: Literal["DeleteUserCascadeLimitExceeded"] = field(default="DeleteUserCascadeLimitExceeded", init=False)
1570
+
1571
+ def is_user_deleted(self) -> bool:
1572
+ return False
1573
+
1574
+ def is_delete_user_missing(self) -> bool:
1575
+ return False
1576
+
1577
+ def is_delete_user_cascade_limit_exceeded(self) -> bool:
1578
+ return True
1579
+
1580
+ DeleteUserOutcome: TypeAlias = DeleteUserUserDeleted | DeleteUserDeleteUserMissing | DeleteUserDeleteUserCascadeLimitExceeded
1581
+
1582
+ @dataclass(frozen=True, slots=True, kw_only=True)
1583
+ class DeleteVerificationInput:
1584
+ request_id: UUID
1585
+ organization_id: UUID
1586
+ verification_ids: tuple[UUID, ...]
1587
+
1588
+ DELETE_VERIFICATION_PLAN_HASH: Final[str] = "bffc0c5ef5ad2b602954492d043e833785ec3f9d6f0520fbc0f933422544ae6a"
1589
+ @dataclass(frozen=True, slots=True, kw_only=True)
1590
+ class DeleteVerificationVerificationDeleted:
1591
+ outcome: Literal["VerificationDeleted"] = field(default="VerificationDeleted", init=False)
1592
+
1593
+ def is_verification_deleted(self) -> bool:
1594
+ return True
1595
+
1596
+ def is_verification_missing(self) -> bool:
1597
+ return False
1598
+
1599
+ @dataclass(frozen=True, slots=True, kw_only=True)
1600
+ class DeleteVerificationVerificationMissing:
1601
+ outcome: Literal["VerificationMissing"] = field(default="VerificationMissing", init=False)
1602
+
1603
+ def is_verification_deleted(self) -> bool:
1604
+ return False
1605
+
1606
+ def is_verification_missing(self) -> bool:
1607
+ return True
1608
+
1609
+ DeleteVerificationOutcome: TypeAlias = DeleteVerificationVerificationDeleted | DeleteVerificationVerificationMissing
1610
+
1611
+ @dataclass(frozen=True, slots=True, kw_only=True)
1612
+ class UpdateAccountInput:
1613
+ scope: str | None
1614
+ user_id: UUID
1615
+ id_token: str | None
1616
+ password: str | None
1617
+ account_id: UUID
1618
+ request_id: UUID
1619
+ updated_at: Timestamp
1620
+ provider_id: str
1621
+ access_token: str | None
1622
+ refresh_token: str | None
1623
+ organization_id: UUID
1624
+ expected_revision: Annotated[int, "u64"]
1625
+ external_account_id: str
1626
+ access_token_expires_at: Timestamp | None
1627
+ refresh_token_expires_at: Timestamp | None
1628
+
1629
+ UPDATE_ACCOUNT_PLAN_HASH: Final[str] = "1556cd92effd135225904f0313f1cdf146ebe82f72621ebeccb2686c5442b849"
1630
+ @dataclass(frozen=True, slots=True, kw_only=True)
1631
+ class UpdateAccountAccountUpdated:
1632
+ outcome: Literal["AccountUpdated"] = field(default="AccountUpdated", init=False)
1633
+
1634
+ def is_account_updated(self) -> bool:
1635
+ return True
1636
+
1637
+ def is_account_update_stale(self) -> bool:
1638
+ return False
1639
+
1640
+ def is_account_update_missing(self) -> bool:
1641
+ return False
1642
+
1643
+ @dataclass(frozen=True, slots=True, kw_only=True)
1644
+ class UpdateAccountAccountUpdateStale:
1645
+ outcome: Literal["AccountUpdateStale"] = field(default="AccountUpdateStale", init=False)
1646
+
1647
+ def is_account_updated(self) -> bool:
1648
+ return False
1649
+
1650
+ def is_account_update_stale(self) -> bool:
1651
+ return True
1652
+
1653
+ def is_account_update_missing(self) -> bool:
1654
+ return False
1655
+
1656
+ @dataclass(frozen=True, slots=True, kw_only=True)
1657
+ class UpdateAccountAccountUpdateMissing:
1658
+ outcome: Literal["AccountUpdateMissing"] = field(default="AccountUpdateMissing", init=False)
1659
+
1660
+ def is_account_updated(self) -> bool:
1661
+ return False
1662
+
1663
+ def is_account_update_stale(self) -> bool:
1664
+ return False
1665
+
1666
+ def is_account_update_missing(self) -> bool:
1667
+ return True
1668
+
1669
+ UpdateAccountOutcome: TypeAlias = UpdateAccountAccountUpdated | UpdateAccountAccountUpdateStale | UpdateAccountAccountUpdateMissing
1670
+
1671
+ @dataclass(frozen=True, slots=True, kw_only=True)
1672
+ class UpdateAccountPasswordsInput:
1673
+ updates: tuple[AccountPasswordUpdate, ...]
1674
+ user_id: UUID
1675
+ request_id: UUID
1676
+ organization_id: UUID
1677
+
1678
+ UPDATE_ACCOUNT_PASSWORDS_PLAN_HASH: Final[str] = "5f18c741b5e9c09203c67b5985af9d034fad670462ecdda32a0a1f031ef288f6"
1679
+ @dataclass(frozen=True, slots=True, kw_only=True)
1680
+ class UpdateAccountPasswordsPasswordAccountStale:
1681
+ outcome: Literal["PasswordAccountStale"] = field(default="PasswordAccountStale", init=False)
1682
+
1683
+ def is_password_account_stale(self) -> bool:
1684
+ return True
1685
+
1686
+ def is_password_account_missing(self) -> bool:
1687
+ return False
1688
+
1689
+ def is_account_passwords_updated(self) -> bool:
1690
+ return False
1691
+
1692
+ def is_password_provider_mismatch(self) -> bool:
1693
+ return False
1694
+
1695
+ @dataclass(frozen=True, slots=True, kw_only=True)
1696
+ class UpdateAccountPasswordsPasswordAccountMissing:
1697
+ outcome: Literal["PasswordAccountMissing"] = field(default="PasswordAccountMissing", init=False)
1698
+
1699
+ def is_password_account_stale(self) -> bool:
1700
+ return False
1701
+
1702
+ def is_password_account_missing(self) -> bool:
1703
+ return True
1704
+
1705
+ def is_account_passwords_updated(self) -> bool:
1706
+ return False
1707
+
1708
+ def is_password_provider_mismatch(self) -> bool:
1709
+ return False
1710
+
1711
+ @dataclass(frozen=True, slots=True, kw_only=True)
1712
+ class UpdateAccountPasswordsAccountPasswordsUpdated:
1713
+ outcome: Literal["AccountPasswordsUpdated"] = field(default="AccountPasswordsUpdated", init=False)
1714
+
1715
+ def is_password_account_stale(self) -> bool:
1716
+ return False
1717
+
1718
+ def is_password_account_missing(self) -> bool:
1719
+ return False
1720
+
1721
+ def is_account_passwords_updated(self) -> bool:
1722
+ return True
1723
+
1724
+ def is_password_provider_mismatch(self) -> bool:
1725
+ return False
1726
+
1727
+ @dataclass(frozen=True, slots=True, kw_only=True)
1728
+ class UpdateAccountPasswordsPasswordProviderMismatch:
1729
+ outcome: Literal["PasswordProviderMismatch"] = field(default="PasswordProviderMismatch", init=False)
1730
+
1731
+ def is_password_account_stale(self) -> bool:
1732
+ return False
1733
+
1734
+ def is_password_account_missing(self) -> bool:
1735
+ return False
1736
+
1737
+ def is_account_passwords_updated(self) -> bool:
1738
+ return False
1739
+
1740
+ def is_password_provider_mismatch(self) -> bool:
1741
+ return True
1742
+
1743
+ UpdateAccountPasswordsOutcome: TypeAlias = UpdateAccountPasswordsPasswordAccountStale | UpdateAccountPasswordsPasswordAccountMissing | UpdateAccountPasswordsAccountPasswordsUpdated | UpdateAccountPasswordsPasswordProviderMismatch
1744
+
1745
+ @dataclass(frozen=True, slots=True, kw_only=True)
1746
+ class UpdateSessionInput:
1747
+ user_id: UUID
1748
+ expires_at: Timestamp
1749
+ ip_address: str | None
1750
+ request_id: UUID
1751
+ session_id: UUID
1752
+ updated_at: Timestamp
1753
+ user_agent: str | None
1754
+ organization_id: UUID
1755
+ expected_revision: Annotated[int, "u64"]
1756
+
1757
+ UPDATE_SESSION_PLAN_HASH: Final[str] = "4c1184c5c0a1f8b8935a8b96204ad839afe84e1752f2ba24cdf63feef4f7ce3a"
1758
+ @dataclass(frozen=True, slots=True, kw_only=True)
1759
+ class UpdateSessionSessionUpdated:
1760
+ outcome: Literal["SessionUpdated"] = field(default="SessionUpdated", init=False)
1761
+
1762
+ def is_session_updated(self) -> bool:
1763
+ return True
1764
+
1765
+ def is_session_update_stale(self) -> bool:
1766
+ return False
1767
+
1768
+ def is_session_update_missing(self) -> bool:
1769
+ return False
1770
+
1771
+ @dataclass(frozen=True, slots=True, kw_only=True)
1772
+ class UpdateSessionSessionUpdateStale:
1773
+ outcome: Literal["SessionUpdateStale"] = field(default="SessionUpdateStale", init=False)
1774
+
1775
+ def is_session_updated(self) -> bool:
1776
+ return False
1777
+
1778
+ def is_session_update_stale(self) -> bool:
1779
+ return True
1780
+
1781
+ def is_session_update_missing(self) -> bool:
1782
+ return False
1783
+
1784
+ @dataclass(frozen=True, slots=True, kw_only=True)
1785
+ class UpdateSessionSessionUpdateMissing:
1786
+ outcome: Literal["SessionUpdateMissing"] = field(default="SessionUpdateMissing", init=False)
1787
+
1788
+ def is_session_updated(self) -> bool:
1789
+ return False
1790
+
1791
+ def is_session_update_stale(self) -> bool:
1792
+ return False
1793
+
1794
+ def is_session_update_missing(self) -> bool:
1795
+ return True
1796
+
1797
+ UpdateSessionOutcome: TypeAlias = UpdateSessionSessionUpdated | UpdateSessionSessionUpdateStale | UpdateSessionSessionUpdateMissing
1798
+
1799
+ @dataclass(frozen=True, slots=True, kw_only=True)
1800
+ class UpdateUserInput:
1801
+ name: str
1802
+ email: str
1803
+ image: str | None
1804
+ user_id: UUID
1805
+ request_id: UUID
1806
+ updated_at: Timestamp
1807
+ email_verified: bool
1808
+ organization_id: UUID
1809
+ expected_revision: Annotated[int, "u64"]
1810
+
1811
+ UPDATE_USER_PLAN_HASH: Final[str] = "cd0d3c8108976d4b2413f41fd68791b3e9276a763787f40b82bef17219091194"
1812
+ @dataclass(frozen=True, slots=True, kw_only=True)
1813
+ class UpdateUserUserUpdated:
1814
+ outcome: Literal["UserUpdated"] = field(default="UserUpdated", init=False)
1815
+
1816
+ def is_user_updated(self) -> bool:
1817
+ return True
1818
+
1819
+ def is_user_update_stale(self) -> bool:
1820
+ return False
1821
+
1822
+ def is_user_update_missing(self) -> bool:
1823
+ return False
1824
+
1825
+ @dataclass(frozen=True, slots=True, kw_only=True)
1826
+ class UpdateUserUserUpdateStale:
1827
+ outcome: Literal["UserUpdateStale"] = field(default="UserUpdateStale", init=False)
1828
+
1829
+ def is_user_updated(self) -> bool:
1830
+ return False
1831
+
1832
+ def is_user_update_stale(self) -> bool:
1833
+ return True
1834
+
1835
+ def is_user_update_missing(self) -> bool:
1836
+ return False
1837
+
1838
+ @dataclass(frozen=True, slots=True, kw_only=True)
1839
+ class UpdateUserUserUpdateMissing:
1840
+ outcome: Literal["UserUpdateMissing"] = field(default="UserUpdateMissing", init=False)
1841
+
1842
+ def is_user_updated(self) -> bool:
1843
+ return False
1844
+
1845
+ def is_user_update_stale(self) -> bool:
1846
+ return False
1847
+
1848
+ def is_user_update_missing(self) -> bool:
1849
+ return True
1850
+
1851
+ UpdateUserOutcome: TypeAlias = UpdateUserUserUpdated | UpdateUserUserUpdateStale | UpdateUserUserUpdateMissing
1852
+
1853
+ @dataclass(frozen=True, slots=True, kw_only=True)
1854
+ class UpdateVerificationInput:
1855
+ value: str
1856
+ expires_at: Timestamp
1857
+ request_id: UUID
1858
+ updated_at: Timestamp
1859
+ organization_id: UUID
1860
+ verification_id: UUID
1861
+ expected_revision: Annotated[int, "u64"]
1862
+
1863
+ UPDATE_VERIFICATION_PLAN_HASH: Final[str] = "b9ea963db584e7fd9dbce1069d982dc0f53ebb06b72b41b060578b284596018f"
1864
+ @dataclass(frozen=True, slots=True, kw_only=True)
1865
+ class UpdateVerificationVerificationUpdated:
1866
+ outcome: Literal["VerificationUpdated"] = field(default="VerificationUpdated", init=False)
1867
+
1868
+ def is_verification_updated(self) -> bool:
1869
+ return True
1870
+
1871
+ def is_verification_update_stale(self) -> bool:
1872
+ return False
1873
+
1874
+ def is_verification_update_missing(self) -> bool:
1875
+ return False
1876
+
1877
+ @dataclass(frozen=True, slots=True, kw_only=True)
1878
+ class UpdateVerificationVerificationUpdateStale:
1879
+ outcome: Literal["VerificationUpdateStale"] = field(default="VerificationUpdateStale", init=False)
1880
+
1881
+ def is_verification_updated(self) -> bool:
1882
+ return False
1883
+
1884
+ def is_verification_update_stale(self) -> bool:
1885
+ return True
1886
+
1887
+ def is_verification_update_missing(self) -> bool:
1888
+ return False
1889
+
1890
+ @dataclass(frozen=True, slots=True, kw_only=True)
1891
+ class UpdateVerificationVerificationUpdateMissing:
1892
+ outcome: Literal["VerificationUpdateMissing"] = field(default="VerificationUpdateMissing", init=False)
1893
+
1894
+ def is_verification_updated(self) -> bool:
1895
+ return False
1896
+
1897
+ def is_verification_update_stale(self) -> bool:
1898
+ return False
1899
+
1900
+ def is_verification_update_missing(self) -> bool:
1901
+ return True
1902
+
1903
+ UpdateVerificationOutcome: TypeAlias = UpdateVerificationVerificationUpdated | UpdateVerificationVerificationUpdateStale | UpdateVerificationVerificationUpdateMissing
1904
+
1905
+ class RiffDBBetterAuthCoreClient:
1906
+ def __init__(self, transport: SyncApplicationTransport, command_attempts: AttemptBudget = AttemptBudget(3), *, read_after_commit: int | None = None, track_causal_writes: bool = True) -> None:
1907
+ self._transport = transport
1908
+ self._command_attempts = command_attempts
1909
+ self._read_after_commit = read_after_commit
1910
+ self._track_causal_writes = track_causal_writes
1911
+
1912
+ @classmethod
1913
+ def from_transport(cls, transport: SyncApplicationTransport, command_attempts: AttemptBudget = AttemptBudget(3)) -> RiffDBBetterAuthCoreClient:
1914
+ return cls(transport, command_attempts)
1915
+
1916
+ def with_read_after_commit(self, commit_sequence: int | None) -> RiffDBBetterAuthCoreClient:
1917
+ return RiffDBBetterAuthCoreClient(self._transport, self._command_attempts, read_after_commit=commit_sequence, track_causal_writes=self._track_causal_writes)
1918
+
1919
+ def causal_session(self, initial_commit_sequence: int | None = None) -> RiffDBBetterAuthCoreClient:
1920
+ return RiffDBBetterAuthCoreClient(self._transport, self._command_attempts, read_after_commit=initial_commit_sequence if initial_commit_sequence is not None else self._read_after_commit, track_causal_writes=True)
1921
+
1922
+ @property
1923
+ def last_commit_sequence(self) -> int | None:
1924
+ return self._read_after_commit
1925
+
1926
+ def admin_users_all_email_asc(self, parameters: AdminUsersAllEmailAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersAllEmailAscResult]:
1927
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
1928
+ raise ValueError("limit must be an integer from 1 through 100")
1929
+ if options.read_after_commit is None and self._read_after_commit is not None:
1930
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
1931
+ raw = self._transport._execute_named_query(
1932
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
1933
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
1934
+ query_name="AdminUsersAllEmailAsc", plan_hash=ADMIN_USERS_ALL_EMAIL_ASC_QUERY_PLAN_HASH,
1935
+ parameters=encode_record(parameters), options=options,
1936
+ )
1937
+ outcomes = {
1938
+ "Found": AdminUsersAllEmailAscFound,
1939
+ }
1940
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
1941
+
1942
+ def admin_users_all_email_asc_after_commit(self, parameters: AdminUsersAllEmailAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersAllEmailAscResult]:
1943
+ return self.admin_users_all_email_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
1944
+
1945
+ def admin_users_contains_asc(self, parameters: AdminUsersContainsAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsAscResult]:
1946
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
1947
+ raise ValueError("limit must be an integer from 1 through 100")
1948
+ if options.read_after_commit is None and self._read_after_commit is not None:
1949
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
1950
+ raw = self._transport._execute_named_query(
1951
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
1952
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
1953
+ query_name="AdminUsersContainsAsc", plan_hash=ADMIN_USERS_CONTAINS_ASC_QUERY_PLAN_HASH,
1954
+ parameters=encode_record(parameters), options=options,
1955
+ )
1956
+ outcomes = {
1957
+ "Found": AdminUsersContainsAscFound,
1958
+ }
1959
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
1960
+
1961
+ def admin_users_contains_asc_after_commit(self, parameters: AdminUsersContainsAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsAscResult]:
1962
+ return self.admin_users_contains_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
1963
+
1964
+ def admin_users_contains_desc(self, parameters: AdminUsersContainsDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsDescResult]:
1965
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
1966
+ raise ValueError("limit must be an integer from 1 through 100")
1967
+ if options.read_after_commit is None and self._read_after_commit is not None:
1968
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
1969
+ raw = self._transport._execute_named_query(
1970
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
1971
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
1972
+ query_name="AdminUsersContainsDesc", plan_hash=ADMIN_USERS_CONTAINS_DESC_QUERY_PLAN_HASH,
1973
+ parameters=encode_record(parameters), options=options,
1974
+ )
1975
+ outcomes = {
1976
+ "Found": AdminUsersContainsDescFound,
1977
+ }
1978
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
1979
+
1980
+ def admin_users_contains_desc_after_commit(self, parameters: AdminUsersContainsDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsDescResult]:
1981
+ return self.admin_users_contains_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
1982
+
1983
+ def admin_users_email_contains_created_desc(self, parameters: AdminUsersEmailContainsCreatedDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsCreatedDescResult]:
1984
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
1985
+ raise ValueError("limit must be an integer from 1 through 100")
1986
+ if options.read_after_commit is None and self._read_after_commit is not None:
1987
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
1988
+ raw = self._transport._execute_named_query(
1989
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
1990
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
1991
+ query_name="AdminUsersEmailContainsCreatedDesc", plan_hash=ADMIN_USERS_EMAIL_CONTAINS_CREATED_DESC_QUERY_PLAN_HASH,
1992
+ parameters=encode_record(parameters), options=options,
1993
+ )
1994
+ outcomes = {
1995
+ "Found": AdminUsersEmailContainsCreatedDescFound,
1996
+ }
1997
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
1998
+
1999
+ def admin_users_email_contains_created_desc_after_commit(self, parameters: AdminUsersEmailContainsCreatedDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsCreatedDescResult]:
2000
+ return self.admin_users_email_contains_created_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2001
+
2002
+ def admin_users_email_contains_image_asc(self, parameters: AdminUsersEmailContainsImageAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsImageAscResult]:
2003
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
2004
+ raise ValueError("limit must be an integer from 1 through 100")
2005
+ if options.read_after_commit is None and self._read_after_commit is not None:
2006
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2007
+ raw = self._transport._execute_named_query(
2008
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2009
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2010
+ query_name="AdminUsersEmailContainsImageAsc", plan_hash=ADMIN_USERS_EMAIL_CONTAINS_IMAGE_ASC_QUERY_PLAN_HASH,
2011
+ parameters=encode_record(parameters), options=options,
2012
+ )
2013
+ outcomes = {
2014
+ "Found": AdminUsersEmailContainsImageAscFound,
2015
+ }
2016
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2017
+
2018
+ def admin_users_email_contains_image_asc_after_commit(self, parameters: AdminUsersEmailContainsImageAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsImageAscResult]:
2019
+ return self.admin_users_email_contains_image_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2020
+
2021
+ def admin_users_ends_with_asc(self, parameters: AdminUsersEndsWithAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithAscResult]:
2022
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
2023
+ raise ValueError("limit must be an integer from 1 through 100")
2024
+ if options.read_after_commit is None and self._read_after_commit is not None:
2025
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2026
+ raw = self._transport._execute_named_query(
2027
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2028
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2029
+ query_name="AdminUsersEndsWithAsc", plan_hash=ADMIN_USERS_ENDS_WITH_ASC_QUERY_PLAN_HASH,
2030
+ parameters=encode_record(parameters), options=options,
2031
+ )
2032
+ outcomes = {
2033
+ "Found": AdminUsersEndsWithAscFound,
2034
+ }
2035
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2036
+
2037
+ def admin_users_ends_with_asc_after_commit(self, parameters: AdminUsersEndsWithAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithAscResult]:
2038
+ return self.admin_users_ends_with_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2039
+
2040
+ def admin_users_ends_with_desc(self, parameters: AdminUsersEndsWithDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithDescResult]:
2041
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
2042
+ raise ValueError("limit must be an integer from 1 through 100")
2043
+ if options.read_after_commit is None and self._read_after_commit is not None:
2044
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2045
+ raw = self._transport._execute_named_query(
2046
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2047
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2048
+ query_name="AdminUsersEndsWithDesc", plan_hash=ADMIN_USERS_ENDS_WITH_DESC_QUERY_PLAN_HASH,
2049
+ parameters=encode_record(parameters), options=options,
2050
+ )
2051
+ outcomes = {
2052
+ "Found": AdminUsersEndsWithDescFound,
2053
+ }
2054
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2055
+
2056
+ def admin_users_ends_with_desc_after_commit(self, parameters: AdminUsersEndsWithDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithDescResult]:
2057
+ return self.admin_users_ends_with_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2058
+
2059
+ def admin_users_starts_with_asc(self, parameters: AdminUsersStartsWithAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithAscResult]:
2060
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
2061
+ raise ValueError("limit must be an integer from 1 through 100")
2062
+ if options.read_after_commit is None and self._read_after_commit is not None:
2063
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2064
+ raw = self._transport._execute_named_query(
2065
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2066
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2067
+ query_name="AdminUsersStartsWithAsc", plan_hash=ADMIN_USERS_STARTS_WITH_ASC_QUERY_PLAN_HASH,
2068
+ parameters=encode_record(parameters), options=options,
2069
+ )
2070
+ outcomes = {
2071
+ "Found": AdminUsersStartsWithAscFound,
2072
+ }
2073
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2074
+
2075
+ def admin_users_starts_with_asc_after_commit(self, parameters: AdminUsersStartsWithAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithAscResult]:
2076
+ return self.admin_users_starts_with_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2077
+
2078
+ def admin_users_starts_with_desc(self, parameters: AdminUsersStartsWithDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithDescResult]:
2079
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
2080
+ raise ValueError("limit must be an integer from 1 through 100")
2081
+ if options.read_after_commit is None and self._read_after_commit is not None:
2082
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2083
+ raw = self._transport._execute_named_query(
2084
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2085
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2086
+ query_name="AdminUsersStartsWithDesc", plan_hash=ADMIN_USERS_STARTS_WITH_DESC_QUERY_PLAN_HASH,
2087
+ parameters=encode_record(parameters), options=options,
2088
+ )
2089
+ outcomes = {
2090
+ "Found": AdminUsersStartsWithDescFound,
2091
+ }
2092
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2093
+
2094
+ def admin_users_starts_with_desc_after_commit(self, parameters: AdminUsersStartsWithDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithDescResult]:
2095
+ return self.admin_users_starts_with_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2096
+
2097
+ def find_account_by_id(self, parameters: FindAccountByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByIdResult]:
2098
+ if options.read_after_commit is None and self._read_after_commit is not None:
2099
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2100
+ raw = self._transport._execute_named_query(
2101
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2102
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2103
+ query_name="FindAccountById", plan_hash=FIND_ACCOUNT_BY_ID_QUERY_PLAN_HASH,
2104
+ parameters=encode_record(parameters), options=options,
2105
+ )
2106
+ outcomes = {
2107
+ "Found": FindAccountByIdFound,
2108
+ }
2109
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2110
+
2111
+ def find_account_by_id_after_commit(self, parameters: FindAccountByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByIdResult]:
2112
+ return self.find_account_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2113
+
2114
+ def find_account_by_provider(self, parameters: FindAccountByProviderParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByProviderResult]:
2115
+ if options.read_after_commit is None and self._read_after_commit is not None:
2116
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2117
+ raw = self._transport._execute_named_query(
2118
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2119
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2120
+ query_name="FindAccountByProvider", plan_hash=FIND_ACCOUNT_BY_PROVIDER_QUERY_PLAN_HASH,
2121
+ parameters=encode_record(parameters), options=options,
2122
+ )
2123
+ outcomes = {
2124
+ "Found": FindAccountByProviderFound,
2125
+ }
2126
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2127
+
2128
+ def find_account_by_provider_after_commit(self, parameters: FindAccountByProviderParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByProviderResult]:
2129
+ return self.find_account_by_provider(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2130
+
2131
+ def find_accounts_by_user_id(self, parameters: FindAccountsByUserIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserIdResult]:
2132
+ encoded_parameters = encode_record(parameters)
2133
+ generated_cursor = parameters.after
2134
+ if generated_cursor is not None:
2135
+ if options.cursor is not None:
2136
+ raise ValueError("generated cursor conflicts with query options")
2137
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
2138
+ encoded_parameters.pop("after", None)
2139
+ if options.read_after_commit is None and self._read_after_commit is not None:
2140
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2141
+ raw = self._transport._execute_named_query(
2142
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2143
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2144
+ query_name="FindAccountsByUserId", plan_hash=FIND_ACCOUNTS_BY_USER_ID_QUERY_PLAN_HASH,
2145
+ parameters=encoded_parameters, options=options,
2146
+ )
2147
+ outcomes = {
2148
+ "Found": FindAccountsByUserIdFound,
2149
+ }
2150
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2151
+
2152
+ def find_accounts_by_user_id_after_commit(self, parameters: FindAccountsByUserIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserIdResult]:
2153
+ return self.find_accounts_by_user_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2154
+
2155
+ def find_accounts_by_user_id_pages(self, parameters: FindAccountsByUserIdParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindAccountsByUserIdResult]]:
2156
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
2157
+ raise ValueError("max_pages must be an integer from 1 through 1024")
2158
+ if parameters.after is not None and options.cursor is not None:
2159
+ raise ValueError("generated cursor conflicts with query options")
2160
+ cursor = options.cursor if options.cursor is not None else parameters.after
2161
+ pages: list[TypedQueryResult[FindAccountsByUserIdResult]] = []
2162
+ for _ in range(max_pages):
2163
+ page_parameters = FindAccountsByUserIdParams(organization_id=parameters.organization_id, user_id=parameters.user_id, after=None)
2164
+ page = self.find_accounts_by_user_id(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
2165
+ pages.append(page)
2166
+ if not page.next_cursor:
2167
+ break
2168
+ cursor = page.next_cursor
2169
+ return pages
2170
+
2171
+ def find_accounts_by_user_provider(self, parameters: FindAccountsByUserProviderParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserProviderResult]:
2172
+ encoded_parameters = encode_record(parameters)
2173
+ generated_cursor = parameters.after
2174
+ if generated_cursor is not None:
2175
+ if options.cursor is not None:
2176
+ raise ValueError("generated cursor conflicts with query options")
2177
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
2178
+ encoded_parameters.pop("after", None)
2179
+ if options.read_after_commit is None and self._read_after_commit is not None:
2180
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2181
+ raw = self._transport._execute_named_query(
2182
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2183
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2184
+ query_name="FindAccountsByUserProvider", plan_hash=FIND_ACCOUNTS_BY_USER_PROVIDER_QUERY_PLAN_HASH,
2185
+ parameters=encoded_parameters, options=options,
2186
+ )
2187
+ outcomes = {
2188
+ "Found": FindAccountsByUserProviderFound,
2189
+ }
2190
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2191
+
2192
+ def find_accounts_by_user_provider_after_commit(self, parameters: FindAccountsByUserProviderParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserProviderResult]:
2193
+ return self.find_accounts_by_user_provider(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2194
+
2195
+ def find_accounts_by_user_provider_pages(self, parameters: FindAccountsByUserProviderParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindAccountsByUserProviderResult]]:
2196
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
2197
+ raise ValueError("max_pages must be an integer from 1 through 1024")
2198
+ if parameters.after is not None and options.cursor is not None:
2199
+ raise ValueError("generated cursor conflicts with query options")
2200
+ cursor = options.cursor if options.cursor is not None else parameters.after
2201
+ pages: list[TypedQueryResult[FindAccountsByUserProviderResult]] = []
2202
+ for _ in range(max_pages):
2203
+ page_parameters = FindAccountsByUserProviderParams(organization_id=parameters.organization_id, user_id=parameters.user_id, provider_id=parameters.provider_id, after=None)
2204
+ page = self.find_accounts_by_user_provider(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
2205
+ pages.append(page)
2206
+ if not page.next_cursor:
2207
+ break
2208
+ cursor = page.next_cursor
2209
+ return pages
2210
+
2211
+ def find_active_sessions_by_user_id(self, parameters: FindActiveSessionsByUserIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindActiveSessionsByUserIdResult]:
2212
+ encoded_parameters = encode_record(parameters)
2213
+ generated_cursor = parameters.after
2214
+ if generated_cursor is not None:
2215
+ if options.cursor is not None:
2216
+ raise ValueError("generated cursor conflicts with query options")
2217
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
2218
+ encoded_parameters.pop("after", None)
2219
+ if options.read_after_commit is None and self._read_after_commit is not None:
2220
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2221
+ raw = self._transport._execute_named_query(
2222
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2223
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2224
+ query_name="FindActiveSessionsByUserId", plan_hash=FIND_ACTIVE_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH,
2225
+ parameters=encoded_parameters, options=options,
2226
+ )
2227
+ outcomes = {
2228
+ "Found": FindActiveSessionsByUserIdFound,
2229
+ }
2230
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2231
+
2232
+ def find_active_sessions_by_user_id_after_commit(self, parameters: FindActiveSessionsByUserIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindActiveSessionsByUserIdResult]:
2233
+ return self.find_active_sessions_by_user_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2234
+
2235
+ def find_active_sessions_by_user_id_pages(self, parameters: FindActiveSessionsByUserIdParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindActiveSessionsByUserIdResult]]:
2236
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
2237
+ raise ValueError("max_pages must be an integer from 1 through 1024")
2238
+ if parameters.after is not None and options.cursor is not None:
2239
+ raise ValueError("generated cursor conflicts with query options")
2240
+ cursor = options.cursor if options.cursor is not None else parameters.after
2241
+ pages: list[TypedQueryResult[FindActiveSessionsByUserIdResult]] = []
2242
+ for _ in range(max_pages):
2243
+ page_parameters = FindActiveSessionsByUserIdParams(organization_id=parameters.organization_id, user_id=parameters.user_id, expires_after=parameters.expires_after, after=None)
2244
+ page = self.find_active_sessions_by_user_id(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
2245
+ pages.append(page)
2246
+ if not page.next_cursor:
2247
+ break
2248
+ cursor = page.next_cursor
2249
+ return pages
2250
+
2251
+ def find_expired_verification_ids(self, parameters: FindExpiredVerificationIdsParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindExpiredVerificationIdsResult]:
2252
+ encoded_parameters = encode_record(parameters)
2253
+ generated_cursor = parameters.after
2254
+ if generated_cursor is not None:
2255
+ if options.cursor is not None:
2256
+ raise ValueError("generated cursor conflicts with query options")
2257
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
2258
+ encoded_parameters.pop("after", None)
2259
+ if options.read_after_commit is None and self._read_after_commit is not None:
2260
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2261
+ raw = self._transport._execute_named_query(
2262
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2263
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2264
+ query_name="FindExpiredVerificationIds", plan_hash=FIND_EXPIRED_VERIFICATION_IDS_QUERY_PLAN_HASH,
2265
+ parameters=encoded_parameters, options=options,
2266
+ )
2267
+ outcomes = {
2268
+ "Found": FindExpiredVerificationIdsFound,
2269
+ }
2270
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2271
+
2272
+ def find_expired_verification_ids_after_commit(self, parameters: FindExpiredVerificationIdsParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindExpiredVerificationIdsResult]:
2273
+ return self.find_expired_verification_ids(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2274
+
2275
+ def find_expired_verification_ids_pages(self, parameters: FindExpiredVerificationIdsParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindExpiredVerificationIdsResult]]:
2276
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
2277
+ raise ValueError("max_pages must be an integer from 1 through 1024")
2278
+ if parameters.after is not None and options.cursor is not None:
2279
+ raise ValueError("generated cursor conflicts with query options")
2280
+ cursor = options.cursor if options.cursor is not None else parameters.after
2281
+ pages: list[TypedQueryResult[FindExpiredVerificationIdsResult]] = []
2282
+ for _ in range(max_pages):
2283
+ page_parameters = FindExpiredVerificationIdsParams(organization_id=parameters.organization_id, expires_before=parameters.expires_before, after=None)
2284
+ page = self.find_expired_verification_ids(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
2285
+ pages.append(page)
2286
+ if not page.next_cursor:
2287
+ break
2288
+ cursor = page.next_cursor
2289
+ return pages
2290
+
2291
+ def find_latest_verification(self, parameters: FindLatestVerificationParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindLatestVerificationResult]:
2292
+ if options.read_after_commit is None and self._read_after_commit is not None:
2293
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2294
+ raw = self._transport._execute_named_query(
2295
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2296
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2297
+ query_name="FindLatestVerification", plan_hash=FIND_LATEST_VERIFICATION_QUERY_PLAN_HASH,
2298
+ parameters=encode_record(parameters), options=options,
2299
+ )
2300
+ outcomes = {
2301
+ "Found": FindLatestVerificationFound,
2302
+ }
2303
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2304
+
2305
+ def find_latest_verification_after_commit(self, parameters: FindLatestVerificationParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindLatestVerificationResult]:
2306
+ return self.find_latest_verification(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2307
+
2308
+ def find_session_by_id(self, parameters: FindSessionByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByIdResult]:
2309
+ if options.read_after_commit is None and self._read_after_commit is not None:
2310
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2311
+ raw = self._transport._execute_named_query(
2312
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2313
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2314
+ query_name="FindSessionById", plan_hash=FIND_SESSION_BY_ID_QUERY_PLAN_HASH,
2315
+ parameters=encode_record(parameters), options=options,
2316
+ )
2317
+ outcomes = {
2318
+ "Found": FindSessionByIdFound,
2319
+ }
2320
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2321
+
2322
+ def find_session_by_id_after_commit(self, parameters: FindSessionByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByIdResult]:
2323
+ return self.find_session_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2324
+
2325
+ def find_session_by_token(self, parameters: FindSessionByTokenParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByTokenResult]:
2326
+ if options.read_after_commit is None and self._read_after_commit is not None:
2327
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2328
+ raw = self._transport._execute_named_query(
2329
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2330
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2331
+ query_name="FindSessionByToken", plan_hash=FIND_SESSION_BY_TOKEN_QUERY_PLAN_HASH,
2332
+ parameters=encode_record(parameters), options=options,
2333
+ )
2334
+ outcomes = {
2335
+ "Found": FindSessionByTokenFound,
2336
+ }
2337
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2338
+
2339
+ def find_session_by_token_after_commit(self, parameters: FindSessionByTokenParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByTokenResult]:
2340
+ return self.find_session_by_token(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2341
+
2342
+ def find_sessions_by_token_set(self, parameters: FindSessionsByTokenSetParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByTokenSetResult]:
2343
+ if options.read_after_commit is None and self._read_after_commit is not None:
2344
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2345
+ raw = self._transport._execute_named_query(
2346
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2347
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2348
+ query_name="FindSessionsByTokenSet", plan_hash=FIND_SESSIONS_BY_TOKEN_SET_QUERY_PLAN_HASH,
2349
+ parameters=encode_record(parameters), options=options,
2350
+ )
2351
+ outcomes = {
2352
+ "Found": FindSessionsByTokenSetFound,
2353
+ }
2354
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2355
+
2356
+ def find_sessions_by_token_set_after_commit(self, parameters: FindSessionsByTokenSetParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByTokenSetResult]:
2357
+ return self.find_sessions_by_token_set(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2358
+
2359
+ def find_sessions_by_user_id(self, parameters: FindSessionsByUserIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByUserIdResult]:
2360
+ encoded_parameters = encode_record(parameters)
2361
+ generated_cursor = parameters.after
2362
+ if generated_cursor is not None:
2363
+ if options.cursor is not None:
2364
+ raise ValueError("generated cursor conflicts with query options")
2365
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
2366
+ encoded_parameters.pop("after", None)
2367
+ if options.read_after_commit is None and self._read_after_commit is not None:
2368
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2369
+ raw = self._transport._execute_named_query(
2370
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2371
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2372
+ query_name="FindSessionsByUserId", plan_hash=FIND_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH,
2373
+ parameters=encoded_parameters, options=options,
2374
+ )
2375
+ outcomes = {
2376
+ "Found": FindSessionsByUserIdFound,
2377
+ }
2378
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2379
+
2380
+ def find_sessions_by_user_id_after_commit(self, parameters: FindSessionsByUserIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByUserIdResult]:
2381
+ return self.find_sessions_by_user_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2382
+
2383
+ def find_sessions_by_user_id_pages(self, parameters: FindSessionsByUserIdParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindSessionsByUserIdResult]]:
2384
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
2385
+ raise ValueError("max_pages must be an integer from 1 through 1024")
2386
+ if parameters.after is not None and options.cursor is not None:
2387
+ raise ValueError("generated cursor conflicts with query options")
2388
+ cursor = options.cursor if options.cursor is not None else parameters.after
2389
+ pages: list[TypedQueryResult[FindSessionsByUserIdResult]] = []
2390
+ for _ in range(max_pages):
2391
+ page_parameters = FindSessionsByUserIdParams(organization_id=parameters.organization_id, user_id=parameters.user_id, after=None)
2392
+ page = self.find_sessions_by_user_id(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
2393
+ pages.append(page)
2394
+ if not page.next_cursor:
2395
+ break
2396
+ cursor = page.next_cursor
2397
+ return pages
2398
+
2399
+ def find_user_by_email(self, parameters: FindUserByEmailParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByEmailResult]:
2400
+ if options.read_after_commit is None and self._read_after_commit is not None:
2401
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2402
+ raw = self._transport._execute_named_query(
2403
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2404
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2405
+ query_name="FindUserByEmail", plan_hash=FIND_USER_BY_EMAIL_QUERY_PLAN_HASH,
2406
+ parameters=encode_record(parameters), options=options,
2407
+ accept_compact_result=True,
2408
+ )
2409
+ outcomes = {
2410
+ "Found": FindUserByEmailFound,
2411
+ }
2412
+ return raw._map_value(lambda value: _decode_find_user_by_email_compact(value) if isinstance(value, dict) and "$riffdb_compact" in value else decode_variant(outcomes, value))
2413
+
2414
+ def find_user_by_email_after_commit(self, parameters: FindUserByEmailParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByEmailResult]:
2415
+ return self.find_user_by_email(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2416
+
2417
+ def find_user_by_id(self, parameters: FindUserByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByIdResult]:
2418
+ if options.read_after_commit is None and self._read_after_commit is not None:
2419
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2420
+ raw = self._transport._execute_named_query(
2421
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2422
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2423
+ query_name="FindUserById", plan_hash=FIND_USER_BY_ID_QUERY_PLAN_HASH,
2424
+ parameters=encode_record(parameters), options=options,
2425
+ )
2426
+ outcomes = {
2427
+ "Found": FindUserByIdFound,
2428
+ "Missing": FindUserByIdMissing,
2429
+ }
2430
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2431
+
2432
+ def find_user_by_id_after_commit(self, parameters: FindUserByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByIdResult]:
2433
+ return self.find_user_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2434
+
2435
+ def find_verification_by_id(self, parameters: FindVerificationByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationByIdResult]:
2436
+ if options.read_after_commit is None and self._read_after_commit is not None:
2437
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2438
+ raw = self._transport._execute_named_query(
2439
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2440
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2441
+ query_name="FindVerificationById", plan_hash=FIND_VERIFICATION_BY_ID_QUERY_PLAN_HASH,
2442
+ parameters=encode_record(parameters), options=options,
2443
+ )
2444
+ outcomes = {
2445
+ "Found": FindVerificationByIdFound,
2446
+ "Missing": FindVerificationByIdMissing,
2447
+ }
2448
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2449
+
2450
+ def find_verification_by_id_after_commit(self, parameters: FindVerificationByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationByIdResult]:
2451
+ return self.find_verification_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2452
+
2453
+ def find_verifications_by_identifier(self, parameters: FindVerificationsByIdentifierParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationsByIdentifierResult]:
2454
+ encoded_parameters = encode_record(parameters)
2455
+ generated_cursor = parameters.after
2456
+ if generated_cursor is not None:
2457
+ if options.cursor is not None:
2458
+ raise ValueError("generated cursor conflicts with query options")
2459
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
2460
+ encoded_parameters.pop("after", None)
2461
+ if options.read_after_commit is None and self._read_after_commit is not None:
2462
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2463
+ raw = self._transport._execute_named_query(
2464
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2465
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2466
+ query_name="FindVerificationsByIdentifier", plan_hash=FIND_VERIFICATIONS_BY_IDENTIFIER_QUERY_PLAN_HASH,
2467
+ parameters=encoded_parameters, options=options,
2468
+ )
2469
+ outcomes = {
2470
+ "Found": FindVerificationsByIdentifierFound,
2471
+ }
2472
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2473
+
2474
+ def find_verifications_by_identifier_after_commit(self, parameters: FindVerificationsByIdentifierParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationsByIdentifierResult]:
2475
+ return self.find_verifications_by_identifier(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2476
+
2477
+ def find_verifications_by_identifier_pages(self, parameters: FindVerificationsByIdentifierParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindVerificationsByIdentifierResult]]:
2478
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
2479
+ raise ValueError("max_pages must be an integer from 1 through 1024")
2480
+ if parameters.after is not None and options.cursor is not None:
2481
+ raise ValueError("generated cursor conflicts with query options")
2482
+ cursor = options.cursor if options.cursor is not None else parameters.after
2483
+ pages: list[TypedQueryResult[FindVerificationsByIdentifierResult]] = []
2484
+ for _ in range(max_pages):
2485
+ page_parameters = FindVerificationsByIdentifierParams(organization_id=parameters.organization_id, identifier=parameters.identifier, after=None)
2486
+ page = self.find_verifications_by_identifier(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
2487
+ pages.append(page)
2488
+ if not page.next_cursor:
2489
+ break
2490
+ cursor = page.next_cursor
2491
+ return pages
2492
+
2493
+ def consume_verification(self, input: ConsumeVerificationInput) -> TypedCommandResult[ConsumeVerificationOutcome]:
2494
+ raw = self._transport._execute_command(
2495
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2496
+ command_name="ConsumeVerification", plan_hash=CONSUME_VERIFICATION_PLAN_HASH,
2497
+ input=encode_record(input), attempts=self._command_attempts,
2498
+ )
2499
+ outcomes = {
2500
+ "VerificationConsumed": ConsumeVerificationVerificationConsumed,
2501
+ "VerificationConsumeMissing": ConsumeVerificationVerificationConsumeMissing,
2502
+ }
2503
+ result: TypedCommandResult[ConsumeVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2504
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2505
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2506
+ return result
2507
+
2508
+ def consume_verification_batch(
2509
+ self, inputs: Sequence[ConsumeVerificationInput], options: CommandBatchOptions,
2510
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2511
+ ) -> CommandBatchResult[ConsumeVerificationOutcome]:
2512
+ return self._transport._command_batch(inputs, options, self.consume_verification, progress)
2513
+
2514
+ def consume_verification_set(self, input: ConsumeVerificationSetInput) -> TypedCommandResult[ConsumeVerificationSetOutcome]:
2515
+ if not 1 <= len(input.verification_ids) <= 32:
2516
+ raise ValueError("invalid bounded collection length for ConsumeVerificationSet.verification_ids")
2517
+ raw = self._transport._execute_command(
2518
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2519
+ command_name="ConsumeVerificationSet", plan_hash=CONSUME_VERIFICATION_SET_PLAN_HASH,
2520
+ input=encode_record(input), attempts=self._command_attempts,
2521
+ )
2522
+ outcomes = {
2523
+ "VerificationSetConsumed": ConsumeVerificationSetVerificationSetConsumed,
2524
+ "VerificationConsumeMissing": ConsumeVerificationSetVerificationConsumeMissing,
2525
+ }
2526
+ result: TypedCommandResult[ConsumeVerificationSetOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2527
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2528
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2529
+ return result
2530
+
2531
+ def consume_verification_set_batch(
2532
+ self, inputs: Sequence[ConsumeVerificationSetInput], options: CommandBatchOptions,
2533
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2534
+ ) -> CommandBatchResult[ConsumeVerificationSetOutcome]:
2535
+ for input in inputs:
2536
+ if not 1 <= len(input.verification_ids) <= 32:
2537
+ raise ValueError("invalid bounded collection length for ConsumeVerificationSet.verification_ids")
2538
+ return self._transport._command_batch(inputs, options, self.consume_verification_set, progress)
2539
+
2540
+ def create_account(self, input: CreateAccountInput) -> TypedCommandResult[CreateAccountOutcome]:
2541
+ raw = self._transport._execute_command(
2542
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2543
+ command_name="CreateAccount", plan_hash=CREATE_ACCOUNT_PLAN_HASH,
2544
+ input=encode_record(input), attempts=self._command_attempts,
2545
+ )
2546
+ outcomes = {
2547
+ "AccountCreated": CreateAccountAccountCreated,
2548
+ "AccountUserMissing": CreateAccountAccountUserMissing,
2549
+ "AccountAlreadyExists": CreateAccountAccountAlreadyExists,
2550
+ }
2551
+ result: TypedCommandResult[CreateAccountOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2552
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2553
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2554
+ return result
2555
+
2556
+ def create_account_batch(
2557
+ self, inputs: Sequence[CreateAccountInput], options: CommandBatchOptions,
2558
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2559
+ ) -> CommandBatchResult[CreateAccountOutcome]:
2560
+ return self._transport._command_batch(inputs, options, self.create_account, progress)
2561
+
2562
+ def create_oauth_user_graph(self, input: CreateOAuthUserGraphInput) -> TypedCommandResult[CreateOAuthUserGraphOutcome]:
2563
+ raw = self._transport._execute_command(
2564
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2565
+ command_name="CreateOAuthUserGraph", plan_hash=CREATE_OAUTH_USER_GRAPH_PLAN_HASH,
2566
+ input=encode_record(input), attempts=self._command_attempts,
2567
+ )
2568
+ outcomes = {
2569
+ "OAuthUserExists": CreateOAuthUserGraphOAuthUserExists,
2570
+ "OAuthAccountExists": CreateOAuthUserGraphOAuthAccountExists,
2571
+ "OAuthUserGraphCreated": CreateOAuthUserGraphOAuthUserGraphCreated,
2572
+ }
2573
+ result: TypedCommandResult[CreateOAuthUserGraphOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2574
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2575
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2576
+ return result
2577
+
2578
+ def create_oauth_user_graph_batch(
2579
+ self, inputs: Sequence[CreateOAuthUserGraphInput], options: CommandBatchOptions,
2580
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2581
+ ) -> CommandBatchResult[CreateOAuthUserGraphOutcome]:
2582
+ return self._transport._command_batch(inputs, options, self.create_oauth_user_graph, progress)
2583
+
2584
+ def create_session(self, input: CreateSessionInput) -> TypedCommandResult[CreateSessionOutcome]:
2585
+ raw = self._transport._execute_command(
2586
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2587
+ command_name="CreateSession", plan_hash=CREATE_SESSION_PLAN_HASH,
2588
+ input=encode_record(input), attempts=self._command_attempts,
2589
+ )
2590
+ outcomes = {
2591
+ "SessionCreated": CreateSessionSessionCreated,
2592
+ "SessionUserMissing": CreateSessionSessionUserMissing,
2593
+ "SessionAlreadyExists": CreateSessionSessionAlreadyExists,
2594
+ }
2595
+ result: TypedCommandResult[CreateSessionOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2596
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2597
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2598
+ return result
2599
+
2600
+ def create_session_batch(
2601
+ self, inputs: Sequence[CreateSessionInput], options: CommandBatchOptions,
2602
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2603
+ ) -> CommandBatchResult[CreateSessionOutcome]:
2604
+ return self._transport._command_batch(inputs, options, self.create_session, progress)
2605
+
2606
+ def create_signup_graph(self, input: CreateSignupGraphInput) -> TypedCommandResult[CreateSignupGraphOutcome]:
2607
+ raw = self._transport._execute_command(
2608
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2609
+ command_name="CreateSignupGraph", plan_hash=CREATE_SIGNUP_GRAPH_PLAN_HASH,
2610
+ input=encode_record(input), attempts=self._command_attempts,
2611
+ )
2612
+ outcomes = {
2613
+ "SignupUserExists": CreateSignupGraphSignupUserExists,
2614
+ "SignupGraphCreated": CreateSignupGraphSignupGraphCreated,
2615
+ "SignupAccountExists": CreateSignupGraphSignupAccountExists,
2616
+ "SignupSessionExists": CreateSignupGraphSignupSessionExists,
2617
+ }
2618
+ result: TypedCommandResult[CreateSignupGraphOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2619
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2620
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2621
+ return result
2622
+
2623
+ def create_signup_graph_batch(
2624
+ self, inputs: Sequence[CreateSignupGraphInput], options: CommandBatchOptions,
2625
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2626
+ ) -> CommandBatchResult[CreateSignupGraphOutcome]:
2627
+ return self._transport._command_batch(inputs, options, self.create_signup_graph, progress)
2628
+
2629
+ def create_user(self, input: CreateUserInput) -> TypedCommandResult[CreateUserOutcome]:
2630
+ raw = self._transport._execute_command(
2631
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2632
+ command_name="CreateUser", plan_hash=CREATE_USER_PLAN_HASH,
2633
+ input=encode_record(input), attempts=self._command_attempts,
2634
+ )
2635
+ outcomes = {
2636
+ "UserCreated": CreateUserUserCreated,
2637
+ "UserAlreadyExists": CreateUserUserAlreadyExists,
2638
+ }
2639
+ result: TypedCommandResult[CreateUserOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2640
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2641
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2642
+ return result
2643
+
2644
+ def create_user_batch(
2645
+ self, inputs: Sequence[CreateUserInput], options: CommandBatchOptions,
2646
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2647
+ ) -> CommandBatchResult[CreateUserOutcome]:
2648
+ return self._transport._command_batch(inputs, options, self.create_user, progress)
2649
+
2650
+ def create_verification(self, input: CreateVerificationInput) -> TypedCommandResult[CreateVerificationOutcome]:
2651
+ raw = self._transport._execute_command(
2652
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2653
+ command_name="CreateVerification", plan_hash=CREATE_VERIFICATION_PLAN_HASH,
2654
+ input=encode_record(input), attempts=self._command_attempts,
2655
+ )
2656
+ outcomes = {
2657
+ "VerificationCreated": CreateVerificationVerificationCreated,
2658
+ "VerificationAlreadyExists": CreateVerificationVerificationAlreadyExists,
2659
+ }
2660
+ result: TypedCommandResult[CreateVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2661
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2662
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2663
+ return result
2664
+
2665
+ def create_verification_batch(
2666
+ self, inputs: Sequence[CreateVerificationInput], options: CommandBatchOptions,
2667
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2668
+ ) -> CommandBatchResult[CreateVerificationOutcome]:
2669
+ return self._transport._command_batch(inputs, options, self.create_verification, progress)
2670
+
2671
+ def delete_account(self, input: DeleteAccountInput) -> TypedCommandResult[DeleteAccountOutcome]:
2672
+ if not 1 <= len(input.account_ids) <= 32:
2673
+ raise ValueError("invalid bounded collection length for DeleteAccount.account_ids")
2674
+ raw = self._transport._execute_command(
2675
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2676
+ command_name="DeleteAccount", plan_hash=DELETE_ACCOUNT_PLAN_HASH,
2677
+ input=encode_record(input), attempts=self._command_attempts,
2678
+ )
2679
+ outcomes = {
2680
+ "AccountDeleted": DeleteAccountAccountDeleted,
2681
+ "AccountMissing": DeleteAccountAccountMissing,
2682
+ }
2683
+ result: TypedCommandResult[DeleteAccountOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2684
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2685
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2686
+ return result
2687
+
2688
+ def delete_account_batch(
2689
+ self, inputs: Sequence[DeleteAccountInput], options: CommandBatchOptions,
2690
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2691
+ ) -> CommandBatchResult[DeleteAccountOutcome]:
2692
+ for input in inputs:
2693
+ if not 1 <= len(input.account_ids) <= 32:
2694
+ raise ValueError("invalid bounded collection length for DeleteAccount.account_ids")
2695
+ return self._transport._command_batch(inputs, options, self.delete_account, progress)
2696
+
2697
+ def delete_session(self, input: DeleteSessionInput) -> TypedCommandResult[DeleteSessionOutcome]:
2698
+ if not 1 <= len(input.session_ids) <= 32:
2699
+ raise ValueError("invalid bounded collection length for DeleteSession.session_ids")
2700
+ raw = self._transport._execute_command(
2701
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2702
+ command_name="DeleteSession", plan_hash=DELETE_SESSION_PLAN_HASH,
2703
+ input=encode_record(input), attempts=self._command_attempts,
2704
+ )
2705
+ outcomes = {
2706
+ "SessionDeleted": DeleteSessionSessionDeleted,
2707
+ "SessionMissing": DeleteSessionSessionMissing,
2708
+ }
2709
+ result: TypedCommandResult[DeleteSessionOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2710
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2711
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2712
+ return result
2713
+
2714
+ def delete_session_batch(
2715
+ self, inputs: Sequence[DeleteSessionInput], options: CommandBatchOptions,
2716
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2717
+ ) -> CommandBatchResult[DeleteSessionOutcome]:
2718
+ for input in inputs:
2719
+ if not 1 <= len(input.session_ids) <= 32:
2720
+ raise ValueError("invalid bounded collection length for DeleteSession.session_ids")
2721
+ return self._transport._command_batch(inputs, options, self.delete_session, progress)
2722
+
2723
+ def delete_user(self, input: DeleteUserInput) -> TypedCommandResult[DeleteUserOutcome]:
2724
+ if not 1 <= len(input.user_ids) <= 1:
2725
+ raise ValueError("invalid bounded collection length for DeleteUser.user_ids")
2726
+ raw = self._transport._execute_command(
2727
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2728
+ command_name="DeleteUser", plan_hash=DELETE_USER_PLAN_HASH,
2729
+ input=encode_record(input), attempts=self._command_attempts,
2730
+ )
2731
+ outcomes = {
2732
+ "UserDeleted": DeleteUserUserDeleted,
2733
+ "DeleteUserMissing": DeleteUserDeleteUserMissing,
2734
+ "DeleteUserCascadeLimitExceeded": DeleteUserDeleteUserCascadeLimitExceeded,
2735
+ }
2736
+ result: TypedCommandResult[DeleteUserOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2737
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2738
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2739
+ return result
2740
+
2741
+ def delete_user_batch(
2742
+ self, inputs: Sequence[DeleteUserInput], options: CommandBatchOptions,
2743
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2744
+ ) -> CommandBatchResult[DeleteUserOutcome]:
2745
+ for input in inputs:
2746
+ if not 1 <= len(input.user_ids) <= 1:
2747
+ raise ValueError("invalid bounded collection length for DeleteUser.user_ids")
2748
+ return self._transport._command_batch(inputs, options, self.delete_user, progress)
2749
+
2750
+ def delete_verification(self, input: DeleteVerificationInput) -> TypedCommandResult[DeleteVerificationOutcome]:
2751
+ if not 1 <= len(input.verification_ids) <= 32:
2752
+ raise ValueError("invalid bounded collection length for DeleteVerification.verification_ids")
2753
+ raw = self._transport._execute_command(
2754
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2755
+ command_name="DeleteVerification", plan_hash=DELETE_VERIFICATION_PLAN_HASH,
2756
+ input=encode_record(input), attempts=self._command_attempts,
2757
+ )
2758
+ outcomes = {
2759
+ "VerificationDeleted": DeleteVerificationVerificationDeleted,
2760
+ "VerificationMissing": DeleteVerificationVerificationMissing,
2761
+ }
2762
+ result: TypedCommandResult[DeleteVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2763
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2764
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2765
+ return result
2766
+
2767
+ def delete_verification_batch(
2768
+ self, inputs: Sequence[DeleteVerificationInput], options: CommandBatchOptions,
2769
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2770
+ ) -> CommandBatchResult[DeleteVerificationOutcome]:
2771
+ for input in inputs:
2772
+ if not 1 <= len(input.verification_ids) <= 32:
2773
+ raise ValueError("invalid bounded collection length for DeleteVerification.verification_ids")
2774
+ return self._transport._command_batch(inputs, options, self.delete_verification, progress)
2775
+
2776
+ def update_account(self, input: UpdateAccountInput) -> TypedCommandResult[UpdateAccountOutcome]:
2777
+ raw = self._transport._execute_command(
2778
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2779
+ command_name="UpdateAccount", plan_hash=UPDATE_ACCOUNT_PLAN_HASH,
2780
+ input=encode_record(input), attempts=self._command_attempts,
2781
+ )
2782
+ outcomes = {
2783
+ "AccountUpdated": UpdateAccountAccountUpdated,
2784
+ "AccountUpdateStale": UpdateAccountAccountUpdateStale,
2785
+ "AccountUpdateMissing": UpdateAccountAccountUpdateMissing,
2786
+ }
2787
+ result: TypedCommandResult[UpdateAccountOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2788
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2789
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2790
+ return result
2791
+
2792
+ def update_account_batch(
2793
+ self, inputs: Sequence[UpdateAccountInput], options: CommandBatchOptions,
2794
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2795
+ ) -> CommandBatchResult[UpdateAccountOutcome]:
2796
+ return self._transport._command_batch(inputs, options, self.update_account, progress)
2797
+
2798
+ def update_account_passwords(self, input: UpdateAccountPasswordsInput) -> TypedCommandResult[UpdateAccountPasswordsOutcome]:
2799
+ if not 1 <= len(input.updates) <= 8:
2800
+ raise ValueError("invalid bounded collection length for UpdateAccountPasswords.updates")
2801
+ raw = self._transport._execute_command(
2802
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2803
+ command_name="UpdateAccountPasswords", plan_hash=UPDATE_ACCOUNT_PASSWORDS_PLAN_HASH,
2804
+ input=encode_record(input), attempts=self._command_attempts,
2805
+ )
2806
+ outcomes = {
2807
+ "PasswordAccountStale": UpdateAccountPasswordsPasswordAccountStale,
2808
+ "PasswordAccountMissing": UpdateAccountPasswordsPasswordAccountMissing,
2809
+ "AccountPasswordsUpdated": UpdateAccountPasswordsAccountPasswordsUpdated,
2810
+ "PasswordProviderMismatch": UpdateAccountPasswordsPasswordProviderMismatch,
2811
+ }
2812
+ result: TypedCommandResult[UpdateAccountPasswordsOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2813
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2814
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2815
+ return result
2816
+
2817
+ def update_account_passwords_batch(
2818
+ self, inputs: Sequence[UpdateAccountPasswordsInput], options: CommandBatchOptions,
2819
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2820
+ ) -> CommandBatchResult[UpdateAccountPasswordsOutcome]:
2821
+ for input in inputs:
2822
+ if not 1 <= len(input.updates) <= 8:
2823
+ raise ValueError("invalid bounded collection length for UpdateAccountPasswords.updates")
2824
+ return self._transport._command_batch(inputs, options, self.update_account_passwords, progress)
2825
+
2826
+ def update_session(self, input: UpdateSessionInput) -> TypedCommandResult[UpdateSessionOutcome]:
2827
+ raw = self._transport._execute_command(
2828
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2829
+ command_name="UpdateSession", plan_hash=UPDATE_SESSION_PLAN_HASH,
2830
+ input=encode_record(input), attempts=self._command_attempts,
2831
+ )
2832
+ outcomes = {
2833
+ "SessionUpdated": UpdateSessionSessionUpdated,
2834
+ "SessionUpdateStale": UpdateSessionSessionUpdateStale,
2835
+ "SessionUpdateMissing": UpdateSessionSessionUpdateMissing,
2836
+ }
2837
+ result: TypedCommandResult[UpdateSessionOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2838
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2839
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2840
+ return result
2841
+
2842
+ def update_session_batch(
2843
+ self, inputs: Sequence[UpdateSessionInput], options: CommandBatchOptions,
2844
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2845
+ ) -> CommandBatchResult[UpdateSessionOutcome]:
2846
+ return self._transport._command_batch(inputs, options, self.update_session, progress)
2847
+
2848
+ def update_user(self, input: UpdateUserInput) -> TypedCommandResult[UpdateUserOutcome]:
2849
+ raw = self._transport._execute_command(
2850
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2851
+ command_name="UpdateUser", plan_hash=UPDATE_USER_PLAN_HASH,
2852
+ input=encode_record(input), attempts=self._command_attempts,
2853
+ )
2854
+ outcomes = {
2855
+ "UserUpdated": UpdateUserUserUpdated,
2856
+ "UserUpdateStale": UpdateUserUserUpdateStale,
2857
+ "UserUpdateMissing": UpdateUserUserUpdateMissing,
2858
+ }
2859
+ result: TypedCommandResult[UpdateUserOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2860
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2861
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2862
+ return result
2863
+
2864
+ def update_user_batch(
2865
+ self, inputs: Sequence[UpdateUserInput], options: CommandBatchOptions,
2866
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2867
+ ) -> CommandBatchResult[UpdateUserOutcome]:
2868
+ return self._transport._command_batch(inputs, options, self.update_user, progress)
2869
+
2870
+ def update_verification(self, input: UpdateVerificationInput) -> TypedCommandResult[UpdateVerificationOutcome]:
2871
+ raw = self._transport._execute_command(
2872
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2873
+ command_name="UpdateVerification", plan_hash=UPDATE_VERIFICATION_PLAN_HASH,
2874
+ input=encode_record(input), attempts=self._command_attempts,
2875
+ )
2876
+ outcomes = {
2877
+ "VerificationUpdated": UpdateVerificationVerificationUpdated,
2878
+ "VerificationUpdateStale": UpdateVerificationVerificationUpdateStale,
2879
+ "VerificationUpdateMissing": UpdateVerificationVerificationUpdateMissing,
2880
+ }
2881
+ result: TypedCommandResult[UpdateVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2882
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2883
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
2884
+ return result
2885
+
2886
+ def update_verification_batch(
2887
+ self, inputs: Sequence[UpdateVerificationInput], options: CommandBatchOptions,
2888
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2889
+ ) -> CommandBatchResult[UpdateVerificationOutcome]:
2890
+ return self._transport._command_batch(inputs, options, self.update_verification, progress)
2891
+
2892
+ class AsyncRiffDBBetterAuthCoreClient:
2893
+ def __init__(self, transport: AsyncApplicationTransport, command_attempts: AttemptBudget = AttemptBudget(3), *, read_after_commit: int | None = None, track_causal_writes: bool = True) -> None:
2894
+ self._transport = transport
2895
+ self._command_attempts = command_attempts
2896
+ self._read_after_commit = read_after_commit
2897
+ self._track_causal_writes = track_causal_writes
2898
+
2899
+ @classmethod
2900
+ def from_transport(cls, transport: AsyncApplicationTransport, command_attempts: AttemptBudget = AttemptBudget(3)) -> AsyncRiffDBBetterAuthCoreClient:
2901
+ return cls(transport, command_attempts)
2902
+
2903
+ def with_read_after_commit(self, commit_sequence: int | None) -> AsyncRiffDBBetterAuthCoreClient:
2904
+ return AsyncRiffDBBetterAuthCoreClient(self._transport, self._command_attempts, read_after_commit=commit_sequence, track_causal_writes=self._track_causal_writes)
2905
+
2906
+ def causal_session(self, initial_commit_sequence: int | None = None) -> AsyncRiffDBBetterAuthCoreClient:
2907
+ return AsyncRiffDBBetterAuthCoreClient(self._transport, self._command_attempts, read_after_commit=initial_commit_sequence if initial_commit_sequence is not None else self._read_after_commit, track_causal_writes=True)
2908
+
2909
+ @property
2910
+ def last_commit_sequence(self) -> int | None:
2911
+ return self._read_after_commit
2912
+
2913
+ async def admin_users_all_email_asc(self, parameters: AdminUsersAllEmailAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersAllEmailAscResult]:
2914
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
2915
+ raise ValueError("limit must be an integer from 1 through 100")
2916
+ if options.read_after_commit is None and self._read_after_commit is not None:
2917
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2918
+ raw = await self._transport._execute_named_query(
2919
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2920
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2921
+ query_name="AdminUsersAllEmailAsc", plan_hash=ADMIN_USERS_ALL_EMAIL_ASC_QUERY_PLAN_HASH,
2922
+ parameters=encode_record(parameters), options=options,
2923
+ )
2924
+ outcomes = {
2925
+ "Found": AdminUsersAllEmailAscFound,
2926
+ }
2927
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2928
+
2929
+ async def admin_users_all_email_asc_after_commit(self, parameters: AdminUsersAllEmailAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersAllEmailAscResult]:
2930
+ return await self.admin_users_all_email_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2931
+
2932
+ async def admin_users_contains_asc(self, parameters: AdminUsersContainsAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsAscResult]:
2933
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
2934
+ raise ValueError("limit must be an integer from 1 through 100")
2935
+ if options.read_after_commit is None and self._read_after_commit is not None:
2936
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2937
+ raw = await self._transport._execute_named_query(
2938
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2939
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2940
+ query_name="AdminUsersContainsAsc", plan_hash=ADMIN_USERS_CONTAINS_ASC_QUERY_PLAN_HASH,
2941
+ parameters=encode_record(parameters), options=options,
2942
+ )
2943
+ outcomes = {
2944
+ "Found": AdminUsersContainsAscFound,
2945
+ }
2946
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2947
+
2948
+ async def admin_users_contains_asc_after_commit(self, parameters: AdminUsersContainsAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsAscResult]:
2949
+ return await self.admin_users_contains_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2950
+
2951
+ async def admin_users_contains_desc(self, parameters: AdminUsersContainsDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsDescResult]:
2952
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
2953
+ raise ValueError("limit must be an integer from 1 through 100")
2954
+ if options.read_after_commit is None and self._read_after_commit is not None:
2955
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2956
+ raw = await self._transport._execute_named_query(
2957
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2958
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2959
+ query_name="AdminUsersContainsDesc", plan_hash=ADMIN_USERS_CONTAINS_DESC_QUERY_PLAN_HASH,
2960
+ parameters=encode_record(parameters), options=options,
2961
+ )
2962
+ outcomes = {
2963
+ "Found": AdminUsersContainsDescFound,
2964
+ }
2965
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2966
+
2967
+ async def admin_users_contains_desc_after_commit(self, parameters: AdminUsersContainsDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsDescResult]:
2968
+ return await self.admin_users_contains_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2969
+
2970
+ async def admin_users_email_contains_created_desc(self, parameters: AdminUsersEmailContainsCreatedDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsCreatedDescResult]:
2971
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
2972
+ raise ValueError("limit must be an integer from 1 through 100")
2973
+ if options.read_after_commit is None and self._read_after_commit is not None:
2974
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2975
+ raw = await self._transport._execute_named_query(
2976
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2977
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2978
+ query_name="AdminUsersEmailContainsCreatedDesc", plan_hash=ADMIN_USERS_EMAIL_CONTAINS_CREATED_DESC_QUERY_PLAN_HASH,
2979
+ parameters=encode_record(parameters), options=options,
2980
+ )
2981
+ outcomes = {
2982
+ "Found": AdminUsersEmailContainsCreatedDescFound,
2983
+ }
2984
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2985
+
2986
+ async def admin_users_email_contains_created_desc_after_commit(self, parameters: AdminUsersEmailContainsCreatedDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsCreatedDescResult]:
2987
+ return await self.admin_users_email_contains_created_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2988
+
2989
+ async def admin_users_email_contains_image_asc(self, parameters: AdminUsersEmailContainsImageAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsImageAscResult]:
2990
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
2991
+ raise ValueError("limit must be an integer from 1 through 100")
2992
+ if options.read_after_commit is None and self._read_after_commit is not None:
2993
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2994
+ raw = await self._transport._execute_named_query(
2995
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2996
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2997
+ query_name="AdminUsersEmailContainsImageAsc", plan_hash=ADMIN_USERS_EMAIL_CONTAINS_IMAGE_ASC_QUERY_PLAN_HASH,
2998
+ parameters=encode_record(parameters), options=options,
2999
+ )
3000
+ outcomes = {
3001
+ "Found": AdminUsersEmailContainsImageAscFound,
3002
+ }
3003
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3004
+
3005
+ async def admin_users_email_contains_image_asc_after_commit(self, parameters: AdminUsersEmailContainsImageAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsImageAscResult]:
3006
+ return await self.admin_users_email_contains_image_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3007
+
3008
+ async def admin_users_ends_with_asc(self, parameters: AdminUsersEndsWithAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithAscResult]:
3009
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
3010
+ raise ValueError("limit must be an integer from 1 through 100")
3011
+ if options.read_after_commit is None and self._read_after_commit is not None:
3012
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3013
+ raw = await self._transport._execute_named_query(
3014
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3015
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3016
+ query_name="AdminUsersEndsWithAsc", plan_hash=ADMIN_USERS_ENDS_WITH_ASC_QUERY_PLAN_HASH,
3017
+ parameters=encode_record(parameters), options=options,
3018
+ )
3019
+ outcomes = {
3020
+ "Found": AdminUsersEndsWithAscFound,
3021
+ }
3022
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3023
+
3024
+ async def admin_users_ends_with_asc_after_commit(self, parameters: AdminUsersEndsWithAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithAscResult]:
3025
+ return await self.admin_users_ends_with_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3026
+
3027
+ async def admin_users_ends_with_desc(self, parameters: AdminUsersEndsWithDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithDescResult]:
3028
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
3029
+ raise ValueError("limit must be an integer from 1 through 100")
3030
+ if options.read_after_commit is None and self._read_after_commit is not None:
3031
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3032
+ raw = await self._transport._execute_named_query(
3033
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3034
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3035
+ query_name="AdminUsersEndsWithDesc", plan_hash=ADMIN_USERS_ENDS_WITH_DESC_QUERY_PLAN_HASH,
3036
+ parameters=encode_record(parameters), options=options,
3037
+ )
3038
+ outcomes = {
3039
+ "Found": AdminUsersEndsWithDescFound,
3040
+ }
3041
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3042
+
3043
+ async def admin_users_ends_with_desc_after_commit(self, parameters: AdminUsersEndsWithDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithDescResult]:
3044
+ return await self.admin_users_ends_with_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3045
+
3046
+ async def admin_users_starts_with_asc(self, parameters: AdminUsersStartsWithAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithAscResult]:
3047
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
3048
+ raise ValueError("limit must be an integer from 1 through 100")
3049
+ if options.read_after_commit is None and self._read_after_commit is not None:
3050
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3051
+ raw = await self._transport._execute_named_query(
3052
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3053
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3054
+ query_name="AdminUsersStartsWithAsc", plan_hash=ADMIN_USERS_STARTS_WITH_ASC_QUERY_PLAN_HASH,
3055
+ parameters=encode_record(parameters), options=options,
3056
+ )
3057
+ outcomes = {
3058
+ "Found": AdminUsersStartsWithAscFound,
3059
+ }
3060
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3061
+
3062
+ async def admin_users_starts_with_asc_after_commit(self, parameters: AdminUsersStartsWithAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithAscResult]:
3063
+ return await self.admin_users_starts_with_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3064
+
3065
+ async def admin_users_starts_with_desc(self, parameters: AdminUsersStartsWithDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithDescResult]:
3066
+ if parameters.limit is not None and (isinstance(parameters.limit, bool) or not isinstance(parameters.limit, int) or parameters.limit < 1 or parameters.limit > 100):
3067
+ raise ValueError("limit must be an integer from 1 through 100")
3068
+ if options.read_after_commit is None and self._read_after_commit is not None:
3069
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3070
+ raw = await self._transport._execute_named_query(
3071
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3072
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3073
+ query_name="AdminUsersStartsWithDesc", plan_hash=ADMIN_USERS_STARTS_WITH_DESC_QUERY_PLAN_HASH,
3074
+ parameters=encode_record(parameters), options=options,
3075
+ )
3076
+ outcomes = {
3077
+ "Found": AdminUsersStartsWithDescFound,
3078
+ }
3079
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3080
+
3081
+ async def admin_users_starts_with_desc_after_commit(self, parameters: AdminUsersStartsWithDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithDescResult]:
3082
+ return await self.admin_users_starts_with_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3083
+
3084
+ async def find_account_by_id(self, parameters: FindAccountByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByIdResult]:
3085
+ if options.read_after_commit is None and self._read_after_commit is not None:
3086
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3087
+ raw = await self._transport._execute_named_query(
3088
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3089
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3090
+ query_name="FindAccountById", plan_hash=FIND_ACCOUNT_BY_ID_QUERY_PLAN_HASH,
3091
+ parameters=encode_record(parameters), options=options,
3092
+ )
3093
+ outcomes = {
3094
+ "Found": FindAccountByIdFound,
3095
+ }
3096
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3097
+
3098
+ async def find_account_by_id_after_commit(self, parameters: FindAccountByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByIdResult]:
3099
+ return await self.find_account_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3100
+
3101
+ async def find_account_by_provider(self, parameters: FindAccountByProviderParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByProviderResult]:
3102
+ if options.read_after_commit is None and self._read_after_commit is not None:
3103
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3104
+ raw = await self._transport._execute_named_query(
3105
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3106
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3107
+ query_name="FindAccountByProvider", plan_hash=FIND_ACCOUNT_BY_PROVIDER_QUERY_PLAN_HASH,
3108
+ parameters=encode_record(parameters), options=options,
3109
+ )
3110
+ outcomes = {
3111
+ "Found": FindAccountByProviderFound,
3112
+ }
3113
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3114
+
3115
+ async def find_account_by_provider_after_commit(self, parameters: FindAccountByProviderParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByProviderResult]:
3116
+ return await self.find_account_by_provider(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3117
+
3118
+ async def find_accounts_by_user_id(self, parameters: FindAccountsByUserIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserIdResult]:
3119
+ encoded_parameters = encode_record(parameters)
3120
+ generated_cursor = parameters.after
3121
+ if generated_cursor is not None:
3122
+ if options.cursor is not None:
3123
+ raise ValueError("generated cursor conflicts with query options")
3124
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
3125
+ encoded_parameters.pop("after", None)
3126
+ if options.read_after_commit is None and self._read_after_commit is not None:
3127
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3128
+ raw = await self._transport._execute_named_query(
3129
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3130
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3131
+ query_name="FindAccountsByUserId", plan_hash=FIND_ACCOUNTS_BY_USER_ID_QUERY_PLAN_HASH,
3132
+ parameters=encoded_parameters, options=options,
3133
+ )
3134
+ outcomes = {
3135
+ "Found": FindAccountsByUserIdFound,
3136
+ }
3137
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3138
+
3139
+ async def find_accounts_by_user_id_after_commit(self, parameters: FindAccountsByUserIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserIdResult]:
3140
+ return await self.find_accounts_by_user_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3141
+
3142
+ async def find_accounts_by_user_id_pages(self, parameters: FindAccountsByUserIdParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindAccountsByUserIdResult]]:
3143
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
3144
+ raise ValueError("max_pages must be an integer from 1 through 1024")
3145
+ if parameters.after is not None and options.cursor is not None:
3146
+ raise ValueError("generated cursor conflicts with query options")
3147
+ cursor = options.cursor if options.cursor is not None else parameters.after
3148
+ pages: list[TypedQueryResult[FindAccountsByUserIdResult]] = []
3149
+ for _ in range(max_pages):
3150
+ page_parameters = FindAccountsByUserIdParams(organization_id=parameters.organization_id, user_id=parameters.user_id, after=None)
3151
+ page = await self.find_accounts_by_user_id(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
3152
+ pages.append(page)
3153
+ if not page.next_cursor:
3154
+ break
3155
+ cursor = page.next_cursor
3156
+ return pages
3157
+
3158
+ async def find_accounts_by_user_provider(self, parameters: FindAccountsByUserProviderParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserProviderResult]:
3159
+ encoded_parameters = encode_record(parameters)
3160
+ generated_cursor = parameters.after
3161
+ if generated_cursor is not None:
3162
+ if options.cursor is not None:
3163
+ raise ValueError("generated cursor conflicts with query options")
3164
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
3165
+ encoded_parameters.pop("after", None)
3166
+ if options.read_after_commit is None and self._read_after_commit is not None:
3167
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3168
+ raw = await self._transport._execute_named_query(
3169
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3170
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3171
+ query_name="FindAccountsByUserProvider", plan_hash=FIND_ACCOUNTS_BY_USER_PROVIDER_QUERY_PLAN_HASH,
3172
+ parameters=encoded_parameters, options=options,
3173
+ )
3174
+ outcomes = {
3175
+ "Found": FindAccountsByUserProviderFound,
3176
+ }
3177
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3178
+
3179
+ async def find_accounts_by_user_provider_after_commit(self, parameters: FindAccountsByUserProviderParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserProviderResult]:
3180
+ return await self.find_accounts_by_user_provider(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3181
+
3182
+ async def find_accounts_by_user_provider_pages(self, parameters: FindAccountsByUserProviderParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindAccountsByUserProviderResult]]:
3183
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
3184
+ raise ValueError("max_pages must be an integer from 1 through 1024")
3185
+ if parameters.after is not None and options.cursor is not None:
3186
+ raise ValueError("generated cursor conflicts with query options")
3187
+ cursor = options.cursor if options.cursor is not None else parameters.after
3188
+ pages: list[TypedQueryResult[FindAccountsByUserProviderResult]] = []
3189
+ for _ in range(max_pages):
3190
+ page_parameters = FindAccountsByUserProviderParams(organization_id=parameters.organization_id, user_id=parameters.user_id, provider_id=parameters.provider_id, after=None)
3191
+ page = await self.find_accounts_by_user_provider(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
3192
+ pages.append(page)
3193
+ if not page.next_cursor:
3194
+ break
3195
+ cursor = page.next_cursor
3196
+ return pages
3197
+
3198
+ async def find_active_sessions_by_user_id(self, parameters: FindActiveSessionsByUserIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindActiveSessionsByUserIdResult]:
3199
+ encoded_parameters = encode_record(parameters)
3200
+ generated_cursor = parameters.after
3201
+ if generated_cursor is not None:
3202
+ if options.cursor is not None:
3203
+ raise ValueError("generated cursor conflicts with query options")
3204
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
3205
+ encoded_parameters.pop("after", None)
3206
+ if options.read_after_commit is None and self._read_after_commit is not None:
3207
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3208
+ raw = await self._transport._execute_named_query(
3209
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3210
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3211
+ query_name="FindActiveSessionsByUserId", plan_hash=FIND_ACTIVE_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH,
3212
+ parameters=encoded_parameters, options=options,
3213
+ )
3214
+ outcomes = {
3215
+ "Found": FindActiveSessionsByUserIdFound,
3216
+ }
3217
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3218
+
3219
+ async def find_active_sessions_by_user_id_after_commit(self, parameters: FindActiveSessionsByUserIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindActiveSessionsByUserIdResult]:
3220
+ return await self.find_active_sessions_by_user_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3221
+
3222
+ async def find_active_sessions_by_user_id_pages(self, parameters: FindActiveSessionsByUserIdParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindActiveSessionsByUserIdResult]]:
3223
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
3224
+ raise ValueError("max_pages must be an integer from 1 through 1024")
3225
+ if parameters.after is not None and options.cursor is not None:
3226
+ raise ValueError("generated cursor conflicts with query options")
3227
+ cursor = options.cursor if options.cursor is not None else parameters.after
3228
+ pages: list[TypedQueryResult[FindActiveSessionsByUserIdResult]] = []
3229
+ for _ in range(max_pages):
3230
+ page_parameters = FindActiveSessionsByUserIdParams(organization_id=parameters.organization_id, user_id=parameters.user_id, expires_after=parameters.expires_after, after=None)
3231
+ page = await self.find_active_sessions_by_user_id(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
3232
+ pages.append(page)
3233
+ if not page.next_cursor:
3234
+ break
3235
+ cursor = page.next_cursor
3236
+ return pages
3237
+
3238
+ async def find_expired_verification_ids(self, parameters: FindExpiredVerificationIdsParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindExpiredVerificationIdsResult]:
3239
+ encoded_parameters = encode_record(parameters)
3240
+ generated_cursor = parameters.after
3241
+ if generated_cursor is not None:
3242
+ if options.cursor is not None:
3243
+ raise ValueError("generated cursor conflicts with query options")
3244
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
3245
+ encoded_parameters.pop("after", None)
3246
+ if options.read_after_commit is None and self._read_after_commit is not None:
3247
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3248
+ raw = await self._transport._execute_named_query(
3249
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3250
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3251
+ query_name="FindExpiredVerificationIds", plan_hash=FIND_EXPIRED_VERIFICATION_IDS_QUERY_PLAN_HASH,
3252
+ parameters=encoded_parameters, options=options,
3253
+ )
3254
+ outcomes = {
3255
+ "Found": FindExpiredVerificationIdsFound,
3256
+ }
3257
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3258
+
3259
+ async def find_expired_verification_ids_after_commit(self, parameters: FindExpiredVerificationIdsParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindExpiredVerificationIdsResult]:
3260
+ return await self.find_expired_verification_ids(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3261
+
3262
+ async def find_expired_verification_ids_pages(self, parameters: FindExpiredVerificationIdsParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindExpiredVerificationIdsResult]]:
3263
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
3264
+ raise ValueError("max_pages must be an integer from 1 through 1024")
3265
+ if parameters.after is not None and options.cursor is not None:
3266
+ raise ValueError("generated cursor conflicts with query options")
3267
+ cursor = options.cursor if options.cursor is not None else parameters.after
3268
+ pages: list[TypedQueryResult[FindExpiredVerificationIdsResult]] = []
3269
+ for _ in range(max_pages):
3270
+ page_parameters = FindExpiredVerificationIdsParams(organization_id=parameters.organization_id, expires_before=parameters.expires_before, after=None)
3271
+ page = await self.find_expired_verification_ids(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
3272
+ pages.append(page)
3273
+ if not page.next_cursor:
3274
+ break
3275
+ cursor = page.next_cursor
3276
+ return pages
3277
+
3278
+ async def find_latest_verification(self, parameters: FindLatestVerificationParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindLatestVerificationResult]:
3279
+ if options.read_after_commit is None and self._read_after_commit is not None:
3280
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3281
+ raw = await self._transport._execute_named_query(
3282
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3283
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3284
+ query_name="FindLatestVerification", plan_hash=FIND_LATEST_VERIFICATION_QUERY_PLAN_HASH,
3285
+ parameters=encode_record(parameters), options=options,
3286
+ )
3287
+ outcomes = {
3288
+ "Found": FindLatestVerificationFound,
3289
+ }
3290
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3291
+
3292
+ async def find_latest_verification_after_commit(self, parameters: FindLatestVerificationParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindLatestVerificationResult]:
3293
+ return await self.find_latest_verification(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3294
+
3295
+ async def find_session_by_id(self, parameters: FindSessionByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByIdResult]:
3296
+ if options.read_after_commit is None and self._read_after_commit is not None:
3297
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3298
+ raw = await self._transport._execute_named_query(
3299
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3300
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3301
+ query_name="FindSessionById", plan_hash=FIND_SESSION_BY_ID_QUERY_PLAN_HASH,
3302
+ parameters=encode_record(parameters), options=options,
3303
+ )
3304
+ outcomes = {
3305
+ "Found": FindSessionByIdFound,
3306
+ }
3307
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3308
+
3309
+ async def find_session_by_id_after_commit(self, parameters: FindSessionByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByIdResult]:
3310
+ return await self.find_session_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3311
+
3312
+ async def find_session_by_token(self, parameters: FindSessionByTokenParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByTokenResult]:
3313
+ if options.read_after_commit is None and self._read_after_commit is not None:
3314
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3315
+ raw = await self._transport._execute_named_query(
3316
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3317
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3318
+ query_name="FindSessionByToken", plan_hash=FIND_SESSION_BY_TOKEN_QUERY_PLAN_HASH,
3319
+ parameters=encode_record(parameters), options=options,
3320
+ )
3321
+ outcomes = {
3322
+ "Found": FindSessionByTokenFound,
3323
+ }
3324
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3325
+
3326
+ async def find_session_by_token_after_commit(self, parameters: FindSessionByTokenParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByTokenResult]:
3327
+ return await self.find_session_by_token(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3328
+
3329
+ async def find_sessions_by_token_set(self, parameters: FindSessionsByTokenSetParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByTokenSetResult]:
3330
+ if options.read_after_commit is None and self._read_after_commit is not None:
3331
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3332
+ raw = await self._transport._execute_named_query(
3333
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3334
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3335
+ query_name="FindSessionsByTokenSet", plan_hash=FIND_SESSIONS_BY_TOKEN_SET_QUERY_PLAN_HASH,
3336
+ parameters=encode_record(parameters), options=options,
3337
+ )
3338
+ outcomes = {
3339
+ "Found": FindSessionsByTokenSetFound,
3340
+ }
3341
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3342
+
3343
+ async def find_sessions_by_token_set_after_commit(self, parameters: FindSessionsByTokenSetParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByTokenSetResult]:
3344
+ return await self.find_sessions_by_token_set(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3345
+
3346
+ async def find_sessions_by_user_id(self, parameters: FindSessionsByUserIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByUserIdResult]:
3347
+ encoded_parameters = encode_record(parameters)
3348
+ generated_cursor = parameters.after
3349
+ if generated_cursor is not None:
3350
+ if options.cursor is not None:
3351
+ raise ValueError("generated cursor conflicts with query options")
3352
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
3353
+ encoded_parameters.pop("after", None)
3354
+ if options.read_after_commit is None and self._read_after_commit is not None:
3355
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3356
+ raw = await self._transport._execute_named_query(
3357
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3358
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3359
+ query_name="FindSessionsByUserId", plan_hash=FIND_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH,
3360
+ parameters=encoded_parameters, options=options,
3361
+ )
3362
+ outcomes = {
3363
+ "Found": FindSessionsByUserIdFound,
3364
+ }
3365
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3366
+
3367
+ async def find_sessions_by_user_id_after_commit(self, parameters: FindSessionsByUserIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByUserIdResult]:
3368
+ return await self.find_sessions_by_user_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3369
+
3370
+ async def find_sessions_by_user_id_pages(self, parameters: FindSessionsByUserIdParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindSessionsByUserIdResult]]:
3371
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
3372
+ raise ValueError("max_pages must be an integer from 1 through 1024")
3373
+ if parameters.after is not None and options.cursor is not None:
3374
+ raise ValueError("generated cursor conflicts with query options")
3375
+ cursor = options.cursor if options.cursor is not None else parameters.after
3376
+ pages: list[TypedQueryResult[FindSessionsByUserIdResult]] = []
3377
+ for _ in range(max_pages):
3378
+ page_parameters = FindSessionsByUserIdParams(organization_id=parameters.organization_id, user_id=parameters.user_id, after=None)
3379
+ page = await self.find_sessions_by_user_id(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
3380
+ pages.append(page)
3381
+ if not page.next_cursor:
3382
+ break
3383
+ cursor = page.next_cursor
3384
+ return pages
3385
+
3386
+ async def find_user_by_email(self, parameters: FindUserByEmailParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByEmailResult]:
3387
+ if options.read_after_commit is None and self._read_after_commit is not None:
3388
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3389
+ raw = await self._transport._execute_named_query(
3390
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3391
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3392
+ query_name="FindUserByEmail", plan_hash=FIND_USER_BY_EMAIL_QUERY_PLAN_HASH,
3393
+ parameters=encode_record(parameters), options=options,
3394
+ accept_compact_result=True,
3395
+ )
3396
+ outcomes = {
3397
+ "Found": FindUserByEmailFound,
3398
+ }
3399
+ return raw._map_value(lambda value: _decode_find_user_by_email_compact(value) if isinstance(value, dict) and "$riffdb_compact" in value else decode_variant(outcomes, value))
3400
+
3401
+ async def find_user_by_email_after_commit(self, parameters: FindUserByEmailParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByEmailResult]:
3402
+ return await self.find_user_by_email(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3403
+
3404
+ async def find_user_by_id(self, parameters: FindUserByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByIdResult]:
3405
+ if options.read_after_commit is None and self._read_after_commit is not None:
3406
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3407
+ raw = await self._transport._execute_named_query(
3408
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3409
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3410
+ query_name="FindUserById", plan_hash=FIND_USER_BY_ID_QUERY_PLAN_HASH,
3411
+ parameters=encode_record(parameters), options=options,
3412
+ )
3413
+ outcomes = {
3414
+ "Found": FindUserByIdFound,
3415
+ "Missing": FindUserByIdMissing,
3416
+ }
3417
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3418
+
3419
+ async def find_user_by_id_after_commit(self, parameters: FindUserByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByIdResult]:
3420
+ return await self.find_user_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3421
+
3422
+ async def find_verification_by_id(self, parameters: FindVerificationByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationByIdResult]:
3423
+ if options.read_after_commit is None and self._read_after_commit is not None:
3424
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3425
+ raw = await self._transport._execute_named_query(
3426
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3427
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3428
+ query_name="FindVerificationById", plan_hash=FIND_VERIFICATION_BY_ID_QUERY_PLAN_HASH,
3429
+ parameters=encode_record(parameters), options=options,
3430
+ )
3431
+ outcomes = {
3432
+ "Found": FindVerificationByIdFound,
3433
+ "Missing": FindVerificationByIdMissing,
3434
+ }
3435
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3436
+
3437
+ async def find_verification_by_id_after_commit(self, parameters: FindVerificationByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationByIdResult]:
3438
+ return await self.find_verification_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3439
+
3440
+ async def find_verifications_by_identifier(self, parameters: FindVerificationsByIdentifierParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationsByIdentifierResult]:
3441
+ encoded_parameters = encode_record(parameters)
3442
+ generated_cursor = parameters.after
3443
+ if generated_cursor is not None:
3444
+ if options.cursor is not None:
3445
+ raise ValueError("generated cursor conflicts with query options")
3446
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
3447
+ encoded_parameters.pop("after", None)
3448
+ if options.read_after_commit is None and self._read_after_commit is not None:
3449
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3450
+ raw = await self._transport._execute_named_query(
3451
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3452
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3453
+ query_name="FindVerificationsByIdentifier", plan_hash=FIND_VERIFICATIONS_BY_IDENTIFIER_QUERY_PLAN_HASH,
3454
+ parameters=encoded_parameters, options=options,
3455
+ )
3456
+ outcomes = {
3457
+ "Found": FindVerificationsByIdentifierFound,
3458
+ }
3459
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3460
+
3461
+ async def find_verifications_by_identifier_after_commit(self, parameters: FindVerificationsByIdentifierParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationsByIdentifierResult]:
3462
+ return await self.find_verifications_by_identifier(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3463
+
3464
+ async def find_verifications_by_identifier_pages(self, parameters: FindVerificationsByIdentifierParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindVerificationsByIdentifierResult]]:
3465
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
3466
+ raise ValueError("max_pages must be an integer from 1 through 1024")
3467
+ if parameters.after is not None and options.cursor is not None:
3468
+ raise ValueError("generated cursor conflicts with query options")
3469
+ cursor = options.cursor if options.cursor is not None else parameters.after
3470
+ pages: list[TypedQueryResult[FindVerificationsByIdentifierResult]] = []
3471
+ for _ in range(max_pages):
3472
+ page_parameters = FindVerificationsByIdentifierParams(organization_id=parameters.organization_id, identifier=parameters.identifier, after=None)
3473
+ page = await self.find_verifications_by_identifier(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
3474
+ pages.append(page)
3475
+ if not page.next_cursor:
3476
+ break
3477
+ cursor = page.next_cursor
3478
+ return pages
3479
+
3480
+ async def consume_verification(self, input: ConsumeVerificationInput) -> TypedCommandResult[ConsumeVerificationOutcome]:
3481
+ raw = await self._transport._execute_command(
3482
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3483
+ command_name="ConsumeVerification", plan_hash=CONSUME_VERIFICATION_PLAN_HASH,
3484
+ input=encode_record(input), attempts=self._command_attempts,
3485
+ )
3486
+ outcomes = {
3487
+ "VerificationConsumed": ConsumeVerificationVerificationConsumed,
3488
+ "VerificationConsumeMissing": ConsumeVerificationVerificationConsumeMissing,
3489
+ }
3490
+ result: TypedCommandResult[ConsumeVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3491
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3492
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3493
+ return result
3494
+
3495
+ async def consume_verification_batch(
3496
+ self, inputs: Sequence[ConsumeVerificationInput], options: CommandBatchOptions,
3497
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3498
+ ) -> CommandBatchResult[ConsumeVerificationOutcome]:
3499
+ return await self._transport._command_batch(inputs, options, self.consume_verification, progress)
3500
+
3501
+ async def consume_verification_set(self, input: ConsumeVerificationSetInput) -> TypedCommandResult[ConsumeVerificationSetOutcome]:
3502
+ if not 1 <= len(input.verification_ids) <= 32:
3503
+ raise ValueError("invalid bounded collection length for ConsumeVerificationSet.verification_ids")
3504
+ raw = await self._transport._execute_command(
3505
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3506
+ command_name="ConsumeVerificationSet", plan_hash=CONSUME_VERIFICATION_SET_PLAN_HASH,
3507
+ input=encode_record(input), attempts=self._command_attempts,
3508
+ )
3509
+ outcomes = {
3510
+ "VerificationSetConsumed": ConsumeVerificationSetVerificationSetConsumed,
3511
+ "VerificationConsumeMissing": ConsumeVerificationSetVerificationConsumeMissing,
3512
+ }
3513
+ result: TypedCommandResult[ConsumeVerificationSetOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3514
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3515
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3516
+ return result
3517
+
3518
+ async def consume_verification_set_batch(
3519
+ self, inputs: Sequence[ConsumeVerificationSetInput], options: CommandBatchOptions,
3520
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3521
+ ) -> CommandBatchResult[ConsumeVerificationSetOutcome]:
3522
+ for input in inputs:
3523
+ if not 1 <= len(input.verification_ids) <= 32:
3524
+ raise ValueError("invalid bounded collection length for ConsumeVerificationSet.verification_ids")
3525
+ return await self._transport._command_batch(inputs, options, self.consume_verification_set, progress)
3526
+
3527
+ async def create_account(self, input: CreateAccountInput) -> TypedCommandResult[CreateAccountOutcome]:
3528
+ raw = await self._transport._execute_command(
3529
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3530
+ command_name="CreateAccount", plan_hash=CREATE_ACCOUNT_PLAN_HASH,
3531
+ input=encode_record(input), attempts=self._command_attempts,
3532
+ )
3533
+ outcomes = {
3534
+ "AccountCreated": CreateAccountAccountCreated,
3535
+ "AccountUserMissing": CreateAccountAccountUserMissing,
3536
+ "AccountAlreadyExists": CreateAccountAccountAlreadyExists,
3537
+ }
3538
+ result: TypedCommandResult[CreateAccountOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3539
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3540
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3541
+ return result
3542
+
3543
+ async def create_account_batch(
3544
+ self, inputs: Sequence[CreateAccountInput], options: CommandBatchOptions,
3545
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3546
+ ) -> CommandBatchResult[CreateAccountOutcome]:
3547
+ return await self._transport._command_batch(inputs, options, self.create_account, progress)
3548
+
3549
+ async def create_oauth_user_graph(self, input: CreateOAuthUserGraphInput) -> TypedCommandResult[CreateOAuthUserGraphOutcome]:
3550
+ raw = await self._transport._execute_command(
3551
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3552
+ command_name="CreateOAuthUserGraph", plan_hash=CREATE_OAUTH_USER_GRAPH_PLAN_HASH,
3553
+ input=encode_record(input), attempts=self._command_attempts,
3554
+ )
3555
+ outcomes = {
3556
+ "OAuthUserExists": CreateOAuthUserGraphOAuthUserExists,
3557
+ "OAuthAccountExists": CreateOAuthUserGraphOAuthAccountExists,
3558
+ "OAuthUserGraphCreated": CreateOAuthUserGraphOAuthUserGraphCreated,
3559
+ }
3560
+ result: TypedCommandResult[CreateOAuthUserGraphOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3561
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3562
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3563
+ return result
3564
+
3565
+ async def create_oauth_user_graph_batch(
3566
+ self, inputs: Sequence[CreateOAuthUserGraphInput], options: CommandBatchOptions,
3567
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3568
+ ) -> CommandBatchResult[CreateOAuthUserGraphOutcome]:
3569
+ return await self._transport._command_batch(inputs, options, self.create_oauth_user_graph, progress)
3570
+
3571
+ async def create_session(self, input: CreateSessionInput) -> TypedCommandResult[CreateSessionOutcome]:
3572
+ raw = await self._transport._execute_command(
3573
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3574
+ command_name="CreateSession", plan_hash=CREATE_SESSION_PLAN_HASH,
3575
+ input=encode_record(input), attempts=self._command_attempts,
3576
+ )
3577
+ outcomes = {
3578
+ "SessionCreated": CreateSessionSessionCreated,
3579
+ "SessionUserMissing": CreateSessionSessionUserMissing,
3580
+ "SessionAlreadyExists": CreateSessionSessionAlreadyExists,
3581
+ }
3582
+ result: TypedCommandResult[CreateSessionOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3583
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3584
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3585
+ return result
3586
+
3587
+ async def create_session_batch(
3588
+ self, inputs: Sequence[CreateSessionInput], options: CommandBatchOptions,
3589
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3590
+ ) -> CommandBatchResult[CreateSessionOutcome]:
3591
+ return await self._transport._command_batch(inputs, options, self.create_session, progress)
3592
+
3593
+ async def create_signup_graph(self, input: CreateSignupGraphInput) -> TypedCommandResult[CreateSignupGraphOutcome]:
3594
+ raw = await self._transport._execute_command(
3595
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3596
+ command_name="CreateSignupGraph", plan_hash=CREATE_SIGNUP_GRAPH_PLAN_HASH,
3597
+ input=encode_record(input), attempts=self._command_attempts,
3598
+ )
3599
+ outcomes = {
3600
+ "SignupUserExists": CreateSignupGraphSignupUserExists,
3601
+ "SignupGraphCreated": CreateSignupGraphSignupGraphCreated,
3602
+ "SignupAccountExists": CreateSignupGraphSignupAccountExists,
3603
+ "SignupSessionExists": CreateSignupGraphSignupSessionExists,
3604
+ }
3605
+ result: TypedCommandResult[CreateSignupGraphOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3606
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3607
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3608
+ return result
3609
+
3610
+ async def create_signup_graph_batch(
3611
+ self, inputs: Sequence[CreateSignupGraphInput], options: CommandBatchOptions,
3612
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3613
+ ) -> CommandBatchResult[CreateSignupGraphOutcome]:
3614
+ return await self._transport._command_batch(inputs, options, self.create_signup_graph, progress)
3615
+
3616
+ async def create_user(self, input: CreateUserInput) -> TypedCommandResult[CreateUserOutcome]:
3617
+ raw = await self._transport._execute_command(
3618
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3619
+ command_name="CreateUser", plan_hash=CREATE_USER_PLAN_HASH,
3620
+ input=encode_record(input), attempts=self._command_attempts,
3621
+ )
3622
+ outcomes = {
3623
+ "UserCreated": CreateUserUserCreated,
3624
+ "UserAlreadyExists": CreateUserUserAlreadyExists,
3625
+ }
3626
+ result: TypedCommandResult[CreateUserOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3627
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3628
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3629
+ return result
3630
+
3631
+ async def create_user_batch(
3632
+ self, inputs: Sequence[CreateUserInput], options: CommandBatchOptions,
3633
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3634
+ ) -> CommandBatchResult[CreateUserOutcome]:
3635
+ return await self._transport._command_batch(inputs, options, self.create_user, progress)
3636
+
3637
+ async def create_verification(self, input: CreateVerificationInput) -> TypedCommandResult[CreateVerificationOutcome]:
3638
+ raw = await self._transport._execute_command(
3639
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3640
+ command_name="CreateVerification", plan_hash=CREATE_VERIFICATION_PLAN_HASH,
3641
+ input=encode_record(input), attempts=self._command_attempts,
3642
+ )
3643
+ outcomes = {
3644
+ "VerificationCreated": CreateVerificationVerificationCreated,
3645
+ "VerificationAlreadyExists": CreateVerificationVerificationAlreadyExists,
3646
+ }
3647
+ result: TypedCommandResult[CreateVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3648
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3649
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3650
+ return result
3651
+
3652
+ async def create_verification_batch(
3653
+ self, inputs: Sequence[CreateVerificationInput], options: CommandBatchOptions,
3654
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3655
+ ) -> CommandBatchResult[CreateVerificationOutcome]:
3656
+ return await self._transport._command_batch(inputs, options, self.create_verification, progress)
3657
+
3658
+ async def delete_account(self, input: DeleteAccountInput) -> TypedCommandResult[DeleteAccountOutcome]:
3659
+ if not 1 <= len(input.account_ids) <= 32:
3660
+ raise ValueError("invalid bounded collection length for DeleteAccount.account_ids")
3661
+ raw = await self._transport._execute_command(
3662
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3663
+ command_name="DeleteAccount", plan_hash=DELETE_ACCOUNT_PLAN_HASH,
3664
+ input=encode_record(input), attempts=self._command_attempts,
3665
+ )
3666
+ outcomes = {
3667
+ "AccountDeleted": DeleteAccountAccountDeleted,
3668
+ "AccountMissing": DeleteAccountAccountMissing,
3669
+ }
3670
+ result: TypedCommandResult[DeleteAccountOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3671
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3672
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3673
+ return result
3674
+
3675
+ async def delete_account_batch(
3676
+ self, inputs: Sequence[DeleteAccountInput], options: CommandBatchOptions,
3677
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3678
+ ) -> CommandBatchResult[DeleteAccountOutcome]:
3679
+ for input in inputs:
3680
+ if not 1 <= len(input.account_ids) <= 32:
3681
+ raise ValueError("invalid bounded collection length for DeleteAccount.account_ids")
3682
+ return await self._transport._command_batch(inputs, options, self.delete_account, progress)
3683
+
3684
+ async def delete_session(self, input: DeleteSessionInput) -> TypedCommandResult[DeleteSessionOutcome]:
3685
+ if not 1 <= len(input.session_ids) <= 32:
3686
+ raise ValueError("invalid bounded collection length for DeleteSession.session_ids")
3687
+ raw = await self._transport._execute_command(
3688
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3689
+ command_name="DeleteSession", plan_hash=DELETE_SESSION_PLAN_HASH,
3690
+ input=encode_record(input), attempts=self._command_attempts,
3691
+ )
3692
+ outcomes = {
3693
+ "SessionDeleted": DeleteSessionSessionDeleted,
3694
+ "SessionMissing": DeleteSessionSessionMissing,
3695
+ }
3696
+ result: TypedCommandResult[DeleteSessionOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3697
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3698
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3699
+ return result
3700
+
3701
+ async def delete_session_batch(
3702
+ self, inputs: Sequence[DeleteSessionInput], options: CommandBatchOptions,
3703
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3704
+ ) -> CommandBatchResult[DeleteSessionOutcome]:
3705
+ for input in inputs:
3706
+ if not 1 <= len(input.session_ids) <= 32:
3707
+ raise ValueError("invalid bounded collection length for DeleteSession.session_ids")
3708
+ return await self._transport._command_batch(inputs, options, self.delete_session, progress)
3709
+
3710
+ async def delete_user(self, input: DeleteUserInput) -> TypedCommandResult[DeleteUserOutcome]:
3711
+ if not 1 <= len(input.user_ids) <= 1:
3712
+ raise ValueError("invalid bounded collection length for DeleteUser.user_ids")
3713
+ raw = await self._transport._execute_command(
3714
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3715
+ command_name="DeleteUser", plan_hash=DELETE_USER_PLAN_HASH,
3716
+ input=encode_record(input), attempts=self._command_attempts,
3717
+ )
3718
+ outcomes = {
3719
+ "UserDeleted": DeleteUserUserDeleted,
3720
+ "DeleteUserMissing": DeleteUserDeleteUserMissing,
3721
+ "DeleteUserCascadeLimitExceeded": DeleteUserDeleteUserCascadeLimitExceeded,
3722
+ }
3723
+ result: TypedCommandResult[DeleteUserOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3724
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3725
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3726
+ return result
3727
+
3728
+ async def delete_user_batch(
3729
+ self, inputs: Sequence[DeleteUserInput], options: CommandBatchOptions,
3730
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3731
+ ) -> CommandBatchResult[DeleteUserOutcome]:
3732
+ for input in inputs:
3733
+ if not 1 <= len(input.user_ids) <= 1:
3734
+ raise ValueError("invalid bounded collection length for DeleteUser.user_ids")
3735
+ return await self._transport._command_batch(inputs, options, self.delete_user, progress)
3736
+
3737
+ async def delete_verification(self, input: DeleteVerificationInput) -> TypedCommandResult[DeleteVerificationOutcome]:
3738
+ if not 1 <= len(input.verification_ids) <= 32:
3739
+ raise ValueError("invalid bounded collection length for DeleteVerification.verification_ids")
3740
+ raw = await self._transport._execute_command(
3741
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3742
+ command_name="DeleteVerification", plan_hash=DELETE_VERIFICATION_PLAN_HASH,
3743
+ input=encode_record(input), attempts=self._command_attempts,
3744
+ )
3745
+ outcomes = {
3746
+ "VerificationDeleted": DeleteVerificationVerificationDeleted,
3747
+ "VerificationMissing": DeleteVerificationVerificationMissing,
3748
+ }
3749
+ result: TypedCommandResult[DeleteVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3750
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3751
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3752
+ return result
3753
+
3754
+ async def delete_verification_batch(
3755
+ self, inputs: Sequence[DeleteVerificationInput], options: CommandBatchOptions,
3756
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3757
+ ) -> CommandBatchResult[DeleteVerificationOutcome]:
3758
+ for input in inputs:
3759
+ if not 1 <= len(input.verification_ids) <= 32:
3760
+ raise ValueError("invalid bounded collection length for DeleteVerification.verification_ids")
3761
+ return await self._transport._command_batch(inputs, options, self.delete_verification, progress)
3762
+
3763
+ async def update_account(self, input: UpdateAccountInput) -> TypedCommandResult[UpdateAccountOutcome]:
3764
+ raw = await self._transport._execute_command(
3765
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3766
+ command_name="UpdateAccount", plan_hash=UPDATE_ACCOUNT_PLAN_HASH,
3767
+ input=encode_record(input), attempts=self._command_attempts,
3768
+ )
3769
+ outcomes = {
3770
+ "AccountUpdated": UpdateAccountAccountUpdated,
3771
+ "AccountUpdateStale": UpdateAccountAccountUpdateStale,
3772
+ "AccountUpdateMissing": UpdateAccountAccountUpdateMissing,
3773
+ }
3774
+ result: TypedCommandResult[UpdateAccountOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3775
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3776
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3777
+ return result
3778
+
3779
+ async def update_account_batch(
3780
+ self, inputs: Sequence[UpdateAccountInput], options: CommandBatchOptions,
3781
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3782
+ ) -> CommandBatchResult[UpdateAccountOutcome]:
3783
+ return await self._transport._command_batch(inputs, options, self.update_account, progress)
3784
+
3785
+ async def update_account_passwords(self, input: UpdateAccountPasswordsInput) -> TypedCommandResult[UpdateAccountPasswordsOutcome]:
3786
+ if not 1 <= len(input.updates) <= 8:
3787
+ raise ValueError("invalid bounded collection length for UpdateAccountPasswords.updates")
3788
+ raw = await self._transport._execute_command(
3789
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3790
+ command_name="UpdateAccountPasswords", plan_hash=UPDATE_ACCOUNT_PASSWORDS_PLAN_HASH,
3791
+ input=encode_record(input), attempts=self._command_attempts,
3792
+ )
3793
+ outcomes = {
3794
+ "PasswordAccountStale": UpdateAccountPasswordsPasswordAccountStale,
3795
+ "PasswordAccountMissing": UpdateAccountPasswordsPasswordAccountMissing,
3796
+ "AccountPasswordsUpdated": UpdateAccountPasswordsAccountPasswordsUpdated,
3797
+ "PasswordProviderMismatch": UpdateAccountPasswordsPasswordProviderMismatch,
3798
+ }
3799
+ result: TypedCommandResult[UpdateAccountPasswordsOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3800
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3801
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3802
+ return result
3803
+
3804
+ async def update_account_passwords_batch(
3805
+ self, inputs: Sequence[UpdateAccountPasswordsInput], options: CommandBatchOptions,
3806
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3807
+ ) -> CommandBatchResult[UpdateAccountPasswordsOutcome]:
3808
+ for input in inputs:
3809
+ if not 1 <= len(input.updates) <= 8:
3810
+ raise ValueError("invalid bounded collection length for UpdateAccountPasswords.updates")
3811
+ return await self._transport._command_batch(inputs, options, self.update_account_passwords, progress)
3812
+
3813
+ async def update_session(self, input: UpdateSessionInput) -> TypedCommandResult[UpdateSessionOutcome]:
3814
+ raw = await self._transport._execute_command(
3815
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3816
+ command_name="UpdateSession", plan_hash=UPDATE_SESSION_PLAN_HASH,
3817
+ input=encode_record(input), attempts=self._command_attempts,
3818
+ )
3819
+ outcomes = {
3820
+ "SessionUpdated": UpdateSessionSessionUpdated,
3821
+ "SessionUpdateStale": UpdateSessionSessionUpdateStale,
3822
+ "SessionUpdateMissing": UpdateSessionSessionUpdateMissing,
3823
+ }
3824
+ result: TypedCommandResult[UpdateSessionOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3825
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3826
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3827
+ return result
3828
+
3829
+ async def update_session_batch(
3830
+ self, inputs: Sequence[UpdateSessionInput], options: CommandBatchOptions,
3831
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3832
+ ) -> CommandBatchResult[UpdateSessionOutcome]:
3833
+ return await self._transport._command_batch(inputs, options, self.update_session, progress)
3834
+
3835
+ async def update_user(self, input: UpdateUserInput) -> TypedCommandResult[UpdateUserOutcome]:
3836
+ raw = await self._transport._execute_command(
3837
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3838
+ command_name="UpdateUser", plan_hash=UPDATE_USER_PLAN_HASH,
3839
+ input=encode_record(input), attempts=self._command_attempts,
3840
+ )
3841
+ outcomes = {
3842
+ "UserUpdated": UpdateUserUserUpdated,
3843
+ "UserUpdateStale": UpdateUserUserUpdateStale,
3844
+ "UserUpdateMissing": UpdateUserUserUpdateMissing,
3845
+ }
3846
+ result: TypedCommandResult[UpdateUserOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3847
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3848
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3849
+ return result
3850
+
3851
+ async def update_user_batch(
3852
+ self, inputs: Sequence[UpdateUserInput], options: CommandBatchOptions,
3853
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3854
+ ) -> CommandBatchResult[UpdateUserOutcome]:
3855
+ return await self._transport._command_batch(inputs, options, self.update_user, progress)
3856
+
3857
+ async def update_verification(self, input: UpdateVerificationInput) -> TypedCommandResult[UpdateVerificationOutcome]:
3858
+ raw = await self._transport._execute_command(
3859
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3860
+ command_name="UpdateVerification", plan_hash=UPDATE_VERIFICATION_PLAN_HASH,
3861
+ input=encode_record(input), attempts=self._command_attempts,
3862
+ )
3863
+ outcomes = {
3864
+ "VerificationUpdated": UpdateVerificationVerificationUpdated,
3865
+ "VerificationUpdateStale": UpdateVerificationVerificationUpdateStale,
3866
+ "VerificationUpdateMissing": UpdateVerificationVerificationUpdateMissing,
3867
+ }
3868
+ result: TypedCommandResult[UpdateVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3869
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3870
+ self._read_after_commit = result.commit_sequence if self._read_after_commit is None or result.commit_sequence > self._read_after_commit else self._read_after_commit
3871
+ return result
3872
+
3873
+ async def update_verification_batch(
3874
+ self, inputs: Sequence[UpdateVerificationInput], options: CommandBatchOptions,
3875
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3876
+ ) -> CommandBatchResult[UpdateVerificationOutcome]:
3877
+ return await self._transport._command_batch(inputs, options, self.update_verification, progress)