// This file is @generated by prost-build.
/// The build information of a particular partition on the device.
#[derive(serde::Deserialize, serde::Serialize)]
#[serde(default)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PartitionState {
    #[prost(string, tag = "1")]
    pub partition_name: ::prost::alloc::string::String,
    #[prost(string, repeated, tag = "2")]
    pub device: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "3")]
    pub build: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// The version string of the partition. It's usually timestamp if present.
    /// One known exception is the boot image, who uses the kmi version, e.g.
    /// 5.4.42-android12-0
    #[prost(string, tag = "4")]
    pub version: ::prost::alloc::string::String,
}
/// The build information on the device. The bytes of the running images are thus
/// inferred from the device state. For more information of the meaning of each
/// subfield, check
/// <https://source.android.com/compatibility/android-cdd#3_2_2_build_parameters>
#[derive(serde::Deserialize, serde::Serialize)]
#[serde(default)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeviceState {
    /// device name. i.e. ro.product.device; if the field has multiple values, it
    /// means the ota package supports multiple devices. This usually happens when
    /// we use the same image to support multiple skus.
    #[prost(string, repeated, tag = "1")]
    pub device: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// device fingerprint. Up to R build, the value reads from
    /// ro.build.fingerprint.
    #[prost(string, repeated, tag = "2")]
    pub build: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// A value that specify a version of the android build.
    #[prost(string, tag = "3")]
    pub build_incremental: ::prost::alloc::string::String,
    /// The timestamp when the build is generated.
    #[prost(int64, tag = "4")]
    pub timestamp: i64,
    /// The version of the currently-executing Android system.
    #[prost(string, tag = "5")]
    pub sdk_level: ::prost::alloc::string::String,
    /// A value indicating the security patch level of a build.
    #[prost(string, tag = "6")]
    pub security_patch_level: ::prost::alloc::string::String,
    /// The detailed state of each partition. For partial updates or devices with
    /// mixed build of partitions, some of the above fields may left empty. And the
    /// client will rely on the information of specific partitions to target the
    /// update.
    #[prost(message, repeated, tag = "7")]
    pub partition_state: ::prost::alloc::vec::Vec<PartitionState>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ApexInfo {
    #[prost(string, tag = "1")]
    pub package_name: ::prost::alloc::string::String,
    #[prost(int64, tag = "2")]
    pub version: i64,
    #[prost(bool, tag = "3")]
    pub is_compressed: bool,
    #[prost(int64, tag = "4")]
    pub decompressed_size: i64,
    /// Used in OTA
    #[prost(int64, tag = "5")]
    pub source_version: i64,
}
/// Just a container to hold repeated apex_info, so that we can easily serialize
/// a list of apex_info to string.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApexMetadata {
    #[prost(message, repeated, tag = "1")]
    pub apex_info: ::prost::alloc::vec::Vec<ApexInfo>,
}
/// The metadata of an OTA package. It contains the information of the package
/// and prerequisite to install the update correctly.
#[derive(serde::Deserialize, serde::Serialize)]
#[serde(default)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OtaMetadata {
    #[prost(enumeration = "ota_metadata::OtaType", tag = "1")]
    #[serde(with = "crate::protobuf::ota_type")]
    pub r#type: i32,
    /// True if we need to wipe after the update.
    #[prost(bool, tag = "2")]
    pub wipe: bool,
    /// True if the timestamp of the post build is older than the pre build.
    #[prost(bool, tag = "3")]
    pub downgrade: bool,
    /// A map of name:content of property files, e.g. ota-property-files.
    #[prost(btree_map = "string, string", tag = "4")]
    pub property_files: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// The required device state in order to install the package.
    #[prost(message, optional, tag = "5")]
    pub precondition: ::core::option::Option<DeviceState>,
    /// The expected device state after the update.
    #[prost(message, optional, tag = "6")]
    pub postcondition: ::core::option::Option<DeviceState>,
    /// The required size of the cache partition, only valid for non-A/B update.
    #[prost(int64, tag = "8")]
    pub required_cache: i64,
    /// True iff security patch level downgrade is permitted on this OTA.
    #[prost(bool, tag = "9")]
    pub spl_downgrade: bool,
}
/// Nested message and enum types in `OtaMetadata`.
pub mod ota_metadata {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum OtaType {
        Unknown = 0,
        Ab = 1,
        Block = 2,
        Brick = 3,
    }
    impl OtaType {
        /// 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::Unknown => "UNKNOWN",
                Self::Ab => "AB",
                Self::Block => "BLOCK",
                Self::Brick => "BRICK",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "UNKNOWN" => Some(Self::Unknown),
                "AB" => Some(Self::Ab),
                "BLOCK" => Some(Self::Block),
                "BRICK" => Some(Self::Brick),
                _ => None,
            }
        }
    }
}
