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, PartialEq, ::prost::Message)]
pub struct InstanceInformation {
    /// The unique identifier of the instance.
    #[prost(string, tag="1")]
    pub id: ::prost::alloc::string::String,
    /// The custom domains (incl. generated ones) of the instance.
    #[prost(string, repeated, tag="2")]
    pub domains: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// The creation date of the instance.
    #[prost(message, optional, tag="3")]
    pub created_at: ::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 ResourceCount {
    /// The ID of the instance for which the resource counts are reported.
    #[prost(string, tag="3")]
    pub instance_id: ::prost::alloc::string::String,
    /// The parent type of the resource counts (e.g. organization or instance).
    /// For example, reporting the amount of users per organization would use
    /// `COUNT_PARENT_TYPE_ORGANIZATION` as parent type and the organization ID as parent ID.
    #[prost(enumeration="CountParentType", tag="4")]
    pub parent_type: i32,
    /// The parent ID of the resource counts (e.g. organization or instance ID).
    /// For example, reporting the amount of users per organization would use
    /// `COUNT_PARENT_TYPE_ORGANIZATION` as parent type and the organization ID as parent ID.
    #[prost(string, tag="5")]
    pub parent_id: ::prost::alloc::string::String,
    /// The resource counts to report, e.g. amount of `users`, `organizations`, etc.
    #[prost(string, tag="6")]
    pub resource_name: ::prost::alloc::string::String,
    /// The name of the table in the database, which was used to calculate the counts.
    /// This can be used to deduplicate counts in case of multiple reports.
    /// For example, if the counts were calculated from the `users14` table,
    /// the table name would be `users14`, where there could also be a `users15` table
    /// reported at the same time as the system is rolling out a new version.
    #[prost(string, tag="7")]
    pub table_name: ::prost::alloc::string::String,
    /// The timestamp when the count was last updated.
    #[prost(message, optional, tag="8")]
    pub updated_at: ::core::option::Option<::pbjson_types::Timestamp>,
    /// The actual amount of the resource.
    #[prost(uint32, tag="9")]
    pub amount: u32,
}
#[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 CountParentType {
    Unspecified = 0,
    Instance = 1,
    Organization = 2,
}
impl CountParentType {
    /// 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 => "COUNT_PARENT_TYPE_UNSPECIFIED",
            Self::Instance => "COUNT_PARENT_TYPE_INSTANCE",
            Self::Organization => "COUNT_PARENT_TYPE_ORGANIZATION",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "COUNT_PARENT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "COUNT_PARENT_TYPE_INSTANCE" => Some(Self::Instance),
            "COUNT_PARENT_TYPE_ORGANIZATION" => Some(Self::Organization),
            _ => None,
        }
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReportBaseInformationRequest {
    /// The system ID is a unique identifier for the ZITADEL system.
    #[prost(string, tag="1")]
    pub system_id: ::prost::alloc::string::String,
    /// The current version of the ZITADEL system.
    #[prost(string, tag="2")]
    pub version: ::prost::alloc::string::String,
    /// A list of instances in the ZITADEL system and their information.
    #[prost(message, repeated, tag="3")]
    pub instances: ::prost::alloc::vec::Vec<InstanceInformation>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReportBaseInformationResponse {
    /// The report ID is a unique identifier for the report.
    /// It is used to identify the report to be able to link it to the resource counts or other reports.
    /// Note that the report ID is only valid for the same system ID.
    #[prost(string, tag="1")]
    pub report_id: ::prost::alloc::string::String,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReportResourceCountsRequest {
    /// The system ID is a unique identifier for the ZITADEL system.
    #[prost(string, tag="1")]
    pub system_id: ::prost::alloc::string::String,
    /// The previously returned report ID from the server to continue reporting.
    /// Note that the report ID is only valid for the same system ID.
    #[prost(string, optional, tag="2")]
    pub report_id: ::core::option::Option<::prost::alloc::string::String>,
    /// A list of resource counts to report.
    #[prost(message, repeated, tag="3")]
    pub resource_counts: ::prost::alloc::vec::Vec<ResourceCount>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(crate = "serde", rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReportResourceCountsResponse {
    /// The report ID is a unique identifier for the report.
    /// It is used to identify the report in case of additional data / pagination.
    /// Note that the report ID is only valid for the same system ID.
    #[prost(string, tag="1")]
    pub report_id: ::prost::alloc::string::String,
}
include!("zitadel.analytics.v2beta.tonic.rs");
// @@protoc_insertion_point(module)