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
// @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 GetUserSchema {
    /// Details provide some base information (such as the last change date) of the schema.
    #[prost(message, optional, tag="1")]
    pub details: ::core::option::Option<super::super::object::v3alpha::Details>,
    #[prost(message, optional, tag="2")]
    pub config: ::core::option::Option<UserSchema>,
    /// Current state of the schema.
    #[prost(enumeration="State", tag="3")]
    pub state: i32,
    /// Revision is a read only version of the schema, each update of the `schema`-field increases the revision.
    #[prost(uint32, tag="4")]
    pub revision: u32,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserSchema {
    /// Type is a human readable word describing the schema.
    #[prost(string, tag="1")]
    pub r#type: ::prost::alloc::string::String,
    /// Defines the possible types of authenticators.
    #[prost(enumeration="AuthenticatorType", repeated, packed="false", tag="3")]
    pub possible_authenticators: ::prost::alloc::vec::Vec<i32>,
    #[prost(oneof="user_schema::DataType", tags="2")]
    pub data_type: ::core::option::Option<user_schema::DataType>,
}
/// Nested message and enum types in `UserSchema`.
pub mod user_schema {
    #[derive(::serde::Serialize, ::serde::Deserialize)]
    #[serde(crate = "serde", rename_all = "snake_case")]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum DataType {
        /// JSON schema representation defining the user.
        #[prost(message, tag="2")]
        Schema(::pbjson_types::Struct),
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PatchUserSchema {
    /// Type is a human readable word describing the schema.
    #[prost(string, optional, tag="2")]
    pub r#type: ::core::option::Option<::prost::alloc::string::String>,
    /// Defines the possible types of authenticators.
    ///
    /// Removal of an authenticator does not remove the authenticator on a user.
    #[prost(enumeration="AuthenticatorType", repeated, packed="false", tag="4")]
    pub possible_authenticators: ::prost::alloc::vec::Vec<i32>,
    #[prost(oneof="patch_user_schema::DataType", tags="3")]
    pub data_type: ::core::option::Option<patch_user_schema::DataType>,
}
/// Nested message and enum types in `PatchUserSchema`.
pub mod patch_user_schema {
    #[derive(::serde::Serialize, ::serde::Deserialize)]
    #[serde(crate = "serde", rename_all = "snake_case")]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum DataType {
        /// JSON schema representation defining the user.
        #[prost(message, tag="3")]
        Schema(::pbjson_types::Struct),
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchFilter {
    #[prost(oneof="search_filter::Filter", tags="1, 2, 3, 5, 6, 7")]
    pub filter: ::core::option::Option<search_filter::Filter>,
}
/// Nested message and enum types in `SearchFilter`.
pub mod search_filter {
    #[derive(::serde::Serialize, ::serde::Deserialize)]
    #[serde(crate = "serde", rename_all = "snake_case")]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Filter {
        /// Union the results of each sub filter ('OR').
        #[prost(message, tag="1")]
        OrFilter(super::OrFilter),
        /// Limit the result to match all sub queries ('AND').
        /// Note that if you specify multiple queries, they will be implicitly used as andQueries.
        /// Use the andFilter in combination with orFilter and notFilter.
        #[prost(message, tag="2")]
        AndFilter(super::AndFilter),
        /// Exclude / Negate the result of the sub filter ('NOT').
        #[prost(message, tag="3")]
        NotFilter(::prost::alloc::boxed::Box<super::NotFilter>),
        /// Limit the result to a specific schema type.
        #[prost(message, tag="5")]
        TypeFilter(super::TypeFilter),
        /// Limit the result to a specific state of the schema.
        #[prost(message, tag="6")]
        StateFilter(super::StateFilter),
        /// Limit the result to a specific schema ID.
        #[prost(message, tag="7")]
        IdFilter(super::IdFilter),
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrFilter {
    #[prost(message, repeated, tag="1")]
    pub queries: ::prost::alloc::vec::Vec<SearchFilter>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AndFilter {
    #[prost(message, repeated, tag="1")]
    pub queries: ::prost::alloc::vec::Vec<SearchFilter>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NotFilter {
    #[prost(message, optional, boxed, tag="1")]
    pub filter: ::core::option::Option<::prost::alloc::boxed::Box<SearchFilter>>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IdFilter {
    /// Defines the ID of the user schema to filter for.
    #[prost(string, tag="1")]
    pub id: ::prost::alloc::string::String,
    /// Defines which text comparison method used for the id filter.
    #[prost(enumeration="super::super::object::v3alpha::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 TypeFilter {
    /// Defines which type to filter for.
    #[prost(string, tag="1")]
    pub r#type: ::prost::alloc::string::String,
    /// Defines which text comparison method used for the type filter.
    #[prost(enumeration="super::super::object::v3alpha::TextFilterMethod", tag="2")]
    pub method: i32,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StateFilter {
    /// Defines the state to filter for.
    #[prost(enumeration="State", tag="1")]
    pub state: 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 FieldName {
    Unspecified = 0,
    Type = 1,
    State = 2,
    Revision = 3,
    ChangeDate = 4,
    CreationDate = 5,
}
impl FieldName {
    /// 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 => "FIELD_NAME_UNSPECIFIED",
            Self::Type => "FIELD_NAME_TYPE",
            Self::State => "FIELD_NAME_STATE",
            Self::Revision => "FIELD_NAME_REVISION",
            Self::ChangeDate => "FIELD_NAME_CHANGE_DATE",
            Self::CreationDate => "FIELD_NAME_CREATION_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 {
            "FIELD_NAME_UNSPECIFIED" => Some(Self::Unspecified),
            "FIELD_NAME_TYPE" => Some(Self::Type),
            "FIELD_NAME_STATE" => Some(Self::State),
            "FIELD_NAME_REVISION" => Some(Self::Revision),
            "FIELD_NAME_CHANGE_DATE" => Some(Self::ChangeDate),
            "FIELD_NAME_CREATION_DATE" => Some(Self::CreationDate),
            _ => 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 State {
    Unspecified = 0,
    Active = 1,
    Inactive = 2,
}
impl State {
    /// 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 => "STATE_UNSPECIFIED",
            Self::Active => "STATE_ACTIVE",
            Self::Inactive => "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 {
            "STATE_UNSPECIFIED" => Some(Self::Unspecified),
            "STATE_ACTIVE" => Some(Self::Active),
            "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 AuthenticatorType {
    Unspecified = 0,
    Username = 1,
    Password = 2,
    Webauthn = 3,
    Totp = 4,
    OtpEmail = 5,
    OtpSms = 6,
    AuthenticationKey = 7,
    IdentityProvider = 8,
}
impl AuthenticatorType {
    /// 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 => "AUTHENTICATOR_TYPE_UNSPECIFIED",
            Self::Username => "AUTHENTICATOR_TYPE_USERNAME",
            Self::Password => "AUTHENTICATOR_TYPE_PASSWORD",
            Self::Webauthn => "AUTHENTICATOR_TYPE_WEBAUTHN",
            Self::Totp => "AUTHENTICATOR_TYPE_TOTP",
            Self::OtpEmail => "AUTHENTICATOR_TYPE_OTP_EMAIL",
            Self::OtpSms => "AUTHENTICATOR_TYPE_OTP_SMS",
            Self::AuthenticationKey => "AUTHENTICATOR_TYPE_AUTHENTICATION_KEY",
            Self::IdentityProvider => "AUTHENTICATOR_TYPE_IDENTITY_PROVIDER",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "AUTHENTICATOR_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "AUTHENTICATOR_TYPE_USERNAME" => Some(Self::Username),
            "AUTHENTICATOR_TYPE_PASSWORD" => Some(Self::Password),
            "AUTHENTICATOR_TYPE_WEBAUTHN" => Some(Self::Webauthn),
            "AUTHENTICATOR_TYPE_TOTP" => Some(Self::Totp),
            "AUTHENTICATOR_TYPE_OTP_EMAIL" => Some(Self::OtpEmail),
            "AUTHENTICATOR_TYPE_OTP_SMS" => Some(Self::OtpSms),
            "AUTHENTICATOR_TYPE_AUTHENTICATION_KEY" => Some(Self::AuthenticationKey),
            "AUTHENTICATOR_TYPE_IDENTITY_PROVIDER" => Some(Self::IdentityProvider),
            _ => None,
        }
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchUserSchemasRequest {
    #[prost(message, optional, tag="1")]
    pub instance: ::core::option::Option<super::super::super::object::v3alpha::Instance>,
    /// list limitations and ordering.
    #[prost(message, optional, tag="2")]
    pub query: ::core::option::Option<super::super::object::v3alpha::SearchQuery>,
    /// 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="FieldName", optional, tag="3")]
    pub sorting_column: ::core::option::Option<i32>,
    /// Define the criteria to filter for.
    #[prost(message, repeated, tag="4")]
    pub filters: ::prost::alloc::vec::Vec<SearchFilter>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchUserSchemasResponse {
    /// Details provides information about the returned result including total amount found.
    #[prost(message, optional, tag="1")]
    pub details: ::core::option::Option<super::super::object::v3alpha::ListDetails>,
    /// States by which field the results are sorted.
    #[prost(enumeration="FieldName", tag="2")]
    pub sorting_column: i32,
    /// The result contains the user schemas, which matched the queries.
    #[prost(message, repeated, tag="3")]
    pub result: ::prost::alloc::vec::Vec<GetUserSchema>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetUserSchemaRequest {
    /// unique identifier of the schema.
    #[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 GetUserSchemaResponse {
    #[prost(message, optional, tag="2")]
    pub user_schema: ::core::option::Option<GetUserSchema>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateUserSchemaRequest {
    #[prost(message, optional, tag="1")]
    pub instance: ::core::option::Option<super::super::super::object::v3alpha::Instance>,
    #[prost(message, optional, tag="2")]
    pub user_schema: ::core::option::Option<UserSchema>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateUserSchemaResponse {
    /// Details provide some base information (such as the last change date) of the schema.
    #[prost(message, optional, tag="2")]
    pub details: ::core::option::Option<super::super::object::v3alpha::Details>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PatchUserSchemaRequest {
    #[prost(message, optional, tag="1")]
    pub instance: ::core::option::Option<super::super::super::object::v3alpha::Instance>,
    /// unique identifier of the schema.
    #[prost(string, tag="2")]
    pub id: ::prost::alloc::string::String,
    #[prost(message, optional, tag="3")]
    pub user_schema: ::core::option::Option<PatchUserSchema>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PatchUserSchemaResponse {
    /// Details provide some base information (such as the last change date) of the schema.
    #[prost(message, optional, tag="1")]
    pub details: ::core::option::Option<super::super::object::v3alpha::Details>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeactivateUserSchemaRequest {
    #[prost(message, optional, tag="2")]
    pub instance: ::core::option::Option<super::super::super::object::v3alpha::Instance>,
    /// unique identifier of the schema.
    #[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 DeactivateUserSchemaResponse {
    /// Details provide some base information (such as the last change date) of the schema.
    #[prost(message, optional, tag="1")]
    pub details: ::core::option::Option<super::super::object::v3alpha::Details>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReactivateUserSchemaRequest {
    #[prost(message, optional, tag="2")]
    pub instance: ::core::option::Option<super::super::super::object::v3alpha::Instance>,
    /// unique identifier of the schema.
    #[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 ReactivateUserSchemaResponse {
    /// Details provide some base information (such as the last change date) of the schema.
    #[prost(message, optional, tag="1")]
    pub details: ::core::option::Option<super::super::object::v3alpha::Details>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteUserSchemaRequest {
    #[prost(message, optional, tag="2")]
    pub instance: ::core::option::Option<super::super::super::object::v3alpha::Instance>,
    /// unique identifier of the schema.
    #[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 DeleteUserSchemaResponse {
    /// Details provide some base information (such as the last change date) of the schema.
    #[prost(message, optional, tag="1")]
    pub details: ::core::option::Option<super::super::object::v3alpha::Details>,
}
include!("zitadel.resources.userschema.v3alpha.tonic.rs");
// @@protoc_insertion_point(module)