// This file is @generated by prost-build.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryItem {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub product_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub variant_id: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub sku: ::prost::alloc::string::String,
    #[prost(int32, tag = "5")]
    pub quantity_available: i32,
    #[prost(int32, tag = "6")]
    pub quantity_reserved: i32,
    #[prost(int32, tag = "7")]
    pub quantity_total: i32,
    #[prost(string, tag = "8")]
    pub location_id: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "9")]
    pub metadata: ::core::option::Option<super::super::shared::v1::Struct>,
    /// Unix timestamp
    #[prost(int64, tag = "10")]
    pub created_at: i64,
    /// Unix timestamp
    #[prost(int64, optional, tag = "11")]
    pub updated_at: ::core::option::Option<i64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryReservation {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub reservation_token: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub order_id: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub status: ::prost::alloc::string::String,
    #[prost(int64, tag = "5")]
    pub expires_at: i64,
    #[prost(int64, tag = "6")]
    pub created_at: i64,
    #[prost(int64, optional, tag = "7")]
    pub updated_at: ::core::option::Option<i64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryReservationItem {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub reservation_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub inventory_item_id: ::prost::alloc::string::String,
    #[prost(int32, tag = "4")]
    pub quantity: i32,
    #[prost(int64, tag = "5")]
    pub created_at: i64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryMovement {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub inventory_item_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub movement_type: ::prost::alloc::string::String,
    #[prost(int32, tag = "4")]
    pub quantity: i32,
    #[prost(string, tag = "5")]
    pub reference_id: ::prost::alloc::string::String,
    #[prost(string, tag = "6")]
    pub reason: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "7")]
    pub metadata: ::core::option::Option<super::super::shared::v1::Struct>,
    #[prost(int64, tag = "8")]
    pub created_at: i64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InventoryMovementType {
    Unspecified = 0,
    In = 1,
    Out = 2,
    Adjustment = 3,
    Reservation = 4,
    Release = 5,
}
impl InventoryMovementType {
    /// 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 => "INVENTORY_MOVEMENT_TYPE_UNSPECIFIED",
            Self::In => "INVENTORY_MOVEMENT_TYPE_IN",
            Self::Out => "INVENTORY_MOVEMENT_TYPE_OUT",
            Self::Adjustment => "INVENTORY_MOVEMENT_TYPE_ADJUSTMENT",
            Self::Reservation => "INVENTORY_MOVEMENT_TYPE_RESERVATION",
            Self::Release => "INVENTORY_MOVEMENT_TYPE_RELEASE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "INVENTORY_MOVEMENT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "INVENTORY_MOVEMENT_TYPE_IN" => Some(Self::In),
            "INVENTORY_MOVEMENT_TYPE_OUT" => Some(Self::Out),
            "INVENTORY_MOVEMENT_TYPE_ADJUSTMENT" => Some(Self::Adjustment),
            "INVENTORY_MOVEMENT_TYPE_RESERVATION" => Some(Self::Reservation),
            "INVENTORY_MOVEMENT_TYPE_RELEASE" => Some(Self::Release),
            _ => None,
        }
    }
}
/// Request for getting inventory
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryGetRequest {
    #[prost(string, repeated, tag = "1")]
    pub product_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "2")]
    pub variant_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "3")]
    pub skus: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryGetResponse {
    #[prost(oneof = "inventory_get_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<inventory_get_response::Response>,
}
/// Nested message and enum types in `InventoryGetResponse`.
pub mod inventory_get_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        Data(super::InventoryGetResponseData),
        #[prost(message, tag = "2")]
        Error(super::super::super::shared::v1::AppError),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryGetResponseData {
    #[prost(message, repeated, tag = "1")]
    pub items: ::prost::alloc::vec::Vec<InventoryItemList>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryItemList {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub product_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub variant_id: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub sku: ::prost::alloc::string::String,
    #[prost(uint32, tag = "5")]
    pub quantity_total: u32,
    #[prost(uint32, tag = "6")]
    pub quantity_reserved: u32,
    #[prost(uint32, tag = "7")]
    pub quantity_available: u32,
    /// Optional
    #[prost(string, tag = "8")]
    pub location_id: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "9")]
    pub metadata: ::core::option::Option<super::super::shared::v1::Struct>,
}
/// Request for inventory release
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryReleaseRequest {
    #[prost(string, tag = "1")]
    pub reservation_token: ::prost::alloc::string::String,
}
/// Response for inventory release
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryReleaseResponse {
    #[prost(oneof = "inventory_release_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<inventory_release_response::Response>,
}
/// Nested message and enum types in `InventoryReleaseResponse`.
pub mod inventory_release_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        Data(super::super::super::shared::v1::SuccessResponseData),
        #[prost(message, tag = "2")]
        Error(super::super::super::shared::v1::AppError),
    }
}
/// Request for getting reservation details
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryReservationGetRequest {
    #[prost(string, tag = "1")]
    pub reservation_token: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryReservationGetResponse {
    #[prost(oneof = "inventory_reservation_get_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<inventory_reservation_get_response::Response>,
}
/// Nested message and enum types in `InventoryReservationGetResponse`.
pub mod inventory_reservation_get_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        Data(super::InventoryReservationGetResponseData),
        #[prost(message, tag = "2")]
        Error(super::super::super::shared::v1::AppError),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryReservationGetResponseData {
    #[prost(string, tag = "1")]
    pub reservation_token: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub order_id: ::prost::alloc::string::String,
    #[prost(enumeration = "InventoryReservationStatus", tag = "3")]
    pub status: i32,
    #[prost(int64, tag = "4")]
    pub expires_at: i64,
    #[prost(message, repeated, tag = "5")]
    pub items: ::prost::alloc::vec::Vec<InventoryReservationListItem>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryReservationListItem {
    #[prost(string, tag = "1")]
    pub product_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub variant_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub sku: ::prost::alloc::string::String,
    #[prost(uint32, tag = "4")]
    pub quantity_requested: u32,
    #[prost(uint32, tag = "5")]
    pub quantity_reserved: u32,
    #[prost(enumeration = "InventoryReservationItemStatus", tag = "6")]
    pub status: i32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InventoryReservationStatus {
    Unspecified = 0,
    Reserved = 1,
    PartiallyReserved = 2,
    NotReserved = 3,
    Pending = 4,
    Released = 5,
    Fulfilled = 6,
}
impl InventoryReservationStatus {
    /// 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 => "INVENTORY_RESERVATION_STATUS_UNSPECIFIED",
            Self::Reserved => "INVENTORY_RESERVATION_STATUS_RESERVED",
            Self::PartiallyReserved => "INVENTORY_RESERVATION_STATUS_PARTIALLY_RESERVED",
            Self::NotReserved => "INVENTORY_RESERVATION_STATUS_NOT_RESERVED",
            Self::Pending => "INVENTORY_RESERVATION_STATUS_PENDING",
            Self::Released => "INVENTORY_RESERVATION_STATUS_RELEASED",
            Self::Fulfilled => "INVENTORY_RESERVATION_STATUS_FULFILLED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "INVENTORY_RESERVATION_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "INVENTORY_RESERVATION_STATUS_RESERVED" => Some(Self::Reserved),
            "INVENTORY_RESERVATION_STATUS_PARTIALLY_RESERVED" => {
                Some(Self::PartiallyReserved)
            }
            "INVENTORY_RESERVATION_STATUS_NOT_RESERVED" => Some(Self::NotReserved),
            "INVENTORY_RESERVATION_STATUS_PENDING" => Some(Self::Pending),
            "INVENTORY_RESERVATION_STATUS_RELEASED" => Some(Self::Released),
            "INVENTORY_RESERVATION_STATUS_FULFILLED" => Some(Self::Fulfilled),
            _ => None,
        }
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InventoryReservationItemStatus {
    Unspecified = 0,
    Reserved = 1,
    PartiallyReserved = 2,
    NotReserved = 3,
    OutOfStock = 4,
}
impl InventoryReservationItemStatus {
    /// 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 => "INVENTORY_RESERVATION_ITEM_STATUS_UNSPECIFIED",
            Self::Reserved => "INVENTORY_RESERVATION_ITEM_STATUS_RESERVED",
            Self::PartiallyReserved => {
                "INVENTORY_RESERVATION_ITEM_STATUS_PARTIALLY_RESERVED"
            }
            Self::NotReserved => "INVENTORY_RESERVATION_ITEM_STATUS_NOT_RESERVED",
            Self::OutOfStock => "INVENTORY_RESERVATION_ITEM_STATUS_OUT_OF_STOCK",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "INVENTORY_RESERVATION_ITEM_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "INVENTORY_RESERVATION_ITEM_STATUS_RESERVED" => Some(Self::Reserved),
            "INVENTORY_RESERVATION_ITEM_STATUS_PARTIALLY_RESERVED" => {
                Some(Self::PartiallyReserved)
            }
            "INVENTORY_RESERVATION_ITEM_STATUS_NOT_RESERVED" => Some(Self::NotReserved),
            "INVENTORY_RESERVATION_ITEM_STATUS_OUT_OF_STOCK" => Some(Self::OutOfStock),
            _ => None,
        }
    }
}
/// Request/Response for inventory reservation
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryReserveRequest {
    #[prost(string, tag = "1")]
    pub order_id: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "2")]
    pub items: ::prost::alloc::vec::Vec<InventoryReserveRequestItem>,
    /// Time to live for reservation
    #[prost(int64, tag = "3")]
    pub ttl_seconds: i64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryReserveRequestItem {
    #[prost(string, tag = "1")]
    pub product_id: ::prost::alloc::string::String,
    /// Optional if product has no variations
    #[prost(string, tag = "2")]
    pub variant_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub sku: ::prost::alloc::string::String,
    #[prost(uint32, tag = "4")]
    pub quantity: u32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryReserveResponse {
    #[prost(oneof = "inventory_reserve_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<inventory_reserve_response::Response>,
}
/// Nested message and enum types in `InventoryReserveResponse`.
pub mod inventory_reserve_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        Data(super::InventoryReserveResponseData),
        #[prost(message, tag = "2")]
        Error(super::super::super::shared::v1::AppError),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryReserveResponseData {
    #[prost(string, tag = "1")]
    pub reservation_token: ::prost::alloc::string::String,
    #[prost(enumeration = "InventoryReservationStatus", tag = "2")]
    pub status: i32,
    #[prost(message, repeated, tag = "3")]
    pub items: ::prost::alloc::vec::Vec<InventoryReservationListItem>,
}
/// Request/Response for updating inventory
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryUpdateRequest {
    #[prost(message, repeated, tag = "1")]
    pub items: ::prost::alloc::vec::Vec<InventoryUpdateItem>,
    #[prost(string, tag = "2")]
    pub reason: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryUpdateItem {
    #[prost(string, tag = "1")]
    pub product_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub variant_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub sku: ::prost::alloc::string::String,
    #[prost(enumeration = "InventoryUpdateOperation", tag = "4")]
    pub operation: i32,
    #[prost(uint32, tag = "5")]
    pub quantity: u32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InventoryUpdateResponse {
    #[prost(oneof = "inventory_update_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<inventory_update_response::Response>,
}
/// Nested message and enum types in `InventoryUpdateResponse`.
pub mod inventory_update_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        Data(super::super::super::shared::v1::SuccessResponseData),
        #[prost(message, tag = "2")]
        Error(super::super::super::shared::v1::AppError),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InventoryUpdateOperation {
    Unspecified = 0,
    /// Set exact quantity
    Set = 1,
    /// Add to existing quantity
    Add = 2,
    /// Subtract from existing quantity
    Subtract = 3,
}
impl InventoryUpdateOperation {
    /// 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 => "INVENTORY_UPDATE_OPERATION_UNSPECIFIED",
            Self::Set => "INVENTORY_UPDATE_OPERATION_SET",
            Self::Add => "INVENTORY_UPDATE_OPERATION_ADD",
            Self::Subtract => "INVENTORY_UPDATE_OPERATION_SUBTRACT",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "INVENTORY_UPDATE_OPERATION_UNSPECIFIED" => Some(Self::Unspecified),
            "INVENTORY_UPDATE_OPERATION_SET" => Some(Self::Set),
            "INVENTORY_UPDATE_OPERATION_ADD" => Some(Self::Add),
            "INVENTORY_UPDATE_OPERATION_SUBTRACT" => Some(Self::Subtract),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod inventory_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct InventoryServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl InventoryServiceClient<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> InventoryServiceClient<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,
        ) -> InventoryServiceClient<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,
        {
            InventoryServiceClient::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
        }
        /// Reserve inventory for an order
        pub async fn inventory_reserve(
            &mut self,
            request: impl tonic::IntoRequest<super::InventoryReserveRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InventoryReserveResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/inventory.v1.InventoryService/InventoryReserve",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("inventory.v1.InventoryService", "InventoryReserve"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Release inventory reservation
        pub async fn inventory_release(
            &mut self,
            request: impl tonic::IntoRequest<super::InventoryReleaseRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InventoryReleaseResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/inventory.v1.InventoryService/InventoryRelease",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("inventory.v1.InventoryService", "InventoryRelease"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Get inventory levels for products
        pub async fn inventory_get(
            &mut self,
            request: impl tonic::IntoRequest<super::InventoryGetRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InventoryGetResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/inventory.v1.InventoryService/InventoryGet",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("inventory.v1.InventoryService", "InventoryGet"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Update inventory levels
        pub async fn inventory_update(
            &mut self,
            request: impl tonic::IntoRequest<super::InventoryUpdateRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InventoryUpdateResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/inventory.v1.InventoryService/InventoryUpdate",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("inventory.v1.InventoryService", "InventoryUpdate"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Get reservation details
        pub async fn inventory_reservation_get(
            &mut self,
            request: impl tonic::IntoRequest<super::InventoryReservationGetRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InventoryReservationGetResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/inventory.v1.InventoryService/InventoryReservationGet",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "inventory.v1.InventoryService",
                        "InventoryReservationGet",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod inventory_service_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with InventoryServiceServer.
    #[async_trait]
    pub trait InventoryService: std::marker::Send + std::marker::Sync + 'static {
        /// Reserve inventory for an order
        async fn inventory_reserve(
            &self,
            request: tonic::Request<super::InventoryReserveRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InventoryReserveResponse>,
            tonic::Status,
        >;
        /// Release inventory reservation
        async fn inventory_release(
            &self,
            request: tonic::Request<super::InventoryReleaseRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InventoryReleaseResponse>,
            tonic::Status,
        >;
        /// Get inventory levels for products
        async fn inventory_get(
            &self,
            request: tonic::Request<super::InventoryGetRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InventoryGetResponse>,
            tonic::Status,
        >;
        /// Update inventory levels
        async fn inventory_update(
            &self,
            request: tonic::Request<super::InventoryUpdateRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InventoryUpdateResponse>,
            tonic::Status,
        >;
        /// Get reservation details
        async fn inventory_reservation_get(
            &self,
            request: tonic::Request<super::InventoryReservationGetRequest>,
        ) -> std::result::Result<
            tonic::Response<super::InventoryReservationGetResponse>,
            tonic::Status,
        >;
    }
    #[derive(Debug)]
    pub struct InventoryServiceServer<T> {
        inner: Arc<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    impl<T> InventoryServiceServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(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.max_decoding_message_size = Some(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.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>> for InventoryServiceServer<T>
    where
        T: InventoryService,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            match req.uri().path() {
                "/inventory.v1.InventoryService/InventoryReserve" => {
                    #[allow(non_camel_case_types)]
                    struct InventoryReserveSvc<T: InventoryService>(pub Arc<T>);
                    impl<
                        T: InventoryService,
                    > tonic::server::UnaryService<super::InventoryReserveRequest>
                    for InventoryReserveSvc<T> {
                        type Response = super::InventoryReserveResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::InventoryReserveRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as InventoryService>::inventory_reserve(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = InventoryReserveSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/inventory.v1.InventoryService/InventoryRelease" => {
                    #[allow(non_camel_case_types)]
                    struct InventoryReleaseSvc<T: InventoryService>(pub Arc<T>);
                    impl<
                        T: InventoryService,
                    > tonic::server::UnaryService<super::InventoryReleaseRequest>
                    for InventoryReleaseSvc<T> {
                        type Response = super::InventoryReleaseResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::InventoryReleaseRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as InventoryService>::inventory_release(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = InventoryReleaseSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/inventory.v1.InventoryService/InventoryGet" => {
                    #[allow(non_camel_case_types)]
                    struct InventoryGetSvc<T: InventoryService>(pub Arc<T>);
                    impl<
                        T: InventoryService,
                    > tonic::server::UnaryService<super::InventoryGetRequest>
                    for InventoryGetSvc<T> {
                        type Response = super::InventoryGetResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::InventoryGetRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as InventoryService>::inventory_get(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = InventoryGetSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/inventory.v1.InventoryService/InventoryUpdate" => {
                    #[allow(non_camel_case_types)]
                    struct InventoryUpdateSvc<T: InventoryService>(pub Arc<T>);
                    impl<
                        T: InventoryService,
                    > tonic::server::UnaryService<super::InventoryUpdateRequest>
                    for InventoryUpdateSvc<T> {
                        type Response = super::InventoryUpdateResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::InventoryUpdateRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as InventoryService>::inventory_update(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = InventoryUpdateSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/inventory.v1.InventoryService/InventoryReservationGet" => {
                    #[allow(non_camel_case_types)]
                    struct InventoryReservationGetSvc<T: InventoryService>(pub Arc<T>);
                    impl<
                        T: InventoryService,
                    > tonic::server::UnaryService<super::InventoryReservationGetRequest>
                    for InventoryReservationGetSvc<T> {
                        type Response = super::InventoryReservationGetResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::InventoryReservationGetRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as InventoryService>::inventory_reservation_get(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = InventoryReservationGetSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        let mut response = http::Response::new(
                            tonic::body::Body::default(),
                        );
                        let headers = response.headers_mut();
                        headers
                            .insert(
                                tonic::Status::GRPC_STATUS,
                                (tonic::Code::Unimplemented as i32).into(),
                            );
                        headers
                            .insert(
                                http::header::CONTENT_TYPE,
                                tonic::metadata::GRPC_CONTENT_TYPE,
                            );
                        Ok(response)
                    })
                }
            }
        }
    }
    impl<T> Clone for InventoryServiceServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "inventory.v1.InventoryService";
    impl<T> tonic::server::NamedService for InventoryServiceServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
