@riffdb/better-auth 0.0.0-stage → 0.2.1

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 (226) hide show
  1. package/DESIGN.md +273 -0
  2. package/LICENSE-APACHE +201 -0
  3. package/LICENSE-MIT +27 -0
  4. package/README.md +323 -2
  5. package/dist/adapter.d.ts +34 -0
  6. package/dist/adapter.d.ts.map +1 -0
  7. package/dist/adapter.js +1600 -0
  8. package/dist/adapter.js.map +1 -0
  9. package/dist/generated/client.d.ts +2166 -0
  10. package/dist/generated/client.d.ts.map +1 -0
  11. package/dist/generated/client.js +2454 -0
  12. package/dist/generated/client.js.map +1 -0
  13. package/dist/index.d.ts +7 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +7 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/plugin-dispatch.d.ts +37 -0
  18. package/dist/plugin-dispatch.d.ts.map +1 -0
  19. package/dist/plugin-dispatch.js +293 -0
  20. package/dist/plugin-dispatch.js.map +1 -0
  21. package/dist/profile-contract.d.ts +63 -0
  22. package/dist/profile-contract.d.ts.map +1 -0
  23. package/dist/profile-contract.js +543 -0
  24. package/dist/profile-contract.js.map +1 -0
  25. package/dist/profile-plan.d.ts +69 -0
  26. package/dist/profile-plan.d.ts.map +1 -0
  27. package/dist/profile-plan.js +180 -0
  28. package/dist/profile-plan.js.map +1 -0
  29. package/dist/profile.d.ts +48 -0
  30. package/dist/profile.d.ts.map +1 -0
  31. package/dist/profile.js +132 -0
  32. package/dist/profile.js.map +1 -0
  33. package/dist/profiles/custom-fields/profile.d.ts +3 -0
  34. package/dist/profiles/custom-fields/profile.d.ts.map +1 -0
  35. package/dist/profiles/custom-fields/profile.js +475 -0
  36. package/dist/profiles/custom-fields/profile.js.map +1 -0
  37. package/dist/profiles/custom-fields/src/generated/client.d.ts +2710 -0
  38. package/dist/profiles/custom-fields/src/generated/client.d.ts.map +1 -0
  39. package/dist/profiles/custom-fields/src/generated/client.js +2663 -0
  40. package/dist/profiles/custom-fields/src/generated/client.js.map +1 -0
  41. package/dist/profiles/runtime/profile.d.ts +3 -0
  42. package/dist/profiles/runtime/profile.d.ts.map +1 -0
  43. package/dist/profiles/runtime/profile.js +1065 -0
  44. package/dist/profiles/runtime/profile.js.map +1 -0
  45. package/dist/profiles/runtime/src/generated/client.d.ts +4274 -0
  46. package/dist/profiles/runtime/src/generated/client.d.ts.map +1 -0
  47. package/dist/profiles/runtime/src/generated/client.js +4607 -0
  48. package/dist/profiles/runtime/src/generated/client.js.map +1 -0
  49. package/dist/runtime-materialize.d.ts +10 -0
  50. package/dist/runtime-materialize.d.ts.map +1 -0
  51. package/dist/runtime-materialize.js +344 -0
  52. package/dist/runtime-materialize.js.map +1 -0
  53. package/dist/runtime-profile.d.ts +34 -0
  54. package/dist/runtime-profile.d.ts.map +1 -0
  55. package/dist/runtime-profile.js +203 -0
  56. package/dist/runtime-profile.js.map +1 -0
  57. package/dist/testing.d.ts +11 -0
  58. package/dist/testing.d.ts.map +1 -0
  59. package/dist/testing.js +12 -0
  60. package/dist/testing.js.map +1 -0
  61. package/generated/go/client.go +2250 -0
  62. package/generated/mcp/tools.json +13922 -0
  63. package/generated/python/client.py +4454 -0
  64. package/generated/riffdb.application.exact.json +1 -0
  65. package/generated/riffdb.contract.bundle +0 -0
  66. package/generated/rust/client.rs +6524 -0
  67. package/package.json +83 -4
  68. package/profiles/custom-fields/generated/go/client.go +2578 -0
  69. package/profiles/custom-fields/generated/mcp/tools.json +15998 -0
  70. package/profiles/custom-fields/generated/python/client.py +5141 -0
  71. package/profiles/custom-fields/generated/riffdb.application.exact.json +1 -0
  72. package/profiles/custom-fields/generated/riffdb.contract.bundle +0 -0
  73. package/profiles/custom-fields/generated/rust/client.rs +7980 -0
  74. package/profiles/custom-fields/profile.ts +474 -0
  75. package/profiles/custom-fields/riffdb/contract.riff +568 -0
  76. package/profiles/custom-fields/riffdb/queries/admin_users_all_email_asc.riffq +24 -0
  77. package/profiles/custom-fields/riffdb/queries/admin_users_contains_asc.riffq +24 -0
  78. package/profiles/custom-fields/riffdb/queries/admin_users_contains_desc.riffq +24 -0
  79. package/profiles/custom-fields/riffdb/queries/admin_users_email_contains_created_desc.riffq +24 -0
  80. package/profiles/custom-fields/riffdb/queries/admin_users_email_contains_image_asc.riffq +24 -0
  81. package/profiles/custom-fields/riffdb/queries/admin_users_ends_with_asc.riffq +24 -0
  82. package/profiles/custom-fields/riffdb/queries/admin_users_ends_with_desc.riffq +24 -0
  83. package/profiles/custom-fields/riffdb/queries/admin_users_starts_with_asc.riffq +24 -0
  84. package/profiles/custom-fields/riffdb/queries/admin_users_starts_with_desc.riffq +24 -0
  85. package/profiles/custom-fields/riffdb/queries/find_account_by_id.riffq +24 -0
  86. package/profiles/custom-fields/riffdb/queries/find_account_by_provider.riffq +26 -0
  87. package/profiles/custom-fields/riffdb/queries/find_accounts_by_user_id.riffq +25 -0
  88. package/profiles/custom-fields/riffdb/queries/find_accounts_by_user_provider.riffq +27 -0
  89. package/profiles/custom-fields/riffdb/queries/find_active_sessions_by_user_id.riffq +23 -0
  90. package/profiles/custom-fields/riffdb/queries/find_credential_account.riffq +25 -0
  91. package/profiles/custom-fields/riffdb/queries/find_expired_verification_ids.riffq +17 -0
  92. package/profiles/custom-fields/riffdb/queries/find_latest_verification.riffq +20 -0
  93. package/profiles/custom-fields/riffdb/queries/find_session_by_id.riffq +20 -0
  94. package/profiles/custom-fields/riffdb/queries/find_session_by_token.riffq +20 -0
  95. package/profiles/custom-fields/riffdb/queries/find_sessions_by_token_set.riffq +20 -0
  96. package/profiles/custom-fields/riffdb/queries/find_sessions_by_user_id.riffq +21 -0
  97. package/profiles/custom-fields/riffdb/queries/find_user_by_email.riffq +16 -0
  98. package/profiles/custom-fields/riffdb/queries/find_user_by_id.riffq +15 -0
  99. package/profiles/custom-fields/riffdb/queries/find_verification_by_id.riffq +19 -0
  100. package/profiles/custom-fields/riffdb/queries/find_verifications_by_identifier.riffq +21 -0
  101. package/profiles/custom-fields/riffdb/queries/profile_account_with_user_by_provider.riffq +31 -0
  102. package/profiles/custom-fields/riffdb/queries/profile_session_with_user_by_id.riffq +14 -0
  103. package/profiles/custom-fields/riffdb/queries/profile_session_with_user_by_token.riffq +14 -0
  104. package/profiles/custom-fields/riffdb/queries/profile_sessions_with_users_by_token_set.riffq +25 -0
  105. package/profiles/custom-fields/riffdb/queries/profile_user_with_accounts_by_email.riffq +19 -0
  106. package/profiles/custom-fields/riffdb/queries/profile_user_with_accounts_by_id.riffq +19 -0
  107. package/profiles/custom-fields/riffdb.application.json +217 -0
  108. package/profiles/custom-fields/riffdb.application.lock.json +1 -0
  109. package/profiles/custom-fields/riffdb.toml +3 -0
  110. package/profiles/custom-fields/src/generated/client.ts +3096 -0
  111. package/profiles/organization-security/materialization.json +51 -0
  112. package/profiles/organization-security/riffdb/contract.riff +778 -0
  113. package/profiles/organization-security/riffdb/queries/find_account_by_id.riffq +18 -0
  114. package/profiles/organization-security/riffdb/queries/find_invitation_by_email.riffq +17 -0
  115. package/profiles/organization-security/riffdb/queries/find_invitation_by_id.riffq +18 -0
  116. package/profiles/organization-security/riffdb/queries/find_invitation_by_organization_id.riffq +17 -0
  117. package/profiles/organization-security/riffdb/queries/find_member_by_id.riffq +18 -0
  118. package/profiles/organization-security/riffdb/queries/find_member_by_user_id.riffq +17 -0
  119. package/profiles/organization-security/riffdb/queries/find_organization_by_id.riffq +16 -0
  120. package/profiles/organization-security/riffdb/queries/find_organization_by_slug.riffq +16 -0
  121. package/profiles/organization-security/riffdb/queries/find_session_by_id.riffq +18 -0
  122. package/profiles/organization-security/riffdb/queries/find_session_by_token.riffq +16 -0
  123. package/profiles/organization-security/riffdb/queries/find_team_by_id.riffq +18 -0
  124. package/profiles/organization-security/riffdb/queries/find_team_member_by_id.riffq +18 -0
  125. package/profiles/organization-security/riffdb/queries/find_team_member_by_membership_key.riffq +16 -0
  126. package/profiles/organization-security/riffdb/queries/find_team_member_by_team_id.riffq +17 -0
  127. package/profiles/organization-security/riffdb/queries/find_two_factor_by_id.riffq +18 -0
  128. package/profiles/organization-security/riffdb/queries/find_two_factor_by_secret.riffq +17 -0
  129. package/profiles/organization-security/riffdb/queries/find_user_by_email.riffq +16 -0
  130. package/profiles/organization-security/riffdb/queries/find_user_by_id.riffq +16 -0
  131. package/profiles/organization-security/riffdb/queries/find_verification_by_id.riffq +16 -0
  132. package/profiles/organization-security/riffdb/queries/find_verification_by_identifier.riffq +17 -0
  133. package/profiles/organization-security/riffdb.application.json +172 -0
  134. package/profiles/organization-security/riffdb.toml +7 -0
  135. package/profiles/organization-security.profile.json +980 -0
  136. package/profiles/runtime/generated/go/client.go +4511 -0
  137. package/profiles/runtime/generated/mcp/tools.json +30004 -0
  138. package/profiles/runtime/generated/python/client.py +9337 -0
  139. package/profiles/runtime/generated/riffdb.application.exact.json +1 -0
  140. package/profiles/runtime/generated/riffdb.contract.bundle +0 -0
  141. package/profiles/runtime/generated/rust/client.rs +13297 -0
  142. package/profiles/runtime/profile.ts +1064 -0
  143. package/profiles/runtime/riffdb/contract.riff +1053 -0
  144. package/profiles/runtime/riffdb/queries/admin_users_all_email_asc.riffq +24 -0
  145. package/profiles/runtime/riffdb/queries/admin_users_contains_asc.riffq +24 -0
  146. package/profiles/runtime/riffdb/queries/admin_users_contains_desc.riffq +24 -0
  147. package/profiles/runtime/riffdb/queries/admin_users_email_contains_created_desc.riffq +24 -0
  148. package/profiles/runtime/riffdb/queries/admin_users_email_contains_image_asc.riffq +24 -0
  149. package/profiles/runtime/riffdb/queries/admin_users_ends_with_asc.riffq +24 -0
  150. package/profiles/runtime/riffdb/queries/admin_users_ends_with_desc.riffq +24 -0
  151. package/profiles/runtime/riffdb/queries/admin_users_starts_with_asc.riffq +24 -0
  152. package/profiles/runtime/riffdb/queries/admin_users_starts_with_desc.riffq +24 -0
  153. package/profiles/runtime/riffdb/queries/find_account_by_id.riffq +24 -0
  154. package/profiles/runtime/riffdb/queries/find_account_by_provider.riffq +26 -0
  155. package/profiles/runtime/riffdb/queries/find_accounts_by_user_id.riffq +25 -0
  156. package/profiles/runtime/riffdb/queries/find_accounts_by_user_provider.riffq +27 -0
  157. package/profiles/runtime/riffdb/queries/find_active_sessions_by_user_id.riffq +23 -0
  158. package/profiles/runtime/riffdb/queries/find_credential_account.riffq +25 -0
  159. package/profiles/runtime/riffdb/queries/find_expired_verification_ids.riffq +17 -0
  160. package/profiles/runtime/riffdb/queries/find_latest_verification.riffq +20 -0
  161. package/profiles/runtime/riffdb/queries/find_session_by_id.riffq +20 -0
  162. package/profiles/runtime/riffdb/queries/find_session_by_token.riffq +20 -0
  163. package/profiles/runtime/riffdb/queries/find_sessions_by_token_set.riffq +20 -0
  164. package/profiles/runtime/riffdb/queries/find_sessions_by_user_id.riffq +21 -0
  165. package/profiles/runtime/riffdb/queries/find_user_by_email.riffq +16 -0
  166. package/profiles/runtime/riffdb/queries/find_user_by_id.riffq +15 -0
  167. package/profiles/runtime/riffdb/queries/find_verification_by_id.riffq +19 -0
  168. package/profiles/runtime/riffdb/queries/find_verifications_by_identifier.riffq +21 -0
  169. package/profiles/runtime/riffdb/queries/profile_account_with_user_by_provider.riffq +31 -0
  170. package/profiles/runtime/riffdb/queries/profile_invitation_by_email.riffq +17 -0
  171. package/profiles/runtime/riffdb/queries/profile_invitation_by_id.riffq +17 -0
  172. package/profiles/runtime/riffdb/queries/profile_invitation_by_organization_email_status.riffq +19 -0
  173. package/profiles/runtime/riffdb/queries/profile_invitation_by_organization_id.riffq +17 -0
  174. package/profiles/runtime/riffdb/queries/profile_invitation_by_organization_status.riffq +18 -0
  175. package/profiles/runtime/riffdb/queries/profile_member_by_id.riffq +27 -0
  176. package/profiles/runtime/riffdb/queries/profile_member_by_organization.riffq +20 -0
  177. package/profiles/runtime/riffdb/queries/profile_member_by_organization_created_at_asc.riffq +20 -0
  178. package/profiles/runtime/riffdb/queries/profile_member_by_organization_created_at_desc.riffq +20 -0
  179. package/profiles/runtime/riffdb/queries/profile_member_by_organization_role_asc.riffq +20 -0
  180. package/profiles/runtime/riffdb/queries/profile_member_by_organization_role_desc.riffq +20 -0
  181. package/profiles/runtime/riffdb/queries/profile_member_by_organization_user.riffq +28 -0
  182. package/profiles/runtime/riffdb/queries/profile_member_by_user.riffq +27 -0
  183. package/profiles/runtime/riffdb/queries/profile_organization_by_id.riffq +27 -0
  184. package/profiles/runtime/riffdb/queries/profile_organization_by_slug.riffq +27 -0
  185. package/profiles/runtime/riffdb/queries/profile_session_with_user_by_id.riffq +14 -0
  186. package/profiles/runtime/riffdb/queries/profile_session_with_user_by_token.riffq +14 -0
  187. package/profiles/runtime/riffdb/queries/profile_sessions_with_users_by_token_set.riffq +25 -0
  188. package/profiles/runtime/riffdb/queries/profile_two_factor_by_id.riffq +17 -0
  189. package/profiles/runtime/riffdb/queries/profile_two_factor_by_user.riffq +17 -0
  190. package/profiles/runtime/riffdb/queries/profile_user_with_accounts_by_email.riffq +19 -0
  191. package/profiles/runtime/riffdb/queries/profile_user_with_accounts_by_id.riffq +19 -0
  192. package/profiles/runtime/riffdb/queries/profile_users_by_id_set.riffq +8 -0
  193. package/profiles/runtime/riffdb.application.json +324 -0
  194. package/profiles/runtime/riffdb.application.lock.json +1 -0
  195. package/profiles/runtime/riffdb.toml +3 -0
  196. package/profiles/runtime/src/generated/client.ts +5186 -0
  197. package/riffdb/contract.riff +547 -0
  198. package/riffdb/queries/admin_users_all_email_asc.riffq +24 -0
  199. package/riffdb/queries/admin_users_contains_asc.riffq +24 -0
  200. package/riffdb/queries/admin_users_contains_desc.riffq +24 -0
  201. package/riffdb/queries/admin_users_email_contains_created_desc.riffq +24 -0
  202. package/riffdb/queries/admin_users_email_contains_image_asc.riffq +24 -0
  203. package/riffdb/queries/admin_users_ends_with_asc.riffq +24 -0
  204. package/riffdb/queries/admin_users_ends_with_desc.riffq +24 -0
  205. package/riffdb/queries/admin_users_starts_with_asc.riffq +24 -0
  206. package/riffdb/queries/admin_users_starts_with_desc.riffq +24 -0
  207. package/riffdb/queries/find_account_by_id.riffq +24 -0
  208. package/riffdb/queries/find_account_by_provider.riffq +26 -0
  209. package/riffdb/queries/find_accounts_by_user_id.riffq +25 -0
  210. package/riffdb/queries/find_accounts_by_user_provider.riffq +27 -0
  211. package/riffdb/queries/find_active_sessions_by_user_id.riffq +23 -0
  212. package/riffdb/queries/find_credential_account.riffq +25 -0
  213. package/riffdb/queries/find_expired_verification_ids.riffq +17 -0
  214. package/riffdb/queries/find_latest_verification.riffq +20 -0
  215. package/riffdb/queries/find_session_by_id.riffq +20 -0
  216. package/riffdb/queries/find_session_by_token.riffq +20 -0
  217. package/riffdb/queries/find_sessions_by_token_set.riffq +20 -0
  218. package/riffdb/queries/find_sessions_by_user_id.riffq +21 -0
  219. package/riffdb/queries/find_user_by_email.riffq +16 -0
  220. package/riffdb/queries/find_user_by_id.riffq +15 -0
  221. package/riffdb/queries/find_verification_by_id.riffq +19 -0
  222. package/riffdb/queries/find_verifications_by_identifier.riffq +21 -0
  223. package/riffdb.application.json +187 -0
  224. package/riffdb.application.lock.json +1 -0
  225. package/scripts/real-riffdb-runner.mjs +333 -0
  226. package/src/generated/client.ts +2746 -0
@@ -0,0 +1,4454 @@
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] = "74fd255eefcf04f0b054dbb6c4a0bed43a7312d82f7755687c9229ee3206ddfc"
26
+ QUERY_MODULE_HASH: Final[str] = "8dff3a38f6c0a915d7653e7571a2ef5795a89b452990d705f38fe0ac93b5ad9a"
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] = "056edbaabe43e1dc95f1f6af9838747f54d927a90d5bc9f2be045ae266d107d3"
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] = "b64d213477dd2275d98422a6c3460b0cae932dd96255fe9d565005e8afa37fc4"
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] = "57aba8cf311c301e985adc324f97b4d963a38e6efa6058a82e248854d75f2f05"
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] = "7aede9eda624f5b4eb4280ca7b8a1421466ce30091177c9abab4f125987eb4ff"
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] = "453cb6c81f506a1f0ac99bed3cc85da59176d2cb83597d5812d771683a60cb4c"
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] = "924c7acfdcf3f7970917ac611b6eafc9175ac69f735d9e1cc01414fcc6f0e696"
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] = "cab8ad8456533e4ce97388948e4f703cac6f2eebb641b83a91c3b005ece7fffb"
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] = "add0aed3dbd0caea0de2857133a857d49eb7bfc0e031d117270cc873137da5ec"
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] = "23c1561fb3956217e79d1b358be468e55c4021b887e927a4fb3c0484c92be872"
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] = "14a08df3dd8a74ea0a5622804bf0c2424086ee73eb10ce57d7df336a7d25f5ba"
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] = "e6c4517a46d725780e79725ca3fdaba2208ef4b282d49f484121eee76c043831"
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] = "ccdc524ca64ad667c209de25b4ce977f43b53ffdd8eb1b70fedf29fc99f27da6"
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] = "21d13b3c30b4a4059f3c436e290d11c20f0f1d1154e05fb48ae3dd0da882526d"
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] = "de1e5232a64a32057699b5ac21f1b43e69d755a3c143595f906fe63e16147264"
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_CREDENTIAL_ACCOUNT_QUERY_PLAN_HASH: Final[str] = "f968271d103a76cc6b2a5496f5cceffe4cff5aa39d2a370379b518d8e7d90771"
671
+ FIND_CREDENTIAL_ACCOUNT_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
672
+ ("FindCredentialAccount", "Account", "access_token"),
673
+ ("FindCredentialAccount", "Account", "refresh_token"),
674
+ ("FindCredentialAccount", "Account", "id_token"),
675
+ ("FindCredentialAccount", "Account", "password"),
676
+ )
677
+
678
+
679
+ @dataclass(frozen=True, slots=True, kw_only=True)
680
+ class FindCredentialAccountParams:
681
+ organization_id: UUID
682
+ user_id: UUID
683
+ account_id: str
684
+ provider_id: str
685
+
686
+ @dataclass(frozen=True, slots=True, kw_only=True)
687
+ class FindCredentialAccountFoundAccounts:
688
+ organization_id: UUID = field(repr=False)
689
+ user_id: UUID = field(repr=False)
690
+ id: UUID = field(repr=False)
691
+ account_id: str = field(repr=False)
692
+ provider_id: str = field(repr=False)
693
+ access_token: str | None = field(repr=False)
694
+ refresh_token: str | None = field(repr=False)
695
+ id_token: str | None = field(repr=False)
696
+ password: str | None = field(repr=False)
697
+ access_token_expires_at: Timestamp | None = field(repr=False)
698
+ refresh_token_expires_at: Timestamp | None = field(repr=False)
699
+ scope: str | None = field(repr=False)
700
+ created_at: Timestamp = field(repr=False)
701
+ updated_at: Timestamp = field(repr=False)
702
+ revision: Annotated[int, "u64"] = field(repr=False)
703
+
704
+ @dataclass(frozen=True, slots=True, kw_only=True)
705
+ class FindCredentialAccountFound:
706
+ accounts: tuple[FindCredentialAccountFoundAccounts, ...] = field(repr=False)
707
+ outcome: Literal["Found"] = field(default="Found", init=False)
708
+
709
+ def is_found(self) -> bool:
710
+ return True
711
+
712
+ def unwrap_found(self) -> FindCredentialAccountFound:
713
+ return self
714
+
715
+ FindCredentialAccountResult: TypeAlias = FindCredentialAccountFound
716
+
717
+ FIND_EXPIRED_VERIFICATION_IDS_QUERY_PLAN_HASH: Final[str] = "6c799850ba3b2eb3222aac85a76f40492c46de76870075b029f3b4ac897ed8b9"
718
+
719
+ @dataclass(frozen=True, slots=True, kw_only=True)
720
+ class FindExpiredVerificationIdsParams:
721
+ organization_id: UUID
722
+ expires_before: Timestamp
723
+ after: str | None = None
724
+
725
+ @dataclass(frozen=True, slots=True, kw_only=True)
726
+ class FindExpiredVerificationIdsFoundVerifications:
727
+ verification_id: UUID
728
+
729
+ @dataclass(frozen=True, slots=True, kw_only=True)
730
+ class FindExpiredVerificationIdsFound:
731
+ verifications: tuple[FindExpiredVerificationIdsFoundVerifications, ...]
732
+ outcome: Literal["Found"] = field(default="Found", init=False)
733
+
734
+ def is_found(self) -> bool:
735
+ return True
736
+
737
+ def unwrap_found(self) -> FindExpiredVerificationIdsFound:
738
+ return self
739
+
740
+ FindExpiredVerificationIdsResult: TypeAlias = FindExpiredVerificationIdsFound
741
+
742
+ FIND_LATEST_VERIFICATION_QUERY_PLAN_HASH: Final[str] = "b3832c0a8a316d3fcbc62b388fbe09ceb6624b55482195f7642553467cba6fcb"
743
+ FIND_LATEST_VERIFICATION_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
744
+ ("FindLatestVerification", "Verification", "value"),
745
+ )
746
+
747
+
748
+ @dataclass(frozen=True, slots=True, kw_only=True)
749
+ class FindLatestVerificationParams:
750
+ organization_id: UUID
751
+ identifier: str
752
+
753
+ @dataclass(frozen=True, slots=True, kw_only=True)
754
+ class FindLatestVerificationFoundVerifications:
755
+ verification_id: UUID = field(repr=False)
756
+ identifier: str = field(repr=False)
757
+ value: str = field(repr=False)
758
+ expires_at: Timestamp = field(repr=False)
759
+ created_at: Timestamp = field(repr=False)
760
+ updated_at: Timestamp = field(repr=False)
761
+ revision: Annotated[int, "u64"] = field(repr=False)
762
+
763
+ @dataclass(frozen=True, slots=True, kw_only=True)
764
+ class FindLatestVerificationFound:
765
+ verifications: tuple[FindLatestVerificationFoundVerifications, ...] = field(repr=False)
766
+ outcome: Literal["Found"] = field(default="Found", init=False)
767
+
768
+ def is_found(self) -> bool:
769
+ return True
770
+
771
+ def unwrap_found(self) -> FindLatestVerificationFound:
772
+ return self
773
+
774
+ FindLatestVerificationResult: TypeAlias = FindLatestVerificationFound
775
+
776
+ FIND_SESSION_BY_ID_QUERY_PLAN_HASH: Final[str] = "c92eb2035c0e3ca7dedbaa42a4e2efe7bc4786a65213394da7f5d3beb579a2a1"
777
+ FIND_SESSION_BY_ID_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
778
+ ("FindSessionById", "Session", "token"),
779
+ )
780
+
781
+
782
+ @dataclass(frozen=True, slots=True, kw_only=True)
783
+ class FindSessionByIdParams:
784
+ organization_id: UUID
785
+ id: UUID
786
+
787
+ @dataclass(frozen=True, slots=True, kw_only=True)
788
+ class FindSessionByIdFoundSessions:
789
+ id: UUID = field(repr=False)
790
+ user_id: UUID = field(repr=False)
791
+ token: str = field(repr=False)
792
+ expires_at: Timestamp = field(repr=False)
793
+ ip_address: str | None = field(repr=False)
794
+ user_agent: str | None = field(repr=False)
795
+ created_at: Timestamp = field(repr=False)
796
+ updated_at: Timestamp = field(repr=False)
797
+ revision: Annotated[int, "u64"] = field(repr=False)
798
+
799
+ @dataclass(frozen=True, slots=True, kw_only=True)
800
+ class FindSessionByIdFound:
801
+ sessions: tuple[FindSessionByIdFoundSessions, ...] = field(repr=False)
802
+ outcome: Literal["Found"] = field(default="Found", init=False)
803
+
804
+ def is_found(self) -> bool:
805
+ return True
806
+
807
+ def unwrap_found(self) -> FindSessionByIdFound:
808
+ return self
809
+
810
+ FindSessionByIdResult: TypeAlias = FindSessionByIdFound
811
+
812
+ FIND_SESSION_BY_TOKEN_QUERY_PLAN_HASH: Final[str] = "a8a12334a3d34c30d54be828bdcc9b9b77223303c3f9681e4a602c92341876ec"
813
+ FIND_SESSION_BY_TOKEN_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
814
+ ("FindSessionByToken", "Session", "token"),
815
+ )
816
+
817
+
818
+ @dataclass(frozen=True, slots=True, kw_only=True)
819
+ class FindSessionByTokenParams:
820
+ organization_id: UUID
821
+ token: str
822
+
823
+ @dataclass(frozen=True, slots=True, kw_only=True)
824
+ class FindSessionByTokenFoundSessions:
825
+ id: UUID = field(repr=False)
826
+ user_id: UUID = field(repr=False)
827
+ token: str = field(repr=False)
828
+ expires_at: Timestamp = field(repr=False)
829
+ ip_address: str | None = field(repr=False)
830
+ user_agent: str | None = field(repr=False)
831
+ created_at: Timestamp = field(repr=False)
832
+ updated_at: Timestamp = field(repr=False)
833
+ revision: Annotated[int, "u64"] = field(repr=False)
834
+
835
+ @dataclass(frozen=True, slots=True, kw_only=True)
836
+ class FindSessionByTokenFound:
837
+ sessions: tuple[FindSessionByTokenFoundSessions, ...] = field(repr=False)
838
+ outcome: Literal["Found"] = field(default="Found", init=False)
839
+
840
+ def is_found(self) -> bool:
841
+ return True
842
+
843
+ def unwrap_found(self) -> FindSessionByTokenFound:
844
+ return self
845
+
846
+ FindSessionByTokenResult: TypeAlias = FindSessionByTokenFound
847
+
848
+ FIND_SESSIONS_BY_TOKEN_SET_QUERY_PLAN_HASH: Final[str] = "7e23187b537599c4c2361d34ea866b5b719f63feda0135587b5ec6afd5ce62f6"
849
+ FIND_SESSIONS_BY_TOKEN_SET_TOKENS_MAX_ITEMS: Final[int] = 32
850
+ FIND_SESSIONS_BY_TOKEN_SET_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
851
+ ("FindSessionsByTokenSet", "Session", "token"),
852
+ )
853
+
854
+
855
+ @dataclass(frozen=True, slots=True, kw_only=True)
856
+ class FindSessionsByTokenSetParams:
857
+ organization_id: UUID
858
+ tokens: tuple[str, ...]
859
+
860
+ @dataclass(frozen=True, slots=True, kw_only=True)
861
+ class FindSessionsByTokenSetFoundSessions:
862
+ id: UUID = field(repr=False)
863
+ user_id: UUID = field(repr=False)
864
+ token: str = field(repr=False)
865
+ expires_at: Timestamp = field(repr=False)
866
+ ip_address: str | None = field(repr=False)
867
+ user_agent: str | None = field(repr=False)
868
+ created_at: Timestamp = field(repr=False)
869
+ updated_at: Timestamp = field(repr=False)
870
+ revision: Annotated[int, "u64"] = field(repr=False)
871
+
872
+ @dataclass(frozen=True, slots=True, kw_only=True)
873
+ class FindSessionsByTokenSetFound:
874
+ sessions: tuple[FindSessionsByTokenSetFoundSessions, ...] = field(repr=False)
875
+ outcome: Literal["Found"] = field(default="Found", init=False)
876
+
877
+ def is_found(self) -> bool:
878
+ return True
879
+
880
+ def unwrap_found(self) -> FindSessionsByTokenSetFound:
881
+ return self
882
+
883
+ FindSessionsByTokenSetResult: TypeAlias = FindSessionsByTokenSetFound
884
+
885
+ FIND_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH: Final[str] = "a3277546d8b0c0059b850c368ae4925000c255e69b7ff005f4b3d2ef61b504af"
886
+ FIND_SESSIONS_BY_USER_ID_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
887
+ ("FindSessionsByUserId", "Session", "token"),
888
+ )
889
+
890
+
891
+ @dataclass(frozen=True, slots=True, kw_only=True)
892
+ class FindSessionsByUserIdParams:
893
+ organization_id: UUID
894
+ user_id: UUID
895
+ after: str | None = None
896
+
897
+ @dataclass(frozen=True, slots=True, kw_only=True)
898
+ class FindSessionsByUserIdFoundSessions:
899
+ id: UUID = field(repr=False)
900
+ user_id: UUID = field(repr=False)
901
+ token: str = field(repr=False)
902
+ expires_at: Timestamp = field(repr=False)
903
+ ip_address: str | None = field(repr=False)
904
+ user_agent: str | None = field(repr=False)
905
+ created_at: Timestamp = field(repr=False)
906
+ updated_at: Timestamp = field(repr=False)
907
+ revision: Annotated[int, "u64"] = field(repr=False)
908
+
909
+ @dataclass(frozen=True, slots=True, kw_only=True)
910
+ class FindSessionsByUserIdFound:
911
+ sessions: tuple[FindSessionsByUserIdFoundSessions, ...] = field(repr=False)
912
+ outcome: Literal["Found"] = field(default="Found", init=False)
913
+
914
+ def is_found(self) -> bool:
915
+ return True
916
+
917
+ def unwrap_found(self) -> FindSessionsByUserIdFound:
918
+ return self
919
+
920
+ FindSessionsByUserIdResult: TypeAlias = FindSessionsByUserIdFound
921
+
922
+ FIND_USER_BY_EMAIL_QUERY_PLAN_HASH: Final[str] = "b167b8cb2fb5ce19685491b47da4e816665b840e0f0e463666f6302134472b9a"
923
+
924
+ @dataclass(frozen=True, slots=True, kw_only=True)
925
+ class FindUserByEmailParams:
926
+ organization_id: UUID
927
+ email: str
928
+
929
+ @dataclass(frozen=True, slots=True, kw_only=True)
930
+ class FindUserByEmailFoundUsers:
931
+ user_id: UUID
932
+ name: str
933
+ email: str
934
+ email_verified: bool
935
+ image: str | None
936
+ created_at: Timestamp
937
+ updated_at: Timestamp
938
+ revision: Annotated[int, "u64"]
939
+
940
+ @dataclass(frozen=True, slots=True, kw_only=True)
941
+ class FindUserByEmailFound:
942
+ users: tuple[FindUserByEmailFoundUsers, ...]
943
+ outcome: Literal["Found"] = field(default="Found", init=False)
944
+
945
+ def is_found(self) -> bool:
946
+ return True
947
+
948
+ def unwrap_found(self) -> FindUserByEmailFound:
949
+ return self
950
+
951
+ FindUserByEmailResult: TypeAlias = FindUserByEmailFound
952
+
953
+ def _decode_find_user_by_email_compact(value: object) -> FindUserByEmailResult:
954
+ if not isinstance(value, dict) or frozenset(value) != frozenset(("$riffdb_compact",)):
955
+ raise ValueError("invalid RiffDB compact result")
956
+ compact = value["$riffdb_compact"]
957
+ 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:
958
+ raise ValueError("invalid RiffDB compact result")
959
+ decoded: list[FindUserByEmailFoundUsers] = []
960
+ for row in compact["rows"]:
961
+ if not isinstance(row, list) or len(row) != 8:
962
+ raise ValueError("invalid RiffDB compact result")
963
+ decoded.append(FindUserByEmailFoundUsers(
964
+
965
+ 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"])),
966
+ 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"))),
967
+ email_verified=(row[2] if type(row[2]) is bool else (_ for _ in ()).throw(ValueError("invalid RiffDB compact bool"))),
968
+ 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"))),
969
+ 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"))),
970
+ revision=(row[5] if type(row[5]) is int and 0 <= row[5] < 2**64 else (_ for _ in ()).throw(ValueError("invalid RiffDB compact u64"))),
971
+ 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"])),
972
+ user_id=UUID(str(_compact_tag(row[7], "uuid", frozenset(("$riffdb", "value")))["value"])),
973
+ ))
974
+ return FindUserByEmailFound(users=tuple(decoded))
975
+
976
+ FIND_USER_BY_ID_QUERY_PLAN_HASH: Final[str] = "25d4a0a77d5df64ab6187528f9fac6b205a03c33e01c9ea6b573e8316b78b924"
977
+
978
+ @dataclass(frozen=True, slots=True, kw_only=True)
979
+ class FindUserByIdParams:
980
+ organization_id: UUID
981
+ id: UUID
982
+
983
+ @dataclass(frozen=True, slots=True, kw_only=True)
984
+ class FindUserByIdFoundUser:
985
+ user_id: UUID
986
+ name: str
987
+ email: str
988
+ email_verified: bool
989
+ image: str | None
990
+ created_at: Timestamp
991
+ updated_at: Timestamp
992
+ revision: Annotated[int, "u64"]
993
+
994
+ @dataclass(frozen=True, slots=True, kw_only=True)
995
+ class FindUserByIdFound:
996
+ user: FindUserByIdFoundUser
997
+ outcome: Literal["Found"] = field(default="Found", init=False)
998
+
999
+ def is_found(self) -> bool:
1000
+ return True
1001
+
1002
+ def is_missing(self) -> bool:
1003
+ return False
1004
+
1005
+ def unwrap_found(self) -> FindUserByIdFound:
1006
+ return self
1007
+
1008
+ @dataclass(frozen=True, slots=True, kw_only=True)
1009
+ class FindUserByIdMissing:
1010
+ outcome: Literal["Missing"] = field(default="Missing", init=False)
1011
+
1012
+ def is_found(self) -> bool:
1013
+ return False
1014
+
1015
+ def is_missing(self) -> bool:
1016
+ return True
1017
+
1018
+ def unwrap_found(self) -> FindUserByIdFound:
1019
+ raise ValueError("expected FindUserById outcome found")
1020
+
1021
+ FindUserByIdResult: TypeAlias = FindUserByIdFound | FindUserByIdMissing
1022
+
1023
+ FIND_VERIFICATION_BY_ID_QUERY_PLAN_HASH: Final[str] = "54f07c7eba7d51857dd6473e39304dc798bf7084ca946dfa7f0203633a5133ac"
1024
+ FIND_VERIFICATION_BY_ID_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
1025
+ ("FindVerificationById", "Verification", "value"),
1026
+ )
1027
+
1028
+
1029
+ @dataclass(frozen=True, slots=True, kw_only=True)
1030
+ class FindVerificationByIdParams:
1031
+ organization_id: UUID
1032
+ id: UUID
1033
+
1034
+ @dataclass(frozen=True, slots=True, kw_only=True)
1035
+ class FindVerificationByIdFoundVerification:
1036
+ verification_id: UUID = field(repr=False)
1037
+ identifier: str = field(repr=False)
1038
+ value: str = field(repr=False)
1039
+ expires_at: Timestamp = field(repr=False)
1040
+ created_at: Timestamp = field(repr=False)
1041
+ updated_at: Timestamp = field(repr=False)
1042
+ revision: Annotated[int, "u64"] = field(repr=False)
1043
+
1044
+ @dataclass(frozen=True, slots=True, kw_only=True)
1045
+ class FindVerificationByIdFound:
1046
+ verification: FindVerificationByIdFoundVerification = field(repr=False)
1047
+ outcome: Literal["Found"] = field(default="Found", init=False)
1048
+
1049
+ def is_found(self) -> bool:
1050
+ return True
1051
+
1052
+ def is_missing(self) -> bool:
1053
+ return False
1054
+
1055
+ def unwrap_found(self) -> FindVerificationByIdFound:
1056
+ return self
1057
+
1058
+ @dataclass(frozen=True, slots=True, kw_only=True)
1059
+ class FindVerificationByIdMissing:
1060
+ outcome: Literal["Missing"] = field(default="Missing", init=False)
1061
+
1062
+ def is_found(self) -> bool:
1063
+ return False
1064
+
1065
+ def is_missing(self) -> bool:
1066
+ return True
1067
+
1068
+ def unwrap_found(self) -> FindVerificationByIdFound:
1069
+ raise ValueError("expected FindVerificationById outcome found")
1070
+
1071
+ FindVerificationByIdResult: TypeAlias = FindVerificationByIdFound | FindVerificationByIdMissing
1072
+
1073
+ FIND_VERIFICATIONS_BY_IDENTIFIER_QUERY_PLAN_HASH: Final[str] = "4c768ae1d966454e9b791cd57a6311476947b5c457020943a50bc3cfee90765b"
1074
+ FIND_VERIFICATIONS_BY_IDENTIFIER_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str], ...]] = (
1075
+ ("FindVerificationsByIdentifier", "Verification", "value"),
1076
+ )
1077
+
1078
+
1079
+ @dataclass(frozen=True, slots=True, kw_only=True)
1080
+ class FindVerificationsByIdentifierParams:
1081
+ organization_id: UUID
1082
+ identifier: str
1083
+ after: str | None = None
1084
+
1085
+ @dataclass(frozen=True, slots=True, kw_only=True)
1086
+ class FindVerificationsByIdentifierFoundVerifications:
1087
+ verification_id: UUID = field(repr=False)
1088
+ identifier: str = field(repr=False)
1089
+ value: str = field(repr=False)
1090
+ expires_at: Timestamp = field(repr=False)
1091
+ created_at: Timestamp = field(repr=False)
1092
+ updated_at: Timestamp = field(repr=False)
1093
+ revision: Annotated[int, "u64"] = field(repr=False)
1094
+
1095
+ @dataclass(frozen=True, slots=True, kw_only=True)
1096
+ class FindVerificationsByIdentifierFound:
1097
+ verifications: tuple[FindVerificationsByIdentifierFoundVerifications, ...] = field(repr=False)
1098
+ outcome: Literal["Found"] = field(default="Found", init=False)
1099
+
1100
+ def is_found(self) -> bool:
1101
+ return True
1102
+
1103
+ def unwrap_found(self) -> FindVerificationsByIdentifierFound:
1104
+ return self
1105
+
1106
+ FindVerificationsByIdentifierResult: TypeAlias = FindVerificationsByIdentifierFound
1107
+
1108
+ CONSUME_VERIFICATION_SECRET_OUTPUTS: Final[tuple[tuple[str, str, str, str], ...]] = (
1109
+ ("VerificationConsumed", "value", "Verification", "value"),
1110
+ )
1111
+
1112
+ @dataclass(frozen=True, slots=True, kw_only=True)
1113
+ class ConsumeVerificationInput:
1114
+ request_id: UUID
1115
+ organization_id: UUID
1116
+ verification_id: UUID
1117
+
1118
+ CONSUME_VERIFICATION_PLAN_HASH: Final[str] = "22a3f3b01aeb537ae2b8b3f758aa19d8f8a6a58a0e284b3b347d1079972adef2"
1119
+ @dataclass(frozen=True, slots=True, kw_only=True, repr=False)
1120
+ class ConsumeVerificationVerificationConsumed:
1121
+ value: str
1122
+ revision: Annotated[int, "u64"]
1123
+ created_at: Timestamp
1124
+ expires_at: Timestamp
1125
+ identifier: str
1126
+ updated_at: Timestamp
1127
+ verification_id: UUID
1128
+ outcome: Literal["VerificationConsumed"] = field(default="VerificationConsumed", init=False)
1129
+
1130
+ def is_verification_consumed(self) -> bool:
1131
+ return True
1132
+
1133
+ def is_verification_consume_missing(self) -> bool:
1134
+ return False
1135
+
1136
+ def __repr__(self) -> str:
1137
+ return "ConsumeVerificationVerificationConsumed(<secret outputs redacted>)"
1138
+
1139
+ @dataclass(frozen=True, slots=True, kw_only=True)
1140
+ class ConsumeVerificationVerificationConsumeMissing:
1141
+ outcome: Literal["VerificationConsumeMissing"] = field(default="VerificationConsumeMissing", init=False)
1142
+
1143
+ def is_verification_consumed(self) -> bool:
1144
+ return False
1145
+
1146
+ def is_verification_consume_missing(self) -> bool:
1147
+ return True
1148
+
1149
+ ConsumeVerificationOutcome: TypeAlias = ConsumeVerificationVerificationConsumed | ConsumeVerificationVerificationConsumeMissing
1150
+
1151
+ @dataclass(frozen=True, slots=True, kw_only=True)
1152
+ class ConsumeVerificationSetInput:
1153
+ request_id: UUID
1154
+ organization_id: UUID
1155
+ verification_ids: tuple[UUID, ...]
1156
+
1157
+ CONSUME_VERIFICATION_SET_PLAN_HASH: Final[str] = "cc5e0d69851c61f11bbbca45ad00bec80b32687a94272379e133fbf854d59780"
1158
+ @dataclass(frozen=True, slots=True, kw_only=True)
1159
+ class ConsumeVerificationSetVerificationSetConsumed:
1160
+ outcome: Literal["VerificationSetConsumed"] = field(default="VerificationSetConsumed", init=False)
1161
+
1162
+ def is_verification_set_consumed(self) -> bool:
1163
+ return True
1164
+
1165
+ def is_verification_consume_missing(self) -> bool:
1166
+ return False
1167
+
1168
+ @dataclass(frozen=True, slots=True, kw_only=True)
1169
+ class ConsumeVerificationSetVerificationConsumeMissing:
1170
+ outcome: Literal["VerificationConsumeMissing"] = field(default="VerificationConsumeMissing", init=False)
1171
+
1172
+ def is_verification_set_consumed(self) -> bool:
1173
+ return False
1174
+
1175
+ def is_verification_consume_missing(self) -> bool:
1176
+ return True
1177
+
1178
+ ConsumeVerificationSetOutcome: TypeAlias = ConsumeVerificationSetVerificationSetConsumed | ConsumeVerificationSetVerificationConsumeMissing
1179
+
1180
+ @dataclass(frozen=True, slots=True, kw_only=True)
1181
+ class ConsumeVerificationSnapshotInput:
1182
+ request_id: UUID
1183
+ organization_id: UUID
1184
+ verification_id: UUID
1185
+ expected_revision: Annotated[int, "u64"]
1186
+
1187
+ CONSUME_VERIFICATION_SNAPSHOT_PLAN_HASH: Final[str] = "1a80a36f34b4699c972fc1e6f48cad3f85da54e202831a6986aea084db09788b"
1188
+ @dataclass(frozen=True, slots=True, kw_only=True)
1189
+ class ConsumeVerificationSnapshotVerificationConsumed:
1190
+ outcome: Literal["VerificationConsumed"] = field(default="VerificationConsumed", init=False)
1191
+
1192
+ def is_verification_consumed(self) -> bool:
1193
+ return True
1194
+
1195
+ def is_verification_consume_stale(self) -> bool:
1196
+ return False
1197
+
1198
+ def is_verification_consume_missing(self) -> bool:
1199
+ return False
1200
+
1201
+ @dataclass(frozen=True, slots=True, kw_only=True)
1202
+ class ConsumeVerificationSnapshotVerificationConsumeStale:
1203
+ outcome: Literal["VerificationConsumeStale"] = field(default="VerificationConsumeStale", init=False)
1204
+
1205
+ def is_verification_consumed(self) -> bool:
1206
+ return False
1207
+
1208
+ def is_verification_consume_stale(self) -> bool:
1209
+ return True
1210
+
1211
+ def is_verification_consume_missing(self) -> bool:
1212
+ return False
1213
+
1214
+ @dataclass(frozen=True, slots=True, kw_only=True)
1215
+ class ConsumeVerificationSnapshotVerificationConsumeMissing:
1216
+ outcome: Literal["VerificationConsumeMissing"] = field(default="VerificationConsumeMissing", init=False)
1217
+
1218
+ def is_verification_consumed(self) -> bool:
1219
+ return False
1220
+
1221
+ def is_verification_consume_stale(self) -> bool:
1222
+ return False
1223
+
1224
+ def is_verification_consume_missing(self) -> bool:
1225
+ return True
1226
+
1227
+ ConsumeVerificationSnapshotOutcome: TypeAlias = ConsumeVerificationSnapshotVerificationConsumed | ConsumeVerificationSnapshotVerificationConsumeStale | ConsumeVerificationSnapshotVerificationConsumeMissing
1228
+
1229
+ @dataclass(frozen=True, slots=True, kw_only=True)
1230
+ class CreateAccountInput:
1231
+ id: UUID
1232
+ scope: str | None
1233
+ user_id: UUID
1234
+ id_token: str | None
1235
+ password: str | None
1236
+ account_id: str
1237
+ created_at: Timestamp
1238
+ request_id: UUID
1239
+ updated_at: Timestamp
1240
+ provider_id: str
1241
+ access_token: str | None
1242
+ refresh_token: str | None
1243
+ organization_id: UUID
1244
+ access_token_expires_at: Timestamp | None
1245
+ refresh_token_expires_at: Timestamp | None
1246
+
1247
+ CREATE_ACCOUNT_PLAN_HASH: Final[str] = "53f2e7b330780eb514a299ceb673da4f1eeaea81beb45253267a52e41a7fd0b2"
1248
+ @dataclass(frozen=True, slots=True, kw_only=True)
1249
+ class CreateAccountAccountCreated:
1250
+ outcome: Literal["AccountCreated"] = field(default="AccountCreated", init=False)
1251
+
1252
+ def is_account_created(self) -> bool:
1253
+ return True
1254
+
1255
+ def is_account_user_missing(self) -> bool:
1256
+ return False
1257
+
1258
+ def is_account_already_exists(self) -> bool:
1259
+ return False
1260
+
1261
+ @dataclass(frozen=True, slots=True, kw_only=True)
1262
+ class CreateAccountAccountUserMissing:
1263
+ outcome: Literal["AccountUserMissing"] = field(default="AccountUserMissing", init=False)
1264
+
1265
+ def is_account_created(self) -> bool:
1266
+ return False
1267
+
1268
+ def is_account_user_missing(self) -> bool:
1269
+ return True
1270
+
1271
+ def is_account_already_exists(self) -> bool:
1272
+ return False
1273
+
1274
+ @dataclass(frozen=True, slots=True, kw_only=True)
1275
+ class CreateAccountAccountAlreadyExists:
1276
+ outcome: Literal["AccountAlreadyExists"] = field(default="AccountAlreadyExists", init=False)
1277
+
1278
+ def is_account_created(self) -> bool:
1279
+ return False
1280
+
1281
+ def is_account_user_missing(self) -> bool:
1282
+ return False
1283
+
1284
+ def is_account_already_exists(self) -> bool:
1285
+ return True
1286
+
1287
+ CreateAccountOutcome: TypeAlias = CreateAccountAccountCreated | CreateAccountAccountUserMissing | CreateAccountAccountAlreadyExists
1288
+
1289
+ @dataclass(frozen=True, slots=True, kw_only=True)
1290
+ class CreateOAuthUserGraphInput:
1291
+ scope: str | None
1292
+ user_id: UUID
1293
+ id_token: str | None
1294
+ password: str | None
1295
+ user_name: str
1296
+ account_id: UUID
1297
+ request_id: UUID
1298
+ user_email: str
1299
+ user_image: str | None
1300
+ provider_id: str
1301
+ access_token: str | None
1302
+ refresh_token: str | None
1303
+ organization_id: UUID
1304
+ user_created_at: Timestamp
1305
+ user_updated_at: Timestamp
1306
+ account_created_at: Timestamp
1307
+ account_updated_at: Timestamp
1308
+ external_account_id: str
1309
+ user_email_verified: bool
1310
+ access_token_expires_at: Timestamp | None
1311
+ refresh_token_expires_at: Timestamp | None
1312
+
1313
+ CREATE_OAUTH_USER_GRAPH_PLAN_HASH: Final[str] = "a30c6faca9666ff17536e1f4ec35f0306e970430a064e0d72a66adccefad7407"
1314
+ @dataclass(frozen=True, slots=True, kw_only=True)
1315
+ class CreateOAuthUserGraphOAuthUserExists:
1316
+ outcome: Literal["OAuthUserExists"] = field(default="OAuthUserExists", init=False)
1317
+
1318
+ def is_oauth_user_exists(self) -> bool:
1319
+ return True
1320
+
1321
+ def is_oauth_account_exists(self) -> bool:
1322
+ return False
1323
+
1324
+ def is_oauth_user_graph_created(self) -> bool:
1325
+ return False
1326
+
1327
+ @dataclass(frozen=True, slots=True, kw_only=True)
1328
+ class CreateOAuthUserGraphOAuthAccountExists:
1329
+ outcome: Literal["OAuthAccountExists"] = field(default="OAuthAccountExists", init=False)
1330
+
1331
+ def is_oauth_user_exists(self) -> bool:
1332
+ return False
1333
+
1334
+ def is_oauth_account_exists(self) -> bool:
1335
+ return True
1336
+
1337
+ def is_oauth_user_graph_created(self) -> bool:
1338
+ return False
1339
+
1340
+ @dataclass(frozen=True, slots=True, kw_only=True)
1341
+ class CreateOAuthUserGraphOAuthUserGraphCreated:
1342
+ outcome: Literal["OAuthUserGraphCreated"] = field(default="OAuthUserGraphCreated", init=False)
1343
+
1344
+ def is_oauth_user_exists(self) -> bool:
1345
+ return False
1346
+
1347
+ def is_oauth_account_exists(self) -> bool:
1348
+ return False
1349
+
1350
+ def is_oauth_user_graph_created(self) -> bool:
1351
+ return True
1352
+
1353
+ CreateOAuthUserGraphOutcome: TypeAlias = CreateOAuthUserGraphOAuthUserExists | CreateOAuthUserGraphOAuthAccountExists | CreateOAuthUserGraphOAuthUserGraphCreated
1354
+
1355
+ @dataclass(frozen=True, slots=True, kw_only=True)
1356
+ class CreateSessionInput:
1357
+ id: UUID
1358
+ token: str
1359
+ user_id: UUID
1360
+ created_at: Timestamp
1361
+ expires_at: Timestamp
1362
+ ip_address: str | None
1363
+ request_id: UUID
1364
+ updated_at: Timestamp
1365
+ user_agent: str | None
1366
+ organization_id: UUID
1367
+
1368
+ CREATE_SESSION_PLAN_HASH: Final[str] = "c5e41496adb0a45f87503008fa43da87c6c729674bb1f521625ff16183059050"
1369
+ @dataclass(frozen=True, slots=True, kw_only=True)
1370
+ class CreateSessionSessionCreated:
1371
+ outcome: Literal["SessionCreated"] = field(default="SessionCreated", init=False)
1372
+
1373
+ def is_session_created(self) -> bool:
1374
+ return True
1375
+
1376
+ def is_session_user_missing(self) -> bool:
1377
+ return False
1378
+
1379
+ def is_session_already_exists(self) -> bool:
1380
+ return False
1381
+
1382
+ @dataclass(frozen=True, slots=True, kw_only=True)
1383
+ class CreateSessionSessionUserMissing:
1384
+ outcome: Literal["SessionUserMissing"] = field(default="SessionUserMissing", init=False)
1385
+
1386
+ def is_session_created(self) -> bool:
1387
+ return False
1388
+
1389
+ def is_session_user_missing(self) -> bool:
1390
+ return True
1391
+
1392
+ def is_session_already_exists(self) -> bool:
1393
+ return False
1394
+
1395
+ @dataclass(frozen=True, slots=True, kw_only=True)
1396
+ class CreateSessionSessionAlreadyExists:
1397
+ outcome: Literal["SessionAlreadyExists"] = field(default="SessionAlreadyExists", init=False)
1398
+
1399
+ def is_session_created(self) -> bool:
1400
+ return False
1401
+
1402
+ def is_session_user_missing(self) -> bool:
1403
+ return False
1404
+
1405
+ def is_session_already_exists(self) -> bool:
1406
+ return True
1407
+
1408
+ CreateSessionOutcome: TypeAlias = CreateSessionSessionCreated | CreateSessionSessionUserMissing | CreateSessionSessionAlreadyExists
1409
+
1410
+ @dataclass(frozen=True, slots=True, kw_only=True)
1411
+ class CreateSignupGraphInput:
1412
+ user_id: UUID
1413
+ user_name: str
1414
+ account_id: UUID
1415
+ request_id: UUID
1416
+ session_id: UUID
1417
+ user_email: str
1418
+ user_image: str | None
1419
+ provider_id: str
1420
+ session_token: str
1421
+ organization_id: UUID
1422
+ user_created_at: Timestamp
1423
+ user_updated_at: Timestamp
1424
+ account_password: str | None
1425
+ account_created_at: Timestamp
1426
+ account_updated_at: Timestamp
1427
+ session_created_at: Timestamp
1428
+ session_expires_at: Timestamp
1429
+ session_ip_address: str | None
1430
+ session_updated_at: Timestamp
1431
+ session_user_agent: str | None
1432
+ external_account_id: str
1433
+ user_email_verified: bool
1434
+
1435
+ CREATE_SIGNUP_GRAPH_PLAN_HASH: Final[str] = "01e4e118b1cc5c3a16c19259284cd0845e8a2e405fc02f81ab9b1fcafc79d0b8"
1436
+ @dataclass(frozen=True, slots=True, kw_only=True)
1437
+ class CreateSignupGraphSignupUserExists:
1438
+ outcome: Literal["SignupUserExists"] = field(default="SignupUserExists", init=False)
1439
+
1440
+ def is_signup_user_exists(self) -> bool:
1441
+ return True
1442
+
1443
+ def is_signup_graph_created(self) -> bool:
1444
+ return False
1445
+
1446
+ def is_signup_account_exists(self) -> bool:
1447
+ return False
1448
+
1449
+ def is_signup_session_exists(self) -> bool:
1450
+ return False
1451
+
1452
+ @dataclass(frozen=True, slots=True, kw_only=True)
1453
+ class CreateSignupGraphSignupGraphCreated:
1454
+ outcome: Literal["SignupGraphCreated"] = field(default="SignupGraphCreated", init=False)
1455
+
1456
+ def is_signup_user_exists(self) -> bool:
1457
+ return False
1458
+
1459
+ def is_signup_graph_created(self) -> bool:
1460
+ return True
1461
+
1462
+ def is_signup_account_exists(self) -> bool:
1463
+ return False
1464
+
1465
+ def is_signup_session_exists(self) -> bool:
1466
+ return False
1467
+
1468
+ @dataclass(frozen=True, slots=True, kw_only=True)
1469
+ class CreateSignupGraphSignupAccountExists:
1470
+ outcome: Literal["SignupAccountExists"] = field(default="SignupAccountExists", init=False)
1471
+
1472
+ def is_signup_user_exists(self) -> bool:
1473
+ return False
1474
+
1475
+ def is_signup_graph_created(self) -> bool:
1476
+ return False
1477
+
1478
+ def is_signup_account_exists(self) -> bool:
1479
+ return True
1480
+
1481
+ def is_signup_session_exists(self) -> bool:
1482
+ return False
1483
+
1484
+ @dataclass(frozen=True, slots=True, kw_only=True)
1485
+ class CreateSignupGraphSignupSessionExists:
1486
+ outcome: Literal["SignupSessionExists"] = field(default="SignupSessionExists", init=False)
1487
+
1488
+ def is_signup_user_exists(self) -> bool:
1489
+ return False
1490
+
1491
+ def is_signup_graph_created(self) -> bool:
1492
+ return False
1493
+
1494
+ def is_signup_account_exists(self) -> bool:
1495
+ return False
1496
+
1497
+ def is_signup_session_exists(self) -> bool:
1498
+ return True
1499
+
1500
+ CreateSignupGraphOutcome: TypeAlias = CreateSignupGraphSignupUserExists | CreateSignupGraphSignupGraphCreated | CreateSignupGraphSignupAccountExists | CreateSignupGraphSignupSessionExists
1501
+
1502
+ @dataclass(frozen=True, slots=True, kw_only=True)
1503
+ class CreateUserInput:
1504
+ id: UUID
1505
+ name: str
1506
+ email: str
1507
+ image: str | None
1508
+ created_at: Timestamp
1509
+ request_id: UUID
1510
+ updated_at: Timestamp
1511
+ email_verified: bool
1512
+ organization_id: UUID
1513
+
1514
+ CREATE_USER_PLAN_HASH: Final[str] = "752d7d404aa418b5c1a08065ce9a8efbb28ab2b62f18969c98a13a06092fd8b3"
1515
+ @dataclass(frozen=True, slots=True, kw_only=True)
1516
+ class CreateUserUserCreated:
1517
+ outcome: Literal["UserCreated"] = field(default="UserCreated", init=False)
1518
+
1519
+ def is_user_created(self) -> bool:
1520
+ return True
1521
+
1522
+ def is_user_already_exists(self) -> bool:
1523
+ return False
1524
+
1525
+ @dataclass(frozen=True, slots=True, kw_only=True)
1526
+ class CreateUserUserAlreadyExists:
1527
+ outcome: Literal["UserAlreadyExists"] = field(default="UserAlreadyExists", init=False)
1528
+
1529
+ def is_user_created(self) -> bool:
1530
+ return False
1531
+
1532
+ def is_user_already_exists(self) -> bool:
1533
+ return True
1534
+
1535
+ CreateUserOutcome: TypeAlias = CreateUserUserCreated | CreateUserUserAlreadyExists
1536
+
1537
+ @dataclass(frozen=True, slots=True, kw_only=True)
1538
+ class CreateVerificationInput:
1539
+ id: UUID
1540
+ value: str
1541
+ created_at: Timestamp
1542
+ expires_at: Timestamp
1543
+ identifier: str
1544
+ request_id: UUID
1545
+ updated_at: Timestamp
1546
+ organization_id: UUID
1547
+
1548
+ CREATE_VERIFICATION_PLAN_HASH: Final[str] = "82bce005457b1fcf1d069a69304f7bf4e2eeb7d2718d5289dc9d25e197309e35"
1549
+ @dataclass(frozen=True, slots=True, kw_only=True)
1550
+ class CreateVerificationVerificationCreated:
1551
+ outcome: Literal["VerificationCreated"] = field(default="VerificationCreated", init=False)
1552
+
1553
+ def is_verification_created(self) -> bool:
1554
+ return True
1555
+
1556
+ def is_verification_already_exists(self) -> bool:
1557
+ return False
1558
+
1559
+ @dataclass(frozen=True, slots=True, kw_only=True)
1560
+ class CreateVerificationVerificationAlreadyExists:
1561
+ outcome: Literal["VerificationAlreadyExists"] = field(default="VerificationAlreadyExists", init=False)
1562
+
1563
+ def is_verification_created(self) -> bool:
1564
+ return False
1565
+
1566
+ def is_verification_already_exists(self) -> bool:
1567
+ return True
1568
+
1569
+ CreateVerificationOutcome: TypeAlias = CreateVerificationVerificationCreated | CreateVerificationVerificationAlreadyExists
1570
+
1571
+ @dataclass(frozen=True, slots=True, kw_only=True)
1572
+ class DeleteAccountInput:
1573
+ user_id: UUID
1574
+ request_id: UUID
1575
+ account_ids: tuple[UUID, ...]
1576
+ organization_id: UUID
1577
+
1578
+ DELETE_ACCOUNT_PLAN_HASH: Final[str] = "6429ebe6e70797c57c44a4738c8a511bbe5304e5bf58148dfc0c2721ffaff382"
1579
+ @dataclass(frozen=True, slots=True, kw_only=True)
1580
+ class DeleteAccountAccountDeleted:
1581
+ outcome: Literal["AccountDeleted"] = field(default="AccountDeleted", init=False)
1582
+
1583
+ def is_account_deleted(self) -> bool:
1584
+ return True
1585
+
1586
+ def is_account_missing(self) -> bool:
1587
+ return False
1588
+
1589
+ @dataclass(frozen=True, slots=True, kw_only=True)
1590
+ class DeleteAccountAccountMissing:
1591
+ outcome: Literal["AccountMissing"] = field(default="AccountMissing", init=False)
1592
+
1593
+ def is_account_deleted(self) -> bool:
1594
+ return False
1595
+
1596
+ def is_account_missing(self) -> bool:
1597
+ return True
1598
+
1599
+ DeleteAccountOutcome: TypeAlias = DeleteAccountAccountDeleted | DeleteAccountAccountMissing
1600
+
1601
+ @dataclass(frozen=True, slots=True, kw_only=True)
1602
+ class DeleteSessionInput:
1603
+ user_id: UUID
1604
+ request_id: UUID
1605
+ session_ids: tuple[UUID, ...]
1606
+ organization_id: UUID
1607
+
1608
+ DELETE_SESSION_PLAN_HASH: Final[str] = "a3901beb6c2d2754fd3d2c64252b6f5059cd1792c0a0560741c94da4668a0524"
1609
+ @dataclass(frozen=True, slots=True, kw_only=True)
1610
+ class DeleteSessionSessionDeleted:
1611
+ outcome: Literal["SessionDeleted"] = field(default="SessionDeleted", init=False)
1612
+
1613
+ def is_session_deleted(self) -> bool:
1614
+ return True
1615
+
1616
+ def is_session_missing(self) -> bool:
1617
+ return False
1618
+
1619
+ @dataclass(frozen=True, slots=True, kw_only=True)
1620
+ class DeleteSessionSessionMissing:
1621
+ outcome: Literal["SessionMissing"] = field(default="SessionMissing", init=False)
1622
+
1623
+ def is_session_deleted(self) -> bool:
1624
+ return False
1625
+
1626
+ def is_session_missing(self) -> bool:
1627
+ return True
1628
+
1629
+ DeleteSessionOutcome: TypeAlias = DeleteSessionSessionDeleted | DeleteSessionSessionMissing
1630
+
1631
+ @dataclass(frozen=True, slots=True, kw_only=True)
1632
+ class DeleteUserInput:
1633
+ user_ids: tuple[UUID, ...]
1634
+ request_id: UUID
1635
+ organization_id: UUID
1636
+
1637
+ DELETE_USER_PLAN_HASH: Final[str] = "f7195857c4f50a68b37ee0f8516c27dd03b08d5cd5ba45f53d9f9345d2f90985"
1638
+ @dataclass(frozen=True, slots=True, kw_only=True)
1639
+ class DeleteUserUserDeleted:
1640
+ outcome: Literal["UserDeleted"] = field(default="UserDeleted", init=False)
1641
+
1642
+ def is_user_deleted(self) -> bool:
1643
+ return True
1644
+
1645
+ def is_delete_user_missing(self) -> bool:
1646
+ return False
1647
+
1648
+ def is_delete_user_cascade_limit_exceeded(self) -> bool:
1649
+ return False
1650
+
1651
+ @dataclass(frozen=True, slots=True, kw_only=True)
1652
+ class DeleteUserDeleteUserMissing:
1653
+ outcome: Literal["DeleteUserMissing"] = field(default="DeleteUserMissing", init=False)
1654
+
1655
+ def is_user_deleted(self) -> bool:
1656
+ return False
1657
+
1658
+ def is_delete_user_missing(self) -> bool:
1659
+ return True
1660
+
1661
+ def is_delete_user_cascade_limit_exceeded(self) -> bool:
1662
+ return False
1663
+
1664
+ @dataclass(frozen=True, slots=True, kw_only=True)
1665
+ class DeleteUserDeleteUserCascadeLimitExceeded:
1666
+ outcome: Literal["DeleteUserCascadeLimitExceeded"] = field(default="DeleteUserCascadeLimitExceeded", init=False)
1667
+
1668
+ def is_user_deleted(self) -> bool:
1669
+ return False
1670
+
1671
+ def is_delete_user_missing(self) -> bool:
1672
+ return False
1673
+
1674
+ def is_delete_user_cascade_limit_exceeded(self) -> bool:
1675
+ return True
1676
+
1677
+ DeleteUserOutcome: TypeAlias = DeleteUserUserDeleted | DeleteUserDeleteUserMissing | DeleteUserDeleteUserCascadeLimitExceeded
1678
+
1679
+ @dataclass(frozen=True, slots=True, kw_only=True)
1680
+ class DeleteVerificationInput:
1681
+ request_id: UUID
1682
+ organization_id: UUID
1683
+ verification_ids: tuple[UUID, ...]
1684
+
1685
+ DELETE_VERIFICATION_PLAN_HASH: Final[str] = "bffc0c5ef5ad2b602954492d043e833785ec3f9d6f0520fbc0f933422544ae6a"
1686
+ @dataclass(frozen=True, slots=True, kw_only=True)
1687
+ class DeleteVerificationVerificationDeleted:
1688
+ outcome: Literal["VerificationDeleted"] = field(default="VerificationDeleted", init=False)
1689
+
1690
+ def is_verification_deleted(self) -> bool:
1691
+ return True
1692
+
1693
+ def is_verification_missing(self) -> bool:
1694
+ return False
1695
+
1696
+ @dataclass(frozen=True, slots=True, kw_only=True)
1697
+ class DeleteVerificationVerificationMissing:
1698
+ outcome: Literal["VerificationMissing"] = field(default="VerificationMissing", init=False)
1699
+
1700
+ def is_verification_deleted(self) -> bool:
1701
+ return False
1702
+
1703
+ def is_verification_missing(self) -> bool:
1704
+ return True
1705
+
1706
+ DeleteVerificationOutcome: TypeAlias = DeleteVerificationVerificationDeleted | DeleteVerificationVerificationMissing
1707
+
1708
+ @dataclass(frozen=True, slots=True, kw_only=True)
1709
+ class ResetCredentialPasswordInput:
1710
+ user_id: UUID
1711
+ password: str
1712
+ account_id: UUID
1713
+ request_id: UUID
1714
+ updated_at: Timestamp
1715
+ organization_id: UUID
1716
+ account_revision: Annotated[int, "u64"]
1717
+ verification_ids: tuple[UUID, ...]
1718
+ external_account_id: str
1719
+ verification_revision: Annotated[int, "u64"]
1720
+
1721
+ RESET_CREDENTIAL_PASSWORD_PLAN_HASH: Final[str] = "ed87f267831fb0823b0e9bbf51d7b302a715a95c0cea69faf7922c0e4e7f375e"
1722
+ @dataclass(frozen=True, slots=True, kw_only=True)
1723
+ class ResetCredentialPasswordPasswordAccountStale:
1724
+ outcome: Literal["PasswordAccountStale"] = field(default="PasswordAccountStale", init=False)
1725
+
1726
+ def is_password_account_stale(self) -> bool:
1727
+ return True
1728
+
1729
+ def is_password_account_missing(self) -> bool:
1730
+ return False
1731
+
1732
+ def is_credential_password_reset(self) -> bool:
1733
+ return False
1734
+
1735
+ def is_password_provider_mismatch(self) -> bool:
1736
+ return False
1737
+
1738
+ def is_verification_consume_stale(self) -> bool:
1739
+ return False
1740
+
1741
+ def is_verification_consume_missing(self) -> bool:
1742
+ return False
1743
+
1744
+ @dataclass(frozen=True, slots=True, kw_only=True)
1745
+ class ResetCredentialPasswordPasswordAccountMissing:
1746
+ outcome: Literal["PasswordAccountMissing"] = field(default="PasswordAccountMissing", init=False)
1747
+
1748
+ def is_password_account_stale(self) -> bool:
1749
+ return False
1750
+
1751
+ def is_password_account_missing(self) -> bool:
1752
+ return True
1753
+
1754
+ def is_credential_password_reset(self) -> bool:
1755
+ return False
1756
+
1757
+ def is_password_provider_mismatch(self) -> bool:
1758
+ return False
1759
+
1760
+ def is_verification_consume_stale(self) -> bool:
1761
+ return False
1762
+
1763
+ def is_verification_consume_missing(self) -> bool:
1764
+ return False
1765
+
1766
+ @dataclass(frozen=True, slots=True, kw_only=True)
1767
+ class ResetCredentialPasswordCredentialPasswordReset:
1768
+ outcome: Literal["CredentialPasswordReset"] = field(default="CredentialPasswordReset", init=False)
1769
+
1770
+ def is_password_account_stale(self) -> bool:
1771
+ return False
1772
+
1773
+ def is_password_account_missing(self) -> bool:
1774
+ return False
1775
+
1776
+ def is_credential_password_reset(self) -> bool:
1777
+ return True
1778
+
1779
+ def is_password_provider_mismatch(self) -> bool:
1780
+ return False
1781
+
1782
+ def is_verification_consume_stale(self) -> bool:
1783
+ return False
1784
+
1785
+ def is_verification_consume_missing(self) -> bool:
1786
+ return False
1787
+
1788
+ @dataclass(frozen=True, slots=True, kw_only=True)
1789
+ class ResetCredentialPasswordPasswordProviderMismatch:
1790
+ outcome: Literal["PasswordProviderMismatch"] = field(default="PasswordProviderMismatch", init=False)
1791
+
1792
+ def is_password_account_stale(self) -> bool:
1793
+ return False
1794
+
1795
+ def is_password_account_missing(self) -> bool:
1796
+ return False
1797
+
1798
+ def is_credential_password_reset(self) -> bool:
1799
+ return False
1800
+
1801
+ def is_password_provider_mismatch(self) -> bool:
1802
+ return True
1803
+
1804
+ def is_verification_consume_stale(self) -> bool:
1805
+ return False
1806
+
1807
+ def is_verification_consume_missing(self) -> bool:
1808
+ return False
1809
+
1810
+ @dataclass(frozen=True, slots=True, kw_only=True)
1811
+ class ResetCredentialPasswordVerificationConsumeStale:
1812
+ outcome: Literal["VerificationConsumeStale"] = field(default="VerificationConsumeStale", init=False)
1813
+
1814
+ def is_password_account_stale(self) -> bool:
1815
+ return False
1816
+
1817
+ def is_password_account_missing(self) -> bool:
1818
+ return False
1819
+
1820
+ def is_credential_password_reset(self) -> bool:
1821
+ return False
1822
+
1823
+ def is_password_provider_mismatch(self) -> bool:
1824
+ return False
1825
+
1826
+ def is_verification_consume_stale(self) -> bool:
1827
+ return True
1828
+
1829
+ def is_verification_consume_missing(self) -> bool:
1830
+ return False
1831
+
1832
+ @dataclass(frozen=True, slots=True, kw_only=True)
1833
+ class ResetCredentialPasswordVerificationConsumeMissing:
1834
+ outcome: Literal["VerificationConsumeMissing"] = field(default="VerificationConsumeMissing", init=False)
1835
+
1836
+ def is_password_account_stale(self) -> bool:
1837
+ return False
1838
+
1839
+ def is_password_account_missing(self) -> bool:
1840
+ return False
1841
+
1842
+ def is_credential_password_reset(self) -> bool:
1843
+ return False
1844
+
1845
+ def is_password_provider_mismatch(self) -> bool:
1846
+ return False
1847
+
1848
+ def is_verification_consume_stale(self) -> bool:
1849
+ return False
1850
+
1851
+ def is_verification_consume_missing(self) -> bool:
1852
+ return True
1853
+
1854
+ ResetCredentialPasswordOutcome: TypeAlias = ResetCredentialPasswordPasswordAccountStale | ResetCredentialPasswordPasswordAccountMissing | ResetCredentialPasswordCredentialPasswordReset | ResetCredentialPasswordPasswordProviderMismatch | ResetCredentialPasswordVerificationConsumeStale | ResetCredentialPasswordVerificationConsumeMissing
1855
+
1856
+ @dataclass(frozen=True, slots=True, kw_only=True)
1857
+ class UpdateAccountInput:
1858
+ scope: str | None
1859
+ user_id: UUID
1860
+ id_token: str | None
1861
+ password: str | None
1862
+ account_id: UUID
1863
+ request_id: UUID
1864
+ updated_at: Timestamp
1865
+ provider_id: str
1866
+ access_token: str | None
1867
+ refresh_token: str | None
1868
+ organization_id: UUID
1869
+ expected_revision: Annotated[int, "u64"]
1870
+ external_account_id: str
1871
+ access_token_expires_at: Timestamp | None
1872
+ refresh_token_expires_at: Timestamp | None
1873
+
1874
+ UPDATE_ACCOUNT_PLAN_HASH: Final[str] = "1556cd92effd135225904f0313f1cdf146ebe82f72621ebeccb2686c5442b849"
1875
+ @dataclass(frozen=True, slots=True, kw_only=True)
1876
+ class UpdateAccountAccountUpdated:
1877
+ outcome: Literal["AccountUpdated"] = field(default="AccountUpdated", init=False)
1878
+
1879
+ def is_account_updated(self) -> bool:
1880
+ return True
1881
+
1882
+ def is_account_update_stale(self) -> bool:
1883
+ return False
1884
+
1885
+ def is_account_update_missing(self) -> bool:
1886
+ return False
1887
+
1888
+ @dataclass(frozen=True, slots=True, kw_only=True)
1889
+ class UpdateAccountAccountUpdateStale:
1890
+ outcome: Literal["AccountUpdateStale"] = field(default="AccountUpdateStale", init=False)
1891
+
1892
+ def is_account_updated(self) -> bool:
1893
+ return False
1894
+
1895
+ def is_account_update_stale(self) -> bool:
1896
+ return True
1897
+
1898
+ def is_account_update_missing(self) -> bool:
1899
+ return False
1900
+
1901
+ @dataclass(frozen=True, slots=True, kw_only=True)
1902
+ class UpdateAccountAccountUpdateMissing:
1903
+ outcome: Literal["AccountUpdateMissing"] = field(default="AccountUpdateMissing", init=False)
1904
+
1905
+ def is_account_updated(self) -> bool:
1906
+ return False
1907
+
1908
+ def is_account_update_stale(self) -> bool:
1909
+ return False
1910
+
1911
+ def is_account_update_missing(self) -> bool:
1912
+ return True
1913
+
1914
+ UpdateAccountOutcome: TypeAlias = UpdateAccountAccountUpdated | UpdateAccountAccountUpdateStale | UpdateAccountAccountUpdateMissing
1915
+
1916
+ @dataclass(frozen=True, slots=True, kw_only=True)
1917
+ class UpdateAccountPasswordsInput:
1918
+ updates: tuple[AccountPasswordUpdate, ...]
1919
+ user_id: UUID
1920
+ request_id: UUID
1921
+ organization_id: UUID
1922
+
1923
+ UPDATE_ACCOUNT_PASSWORDS_PLAN_HASH: Final[str] = "5f18c741b5e9c09203c67b5985af9d034fad670462ecdda32a0a1f031ef288f6"
1924
+ @dataclass(frozen=True, slots=True, kw_only=True)
1925
+ class UpdateAccountPasswordsPasswordAccountStale:
1926
+ outcome: Literal["PasswordAccountStale"] = field(default="PasswordAccountStale", init=False)
1927
+
1928
+ def is_password_account_stale(self) -> bool:
1929
+ return True
1930
+
1931
+ def is_password_account_missing(self) -> bool:
1932
+ return False
1933
+
1934
+ def is_account_passwords_updated(self) -> bool:
1935
+ return False
1936
+
1937
+ def is_password_provider_mismatch(self) -> bool:
1938
+ return False
1939
+
1940
+ @dataclass(frozen=True, slots=True, kw_only=True)
1941
+ class UpdateAccountPasswordsPasswordAccountMissing:
1942
+ outcome: Literal["PasswordAccountMissing"] = field(default="PasswordAccountMissing", init=False)
1943
+
1944
+ def is_password_account_stale(self) -> bool:
1945
+ return False
1946
+
1947
+ def is_password_account_missing(self) -> bool:
1948
+ return True
1949
+
1950
+ def is_account_passwords_updated(self) -> bool:
1951
+ return False
1952
+
1953
+ def is_password_provider_mismatch(self) -> bool:
1954
+ return False
1955
+
1956
+ @dataclass(frozen=True, slots=True, kw_only=True)
1957
+ class UpdateAccountPasswordsAccountPasswordsUpdated:
1958
+ outcome: Literal["AccountPasswordsUpdated"] = field(default="AccountPasswordsUpdated", init=False)
1959
+
1960
+ def is_password_account_stale(self) -> bool:
1961
+ return False
1962
+
1963
+ def is_password_account_missing(self) -> bool:
1964
+ return False
1965
+
1966
+ def is_account_passwords_updated(self) -> bool:
1967
+ return True
1968
+
1969
+ def is_password_provider_mismatch(self) -> bool:
1970
+ return False
1971
+
1972
+ @dataclass(frozen=True, slots=True, kw_only=True)
1973
+ class UpdateAccountPasswordsPasswordProviderMismatch:
1974
+ outcome: Literal["PasswordProviderMismatch"] = field(default="PasswordProviderMismatch", init=False)
1975
+
1976
+ def is_password_account_stale(self) -> bool:
1977
+ return False
1978
+
1979
+ def is_password_account_missing(self) -> bool:
1980
+ return False
1981
+
1982
+ def is_account_passwords_updated(self) -> bool:
1983
+ return False
1984
+
1985
+ def is_password_provider_mismatch(self) -> bool:
1986
+ return True
1987
+
1988
+ UpdateAccountPasswordsOutcome: TypeAlias = UpdateAccountPasswordsPasswordAccountStale | UpdateAccountPasswordsPasswordAccountMissing | UpdateAccountPasswordsAccountPasswordsUpdated | UpdateAccountPasswordsPasswordProviderMismatch
1989
+
1990
+ @dataclass(frozen=True, slots=True, kw_only=True)
1991
+ class UpdateCredentialPasswordInput:
1992
+ user_id: UUID
1993
+ password: str
1994
+ account_id: UUID
1995
+ request_id: UUID
1996
+ updated_at: Timestamp
1997
+ organization_id: UUID
1998
+ expected_revision: Annotated[int, "u64"]
1999
+ external_account_id: str
2000
+
2001
+ UPDATE_CREDENTIAL_PASSWORD_PLAN_HASH: Final[str] = "08781a68739c705ab6ffe51a0de547605e1a7dd2fd2b8075445d40db923d1f15"
2002
+ @dataclass(frozen=True, slots=True, kw_only=True)
2003
+ class UpdateCredentialPasswordPasswordAccountStale:
2004
+ outcome: Literal["PasswordAccountStale"] = field(default="PasswordAccountStale", init=False)
2005
+
2006
+ def is_password_account_stale(self) -> bool:
2007
+ return True
2008
+
2009
+ def is_password_account_missing(self) -> bool:
2010
+ return False
2011
+
2012
+ def is_password_provider_mismatch(self) -> bool:
2013
+ return False
2014
+
2015
+ def is_credential_password_updated(self) -> bool:
2016
+ return False
2017
+
2018
+ @dataclass(frozen=True, slots=True, kw_only=True)
2019
+ class UpdateCredentialPasswordPasswordAccountMissing:
2020
+ outcome: Literal["PasswordAccountMissing"] = field(default="PasswordAccountMissing", init=False)
2021
+
2022
+ def is_password_account_stale(self) -> bool:
2023
+ return False
2024
+
2025
+ def is_password_account_missing(self) -> bool:
2026
+ return True
2027
+
2028
+ def is_password_provider_mismatch(self) -> bool:
2029
+ return False
2030
+
2031
+ def is_credential_password_updated(self) -> bool:
2032
+ return False
2033
+
2034
+ @dataclass(frozen=True, slots=True, kw_only=True)
2035
+ class UpdateCredentialPasswordPasswordProviderMismatch:
2036
+ outcome: Literal["PasswordProviderMismatch"] = field(default="PasswordProviderMismatch", init=False)
2037
+
2038
+ def is_password_account_stale(self) -> bool:
2039
+ return False
2040
+
2041
+ def is_password_account_missing(self) -> bool:
2042
+ return False
2043
+
2044
+ def is_password_provider_mismatch(self) -> bool:
2045
+ return True
2046
+
2047
+ def is_credential_password_updated(self) -> bool:
2048
+ return False
2049
+
2050
+ @dataclass(frozen=True, slots=True, kw_only=True)
2051
+ class UpdateCredentialPasswordCredentialPasswordUpdated:
2052
+ outcome: Literal["CredentialPasswordUpdated"] = field(default="CredentialPasswordUpdated", init=False)
2053
+
2054
+ def is_password_account_stale(self) -> bool:
2055
+ return False
2056
+
2057
+ def is_password_account_missing(self) -> bool:
2058
+ return False
2059
+
2060
+ def is_password_provider_mismatch(self) -> bool:
2061
+ return False
2062
+
2063
+ def is_credential_password_updated(self) -> bool:
2064
+ return True
2065
+
2066
+ UpdateCredentialPasswordOutcome: TypeAlias = UpdateCredentialPasswordPasswordAccountStale | UpdateCredentialPasswordPasswordAccountMissing | UpdateCredentialPasswordPasswordProviderMismatch | UpdateCredentialPasswordCredentialPasswordUpdated
2067
+
2068
+ @dataclass(frozen=True, slots=True, kw_only=True)
2069
+ class UpdateSessionInput:
2070
+ user_id: UUID
2071
+ expires_at: Timestamp
2072
+ ip_address: str | None
2073
+ request_id: UUID
2074
+ session_id: UUID
2075
+ updated_at: Timestamp
2076
+ user_agent: str | None
2077
+ organization_id: UUID
2078
+ expected_revision: Annotated[int, "u64"]
2079
+
2080
+ UPDATE_SESSION_PLAN_HASH: Final[str] = "4c1184c5c0a1f8b8935a8b96204ad839afe84e1752f2ba24cdf63feef4f7ce3a"
2081
+ @dataclass(frozen=True, slots=True, kw_only=True)
2082
+ class UpdateSessionSessionUpdated:
2083
+ outcome: Literal["SessionUpdated"] = field(default="SessionUpdated", init=False)
2084
+
2085
+ def is_session_updated(self) -> bool:
2086
+ return True
2087
+
2088
+ def is_session_update_stale(self) -> bool:
2089
+ return False
2090
+
2091
+ def is_session_update_missing(self) -> bool:
2092
+ return False
2093
+
2094
+ @dataclass(frozen=True, slots=True, kw_only=True)
2095
+ class UpdateSessionSessionUpdateStale:
2096
+ outcome: Literal["SessionUpdateStale"] = field(default="SessionUpdateStale", init=False)
2097
+
2098
+ def is_session_updated(self) -> bool:
2099
+ return False
2100
+
2101
+ def is_session_update_stale(self) -> bool:
2102
+ return True
2103
+
2104
+ def is_session_update_missing(self) -> bool:
2105
+ return False
2106
+
2107
+ @dataclass(frozen=True, slots=True, kw_only=True)
2108
+ class UpdateSessionSessionUpdateMissing:
2109
+ outcome: Literal["SessionUpdateMissing"] = field(default="SessionUpdateMissing", init=False)
2110
+
2111
+ def is_session_updated(self) -> bool:
2112
+ return False
2113
+
2114
+ def is_session_update_stale(self) -> bool:
2115
+ return False
2116
+
2117
+ def is_session_update_missing(self) -> bool:
2118
+ return True
2119
+
2120
+ UpdateSessionOutcome: TypeAlias = UpdateSessionSessionUpdated | UpdateSessionSessionUpdateStale | UpdateSessionSessionUpdateMissing
2121
+
2122
+ @dataclass(frozen=True, slots=True, kw_only=True)
2123
+ class UpdateUserInput:
2124
+ name: str
2125
+ email: str
2126
+ image: str | None
2127
+ user_id: UUID
2128
+ request_id: UUID
2129
+ updated_at: Timestamp
2130
+ email_verified: bool
2131
+ organization_id: UUID
2132
+ expected_revision: Annotated[int, "u64"]
2133
+
2134
+ UPDATE_USER_PLAN_HASH: Final[str] = "cd0d3c8108976d4b2413f41fd68791b3e9276a763787f40b82bef17219091194"
2135
+ @dataclass(frozen=True, slots=True, kw_only=True)
2136
+ class UpdateUserUserUpdated:
2137
+ outcome: Literal["UserUpdated"] = field(default="UserUpdated", init=False)
2138
+
2139
+ def is_user_updated(self) -> bool:
2140
+ return True
2141
+
2142
+ def is_user_update_stale(self) -> bool:
2143
+ return False
2144
+
2145
+ def is_user_update_missing(self) -> bool:
2146
+ return False
2147
+
2148
+ @dataclass(frozen=True, slots=True, kw_only=True)
2149
+ class UpdateUserUserUpdateStale:
2150
+ outcome: Literal["UserUpdateStale"] = field(default="UserUpdateStale", init=False)
2151
+
2152
+ def is_user_updated(self) -> bool:
2153
+ return False
2154
+
2155
+ def is_user_update_stale(self) -> bool:
2156
+ return True
2157
+
2158
+ def is_user_update_missing(self) -> bool:
2159
+ return False
2160
+
2161
+ @dataclass(frozen=True, slots=True, kw_only=True)
2162
+ class UpdateUserUserUpdateMissing:
2163
+ outcome: Literal["UserUpdateMissing"] = field(default="UserUpdateMissing", init=False)
2164
+
2165
+ def is_user_updated(self) -> bool:
2166
+ return False
2167
+
2168
+ def is_user_update_stale(self) -> bool:
2169
+ return False
2170
+
2171
+ def is_user_update_missing(self) -> bool:
2172
+ return True
2173
+
2174
+ UpdateUserOutcome: TypeAlias = UpdateUserUserUpdated | UpdateUserUserUpdateStale | UpdateUserUserUpdateMissing
2175
+
2176
+ @dataclass(frozen=True, slots=True, kw_only=True)
2177
+ class UpdateVerificationInput:
2178
+ value: str
2179
+ expires_at: Timestamp
2180
+ request_id: UUID
2181
+ updated_at: Timestamp
2182
+ organization_id: UUID
2183
+ verification_id: UUID
2184
+ expected_revision: Annotated[int, "u64"]
2185
+
2186
+ UPDATE_VERIFICATION_PLAN_HASH: Final[str] = "b9ea963db584e7fd9dbce1069d982dc0f53ebb06b72b41b060578b284596018f"
2187
+ @dataclass(frozen=True, slots=True, kw_only=True)
2188
+ class UpdateVerificationVerificationUpdated:
2189
+ outcome: Literal["VerificationUpdated"] = field(default="VerificationUpdated", init=False)
2190
+
2191
+ def is_verification_updated(self) -> bool:
2192
+ return True
2193
+
2194
+ def is_verification_update_stale(self) -> bool:
2195
+ return False
2196
+
2197
+ def is_verification_update_missing(self) -> bool:
2198
+ return False
2199
+
2200
+ @dataclass(frozen=True, slots=True, kw_only=True)
2201
+ class UpdateVerificationVerificationUpdateStale:
2202
+ outcome: Literal["VerificationUpdateStale"] = field(default="VerificationUpdateStale", init=False)
2203
+
2204
+ def is_verification_updated(self) -> bool:
2205
+ return False
2206
+
2207
+ def is_verification_update_stale(self) -> bool:
2208
+ return True
2209
+
2210
+ def is_verification_update_missing(self) -> bool:
2211
+ return False
2212
+
2213
+ @dataclass(frozen=True, slots=True, kw_only=True)
2214
+ class UpdateVerificationVerificationUpdateMissing:
2215
+ outcome: Literal["VerificationUpdateMissing"] = field(default="VerificationUpdateMissing", init=False)
2216
+
2217
+ def is_verification_updated(self) -> bool:
2218
+ return False
2219
+
2220
+ def is_verification_update_stale(self) -> bool:
2221
+ return False
2222
+
2223
+ def is_verification_update_missing(self) -> bool:
2224
+ return True
2225
+
2226
+ UpdateVerificationOutcome: TypeAlias = UpdateVerificationVerificationUpdated | UpdateVerificationVerificationUpdateStale | UpdateVerificationVerificationUpdateMissing
2227
+
2228
+ class RiffDBBetterAuthCoreClient:
2229
+ def __init__(self, transport: SyncApplicationTransport, command_attempts: AttemptBudget = AttemptBudget(3), *, read_after_commit: int | None = None, track_causal_writes: bool = True) -> None:
2230
+ self._transport = transport
2231
+ self._command_attempts = command_attempts
2232
+ self._read_after_commit = read_after_commit
2233
+ self._track_causal_writes = track_causal_writes
2234
+
2235
+ @classmethod
2236
+ def from_transport(cls, transport: SyncApplicationTransport, command_attempts: AttemptBudget = AttemptBudget(3)) -> RiffDBBetterAuthCoreClient:
2237
+ return cls(transport, command_attempts)
2238
+
2239
+ def with_read_after_commit(self, commit_sequence: int | None) -> RiffDBBetterAuthCoreClient:
2240
+ return RiffDBBetterAuthCoreClient(self._transport, self._command_attempts, read_after_commit=commit_sequence, track_causal_writes=self._track_causal_writes)
2241
+
2242
+ def causal_session(self, initial_commit_sequence: int | None = None) -> RiffDBBetterAuthCoreClient:
2243
+ 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)
2244
+
2245
+ @property
2246
+ def last_commit_sequence(self) -> int | None:
2247
+ return self._read_after_commit
2248
+
2249
+ def admin_users_all_email_asc(self, parameters: AdminUsersAllEmailAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersAllEmailAscResult]:
2250
+ 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):
2251
+ raise ValueError("limit must be an integer from 1 through 100")
2252
+ if options.read_after_commit is None and self._read_after_commit is not None:
2253
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2254
+ raw = self._transport._execute_named_query(
2255
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2256
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2257
+ query_name="AdminUsersAllEmailAsc", plan_hash=ADMIN_USERS_ALL_EMAIL_ASC_QUERY_PLAN_HASH,
2258
+ parameters=encode_record(parameters), options=options,
2259
+ )
2260
+ outcomes = {
2261
+ "Found": AdminUsersAllEmailAscFound,
2262
+ }
2263
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2264
+
2265
+ def admin_users_all_email_asc_after_commit(self, parameters: AdminUsersAllEmailAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersAllEmailAscResult]:
2266
+ return self.admin_users_all_email_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2267
+
2268
+ def admin_users_contains_asc(self, parameters: AdminUsersContainsAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsAscResult]:
2269
+ 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):
2270
+ raise ValueError("limit must be an integer from 1 through 100")
2271
+ if options.read_after_commit is None and self._read_after_commit is not None:
2272
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2273
+ raw = self._transport._execute_named_query(
2274
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2275
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2276
+ query_name="AdminUsersContainsAsc", plan_hash=ADMIN_USERS_CONTAINS_ASC_QUERY_PLAN_HASH,
2277
+ parameters=encode_record(parameters), options=options,
2278
+ )
2279
+ outcomes = {
2280
+ "Found": AdminUsersContainsAscFound,
2281
+ }
2282
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2283
+
2284
+ def admin_users_contains_asc_after_commit(self, parameters: AdminUsersContainsAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsAscResult]:
2285
+ return self.admin_users_contains_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2286
+
2287
+ def admin_users_contains_desc(self, parameters: AdminUsersContainsDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsDescResult]:
2288
+ 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):
2289
+ raise ValueError("limit must be an integer from 1 through 100")
2290
+ if options.read_after_commit is None and self._read_after_commit is not None:
2291
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2292
+ raw = self._transport._execute_named_query(
2293
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2294
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2295
+ query_name="AdminUsersContainsDesc", plan_hash=ADMIN_USERS_CONTAINS_DESC_QUERY_PLAN_HASH,
2296
+ parameters=encode_record(parameters), options=options,
2297
+ )
2298
+ outcomes = {
2299
+ "Found": AdminUsersContainsDescFound,
2300
+ }
2301
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2302
+
2303
+ def admin_users_contains_desc_after_commit(self, parameters: AdminUsersContainsDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsDescResult]:
2304
+ return self.admin_users_contains_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2305
+
2306
+ def admin_users_email_contains_created_desc(self, parameters: AdminUsersEmailContainsCreatedDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsCreatedDescResult]:
2307
+ 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):
2308
+ raise ValueError("limit must be an integer from 1 through 100")
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="AdminUsersEmailContainsCreatedDesc", plan_hash=ADMIN_USERS_EMAIL_CONTAINS_CREATED_DESC_QUERY_PLAN_HASH,
2315
+ parameters=encode_record(parameters), options=options,
2316
+ )
2317
+ outcomes = {
2318
+ "Found": AdminUsersEmailContainsCreatedDescFound,
2319
+ }
2320
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2321
+
2322
+ def admin_users_email_contains_created_desc_after_commit(self, parameters: AdminUsersEmailContainsCreatedDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsCreatedDescResult]:
2323
+ return self.admin_users_email_contains_created_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2324
+
2325
+ def admin_users_email_contains_image_asc(self, parameters: AdminUsersEmailContainsImageAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsImageAscResult]:
2326
+ 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):
2327
+ raise ValueError("limit must be an integer from 1 through 100")
2328
+ if options.read_after_commit is None and self._read_after_commit is not None:
2329
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2330
+ raw = self._transport._execute_named_query(
2331
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2332
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2333
+ query_name="AdminUsersEmailContainsImageAsc", plan_hash=ADMIN_USERS_EMAIL_CONTAINS_IMAGE_ASC_QUERY_PLAN_HASH,
2334
+ parameters=encode_record(parameters), options=options,
2335
+ )
2336
+ outcomes = {
2337
+ "Found": AdminUsersEmailContainsImageAscFound,
2338
+ }
2339
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2340
+
2341
+ def admin_users_email_contains_image_asc_after_commit(self, parameters: AdminUsersEmailContainsImageAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsImageAscResult]:
2342
+ return self.admin_users_email_contains_image_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2343
+
2344
+ def admin_users_ends_with_asc(self, parameters: AdminUsersEndsWithAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithAscResult]:
2345
+ 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):
2346
+ raise ValueError("limit must be an integer from 1 through 100")
2347
+ if options.read_after_commit is None and self._read_after_commit is not None:
2348
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2349
+ raw = self._transport._execute_named_query(
2350
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2351
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2352
+ query_name="AdminUsersEndsWithAsc", plan_hash=ADMIN_USERS_ENDS_WITH_ASC_QUERY_PLAN_HASH,
2353
+ parameters=encode_record(parameters), options=options,
2354
+ )
2355
+ outcomes = {
2356
+ "Found": AdminUsersEndsWithAscFound,
2357
+ }
2358
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2359
+
2360
+ def admin_users_ends_with_asc_after_commit(self, parameters: AdminUsersEndsWithAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithAscResult]:
2361
+ return self.admin_users_ends_with_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2362
+
2363
+ def admin_users_ends_with_desc(self, parameters: AdminUsersEndsWithDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithDescResult]:
2364
+ 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):
2365
+ raise ValueError("limit must be an integer from 1 through 100")
2366
+ if options.read_after_commit is None and self._read_after_commit is not None:
2367
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2368
+ raw = self._transport._execute_named_query(
2369
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2370
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2371
+ query_name="AdminUsersEndsWithDesc", plan_hash=ADMIN_USERS_ENDS_WITH_DESC_QUERY_PLAN_HASH,
2372
+ parameters=encode_record(parameters), options=options,
2373
+ )
2374
+ outcomes = {
2375
+ "Found": AdminUsersEndsWithDescFound,
2376
+ }
2377
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2378
+
2379
+ def admin_users_ends_with_desc_after_commit(self, parameters: AdminUsersEndsWithDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithDescResult]:
2380
+ return self.admin_users_ends_with_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2381
+
2382
+ def admin_users_starts_with_asc(self, parameters: AdminUsersStartsWithAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithAscResult]:
2383
+ 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):
2384
+ raise ValueError("limit must be an integer from 1 through 100")
2385
+ if options.read_after_commit is None and self._read_after_commit is not None:
2386
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2387
+ raw = self._transport._execute_named_query(
2388
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2389
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2390
+ query_name="AdminUsersStartsWithAsc", plan_hash=ADMIN_USERS_STARTS_WITH_ASC_QUERY_PLAN_HASH,
2391
+ parameters=encode_record(parameters), options=options,
2392
+ )
2393
+ outcomes = {
2394
+ "Found": AdminUsersStartsWithAscFound,
2395
+ }
2396
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2397
+
2398
+ def admin_users_starts_with_asc_after_commit(self, parameters: AdminUsersStartsWithAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithAscResult]:
2399
+ return self.admin_users_starts_with_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2400
+
2401
+ def admin_users_starts_with_desc(self, parameters: AdminUsersStartsWithDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithDescResult]:
2402
+ 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):
2403
+ raise ValueError("limit must be an integer from 1 through 100")
2404
+ if options.read_after_commit is None and self._read_after_commit is not None:
2405
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2406
+ raw = self._transport._execute_named_query(
2407
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2408
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2409
+ query_name="AdminUsersStartsWithDesc", plan_hash=ADMIN_USERS_STARTS_WITH_DESC_QUERY_PLAN_HASH,
2410
+ parameters=encode_record(parameters), options=options,
2411
+ )
2412
+ outcomes = {
2413
+ "Found": AdminUsersStartsWithDescFound,
2414
+ }
2415
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2416
+
2417
+ def admin_users_starts_with_desc_after_commit(self, parameters: AdminUsersStartsWithDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithDescResult]:
2418
+ return self.admin_users_starts_with_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2419
+
2420
+ def find_account_by_id(self, parameters: FindAccountByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByIdResult]:
2421
+ if options.read_after_commit is None and self._read_after_commit is not None:
2422
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2423
+ raw = self._transport._execute_named_query(
2424
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2425
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2426
+ query_name="FindAccountById", plan_hash=FIND_ACCOUNT_BY_ID_QUERY_PLAN_HASH,
2427
+ parameters=encode_record(parameters), options=options,
2428
+ )
2429
+ outcomes = {
2430
+ "Found": FindAccountByIdFound,
2431
+ }
2432
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2433
+
2434
+ def find_account_by_id_after_commit(self, parameters: FindAccountByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByIdResult]:
2435
+ return self.find_account_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2436
+
2437
+ def find_account_by_provider(self, parameters: FindAccountByProviderParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByProviderResult]:
2438
+ if options.read_after_commit is None and self._read_after_commit is not None:
2439
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2440
+ raw = self._transport._execute_named_query(
2441
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2442
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2443
+ query_name="FindAccountByProvider", plan_hash=FIND_ACCOUNT_BY_PROVIDER_QUERY_PLAN_HASH,
2444
+ parameters=encode_record(parameters), options=options,
2445
+ )
2446
+ outcomes = {
2447
+ "Found": FindAccountByProviderFound,
2448
+ }
2449
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2450
+
2451
+ def find_account_by_provider_after_commit(self, parameters: FindAccountByProviderParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByProviderResult]:
2452
+ return self.find_account_by_provider(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2453
+
2454
+ def find_accounts_by_user_id(self, parameters: FindAccountsByUserIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserIdResult]:
2455
+ encoded_parameters = encode_record(parameters)
2456
+ generated_cursor = parameters.after
2457
+ if generated_cursor is not None:
2458
+ if options.cursor is not None:
2459
+ raise ValueError("generated cursor conflicts with query options")
2460
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
2461
+ encoded_parameters.pop("after", None)
2462
+ if options.read_after_commit is None and self._read_after_commit is not None:
2463
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2464
+ raw = self._transport._execute_named_query(
2465
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2466
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2467
+ query_name="FindAccountsByUserId", plan_hash=FIND_ACCOUNTS_BY_USER_ID_QUERY_PLAN_HASH,
2468
+ parameters=encoded_parameters, options=options,
2469
+ )
2470
+ outcomes = {
2471
+ "Found": FindAccountsByUserIdFound,
2472
+ }
2473
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2474
+
2475
+ def find_accounts_by_user_id_after_commit(self, parameters: FindAccountsByUserIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserIdResult]:
2476
+ return self.find_accounts_by_user_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2477
+
2478
+ def find_accounts_by_user_id_pages(self, parameters: FindAccountsByUserIdParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindAccountsByUserIdResult]]:
2479
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
2480
+ raise ValueError("max_pages must be an integer from 1 through 1024")
2481
+ if parameters.after is not None and options.cursor is not None:
2482
+ raise ValueError("generated cursor conflicts with query options")
2483
+ cursor = options.cursor if options.cursor is not None else parameters.after
2484
+ pages: list[TypedQueryResult[FindAccountsByUserIdResult]] = []
2485
+ for _ in range(max_pages):
2486
+ page_parameters = FindAccountsByUserIdParams(organization_id=parameters.organization_id, user_id=parameters.user_id, after=None)
2487
+ page = self.find_accounts_by_user_id(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
2488
+ pages.append(page)
2489
+ if not page.next_cursor:
2490
+ break
2491
+ cursor = page.next_cursor
2492
+ return pages
2493
+
2494
+ def find_accounts_by_user_provider(self, parameters: FindAccountsByUserProviderParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserProviderResult]:
2495
+ encoded_parameters = encode_record(parameters)
2496
+ generated_cursor = parameters.after
2497
+ if generated_cursor is not None:
2498
+ if options.cursor is not None:
2499
+ raise ValueError("generated cursor conflicts with query options")
2500
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
2501
+ encoded_parameters.pop("after", None)
2502
+ if options.read_after_commit is None and self._read_after_commit is not None:
2503
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2504
+ raw = self._transport._execute_named_query(
2505
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2506
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2507
+ query_name="FindAccountsByUserProvider", plan_hash=FIND_ACCOUNTS_BY_USER_PROVIDER_QUERY_PLAN_HASH,
2508
+ parameters=encoded_parameters, options=options,
2509
+ )
2510
+ outcomes = {
2511
+ "Found": FindAccountsByUserProviderFound,
2512
+ }
2513
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2514
+
2515
+ def find_accounts_by_user_provider_after_commit(self, parameters: FindAccountsByUserProviderParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserProviderResult]:
2516
+ return self.find_accounts_by_user_provider(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2517
+
2518
+ def find_accounts_by_user_provider_pages(self, parameters: FindAccountsByUserProviderParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindAccountsByUserProviderResult]]:
2519
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
2520
+ raise ValueError("max_pages must be an integer from 1 through 1024")
2521
+ if parameters.after is not None and options.cursor is not None:
2522
+ raise ValueError("generated cursor conflicts with query options")
2523
+ cursor = options.cursor if options.cursor is not None else parameters.after
2524
+ pages: list[TypedQueryResult[FindAccountsByUserProviderResult]] = []
2525
+ for _ in range(max_pages):
2526
+ page_parameters = FindAccountsByUserProviderParams(organization_id=parameters.organization_id, user_id=parameters.user_id, provider_id=parameters.provider_id, after=None)
2527
+ page = self.find_accounts_by_user_provider(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
2528
+ pages.append(page)
2529
+ if not page.next_cursor:
2530
+ break
2531
+ cursor = page.next_cursor
2532
+ return pages
2533
+
2534
+ def find_active_sessions_by_user_id(self, parameters: FindActiveSessionsByUserIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindActiveSessionsByUserIdResult]:
2535
+ encoded_parameters = encode_record(parameters)
2536
+ generated_cursor = parameters.after
2537
+ if generated_cursor is not None:
2538
+ if options.cursor is not None:
2539
+ raise ValueError("generated cursor conflicts with query options")
2540
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
2541
+ encoded_parameters.pop("after", None)
2542
+ if options.read_after_commit is None and self._read_after_commit is not None:
2543
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2544
+ raw = self._transport._execute_named_query(
2545
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2546
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2547
+ query_name="FindActiveSessionsByUserId", plan_hash=FIND_ACTIVE_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH,
2548
+ parameters=encoded_parameters, options=options,
2549
+ )
2550
+ outcomes = {
2551
+ "Found": FindActiveSessionsByUserIdFound,
2552
+ }
2553
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2554
+
2555
+ def find_active_sessions_by_user_id_after_commit(self, parameters: FindActiveSessionsByUserIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindActiveSessionsByUserIdResult]:
2556
+ return self.find_active_sessions_by_user_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2557
+
2558
+ def find_active_sessions_by_user_id_pages(self, parameters: FindActiveSessionsByUserIdParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindActiveSessionsByUserIdResult]]:
2559
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
2560
+ raise ValueError("max_pages must be an integer from 1 through 1024")
2561
+ if parameters.after is not None and options.cursor is not None:
2562
+ raise ValueError("generated cursor conflicts with query options")
2563
+ cursor = options.cursor if options.cursor is not None else parameters.after
2564
+ pages: list[TypedQueryResult[FindActiveSessionsByUserIdResult]] = []
2565
+ for _ in range(max_pages):
2566
+ page_parameters = FindActiveSessionsByUserIdParams(organization_id=parameters.organization_id, user_id=parameters.user_id, expires_after=parameters.expires_after, after=None)
2567
+ page = self.find_active_sessions_by_user_id(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
2568
+ pages.append(page)
2569
+ if not page.next_cursor:
2570
+ break
2571
+ cursor = page.next_cursor
2572
+ return pages
2573
+
2574
+ def find_credential_account(self, parameters: FindCredentialAccountParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindCredentialAccountResult]:
2575
+ if options.read_after_commit is None and self._read_after_commit is not None:
2576
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2577
+ raw = self._transport._execute_named_query(
2578
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2579
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2580
+ query_name="FindCredentialAccount", plan_hash=FIND_CREDENTIAL_ACCOUNT_QUERY_PLAN_HASH,
2581
+ parameters=encode_record(parameters), options=options,
2582
+ )
2583
+ outcomes = {
2584
+ "Found": FindCredentialAccountFound,
2585
+ }
2586
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2587
+
2588
+ def find_credential_account_after_commit(self, parameters: FindCredentialAccountParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindCredentialAccountResult]:
2589
+ return self.find_credential_account(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2590
+
2591
+ def find_expired_verification_ids(self, parameters: FindExpiredVerificationIdsParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindExpiredVerificationIdsResult]:
2592
+ encoded_parameters = encode_record(parameters)
2593
+ generated_cursor = parameters.after
2594
+ if generated_cursor is not None:
2595
+ if options.cursor is not None:
2596
+ raise ValueError("generated cursor conflicts with query options")
2597
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
2598
+ encoded_parameters.pop("after", None)
2599
+ if options.read_after_commit is None and self._read_after_commit is not None:
2600
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2601
+ raw = self._transport._execute_named_query(
2602
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2603
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2604
+ query_name="FindExpiredVerificationIds", plan_hash=FIND_EXPIRED_VERIFICATION_IDS_QUERY_PLAN_HASH,
2605
+ parameters=encoded_parameters, options=options,
2606
+ )
2607
+ outcomes = {
2608
+ "Found": FindExpiredVerificationIdsFound,
2609
+ }
2610
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2611
+
2612
+ def find_expired_verification_ids_after_commit(self, parameters: FindExpiredVerificationIdsParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindExpiredVerificationIdsResult]:
2613
+ return self.find_expired_verification_ids(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2614
+
2615
+ def find_expired_verification_ids_pages(self, parameters: FindExpiredVerificationIdsParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindExpiredVerificationIdsResult]]:
2616
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
2617
+ raise ValueError("max_pages must be an integer from 1 through 1024")
2618
+ if parameters.after is not None and options.cursor is not None:
2619
+ raise ValueError("generated cursor conflicts with query options")
2620
+ cursor = options.cursor if options.cursor is not None else parameters.after
2621
+ pages: list[TypedQueryResult[FindExpiredVerificationIdsResult]] = []
2622
+ for _ in range(max_pages):
2623
+ page_parameters = FindExpiredVerificationIdsParams(organization_id=parameters.organization_id, expires_before=parameters.expires_before, after=None)
2624
+ page = self.find_expired_verification_ids(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
2625
+ pages.append(page)
2626
+ if not page.next_cursor:
2627
+ break
2628
+ cursor = page.next_cursor
2629
+ return pages
2630
+
2631
+ def find_latest_verification(self, parameters: FindLatestVerificationParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindLatestVerificationResult]:
2632
+ if options.read_after_commit is None and self._read_after_commit is not None:
2633
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2634
+ raw = self._transport._execute_named_query(
2635
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2636
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2637
+ query_name="FindLatestVerification", plan_hash=FIND_LATEST_VERIFICATION_QUERY_PLAN_HASH,
2638
+ parameters=encode_record(parameters), options=options,
2639
+ )
2640
+ outcomes = {
2641
+ "Found": FindLatestVerificationFound,
2642
+ }
2643
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2644
+
2645
+ def find_latest_verification_after_commit(self, parameters: FindLatestVerificationParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindLatestVerificationResult]:
2646
+ return self.find_latest_verification(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2647
+
2648
+ def find_session_by_id(self, parameters: FindSessionByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByIdResult]:
2649
+ if options.read_after_commit is None and self._read_after_commit is not None:
2650
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2651
+ raw = self._transport._execute_named_query(
2652
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2653
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2654
+ query_name="FindSessionById", plan_hash=FIND_SESSION_BY_ID_QUERY_PLAN_HASH,
2655
+ parameters=encode_record(parameters), options=options,
2656
+ )
2657
+ outcomes = {
2658
+ "Found": FindSessionByIdFound,
2659
+ }
2660
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2661
+
2662
+ def find_session_by_id_after_commit(self, parameters: FindSessionByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByIdResult]:
2663
+ return self.find_session_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2664
+
2665
+ def find_session_by_token(self, parameters: FindSessionByTokenParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByTokenResult]:
2666
+ if options.read_after_commit is None and self._read_after_commit is not None:
2667
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2668
+ raw = self._transport._execute_named_query(
2669
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2670
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2671
+ query_name="FindSessionByToken", plan_hash=FIND_SESSION_BY_TOKEN_QUERY_PLAN_HASH,
2672
+ parameters=encode_record(parameters), options=options,
2673
+ )
2674
+ outcomes = {
2675
+ "Found": FindSessionByTokenFound,
2676
+ }
2677
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2678
+
2679
+ def find_session_by_token_after_commit(self, parameters: FindSessionByTokenParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByTokenResult]:
2680
+ return self.find_session_by_token(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2681
+
2682
+ def find_sessions_by_token_set(self, parameters: FindSessionsByTokenSetParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByTokenSetResult]:
2683
+ if options.read_after_commit is None and self._read_after_commit is not None:
2684
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2685
+ raw = self._transport._execute_named_query(
2686
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2687
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2688
+ query_name="FindSessionsByTokenSet", plan_hash=FIND_SESSIONS_BY_TOKEN_SET_QUERY_PLAN_HASH,
2689
+ parameters=encode_record(parameters), options=options,
2690
+ )
2691
+ outcomes = {
2692
+ "Found": FindSessionsByTokenSetFound,
2693
+ }
2694
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2695
+
2696
+ def find_sessions_by_token_set_after_commit(self, parameters: FindSessionsByTokenSetParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByTokenSetResult]:
2697
+ return self.find_sessions_by_token_set(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2698
+
2699
+ def find_sessions_by_token_set_all(self, parameters: FindSessionsByTokenSetParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByTokenSetFound]:
2700
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
2701
+ raise ValueError("max_pages must be an integer from 1 through 1024")
2702
+ if options.cursor is not None:
2703
+ raise ValueError("find_sessions_by_token_set_all does not accept an initial cursor")
2704
+ items = tuple(dict.fromkeys(parameters.tokens))
2705
+ if not items:
2706
+ raise ValueError("tokens must contain at least 1 item")
2707
+ pinned_head = options.read_after_commit if options.read_after_commit is not None else self._read_after_commit
2708
+ highest_head = 0
2709
+ merged: list[FindSessionsByTokenSetFoundSessions] = []
2710
+ latest_page: TypedQueryResult[FindSessionsByTokenSetResult] | None = None
2711
+ pages_remaining = max_pages
2712
+ for offset in range(0, len(items), FIND_SESSIONS_BY_TOKEN_SET_TOKENS_MAX_ITEMS):
2713
+ chunk = items[offset:offset + FIND_SESSIONS_BY_TOKEN_SET_TOKENS_MAX_ITEMS]
2714
+ chunk_cursor: str | None = None
2715
+ while True:
2716
+ if pages_remaining < 1:
2717
+ raise ValueError("find_sessions_by_token_set_all exceeded max_pages (1..=1024)")
2718
+ pages_remaining -= 1
2719
+ chunk_parameters = FindSessionsByTokenSetParams(organization_id=parameters.organization_id, tokens=chunk)
2720
+ page = self.find_sessions_by_token_set(chunk_parameters, QueryOptions(cursor=chunk_cursor, read_after_commit=pinned_head, consistency=options.consistency))
2721
+ found = page.value.unwrap_found()
2722
+ merged.extend(found.sessions)
2723
+ latest_page = page
2724
+ if page.application_head > highest_head:
2725
+ highest_head = page.application_head
2726
+ if pinned_head is None or page.application_head > pinned_head:
2727
+ pinned_head = page.application_head
2728
+ if not page.next_cursor:
2729
+ break
2730
+ chunk_cursor = page.next_cursor
2731
+ assert latest_page is not None
2732
+ return TypedQueryResult(identity=latest_page.identity, value=FindSessionsByTokenSetFound(sessions=tuple(merged)), application_head=highest_head, next_cursor=None)
2733
+
2734
+ def find_sessions_by_user_id(self, parameters: FindSessionsByUserIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByUserIdResult]:
2735
+ encoded_parameters = encode_record(parameters)
2736
+ generated_cursor = parameters.after
2737
+ if generated_cursor is not None:
2738
+ if options.cursor is not None:
2739
+ raise ValueError("generated cursor conflicts with query options")
2740
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
2741
+ encoded_parameters.pop("after", None)
2742
+ if options.read_after_commit is None and self._read_after_commit is not None:
2743
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2744
+ raw = self._transport._execute_named_query(
2745
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2746
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2747
+ query_name="FindSessionsByUserId", plan_hash=FIND_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH,
2748
+ parameters=encoded_parameters, options=options,
2749
+ )
2750
+ outcomes = {
2751
+ "Found": FindSessionsByUserIdFound,
2752
+ }
2753
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2754
+
2755
+ def find_sessions_by_user_id_after_commit(self, parameters: FindSessionsByUserIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByUserIdResult]:
2756
+ return self.find_sessions_by_user_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2757
+
2758
+ def find_sessions_by_user_id_pages(self, parameters: FindSessionsByUserIdParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindSessionsByUserIdResult]]:
2759
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
2760
+ raise ValueError("max_pages must be an integer from 1 through 1024")
2761
+ if parameters.after is not None and options.cursor is not None:
2762
+ raise ValueError("generated cursor conflicts with query options")
2763
+ cursor = options.cursor if options.cursor is not None else parameters.after
2764
+ pages: list[TypedQueryResult[FindSessionsByUserIdResult]] = []
2765
+ for _ in range(max_pages):
2766
+ page_parameters = FindSessionsByUserIdParams(organization_id=parameters.organization_id, user_id=parameters.user_id, after=None)
2767
+ page = self.find_sessions_by_user_id(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
2768
+ pages.append(page)
2769
+ if not page.next_cursor:
2770
+ break
2771
+ cursor = page.next_cursor
2772
+ return pages
2773
+
2774
+ def find_user_by_email(self, parameters: FindUserByEmailParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByEmailResult]:
2775
+ if options.read_after_commit is None and self._read_after_commit is not None:
2776
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2777
+ raw = self._transport._execute_named_query(
2778
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2779
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2780
+ query_name="FindUserByEmail", plan_hash=FIND_USER_BY_EMAIL_QUERY_PLAN_HASH,
2781
+ parameters=encode_record(parameters), options=options,
2782
+ accept_compact_result=True,
2783
+ )
2784
+ outcomes = {
2785
+ "Found": FindUserByEmailFound,
2786
+ }
2787
+ 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))
2788
+
2789
+ def find_user_by_email_after_commit(self, parameters: FindUserByEmailParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByEmailResult]:
2790
+ return self.find_user_by_email(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2791
+
2792
+ def find_user_by_id(self, parameters: FindUserByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByIdResult]:
2793
+ if options.read_after_commit is None and self._read_after_commit is not None:
2794
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2795
+ raw = self._transport._execute_named_query(
2796
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2797
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2798
+ query_name="FindUserById", plan_hash=FIND_USER_BY_ID_QUERY_PLAN_HASH,
2799
+ parameters=encode_record(parameters), options=options,
2800
+ )
2801
+ outcomes = {
2802
+ "Found": FindUserByIdFound,
2803
+ "Missing": FindUserByIdMissing,
2804
+ }
2805
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2806
+
2807
+ def find_user_by_id_after_commit(self, parameters: FindUserByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByIdResult]:
2808
+ return self.find_user_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2809
+
2810
+ def find_verification_by_id(self, parameters: FindVerificationByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationByIdResult]:
2811
+ if options.read_after_commit is None and self._read_after_commit is not None:
2812
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2813
+ raw = self._transport._execute_named_query(
2814
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2815
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2816
+ query_name="FindVerificationById", plan_hash=FIND_VERIFICATION_BY_ID_QUERY_PLAN_HASH,
2817
+ parameters=encode_record(parameters), options=options,
2818
+ )
2819
+ outcomes = {
2820
+ "Found": FindVerificationByIdFound,
2821
+ "Missing": FindVerificationByIdMissing,
2822
+ }
2823
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2824
+
2825
+ def find_verification_by_id_after_commit(self, parameters: FindVerificationByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationByIdResult]:
2826
+ return self.find_verification_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2827
+
2828
+ def find_verifications_by_identifier(self, parameters: FindVerificationsByIdentifierParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationsByIdentifierResult]:
2829
+ encoded_parameters = encode_record(parameters)
2830
+ generated_cursor = parameters.after
2831
+ if generated_cursor is not None:
2832
+ if options.cursor is not None:
2833
+ raise ValueError("generated cursor conflicts with query options")
2834
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
2835
+ encoded_parameters.pop("after", None)
2836
+ if options.read_after_commit is None and self._read_after_commit is not None:
2837
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
2838
+ raw = self._transport._execute_named_query(
2839
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2840
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
2841
+ query_name="FindVerificationsByIdentifier", plan_hash=FIND_VERIFICATIONS_BY_IDENTIFIER_QUERY_PLAN_HASH,
2842
+ parameters=encoded_parameters, options=options,
2843
+ )
2844
+ outcomes = {
2845
+ "Found": FindVerificationsByIdentifierFound,
2846
+ }
2847
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
2848
+
2849
+ def find_verifications_by_identifier_after_commit(self, parameters: FindVerificationsByIdentifierParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationsByIdentifierResult]:
2850
+ return self.find_verifications_by_identifier(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
2851
+
2852
+ def find_verifications_by_identifier_pages(self, parameters: FindVerificationsByIdentifierParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindVerificationsByIdentifierResult]]:
2853
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
2854
+ raise ValueError("max_pages must be an integer from 1 through 1024")
2855
+ if parameters.after is not None and options.cursor is not None:
2856
+ raise ValueError("generated cursor conflicts with query options")
2857
+ cursor = options.cursor if options.cursor is not None else parameters.after
2858
+ pages: list[TypedQueryResult[FindVerificationsByIdentifierResult]] = []
2859
+ for _ in range(max_pages):
2860
+ page_parameters = FindVerificationsByIdentifierParams(organization_id=parameters.organization_id, identifier=parameters.identifier, after=None)
2861
+ page = self.find_verifications_by_identifier(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
2862
+ pages.append(page)
2863
+ if not page.next_cursor:
2864
+ break
2865
+ cursor = page.next_cursor
2866
+ return pages
2867
+
2868
+ def consume_verification(self, input: ConsumeVerificationInput) -> TypedCommandResult[ConsumeVerificationOutcome]:
2869
+ raw = self._transport._execute_command(
2870
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2871
+ command_name="ConsumeVerification", plan_hash=CONSUME_VERIFICATION_PLAN_HASH,
2872
+ input=encode_record(input), attempts=self._command_attempts,
2873
+ )
2874
+ outcomes = {
2875
+ "VerificationConsumed": ConsumeVerificationVerificationConsumed,
2876
+ "VerificationConsumeMissing": ConsumeVerificationVerificationConsumeMissing,
2877
+ }
2878
+ result: TypedCommandResult[ConsumeVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2879
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2880
+ 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
2881
+ return result
2882
+
2883
+ def consume_verification_batch(
2884
+ self, inputs: Sequence[ConsumeVerificationInput], options: CommandBatchOptions,
2885
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2886
+ ) -> CommandBatchResult[ConsumeVerificationOutcome]:
2887
+ return self._transport._command_batch(inputs, options, self.consume_verification, progress)
2888
+
2889
+ def consume_verification_set(self, input: ConsumeVerificationSetInput) -> TypedCommandResult[ConsumeVerificationSetOutcome]:
2890
+ if not 1 <= len(input.verification_ids) <= 32:
2891
+ raise ValueError("invalid bounded collection length for ConsumeVerificationSet.verification_ids")
2892
+ raw = self._transport._execute_command(
2893
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2894
+ command_name="ConsumeVerificationSet", plan_hash=CONSUME_VERIFICATION_SET_PLAN_HASH,
2895
+ input=encode_record(input), attempts=self._command_attempts,
2896
+ )
2897
+ outcomes = {
2898
+ "VerificationSetConsumed": ConsumeVerificationSetVerificationSetConsumed,
2899
+ "VerificationConsumeMissing": ConsumeVerificationSetVerificationConsumeMissing,
2900
+ }
2901
+ result: TypedCommandResult[ConsumeVerificationSetOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2902
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2903
+ 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
2904
+ return result
2905
+
2906
+ def consume_verification_set_batch(
2907
+ self, inputs: Sequence[ConsumeVerificationSetInput], options: CommandBatchOptions,
2908
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2909
+ ) -> CommandBatchResult[ConsumeVerificationSetOutcome]:
2910
+ for input in inputs:
2911
+ if not 1 <= len(input.verification_ids) <= 32:
2912
+ raise ValueError("invalid bounded collection length for ConsumeVerificationSet.verification_ids")
2913
+ return self._transport._command_batch(inputs, options, self.consume_verification_set, progress)
2914
+
2915
+ def consume_verification_snapshot(self, input: ConsumeVerificationSnapshotInput) -> TypedCommandResult[ConsumeVerificationSnapshotOutcome]:
2916
+ raw = self._transport._execute_command(
2917
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2918
+ command_name="ConsumeVerificationSnapshot", plan_hash=CONSUME_VERIFICATION_SNAPSHOT_PLAN_HASH,
2919
+ input=encode_record(input), attempts=self._command_attempts,
2920
+ )
2921
+ outcomes = {
2922
+ "VerificationConsumed": ConsumeVerificationSnapshotVerificationConsumed,
2923
+ "VerificationConsumeStale": ConsumeVerificationSnapshotVerificationConsumeStale,
2924
+ "VerificationConsumeMissing": ConsumeVerificationSnapshotVerificationConsumeMissing,
2925
+ }
2926
+ result: TypedCommandResult[ConsumeVerificationSnapshotOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2927
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2928
+ 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
2929
+ return result
2930
+
2931
+ def consume_verification_snapshot_batch(
2932
+ self, inputs: Sequence[ConsumeVerificationSnapshotInput], options: CommandBatchOptions,
2933
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2934
+ ) -> CommandBatchResult[ConsumeVerificationSnapshotOutcome]:
2935
+ return self._transport._command_batch(inputs, options, self.consume_verification_snapshot, progress)
2936
+
2937
+ def create_account(self, input: CreateAccountInput) -> TypedCommandResult[CreateAccountOutcome]:
2938
+ raw = self._transport._execute_command(
2939
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2940
+ command_name="CreateAccount", plan_hash=CREATE_ACCOUNT_PLAN_HASH,
2941
+ input=encode_record(input), attempts=self._command_attempts,
2942
+ )
2943
+ outcomes = {
2944
+ "AccountCreated": CreateAccountAccountCreated,
2945
+ "AccountUserMissing": CreateAccountAccountUserMissing,
2946
+ "AccountAlreadyExists": CreateAccountAccountAlreadyExists,
2947
+ }
2948
+ result: TypedCommandResult[CreateAccountOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2949
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2950
+ 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
2951
+ return result
2952
+
2953
+ def create_account_batch(
2954
+ self, inputs: Sequence[CreateAccountInput], options: CommandBatchOptions,
2955
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2956
+ ) -> CommandBatchResult[CreateAccountOutcome]:
2957
+ return self._transport._command_batch(inputs, options, self.create_account, progress)
2958
+
2959
+ def create_oauth_user_graph(self, input: CreateOAuthUserGraphInput) -> TypedCommandResult[CreateOAuthUserGraphOutcome]:
2960
+ raw = self._transport._execute_command(
2961
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2962
+ command_name="CreateOAuthUserGraph", plan_hash=CREATE_OAUTH_USER_GRAPH_PLAN_HASH,
2963
+ input=encode_record(input), attempts=self._command_attempts,
2964
+ )
2965
+ outcomes = {
2966
+ "OAuthUserExists": CreateOAuthUserGraphOAuthUserExists,
2967
+ "OAuthAccountExists": CreateOAuthUserGraphOAuthAccountExists,
2968
+ "OAuthUserGraphCreated": CreateOAuthUserGraphOAuthUserGraphCreated,
2969
+ }
2970
+ result: TypedCommandResult[CreateOAuthUserGraphOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2971
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2972
+ 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
2973
+ return result
2974
+
2975
+ def create_oauth_user_graph_batch(
2976
+ self, inputs: Sequence[CreateOAuthUserGraphInput], options: CommandBatchOptions,
2977
+ progress: Callable[[CommandBatchProgress], None] | None = None,
2978
+ ) -> CommandBatchResult[CreateOAuthUserGraphOutcome]:
2979
+ return self._transport._command_batch(inputs, options, self.create_oauth_user_graph, progress)
2980
+
2981
+ def create_session(self, input: CreateSessionInput) -> TypedCommandResult[CreateSessionOutcome]:
2982
+ raw = self._transport._execute_command(
2983
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
2984
+ command_name="CreateSession", plan_hash=CREATE_SESSION_PLAN_HASH,
2985
+ input=encode_record(input), attempts=self._command_attempts,
2986
+ )
2987
+ outcomes = {
2988
+ "SessionCreated": CreateSessionSessionCreated,
2989
+ "SessionUserMissing": CreateSessionSessionUserMissing,
2990
+ "SessionAlreadyExists": CreateSessionSessionAlreadyExists,
2991
+ }
2992
+ result: TypedCommandResult[CreateSessionOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
2993
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
2994
+ 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
2995
+ return result
2996
+
2997
+ def create_session_batch(
2998
+ self, inputs: Sequence[CreateSessionInput], options: CommandBatchOptions,
2999
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3000
+ ) -> CommandBatchResult[CreateSessionOutcome]:
3001
+ return self._transport._command_batch(inputs, options, self.create_session, progress)
3002
+
3003
+ def create_signup_graph(self, input: CreateSignupGraphInput) -> TypedCommandResult[CreateSignupGraphOutcome]:
3004
+ raw = self._transport._execute_command(
3005
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3006
+ command_name="CreateSignupGraph", plan_hash=CREATE_SIGNUP_GRAPH_PLAN_HASH,
3007
+ input=encode_record(input), attempts=self._command_attempts,
3008
+ )
3009
+ outcomes = {
3010
+ "SignupUserExists": CreateSignupGraphSignupUserExists,
3011
+ "SignupGraphCreated": CreateSignupGraphSignupGraphCreated,
3012
+ "SignupAccountExists": CreateSignupGraphSignupAccountExists,
3013
+ "SignupSessionExists": CreateSignupGraphSignupSessionExists,
3014
+ }
3015
+ result: TypedCommandResult[CreateSignupGraphOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3016
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3017
+ 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
3018
+ return result
3019
+
3020
+ def create_signup_graph_batch(
3021
+ self, inputs: Sequence[CreateSignupGraphInput], options: CommandBatchOptions,
3022
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3023
+ ) -> CommandBatchResult[CreateSignupGraphOutcome]:
3024
+ return self._transport._command_batch(inputs, options, self.create_signup_graph, progress)
3025
+
3026
+ def create_user(self, input: CreateUserInput) -> TypedCommandResult[CreateUserOutcome]:
3027
+ raw = self._transport._execute_command(
3028
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3029
+ command_name="CreateUser", plan_hash=CREATE_USER_PLAN_HASH,
3030
+ input=encode_record(input), attempts=self._command_attempts,
3031
+ )
3032
+ outcomes = {
3033
+ "UserCreated": CreateUserUserCreated,
3034
+ "UserAlreadyExists": CreateUserUserAlreadyExists,
3035
+ }
3036
+ result: TypedCommandResult[CreateUserOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3037
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3038
+ 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
3039
+ return result
3040
+
3041
+ def create_user_batch(
3042
+ self, inputs: Sequence[CreateUserInput], options: CommandBatchOptions,
3043
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3044
+ ) -> CommandBatchResult[CreateUserOutcome]:
3045
+ return self._transport._command_batch(inputs, options, self.create_user, progress)
3046
+
3047
+ def create_verification(self, input: CreateVerificationInput) -> TypedCommandResult[CreateVerificationOutcome]:
3048
+ raw = self._transport._execute_command(
3049
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3050
+ command_name="CreateVerification", plan_hash=CREATE_VERIFICATION_PLAN_HASH,
3051
+ input=encode_record(input), attempts=self._command_attempts,
3052
+ )
3053
+ outcomes = {
3054
+ "VerificationCreated": CreateVerificationVerificationCreated,
3055
+ "VerificationAlreadyExists": CreateVerificationVerificationAlreadyExists,
3056
+ }
3057
+ result: TypedCommandResult[CreateVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3058
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3059
+ 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
3060
+ return result
3061
+
3062
+ def create_verification_batch(
3063
+ self, inputs: Sequence[CreateVerificationInput], options: CommandBatchOptions,
3064
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3065
+ ) -> CommandBatchResult[CreateVerificationOutcome]:
3066
+ return self._transport._command_batch(inputs, options, self.create_verification, progress)
3067
+
3068
+ def delete_account(self, input: DeleteAccountInput) -> TypedCommandResult[DeleteAccountOutcome]:
3069
+ if not 1 <= len(input.account_ids) <= 32:
3070
+ raise ValueError("invalid bounded collection length for DeleteAccount.account_ids")
3071
+ raw = self._transport._execute_command(
3072
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3073
+ command_name="DeleteAccount", plan_hash=DELETE_ACCOUNT_PLAN_HASH,
3074
+ input=encode_record(input), attempts=self._command_attempts,
3075
+ )
3076
+ outcomes = {
3077
+ "AccountDeleted": DeleteAccountAccountDeleted,
3078
+ "AccountMissing": DeleteAccountAccountMissing,
3079
+ }
3080
+ result: TypedCommandResult[DeleteAccountOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3081
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3082
+ 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
3083
+ return result
3084
+
3085
+ def delete_account_batch(
3086
+ self, inputs: Sequence[DeleteAccountInput], options: CommandBatchOptions,
3087
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3088
+ ) -> CommandBatchResult[DeleteAccountOutcome]:
3089
+ for input in inputs:
3090
+ if not 1 <= len(input.account_ids) <= 32:
3091
+ raise ValueError("invalid bounded collection length for DeleteAccount.account_ids")
3092
+ return self._transport._command_batch(inputs, options, self.delete_account, progress)
3093
+
3094
+ def delete_session(self, input: DeleteSessionInput) -> TypedCommandResult[DeleteSessionOutcome]:
3095
+ if not 1 <= len(input.session_ids) <= 32:
3096
+ raise ValueError("invalid bounded collection length for DeleteSession.session_ids")
3097
+ raw = self._transport._execute_command(
3098
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3099
+ command_name="DeleteSession", plan_hash=DELETE_SESSION_PLAN_HASH,
3100
+ input=encode_record(input), attempts=self._command_attempts,
3101
+ )
3102
+ outcomes = {
3103
+ "SessionDeleted": DeleteSessionSessionDeleted,
3104
+ "SessionMissing": DeleteSessionSessionMissing,
3105
+ }
3106
+ result: TypedCommandResult[DeleteSessionOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3107
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3108
+ 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
3109
+ return result
3110
+
3111
+ def delete_session_batch(
3112
+ self, inputs: Sequence[DeleteSessionInput], options: CommandBatchOptions,
3113
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3114
+ ) -> CommandBatchResult[DeleteSessionOutcome]:
3115
+ for input in inputs:
3116
+ if not 1 <= len(input.session_ids) <= 32:
3117
+ raise ValueError("invalid bounded collection length for DeleteSession.session_ids")
3118
+ return self._transport._command_batch(inputs, options, self.delete_session, progress)
3119
+
3120
+ def delete_user(self, input: DeleteUserInput) -> TypedCommandResult[DeleteUserOutcome]:
3121
+ if not 1 <= len(input.user_ids) <= 1:
3122
+ raise ValueError("invalid bounded collection length for DeleteUser.user_ids")
3123
+ raw = self._transport._execute_command(
3124
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3125
+ command_name="DeleteUser", plan_hash=DELETE_USER_PLAN_HASH,
3126
+ input=encode_record(input), attempts=self._command_attempts,
3127
+ )
3128
+ outcomes = {
3129
+ "UserDeleted": DeleteUserUserDeleted,
3130
+ "DeleteUserMissing": DeleteUserDeleteUserMissing,
3131
+ "DeleteUserCascadeLimitExceeded": DeleteUserDeleteUserCascadeLimitExceeded,
3132
+ }
3133
+ result: TypedCommandResult[DeleteUserOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3134
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3135
+ 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
3136
+ return result
3137
+
3138
+ def delete_user_batch(
3139
+ self, inputs: Sequence[DeleteUserInput], options: CommandBatchOptions,
3140
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3141
+ ) -> CommandBatchResult[DeleteUserOutcome]:
3142
+ for input in inputs:
3143
+ if not 1 <= len(input.user_ids) <= 1:
3144
+ raise ValueError("invalid bounded collection length for DeleteUser.user_ids")
3145
+ return self._transport._command_batch(inputs, options, self.delete_user, progress)
3146
+
3147
+ def delete_verification(self, input: DeleteVerificationInput) -> TypedCommandResult[DeleteVerificationOutcome]:
3148
+ if not 1 <= len(input.verification_ids) <= 32:
3149
+ raise ValueError("invalid bounded collection length for DeleteVerification.verification_ids")
3150
+ raw = self._transport._execute_command(
3151
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3152
+ command_name="DeleteVerification", plan_hash=DELETE_VERIFICATION_PLAN_HASH,
3153
+ input=encode_record(input), attempts=self._command_attempts,
3154
+ )
3155
+ outcomes = {
3156
+ "VerificationDeleted": DeleteVerificationVerificationDeleted,
3157
+ "VerificationMissing": DeleteVerificationVerificationMissing,
3158
+ }
3159
+ result: TypedCommandResult[DeleteVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3160
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3161
+ 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
3162
+ return result
3163
+
3164
+ def delete_verification_batch(
3165
+ self, inputs: Sequence[DeleteVerificationInput], options: CommandBatchOptions,
3166
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3167
+ ) -> CommandBatchResult[DeleteVerificationOutcome]:
3168
+ for input in inputs:
3169
+ if not 1 <= len(input.verification_ids) <= 32:
3170
+ raise ValueError("invalid bounded collection length for DeleteVerification.verification_ids")
3171
+ return self._transport._command_batch(inputs, options, self.delete_verification, progress)
3172
+
3173
+ def reset_credential_password(self, input: ResetCredentialPasswordInput) -> TypedCommandResult[ResetCredentialPasswordOutcome]:
3174
+ if not 1 <= len(input.verification_ids) <= 1:
3175
+ raise ValueError("invalid bounded collection length for ResetCredentialPassword.verification_ids")
3176
+ raw = self._transport._execute_command(
3177
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3178
+ command_name="ResetCredentialPassword", plan_hash=RESET_CREDENTIAL_PASSWORD_PLAN_HASH,
3179
+ input=encode_record(input), attempts=self._command_attempts,
3180
+ )
3181
+ outcomes = {
3182
+ "PasswordAccountStale": ResetCredentialPasswordPasswordAccountStale,
3183
+ "PasswordAccountMissing": ResetCredentialPasswordPasswordAccountMissing,
3184
+ "CredentialPasswordReset": ResetCredentialPasswordCredentialPasswordReset,
3185
+ "PasswordProviderMismatch": ResetCredentialPasswordPasswordProviderMismatch,
3186
+ "VerificationConsumeStale": ResetCredentialPasswordVerificationConsumeStale,
3187
+ "VerificationConsumeMissing": ResetCredentialPasswordVerificationConsumeMissing,
3188
+ }
3189
+ result: TypedCommandResult[ResetCredentialPasswordOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3190
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3191
+ 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
3192
+ return result
3193
+
3194
+ def reset_credential_password_batch(
3195
+ self, inputs: Sequence[ResetCredentialPasswordInput], options: CommandBatchOptions,
3196
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3197
+ ) -> CommandBatchResult[ResetCredentialPasswordOutcome]:
3198
+ for input in inputs:
3199
+ if not 1 <= len(input.verification_ids) <= 1:
3200
+ raise ValueError("invalid bounded collection length for ResetCredentialPassword.verification_ids")
3201
+ return self._transport._command_batch(inputs, options, self.reset_credential_password, progress)
3202
+
3203
+ def update_account(self, input: UpdateAccountInput) -> TypedCommandResult[UpdateAccountOutcome]:
3204
+ raw = self._transport._execute_command(
3205
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3206
+ command_name="UpdateAccount", plan_hash=UPDATE_ACCOUNT_PLAN_HASH,
3207
+ input=encode_record(input), attempts=self._command_attempts,
3208
+ )
3209
+ outcomes = {
3210
+ "AccountUpdated": UpdateAccountAccountUpdated,
3211
+ "AccountUpdateStale": UpdateAccountAccountUpdateStale,
3212
+ "AccountUpdateMissing": UpdateAccountAccountUpdateMissing,
3213
+ }
3214
+ result: TypedCommandResult[UpdateAccountOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3215
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3216
+ 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
3217
+ return result
3218
+
3219
+ def update_account_batch(
3220
+ self, inputs: Sequence[UpdateAccountInput], options: CommandBatchOptions,
3221
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3222
+ ) -> CommandBatchResult[UpdateAccountOutcome]:
3223
+ return self._transport._command_batch(inputs, options, self.update_account, progress)
3224
+
3225
+ def update_account_passwords(self, input: UpdateAccountPasswordsInput) -> TypedCommandResult[UpdateAccountPasswordsOutcome]:
3226
+ if not 1 <= len(input.updates) <= 8:
3227
+ raise ValueError("invalid bounded collection length for UpdateAccountPasswords.updates")
3228
+ raw = self._transport._execute_command(
3229
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3230
+ command_name="UpdateAccountPasswords", plan_hash=UPDATE_ACCOUNT_PASSWORDS_PLAN_HASH,
3231
+ input=encode_record(input), attempts=self._command_attempts,
3232
+ )
3233
+ outcomes = {
3234
+ "PasswordAccountStale": UpdateAccountPasswordsPasswordAccountStale,
3235
+ "PasswordAccountMissing": UpdateAccountPasswordsPasswordAccountMissing,
3236
+ "AccountPasswordsUpdated": UpdateAccountPasswordsAccountPasswordsUpdated,
3237
+ "PasswordProviderMismatch": UpdateAccountPasswordsPasswordProviderMismatch,
3238
+ }
3239
+ result: TypedCommandResult[UpdateAccountPasswordsOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3240
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3241
+ 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
3242
+ return result
3243
+
3244
+ def update_account_passwords_batch(
3245
+ self, inputs: Sequence[UpdateAccountPasswordsInput], options: CommandBatchOptions,
3246
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3247
+ ) -> CommandBatchResult[UpdateAccountPasswordsOutcome]:
3248
+ for input in inputs:
3249
+ if not 1 <= len(input.updates) <= 8:
3250
+ raise ValueError("invalid bounded collection length for UpdateAccountPasswords.updates")
3251
+ return self._transport._command_batch(inputs, options, self.update_account_passwords, progress)
3252
+
3253
+ def update_credential_password(self, input: UpdateCredentialPasswordInput) -> TypedCommandResult[UpdateCredentialPasswordOutcome]:
3254
+ raw = self._transport._execute_command(
3255
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3256
+ command_name="UpdateCredentialPassword", plan_hash=UPDATE_CREDENTIAL_PASSWORD_PLAN_HASH,
3257
+ input=encode_record(input), attempts=self._command_attempts,
3258
+ )
3259
+ outcomes = {
3260
+ "PasswordAccountStale": UpdateCredentialPasswordPasswordAccountStale,
3261
+ "PasswordAccountMissing": UpdateCredentialPasswordPasswordAccountMissing,
3262
+ "PasswordProviderMismatch": UpdateCredentialPasswordPasswordProviderMismatch,
3263
+ "CredentialPasswordUpdated": UpdateCredentialPasswordCredentialPasswordUpdated,
3264
+ }
3265
+ result: TypedCommandResult[UpdateCredentialPasswordOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3266
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3267
+ 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
3268
+ return result
3269
+
3270
+ def update_credential_password_batch(
3271
+ self, inputs: Sequence[UpdateCredentialPasswordInput], options: CommandBatchOptions,
3272
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3273
+ ) -> CommandBatchResult[UpdateCredentialPasswordOutcome]:
3274
+ return self._transport._command_batch(inputs, options, self.update_credential_password, progress)
3275
+
3276
+ def update_session(self, input: UpdateSessionInput) -> TypedCommandResult[UpdateSessionOutcome]:
3277
+ raw = self._transport._execute_command(
3278
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3279
+ command_name="UpdateSession", plan_hash=UPDATE_SESSION_PLAN_HASH,
3280
+ input=encode_record(input), attempts=self._command_attempts,
3281
+ )
3282
+ outcomes = {
3283
+ "SessionUpdated": UpdateSessionSessionUpdated,
3284
+ "SessionUpdateStale": UpdateSessionSessionUpdateStale,
3285
+ "SessionUpdateMissing": UpdateSessionSessionUpdateMissing,
3286
+ }
3287
+ result: TypedCommandResult[UpdateSessionOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3288
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3289
+ 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
3290
+ return result
3291
+
3292
+ def update_session_batch(
3293
+ self, inputs: Sequence[UpdateSessionInput], options: CommandBatchOptions,
3294
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3295
+ ) -> CommandBatchResult[UpdateSessionOutcome]:
3296
+ return self._transport._command_batch(inputs, options, self.update_session, progress)
3297
+
3298
+ def update_user(self, input: UpdateUserInput) -> TypedCommandResult[UpdateUserOutcome]:
3299
+ raw = self._transport._execute_command(
3300
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3301
+ command_name="UpdateUser", plan_hash=UPDATE_USER_PLAN_HASH,
3302
+ input=encode_record(input), attempts=self._command_attempts,
3303
+ )
3304
+ outcomes = {
3305
+ "UserUpdated": UpdateUserUserUpdated,
3306
+ "UserUpdateStale": UpdateUserUserUpdateStale,
3307
+ "UserUpdateMissing": UpdateUserUserUpdateMissing,
3308
+ }
3309
+ result: TypedCommandResult[UpdateUserOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3310
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3311
+ 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
3312
+ return result
3313
+
3314
+ def update_user_batch(
3315
+ self, inputs: Sequence[UpdateUserInput], options: CommandBatchOptions,
3316
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3317
+ ) -> CommandBatchResult[UpdateUserOutcome]:
3318
+ return self._transport._command_batch(inputs, options, self.update_user, progress)
3319
+
3320
+ def update_verification(self, input: UpdateVerificationInput) -> TypedCommandResult[UpdateVerificationOutcome]:
3321
+ raw = self._transport._execute_command(
3322
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3323
+ command_name="UpdateVerification", plan_hash=UPDATE_VERIFICATION_PLAN_HASH,
3324
+ input=encode_record(input), attempts=self._command_attempts,
3325
+ )
3326
+ outcomes = {
3327
+ "VerificationUpdated": UpdateVerificationVerificationUpdated,
3328
+ "VerificationUpdateStale": UpdateVerificationVerificationUpdateStale,
3329
+ "VerificationUpdateMissing": UpdateVerificationVerificationUpdateMissing,
3330
+ }
3331
+ result: TypedCommandResult[UpdateVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3332
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3333
+ 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
3334
+ return result
3335
+
3336
+ def update_verification_batch(
3337
+ self, inputs: Sequence[UpdateVerificationInput], options: CommandBatchOptions,
3338
+ progress: Callable[[CommandBatchProgress], None] | None = None,
3339
+ ) -> CommandBatchResult[UpdateVerificationOutcome]:
3340
+ return self._transport._command_batch(inputs, options, self.update_verification, progress)
3341
+
3342
+ class AsyncRiffDBBetterAuthCoreClient:
3343
+ def __init__(self, transport: AsyncApplicationTransport, command_attempts: AttemptBudget = AttemptBudget(3), *, read_after_commit: int | None = None, track_causal_writes: bool = True) -> None:
3344
+ self._transport = transport
3345
+ self._command_attempts = command_attempts
3346
+ self._read_after_commit = read_after_commit
3347
+ self._track_causal_writes = track_causal_writes
3348
+
3349
+ @classmethod
3350
+ def from_transport(cls, transport: AsyncApplicationTransport, command_attempts: AttemptBudget = AttemptBudget(3)) -> AsyncRiffDBBetterAuthCoreClient:
3351
+ return cls(transport, command_attempts)
3352
+
3353
+ def with_read_after_commit(self, commit_sequence: int | None) -> AsyncRiffDBBetterAuthCoreClient:
3354
+ return AsyncRiffDBBetterAuthCoreClient(self._transport, self._command_attempts, read_after_commit=commit_sequence, track_causal_writes=self._track_causal_writes)
3355
+
3356
+ def causal_session(self, initial_commit_sequence: int | None = None) -> AsyncRiffDBBetterAuthCoreClient:
3357
+ 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)
3358
+
3359
+ @property
3360
+ def last_commit_sequence(self) -> int | None:
3361
+ return self._read_after_commit
3362
+
3363
+ async def admin_users_all_email_asc(self, parameters: AdminUsersAllEmailAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersAllEmailAscResult]:
3364
+ 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):
3365
+ raise ValueError("limit must be an integer from 1 through 100")
3366
+ if options.read_after_commit is None and self._read_after_commit is not None:
3367
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3368
+ raw = await self._transport._execute_named_query(
3369
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3370
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3371
+ query_name="AdminUsersAllEmailAsc", plan_hash=ADMIN_USERS_ALL_EMAIL_ASC_QUERY_PLAN_HASH,
3372
+ parameters=encode_record(parameters), options=options,
3373
+ )
3374
+ outcomes = {
3375
+ "Found": AdminUsersAllEmailAscFound,
3376
+ }
3377
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3378
+
3379
+ async def admin_users_all_email_asc_after_commit(self, parameters: AdminUsersAllEmailAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersAllEmailAscResult]:
3380
+ return await self.admin_users_all_email_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3381
+
3382
+ async def admin_users_contains_asc(self, parameters: AdminUsersContainsAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsAscResult]:
3383
+ 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):
3384
+ raise ValueError("limit must be an integer from 1 through 100")
3385
+ if options.read_after_commit is None and self._read_after_commit is not None:
3386
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3387
+ raw = await self._transport._execute_named_query(
3388
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3389
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3390
+ query_name="AdminUsersContainsAsc", plan_hash=ADMIN_USERS_CONTAINS_ASC_QUERY_PLAN_HASH,
3391
+ parameters=encode_record(parameters), options=options,
3392
+ )
3393
+ outcomes = {
3394
+ "Found": AdminUsersContainsAscFound,
3395
+ }
3396
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3397
+
3398
+ async def admin_users_contains_asc_after_commit(self, parameters: AdminUsersContainsAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsAscResult]:
3399
+ return await self.admin_users_contains_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3400
+
3401
+ async def admin_users_contains_desc(self, parameters: AdminUsersContainsDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsDescResult]:
3402
+ 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):
3403
+ raise ValueError("limit must be an integer from 1 through 100")
3404
+ if options.read_after_commit is None and self._read_after_commit is not None:
3405
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3406
+ raw = await self._transport._execute_named_query(
3407
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3408
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3409
+ query_name="AdminUsersContainsDesc", plan_hash=ADMIN_USERS_CONTAINS_DESC_QUERY_PLAN_HASH,
3410
+ parameters=encode_record(parameters), options=options,
3411
+ )
3412
+ outcomes = {
3413
+ "Found": AdminUsersContainsDescFound,
3414
+ }
3415
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3416
+
3417
+ async def admin_users_contains_desc_after_commit(self, parameters: AdminUsersContainsDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersContainsDescResult]:
3418
+ return await self.admin_users_contains_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3419
+
3420
+ async def admin_users_email_contains_created_desc(self, parameters: AdminUsersEmailContainsCreatedDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsCreatedDescResult]:
3421
+ 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):
3422
+ raise ValueError("limit must be an integer from 1 through 100")
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="AdminUsersEmailContainsCreatedDesc", plan_hash=ADMIN_USERS_EMAIL_CONTAINS_CREATED_DESC_QUERY_PLAN_HASH,
3429
+ parameters=encode_record(parameters), options=options,
3430
+ )
3431
+ outcomes = {
3432
+ "Found": AdminUsersEmailContainsCreatedDescFound,
3433
+ }
3434
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3435
+
3436
+ async def admin_users_email_contains_created_desc_after_commit(self, parameters: AdminUsersEmailContainsCreatedDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsCreatedDescResult]:
3437
+ return await self.admin_users_email_contains_created_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3438
+
3439
+ async def admin_users_email_contains_image_asc(self, parameters: AdminUsersEmailContainsImageAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsImageAscResult]:
3440
+ 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):
3441
+ raise ValueError("limit must be an integer from 1 through 100")
3442
+ if options.read_after_commit is None and self._read_after_commit is not None:
3443
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3444
+ raw = await self._transport._execute_named_query(
3445
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3446
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3447
+ query_name="AdminUsersEmailContainsImageAsc", plan_hash=ADMIN_USERS_EMAIL_CONTAINS_IMAGE_ASC_QUERY_PLAN_HASH,
3448
+ parameters=encode_record(parameters), options=options,
3449
+ )
3450
+ outcomes = {
3451
+ "Found": AdminUsersEmailContainsImageAscFound,
3452
+ }
3453
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3454
+
3455
+ async def admin_users_email_contains_image_asc_after_commit(self, parameters: AdminUsersEmailContainsImageAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEmailContainsImageAscResult]:
3456
+ return await self.admin_users_email_contains_image_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3457
+
3458
+ async def admin_users_ends_with_asc(self, parameters: AdminUsersEndsWithAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithAscResult]:
3459
+ 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):
3460
+ raise ValueError("limit must be an integer from 1 through 100")
3461
+ if options.read_after_commit is None and self._read_after_commit is not None:
3462
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3463
+ raw = await self._transport._execute_named_query(
3464
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3465
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3466
+ query_name="AdminUsersEndsWithAsc", plan_hash=ADMIN_USERS_ENDS_WITH_ASC_QUERY_PLAN_HASH,
3467
+ parameters=encode_record(parameters), options=options,
3468
+ )
3469
+ outcomes = {
3470
+ "Found": AdminUsersEndsWithAscFound,
3471
+ }
3472
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3473
+
3474
+ async def admin_users_ends_with_asc_after_commit(self, parameters: AdminUsersEndsWithAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithAscResult]:
3475
+ return await self.admin_users_ends_with_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3476
+
3477
+ async def admin_users_ends_with_desc(self, parameters: AdminUsersEndsWithDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithDescResult]:
3478
+ 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):
3479
+ raise ValueError("limit must be an integer from 1 through 100")
3480
+ if options.read_after_commit is None and self._read_after_commit is not None:
3481
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3482
+ raw = await self._transport._execute_named_query(
3483
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3484
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3485
+ query_name="AdminUsersEndsWithDesc", plan_hash=ADMIN_USERS_ENDS_WITH_DESC_QUERY_PLAN_HASH,
3486
+ parameters=encode_record(parameters), options=options,
3487
+ )
3488
+ outcomes = {
3489
+ "Found": AdminUsersEndsWithDescFound,
3490
+ }
3491
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3492
+
3493
+ async def admin_users_ends_with_desc_after_commit(self, parameters: AdminUsersEndsWithDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersEndsWithDescResult]:
3494
+ return await self.admin_users_ends_with_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3495
+
3496
+ async def admin_users_starts_with_asc(self, parameters: AdminUsersStartsWithAscParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithAscResult]:
3497
+ 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):
3498
+ raise ValueError("limit must be an integer from 1 through 100")
3499
+ if options.read_after_commit is None and self._read_after_commit is not None:
3500
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3501
+ raw = await self._transport._execute_named_query(
3502
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3503
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3504
+ query_name="AdminUsersStartsWithAsc", plan_hash=ADMIN_USERS_STARTS_WITH_ASC_QUERY_PLAN_HASH,
3505
+ parameters=encode_record(parameters), options=options,
3506
+ )
3507
+ outcomes = {
3508
+ "Found": AdminUsersStartsWithAscFound,
3509
+ }
3510
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3511
+
3512
+ async def admin_users_starts_with_asc_after_commit(self, parameters: AdminUsersStartsWithAscParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithAscResult]:
3513
+ return await self.admin_users_starts_with_asc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3514
+
3515
+ async def admin_users_starts_with_desc(self, parameters: AdminUsersStartsWithDescParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithDescResult]:
3516
+ 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):
3517
+ raise ValueError("limit must be an integer from 1 through 100")
3518
+ if options.read_after_commit is None and self._read_after_commit is not None:
3519
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3520
+ raw = await self._transport._execute_named_query(
3521
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3522
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3523
+ query_name="AdminUsersStartsWithDesc", plan_hash=ADMIN_USERS_STARTS_WITH_DESC_QUERY_PLAN_HASH,
3524
+ parameters=encode_record(parameters), options=options,
3525
+ )
3526
+ outcomes = {
3527
+ "Found": AdminUsersStartsWithDescFound,
3528
+ }
3529
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3530
+
3531
+ async def admin_users_starts_with_desc_after_commit(self, parameters: AdminUsersStartsWithDescParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[AdminUsersStartsWithDescResult]:
3532
+ return await self.admin_users_starts_with_desc(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3533
+
3534
+ async def find_account_by_id(self, parameters: FindAccountByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByIdResult]:
3535
+ if options.read_after_commit is None and self._read_after_commit is not None:
3536
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3537
+ raw = await self._transport._execute_named_query(
3538
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3539
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3540
+ query_name="FindAccountById", plan_hash=FIND_ACCOUNT_BY_ID_QUERY_PLAN_HASH,
3541
+ parameters=encode_record(parameters), options=options,
3542
+ )
3543
+ outcomes = {
3544
+ "Found": FindAccountByIdFound,
3545
+ }
3546
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3547
+
3548
+ async def find_account_by_id_after_commit(self, parameters: FindAccountByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByIdResult]:
3549
+ return await self.find_account_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3550
+
3551
+ async def find_account_by_provider(self, parameters: FindAccountByProviderParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByProviderResult]:
3552
+ if options.read_after_commit is None and self._read_after_commit is not None:
3553
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3554
+ raw = await self._transport._execute_named_query(
3555
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3556
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3557
+ query_name="FindAccountByProvider", plan_hash=FIND_ACCOUNT_BY_PROVIDER_QUERY_PLAN_HASH,
3558
+ parameters=encode_record(parameters), options=options,
3559
+ )
3560
+ outcomes = {
3561
+ "Found": FindAccountByProviderFound,
3562
+ }
3563
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3564
+
3565
+ async def find_account_by_provider_after_commit(self, parameters: FindAccountByProviderParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountByProviderResult]:
3566
+ return await self.find_account_by_provider(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3567
+
3568
+ async def find_accounts_by_user_id(self, parameters: FindAccountsByUserIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserIdResult]:
3569
+ encoded_parameters = encode_record(parameters)
3570
+ generated_cursor = parameters.after
3571
+ if generated_cursor is not None:
3572
+ if options.cursor is not None:
3573
+ raise ValueError("generated cursor conflicts with query options")
3574
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
3575
+ encoded_parameters.pop("after", None)
3576
+ if options.read_after_commit is None and self._read_after_commit is not None:
3577
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3578
+ raw = await self._transport._execute_named_query(
3579
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3580
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3581
+ query_name="FindAccountsByUserId", plan_hash=FIND_ACCOUNTS_BY_USER_ID_QUERY_PLAN_HASH,
3582
+ parameters=encoded_parameters, options=options,
3583
+ )
3584
+ outcomes = {
3585
+ "Found": FindAccountsByUserIdFound,
3586
+ }
3587
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3588
+
3589
+ async def find_accounts_by_user_id_after_commit(self, parameters: FindAccountsByUserIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserIdResult]:
3590
+ return await self.find_accounts_by_user_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3591
+
3592
+ async def find_accounts_by_user_id_pages(self, parameters: FindAccountsByUserIdParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindAccountsByUserIdResult]]:
3593
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
3594
+ raise ValueError("max_pages must be an integer from 1 through 1024")
3595
+ if parameters.after is not None and options.cursor is not None:
3596
+ raise ValueError("generated cursor conflicts with query options")
3597
+ cursor = options.cursor if options.cursor is not None else parameters.after
3598
+ pages: list[TypedQueryResult[FindAccountsByUserIdResult]] = []
3599
+ for _ in range(max_pages):
3600
+ page_parameters = FindAccountsByUserIdParams(organization_id=parameters.organization_id, user_id=parameters.user_id, after=None)
3601
+ page = await self.find_accounts_by_user_id(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
3602
+ pages.append(page)
3603
+ if not page.next_cursor:
3604
+ break
3605
+ cursor = page.next_cursor
3606
+ return pages
3607
+
3608
+ async def find_accounts_by_user_provider(self, parameters: FindAccountsByUserProviderParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserProviderResult]:
3609
+ encoded_parameters = encode_record(parameters)
3610
+ generated_cursor = parameters.after
3611
+ if generated_cursor is not None:
3612
+ if options.cursor is not None:
3613
+ raise ValueError("generated cursor conflicts with query options")
3614
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
3615
+ encoded_parameters.pop("after", None)
3616
+ if options.read_after_commit is None and self._read_after_commit is not None:
3617
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3618
+ raw = await self._transport._execute_named_query(
3619
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3620
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3621
+ query_name="FindAccountsByUserProvider", plan_hash=FIND_ACCOUNTS_BY_USER_PROVIDER_QUERY_PLAN_HASH,
3622
+ parameters=encoded_parameters, options=options,
3623
+ )
3624
+ outcomes = {
3625
+ "Found": FindAccountsByUserProviderFound,
3626
+ }
3627
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3628
+
3629
+ async def find_accounts_by_user_provider_after_commit(self, parameters: FindAccountsByUserProviderParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindAccountsByUserProviderResult]:
3630
+ return await self.find_accounts_by_user_provider(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3631
+
3632
+ async def find_accounts_by_user_provider_pages(self, parameters: FindAccountsByUserProviderParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindAccountsByUserProviderResult]]:
3633
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
3634
+ raise ValueError("max_pages must be an integer from 1 through 1024")
3635
+ if parameters.after is not None and options.cursor is not None:
3636
+ raise ValueError("generated cursor conflicts with query options")
3637
+ cursor = options.cursor if options.cursor is not None else parameters.after
3638
+ pages: list[TypedQueryResult[FindAccountsByUserProviderResult]] = []
3639
+ for _ in range(max_pages):
3640
+ page_parameters = FindAccountsByUserProviderParams(organization_id=parameters.organization_id, user_id=parameters.user_id, provider_id=parameters.provider_id, after=None)
3641
+ page = await self.find_accounts_by_user_provider(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
3642
+ pages.append(page)
3643
+ if not page.next_cursor:
3644
+ break
3645
+ cursor = page.next_cursor
3646
+ return pages
3647
+
3648
+ async def find_active_sessions_by_user_id(self, parameters: FindActiveSessionsByUserIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindActiveSessionsByUserIdResult]:
3649
+ encoded_parameters = encode_record(parameters)
3650
+ generated_cursor = parameters.after
3651
+ if generated_cursor is not None:
3652
+ if options.cursor is not None:
3653
+ raise ValueError("generated cursor conflicts with query options")
3654
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
3655
+ encoded_parameters.pop("after", None)
3656
+ if options.read_after_commit is None and self._read_after_commit is not None:
3657
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3658
+ raw = await self._transport._execute_named_query(
3659
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3660
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3661
+ query_name="FindActiveSessionsByUserId", plan_hash=FIND_ACTIVE_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH,
3662
+ parameters=encoded_parameters, options=options,
3663
+ )
3664
+ outcomes = {
3665
+ "Found": FindActiveSessionsByUserIdFound,
3666
+ }
3667
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3668
+
3669
+ async def find_active_sessions_by_user_id_after_commit(self, parameters: FindActiveSessionsByUserIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindActiveSessionsByUserIdResult]:
3670
+ return await self.find_active_sessions_by_user_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3671
+
3672
+ async def find_active_sessions_by_user_id_pages(self, parameters: FindActiveSessionsByUserIdParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindActiveSessionsByUserIdResult]]:
3673
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
3674
+ raise ValueError("max_pages must be an integer from 1 through 1024")
3675
+ if parameters.after is not None and options.cursor is not None:
3676
+ raise ValueError("generated cursor conflicts with query options")
3677
+ cursor = options.cursor if options.cursor is not None else parameters.after
3678
+ pages: list[TypedQueryResult[FindActiveSessionsByUserIdResult]] = []
3679
+ for _ in range(max_pages):
3680
+ page_parameters = FindActiveSessionsByUserIdParams(organization_id=parameters.organization_id, user_id=parameters.user_id, expires_after=parameters.expires_after, after=None)
3681
+ page = await self.find_active_sessions_by_user_id(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
3682
+ pages.append(page)
3683
+ if not page.next_cursor:
3684
+ break
3685
+ cursor = page.next_cursor
3686
+ return pages
3687
+
3688
+ async def find_credential_account(self, parameters: FindCredentialAccountParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindCredentialAccountResult]:
3689
+ if options.read_after_commit is None and self._read_after_commit is not None:
3690
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3691
+ raw = await self._transport._execute_named_query(
3692
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3693
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3694
+ query_name="FindCredentialAccount", plan_hash=FIND_CREDENTIAL_ACCOUNT_QUERY_PLAN_HASH,
3695
+ parameters=encode_record(parameters), options=options,
3696
+ )
3697
+ outcomes = {
3698
+ "Found": FindCredentialAccountFound,
3699
+ }
3700
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3701
+
3702
+ async def find_credential_account_after_commit(self, parameters: FindCredentialAccountParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindCredentialAccountResult]:
3703
+ return await self.find_credential_account(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3704
+
3705
+ async def find_expired_verification_ids(self, parameters: FindExpiredVerificationIdsParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindExpiredVerificationIdsResult]:
3706
+ encoded_parameters = encode_record(parameters)
3707
+ generated_cursor = parameters.after
3708
+ if generated_cursor is not None:
3709
+ if options.cursor is not None:
3710
+ raise ValueError("generated cursor conflicts with query options")
3711
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
3712
+ encoded_parameters.pop("after", None)
3713
+ if options.read_after_commit is None and self._read_after_commit is not None:
3714
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3715
+ raw = await self._transport._execute_named_query(
3716
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3717
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3718
+ query_name="FindExpiredVerificationIds", plan_hash=FIND_EXPIRED_VERIFICATION_IDS_QUERY_PLAN_HASH,
3719
+ parameters=encoded_parameters, options=options,
3720
+ )
3721
+ outcomes = {
3722
+ "Found": FindExpiredVerificationIdsFound,
3723
+ }
3724
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3725
+
3726
+ async def find_expired_verification_ids_after_commit(self, parameters: FindExpiredVerificationIdsParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindExpiredVerificationIdsResult]:
3727
+ return await self.find_expired_verification_ids(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3728
+
3729
+ async def find_expired_verification_ids_pages(self, parameters: FindExpiredVerificationIdsParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindExpiredVerificationIdsResult]]:
3730
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
3731
+ raise ValueError("max_pages must be an integer from 1 through 1024")
3732
+ if parameters.after is not None and options.cursor is not None:
3733
+ raise ValueError("generated cursor conflicts with query options")
3734
+ cursor = options.cursor if options.cursor is not None else parameters.after
3735
+ pages: list[TypedQueryResult[FindExpiredVerificationIdsResult]] = []
3736
+ for _ in range(max_pages):
3737
+ page_parameters = FindExpiredVerificationIdsParams(organization_id=parameters.organization_id, expires_before=parameters.expires_before, after=None)
3738
+ page = await self.find_expired_verification_ids(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
3739
+ pages.append(page)
3740
+ if not page.next_cursor:
3741
+ break
3742
+ cursor = page.next_cursor
3743
+ return pages
3744
+
3745
+ async def find_latest_verification(self, parameters: FindLatestVerificationParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindLatestVerificationResult]:
3746
+ if options.read_after_commit is None and self._read_after_commit is not None:
3747
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3748
+ raw = await self._transport._execute_named_query(
3749
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3750
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3751
+ query_name="FindLatestVerification", plan_hash=FIND_LATEST_VERIFICATION_QUERY_PLAN_HASH,
3752
+ parameters=encode_record(parameters), options=options,
3753
+ )
3754
+ outcomes = {
3755
+ "Found": FindLatestVerificationFound,
3756
+ }
3757
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3758
+
3759
+ async def find_latest_verification_after_commit(self, parameters: FindLatestVerificationParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindLatestVerificationResult]:
3760
+ return await self.find_latest_verification(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3761
+
3762
+ async def find_session_by_id(self, parameters: FindSessionByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByIdResult]:
3763
+ if options.read_after_commit is None and self._read_after_commit is not None:
3764
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3765
+ raw = await self._transport._execute_named_query(
3766
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3767
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3768
+ query_name="FindSessionById", plan_hash=FIND_SESSION_BY_ID_QUERY_PLAN_HASH,
3769
+ parameters=encode_record(parameters), options=options,
3770
+ )
3771
+ outcomes = {
3772
+ "Found": FindSessionByIdFound,
3773
+ }
3774
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3775
+
3776
+ async def find_session_by_id_after_commit(self, parameters: FindSessionByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByIdResult]:
3777
+ return await self.find_session_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3778
+
3779
+ async def find_session_by_token(self, parameters: FindSessionByTokenParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByTokenResult]:
3780
+ if options.read_after_commit is None and self._read_after_commit is not None:
3781
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3782
+ raw = await self._transport._execute_named_query(
3783
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3784
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3785
+ query_name="FindSessionByToken", plan_hash=FIND_SESSION_BY_TOKEN_QUERY_PLAN_HASH,
3786
+ parameters=encode_record(parameters), options=options,
3787
+ )
3788
+ outcomes = {
3789
+ "Found": FindSessionByTokenFound,
3790
+ }
3791
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3792
+
3793
+ async def find_session_by_token_after_commit(self, parameters: FindSessionByTokenParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionByTokenResult]:
3794
+ return await self.find_session_by_token(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3795
+
3796
+ async def find_sessions_by_token_set(self, parameters: FindSessionsByTokenSetParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByTokenSetResult]:
3797
+ if options.read_after_commit is None and self._read_after_commit is not None:
3798
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3799
+ raw = await self._transport._execute_named_query(
3800
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3801
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3802
+ query_name="FindSessionsByTokenSet", plan_hash=FIND_SESSIONS_BY_TOKEN_SET_QUERY_PLAN_HASH,
3803
+ parameters=encode_record(parameters), options=options,
3804
+ )
3805
+ outcomes = {
3806
+ "Found": FindSessionsByTokenSetFound,
3807
+ }
3808
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3809
+
3810
+ async def find_sessions_by_token_set_after_commit(self, parameters: FindSessionsByTokenSetParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByTokenSetResult]:
3811
+ return await self.find_sessions_by_token_set(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3812
+
3813
+ async def find_sessions_by_token_set_all(self, parameters: FindSessionsByTokenSetParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByTokenSetFound]:
3814
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
3815
+ raise ValueError("max_pages must be an integer from 1 through 1024")
3816
+ if options.cursor is not None:
3817
+ raise ValueError("find_sessions_by_token_set_all does not accept an initial cursor")
3818
+ items = tuple(dict.fromkeys(parameters.tokens))
3819
+ if not items:
3820
+ raise ValueError("tokens must contain at least 1 item")
3821
+ pinned_head = options.read_after_commit if options.read_after_commit is not None else self._read_after_commit
3822
+ highest_head = 0
3823
+ merged: list[FindSessionsByTokenSetFoundSessions] = []
3824
+ latest_page: TypedQueryResult[FindSessionsByTokenSetResult] | None = None
3825
+ pages_remaining = max_pages
3826
+ for offset in range(0, len(items), FIND_SESSIONS_BY_TOKEN_SET_TOKENS_MAX_ITEMS):
3827
+ chunk = items[offset:offset + FIND_SESSIONS_BY_TOKEN_SET_TOKENS_MAX_ITEMS]
3828
+ chunk_cursor: str | None = None
3829
+ while True:
3830
+ if pages_remaining < 1:
3831
+ raise ValueError("find_sessions_by_token_set_all exceeded max_pages (1..=1024)")
3832
+ pages_remaining -= 1
3833
+ chunk_parameters = FindSessionsByTokenSetParams(organization_id=parameters.organization_id, tokens=chunk)
3834
+ page = await self.find_sessions_by_token_set(chunk_parameters, QueryOptions(cursor=chunk_cursor, read_after_commit=pinned_head, consistency=options.consistency))
3835
+ found = page.value.unwrap_found()
3836
+ merged.extend(found.sessions)
3837
+ latest_page = page
3838
+ if page.application_head > highest_head:
3839
+ highest_head = page.application_head
3840
+ if pinned_head is None or page.application_head > pinned_head:
3841
+ pinned_head = page.application_head
3842
+ if not page.next_cursor:
3843
+ break
3844
+ chunk_cursor = page.next_cursor
3845
+ assert latest_page is not None
3846
+ return TypedQueryResult(identity=latest_page.identity, value=FindSessionsByTokenSetFound(sessions=tuple(merged)), application_head=highest_head, next_cursor=None)
3847
+
3848
+ async def find_sessions_by_user_id(self, parameters: FindSessionsByUserIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByUserIdResult]:
3849
+ encoded_parameters = encode_record(parameters)
3850
+ generated_cursor = parameters.after
3851
+ if generated_cursor is not None:
3852
+ if options.cursor is not None:
3853
+ raise ValueError("generated cursor conflicts with query options")
3854
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
3855
+ encoded_parameters.pop("after", None)
3856
+ if options.read_after_commit is None and self._read_after_commit is not None:
3857
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3858
+ raw = await self._transport._execute_named_query(
3859
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3860
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3861
+ query_name="FindSessionsByUserId", plan_hash=FIND_SESSIONS_BY_USER_ID_QUERY_PLAN_HASH,
3862
+ parameters=encoded_parameters, options=options,
3863
+ )
3864
+ outcomes = {
3865
+ "Found": FindSessionsByUserIdFound,
3866
+ }
3867
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3868
+
3869
+ async def find_sessions_by_user_id_after_commit(self, parameters: FindSessionsByUserIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindSessionsByUserIdResult]:
3870
+ return await self.find_sessions_by_user_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3871
+
3872
+ async def find_sessions_by_user_id_pages(self, parameters: FindSessionsByUserIdParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindSessionsByUserIdResult]]:
3873
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
3874
+ raise ValueError("max_pages must be an integer from 1 through 1024")
3875
+ if parameters.after is not None and options.cursor is not None:
3876
+ raise ValueError("generated cursor conflicts with query options")
3877
+ cursor = options.cursor if options.cursor is not None else parameters.after
3878
+ pages: list[TypedQueryResult[FindSessionsByUserIdResult]] = []
3879
+ for _ in range(max_pages):
3880
+ page_parameters = FindSessionsByUserIdParams(organization_id=parameters.organization_id, user_id=parameters.user_id, after=None)
3881
+ page = await self.find_sessions_by_user_id(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
3882
+ pages.append(page)
3883
+ if not page.next_cursor:
3884
+ break
3885
+ cursor = page.next_cursor
3886
+ return pages
3887
+
3888
+ async def find_user_by_email(self, parameters: FindUserByEmailParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByEmailResult]:
3889
+ if options.read_after_commit is None and self._read_after_commit is not None:
3890
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3891
+ raw = await self._transport._execute_named_query(
3892
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3893
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3894
+ query_name="FindUserByEmail", plan_hash=FIND_USER_BY_EMAIL_QUERY_PLAN_HASH,
3895
+ parameters=encode_record(parameters), options=options,
3896
+ accept_compact_result=True,
3897
+ )
3898
+ outcomes = {
3899
+ "Found": FindUserByEmailFound,
3900
+ }
3901
+ 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))
3902
+
3903
+ async def find_user_by_email_after_commit(self, parameters: FindUserByEmailParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByEmailResult]:
3904
+ return await self.find_user_by_email(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3905
+
3906
+ async def find_user_by_id(self, parameters: FindUserByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByIdResult]:
3907
+ if options.read_after_commit is None and self._read_after_commit is not None:
3908
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3909
+ raw = await self._transport._execute_named_query(
3910
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3911
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3912
+ query_name="FindUserById", plan_hash=FIND_USER_BY_ID_QUERY_PLAN_HASH,
3913
+ parameters=encode_record(parameters), options=options,
3914
+ )
3915
+ outcomes = {
3916
+ "Found": FindUserByIdFound,
3917
+ "Missing": FindUserByIdMissing,
3918
+ }
3919
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3920
+
3921
+ async def find_user_by_id_after_commit(self, parameters: FindUserByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindUserByIdResult]:
3922
+ return await self.find_user_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3923
+
3924
+ async def find_verification_by_id(self, parameters: FindVerificationByIdParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationByIdResult]:
3925
+ if options.read_after_commit is None and self._read_after_commit is not None:
3926
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3927
+ raw = await self._transport._execute_named_query(
3928
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3929
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3930
+ query_name="FindVerificationById", plan_hash=FIND_VERIFICATION_BY_ID_QUERY_PLAN_HASH,
3931
+ parameters=encode_record(parameters), options=options,
3932
+ )
3933
+ outcomes = {
3934
+ "Found": FindVerificationByIdFound,
3935
+ "Missing": FindVerificationByIdMissing,
3936
+ }
3937
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3938
+
3939
+ async def find_verification_by_id_after_commit(self, parameters: FindVerificationByIdParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationByIdResult]:
3940
+ return await self.find_verification_by_id(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3941
+
3942
+ async def find_verifications_by_identifier(self, parameters: FindVerificationsByIdentifierParams, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationsByIdentifierResult]:
3943
+ encoded_parameters = encode_record(parameters)
3944
+ generated_cursor = parameters.after
3945
+ if generated_cursor is not None:
3946
+ if options.cursor is not None:
3947
+ raise ValueError("generated cursor conflicts with query options")
3948
+ options = QueryOptions(cursor=generated_cursor, read_after_commit=options.read_after_commit, consistency=options.consistency)
3949
+ encoded_parameters.pop("after", None)
3950
+ if options.read_after_commit is None and self._read_after_commit is not None:
3951
+ options = QueryOptions(cursor=options.cursor, read_after_commit=self._read_after_commit, consistency=options.consistency)
3952
+ raw = await self._transport._execute_named_query(
3953
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3954
+ contract_bundle_hash=CONTRACT_BUNDLE_HASH, module_hash=QUERY_MODULE_HASH,
3955
+ query_name="FindVerificationsByIdentifier", plan_hash=FIND_VERIFICATIONS_BY_IDENTIFIER_QUERY_PLAN_HASH,
3956
+ parameters=encoded_parameters, options=options,
3957
+ )
3958
+ outcomes = {
3959
+ "Found": FindVerificationsByIdentifierFound,
3960
+ }
3961
+ return raw._map_value(lambda value: decode_variant(outcomes, value))
3962
+
3963
+ async def find_verifications_by_identifier_after_commit(self, parameters: FindVerificationsByIdentifierParams, commit_sequence: int, options: QueryOptions = QueryOptions()) -> TypedQueryResult[FindVerificationsByIdentifierResult]:
3964
+ return await self.find_verifications_by_identifier(parameters, QueryOptions(cursor=options.cursor, read_after_commit=commit_sequence, consistency=options.consistency))
3965
+
3966
+ async def find_verifications_by_identifier_pages(self, parameters: FindVerificationsByIdentifierParams, max_pages: int = 64, options: QueryOptions = QueryOptions()) -> list[TypedQueryResult[FindVerificationsByIdentifierResult]]:
3967
+ if isinstance(max_pages, bool) or not isinstance(max_pages, int) or max_pages < 1 or max_pages > 1024:
3968
+ raise ValueError("max_pages must be an integer from 1 through 1024")
3969
+ if parameters.after is not None and options.cursor is not None:
3970
+ raise ValueError("generated cursor conflicts with query options")
3971
+ cursor = options.cursor if options.cursor is not None else parameters.after
3972
+ pages: list[TypedQueryResult[FindVerificationsByIdentifierResult]] = []
3973
+ for _ in range(max_pages):
3974
+ page_parameters = FindVerificationsByIdentifierParams(organization_id=parameters.organization_id, identifier=parameters.identifier, after=None)
3975
+ page = await self.find_verifications_by_identifier(page_parameters, QueryOptions(cursor=cursor, read_after_commit=options.read_after_commit, consistency=options.consistency))
3976
+ pages.append(page)
3977
+ if not page.next_cursor:
3978
+ break
3979
+ cursor = page.next_cursor
3980
+ return pages
3981
+
3982
+ async def consume_verification(self, input: ConsumeVerificationInput) -> TypedCommandResult[ConsumeVerificationOutcome]:
3983
+ raw = await self._transport._execute_command(
3984
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
3985
+ command_name="ConsumeVerification", plan_hash=CONSUME_VERIFICATION_PLAN_HASH,
3986
+ input=encode_record(input), attempts=self._command_attempts,
3987
+ )
3988
+ outcomes = {
3989
+ "VerificationConsumed": ConsumeVerificationVerificationConsumed,
3990
+ "VerificationConsumeMissing": ConsumeVerificationVerificationConsumeMissing,
3991
+ }
3992
+ result: TypedCommandResult[ConsumeVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
3993
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
3994
+ 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
3995
+ return result
3996
+
3997
+ async def consume_verification_batch(
3998
+ self, inputs: Sequence[ConsumeVerificationInput], options: CommandBatchOptions,
3999
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4000
+ ) -> CommandBatchResult[ConsumeVerificationOutcome]:
4001
+ return await self._transport._command_batch(inputs, options, self.consume_verification, progress)
4002
+
4003
+ async def consume_verification_set(self, input: ConsumeVerificationSetInput) -> TypedCommandResult[ConsumeVerificationSetOutcome]:
4004
+ if not 1 <= len(input.verification_ids) <= 32:
4005
+ raise ValueError("invalid bounded collection length for ConsumeVerificationSet.verification_ids")
4006
+ raw = await self._transport._execute_command(
4007
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4008
+ command_name="ConsumeVerificationSet", plan_hash=CONSUME_VERIFICATION_SET_PLAN_HASH,
4009
+ input=encode_record(input), attempts=self._command_attempts,
4010
+ )
4011
+ outcomes = {
4012
+ "VerificationSetConsumed": ConsumeVerificationSetVerificationSetConsumed,
4013
+ "VerificationConsumeMissing": ConsumeVerificationSetVerificationConsumeMissing,
4014
+ }
4015
+ result: TypedCommandResult[ConsumeVerificationSetOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4016
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4017
+ 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
4018
+ return result
4019
+
4020
+ async def consume_verification_set_batch(
4021
+ self, inputs: Sequence[ConsumeVerificationSetInput], options: CommandBatchOptions,
4022
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4023
+ ) -> CommandBatchResult[ConsumeVerificationSetOutcome]:
4024
+ for input in inputs:
4025
+ if not 1 <= len(input.verification_ids) <= 32:
4026
+ raise ValueError("invalid bounded collection length for ConsumeVerificationSet.verification_ids")
4027
+ return await self._transport._command_batch(inputs, options, self.consume_verification_set, progress)
4028
+
4029
+ async def consume_verification_snapshot(self, input: ConsumeVerificationSnapshotInput) -> TypedCommandResult[ConsumeVerificationSnapshotOutcome]:
4030
+ raw = await self._transport._execute_command(
4031
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4032
+ command_name="ConsumeVerificationSnapshot", plan_hash=CONSUME_VERIFICATION_SNAPSHOT_PLAN_HASH,
4033
+ input=encode_record(input), attempts=self._command_attempts,
4034
+ )
4035
+ outcomes = {
4036
+ "VerificationConsumed": ConsumeVerificationSnapshotVerificationConsumed,
4037
+ "VerificationConsumeStale": ConsumeVerificationSnapshotVerificationConsumeStale,
4038
+ "VerificationConsumeMissing": ConsumeVerificationSnapshotVerificationConsumeMissing,
4039
+ }
4040
+ result: TypedCommandResult[ConsumeVerificationSnapshotOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4041
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4042
+ 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
4043
+ return result
4044
+
4045
+ async def consume_verification_snapshot_batch(
4046
+ self, inputs: Sequence[ConsumeVerificationSnapshotInput], options: CommandBatchOptions,
4047
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4048
+ ) -> CommandBatchResult[ConsumeVerificationSnapshotOutcome]:
4049
+ return await self._transport._command_batch(inputs, options, self.consume_verification_snapshot, progress)
4050
+
4051
+ async def create_account(self, input: CreateAccountInput) -> TypedCommandResult[CreateAccountOutcome]:
4052
+ raw = await self._transport._execute_command(
4053
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4054
+ command_name="CreateAccount", plan_hash=CREATE_ACCOUNT_PLAN_HASH,
4055
+ input=encode_record(input), attempts=self._command_attempts,
4056
+ )
4057
+ outcomes = {
4058
+ "AccountCreated": CreateAccountAccountCreated,
4059
+ "AccountUserMissing": CreateAccountAccountUserMissing,
4060
+ "AccountAlreadyExists": CreateAccountAccountAlreadyExists,
4061
+ }
4062
+ result: TypedCommandResult[CreateAccountOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4063
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4064
+ 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
4065
+ return result
4066
+
4067
+ async def create_account_batch(
4068
+ self, inputs: Sequence[CreateAccountInput], options: CommandBatchOptions,
4069
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4070
+ ) -> CommandBatchResult[CreateAccountOutcome]:
4071
+ return await self._transport._command_batch(inputs, options, self.create_account, progress)
4072
+
4073
+ async def create_oauth_user_graph(self, input: CreateOAuthUserGraphInput) -> TypedCommandResult[CreateOAuthUserGraphOutcome]:
4074
+ raw = await self._transport._execute_command(
4075
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4076
+ command_name="CreateOAuthUserGraph", plan_hash=CREATE_OAUTH_USER_GRAPH_PLAN_HASH,
4077
+ input=encode_record(input), attempts=self._command_attempts,
4078
+ )
4079
+ outcomes = {
4080
+ "OAuthUserExists": CreateOAuthUserGraphOAuthUserExists,
4081
+ "OAuthAccountExists": CreateOAuthUserGraphOAuthAccountExists,
4082
+ "OAuthUserGraphCreated": CreateOAuthUserGraphOAuthUserGraphCreated,
4083
+ }
4084
+ result: TypedCommandResult[CreateOAuthUserGraphOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4085
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4086
+ 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
4087
+ return result
4088
+
4089
+ async def create_oauth_user_graph_batch(
4090
+ self, inputs: Sequence[CreateOAuthUserGraphInput], options: CommandBatchOptions,
4091
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4092
+ ) -> CommandBatchResult[CreateOAuthUserGraphOutcome]:
4093
+ return await self._transport._command_batch(inputs, options, self.create_oauth_user_graph, progress)
4094
+
4095
+ async def create_session(self, input: CreateSessionInput) -> TypedCommandResult[CreateSessionOutcome]:
4096
+ raw = await self._transport._execute_command(
4097
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4098
+ command_name="CreateSession", plan_hash=CREATE_SESSION_PLAN_HASH,
4099
+ input=encode_record(input), attempts=self._command_attempts,
4100
+ )
4101
+ outcomes = {
4102
+ "SessionCreated": CreateSessionSessionCreated,
4103
+ "SessionUserMissing": CreateSessionSessionUserMissing,
4104
+ "SessionAlreadyExists": CreateSessionSessionAlreadyExists,
4105
+ }
4106
+ result: TypedCommandResult[CreateSessionOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4107
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4108
+ 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
4109
+ return result
4110
+
4111
+ async def create_session_batch(
4112
+ self, inputs: Sequence[CreateSessionInput], options: CommandBatchOptions,
4113
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4114
+ ) -> CommandBatchResult[CreateSessionOutcome]:
4115
+ return await self._transport._command_batch(inputs, options, self.create_session, progress)
4116
+
4117
+ async def create_signup_graph(self, input: CreateSignupGraphInput) -> TypedCommandResult[CreateSignupGraphOutcome]:
4118
+ raw = await self._transport._execute_command(
4119
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4120
+ command_name="CreateSignupGraph", plan_hash=CREATE_SIGNUP_GRAPH_PLAN_HASH,
4121
+ input=encode_record(input), attempts=self._command_attempts,
4122
+ )
4123
+ outcomes = {
4124
+ "SignupUserExists": CreateSignupGraphSignupUserExists,
4125
+ "SignupGraphCreated": CreateSignupGraphSignupGraphCreated,
4126
+ "SignupAccountExists": CreateSignupGraphSignupAccountExists,
4127
+ "SignupSessionExists": CreateSignupGraphSignupSessionExists,
4128
+ }
4129
+ result: TypedCommandResult[CreateSignupGraphOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4130
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4131
+ 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
4132
+ return result
4133
+
4134
+ async def create_signup_graph_batch(
4135
+ self, inputs: Sequence[CreateSignupGraphInput], options: CommandBatchOptions,
4136
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4137
+ ) -> CommandBatchResult[CreateSignupGraphOutcome]:
4138
+ return await self._transport._command_batch(inputs, options, self.create_signup_graph, progress)
4139
+
4140
+ async def create_user(self, input: CreateUserInput) -> TypedCommandResult[CreateUserOutcome]:
4141
+ raw = await self._transport._execute_command(
4142
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4143
+ command_name="CreateUser", plan_hash=CREATE_USER_PLAN_HASH,
4144
+ input=encode_record(input), attempts=self._command_attempts,
4145
+ )
4146
+ outcomes = {
4147
+ "UserCreated": CreateUserUserCreated,
4148
+ "UserAlreadyExists": CreateUserUserAlreadyExists,
4149
+ }
4150
+ result: TypedCommandResult[CreateUserOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4151
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4152
+ 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
4153
+ return result
4154
+
4155
+ async def create_user_batch(
4156
+ self, inputs: Sequence[CreateUserInput], options: CommandBatchOptions,
4157
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4158
+ ) -> CommandBatchResult[CreateUserOutcome]:
4159
+ return await self._transport._command_batch(inputs, options, self.create_user, progress)
4160
+
4161
+ async def create_verification(self, input: CreateVerificationInput) -> TypedCommandResult[CreateVerificationOutcome]:
4162
+ raw = await self._transport._execute_command(
4163
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4164
+ command_name="CreateVerification", plan_hash=CREATE_VERIFICATION_PLAN_HASH,
4165
+ input=encode_record(input), attempts=self._command_attempts,
4166
+ )
4167
+ outcomes = {
4168
+ "VerificationCreated": CreateVerificationVerificationCreated,
4169
+ "VerificationAlreadyExists": CreateVerificationVerificationAlreadyExists,
4170
+ }
4171
+ result: TypedCommandResult[CreateVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4172
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4173
+ 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
4174
+ return result
4175
+
4176
+ async def create_verification_batch(
4177
+ self, inputs: Sequence[CreateVerificationInput], options: CommandBatchOptions,
4178
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4179
+ ) -> CommandBatchResult[CreateVerificationOutcome]:
4180
+ return await self._transport._command_batch(inputs, options, self.create_verification, progress)
4181
+
4182
+ async def delete_account(self, input: DeleteAccountInput) -> TypedCommandResult[DeleteAccountOutcome]:
4183
+ if not 1 <= len(input.account_ids) <= 32:
4184
+ raise ValueError("invalid bounded collection length for DeleteAccount.account_ids")
4185
+ raw = await self._transport._execute_command(
4186
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4187
+ command_name="DeleteAccount", plan_hash=DELETE_ACCOUNT_PLAN_HASH,
4188
+ input=encode_record(input), attempts=self._command_attempts,
4189
+ )
4190
+ outcomes = {
4191
+ "AccountDeleted": DeleteAccountAccountDeleted,
4192
+ "AccountMissing": DeleteAccountAccountMissing,
4193
+ }
4194
+ result: TypedCommandResult[DeleteAccountOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4195
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4196
+ 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
4197
+ return result
4198
+
4199
+ async def delete_account_batch(
4200
+ self, inputs: Sequence[DeleteAccountInput], options: CommandBatchOptions,
4201
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4202
+ ) -> CommandBatchResult[DeleteAccountOutcome]:
4203
+ for input in inputs:
4204
+ if not 1 <= len(input.account_ids) <= 32:
4205
+ raise ValueError("invalid bounded collection length for DeleteAccount.account_ids")
4206
+ return await self._transport._command_batch(inputs, options, self.delete_account, progress)
4207
+
4208
+ async def delete_session(self, input: DeleteSessionInput) -> TypedCommandResult[DeleteSessionOutcome]:
4209
+ if not 1 <= len(input.session_ids) <= 32:
4210
+ raise ValueError("invalid bounded collection length for DeleteSession.session_ids")
4211
+ raw = await self._transport._execute_command(
4212
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4213
+ command_name="DeleteSession", plan_hash=DELETE_SESSION_PLAN_HASH,
4214
+ input=encode_record(input), attempts=self._command_attempts,
4215
+ )
4216
+ outcomes = {
4217
+ "SessionDeleted": DeleteSessionSessionDeleted,
4218
+ "SessionMissing": DeleteSessionSessionMissing,
4219
+ }
4220
+ result: TypedCommandResult[DeleteSessionOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4221
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4222
+ 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
4223
+ return result
4224
+
4225
+ async def delete_session_batch(
4226
+ self, inputs: Sequence[DeleteSessionInput], options: CommandBatchOptions,
4227
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4228
+ ) -> CommandBatchResult[DeleteSessionOutcome]:
4229
+ for input in inputs:
4230
+ if not 1 <= len(input.session_ids) <= 32:
4231
+ raise ValueError("invalid bounded collection length for DeleteSession.session_ids")
4232
+ return await self._transport._command_batch(inputs, options, self.delete_session, progress)
4233
+
4234
+ async def delete_user(self, input: DeleteUserInput) -> TypedCommandResult[DeleteUserOutcome]:
4235
+ if not 1 <= len(input.user_ids) <= 1:
4236
+ raise ValueError("invalid bounded collection length for DeleteUser.user_ids")
4237
+ raw = await self._transport._execute_command(
4238
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4239
+ command_name="DeleteUser", plan_hash=DELETE_USER_PLAN_HASH,
4240
+ input=encode_record(input), attempts=self._command_attempts,
4241
+ )
4242
+ outcomes = {
4243
+ "UserDeleted": DeleteUserUserDeleted,
4244
+ "DeleteUserMissing": DeleteUserDeleteUserMissing,
4245
+ "DeleteUserCascadeLimitExceeded": DeleteUserDeleteUserCascadeLimitExceeded,
4246
+ }
4247
+ result: TypedCommandResult[DeleteUserOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4248
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4249
+ 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
4250
+ return result
4251
+
4252
+ async def delete_user_batch(
4253
+ self, inputs: Sequence[DeleteUserInput], options: CommandBatchOptions,
4254
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4255
+ ) -> CommandBatchResult[DeleteUserOutcome]:
4256
+ for input in inputs:
4257
+ if not 1 <= len(input.user_ids) <= 1:
4258
+ raise ValueError("invalid bounded collection length for DeleteUser.user_ids")
4259
+ return await self._transport._command_batch(inputs, options, self.delete_user, progress)
4260
+
4261
+ async def delete_verification(self, input: DeleteVerificationInput) -> TypedCommandResult[DeleteVerificationOutcome]:
4262
+ if not 1 <= len(input.verification_ids) <= 32:
4263
+ raise ValueError("invalid bounded collection length for DeleteVerification.verification_ids")
4264
+ raw = await self._transport._execute_command(
4265
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4266
+ command_name="DeleteVerification", plan_hash=DELETE_VERIFICATION_PLAN_HASH,
4267
+ input=encode_record(input), attempts=self._command_attempts,
4268
+ )
4269
+ outcomes = {
4270
+ "VerificationDeleted": DeleteVerificationVerificationDeleted,
4271
+ "VerificationMissing": DeleteVerificationVerificationMissing,
4272
+ }
4273
+ result: TypedCommandResult[DeleteVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4274
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4275
+ 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
4276
+ return result
4277
+
4278
+ async def delete_verification_batch(
4279
+ self, inputs: Sequence[DeleteVerificationInput], options: CommandBatchOptions,
4280
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4281
+ ) -> CommandBatchResult[DeleteVerificationOutcome]:
4282
+ for input in inputs:
4283
+ if not 1 <= len(input.verification_ids) <= 32:
4284
+ raise ValueError("invalid bounded collection length for DeleteVerification.verification_ids")
4285
+ return await self._transport._command_batch(inputs, options, self.delete_verification, progress)
4286
+
4287
+ async def reset_credential_password(self, input: ResetCredentialPasswordInput) -> TypedCommandResult[ResetCredentialPasswordOutcome]:
4288
+ if not 1 <= len(input.verification_ids) <= 1:
4289
+ raise ValueError("invalid bounded collection length for ResetCredentialPassword.verification_ids")
4290
+ raw = await self._transport._execute_command(
4291
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4292
+ command_name="ResetCredentialPassword", plan_hash=RESET_CREDENTIAL_PASSWORD_PLAN_HASH,
4293
+ input=encode_record(input), attempts=self._command_attempts,
4294
+ )
4295
+ outcomes = {
4296
+ "PasswordAccountStale": ResetCredentialPasswordPasswordAccountStale,
4297
+ "PasswordAccountMissing": ResetCredentialPasswordPasswordAccountMissing,
4298
+ "CredentialPasswordReset": ResetCredentialPasswordCredentialPasswordReset,
4299
+ "PasswordProviderMismatch": ResetCredentialPasswordPasswordProviderMismatch,
4300
+ "VerificationConsumeStale": ResetCredentialPasswordVerificationConsumeStale,
4301
+ "VerificationConsumeMissing": ResetCredentialPasswordVerificationConsumeMissing,
4302
+ }
4303
+ result: TypedCommandResult[ResetCredentialPasswordOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4304
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4305
+ 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
4306
+ return result
4307
+
4308
+ async def reset_credential_password_batch(
4309
+ self, inputs: Sequence[ResetCredentialPasswordInput], options: CommandBatchOptions,
4310
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4311
+ ) -> CommandBatchResult[ResetCredentialPasswordOutcome]:
4312
+ for input in inputs:
4313
+ if not 1 <= len(input.verification_ids) <= 1:
4314
+ raise ValueError("invalid bounded collection length for ResetCredentialPassword.verification_ids")
4315
+ return await self._transport._command_batch(inputs, options, self.reset_credential_password, progress)
4316
+
4317
+ async def update_account(self, input: UpdateAccountInput) -> TypedCommandResult[UpdateAccountOutcome]:
4318
+ raw = await self._transport._execute_command(
4319
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4320
+ command_name="UpdateAccount", plan_hash=UPDATE_ACCOUNT_PLAN_HASH,
4321
+ input=encode_record(input), attempts=self._command_attempts,
4322
+ )
4323
+ outcomes = {
4324
+ "AccountUpdated": UpdateAccountAccountUpdated,
4325
+ "AccountUpdateStale": UpdateAccountAccountUpdateStale,
4326
+ "AccountUpdateMissing": UpdateAccountAccountUpdateMissing,
4327
+ }
4328
+ result: TypedCommandResult[UpdateAccountOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4329
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4330
+ 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
4331
+ return result
4332
+
4333
+ async def update_account_batch(
4334
+ self, inputs: Sequence[UpdateAccountInput], options: CommandBatchOptions,
4335
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4336
+ ) -> CommandBatchResult[UpdateAccountOutcome]:
4337
+ return await self._transport._command_batch(inputs, options, self.update_account, progress)
4338
+
4339
+ async def update_account_passwords(self, input: UpdateAccountPasswordsInput) -> TypedCommandResult[UpdateAccountPasswordsOutcome]:
4340
+ if not 1 <= len(input.updates) <= 8:
4341
+ raise ValueError("invalid bounded collection length for UpdateAccountPasswords.updates")
4342
+ raw = await self._transport._execute_command(
4343
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4344
+ command_name="UpdateAccountPasswords", plan_hash=UPDATE_ACCOUNT_PASSWORDS_PLAN_HASH,
4345
+ input=encode_record(input), attempts=self._command_attempts,
4346
+ )
4347
+ outcomes = {
4348
+ "PasswordAccountStale": UpdateAccountPasswordsPasswordAccountStale,
4349
+ "PasswordAccountMissing": UpdateAccountPasswordsPasswordAccountMissing,
4350
+ "AccountPasswordsUpdated": UpdateAccountPasswordsAccountPasswordsUpdated,
4351
+ "PasswordProviderMismatch": UpdateAccountPasswordsPasswordProviderMismatch,
4352
+ }
4353
+ result: TypedCommandResult[UpdateAccountPasswordsOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4354
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4355
+ 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
4356
+ return result
4357
+
4358
+ async def update_account_passwords_batch(
4359
+ self, inputs: Sequence[UpdateAccountPasswordsInput], options: CommandBatchOptions,
4360
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4361
+ ) -> CommandBatchResult[UpdateAccountPasswordsOutcome]:
4362
+ for input in inputs:
4363
+ if not 1 <= len(input.updates) <= 8:
4364
+ raise ValueError("invalid bounded collection length for UpdateAccountPasswords.updates")
4365
+ return await self._transport._command_batch(inputs, options, self.update_account_passwords, progress)
4366
+
4367
+ async def update_credential_password(self, input: UpdateCredentialPasswordInput) -> TypedCommandResult[UpdateCredentialPasswordOutcome]:
4368
+ raw = await self._transport._execute_command(
4369
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4370
+ command_name="UpdateCredentialPassword", plan_hash=UPDATE_CREDENTIAL_PASSWORD_PLAN_HASH,
4371
+ input=encode_record(input), attempts=self._command_attempts,
4372
+ )
4373
+ outcomes = {
4374
+ "PasswordAccountStale": UpdateCredentialPasswordPasswordAccountStale,
4375
+ "PasswordAccountMissing": UpdateCredentialPasswordPasswordAccountMissing,
4376
+ "PasswordProviderMismatch": UpdateCredentialPasswordPasswordProviderMismatch,
4377
+ "CredentialPasswordUpdated": UpdateCredentialPasswordCredentialPasswordUpdated,
4378
+ }
4379
+ result: TypedCommandResult[UpdateCredentialPasswordOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4380
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4381
+ 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
4382
+ return result
4383
+
4384
+ async def update_credential_password_batch(
4385
+ self, inputs: Sequence[UpdateCredentialPasswordInput], options: CommandBatchOptions,
4386
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4387
+ ) -> CommandBatchResult[UpdateCredentialPasswordOutcome]:
4388
+ return await self._transport._command_batch(inputs, options, self.update_credential_password, progress)
4389
+
4390
+ async def update_session(self, input: UpdateSessionInput) -> TypedCommandResult[UpdateSessionOutcome]:
4391
+ raw = await self._transport._execute_command(
4392
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4393
+ command_name="UpdateSession", plan_hash=UPDATE_SESSION_PLAN_HASH,
4394
+ input=encode_record(input), attempts=self._command_attempts,
4395
+ )
4396
+ outcomes = {
4397
+ "SessionUpdated": UpdateSessionSessionUpdated,
4398
+ "SessionUpdateStale": UpdateSessionSessionUpdateStale,
4399
+ "SessionUpdateMissing": UpdateSessionSessionUpdateMissing,
4400
+ }
4401
+ result: TypedCommandResult[UpdateSessionOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4402
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4403
+ 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
4404
+ return result
4405
+
4406
+ async def update_session_batch(
4407
+ self, inputs: Sequence[UpdateSessionInput], options: CommandBatchOptions,
4408
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4409
+ ) -> CommandBatchResult[UpdateSessionOutcome]:
4410
+ return await self._transport._command_batch(inputs, options, self.update_session, progress)
4411
+
4412
+ async def update_user(self, input: UpdateUserInput) -> TypedCommandResult[UpdateUserOutcome]:
4413
+ raw = await self._transport._execute_command(
4414
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4415
+ command_name="UpdateUser", plan_hash=UPDATE_USER_PLAN_HASH,
4416
+ input=encode_record(input), attempts=self._command_attempts,
4417
+ )
4418
+ outcomes = {
4419
+ "UserUpdated": UpdateUserUserUpdated,
4420
+ "UserUpdateStale": UpdateUserUserUpdateStale,
4421
+ "UserUpdateMissing": UpdateUserUserUpdateMissing,
4422
+ }
4423
+ result: TypedCommandResult[UpdateUserOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4424
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4425
+ 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
4426
+ return result
4427
+
4428
+ async def update_user_batch(
4429
+ self, inputs: Sequence[UpdateUserInput], options: CommandBatchOptions,
4430
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4431
+ ) -> CommandBatchResult[UpdateUserOutcome]:
4432
+ return await self._transport._command_batch(inputs, options, self.update_user, progress)
4433
+
4434
+ async def update_verification(self, input: UpdateVerificationInput) -> TypedCommandResult[UpdateVerificationOutcome]:
4435
+ raw = await self._transport._execute_command(
4436
+ contract_lineage=CONTRACT_LINEAGE, contract_version=CONTRACT_VERSION,
4437
+ command_name="UpdateVerification", plan_hash=UPDATE_VERIFICATION_PLAN_HASH,
4438
+ input=encode_record(input), attempts=self._command_attempts,
4439
+ )
4440
+ outcomes = {
4441
+ "VerificationUpdated": UpdateVerificationVerificationUpdated,
4442
+ "VerificationUpdateStale": UpdateVerificationVerificationUpdateStale,
4443
+ "VerificationUpdateMissing": UpdateVerificationVerificationUpdateMissing,
4444
+ }
4445
+ result: TypedCommandResult[UpdateVerificationOutcome] = raw._map_outcome(lambda value: decode_variant(outcomes, value))
4446
+ if self._track_causal_writes and result.commit_sequence is not None and result.commit_sequence > 0:
4447
+ 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
4448
+ return result
4449
+
4450
+ async def update_verification_batch(
4451
+ self, inputs: Sequence[UpdateVerificationInput], options: CommandBatchOptions,
4452
+ progress: Callable[[CommandBatchProgress], None] | None = None,
4453
+ ) -> CommandBatchResult[UpdateVerificationOutcome]:
4454
+ return await self._transport._command_batch(inputs, options, self.update_verification, progress)