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
// @generated
// This file is @generated by prost-build.
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PaginationRequest {
    /// Starting point for retrieval, in combination of offset used to query a set list of objects.
    #[prost(uint64, tag="1")]
    pub offset: u64,
    /// limit is the maximum amount of objects returned. The default is set to 100
    /// with a maximum of 1000 in the runtime configuration.
    /// If the limit exceeds the maximum configured ZITADEL will throw an error.
    /// If no limit is present the default is taken.
    #[prost(uint32, tag="2")]
    pub limit: u32,
    /// Asc is the sorting order. If true the list is sorted ascending, if false
    /// the list is sorted descending. The default is descending.
    #[prost(bool, tag="3")]
    pub asc: bool,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PaginationResponse {
    /// Absolute number of objects matching the query, regardless of applied limit.
    #[prost(uint64, tag="1")]
    pub total_result: u64,
    /// Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.
    #[prost(uint64, tag="2")]
    pub applied_limit: u64,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IdFilter {
    /// Only return resources that belong to this id.
    #[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 TimestampFilter {
    /// Filter resources by timestamp.
    #[prost(message, optional, tag="1")]
    pub timestamp: ::core::option::Option<::pbjson_types::Timestamp>,
    /// Defines the condition (e.g., equals, before, after) that the timestamp of the retrieved resources should match.
    #[prost(enumeration="TimestampFilterMethod", tag="2")]
    pub method: i32,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InIDsFilter {
    /// Defines the ids to query for.
    #[prost(string, repeated, tag="1")]
    pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[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 TextFilterMethod {
    Equals = 0,
    EqualsIgnoreCase = 1,
    StartsWith = 2,
    StartsWithIgnoreCase = 3,
    Contains = 4,
    ContainsIgnoreCase = 5,
    EndsWith = 6,
    EndsWithIgnoreCase = 7,
}
impl TextFilterMethod {
    /// 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::Equals => "TEXT_FILTER_METHOD_EQUALS",
            Self::EqualsIgnoreCase => "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE",
            Self::StartsWith => "TEXT_FILTER_METHOD_STARTS_WITH",
            Self::StartsWithIgnoreCase => "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE",
            Self::Contains => "TEXT_FILTER_METHOD_CONTAINS",
            Self::ContainsIgnoreCase => "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE",
            Self::EndsWith => "TEXT_FILTER_METHOD_ENDS_WITH",
            Self::EndsWithIgnoreCase => "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "TEXT_FILTER_METHOD_EQUALS" => Some(Self::Equals),
            "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE" => Some(Self::EqualsIgnoreCase),
            "TEXT_FILTER_METHOD_STARTS_WITH" => Some(Self::StartsWith),
            "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE" => Some(Self::StartsWithIgnoreCase),
            "TEXT_FILTER_METHOD_CONTAINS" => Some(Self::Contains),
            "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE" => Some(Self::ContainsIgnoreCase),
            "TEXT_FILTER_METHOD_ENDS_WITH" => Some(Self::EndsWith),
            "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE" => Some(Self::EndsWithIgnoreCase),
            _ => 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 ListFilterMethod {
    In = 0,
}
impl ListFilterMethod {
    /// 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::In => "LIST_FILTER_METHOD_IN",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "LIST_FILTER_METHOD_IN" => Some(Self::In),
            _ => 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 TimestampFilterMethod {
    Equals = 0,
    After = 1,
    AfterOrEquals = 2,
    Before = 3,
    BeforeOrEquals = 4,
}
impl TimestampFilterMethod {
    /// 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::Equals => "TIMESTAMP_FILTER_METHOD_EQUALS",
            Self::After => "TIMESTAMP_FILTER_METHOD_AFTER",
            Self::AfterOrEquals => "TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS",
            Self::Before => "TIMESTAMP_FILTER_METHOD_BEFORE",
            Self::BeforeOrEquals => "TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "TIMESTAMP_FILTER_METHOD_EQUALS" => Some(Self::Equals),
            "TIMESTAMP_FILTER_METHOD_AFTER" => Some(Self::After),
            "TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS" => Some(Self::AfterOrEquals),
            "TIMESTAMP_FILTER_METHOD_BEFORE" => Some(Self::Before),
            "TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS" => Some(Self::BeforeOrEquals),
            _ => None,
        }
    }
}
// @@protoc_insertion_point(module)