// This file is @generated by prost-build.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BestSellingProductsRequest {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BestSellingProductsResponse {
    #[prost(oneof = "best_selling_products_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<best_selling_products_response::Response>,
}
/// Nested message and enum types in `BestSellingProductsResponse`.
pub mod best_selling_products_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        Data(super::BestSellingProductsResponseData),
        #[prost(message, tag = "2")]
        Error(super::super::super::shared::v1::AppError),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BestSellingProductsResponseData {
    #[prost(message, repeated, tag = "1")]
    pub products: ::prost::alloc::vec::Vec<BestSellingProductListItem>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BestSellingProductListItem {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub title: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub image: ::prost::alloc::string::String,
    #[prost(int64, tag = "4")]
    pub price_cents: i64,
    #[prost(int64, optional, tag = "5")]
    pub sale_price_cents: ::core::option::Option<i64>,
    /// E,g 43 => 4.3 rating
    #[prost(uint32, tag = "6")]
    pub rating: u32,
    #[prost(uint32, tag = "7")]
    pub sold_count: u32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateTag {
    #[prost(uint32, optional, tag = "1")]
    pub id: ::core::option::Option<u32>,
    #[prost(string, optional, tag = "2")]
    pub name: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequest {
    #[prost(message, optional, tag = "1")]
    pub identity: ::core::option::Option<ProductCreateRequestIdentity>,
    #[prost(message, optional, tag = "2")]
    pub description: ::core::option::Option<ProductCreateRequestDescription>,
    #[prost(message, optional, tag = "3")]
    pub details: ::core::option::Option<ProductCreateRequestDetails>,
    #[prost(message, optional, tag = "4")]
    pub media: ::core::option::Option<ProductCreateRequestMedia>,
    #[prost(message, optional, tag = "5")]
    pub offer: ::core::option::Option<ProductCreateRequestOffer>,
    #[prost(message, optional, tag = "6")]
    pub safety: ::core::option::Option<ProductCreateRequestSafety>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestIdentity {
    #[prost(string, tag = "1")]
    pub title: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub category: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub subcategory: ::prost::alloc::string::String,
    #[prost(bool, tag = "4")]
    pub has_variations: bool,
    #[prost(string, tag = "5")]
    pub brand_name: ::prost::alloc::string::String,
    #[prost(bool, tag = "6")]
    pub no_brand: bool,
    #[prost(string, tag = "7")]
    pub product_id: ::prost::alloc::string::String,
    #[prost(string, tag = "8")]
    pub product_id_type: ::prost::alloc::string::String,
    #[prost(bool, tag = "9")]
    pub no_product_id: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestDescription {
    #[prost(string, tag = "1")]
    pub description: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "2")]
    pub bullet_points: ::prost::alloc::vec::Vec<ProductCreateRequestBulletPoint>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestBulletPoint {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub bullet_point: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestDetails {
    /// attributes that has include_in_variants = false, so they are existed
    /// if in both (with_variants, without_variants)
    #[prost(map = "string, message", tag = "1")]
    pub shared: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::shared::v1::Any,
    >,
    #[prost(oneof = "product_create_request_details::Details", tags = "2, 3")]
    pub details: ::core::option::Option<product_create_request_details::Details>,
}
/// Nested message and enum types in `ProductCreateRequestDetails`.
pub mod product_create_request_details {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Details {
        #[prost(message, tag = "2")]
        WithVariants(super::ProductCreateRequestDetailsWithVariants),
        #[prost(message, tag = "3")]
        WithoutVariants(super::ProductCreateRequestDetailsWithoutVariants),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestDetailsWithVariants {
    /// an array of details for values for each product's details variant
    #[prost(message, repeated, tag = "1")]
    pub variants: ::prost::alloc::vec::Vec<ProductCreateRequestDetailsVariantForm>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestDetailsVariantForm {
    /// <attribute_id, attribute value>
    #[prost(map = "string, message", tag = "1")]
    pub form: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::shared::v1::Any,
    >,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestDetailsWithoutVariants {
    /// <attribute_id, attribute value>
    #[prost(map = "string, message", tag = "1")]
    pub form: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::shared::v1::Any,
    >,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestMedia {
    /// total size in bytes, so this size is used to decide how to upload the media,
    /// either with resumable uploading or directly if media files aren't so big
    #[prost(uint64, tag = "1")]
    pub total_size: u64,
    #[prost(oneof = "product_create_request_media::Media", tags = "2, 3")]
    pub media: ::core::option::Option<product_create_request_media::Media>,
}
/// Nested message and enum types in `ProductCreateRequestMedia`.
pub mod product_create_request_media {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Media {
        #[prost(message, tag = "2")]
        WithVariants(super::ProductCreateRequestMediaWithVariants),
        #[prost(message, tag = "3")]
        WithoutVariants(super::ProductCreateRequestMediaWithoutVariants),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestMediaWithVariants {
    #[prost(map = "string, message", tag = "1")]
    pub images: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::shared::v1::Attachments,
    >,
    #[prost(map = "string, message", tag = "2")]
    pub videos: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::shared::v1::Attachments,
    >,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestMediaWithoutVariants {
    #[prost(message, repeated, tag = "1")]
    pub images: ::prost::alloc::vec::Vec<super::super::shared::v1::Attachment>,
    #[prost(message, repeated, tag = "2")]
    pub videos: ::prost::alloc::vec::Vec<super::super::shared::v1::Attachment>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestOffer {
    #[prost(string, tag = "1")]
    pub currency: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub fulfillment_type: ::prost::alloc::string::String,
    #[prost(uint64, tag = "3")]
    pub processing_time: u64,
    #[prost(oneof = "product_create_request_offer::Pricing", tags = "4, 5")]
    pub pricing: ::core::option::Option<product_create_request_offer::Pricing>,
}
/// Nested message and enum types in `ProductCreateRequestOffer`.
pub mod product_create_request_offer {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Pricing {
        #[prost(message, tag = "4")]
        WithVariants(super::ProductCreateRequestOfferWithVariants),
        #[prost(message, tag = "5")]
        WithoutVariants(super::ProductCreateRequestOfferWithoutVariants),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestOfferWithVariants {
    #[prost(message, repeated, tag = "1")]
    pub variants: ::prost::alloc::vec::Vec<ProductCreateRequestOfferVariant>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestOfferVariant {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub sku: ::prost::alloc::string::String,
    #[prost(uint64, tag = "3")]
    pub quantity: u64,
    #[prost(string, tag = "4")]
    pub price: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub offering_condition: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "6")]
    pub condition_note: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "7")]
    pub list_price: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(bool, optional, tag = "8")]
    pub has_sale_price: ::core::option::Option<bool>,
    #[prost(string, optional, tag = "9")]
    pub sale_price: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "10")]
    pub sale_price_start: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "11")]
    pub sale_price_end: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(bool, tag = "12")]
    pub has_minimum_orders: bool,
    #[prost(message, repeated, tag = "13")]
    pub minimum_orders: ::prost::alloc::vec::Vec<ProductCreateRequestOfferMinimumOrder>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestOfferWithoutVariants {
    #[prost(string, tag = "1")]
    pub sku: ::prost::alloc::string::String,
    #[prost(uint64, tag = "2")]
    pub quantity: u64,
    #[prost(string, tag = "3")]
    pub price: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub offering_condition: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "5")]
    pub condition_note: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "6")]
    pub list_price: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(bool, optional, tag = "7")]
    pub has_sale_price: ::core::option::Option<bool>,
    #[prost(string, optional, tag = "8")]
    pub sale_price: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "9")]
    pub sale_price_start: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "10")]
    pub sale_price_end: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(bool, tag = "11")]
    pub has_minimum_orders: bool,
    #[prost(message, repeated, tag = "12")]
    pub minimum_orders: ::prost::alloc::vec::Vec<ProductCreateRequestOfferMinimumOrder>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestOfferMinimumOrder {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub price: ::prost::alloc::string::String,
    #[prost(uint64, tag = "3")]
    pub quantity: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateRequestSafety {
    #[prost(bool, tag = "1")]
    pub attestation: bool,
    #[prost(map = "string, message", tag = "2")]
    pub form: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::shared::v1::Any,
    >,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreateResponse {
    #[prost(oneof = "product_create_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<product_create_response::Response>,
}
/// Nested message and enum types in `ProductCreateResponse`.
pub mod product_create_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, PartialEq, ::prost::Message)]
pub struct ProductBulletPoint {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub text: ::prost::alloc::string::String,
    #[prost(uint64, tag = "3")]
    pub created_at: u64,
    #[prost(uint64, optional, tag = "4")]
    pub updated_at: ::core::option::Option<u64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductDetails {
    /// non customizable details for variants (can be empty of all the attributes customizable)
    #[prost(map = "string, message", tag = "1")]
    pub shared: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::shared::v1::Any,
    >,
    /// no need to store the data separately (E.g. with_variants, no_variant) because
    /// we can do a simple check: length === 1 ? So there is no variants
    /// for this product, and also this allow us later on to make the user be able
    /// to add variants to an existing product
    ///
    /// <variant_id, details>
    #[prost(map = "string, message", tag = "2")]
    pub details: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ProductDetailsVariant,
    >,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductDetailsVariant {
    #[prost(string, tag = "1")]
    pub variant_name: ::prost::alloc::string::String,
    #[prost(map = "string, message", tag = "2")]
    pub variant_data: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::shared::v1::Any,
    >,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductMedia {
    /// <variant_id, media>
    #[prost(map = "string, message", tag = "1")]
    pub media: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ProductMediaVariant,
    >,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductMediaVariant {
    /// <attachment_id , attachment>
    #[prost(map = "string, message", tag = "1")]
    pub images: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ProductMediaImage,
    >,
    /// <attachment_id , attachment>
    #[prost(map = "string, message", tag = "2")]
    pub videos: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ProductMediaVideo,
    >,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductMediaImage {
    #[prost(string, tag = "1")]
    pub format: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub url: ::prost::alloc::string::String,
    #[prost(uint64, tag = "3")]
    pub size: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductMediaVideo {
    #[prost(string, tag = "1")]
    pub format: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub url: ::prost::alloc::string::String,
    #[prost(uint64, tag = "3")]
    pub size: u64,
    #[prost(uint64, tag = "4")]
    pub duration: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductOffer {
    /// <variant_id, offer>
    #[prost(map = "string, message", tag = "2")]
    pub offer: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ProductOfferVariant,
    >,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductOfferVariant {
    #[prost(string, tag = "2")]
    pub sku: ::prost::alloc::string::String,
    #[prost(uint64, tag = "3")]
    pub quantity: u64,
    #[prost(string, tag = "4")]
    pub price: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub offering_condition: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "6")]
    pub condition_note: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "7")]
    pub list_price: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(bool, tag = "8")]
    pub has_sale_price: bool,
    #[prost(string, optional, tag = "9")]
    pub sale_price: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "10")]
    pub sale_price_start: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "11")]
    pub sale_price_end: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(bool, tag = "12")]
    pub has_minimum_orders: bool,
    #[prost(message, repeated, tag = "13")]
    pub minimum_orders: ::prost::alloc::vec::Vec<ProductOfferMinimumOrder>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductOfferMinimumOrder {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub price: ::prost::alloc::string::String,
    #[prost(uint64, tag = "3")]
    pub quantity: u64,
    #[prost(uint64, tag = "4")]
    pub created_at: u64,
    #[prost(uint64, optional, tag = "5")]
    pub updated_at: ::core::option::Option<u64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductSafety {
    #[prost(map = "string, message", tag = "1")]
    pub safety: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::shared::v1::Any,
    >,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductTag {
    #[prost(uint32, optional, tag = "1")]
    pub id: ::core::option::Option<u32>,
    #[prost(string, optional, tag = "2")]
    pub name: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductTags {
    #[prost(message, repeated, tag = "1")]
    pub tags: ::prost::alloc::vec::Vec<ProductTag>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ProductMetadata {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Product {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub user_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub title: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub category: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub subcategory: ::prost::alloc::string::String,
    #[prost(bool, tag = "6")]
    pub has_variations: bool,
    #[prost(string, optional, tag = "7")]
    pub brand_name: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(bool, tag = "8")]
    pub has_brand_name: bool,
    #[prost(string, optional, tag = "9")]
    pub product_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(bool, tag = "10")]
    pub has_product_id: bool,
    #[prost(string, optional, tag = "11")]
    pub product_id_type: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, tag = "12")]
    pub description: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "13")]
    pub bullet_points: ::prost::alloc::vec::Vec<ProductBulletPoint>,
    #[prost(string, tag = "14")]
    pub currency_code: ::prost::alloc::string::String,
    #[prost(string, tag = "15")]
    pub fulfillment_type: ::prost::alloc::string::String,
    #[prost(uint64, tag = "16")]
    pub processing_time: u64,
    #[prost(message, optional, tag = "17")]
    pub details: ::core::option::Option<ProductDetails>,
    #[prost(message, optional, tag = "18")]
    pub media: ::core::option::Option<ProductMedia>,
    #[prost(message, optional, tag = "19")]
    pub offer: ::core::option::Option<ProductOffer>,
    #[prost(message, optional, tag = "20")]
    pub safety: ::core::option::Option<ProductSafety>,
    #[prost(message, repeated, tag = "21")]
    pub tags: ::prost::alloc::vec::Vec<ProductTag>,
    #[prost(message, optional, tag = "22")]
    pub metadata: ::core::option::Option<ProductMetadata>,
    #[prost(bool, tag = "23")]
    pub ar_enabled: bool,
    #[prost(string, tag = "24")]
    pub slug: ::prost::alloc::string::String,
    #[prost(string, tag = "25")]
    pub status: ::prost::alloc::string::String,
    #[prost(uint32, tag = "26")]
    pub version: u32,
    #[prost(uint32, tag = "27")]
    pub schema_version: u32,
    #[prost(uint64, tag = "28")]
    pub created_at: u64,
    #[prost(uint64, optional, tag = "29")]
    pub published_at: ::core::option::Option<u64>,
    #[prost(uint64, optional, tag = "30")]
    pub updated_at: ::core::option::Option<u64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Category {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub image: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "4")]
    pub translations: ::prost::alloc::vec::Vec<CategoryTranslations>,
    #[prost(message, repeated, tag = "5")]
    pub subcategories: ::prost::alloc::vec::Vec<Subcategory>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CategoryTranslations {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub language: ::prost::alloc::string::String,
    #[prost(int32, tag = "3")]
    pub version: i32,
    #[prost(map = "string, message", tag = "4")]
    pub subcategories: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        SubcategoryTranslations,
    >,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubcategoryTranslations {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(map = "string, message", tag = "2")]
    pub attributes: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        SubcategoryAttributeTranslation,
    >,
    #[prost(map = "string, message", tag = "3")]
    pub data: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::shared::v1::StringMap,
    >,
    #[prost(message, optional, tag = "4")]
    pub safety: ::core::option::Option<SubcategorySafetyTranslation>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubcategoryAttributeTranslation {
    #[prost(string, tag = "1")]
    pub label: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub placeholder: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub info: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubcategorySafetyTranslation {
    #[prost(map = "string, message", tag = "1")]
    pub attributes: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        SubcategoryAttributeTranslation,
    >,
    #[prost(map = "string, message", tag = "2")]
    pub data: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        super::super::shared::v1::StringMap,
    >,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Subcategory {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    #[prost(int32, tag = "3")]
    pub version: i32,
    #[prost(string, tag = "4")]
    pub created_at: ::prost::alloc::string::String,
    #[prost(map = "string, message", tag = "5")]
    pub attributes: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        SubcategoryAttribute,
    >,
    #[prost(map = "string, message", tag = "6")]
    pub safety: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        SubcategorySafety,
    >,
}
/// Top-level attribute with a typed validation
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubcategoryAttribute {
    /// wither this attribute required or optional
    #[prost(bool, tag = "1")]
    pub required: bool,
    /// input, select, tags ...
    #[prost(string, tag = "2")]
    pub r#type: ::prost::alloc::string::String,
    /// wither this attributes can be customized for each variation or it must be shared
    /// by all of the product's variations
    #[prost(bool, tag = "3")]
    pub include_in_variants: bool,
    /// reference id to the attributes table (E.g weight is common for many products types,
    /// so instead rewriting it each time, we store it in another table)
    #[prost(string, optional, tag = "4")]
    pub reference: ::core::option::Option<::prost::alloc::string::String>,
    /// for select type (E.g. \['white', 'black', ...\])
    #[prost(string, repeated, tag = "5")]
    pub string_array: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// for select type (E.g. multiple colors)
    #[prost(bool, optional, tag = "6")]
    pub is_multiple: ::core::option::Option<bool>,
    /// validation rules of this attribute
    #[prost(message, optional, tag = "7")]
    pub validation: ::core::option::Option<super::super::shared::v1::ValidationField>,
}
/// Top-level safety attribute with a typed validation
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubcategorySafety {
    /// wither this attribute required or optional
    #[prost(bool, tag = "1")]
    pub required: bool,
    /// input, select, tags ...
    #[prost(string, tag = "2")]
    pub r#type: ::prost::alloc::string::String,
    /// reference id to the attributes table (E.g weight is common for many products types,
    /// so instead rewriting it each time, we store it in another table)
    #[prost(string, optional, tag = "3")]
    pub reference: ::core::option::Option<::prost::alloc::string::String>,
    /// for select type (E.g. \['white', 'black', ...\])
    #[prost(string, repeated, tag = "4")]
    pub string_array: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// for select type (E.g. multiple colors)
    #[prost(bool, optional, tag = "5")]
    pub is_multiple: ::core::option::Option<bool>,
    /// validation rules of this attribute
    #[prost(message, optional, tag = "6")]
    pub validation: ::core::option::Option<super::super::shared::v1::ValidationField>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductDataResponseData {
    #[prost(message, optional, tag = "1")]
    pub subcategory: ::core::option::Option<ProductDataResponseSubcategory>,
    #[prost(message, optional, tag = "2")]
    pub tags: ::core::option::Option<ProductTags>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductDataResponseSubcategory {
    #[prost(message, optional, tag = "1")]
    pub data: ::core::option::Option<Subcategory>,
    #[prost(message, optional, tag = "2")]
    pub translations: ::core::option::Option<SubcategoryTranslations>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductDataRequest {
    #[prost(message, optional, tag = "1")]
    pub subcategory: ::core::option::Option<ProductDataRequestCategory>,
    #[prost(bool, optional, tag = "2")]
    pub get_tags: ::core::option::Option<bool>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductDataRequestCategory {
    #[prost(string, tag = "1")]
    pub category: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub subcategory: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductDataResponse {
    #[prost(oneof = "product_data_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<product_data_response::Response>,
}
/// Nested message and enum types in `ProductDataResponse`.
pub mod product_data_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        Data(super::ProductDataResponseData),
        #[prost(message, tag = "2")]
        Error(super::super::super::shared::v1::AppError),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductPrice {
    #[prost(float, tag = "1")]
    pub amount: f32,
    #[prost(string, tag = "2")]
    pub formatted: ::prost::alloc::string::String,
    #[prost(float, optional, tag = "3")]
    pub discount_price: ::core::option::Option<f32>,
    #[prost(string, optional, tag = "4")]
    pub save_amount: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "5")]
    pub save_percentage: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductShippingInfo {
    #[prost(bool, tag = "1")]
    pub free: bool,
    #[prost(enumeration = "ProductShippingMethod", tag = "2")]
    pub method: i32,
    #[prost(string, tag = "3")]
    pub origin: ::prost::alloc::string::String,
    #[prost(int32, tag = "4")]
    pub min_estimated_days: i32,
    #[prost(int32, tag = "5")]
    pub max_estimated_days: i32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductItemMetadata {
    #[prost(enumeration = "ProductItemMetadataType", tag = "1")]
    pub r#type: i32,
    #[prost(string, tag = "2")]
    pub label: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductItem {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub title: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub image: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "4")]
    pub price: ::core::option::Option<ProductPrice>,
    #[prost(float, optional, tag = "5")]
    pub rating: ::core::option::Option<f32>,
    #[prost(int32, optional, tag = "6")]
    pub sold: ::core::option::Option<i32>,
    #[prost(message, repeated, tag = "7")]
    pub meta: ::prost::alloc::vec::Vec<ProductItemMetadata>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductListItem {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub user_id: ::prost::alloc::string::String,
    #[prost(string, tag = "6")]
    pub title: ::prost::alloc::string::String,
    #[prost(string, tag = "7")]
    pub description: ::prost::alloc::string::String,
    #[prost(string, tag = "8")]
    pub slug: ::prost::alloc::string::String,
    #[prost(string, tag = "9")]
    pub price: ::prost::alloc::string::String,
    #[prost(string, tag = "10")]
    pub currency_code: ::prost::alloc::string::String,
    #[prost(bool, tag = "13")]
    pub ar_enabled: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductListRequest {
    #[prost(uint32, tag = "1")]
    pub page: u32,
    #[prost(string, tag = "2")]
    pub last_id: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "3")]
    pub order_price: ::core::option::Option<super::super::shared::v1::OrderDirection>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductListResponse {
    #[prost(oneof = "product_list_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<product_list_response::Response>,
}
/// Nested message and enum types in `ProductListResponse`.
pub mod product_list_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        Data(super::ProductListResponseData),
        #[prost(message, tag = "2")]
        Error(super::super::super::shared::v1::AppError),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductListResponseData {
    #[prost(message, repeated, tag = "1")]
    pub data: ::prost::alloc::vec::Vec<ProductListItem>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProductShippingMethod {
    Standard = 0,
    Express = 1,
}
impl ProductShippingMethod {
    /// 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::Standard => "STANDARD",
            Self::Express => "EXPRESS",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "STANDARD" => Some(Self::Standard),
            "EXPRESS" => Some(Self::Express),
            _ => None,
        }
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProductItemMetadataType {
    Cupon = 0,
    NewShopper = 1,
    Bundle = 2,
}
impl ProductItemMetadataType {
    /// 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::Cupon => "CUPON",
            Self::NewShopper => "NEW_SHOPPER",
            Self::Bundle => "BUNDLE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "CUPON" => Some(Self::Cupon),
            "NEW_SHOPPER" => Some(Self::NewShopper),
            "BUNDLE" => Some(Self::Bundle),
            _ => None,
        }
    }
}
/// minimal product data used mostly for creating orders
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductSnapshot {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub title: ::prost::alloc::string::String,
    #[prost(uint32, tag = "3")]
    pub version: u32,
    #[prost(uint32, tag = "4")]
    pub schema_version: u32,
    #[prost(message, optional, tag = "5")]
    pub offer: ::core::option::Option<ProductOffer>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductSnapshotRequest {
    #[prost(string, tag = "1")]
    pub product_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductSnapshotResponse {
    #[prost(oneof = "product_snapshot_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<product_snapshot_response::Response>,
}
/// Nested message and enum types in `ProductSnapshotResponse`.
pub mod product_snapshot_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        Data(super::ProductSnapshot),
        #[prost(message, tag = "2")]
        Error(super::super::super::shared::v1::AppError),
    }
}
/// Generated client implementations.
pub mod products_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 ProductsServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl ProductsServiceClient<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> ProductsServiceClient<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,
        ) -> ProductsServiceClient<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,
        {
            ProductsServiceClient::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
        }
        pub async fn product_create(
            &mut self,
            request: impl tonic::IntoRequest<super::ProductCreateRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ProductCreateResponse>,
            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(
                "/products.v1.ProductsService/ProductCreate",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("products.v1.ProductsService", "ProductCreate"));
            self.inner.unary(req, path, codec).await
        }
        pub async fn product_data(
            &mut self,
            request: impl tonic::IntoRequest<super::ProductDataRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ProductDataResponse>,
            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(
                "/products.v1.ProductsService/ProductData",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("products.v1.ProductsService", "ProductData"));
            self.inner.unary(req, path, codec).await
        }
        pub async fn product_list(
            &mut self,
            request: impl tonic::IntoRequest<super::ProductListRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ProductListResponse>,
            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(
                "/products.v1.ProductsService/ProductList",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("products.v1.ProductsService", "ProductList"));
            self.inner.unary(req, path, codec).await
        }
        pub async fn product_snapshot(
            &mut self,
            request: impl tonic::IntoRequest<super::ProductSnapshotRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ProductSnapshotResponse>,
            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(
                "/products.v1.ProductsService/ProductSnapshot",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("products.v1.ProductsService", "ProductSnapshot"),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn best_selling_products(
            &mut self,
            request: impl tonic::IntoRequest<super::BestSellingProductsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::BestSellingProductsResponse>,
            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(
                "/products.v1.ProductsService/BestSellingProducts",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("products.v1.ProductsService", "BestSellingProducts"),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod products_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 ProductsServiceServer.
    #[async_trait]
    pub trait ProductsService: std::marker::Send + std::marker::Sync + 'static {
        async fn product_create(
            &self,
            request: tonic::Request<super::ProductCreateRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ProductCreateResponse>,
            tonic::Status,
        >;
        async fn product_data(
            &self,
            request: tonic::Request<super::ProductDataRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ProductDataResponse>,
            tonic::Status,
        >;
        async fn product_list(
            &self,
            request: tonic::Request<super::ProductListRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ProductListResponse>,
            tonic::Status,
        >;
        async fn product_snapshot(
            &self,
            request: tonic::Request<super::ProductSnapshotRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ProductSnapshotResponse>,
            tonic::Status,
        >;
        async fn best_selling_products(
            &self,
            request: tonic::Request<super::BestSellingProductsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::BestSellingProductsResponse>,
            tonic::Status,
        >;
    }
    #[derive(Debug)]
    pub struct ProductsServiceServer<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> ProductsServiceServer<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 ProductsServiceServer<T>
    where
        T: ProductsService,
        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() {
                "/products.v1.ProductsService/ProductCreate" => {
                    #[allow(non_camel_case_types)]
                    struct ProductCreateSvc<T: ProductsService>(pub Arc<T>);
                    impl<
                        T: ProductsService,
                    > tonic::server::UnaryService<super::ProductCreateRequest>
                    for ProductCreateSvc<T> {
                        type Response = super::ProductCreateResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ProductCreateRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as ProductsService>::product_create(&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 = ProductCreateSvc(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)
                }
                "/products.v1.ProductsService/ProductData" => {
                    #[allow(non_camel_case_types)]
                    struct ProductDataSvc<T: ProductsService>(pub Arc<T>);
                    impl<
                        T: ProductsService,
                    > tonic::server::UnaryService<super::ProductDataRequest>
                    for ProductDataSvc<T> {
                        type Response = super::ProductDataResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ProductDataRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as ProductsService>::product_data(&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 = ProductDataSvc(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)
                }
                "/products.v1.ProductsService/ProductList" => {
                    #[allow(non_camel_case_types)]
                    struct ProductListSvc<T: ProductsService>(pub Arc<T>);
                    impl<
                        T: ProductsService,
                    > tonic::server::UnaryService<super::ProductListRequest>
                    for ProductListSvc<T> {
                        type Response = super::ProductListResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ProductListRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as ProductsService>::product_list(&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 = ProductListSvc(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)
                }
                "/products.v1.ProductsService/ProductSnapshot" => {
                    #[allow(non_camel_case_types)]
                    struct ProductSnapshotSvc<T: ProductsService>(pub Arc<T>);
                    impl<
                        T: ProductsService,
                    > tonic::server::UnaryService<super::ProductSnapshotRequest>
                    for ProductSnapshotSvc<T> {
                        type Response = super::ProductSnapshotResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ProductSnapshotRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as ProductsService>::product_snapshot(&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 = ProductSnapshotSvc(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)
                }
                "/products.v1.ProductsService/BestSellingProducts" => {
                    #[allow(non_camel_case_types)]
                    struct BestSellingProductsSvc<T: ProductsService>(pub Arc<T>);
                    impl<
                        T: ProductsService,
                    > tonic::server::UnaryService<super::BestSellingProductsRequest>
                    for BestSellingProductsSvc<T> {
                        type Response = super::BestSellingProductsResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::BestSellingProductsRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as ProductsService>::best_selling_products(
                                        &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 = BestSellingProductsSvc(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 ProductsServiceServer<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 = "products.v1.ProductsService";
    impl<T> tonic::server::NamedService for ProductsServiceServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChangeFeed {
    #[prost(message, optional, tag = "1")]
    pub after: ::core::option::Option<ProductOutbox>,
    #[prost(message, optional, tag = "2")]
    pub before: ::core::option::Option<ProductOutbox>,
    #[prost(int64, tag = "3")]
    pub updated: i64,
    #[prost(int64, tag = "4")]
    pub resolved: i64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductOutbox {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// in other word: the aggregate id
    #[prost(string, tag = "2")]
    pub product_id: ::prost::alloc::string::String,
    /// 'created'|'updated'|'deleted'
    #[prost(string, tag = "3")]
    pub r#type: ::prost::alloc::string::String,
    /// unix timestamp
    #[prost(int64, optional, tag = "4")]
    pub processed_at: ::core::option::Option<i64>,
    #[prost(uint32, tag = "5")]
    pub processing_attempts: u32,
    #[prost(string, optional, tag = "6")]
    pub last_error: ::core::option::Option<::prost::alloc::string::String>,
    /// unix timestamp
    #[prost(int64, tag = "7")]
    pub created_at: i64,
    #[prost(int64, tag = "8")]
    pub updated_at: i64,
    #[prost(oneof = "product_outbox::Payload", tags = "9, 10, 11")]
    pub payload: ::core::option::Option<product_outbox::Payload>,
}
/// Nested message and enum types in `ProductOutbox`.
pub mod product_outbox {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Payload {
        #[prost(message, tag = "9")]
        Created(super::ProductCreatedEvent),
        #[prost(message, tag = "10")]
        Updated(super::ProductUpdatedEvent),
        #[prost(message, tag = "11")]
        Deleted(super::ProductDeletedEvent),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductCreatedEvent {
    #[prost(string, tag = "1")]
    pub title: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub description: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProductUpdatedEvent {
    #[prost(string, optional, tag = "1")]
    pub title: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "2")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ProductDeletedEvent {}
