zitadel-with-serde 0.1.1-alpha.6

An implementation of ZITADEL API access and authentication in Rust. Now with support for serde for easy JSON serialization and deserialization.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
// @generated
// This file is @generated by prost-build.
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProjectGrant {
    /// The unique identifier of the organization which granted the project to the granted_organization_id.
    #[prost(string, tag="2")]
    pub organization_id: ::prost::alloc::string::String,
    /// The timestamp of the granted project creation.
    #[prost(message, optional, tag="3")]
    pub creation_date: ::core::option::Option<::pbjson_types::Timestamp>,
    /// The timestamp of the last change to the granted project (e.g. creation, activation, deactivation).
    #[prost(message, optional, tag="4")]
    pub change_date: ::core::option::Option<::pbjson_types::Timestamp>,
    /// The ID of the organization the project is granted to.
    #[prost(string, tag="5")]
    pub granted_organization_id: ::prost::alloc::string::String,
    /// The name of the organization the project is granted to.
    #[prost(string, tag="6")]
    pub granted_organization_name: ::prost::alloc::string::String,
    /// The roles of the granted project.
    #[prost(string, repeated, tag="7")]
    pub granted_role_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// The ID of the granted project.
    #[prost(string, tag="8")]
    pub project_id: ::prost::alloc::string::String,
    /// The name of the granted project.
    #[prost(string, tag="9")]
    pub project_name: ::prost::alloc::string::String,
    /// Describes the current state of the granted project.
    #[prost(enumeration="ProjectGrantState", tag="10")]
    pub state: i32,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Project {
    /// The unique identifier of the project.
    #[prost(string, tag="1")]
    pub id: ::prost::alloc::string::String,
    /// The unique identifier of the organization the project belongs to.
    #[prost(string, tag="2")]
    pub organization_id: ::prost::alloc::string::String,
    /// The timestamp of the project creation.
    #[prost(message, optional, tag="3")]
    pub creation_date: ::core::option::Option<::pbjson_types::Timestamp>,
    /// The timestamp of the last change to the project (e.g. creation, activation, deactivation).
    #[prost(message, optional, tag="4")]
    pub change_date: ::core::option::Option<::pbjson_types::Timestamp>,
    /// The name of the project.
    #[prost(string, tag="5")]
    pub name: ::prost::alloc::string::String,
    /// Describes the current state of the project.
    #[prost(enumeration="ProjectState", tag="6")]
    pub state: i32,
    /// Describes if the roles of the user should be added to the token.
    #[prost(bool, tag="7")]
    pub project_role_assertion: bool,
    /// When enabled ZITADEL will check if a user has an authorization to use this project assigned when login into an application of this project.
    #[prost(bool, tag="8")]
    pub authorization_required: bool,
    /// When enabled ZITADEL will check if the organization of the user, that is trying to log in, has access to this project (either owns the project or is granted).
    #[prost(bool, tag="9")]
    pub project_access_required: bool,
    /// Defines from where the private labeling should be triggered.
    #[prost(enumeration="PrivateLabelingSetting", tag="10")]
    pub private_labeling_setting: i32,
    /// The ID of the organization the project is granted to.
    #[prost(string, optional, tag="12")]
    pub granted_organization_id: ::core::option::Option<::prost::alloc::string::String>,
    /// The name of the organization the project is granted to.
    #[prost(string, optional, tag="13")]
    pub granted_organization_name: ::core::option::Option<::prost::alloc::string::String>,
    /// Describes the current state of the granted project.
    #[prost(enumeration="GrantedProjectState", tag="14")]
    pub granted_state: i32,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProjectSearchFilter {
    #[prost(oneof="project_search_filter::Filter", tags="1, 2, 3, 4, 5")]
    pub filter: ::core::option::Option<project_search_filter::Filter>,
}
/// Nested message and enum types in `ProjectSearchFilter`.
pub mod project_search_filter {
    #[derive(::serde::Serialize, ::serde::Deserialize)]
    #[serde(crate = "serde", rename_all = "snake_case")]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Filter {
        #[prost(message, tag="1")]
        ProjectNameFilter(super::ProjectNameFilter),
        #[prost(message, tag="2")]
        InProjectIdsFilter(super::super::super::filter::v2beta::InIDsFilter),
        #[prost(message, tag="3")]
        ProjectResourceOwnerFilter(super::super::super::filter::v2beta::IdFilter),
        #[prost(message, tag="4")]
        ProjectGrantResourceOwnerFilter(super::super::super::filter::v2beta::IdFilter),
        #[prost(message, tag="5")]
        ProjectOrganizationIdFilter(super::super::super::filter::v2beta::IdFilter),
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProjectNameFilter {
    /// Defines the name of the project to query for.
    #[prost(string, tag="1")]
    pub project_name: ::prost::alloc::string::String,
    /// Defines which text comparison method used for the name query.
    #[prost(enumeration="super::super::filter::v2beta::TextFilterMethod", tag="2")]
    pub method: i32,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProjectGrantSearchFilter {
    #[prost(oneof="project_grant_search_filter::Filter", tags="1, 2, 3, 4, 5")]
    pub filter: ::core::option::Option<project_grant_search_filter::Filter>,
}
/// Nested message and enum types in `ProjectGrantSearchFilter`.
pub mod project_grant_search_filter {
    #[derive(::serde::Serialize, ::serde::Deserialize)]
    #[serde(crate = "serde", rename_all = "snake_case")]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Filter {
        #[prost(message, tag="1")]
        ProjectNameFilter(super::ProjectNameFilter),
        #[prost(message, tag="2")]
        RoleKeyFilter(super::ProjectRoleKeyFilter),
        #[prost(message, tag="3")]
        InProjectIdsFilter(super::super::super::filter::v2beta::InIDsFilter),
        #[prost(message, tag="4")]
        ProjectResourceOwnerFilter(super::super::super::filter::v2beta::IdFilter),
        #[prost(message, tag="5")]
        ProjectGrantResourceOwnerFilter(super::super::super::filter::v2beta::IdFilter),
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProjectRole {
    /// ID of the project.
    #[prost(string, tag="1")]
    pub project_id: ::prost::alloc::string::String,
    /// Key of the project role.
    #[prost(string, tag="2")]
    pub key: ::prost::alloc::string::String,
    /// The timestamp of the project role creation.
    #[prost(message, optional, tag="3")]
    pub creation_date: ::core::option::Option<::pbjson_types::Timestamp>,
    /// The timestamp of the last change to the project role.
    #[prost(message, optional, tag="4")]
    pub change_date: ::core::option::Option<::pbjson_types::Timestamp>,
    /// Display name of the project role.
    #[prost(string, tag="5")]
    pub display_name: ::prost::alloc::string::String,
    /// Group of the project role.
    #[prost(string, tag="6")]
    pub group: ::prost::alloc::string::String,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProjectRoleSearchFilter {
    #[prost(oneof="project_role_search_filter::Filter", tags="1, 2")]
    pub filter: ::core::option::Option<project_role_search_filter::Filter>,
}
/// Nested message and enum types in `ProjectRoleSearchFilter`.
pub mod project_role_search_filter {
    #[derive(::serde::Serialize, ::serde::Deserialize)]
    #[serde(crate = "serde", rename_all = "snake_case")]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Filter {
        #[prost(message, tag="1")]
        RoleKeyFilter(super::ProjectRoleKeyFilter),
        #[prost(message, tag="2")]
        DisplayNameFilter(super::ProjectRoleDisplayNameFilter),
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProjectRoleKeyFilter {
    #[prost(string, tag="1")]
    pub key: ::prost::alloc::string::String,
    /// Defines which text comparison method used for the name query.
    #[prost(enumeration="super::super::filter::v2beta::TextFilterMethod", tag="2")]
    pub method: i32,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProjectRoleDisplayNameFilter {
    #[prost(string, tag="1")]
    pub display_name: ::prost::alloc::string::String,
    /// Defines which text comparison method used for the name query.
    #[prost(enumeration="super::super::filter::v2beta::TextFilterMethod", tag="2")]
    pub method: i32,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProjectGrantState {
    Unspecified = 0,
    Active = 1,
    Inactive = 2,
}
impl ProjectGrantState {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "PROJECT_GRANT_STATE_UNSPECIFIED",
            Self::Active => "PROJECT_GRANT_STATE_ACTIVE",
            Self::Inactive => "PROJECT_GRANT_STATE_INACTIVE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PROJECT_GRANT_STATE_UNSPECIFIED" => Some(Self::Unspecified),
            "PROJECT_GRANT_STATE_ACTIVE" => Some(Self::Active),
            "PROJECT_GRANT_STATE_INACTIVE" => Some(Self::Inactive),
            _ => None,
        }
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProjectState {
    Unspecified = 0,
    Active = 1,
    Inactive = 2,
}
impl ProjectState {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "PROJECT_STATE_UNSPECIFIED",
            Self::Active => "PROJECT_STATE_ACTIVE",
            Self::Inactive => "PROJECT_STATE_INACTIVE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PROJECT_STATE_UNSPECIFIED" => Some(Self::Unspecified),
            "PROJECT_STATE_ACTIVE" => Some(Self::Active),
            "PROJECT_STATE_INACTIVE" => Some(Self::Inactive),
            _ => None,
        }
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum GrantedProjectState {
    Unspecified = 0,
    Active = 1,
    Inactive = 2,
}
impl GrantedProjectState {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "GRANTED_PROJECT_STATE_UNSPECIFIED",
            Self::Active => "GRANTED_PROJECT_STATE_ACTIVE",
            Self::Inactive => "GRANTED_PROJECT_STATE_INACTIVE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "GRANTED_PROJECT_STATE_UNSPECIFIED" => Some(Self::Unspecified),
            "GRANTED_PROJECT_STATE_ACTIVE" => Some(Self::Active),
            "GRANTED_PROJECT_STATE_INACTIVE" => Some(Self::Inactive),
            _ => None,
        }
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PrivateLabelingSetting {
    Unspecified = 0,
    EnforceProjectResourceOwnerPolicy = 1,
    AllowLoginUserResourceOwnerPolicy = 2,
}
impl PrivateLabelingSetting {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "PRIVATE_LABELING_SETTING_UNSPECIFIED",
            Self::EnforceProjectResourceOwnerPolicy => "PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY",
            Self::AllowLoginUserResourceOwnerPolicy => "PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PRIVATE_LABELING_SETTING_UNSPECIFIED" => Some(Self::Unspecified),
            "PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY" => Some(Self::EnforceProjectResourceOwnerPolicy),
            "PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY" => Some(Self::AllowLoginUserResourceOwnerPolicy),
            _ => None,
        }
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProjectFieldName {
    Unspecified = 0,
    Id = 1,
    CreationDate = 2,
    ChangeDate = 3,
    Name = 4,
}
impl ProjectFieldName {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "PROJECT_FIELD_NAME_UNSPECIFIED",
            Self::Id => "PROJECT_FIELD_NAME_ID",
            Self::CreationDate => "PROJECT_FIELD_NAME_CREATION_DATE",
            Self::ChangeDate => "PROJECT_FIELD_NAME_CHANGE_DATE",
            Self::Name => "PROJECT_FIELD_NAME_NAME",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PROJECT_FIELD_NAME_UNSPECIFIED" => Some(Self::Unspecified),
            "PROJECT_FIELD_NAME_ID" => Some(Self::Id),
            "PROJECT_FIELD_NAME_CREATION_DATE" => Some(Self::CreationDate),
            "PROJECT_FIELD_NAME_CHANGE_DATE" => Some(Self::ChangeDate),
            "PROJECT_FIELD_NAME_NAME" => Some(Self::Name),
            _ => None,
        }
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProjectGrantFieldName {
    Unspecified = 0,
    ProjectId = 1,
    CreationDate = 2,
    ChangeDate = 3,
}
impl ProjectGrantFieldName {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "PROJECT_GRANT_FIELD_NAME_UNSPECIFIED",
            Self::ProjectId => "PROJECT_GRANT_FIELD_NAME_PROJECT_ID",
            Self::CreationDate => "PROJECT_GRANT_FIELD_NAME_CREATION_DATE",
            Self::ChangeDate => "PROJECT_GRANT_FIELD_NAME_CHANGE_DATE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PROJECT_GRANT_FIELD_NAME_UNSPECIFIED" => Some(Self::Unspecified),
            "PROJECT_GRANT_FIELD_NAME_PROJECT_ID" => Some(Self::ProjectId),
            "PROJECT_GRANT_FIELD_NAME_CREATION_DATE" => Some(Self::CreationDate),
            "PROJECT_GRANT_FIELD_NAME_CHANGE_DATE" => Some(Self::ChangeDate),
            _ => None,
        }
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProjectRoleFieldName {
    Unspecified = 0,
    Key = 1,
    CreationDate = 2,
    ChangeDate = 3,
}
impl ProjectRoleFieldName {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "PROJECT_ROLE_FIELD_NAME_UNSPECIFIED",
            Self::Key => "PROJECT_ROLE_FIELD_NAME_KEY",
            Self::CreationDate => "PROJECT_ROLE_FIELD_NAME_CREATION_DATE",
            Self::ChangeDate => "PROJECT_ROLE_FIELD_NAME_CHANGE_DATE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PROJECT_ROLE_FIELD_NAME_UNSPECIFIED" => Some(Self::Unspecified),
            "PROJECT_ROLE_FIELD_NAME_KEY" => Some(Self::Key),
            "PROJECT_ROLE_FIELD_NAME_CREATION_DATE" => Some(Self::CreationDate),
            "PROJECT_ROLE_FIELD_NAME_CHANGE_DATE" => Some(Self::ChangeDate),
            _ => None,
        }
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateProjectRequest {
    /// The unique identifier of the organization the project belongs to.
    #[prost(string, tag="1")]
    pub organization_id: ::prost::alloc::string::String,
    /// The unique identifier of the project.
    #[prost(string, optional, tag="2")]
    pub id: ::core::option::Option<::prost::alloc::string::String>,
    /// Name of the project.
    #[prost(string, tag="3")]
    pub name: ::prost::alloc::string::String,
    /// Enable this setting to have role information included in the user info endpoint. It is also dependent on your application settings to include it in tokens and other types.
    #[prost(bool, tag="4")]
    pub project_role_assertion: bool,
    /// When enabled ZITADEL will check if a user has an authorization to use this project assigned when login into an application of this project.
    #[prost(bool, tag="5")]
    pub authorization_required: bool,
    /// When enabled ZITADEL will check if the organization of the user, that is trying to log in, has access to this project (either owns the project or is granted).
    #[prost(bool, tag="6")]
    pub project_access_required: bool,
    /// Define which private labeling/branding should trigger when getting to a login of this project.
    #[prost(enumeration="PrivateLabelingSetting", tag="7")]
    pub private_labeling_setting: i32,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateProjectResponse {
    /// The unique identifier of the newly created project.
    #[prost(string, tag="1")]
    pub id: ::prost::alloc::string::String,
    /// The timestamp of the project creation.
    #[prost(message, optional, tag="2")]
    pub creation_date: ::core::option::Option<::pbjson_types::Timestamp>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateProjectRequest {
    #[prost(string, tag="1")]
    pub id: ::prost::alloc::string::String,
    /// Name of the project.
    #[prost(string, optional, tag="2")]
    pub name: ::core::option::Option<::prost::alloc::string::String>,
    /// Enable this setting to have role information included in the user info endpoint. It is also dependent on your application settings to include it in tokens and other types.
    #[prost(bool, optional, tag="3")]
    pub project_role_assertion: ::core::option::Option<bool>,
    /// When enabled ZITADEL will check if a user has a role of this project assigned when login into an application of this project.
    #[prost(bool, optional, tag="4")]
    pub project_role_check: ::core::option::Option<bool>,
    /// When enabled ZITADEL will check if the organization of the user, that is trying to log in, has a grant to this project.
    #[prost(bool, optional, tag="5")]
    pub has_project_check: ::core::option::Option<bool>,
    /// Define which private labeling/branding should trigger when getting to a login of this project.
    #[prost(enumeration="PrivateLabelingSetting", optional, tag="6")]
    pub private_labeling_setting: ::core::option::Option<i32>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UpdateProjectResponse {
    /// The timestamp of the change of the project.
    #[prost(message, optional, tag="1")]
    pub change_date: ::core::option::Option<::pbjson_types::Timestamp>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteProjectRequest {
    /// The unique identifier of the project.
    #[prost(string, tag="1")]
    pub id: ::prost::alloc::string::String,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteProjectResponse {
    /// The timestamp of the deletion of the project.
    /// Note that the deletion date is only guaranteed to be set if the deletion was successful during the request.
    /// In case the deletion occurred in a previous request, the deletion date might be empty.
    #[prost(message, optional, tag="3")]
    pub deletion_date: ::core::option::Option<::pbjson_types::Timestamp>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetProjectRequest {
    /// The unique identifier of the project.
    #[prost(string, tag="1")]
    pub id: ::prost::alloc::string::String,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetProjectResponse {
    #[prost(message, optional, tag="1")]
    pub project: ::core::option::Option<Project>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListProjectsRequest {
    /// List limitations and ordering.
    #[prost(message, optional, tag="1")]
    pub pagination: ::core::option::Option<super::super::filter::v2beta::PaginationRequest>,
    /// The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent.
    #[prost(enumeration="ProjectFieldName", optional, tag="2")]
    pub sorting_column: ::core::option::Option<i32>,
    /// Define the criteria to query for.
    #[prost(message, repeated, tag="3")]
    pub filters: ::prost::alloc::vec::Vec<ProjectSearchFilter>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListProjectsResponse {
    #[prost(message, optional, tag="1")]
    pub pagination: ::core::option::Option<super::super::filter::v2beta::PaginationResponse>,
    #[prost(message, repeated, tag="2")]
    pub projects: ::prost::alloc::vec::Vec<Project>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeactivateProjectRequest {
    /// The unique identifier of the project.
    #[prost(string, tag="1")]
    pub id: ::prost::alloc::string::String,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeactivateProjectResponse {
    /// The timestamp of the change of the project.
    #[prost(message, optional, tag="1")]
    pub change_date: ::core::option::Option<::pbjson_types::Timestamp>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActivateProjectRequest {
    /// The unique identifier of the project.
    #[prost(string, tag="1")]
    pub id: ::prost::alloc::string::String,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ActivateProjectResponse {
    /// The timestamp of the change of the project.
    #[prost(message, optional, tag="1")]
    pub change_date: ::core::option::Option<::pbjson_types::Timestamp>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddProjectRoleRequest {
    /// ID of the project.
    #[prost(string, tag="1")]
    pub project_id: ::prost::alloc::string::String,
    /// The key is the only relevant attribute for ZITADEL regarding the authorization checks.
    #[prost(string, tag="2")]
    pub role_key: ::prost::alloc::string::String,
    /// Name displayed for the role.
    #[prost(string, tag="3")]
    pub display_name: ::prost::alloc::string::String,
    /// The group is only used for display purposes. That you have better handling, like giving all the roles from a group to a user.
    #[prost(string, optional, tag="4")]
    pub group: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AddProjectRoleResponse {
    /// The timestamp of the project role creation.
    #[prost(message, optional, tag="2")]
    pub creation_date: ::core::option::Option<::pbjson_types::Timestamp>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateProjectRoleRequest {
    /// ID of the project.
    #[prost(string, tag="1")]
    pub project_id: ::prost::alloc::string::String,
    /// The key is the only relevant attribute for ZITADEL regarding the authorization checks.
    #[prost(string, tag="2")]
    pub role_key: ::prost::alloc::string::String,
    /// Name displayed for the role.
    #[prost(string, optional, tag="3")]
    pub display_name: ::core::option::Option<::prost::alloc::string::String>,
    /// The group is only used for display purposes. That you have better handling, like giving all the roles from a group to a user.
    #[prost(string, optional, tag="4")]
    pub group: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UpdateProjectRoleResponse {
    /// The timestamp of the change of the project role.
    #[prost(message, optional, tag="1")]
    pub change_date: ::core::option::Option<::pbjson_types::Timestamp>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoveProjectRoleRequest {
    /// ID of the project.
    #[prost(string, tag="1")]
    pub project_id: ::prost::alloc::string::String,
    /// The key is the only relevant attribute for ZITADEL regarding the authorization checks.
    #[prost(string, tag="2")]
    pub role_key: ::prost::alloc::string::String,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RemoveProjectRoleResponse {
    /// The timestamp of the removal of the project role.
    /// Note that the removal date is only guaranteed to be set if the removal was successful during the request.
    /// In case the removal occurred in a previous request, the removal date might be empty.
    #[prost(message, optional, tag="3")]
    pub removal_date: ::core::option::Option<::pbjson_types::Timestamp>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListProjectRolesRequest {
    /// ID of the project.
    #[prost(string, tag="1")]
    pub project_id: ::prost::alloc::string::String,
    /// List limitations and ordering.
    #[prost(message, optional, tag="2")]
    pub pagination: ::core::option::Option<super::super::filter::v2beta::PaginationRequest>,
    /// The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent.
    #[prost(enumeration="ProjectRoleFieldName", optional, tag="3")]
    pub sorting_column: ::core::option::Option<i32>,
    /// Define the criteria to query for.
    #[prost(message, repeated, tag="4")]
    pub filters: ::prost::alloc::vec::Vec<ProjectRoleSearchFilter>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListProjectRolesResponse {
    #[prost(message, optional, tag="1")]
    pub pagination: ::core::option::Option<super::super::filter::v2beta::PaginationResponse>,
    #[prost(message, repeated, tag="2")]
    pub project_roles: ::prost::alloc::vec::Vec<ProjectRole>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateProjectGrantRequest {
    /// ID of the project.
    #[prost(string, tag="1")]
    pub project_id: ::prost::alloc::string::String,
    /// Organization the project is granted to.
    #[prost(string, tag="2")]
    pub granted_organization_id: ::prost::alloc::string::String,
    /// Keys of the role available for the project grant.
    #[prost(string, repeated, tag="3")]
    pub role_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CreateProjectGrantResponse {
    /// The timestamp of the project grant creation.
    #[prost(message, optional, tag="1")]
    pub creation_date: ::core::option::Option<::pbjson_types::Timestamp>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateProjectGrantRequest {
    /// ID of the project.
    #[prost(string, tag="1")]
    pub project_id: ::prost::alloc::string::String,
    /// Organization the project is granted to.
    #[prost(string, tag="2")]
    pub granted_organization_id: ::prost::alloc::string::String,
    /// Keys of the role available for the project grant.
    #[prost(string, repeated, tag="3")]
    pub role_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UpdateProjectGrantResponse {
    /// The timestamp of the change of the project grant.
    #[prost(message, optional, tag="1")]
    pub change_date: ::core::option::Option<::pbjson_types::Timestamp>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteProjectGrantRequest {
    /// ID of the project.
    #[prost(string, tag="1")]
    pub project_id: ::prost::alloc::string::String,
    /// Organization the project is granted to.
    #[prost(string, tag="2")]
    pub granted_organization_id: ::prost::alloc::string::String,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteProjectGrantResponse {
    /// The timestamp of the deletion of the project grant.
    /// Note that the deletion date is only guaranteed to be set if the deletion was successful during the request.
    /// In case the deletion occurred in a previous request, the deletion date might be empty.
    #[prost(message, optional, tag="3")]
    pub deletion_date: ::core::option::Option<::pbjson_types::Timestamp>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeactivateProjectGrantRequest {
    /// ID of the project.
    #[prost(string, tag="1")]
    pub project_id: ::prost::alloc::string::String,
    /// Organization the project is granted to.
    #[prost(string, tag="2")]
    pub granted_organization_id: ::prost::alloc::string::String,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeactivateProjectGrantResponse {
    /// The timestamp of the change of the project grant.
    #[prost(message, optional, tag="1")]
    pub change_date: ::core::option::Option<::pbjson_types::Timestamp>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActivateProjectGrantRequest {
    /// ID of the project.
    #[prost(string, tag="1")]
    pub project_id: ::prost::alloc::string::String,
    /// Organization the project is granted to.
    #[prost(string, tag="2")]
    pub granted_organization_id: ::prost::alloc::string::String,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ActivateProjectGrantResponse {
    /// The timestamp of the change of the project grant.
    #[prost(message, optional, tag="1")]
    pub change_date: ::core::option::Option<::pbjson_types::Timestamp>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListProjectGrantsRequest {
    /// List limitations and ordering.
    #[prost(message, optional, tag="1")]
    pub pagination: ::core::option::Option<super::super::filter::v2beta::PaginationRequest>,
    /// The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent.
    #[prost(enumeration="ProjectGrantFieldName", optional, tag="2")]
    pub sorting_column: ::core::option::Option<i32>,
    /// Define the criteria to query for.
    #[prost(message, repeated, tag="3")]
    pub filters: ::prost::alloc::vec::Vec<ProjectGrantSearchFilter>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListProjectGrantsResponse {
    #[prost(message, optional, tag="1")]
    pub pagination: ::core::option::Option<super::super::filter::v2beta::PaginationResponse>,
    #[prost(message, repeated, tag="2")]
    pub project_grants: ::prost::alloc::vec::Vec<ProjectGrant>,
}
include!("zitadel.project.v2beta.tonic.rs");
// @@protoc_insertion_point(module)