@@ -23,18 +23,156 @@ const being_deleted = common_access_method_warning
2323 'Indicates that the [access method](https://docs.seam.co/latest/capability-guides/access-grants/delivering-access-methods) is being deleted.' ,
2424 )
2525
26+ const updating_access_times_warning = common_access_method_warning
27+ . extend ( {
28+ warning_code : z
29+ . literal ( 'updating_access_times' )
30+ . describe ( warning_code_description ) ,
31+ } )
32+ . describe (
33+ 'Indicates that the access times for this [access method](https://docs.seam.co/latest/capability-guides/access-grants/delivering-access-methods) are being updated.' ,
34+ )
35+
2636const access_method_warning = z
27- . discriminatedUnion ( 'warning_code' , [ being_deleted ] )
37+ . discriminatedUnion ( 'warning_code' , [
38+ being_deleted ,
39+ updating_access_times_warning ,
40+ ] )
2841 . describe (
2942 'Warning associated with the [access method](https://docs.seam.co/latest/capability-guides/access-grants/delivering-access-methods).' ,
3043 )
3144
3245const _access_method_warning_map = z . object ( {
3346 being_deleted : being_deleted . optional ( ) . nullable ( ) ,
47+ updating_access_times : updating_access_times_warning . optional ( ) . nullable ( ) ,
3448} )
3549
3650export type AccessMethodWarningMap = z . infer < typeof _access_method_warning_map >
3751
52+ // Pending mutations for access methods
53+ const common_pending_mutation = z . object ( {
54+ created_at : z
55+ . string ( )
56+ . datetime ( )
57+ . describe ( 'Date and time at which the mutation was created.' ) ,
58+ message : z . string ( ) . describe ( 'Detailed description of the mutation.' ) ,
59+ } )
60+
61+ const provisioning_access_mutation = common_pending_mutation
62+ . extend ( {
63+ mutation_code : z
64+ . literal ( 'provisioning_access' )
65+ . describe (
66+ 'Mutation code to indicate that Seam is in the process of provisioning access for this access method on new devices.' ,
67+ ) ,
68+ from : z
69+ . object ( {
70+ device_ids : z
71+ . array ( z . string ( ) . uuid ( ) )
72+ . describe ( 'Previous device IDs where access was provisioned.' ) ,
73+ } )
74+ . describe ( 'Previous device configuration.' ) ,
75+ to : z
76+ . object ( {
77+ device_ids : z
78+ . array ( z . string ( ) . uuid ( ) )
79+ . describe ( 'New device IDs where access is being provisioned.' ) ,
80+ } )
81+ . describe ( 'New device configuration.' ) ,
82+ } )
83+ . describe (
84+ 'Seam is in the process of provisioning access for this access method on new devices.' ,
85+ )
86+
87+ const revoking_access_mutation = common_pending_mutation
88+ . extend ( {
89+ mutation_code : z
90+ . literal ( 'revoking_access' )
91+ . describe (
92+ 'Mutation code to indicate that Seam is in the process of revoking access for this access method from devices.' ,
93+ ) ,
94+ from : z
95+ . object ( {
96+ device_ids : z
97+ . array ( z . string ( ) . uuid ( ) )
98+ . describe ( 'Previous device IDs where access existed.' ) ,
99+ } )
100+ . describe ( 'Previous device configuration.' ) ,
101+ to : z
102+ . object ( {
103+ device_ids : z
104+ . array ( z . string ( ) . uuid ( ) )
105+ . describe ( 'New device IDs where access should remain.' ) ,
106+ } )
107+ . describe ( 'New device configuration.' ) ,
108+ } )
109+ . describe (
110+ 'Seam is in the process of revoking access for this access method from devices.' ,
111+ )
112+
113+ const updating_access_times_mutation = common_pending_mutation
114+ . extend ( {
115+ mutation_code : z
116+ . literal ( 'updating_access_times' )
117+ . describe (
118+ 'Mutation code to indicate that Seam is in the process of updating the access times for this access method.' ,
119+ ) ,
120+ from : z
121+ . object ( {
122+ starts_at : z
123+ . string ( )
124+ . datetime ( )
125+ . nullable ( )
126+ . describe ( 'Previous start time for access.' ) ,
127+ ends_at : z
128+ . string ( )
129+ . datetime ( )
130+ . nullable ( )
131+ . describe ( 'Previous end time for access.' ) ,
132+ } )
133+ . describe ( 'Previous access time configuration.' ) ,
134+ to : z
135+ . object ( {
136+ starts_at : z
137+ . string ( )
138+ . datetime ( )
139+ . nullable ( )
140+ . describe ( 'New start time for access.' ) ,
141+ ends_at : z
142+ . string ( )
143+ . datetime ( )
144+ . nullable ( )
145+ . describe ( 'New end time for access.' ) ,
146+ } )
147+ . describe ( 'New access time configuration.' ) ,
148+ } )
149+ . describe (
150+ 'Seam is in the process of updating the access times for this access method.' ,
151+ )
152+
153+ export const access_method_pending_mutations = z . discriminatedUnion (
154+ 'mutation_code' ,
155+ [
156+ provisioning_access_mutation ,
157+ revoking_access_mutation ,
158+ updating_access_times_mutation ,
159+ ] ,
160+ )
161+
162+ export type AccessMethodPendingMutation = z . infer <
163+ typeof access_method_pending_mutations
164+ >
165+
166+ const _access_method_pending_mutations_map = z . object ( {
167+ provisioning_access : provisioning_access_mutation . optional ( ) . nullable ( ) ,
168+ revoking_access : revoking_access_mutation . optional ( ) . nullable ( ) ,
169+ updating_access_times : updating_access_times_mutation . optional ( ) . nullable ( ) ,
170+ } )
171+
172+ export type AccessMethodPendingMutationsMap = z . infer <
173+ typeof _access_method_pending_mutations_map
174+ >
175+
38176export const access_method = z . object ( {
39177 workspace_id : z
40178 . string ( )
@@ -84,6 +222,11 @@ export const access_method = z.object({
84222 . describe (
85223 'Warnings associated with the [access method](https://docs.seam.co/latest/capability-guides/access-grants/delivering-access-methods).' ,
86224 ) ,
225+ pending_mutations : z
226+ . array ( access_method_pending_mutations )
227+ . describe (
228+ 'Pending mutations for the [access method](https://docs.seam.co/latest/capability-guides/access-grants/delivering-access-methods). Indicates operations that are in progress.' ,
229+ ) ,
87230 customization_profile_id : z
88231 . string ( )
89232 . uuid ( )
0 commit comments