// This file is @generated by prost-build.
/// Local Inventory for the merchant.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LfpInventory {
    /// Output only. Identifier. The name for the `LfpInventory` resource.
    /// Format:
    /// `accounts/{account}/lfpInventories/{target_merchant}~{store_code}~{offer}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. The Merchant Center ID of the merchant to submit the inventory
    /// for.
    #[prost(int64, tag = "2")]
    pub target_account: i64,
    /// Required. The identifier of the merchant's store. Either the store code
    /// inserted through `InsertLfpStore` or the store code in the Business
    /// Profile.
    #[prost(string, tag = "3")]
    pub store_code: ::prost::alloc::string::String,
    /// Required. Immutable. A unique identifier for the product. If both
    /// inventories and sales are submitted for a merchant, this id should match
    /// for the same product.
    ///
    /// **Note**: if the merchant sells the same product new and used, they should
    /// have different IDs.
    #[prost(string, tag = "4")]
    pub offer_id: ::prost::alloc::string::String,
    /// Required. The [CLDR territory
    /// code](<https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml>)
    /// for the country where the product is sold.
    #[prost(string, tag = "5")]
    pub region_code: ::prost::alloc::string::String,
    /// Required. The two-letter ISO 639-1 language code for the item.
    #[prost(string, tag = "6")]
    pub content_language: ::prost::alloc::string::String,
    /// Optional. The Global Trade Item Number of the product.
    #[prost(string, optional, tag = "7")]
    pub gtin: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional. The current price of the product.
    #[prost(message, optional, tag = "8")]
    pub price: ::core::option::Option<super::super::super::r#type::Price>,
    /// Required. Availability of the product at this store.
    /// For accepted attribute values, see the [local product inventory data
    /// specification](<https://support.google.com/merchants/answer/3061342>)
    #[prost(string, tag = "9")]
    pub availability: ::prost::alloc::string::String,
    /// Optional. Quantity of the product available at this store. Must be greater
    /// than or equal to zero.
    #[prost(int64, optional, tag = "10")]
    pub quantity: ::core::option::Option<i64>,
    /// Optional. The time when the inventory is collected. If not set, it will be
    /// set to the time when the inventory is submitted.
    #[prost(message, optional, tag = "11")]
    pub collection_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Optional. Supported pickup method for this offer. Unless the value is "not
    /// supported", this field must be submitted together with `pickupSla`. For
    /// accepted attribute values, see the [local product inventory data
    /// specification](<https://support.google.com/merchants/answer/3061342>).
    #[prost(string, optional, tag = "12")]
    pub pickup_method: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional. Expected date that an order will be ready for pickup relative to
    /// the order date. Must be submitted together with `pickupMethod`. For
    /// accepted attribute values, see the [local product inventory data
    /// specification](<https://support.google.com/merchants/answer/3061342>).
    #[prost(string, optional, tag = "13")]
    pub pickup_sla: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional. The [feed
    /// label](<https://developers.google.com/shopping-content/guides/products/feed-labels>)
    /// for the product. If this is not set, it will default to `regionCode`.
    #[prost(string, optional, tag = "14")]
    pub feed_label: ::core::option::Option<::prost::alloc::string::String>,
}
/// Request message for the `InsertLfpInventory` method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InsertLfpInventoryRequest {
    /// Required. The LFP provider account.
    /// Format: `accounts/{account}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The inventory to insert.
    #[prost(message, optional, tag = "2")]
    pub lfp_inventory: ::core::option::Option<LfpInventory>,
}
/// Generated client implementations.
pub mod lfp_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;
    /// Service for a [LFP
    /// partner](https://support.google.com/merchants/answer/7676652) to submit local
    /// inventories for a merchant.
    #[derive(Debug, Clone)]
    pub struct LfpInventoryServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl LfpInventoryServiceClient<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> LfpInventoryServiceClient<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,
        ) -> LfpInventoryServiceClient<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,
        {
            LfpInventoryServiceClient::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
        }
        /// Inserts a `LfpInventory` resource for the given target merchant account. If
        /// the resource already exists, it will be replaced. The inventory
        /// automatically expires after 30 days.
        pub async fn insert_lfp_inventory(
            &mut self,
            request: impl tonic::IntoRequest<super::InsertLfpInventoryRequest>,
        ) -> std::result::Result<tonic::Response<super::LfpInventory>, 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(
                "/google.shopping.merchant.lfp.v1beta.LfpInventoryService/InsertLfpInventory",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.lfp.v1beta.LfpInventoryService",
                        "InsertLfpInventory",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// The LFP state of a merchant.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LfpMerchantState {
    /// Identifier. The name of the `LfpMerchantState` resource. Format:
    /// `accounts/{account}/lfpMerchantStates/{target_merchant}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Number of [GBPs](<https://www.google.com/business/>) this merchant has access
    /// to.
    #[prost(int64, tag = "2")]
    pub linked_gbps: i64,
    /// Output only. The state per store from the specified merchant. The field
    /// will be absent if the merchant has no stores submitted through LFP.
    #[prost(message, repeated, tag = "3")]
    pub store_states: ::prost::alloc::vec::Vec<lfp_merchant_state::LfpStoreState>,
    /// The inventory statistics for the merchant. The field will be absent if the
    /// merchant has no inventory submitted through LFP.
    #[prost(message, optional, tag = "4")]
    pub inventory_stats: ::core::option::Option<lfp_merchant_state::InventoryStats>,
    /// Country-specific settings for the merchant.
    #[prost(message, repeated, tag = "5")]
    pub country_settings: ::prost::alloc::vec::Vec<lfp_merchant_state::CountrySettings>,
}
/// Nested message and enum types in `LfpMerchantState`.
pub mod lfp_merchant_state {
    /// The state of a specific merchant's store.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct LfpStoreState {
        /// Required. Immutable. The identifier of this store.
        #[prost(string, tag = "1")]
        pub store_code: ::prost::alloc::string::String,
        /// Output only. The store matching state.
        #[prost(enumeration = "lfp_store_state::StoreMatchingState", tag = "2")]
        pub matching_state: i32,
        /// The hint of why the matching has failed (only set if matching_state is
        /// FAILED).
        #[prost(string, tag = "3")]
        pub matching_state_hint: ::prost::alloc::string::String,
    }
    /// Nested message and enum types in `LfpStoreState`.
    pub mod lfp_store_state {
        /// The state of matching `LfpStore` to a Google Business Profile listing.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum StoreMatchingState {
            /// Store matching state unspecified.
            Unspecified = 0,
            /// The `LfpStore` is successfully matched with a Google Business Profile
            /// store.
            Matched = 1,
            /// The `LfpStore` is not matched with a Google Business Profile store.
            Failed = 2,
        }
        impl StoreMatchingState {
            /// 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 => "STORE_MATCHING_STATE_UNSPECIFIED",
                    Self::Matched => "STORE_MATCHING_STATE_MATCHED",
                    Self::Failed => "STORE_MATCHING_STATE_FAILED",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "STORE_MATCHING_STATE_UNSPECIFIED" => Some(Self::Unspecified),
                    "STORE_MATCHING_STATE_MATCHED" => Some(Self::Matched),
                    "STORE_MATCHING_STATE_FAILED" => Some(Self::Failed),
                    _ => None,
                }
            }
        }
    }
    /// The inventory statistics for a merchant.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct InventoryStats {
        /// Number of entries (understanding entry as a pair of product and store)
        /// that were built based on provided inventories/sales and submitted to
        /// Google.
        #[prost(int64, tag = "1")]
        pub submitted_entries: i64,
        /// Number of submitted in stock entries.
        #[prost(int64, tag = "2")]
        pub submitted_in_stock_entries: i64,
        /// Number of entries that were built based on provided
        /// inventories/sales and couldn't be submitted to Google due to errors like
        /// missing product.
        #[prost(int64, tag = "3")]
        pub unsubmitted_entries: i64,
        /// Number of products from provided inventories/sales that were created from
        /// matches to existing online products provided by the merchant or to the
        /// Google catalog.
        #[prost(int64, tag = "4")]
        pub submitted_products: i64,
    }
    /// Country-specific settings for the merchant.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct CountrySettings {
        /// Required. The [CLDR territory
        /// code](<https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml>)
        /// for the country for which these settings are defined.
        #[prost(string, tag = "1")]
        pub region_code: ::prost::alloc::string::String,
        /// True if this merchant has enabled free local listings in MC.
        #[prost(bool, tag = "2")]
        pub free_local_listings_enabled: bool,
        /// True if this merchant has enabled local inventory ads in MC.
        #[prost(bool, tag = "3")]
        pub local_inventory_ads_enabled: bool,
        /// Output only. The verification state of this merchant's inventory check.
        #[prost(enumeration = "country_settings::VerificationState", tag = "4")]
        pub inventory_verification_state: i32,
        /// Output only. The product page type selected by this merchant.
        #[prost(enumeration = "country_settings::ProductPageType", tag = "5")]
        pub product_page_type: i32,
        /// Output only. The verification state of this merchant's instock serving
        /// feature.
        #[prost(enumeration = "country_settings::VerificationState", tag = "6")]
        pub instock_serving_verification_state: i32,
        /// Output only. The verification state of this merchant's pickup serving
        /// feature.
        #[prost(enumeration = "country_settings::VerificationState", tag = "7")]
        pub pickup_serving_verification_state: i32,
    }
    /// Nested message and enum types in `CountrySettings`.
    pub mod country_settings {
        /// The possible verification states for different merchant programs.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum VerificationState {
            /// Verification state unspecified.
            Unspecified = 0,
            /// Verification state not approved.
            NotApproved = 1,
            /// Verification state in progress.
            InProgress = 2,
            /// Verification state approved.
            Approved = 3,
        }
        impl VerificationState {
            /// 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 => "VERIFICATION_STATE_UNSPECIFIED",
                    Self::NotApproved => "VERIFICATION_STATE_NOT_APPROVED",
                    Self::InProgress => "VERIFICATION_STATE_IN_PROGRESS",
                    Self::Approved => "VERIFICATION_STATE_APPROVED",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "VERIFICATION_STATE_UNSPECIFIED" => Some(Self::Unspecified),
                    "VERIFICATION_STATE_NOT_APPROVED" => Some(Self::NotApproved),
                    "VERIFICATION_STATE_IN_PROGRESS" => Some(Self::InProgress),
                    "VERIFICATION_STATE_APPROVED" => Some(Self::Approved),
                    _ => None,
                }
            }
        }
        /// The possible [product page
        /// types](<https://support.google.com/merchants/topic/15148370>) for a
        /// merchant.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum ProductPageType {
            /// Product page type unspecified.
            Unspecified = 0,
            /// Google hosted product page.
            GoogleHosted = 1,
            /// Merchant hosted product page.
            MerchantHosted = 2,
            /// Merchant hosted store specific product page.
            MerchantHostedStoreSpecific = 3,
        }
        impl ProductPageType {
            /// 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 => "PRODUCT_PAGE_TYPE_UNSPECIFIED",
                    Self::GoogleHosted => "GOOGLE_HOSTED",
                    Self::MerchantHosted => "MERCHANT_HOSTED",
                    Self::MerchantHostedStoreSpecific => "MERCHANT_HOSTED_STORE_SPECIFIC",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "PRODUCT_PAGE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                    "GOOGLE_HOSTED" => Some(Self::GoogleHosted),
                    "MERCHANT_HOSTED" => Some(Self::MerchantHosted),
                    "MERCHANT_HOSTED_STORE_SPECIFIC" => {
                        Some(Self::MerchantHostedStoreSpecific)
                    }
                    _ => None,
                }
            }
        }
    }
}
/// Request message for the GetLfpMerchantState method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetLfpMerchantStateRequest {
    /// Required. The name of the state to retrieve.
    /// Format: `accounts/{account}/lfpMerchantStates/{target_merchant}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod lfp_merchant_state_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service for a [LFP
    /// partner](https://support.google.com/merchants/answer/7676652) to get the
    /// state of a merchant.
    #[derive(Debug, Clone)]
    pub struct LfpMerchantStateServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl LfpMerchantStateServiceClient<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> LfpMerchantStateServiceClient<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,
        ) -> LfpMerchantStateServiceClient<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,
        {
            LfpMerchantStateServiceClient::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
        }
        /// Gets the LFP state of a merchant
        pub async fn get_lfp_merchant_state(
            &mut self,
            request: impl tonic::IntoRequest<super::GetLfpMerchantStateRequest>,
        ) -> std::result::Result<
            tonic::Response<super::LfpMerchantState>,
            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(
                "/google.shopping.merchant.lfp.v1beta.LfpMerchantStateService/GetLfpMerchantState",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.lfp.v1beta.LfpMerchantStateService",
                        "GetLfpMerchantState",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// A sale for the merchant.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LfpSale {
    /// Output only. Identifier. The name of the `LfpSale` resource.
    /// Format:
    /// `accounts/{account}/lfpSales/{sale}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. The Merchant Center ID of the merchant to submit the sale for.
    #[prost(int64, tag = "2")]
    pub target_account: i64,
    /// Required. The identifier of the merchant's store. Either a `storeCode`
    /// inserted through the API or the code of the store in the Business Profile.
    #[prost(string, tag = "3")]
    pub store_code: ::prost::alloc::string::String,
    /// Required. A unique identifier for the product. If both inventories and
    /// sales are submitted for a merchant, this id should match for the same
    /// product.
    ///
    /// **Note**: if the merchant sells the same product new and used, they should
    /// have different IDs.
    #[prost(string, tag = "4")]
    pub offer_id: ::prost::alloc::string::String,
    /// Required. The [CLDR territory
    /// code](<https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml>)
    /// for the country where the product is sold.
    #[prost(string, tag = "5")]
    pub region_code: ::prost::alloc::string::String,
    /// Required. The two-letter ISO 639-1 language code for the item.
    #[prost(string, tag = "6")]
    pub content_language: ::prost::alloc::string::String,
    /// Required. The Global Trade Item Number of the sold product.
    #[prost(string, tag = "7")]
    pub gtin: ::prost::alloc::string::String,
    /// Required. The unit price of the product.
    #[prost(message, optional, tag = "8")]
    pub price: ::core::option::Option<super::super::super::r#type::Price>,
    /// Required. The relative change of the available quantity. Negative for items
    /// returned.
    #[prost(int64, tag = "9")]
    pub quantity: i64,
    /// Required. The timestamp for the sale.
    #[prost(message, optional, tag = "10")]
    pub sale_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. System generated globally unique ID for the `LfpSale`.
    #[prost(string, optional, tag = "11")]
    pub uid: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional. The [feed
    /// label](<https://developers.google.com/shopping-content/guides/products/feed-labels>)
    /// for the product. If this is not set, it will default to `regionCode`.
    #[prost(string, optional, tag = "12")]
    pub feed_label: ::core::option::Option<::prost::alloc::string::String>,
}
/// Request message for the InsertLfpSale method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InsertLfpSaleRequest {
    /// Required. The LFP provider account.
    /// Format: `accounts/{lfp_partner}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The sale to insert.
    #[prost(message, optional, tag = "2")]
    pub lfp_sale: ::core::option::Option<LfpSale>,
}
/// Generated client implementations.
pub mod lfp_sale_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service for a [LFP
    /// partner](https://support.google.com/merchants/answer/7676652) to submit sales
    /// data for a merchant.
    #[derive(Debug, Clone)]
    pub struct LfpSaleServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl LfpSaleServiceClient<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> LfpSaleServiceClient<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,
        ) -> LfpSaleServiceClient<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,
        {
            LfpSaleServiceClient::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
        }
        /// Inserts a `LfpSale` for the given merchant.
        pub async fn insert_lfp_sale(
            &mut self,
            request: impl tonic::IntoRequest<super::InsertLfpSaleRequest>,
        ) -> std::result::Result<tonic::Response<super::LfpSale>, 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(
                "/google.shopping.merchant.lfp.v1beta.LfpSaleService/InsertLfpSale",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.lfp.v1beta.LfpSaleService",
                        "InsertLfpSale",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// A store for the merchant. This will be used to match to a store under the
/// Google Business Profile of the target merchant. If a matching store can't be
/// found, the inventories or sales submitted with the store code will not be
/// used.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LfpStore {
    /// Output only. Identifier. The name of the `LfpStore` resource.
    /// Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. The Merchant Center id of the merchant to submit the store for.
    #[prost(int64, tag = "2")]
    pub target_account: i64,
    /// Required. Immutable. A store identifier that is unique for the target
    /// merchant.
    #[prost(string, tag = "3")]
    pub store_code: ::prost::alloc::string::String,
    /// Required. The street address of the store.
    /// Example: 1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA.
    #[prost(string, tag = "4")]
    pub store_address: ::prost::alloc::string::String,
    /// Optional. The merchant or store name.
    #[prost(string, optional, tag = "5")]
    pub store_name: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional. The store phone number in
    /// [E.164](<https://en.wikipedia.org/wiki/E.164>) format. Example:
    /// `+15556767888`
    #[prost(string, optional, tag = "6")]
    pub phone_number: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional. The website URL for the store or merchant.
    #[prost(string, optional, tag = "7")]
    pub website_uri: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional. [Google My Business category
    /// id](<https://gcid-explorer.corp.google.com/static/gcid.html>).
    #[prost(string, repeated, tag = "8")]
    pub gcid_category: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Optional. The [Google Place
    /// Id](<https://developers.google.com/maps/documentation/places/web-service/place-id#id-overview>)
    /// of the store location.
    #[prost(string, optional, tag = "9")]
    pub place_id: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional. Output only. The state of matching to a Google Business Profile.
    /// See
    /// \[matchingStateHint\]\[google.shopping.merchant.lfp.v1beta.LfpStore.matching_state_hint\]
    /// for further details if no match is found.
    #[prost(enumeration = "lfp_store::StoreMatchingState", tag = "10")]
    pub matching_state: i32,
    /// Optional. Output only. The hint of why the matching has failed. This is
    /// only set when
    /// \[matchingState\]\[google.shopping.merchant.lfp.v1beta.LfpStore.matching_state\]=`STORE_MATCHING_STATE_FAILED`.
    ///
    /// Possible values are:
    ///
    /// * "`linked-store-not-found`": There aren't any Google Business
    ///   Profile stores available for matching.
    /// * "`store-match-not-found`": The provided `LfpStore` couldn't be matched to
    ///   any of the connected Google Business Profile stores. Merchant Center
    ///   account is connected correctly and stores are available on Google Business
    ///   Profile, but the `LfpStore` location address does not match with Google
    ///   Business Profile stores' addresses. Update the `LfpStore` address or Google
    ///   Business Profile store address to match correctly.
    /// * "`store-match-unverified`": The provided `LfpStore` couldn't be matched
    ///   to any of the connected Google Business Profile stores, as the matched
    ///   Google Business Profile store is unverified. Go through the Google Business
    ///   Profile verification process to match correctly.
    #[prost(string, optional, tag = "11")]
    pub matching_state_hint: ::core::option::Option<::prost::alloc::string::String>,
}
/// Nested message and enum types in `LfpStore`.
pub mod lfp_store {
    /// The state of matching `LfpStore` to a Google Business Profile.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum StoreMatchingState {
        /// Store matching state unspecified.
        Unspecified = 0,
        /// The `LfpStore` is successfully matched with a Google Business Profile
        /// store.
        Matched = 1,
        /// The `LfpStore` is not matched with a Google Business Profile store.
        Failed = 2,
    }
    impl StoreMatchingState {
        /// 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 => "STORE_MATCHING_STATE_UNSPECIFIED",
                Self::Matched => "STORE_MATCHING_STATE_MATCHED",
                Self::Failed => "STORE_MATCHING_STATE_FAILED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STORE_MATCHING_STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "STORE_MATCHING_STATE_MATCHED" => Some(Self::Matched),
                "STORE_MATCHING_STATE_FAILED" => Some(Self::Failed),
                _ => None,
            }
        }
    }
}
/// Request message for the `GetLfpStore` method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetLfpStoreRequest {
    /// Required. The name of the store to retrieve.
    /// Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request message for the InsertLfpStore method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InsertLfpStoreRequest {
    /// Required. The LFP provider account
    /// Format: `accounts/{account}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The store to insert.
    #[prost(message, optional, tag = "2")]
    pub lfp_store: ::core::option::Option<LfpStore>,
}
/// Request message for the DeleteLfpStore method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteLfpStoreRequest {
    /// Required. The name of the store to delete for the target merchant account.
    /// Format: `accounts/{account}/lfpStores/{target_merchant}~{store_code}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request message for the ListLfpStores method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListLfpStoresRequest {
    /// Required. The LFP partner.
    /// Format: `accounts/{account}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The Merchant Center id of the merchant to list stores for.
    #[prost(int64, tag = "2")]
    pub target_account: i64,
    /// Optional. The maximum number of `LfpStore` resources for the given account
    /// to return. The service returns fewer than this value if the number of
    /// stores for the given account is less than the `pageSize`. The default value
    /// is 250. The maximum value is 1000; If a value higher than the maximum is
    /// specified, then the `pageSize` will default to the maximum.
    #[prost(int32, tag = "3")]
    pub page_size: i32,
    /// Optional. A page token, received from a previous `ListLfpStoresRequest`
    /// call. Provide the page token to retrieve the subsequent page. When
    /// paginating, all other parameters provided to `ListLfpStoresRequest` must
    /// match the call that provided the page token. The token returned as
    /// \[nextPageToken\]\[google.shopping.merchant.lfp.v1beta.ListLfpStoresResponse.next_page_token\]
    /// in the response to the previous request.
    #[prost(string, tag = "4")]
    pub page_token: ::prost::alloc::string::String,
}
/// Response message for the ListLfpStores method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListLfpStoresResponse {
    /// The stores from the specified merchant.
    #[prost(message, repeated, tag = "1")]
    pub lfp_stores: ::prost::alloc::vec::Vec<LfpStore>,
    /// A token, which can be sent as `pageToken` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod lfp_store_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service for a [LFP
    /// partner](https://support.google.com/merchants/answer/7676652) to submit local
    /// stores for a merchant.
    #[derive(Debug, Clone)]
    pub struct LfpStoreServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl LfpStoreServiceClient<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> LfpStoreServiceClient<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,
        ) -> LfpStoreServiceClient<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,
        {
            LfpStoreServiceClient::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
        }
        /// Retrieves information about a store.
        pub async fn get_lfp_store(
            &mut self,
            request: impl tonic::IntoRequest<super::GetLfpStoreRequest>,
        ) -> std::result::Result<tonic::Response<super::LfpStore>, 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(
                "/google.shopping.merchant.lfp.v1beta.LfpStoreService/GetLfpStore",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.lfp.v1beta.LfpStoreService",
                        "GetLfpStore",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Inserts a store for the target merchant. If the store with the same store
        /// code already exists, it will be replaced.
        pub async fn insert_lfp_store(
            &mut self,
            request: impl tonic::IntoRequest<super::InsertLfpStoreRequest>,
        ) -> std::result::Result<tonic::Response<super::LfpStore>, 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(
                "/google.shopping.merchant.lfp.v1beta.LfpStoreService/InsertLfpStore",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.lfp.v1beta.LfpStoreService",
                        "InsertLfpStore",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a store for a target merchant.
        pub async fn delete_lfp_store(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteLfpStoreRequest>,
        ) -> std::result::Result<tonic::Response<()>, 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(
                "/google.shopping.merchant.lfp.v1beta.LfpStoreService/DeleteLfpStore",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.lfp.v1beta.LfpStoreService",
                        "DeleteLfpStore",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists the stores of the target merchant, specified by the filter in
        /// `ListLfpStoresRequest`.
        pub async fn list_lfp_stores(
            &mut self,
            request: impl tonic::IntoRequest<super::ListLfpStoresRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListLfpStoresResponse>,
            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(
                "/google.shopping.merchant.lfp.v1beta.LfpStoreService/ListLfpStores",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.shopping.merchant.lfp.v1beta.LfpStoreService",
                        "ListLfpStores",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
