// Copyright (c) 2026 Ant Group
//
// SPDX-License-Identifier: Apache-2.0
//
// This file is @generated by prost-build.
/// AllocatableResourcesRequest is the request made to the GetAllocatableResources service
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AllocatableResourcesRequest {}
/// AllocatableResourcesResponses contains informations about all the devices known by the kubelet
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AllocatableResourcesResponse {
    #[prost(message, repeated, tag = "1")]
    pub devices: ::prost::alloc::vec::Vec<ContainerDevices>,
    #[prost(int64, repeated, tag = "2")]
    pub cpu_ids: ::prost::alloc::vec::Vec<i64>,
    #[prost(message, repeated, tag = "3")]
    pub memory: ::prost::alloc::vec::Vec<ContainerMemory>,
}
/// ListPodResourcesRequest is the request made to the PodResources service
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListPodResourcesRequest {}
/// ListPodResourcesResponse is the response returned by List function
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPodResourcesResponse {
    #[prost(message, repeated, tag = "1")]
    pub pod_resources: ::prost::alloc::vec::Vec<PodResources>,
}
/// GetPodResourcesRequest is the request made to the Get service
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetPodResourcesRequest {
    #[prost(string, tag = "1")]
    pub pod_name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub pod_namespace: ::prost::alloc::string::String,
}
/// GetPodResourcesResponse is the response returned by Get function
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPodResourcesResponse {
    #[prost(message, optional, tag = "1")]
    pub pod_resources: ::core::option::Option<PodResources>,
}
/// PodResources contains information about the node resources assigned to a pod
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PodResources {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub namespace: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "3")]
    pub containers: ::prost::alloc::vec::Vec<ContainerResources>,
}
/// ContainerResources contains information about the resources assigned to a container
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContainerResources {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "2")]
    pub devices: ::prost::alloc::vec::Vec<ContainerDevices>,
    #[prost(int64, repeated, tag = "3")]
    pub cpu_ids: ::prost::alloc::vec::Vec<i64>,
    #[prost(message, repeated, tag = "4")]
    pub memory: ::prost::alloc::vec::Vec<ContainerMemory>,
    #[prost(message, repeated, tag = "5")]
    pub dynamic_resources: ::prost::alloc::vec::Vec<DynamicResource>,
}
/// ContainerDevices contains information about the devices assigned to a container
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContainerDevices {
    #[prost(string, tag = "1")]
    pub resource_name: ::prost::alloc::string::String,
    #[prost(string, repeated, tag = "2")]
    pub device_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(message, optional, tag = "3")]
    pub topology: ::core::option::Option<TopologyInfo>,
}
/// ContainerMemory contains information about memory and hugepages assigned to a container
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContainerMemory {
    #[prost(string, tag = "1")]
    pub memory_type: ::prost::alloc::string::String,
    #[prost(uint64, tag = "2")]
    pub size: u64,
    #[prost(message, optional, tag = "3")]
    pub topology: ::core::option::Option<TopologyInfo>,
}
/// DynamicResource contains information about the devices assigned to a container by DRA
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DynamicResource {
    /// tombstone: removed in 1.31 because claims are no longer associated with one class
    /// string class_name = 1;
    #[prost(string, tag = "2")]
    pub claim_name: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub claim_namespace: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "4")]
    pub claim_resources: ::prost::alloc::vec::Vec<ClaimResource>,
}
/// ClaimResource contains resource information. The driver name/pool name/device name
/// triplet uniquely identifies the device. Should DRA get extended to other kinds
/// of resources, then device_name will be empty and other fields will get added.
/// Each device at the DRA API level may map to zero or more CDI devices.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClaimResource {
    #[prost(message, repeated, tag = "1")]
    pub cdi_devices: ::prost::alloc::vec::Vec<CdiDevice>,
    #[prost(string, tag = "2")]
    pub driver_name: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub pool_name: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub device_name: ::prost::alloc::string::String,
}
/// Topology describes hardware topology of the resource
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TopologyInfo {
    #[prost(message, repeated, tag = "1")]
    pub nodes: ::prost::alloc::vec::Vec<NumaNode>,
}
/// NUMA representation of NUMA node
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NumaNode {
    #[prost(int64, tag = "1")]
    pub id: i64,
}
/// CDIDevice specifies a CDI device information
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CdiDevice {
    /// Fully qualified CDI device name
    /// for example: vendor.com/gpu=gpudevice1
    /// see more details in the CDI specification:
    /// <https://github.com/container-orchestrated-devices/container-device-interface/blob/main/SPEC.md>
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod pod_resources_lister_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value
    )]
    use std::convert::TryInto;
    use tonic::codegen::http::Uri;
    use tonic::codegen::*;
    /// PodResourcesLister is a service provided by the kubelet that provides information about the
    /// node resources consumed by pods and containers on the node
    #[derive(Debug, Clone)]
    pub struct PodResourcesListerClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl PodResourcesListerClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> PodResourcesListerClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> PodResourcesListerClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<http::Request<tonic::body::Body>>>::Error:
                Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            PodResourcesListerClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// / List returns the node resources assigned to pods and containers.
        pub async fn list(
            &mut self,
            request: impl tonic::IntoRequest<super::ListPodResourcesRequest>,
        ) -> std::result::Result<tonic::Response<super::ListPodResourcesResponse>, tonic::Status>
        {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/v1.PodResourcesLister/List");
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("v1.PodResourcesLister", "List"));
            self.inner.unary(req, path, codec).await
        }
        /// / GetAllocatableResources returns the node resources that are available for assignment to pods and containers.
        pub async fn get_allocatable_resources(
            &mut self,
            request: impl tonic::IntoRequest<super::AllocatableResourcesRequest>,
        ) -> std::result::Result<tonic::Response<super::AllocatableResourcesResponse>, tonic::Status>
        {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/v1.PodResourcesLister/GetAllocatableResources",
            );
            let mut req = request.into_request();
            req.extensions_mut().insert(GrpcMethod::new(
                "v1.PodResourcesLister",
                "GetAllocatableResources",
            ));
            self.inner.unary(req, path, codec).await
        }
        /// / Get returns the node resources assigned to a specific pod.
        pub async fn get(
            &mut self,
            request: impl tonic::IntoRequest<super::GetPodResourcesRequest>,
        ) -> std::result::Result<tonic::Response<super::GetPodResourcesResponse>, tonic::Status>
        {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
            })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/v1.PodResourcesLister/Get");
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("v1.PodResourcesLister", "Get"));
            self.inner.unary(req, path, codec).await
        }
    }
}
