k8s-pb 0.6.0

Bindings for the Kubernetes Client API
Documentation
// This file is @generated by prost-build.
/// Lease defines a lease concept.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Lease {
    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
    /// +optional
    #[prost(message, optional, tag = "1")]
    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
    /// spec contains the specification of the Lease.
    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
    /// +optional
    #[prost(message, optional, tag = "2")]
    pub spec: ::core::option::Option<LeaseSpec>,
}
/// LeaseList is a list of Lease objects.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseList {
    /// Standard list metadata.
    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
    /// +optional
    #[prost(message, optional, tag = "1")]
    pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
    /// items is a list of schema objects.
    #[prost(message, repeated, tag = "2")]
    pub items: ::prost::alloc::vec::Vec<Lease>,
}
/// LeaseSpec is a specification of a Lease.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseSpec {
    /// holderIdentity contains the identity of the holder of a current lease.
    /// If Coordinated Leader Election is used, the holder identity must be
    /// equal to the elected LeaseCandidate.metadata.name field.
    /// +optional
    #[prost(string, optional, tag = "1")]
    pub holder_identity: ::core::option::Option<::prost::alloc::string::String>,
    /// leaseDurationSeconds is a duration that candidates for a lease need
    /// to wait to force acquire it. This is measured against the time of last
    /// observed renewTime.
    /// +optional
    #[prost(int32, optional, tag = "2")]
    pub lease_duration_seconds: ::core::option::Option<i32>,
    /// acquireTime is a time when the current lease was acquired.
    /// +optional
    #[prost(message, optional, tag = "3")]
    pub acquire_time:
        ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::MicroTime>,
    /// renewTime is a time when the current holder of a lease has last
    /// updated the lease.
    /// +optional
    #[prost(message, optional, tag = "4")]
    pub renew_time: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::MicroTime>,
    /// leaseTransitions is the number of transitions of a lease between
    /// holders.
    /// +optional
    #[prost(int32, optional, tag = "5")]
    pub lease_transitions: ::core::option::Option<i32>,
    /// Strategy indicates the strategy for picking the leader for coordinated leader election.
    /// If the field is not specified, there is no active coordination for this lease.
    /// (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.
    /// +featureGate=CoordinatedLeaderElection
    /// +optional
    #[prost(string, optional, tag = "6")]
    pub strategy: ::core::option::Option<::prost::alloc::string::String>,
    /// PreferredHolder signals to a lease holder that the lease has a
    /// more optimal holder and should be given up.
    /// This field can only be set if Strategy is also set.
    /// +featureGate=CoordinatedLeaderElection
    /// +optional
    #[prost(string, optional, tag = "7")]
    pub preferred_holder: ::core::option::Option<::prost::alloc::string::String>,
}

impl crate::Resource for Lease {
    const API_VERSION: &'static str = "coordination.k8s.io/v1";
    const GROUP: &'static str = "coordination.k8s.io";
    const VERSION: &'static str = "v1";
    const KIND: &'static str = "Lease";
    const URL_PATH_SEGMENT: &'static str = "leases";
    type Scope = crate::NamespaceResourceScope;
}
impl crate::Metadata for Lease {
    type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
    fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
        self.metadata.as_ref()
    }
    fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
        self.metadata.as_mut()
    }
}
impl crate::HasSpec for Lease {
    type Spec = crate::api::coordination::v1::LeaseSpec;
    fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
        self.spec.as_ref()
    }
    fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
        self.spec.as_mut()
    }
}