megacommerce_proto/
products.v1.rs

1// This file is @generated by prost-build.
2#[derive(serde::Serialize, serde::Deserialize)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct ProductCreateTag {
5    #[prost(uint32, optional, tag = "1")]
6    pub id: ::core::option::Option<u32>,
7    #[prost(string, optional, tag = "2")]
8    pub name: ::core::option::Option<::prost::alloc::string::String>,
9}
10#[derive(serde::Serialize, serde::Deserialize)]
11#[derive(Clone, PartialEq, ::prost::Message)]
12pub struct ProductCreateRequest {
13    #[prost(message, optional, tag = "1")]
14    pub identity: ::core::option::Option<ProductCreateRequestIdentity>,
15    #[prost(message, optional, tag = "2")]
16    pub description: ::core::option::Option<ProductCreateRequestDescription>,
17    #[prost(message, optional, tag = "3")]
18    pub details: ::core::option::Option<ProductCreateRequestDetails>,
19    #[prost(message, optional, tag = "4")]
20    pub media: ::core::option::Option<ProductCreateRequestMedia>,
21    #[prost(message, optional, tag = "5")]
22    pub offer: ::core::option::Option<ProductCreateRequestOffer>,
23    #[prost(message, optional, tag = "6")]
24    pub safety: ::core::option::Option<ProductCreateRequestSafety>,
25}
26#[derive(serde::Serialize, serde::Deserialize)]
27#[derive(Clone, PartialEq, ::prost::Message)]
28pub struct ProductCreateRequestIdentity {
29    #[prost(string, tag = "1")]
30    pub title: ::prost::alloc::string::String,
31    #[prost(string, tag = "2")]
32    pub category: ::prost::alloc::string::String,
33    #[prost(string, tag = "3")]
34    pub subcategory: ::prost::alloc::string::String,
35    #[prost(bool, tag = "4")]
36    pub has_variations: bool,
37    #[prost(string, tag = "5")]
38    pub brand_name: ::prost::alloc::string::String,
39    #[prost(bool, tag = "6")]
40    pub no_brand: bool,
41    #[prost(string, tag = "7")]
42    pub product_id: ::prost::alloc::string::String,
43    #[prost(string, tag = "8")]
44    pub product_id_type: ::prost::alloc::string::String,
45    #[prost(bool, tag = "9")]
46    pub no_product_id: bool,
47}
48#[derive(serde::Serialize, serde::Deserialize)]
49#[derive(Clone, PartialEq, ::prost::Message)]
50pub struct ProductCreateRequestDescription {
51    #[prost(string, tag = "1")]
52    pub description: ::prost::alloc::string::String,
53    #[prost(message, repeated, tag = "2")]
54    pub bullet_points: ::prost::alloc::vec::Vec<ProductCreateRequestBulletPoint>,
55}
56#[derive(serde::Serialize, serde::Deserialize)]
57#[derive(Clone, PartialEq, ::prost::Message)]
58pub struct ProductCreateRequestBulletPoint {
59    #[prost(string, tag = "1")]
60    pub id: ::prost::alloc::string::String,
61    #[prost(string, tag = "2")]
62    pub bullet_point: ::prost::alloc::string::String,
63}
64#[derive(serde::Serialize, serde::Deserialize)]
65#[derive(Clone, PartialEq, ::prost::Message)]
66pub struct ProductCreateRequestDetails {
67    /// attributes that has include_in_variants = false, so they are existed
68    /// if in both (with_variants, without_variants)
69    #[prost(map = "string, message", tag = "1")]
70    pub shared: ::std::collections::HashMap<
71        ::prost::alloc::string::String,
72        super::super::shared::v1::Any,
73    >,
74    #[prost(oneof = "product_create_request_details::Details", tags = "2, 3")]
75    pub details: ::core::option::Option<product_create_request_details::Details>,
76}
77/// Nested message and enum types in `ProductCreateRequestDetails`.
78pub mod product_create_request_details {
79    #[derive(serde::Serialize, serde::Deserialize)]
80    #[derive(Clone, PartialEq, ::prost::Oneof)]
81    pub enum Details {
82        #[prost(message, tag = "2")]
83        WithVariants(super::ProductCreateRequestDetailsWithVariants),
84        #[prost(message, tag = "3")]
85        WithoutVariants(super::ProductCreateRequestDetailsWithoutVariants),
86    }
87}
88#[derive(serde::Serialize, serde::Deserialize)]
89#[derive(Clone, PartialEq, ::prost::Message)]
90pub struct ProductCreateRequestDetailsWithVariants {
91    /// an array of details for values for each product's details variant
92    #[prost(message, repeated, tag = "1")]
93    pub variants: ::prost::alloc::vec::Vec<ProductCreateRequestDetailsVariantForm>,
94}
95#[derive(serde::Serialize, serde::Deserialize)]
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct ProductCreateRequestDetailsVariantForm {
98    /// <attribute_id, attribute value>
99    #[prost(map = "string, message", tag = "1")]
100    pub form: ::std::collections::HashMap<
101        ::prost::alloc::string::String,
102        super::super::shared::v1::Any,
103    >,
104}
105#[derive(serde::Serialize, serde::Deserialize)]
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct ProductCreateRequestDetailsWithoutVariants {
108    /// <attribute_id, attribute value>
109    #[prost(map = "string, message", tag = "1")]
110    pub form: ::std::collections::HashMap<
111        ::prost::alloc::string::String,
112        super::super::shared::v1::Any,
113    >,
114}
115#[derive(serde::Serialize, serde::Deserialize)]
116#[derive(Clone, PartialEq, ::prost::Message)]
117pub struct ProductCreateRequestMedia {
118    /// total size in bytes, so this size is used to decide how to upload the media,
119    /// either with resumable uploading or directly if media files aren't so big
120    #[prost(uint64, tag = "1")]
121    pub total_size: u64,
122    #[prost(oneof = "product_create_request_media::Media", tags = "2, 3")]
123    pub media: ::core::option::Option<product_create_request_media::Media>,
124}
125/// Nested message and enum types in `ProductCreateRequestMedia`.
126pub mod product_create_request_media {
127    #[derive(serde::Serialize, serde::Deserialize)]
128    #[derive(Clone, PartialEq, ::prost::Oneof)]
129    pub enum Media {
130        #[prost(message, tag = "2")]
131        WithVariants(super::ProductCreateRequestMediaWithVariants),
132        #[prost(message, tag = "3")]
133        WithoutVariants(super::ProductCreateRequestMediaWithoutVariants),
134    }
135}
136#[derive(serde::Serialize, serde::Deserialize)]
137#[derive(Clone, PartialEq, ::prost::Message)]
138pub struct ProductCreateRequestMediaWithVariants {
139    #[prost(map = "string, message", tag = "1")]
140    pub images: ::std::collections::HashMap<
141        ::prost::alloc::string::String,
142        super::super::shared::v1::Attachments,
143    >,
144    #[prost(map = "string, message", tag = "2")]
145    pub videos: ::std::collections::HashMap<
146        ::prost::alloc::string::String,
147        super::super::shared::v1::Attachments,
148    >,
149}
150#[derive(serde::Serialize, serde::Deserialize)]
151#[derive(Clone, PartialEq, ::prost::Message)]
152pub struct ProductCreateRequestMediaWithoutVariants {
153    #[prost(message, repeated, tag = "1")]
154    pub images: ::prost::alloc::vec::Vec<super::super::shared::v1::Attachment>,
155    #[prost(message, repeated, tag = "2")]
156    pub videos: ::prost::alloc::vec::Vec<super::super::shared::v1::Attachment>,
157}
158#[derive(serde::Serialize, serde::Deserialize)]
159#[derive(Clone, PartialEq, ::prost::Message)]
160pub struct ProductCreateRequestOffer {
161    #[prost(string, tag = "1")]
162    pub currency: ::prost::alloc::string::String,
163    #[prost(string, tag = "2")]
164    pub fulfillment_type: ::prost::alloc::string::String,
165    #[prost(uint64, tag = "3")]
166    pub processing_time: u64,
167    #[prost(oneof = "product_create_request_offer::Pricing", tags = "4, 5")]
168    pub pricing: ::core::option::Option<product_create_request_offer::Pricing>,
169}
170/// Nested message and enum types in `ProductCreateRequestOffer`.
171pub mod product_create_request_offer {
172    #[derive(serde::Serialize, serde::Deserialize)]
173    #[derive(Clone, PartialEq, ::prost::Oneof)]
174    pub enum Pricing {
175        #[prost(message, tag = "4")]
176        WithVariants(super::ProductCreateRequestOfferWithVariants),
177        #[prost(message, tag = "5")]
178        WithoutVariants(super::ProductCreateRequestOfferWithoutVariants),
179    }
180}
181#[derive(serde::Serialize, serde::Deserialize)]
182#[derive(Clone, PartialEq, ::prost::Message)]
183pub struct ProductCreateRequestOfferWithVariants {
184    #[prost(message, repeated, tag = "1")]
185    pub variants: ::prost::alloc::vec::Vec<ProductCreateRequestOfferVariant>,
186}
187#[derive(serde::Serialize, serde::Deserialize)]
188#[derive(Clone, PartialEq, ::prost::Message)]
189pub struct ProductCreateRequestOfferVariant {
190    #[prost(string, tag = "1")]
191    pub id: ::prost::alloc::string::String,
192    #[prost(string, tag = "2")]
193    pub sku: ::prost::alloc::string::String,
194    #[prost(uint64, tag = "3")]
195    pub quantity: u64,
196    #[prost(string, tag = "4")]
197    pub price: ::prost::alloc::string::String,
198    #[prost(string, tag = "5")]
199    pub offering_condition: ::prost::alloc::string::String,
200    #[prost(string, optional, tag = "6")]
201    pub condition_note: ::core::option::Option<::prost::alloc::string::String>,
202    #[prost(string, optional, tag = "7")]
203    pub list_price: ::core::option::Option<::prost::alloc::string::String>,
204    #[prost(bool, optional, tag = "8")]
205    pub has_sale_price: ::core::option::Option<bool>,
206    #[prost(string, optional, tag = "9")]
207    pub sale_price: ::core::option::Option<::prost::alloc::string::String>,
208    #[prost(string, optional, tag = "10")]
209    pub sale_price_start: ::core::option::Option<::prost::alloc::string::String>,
210    #[prost(string, optional, tag = "11")]
211    pub sale_price_end: ::core::option::Option<::prost::alloc::string::String>,
212    #[prost(bool, tag = "12")]
213    pub has_minimum_orders: bool,
214    #[prost(message, repeated, tag = "13")]
215    pub minimum_orders: ::prost::alloc::vec::Vec<ProductCreateRequestOfferMinimumOrder>,
216}
217#[derive(serde::Serialize, serde::Deserialize)]
218#[derive(Clone, PartialEq, ::prost::Message)]
219pub struct ProductCreateRequestOfferWithoutVariants {
220    #[prost(string, tag = "1")]
221    pub sku: ::prost::alloc::string::String,
222    #[prost(uint64, tag = "2")]
223    pub quantity: u64,
224    #[prost(string, tag = "3")]
225    pub price: ::prost::alloc::string::String,
226    #[prost(string, tag = "4")]
227    pub offering_condition: ::prost::alloc::string::String,
228    #[prost(string, optional, tag = "5")]
229    pub condition_note: ::core::option::Option<::prost::alloc::string::String>,
230    #[prost(string, optional, tag = "6")]
231    pub list_price: ::core::option::Option<::prost::alloc::string::String>,
232    #[prost(bool, optional, tag = "7")]
233    pub has_sale_price: ::core::option::Option<bool>,
234    #[prost(string, optional, tag = "8")]
235    pub sale_price: ::core::option::Option<::prost::alloc::string::String>,
236    #[prost(string, optional, tag = "9")]
237    pub sale_price_start: ::core::option::Option<::prost::alloc::string::String>,
238    #[prost(string, optional, tag = "10")]
239    pub sale_price_end: ::core::option::Option<::prost::alloc::string::String>,
240    #[prost(bool, tag = "11")]
241    pub has_minimum_orders: bool,
242    #[prost(message, repeated, tag = "12")]
243    pub minimum_orders: ::prost::alloc::vec::Vec<ProductCreateRequestOfferMinimumOrder>,
244}
245#[derive(serde::Serialize, serde::Deserialize)]
246#[derive(Clone, PartialEq, ::prost::Message)]
247pub struct ProductCreateRequestOfferMinimumOrder {
248    #[prost(string, tag = "1")]
249    pub id: ::prost::alloc::string::String,
250    #[prost(string, tag = "2")]
251    pub price: ::prost::alloc::string::String,
252    #[prost(uint64, tag = "3")]
253    pub quantity: u64,
254}
255#[derive(serde::Serialize, serde::Deserialize)]
256#[derive(Clone, PartialEq, ::prost::Message)]
257pub struct ProductCreateRequestSafety {
258    #[prost(bool, tag = "1")]
259    pub attestation: bool,
260    #[prost(map = "string, message", tag = "2")]
261    pub form: ::std::collections::HashMap<
262        ::prost::alloc::string::String,
263        super::super::shared::v1::Any,
264    >,
265}
266#[derive(serde::Serialize, serde::Deserialize)]
267#[derive(Clone, PartialEq, ::prost::Message)]
268pub struct ProductCreateResponse {
269    #[prost(oneof = "product_create_response::Response", tags = "1, 2")]
270    pub response: ::core::option::Option<product_create_response::Response>,
271}
272/// Nested message and enum types in `ProductCreateResponse`.
273pub mod product_create_response {
274    #[derive(serde::Serialize, serde::Deserialize)]
275    #[derive(Clone, PartialEq, ::prost::Oneof)]
276    pub enum Response {
277        #[prost(message, tag = "1")]
278        Data(super::super::super::shared::v1::SuccessResponseData),
279        #[prost(message, tag = "2")]
280        Error(super::super::super::shared::v1::AppError),
281    }
282}
283#[derive(serde::Serialize, serde::Deserialize)]
284#[derive(Clone, PartialEq, ::prost::Message)]
285pub struct ProductBulletPoint {
286    #[prost(string, tag = "1")]
287    pub id: ::prost::alloc::string::String,
288    #[prost(string, tag = "2")]
289    pub text: ::prost::alloc::string::String,
290    #[prost(uint64, tag = "3")]
291    pub created_at: u64,
292    #[prost(uint64, optional, tag = "4")]
293    pub updated_at: ::core::option::Option<u64>,
294}
295#[derive(serde::Serialize, serde::Deserialize)]
296#[derive(Clone, PartialEq, ::prost::Message)]
297pub struct ProductDetails {
298    /// non customizable details for variants (can be empty of all the attributes customizable)
299    #[prost(map = "string, message", tag = "1")]
300    pub shared: ::std::collections::HashMap<
301        ::prost::alloc::string::String,
302        super::super::shared::v1::Any,
303    >,
304    /// no need to store the data separately (E.g. with_variants, no_variant) because
305    /// we can do a simple check: length === 1 ? So there is no variants
306    /// for this product, and also this allow us later on to make the user be able
307    /// to add variants to an existing product
308    ///
309    /// <variant_id, details>
310    #[prost(map = "string, message", tag = "2")]
311    pub details: ::std::collections::HashMap<
312        ::prost::alloc::string::String,
313        ProductDetailsVariant,
314    >,
315}
316#[derive(serde::Serialize, serde::Deserialize)]
317#[derive(Clone, PartialEq, ::prost::Message)]
318pub struct ProductDetailsVariant {
319    #[prost(string, tag = "1")]
320    pub variant_name: ::prost::alloc::string::String,
321    #[prost(map = "string, message", tag = "2")]
322    pub variant_data: ::std::collections::HashMap<
323        ::prost::alloc::string::String,
324        super::super::shared::v1::Any,
325    >,
326}
327#[derive(serde::Serialize, serde::Deserialize)]
328#[derive(Clone, PartialEq, ::prost::Message)]
329pub struct ProductMedia {
330    /// <variant_id, media>
331    #[prost(map = "string, message", tag = "1")]
332    pub media: ::std::collections::HashMap<
333        ::prost::alloc::string::String,
334        ProductMediaVariant,
335    >,
336}
337#[derive(serde::Serialize, serde::Deserialize)]
338#[derive(Clone, PartialEq, ::prost::Message)]
339pub struct ProductMediaVariant {
340    /// <attachment_id , attachment>
341    #[prost(map = "string, message", tag = "1")]
342    pub images: ::std::collections::HashMap<
343        ::prost::alloc::string::String,
344        ProductMediaImage,
345    >,
346    /// <attachment_id , attachment>
347    #[prost(map = "string, message", tag = "2")]
348    pub videos: ::std::collections::HashMap<
349        ::prost::alloc::string::String,
350        ProductMediaVideo,
351    >,
352}
353#[derive(serde::Serialize, serde::Deserialize)]
354#[derive(Clone, PartialEq, ::prost::Message)]
355pub struct ProductMediaImage {
356    #[prost(string, tag = "1")]
357    pub format: ::prost::alloc::string::String,
358    #[prost(string, tag = "2")]
359    pub url: ::prost::alloc::string::String,
360    #[prost(uint64, tag = "3")]
361    pub size: u64,
362}
363#[derive(serde::Serialize, serde::Deserialize)]
364#[derive(Clone, PartialEq, ::prost::Message)]
365pub struct ProductMediaVideo {
366    #[prost(string, tag = "1")]
367    pub format: ::prost::alloc::string::String,
368    #[prost(string, tag = "2")]
369    pub url: ::prost::alloc::string::String,
370    #[prost(uint64, tag = "3")]
371    pub size: u64,
372    #[prost(uint64, tag = "4")]
373    pub duration: u64,
374}
375#[derive(serde::Serialize, serde::Deserialize)]
376#[derive(Clone, PartialEq, ::prost::Message)]
377pub struct ProductOffer {
378    /// <variant_id, offer>
379    #[prost(map = "string, message", tag = "2")]
380    pub offer: ::std::collections::HashMap<
381        ::prost::alloc::string::String,
382        ProductOfferVariant,
383    >,
384}
385#[derive(serde::Serialize, serde::Deserialize)]
386#[derive(Clone, PartialEq, ::prost::Message)]
387pub struct ProductOfferVariant {
388    #[prost(string, tag = "2")]
389    pub sku: ::prost::alloc::string::String,
390    #[prost(uint64, tag = "3")]
391    pub quantity: u64,
392    #[prost(string, tag = "4")]
393    pub price: ::prost::alloc::string::String,
394    #[prost(string, tag = "5")]
395    pub offering_condition: ::prost::alloc::string::String,
396    #[prost(string, optional, tag = "6")]
397    pub condition_note: ::core::option::Option<::prost::alloc::string::String>,
398    #[prost(string, optional, tag = "7")]
399    pub list_price: ::core::option::Option<::prost::alloc::string::String>,
400    #[prost(bool, tag = "8")]
401    pub has_sale_price: bool,
402    #[prost(string, optional, tag = "9")]
403    pub sale_price: ::core::option::Option<::prost::alloc::string::String>,
404    #[prost(string, optional, tag = "10")]
405    pub sale_price_start: ::core::option::Option<::prost::alloc::string::String>,
406    #[prost(string, optional, tag = "11")]
407    pub sale_price_end: ::core::option::Option<::prost::alloc::string::String>,
408    #[prost(bool, tag = "12")]
409    pub has_minimum_orders: bool,
410    #[prost(message, repeated, tag = "13")]
411    pub minimum_orders: ::prost::alloc::vec::Vec<ProductOfferMinimumOrder>,
412}
413#[derive(serde::Serialize, serde::Deserialize)]
414#[derive(Clone, PartialEq, ::prost::Message)]
415pub struct ProductOfferMinimumOrder {
416    #[prost(string, tag = "1")]
417    pub id: ::prost::alloc::string::String,
418    #[prost(string, tag = "2")]
419    pub price: ::prost::alloc::string::String,
420    #[prost(uint64, tag = "3")]
421    pub quantity: u64,
422    #[prost(uint64, tag = "4")]
423    pub created_at: u64,
424    #[prost(uint64, optional, tag = "5")]
425    pub updated_at: ::core::option::Option<u64>,
426}
427#[derive(serde::Serialize, serde::Deserialize)]
428#[derive(Clone, PartialEq, ::prost::Message)]
429pub struct ProductSafety {
430    #[prost(map = "string, message", tag = "1")]
431    pub safety: ::std::collections::HashMap<
432        ::prost::alloc::string::String,
433        super::super::shared::v1::Any,
434    >,
435}
436#[derive(serde::Serialize, serde::Deserialize)]
437#[derive(Clone, PartialEq, ::prost::Message)]
438pub struct ProductTag {
439    #[prost(uint32, optional, tag = "1")]
440    pub id: ::core::option::Option<u32>,
441    #[prost(string, optional, tag = "2")]
442    pub name: ::core::option::Option<::prost::alloc::string::String>,
443}
444#[derive(serde::Serialize, serde::Deserialize)]
445#[derive(Clone, PartialEq, ::prost::Message)]
446pub struct ProductTags {
447    #[prost(message, repeated, tag = "1")]
448    pub tags: ::prost::alloc::vec::Vec<ProductTag>,
449}
450#[derive(serde::Serialize, serde::Deserialize)]
451#[derive(Clone, Copy, PartialEq, ::prost::Message)]
452pub struct ProductMetadata {}
453#[derive(serde::Serialize, serde::Deserialize)]
454#[derive(Clone, PartialEq, ::prost::Message)]
455pub struct Product {
456    #[prost(string, tag = "1")]
457    pub id: ::prost::alloc::string::String,
458    #[prost(string, tag = "2")]
459    pub user_id: ::prost::alloc::string::String,
460    #[prost(string, tag = "3")]
461    pub title: ::prost::alloc::string::String,
462    #[prost(string, tag = "4")]
463    pub category: ::prost::alloc::string::String,
464    #[prost(string, tag = "5")]
465    pub subcategory: ::prost::alloc::string::String,
466    #[prost(bool, tag = "6")]
467    pub has_variations: bool,
468    #[prost(string, optional, tag = "7")]
469    pub brand_name: ::core::option::Option<::prost::alloc::string::String>,
470    #[prost(bool, tag = "8")]
471    pub has_brand_name: bool,
472    #[prost(string, optional, tag = "9")]
473    pub product_id: ::core::option::Option<::prost::alloc::string::String>,
474    #[prost(bool, tag = "10")]
475    pub has_product_id: bool,
476    #[prost(string, optional, tag = "11")]
477    pub product_id_type: ::core::option::Option<::prost::alloc::string::String>,
478    #[prost(string, tag = "12")]
479    pub description: ::prost::alloc::string::String,
480    #[prost(message, repeated, tag = "13")]
481    pub bullet_points: ::prost::alloc::vec::Vec<ProductBulletPoint>,
482    #[prost(string, tag = "14")]
483    pub currency_code: ::prost::alloc::string::String,
484    #[prost(string, tag = "15")]
485    pub fulfillment_type: ::prost::alloc::string::String,
486    #[prost(uint64, tag = "16")]
487    pub processing_time: u64,
488    #[prost(message, optional, tag = "17")]
489    pub details: ::core::option::Option<ProductDetails>,
490    #[prost(message, optional, tag = "18")]
491    pub media: ::core::option::Option<ProductMedia>,
492    #[prost(message, optional, tag = "19")]
493    pub offer: ::core::option::Option<ProductOffer>,
494    #[prost(message, optional, tag = "20")]
495    pub safety: ::core::option::Option<ProductSafety>,
496    #[prost(message, repeated, tag = "21")]
497    pub tags: ::prost::alloc::vec::Vec<ProductTag>,
498    #[prost(message, optional, tag = "22")]
499    pub metadata: ::core::option::Option<ProductMetadata>,
500    #[prost(bool, tag = "23")]
501    pub ar_enabled: bool,
502    #[prost(string, tag = "24")]
503    pub slug: ::prost::alloc::string::String,
504    #[prost(string, tag = "25")]
505    pub status: ::prost::alloc::string::String,
506    #[prost(uint32, tag = "26")]
507    pub version: u32,
508    #[prost(uint32, tag = "27")]
509    pub schema_version: u32,
510    #[prost(uint64, tag = "28")]
511    pub created_at: u64,
512    #[prost(uint64, optional, tag = "29")]
513    pub published_at: ::core::option::Option<u64>,
514    #[prost(uint64, optional, tag = "30")]
515    pub updated_at: ::core::option::Option<u64>,
516}
517#[derive(serde::Serialize, serde::Deserialize)]
518#[derive(Clone, PartialEq, ::prost::Message)]
519pub struct Category {
520    #[prost(string, tag = "1")]
521    pub id: ::prost::alloc::string::String,
522    #[prost(string, tag = "2")]
523    pub name: ::prost::alloc::string::String,
524    #[prost(string, tag = "3")]
525    pub image: ::prost::alloc::string::String,
526    #[prost(message, repeated, tag = "4")]
527    pub translations: ::prost::alloc::vec::Vec<CategoryTranslations>,
528    #[prost(message, repeated, tag = "5")]
529    pub subcategories: ::prost::alloc::vec::Vec<Subcategory>,
530}
531#[derive(serde::Serialize, serde::Deserialize)]
532#[derive(Clone, PartialEq, ::prost::Message)]
533pub struct CategoryTranslations {
534    #[prost(string, tag = "1")]
535    pub name: ::prost::alloc::string::String,
536    #[prost(string, tag = "2")]
537    pub language: ::prost::alloc::string::String,
538    #[prost(int32, tag = "3")]
539    pub version: i32,
540    #[prost(map = "string, message", tag = "4")]
541    pub subcategories: ::std::collections::HashMap<
542        ::prost::alloc::string::String,
543        SubcategoryTranslations,
544    >,
545}
546#[derive(serde::Serialize, serde::Deserialize)]
547#[derive(Clone, PartialEq, ::prost::Message)]
548pub struct SubcategoryTranslations {
549    #[prost(string, tag = "1")]
550    pub name: ::prost::alloc::string::String,
551    #[prost(map = "string, message", tag = "2")]
552    pub attributes: ::std::collections::HashMap<
553        ::prost::alloc::string::String,
554        SubcategoryAttributeTranslation,
555    >,
556    #[prost(map = "string, message", tag = "3")]
557    pub data: ::std::collections::HashMap<
558        ::prost::alloc::string::String,
559        super::super::shared::v1::StringMap,
560    >,
561    #[prost(message, optional, tag = "4")]
562    pub safety: ::core::option::Option<SubcategorySafetyTranslation>,
563}
564#[derive(serde::Serialize, serde::Deserialize)]
565#[derive(Clone, PartialEq, ::prost::Message)]
566pub struct SubcategoryAttributeTranslation {
567    #[prost(string, tag = "1")]
568    pub label: ::prost::alloc::string::String,
569    #[prost(string, tag = "2")]
570    pub placeholder: ::prost::alloc::string::String,
571    #[prost(string, tag = "3")]
572    pub info: ::prost::alloc::string::String,
573}
574#[derive(serde::Serialize, serde::Deserialize)]
575#[derive(Clone, PartialEq, ::prost::Message)]
576pub struct SubcategorySafetyTranslation {
577    #[prost(map = "string, message", tag = "1")]
578    pub attributes: ::std::collections::HashMap<
579        ::prost::alloc::string::String,
580        SubcategoryAttributeTranslation,
581    >,
582    #[prost(map = "string, message", tag = "2")]
583    pub data: ::std::collections::HashMap<
584        ::prost::alloc::string::String,
585        super::super::shared::v1::StringMap,
586    >,
587}
588#[derive(serde::Serialize, serde::Deserialize)]
589#[derive(Clone, PartialEq, ::prost::Message)]
590pub struct Subcategory {
591    #[prost(string, tag = "1")]
592    pub id: ::prost::alloc::string::String,
593    #[prost(string, tag = "2")]
594    pub name: ::prost::alloc::string::String,
595    #[prost(int32, tag = "3")]
596    pub version: i32,
597    #[prost(string, tag = "4")]
598    pub created_at: ::prost::alloc::string::String,
599    #[prost(map = "string, message", tag = "5")]
600    pub attributes: ::std::collections::HashMap<
601        ::prost::alloc::string::String,
602        SubcategoryAttribute,
603    >,
604    #[prost(map = "string, message", tag = "6")]
605    pub safety: ::std::collections::HashMap<
606        ::prost::alloc::string::String,
607        SubcategorySafety,
608    >,
609}
610/// Top-level attribute with a typed validation
611#[derive(serde::Serialize, serde::Deserialize)]
612#[derive(Clone, PartialEq, ::prost::Message)]
613pub struct SubcategoryAttribute {
614    /// wither this attribute required or optional
615    #[prost(bool, tag = "1")]
616    pub required: bool,
617    /// input, select, tags ...
618    #[prost(string, tag = "2")]
619    pub r#type: ::prost::alloc::string::String,
620    /// wither this attributes can be customized for each variation or it must be shared
621    /// by all of the product's variations
622    #[prost(bool, tag = "3")]
623    pub include_in_variants: bool,
624    /// reference id to the attributes table (E.g weight is common for many products types,
625    /// so instead rewriting it each time, we store it in another table)
626    #[prost(string, optional, tag = "4")]
627    pub reference: ::core::option::Option<::prost::alloc::string::String>,
628    /// for select type (E.g. \['white', 'black', ...\])
629    #[prost(string, repeated, tag = "5")]
630    pub string_array: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
631    /// for select type (E.g. multiple colors)
632    #[prost(bool, optional, tag = "6")]
633    pub is_multiple: ::core::option::Option<bool>,
634    /// validation rules of this attribute
635    #[prost(message, optional, tag = "7")]
636    pub validation: ::core::option::Option<super::super::shared::v1::ValidationField>,
637}
638/// Top-level safety attribute with a typed validation
639#[derive(serde::Serialize, serde::Deserialize)]
640#[derive(Clone, PartialEq, ::prost::Message)]
641pub struct SubcategorySafety {
642    /// wither this attribute required or optional
643    #[prost(bool, tag = "1")]
644    pub required: bool,
645    /// input, select, tags ...
646    #[prost(string, tag = "2")]
647    pub r#type: ::prost::alloc::string::String,
648    /// reference id to the attributes table (E.g weight is common for many products types,
649    /// so instead rewriting it each time, we store it in another table)
650    #[prost(string, optional, tag = "3")]
651    pub reference: ::core::option::Option<::prost::alloc::string::String>,
652    /// for select type (E.g. \['white', 'black', ...\])
653    #[prost(string, repeated, tag = "4")]
654    pub string_array: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
655    /// for select type (E.g. multiple colors)
656    #[prost(bool, optional, tag = "5")]
657    pub is_multiple: ::core::option::Option<bool>,
658    /// validation rules of this attribute
659    #[prost(message, optional, tag = "6")]
660    pub validation: ::core::option::Option<super::super::shared::v1::ValidationField>,
661}
662#[derive(serde::Serialize, serde::Deserialize)]
663#[derive(Clone, PartialEq, ::prost::Message)]
664pub struct ProductDataResponseData {
665    #[prost(message, optional, tag = "1")]
666    pub subcategory: ::core::option::Option<ProductDataResponseSubcategory>,
667    #[prost(message, optional, tag = "2")]
668    pub tags: ::core::option::Option<ProductTags>,
669}
670#[derive(serde::Serialize, serde::Deserialize)]
671#[derive(Clone, PartialEq, ::prost::Message)]
672pub struct ProductDataResponseSubcategory {
673    #[prost(message, optional, tag = "1")]
674    pub data: ::core::option::Option<Subcategory>,
675    #[prost(message, optional, tag = "2")]
676    pub translations: ::core::option::Option<SubcategoryTranslations>,
677}
678#[derive(serde::Serialize, serde::Deserialize)]
679#[derive(Clone, PartialEq, ::prost::Message)]
680pub struct ProductDataRequest {
681    #[prost(message, optional, tag = "1")]
682    pub subcategory: ::core::option::Option<ProductDataRequestCategory>,
683    #[prost(bool, optional, tag = "2")]
684    pub get_tags: ::core::option::Option<bool>,
685}
686#[derive(serde::Serialize, serde::Deserialize)]
687#[derive(Clone, PartialEq, ::prost::Message)]
688pub struct ProductDataRequestCategory {
689    #[prost(string, tag = "1")]
690    pub category: ::prost::alloc::string::String,
691    #[prost(string, tag = "2")]
692    pub subcategory: ::prost::alloc::string::String,
693}
694#[derive(serde::Serialize, serde::Deserialize)]
695#[derive(Clone, PartialEq, ::prost::Message)]
696pub struct ProductDataResponse {
697    #[prost(oneof = "product_data_response::Response", tags = "1, 2")]
698    pub response: ::core::option::Option<product_data_response::Response>,
699}
700/// Nested message and enum types in `ProductDataResponse`.
701pub mod product_data_response {
702    #[derive(serde::Serialize, serde::Deserialize)]
703    #[derive(Clone, PartialEq, ::prost::Oneof)]
704    pub enum Response {
705        #[prost(message, tag = "1")]
706        Data(super::ProductDataResponseData),
707        #[prost(message, tag = "2")]
708        Error(super::super::super::shared::v1::AppError),
709    }
710}
711#[derive(serde::Serialize, serde::Deserialize)]
712#[derive(Clone, PartialEq, ::prost::Message)]
713pub struct ProductPrice {
714    #[prost(float, tag = "1")]
715    pub amount: f32,
716    #[prost(string, tag = "2")]
717    pub formatted: ::prost::alloc::string::String,
718    #[prost(float, optional, tag = "3")]
719    pub discount_price: ::core::option::Option<f32>,
720    #[prost(string, optional, tag = "4")]
721    pub save_amount: ::core::option::Option<::prost::alloc::string::String>,
722    #[prost(string, optional, tag = "5")]
723    pub save_percentage: ::core::option::Option<::prost::alloc::string::String>,
724}
725#[derive(serde::Serialize, serde::Deserialize)]
726#[derive(Clone, PartialEq, ::prost::Message)]
727pub struct ProductShippingInfo {
728    #[prost(bool, tag = "1")]
729    pub free: bool,
730    #[prost(enumeration = "ProductShippingMethod", tag = "2")]
731    pub method: i32,
732    #[prost(string, tag = "3")]
733    pub origin: ::prost::alloc::string::String,
734    #[prost(int32, tag = "4")]
735    pub min_estimated_days: i32,
736    #[prost(int32, tag = "5")]
737    pub max_estimated_days: i32,
738}
739#[derive(serde::Serialize, serde::Deserialize)]
740#[derive(Clone, PartialEq, ::prost::Message)]
741pub struct ProductItemMetadata {
742    #[prost(enumeration = "ProductItemMetadataType", tag = "1")]
743    pub r#type: i32,
744    #[prost(string, tag = "2")]
745    pub label: ::prost::alloc::string::String,
746}
747#[derive(serde::Serialize, serde::Deserialize)]
748#[derive(Clone, PartialEq, ::prost::Message)]
749pub struct ProductItem {
750    #[prost(string, tag = "1")]
751    pub id: ::prost::alloc::string::String,
752    #[prost(string, tag = "2")]
753    pub title: ::prost::alloc::string::String,
754    #[prost(string, tag = "3")]
755    pub image: ::prost::alloc::string::String,
756    #[prost(message, optional, tag = "4")]
757    pub price: ::core::option::Option<ProductPrice>,
758    #[prost(float, optional, tag = "5")]
759    pub rating: ::core::option::Option<f32>,
760    #[prost(int32, optional, tag = "6")]
761    pub sold: ::core::option::Option<i32>,
762    #[prost(message, repeated, tag = "7")]
763    pub meta: ::prost::alloc::vec::Vec<ProductItemMetadata>,
764}
765#[derive(serde::Serialize, serde::Deserialize)]
766#[derive(Clone, PartialEq, ::prost::Message)]
767pub struct ProductListItem {
768    #[prost(string, tag = "1")]
769    pub id: ::prost::alloc::string::String,
770    #[prost(string, tag = "2")]
771    pub user_id: ::prost::alloc::string::String,
772    #[prost(string, tag = "6")]
773    pub title: ::prost::alloc::string::String,
774    #[prost(string, tag = "7")]
775    pub description: ::prost::alloc::string::String,
776    #[prost(string, tag = "8")]
777    pub slug: ::prost::alloc::string::String,
778    #[prost(string, tag = "9")]
779    pub price: ::prost::alloc::string::String,
780    #[prost(string, tag = "10")]
781    pub currency_code: ::prost::alloc::string::String,
782    #[prost(bool, tag = "13")]
783    pub ar_enabled: bool,
784}
785#[derive(serde::Serialize, serde::Deserialize)]
786#[derive(Clone, PartialEq, ::prost::Message)]
787pub struct ProductListRequest {
788    #[prost(uint32, tag = "1")]
789    pub page: u32,
790    #[prost(string, tag = "2")]
791    pub last_id: ::prost::alloc::string::String,
792    #[prost(message, optional, tag = "3")]
793    pub order_price: ::core::option::Option<super::super::shared::v1::OrderDirection>,
794}
795#[derive(serde::Serialize, serde::Deserialize)]
796#[derive(Clone, PartialEq, ::prost::Message)]
797pub struct ProductListResponse {
798    #[prost(oneof = "product_list_response::Response", tags = "1, 2")]
799    pub response: ::core::option::Option<product_list_response::Response>,
800}
801/// Nested message and enum types in `ProductListResponse`.
802pub mod product_list_response {
803    #[derive(serde::Serialize, serde::Deserialize)]
804    #[derive(Clone, PartialEq, ::prost::Oneof)]
805    pub enum Response {
806        #[prost(message, tag = "1")]
807        Data(super::ProductListResponseData),
808        #[prost(message, tag = "2")]
809        Error(super::super::super::shared::v1::AppError),
810    }
811}
812#[derive(serde::Serialize, serde::Deserialize)]
813#[derive(Clone, PartialEq, ::prost::Message)]
814pub struct ProductListResponseData {
815    #[prost(message, repeated, tag = "1")]
816    pub data: ::prost::alloc::vec::Vec<ProductListItem>,
817}
818#[derive(serde::Serialize, serde::Deserialize)]
819#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
820#[repr(i32)]
821pub enum ProductShippingMethod {
822    Standard = 0,
823    Express = 1,
824}
825impl ProductShippingMethod {
826    /// String value of the enum field names used in the ProtoBuf definition.
827    ///
828    /// The values are not transformed in any way and thus are considered stable
829    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
830    pub fn as_str_name(&self) -> &'static str {
831        match self {
832            Self::Standard => "STANDARD",
833            Self::Express => "EXPRESS",
834        }
835    }
836    /// Creates an enum from field names used in the ProtoBuf definition.
837    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
838        match value {
839            "STANDARD" => Some(Self::Standard),
840            "EXPRESS" => Some(Self::Express),
841            _ => None,
842        }
843    }
844}
845#[derive(serde::Serialize, serde::Deserialize)]
846#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
847#[repr(i32)]
848pub enum ProductItemMetadataType {
849    Cupon = 0,
850    NewShopper = 1,
851    Bundle = 2,
852}
853impl ProductItemMetadataType {
854    /// String value of the enum field names used in the ProtoBuf definition.
855    ///
856    /// The values are not transformed in any way and thus are considered stable
857    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
858    pub fn as_str_name(&self) -> &'static str {
859        match self {
860            Self::Cupon => "CUPON",
861            Self::NewShopper => "NEW_SHOPPER",
862            Self::Bundle => "BUNDLE",
863        }
864    }
865    /// Creates an enum from field names used in the ProtoBuf definition.
866    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
867        match value {
868            "CUPON" => Some(Self::Cupon),
869            "NEW_SHOPPER" => Some(Self::NewShopper),
870            "BUNDLE" => Some(Self::Bundle),
871            _ => None,
872        }
873    }
874}
875/// Generated client implementations.
876pub mod products_service_client {
877    #![allow(
878        unused_variables,
879        dead_code,
880        missing_docs,
881        clippy::wildcard_imports,
882        clippy::let_unit_value,
883    )]
884    use tonic::codegen::*;
885    use tonic::codegen::http::Uri;
886    #[derive(Debug, Clone)]
887    pub struct ProductsServiceClient<T> {
888        inner: tonic::client::Grpc<T>,
889    }
890    impl ProductsServiceClient<tonic::transport::Channel> {
891        /// Attempt to create a new client by connecting to a given endpoint.
892        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
893        where
894            D: TryInto<tonic::transport::Endpoint>,
895            D::Error: Into<StdError>,
896        {
897            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
898            Ok(Self::new(conn))
899        }
900    }
901    impl<T> ProductsServiceClient<T>
902    where
903        T: tonic::client::GrpcService<tonic::body::Body>,
904        T::Error: Into<StdError>,
905        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
906        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
907    {
908        pub fn new(inner: T) -> Self {
909            let inner = tonic::client::Grpc::new(inner);
910            Self { inner }
911        }
912        pub fn with_origin(inner: T, origin: Uri) -> Self {
913            let inner = tonic::client::Grpc::with_origin(inner, origin);
914            Self { inner }
915        }
916        pub fn with_interceptor<F>(
917            inner: T,
918            interceptor: F,
919        ) -> ProductsServiceClient<InterceptedService<T, F>>
920        where
921            F: tonic::service::Interceptor,
922            T::ResponseBody: Default,
923            T: tonic::codegen::Service<
924                http::Request<tonic::body::Body>,
925                Response = http::Response<
926                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
927                >,
928            >,
929            <T as tonic::codegen::Service<
930                http::Request<tonic::body::Body>,
931            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
932        {
933            ProductsServiceClient::new(InterceptedService::new(inner, interceptor))
934        }
935        /// Compress requests with the given encoding.
936        ///
937        /// This requires the server to support it otherwise it might respond with an
938        /// error.
939        #[must_use]
940        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
941            self.inner = self.inner.send_compressed(encoding);
942            self
943        }
944        /// Enable decompressing responses.
945        #[must_use]
946        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
947            self.inner = self.inner.accept_compressed(encoding);
948            self
949        }
950        /// Limits the maximum size of a decoded message.
951        ///
952        /// Default: `4MB`
953        #[must_use]
954        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
955            self.inner = self.inner.max_decoding_message_size(limit);
956            self
957        }
958        /// Limits the maximum size of an encoded message.
959        ///
960        /// Default: `usize::MAX`
961        #[must_use]
962        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
963            self.inner = self.inner.max_encoding_message_size(limit);
964            self
965        }
966        pub async fn product_create(
967            &mut self,
968            request: impl tonic::IntoRequest<super::ProductCreateRequest>,
969        ) -> std::result::Result<
970            tonic::Response<super::ProductCreateResponse>,
971            tonic::Status,
972        > {
973            self.inner
974                .ready()
975                .await
976                .map_err(|e| {
977                    tonic::Status::unknown(
978                        format!("Service was not ready: {}", e.into()),
979                    )
980                })?;
981            let codec = tonic::codec::ProstCodec::default();
982            let path = http::uri::PathAndQuery::from_static(
983                "/products.v1.ProductsService/ProductCreate",
984            );
985            let mut req = request.into_request();
986            req.extensions_mut()
987                .insert(GrpcMethod::new("products.v1.ProductsService", "ProductCreate"));
988            self.inner.unary(req, path, codec).await
989        }
990        pub async fn product_data(
991            &mut self,
992            request: impl tonic::IntoRequest<super::ProductDataRequest>,
993        ) -> std::result::Result<
994            tonic::Response<super::ProductDataResponse>,
995            tonic::Status,
996        > {
997            self.inner
998                .ready()
999                .await
1000                .map_err(|e| {
1001                    tonic::Status::unknown(
1002                        format!("Service was not ready: {}", e.into()),
1003                    )
1004                })?;
1005            let codec = tonic::codec::ProstCodec::default();
1006            let path = http::uri::PathAndQuery::from_static(
1007                "/products.v1.ProductsService/ProductData",
1008            );
1009            let mut req = request.into_request();
1010            req.extensions_mut()
1011                .insert(GrpcMethod::new("products.v1.ProductsService", "ProductData"));
1012            self.inner.unary(req, path, codec).await
1013        }
1014        pub async fn product_list(
1015            &mut self,
1016            request: impl tonic::IntoRequest<super::ProductListRequest>,
1017        ) -> std::result::Result<
1018            tonic::Response<super::ProductListResponse>,
1019            tonic::Status,
1020        > {
1021            self.inner
1022                .ready()
1023                .await
1024                .map_err(|e| {
1025                    tonic::Status::unknown(
1026                        format!("Service was not ready: {}", e.into()),
1027                    )
1028                })?;
1029            let codec = tonic::codec::ProstCodec::default();
1030            let path = http::uri::PathAndQuery::from_static(
1031                "/products.v1.ProductsService/ProductList",
1032            );
1033            let mut req = request.into_request();
1034            req.extensions_mut()
1035                .insert(GrpcMethod::new("products.v1.ProductsService", "ProductList"));
1036            self.inner.unary(req, path, codec).await
1037        }
1038    }
1039}
1040/// Generated server implementations.
1041pub mod products_service_server {
1042    #![allow(
1043        unused_variables,
1044        dead_code,
1045        missing_docs,
1046        clippy::wildcard_imports,
1047        clippy::let_unit_value,
1048    )]
1049    use tonic::codegen::*;
1050    /// Generated trait containing gRPC methods that should be implemented for use with ProductsServiceServer.
1051    #[async_trait]
1052    pub trait ProductsService: std::marker::Send + std::marker::Sync + 'static {
1053        async fn product_create(
1054            &self,
1055            request: tonic::Request<super::ProductCreateRequest>,
1056        ) -> std::result::Result<
1057            tonic::Response<super::ProductCreateResponse>,
1058            tonic::Status,
1059        >;
1060        async fn product_data(
1061            &self,
1062            request: tonic::Request<super::ProductDataRequest>,
1063        ) -> std::result::Result<
1064            tonic::Response<super::ProductDataResponse>,
1065            tonic::Status,
1066        >;
1067        async fn product_list(
1068            &self,
1069            request: tonic::Request<super::ProductListRequest>,
1070        ) -> std::result::Result<
1071            tonic::Response<super::ProductListResponse>,
1072            tonic::Status,
1073        >;
1074    }
1075    #[derive(Debug)]
1076    pub struct ProductsServiceServer<T> {
1077        inner: Arc<T>,
1078        accept_compression_encodings: EnabledCompressionEncodings,
1079        send_compression_encodings: EnabledCompressionEncodings,
1080        max_decoding_message_size: Option<usize>,
1081        max_encoding_message_size: Option<usize>,
1082    }
1083    impl<T> ProductsServiceServer<T> {
1084        pub fn new(inner: T) -> Self {
1085            Self::from_arc(Arc::new(inner))
1086        }
1087        pub fn from_arc(inner: Arc<T>) -> Self {
1088            Self {
1089                inner,
1090                accept_compression_encodings: Default::default(),
1091                send_compression_encodings: Default::default(),
1092                max_decoding_message_size: None,
1093                max_encoding_message_size: None,
1094            }
1095        }
1096        pub fn with_interceptor<F>(
1097            inner: T,
1098            interceptor: F,
1099        ) -> InterceptedService<Self, F>
1100        where
1101            F: tonic::service::Interceptor,
1102        {
1103            InterceptedService::new(Self::new(inner), interceptor)
1104        }
1105        /// Enable decompressing requests with the given encoding.
1106        #[must_use]
1107        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1108            self.accept_compression_encodings.enable(encoding);
1109            self
1110        }
1111        /// Compress responses with the given encoding, if the client supports it.
1112        #[must_use]
1113        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1114            self.send_compression_encodings.enable(encoding);
1115            self
1116        }
1117        /// Limits the maximum size of a decoded message.
1118        ///
1119        /// Default: `4MB`
1120        #[must_use]
1121        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1122            self.max_decoding_message_size = Some(limit);
1123            self
1124        }
1125        /// Limits the maximum size of an encoded message.
1126        ///
1127        /// Default: `usize::MAX`
1128        #[must_use]
1129        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1130            self.max_encoding_message_size = Some(limit);
1131            self
1132        }
1133    }
1134    impl<T, B> tonic::codegen::Service<http::Request<B>> for ProductsServiceServer<T>
1135    where
1136        T: ProductsService,
1137        B: Body + std::marker::Send + 'static,
1138        B::Error: Into<StdError> + std::marker::Send + 'static,
1139    {
1140        type Response = http::Response<tonic::body::Body>;
1141        type Error = std::convert::Infallible;
1142        type Future = BoxFuture<Self::Response, Self::Error>;
1143        fn poll_ready(
1144            &mut self,
1145            _cx: &mut Context<'_>,
1146        ) -> Poll<std::result::Result<(), Self::Error>> {
1147            Poll::Ready(Ok(()))
1148        }
1149        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1150            match req.uri().path() {
1151                "/products.v1.ProductsService/ProductCreate" => {
1152                    #[allow(non_camel_case_types)]
1153                    struct ProductCreateSvc<T: ProductsService>(pub Arc<T>);
1154                    impl<
1155                        T: ProductsService,
1156                    > tonic::server::UnaryService<super::ProductCreateRequest>
1157                    for ProductCreateSvc<T> {
1158                        type Response = super::ProductCreateResponse;
1159                        type Future = BoxFuture<
1160                            tonic::Response<Self::Response>,
1161                            tonic::Status,
1162                        >;
1163                        fn call(
1164                            &mut self,
1165                            request: tonic::Request<super::ProductCreateRequest>,
1166                        ) -> Self::Future {
1167                            let inner = Arc::clone(&self.0);
1168                            let fut = async move {
1169                                <T as ProductsService>::product_create(&inner, request)
1170                                    .await
1171                            };
1172                            Box::pin(fut)
1173                        }
1174                    }
1175                    let accept_compression_encodings = self.accept_compression_encodings;
1176                    let send_compression_encodings = self.send_compression_encodings;
1177                    let max_decoding_message_size = self.max_decoding_message_size;
1178                    let max_encoding_message_size = self.max_encoding_message_size;
1179                    let inner = self.inner.clone();
1180                    let fut = async move {
1181                        let method = ProductCreateSvc(inner);
1182                        let codec = tonic::codec::ProstCodec::default();
1183                        let mut grpc = tonic::server::Grpc::new(codec)
1184                            .apply_compression_config(
1185                                accept_compression_encodings,
1186                                send_compression_encodings,
1187                            )
1188                            .apply_max_message_size_config(
1189                                max_decoding_message_size,
1190                                max_encoding_message_size,
1191                            );
1192                        let res = grpc.unary(method, req).await;
1193                        Ok(res)
1194                    };
1195                    Box::pin(fut)
1196                }
1197                "/products.v1.ProductsService/ProductData" => {
1198                    #[allow(non_camel_case_types)]
1199                    struct ProductDataSvc<T: ProductsService>(pub Arc<T>);
1200                    impl<
1201                        T: ProductsService,
1202                    > tonic::server::UnaryService<super::ProductDataRequest>
1203                    for ProductDataSvc<T> {
1204                        type Response = super::ProductDataResponse;
1205                        type Future = BoxFuture<
1206                            tonic::Response<Self::Response>,
1207                            tonic::Status,
1208                        >;
1209                        fn call(
1210                            &mut self,
1211                            request: tonic::Request<super::ProductDataRequest>,
1212                        ) -> Self::Future {
1213                            let inner = Arc::clone(&self.0);
1214                            let fut = async move {
1215                                <T as ProductsService>::product_data(&inner, request).await
1216                            };
1217                            Box::pin(fut)
1218                        }
1219                    }
1220                    let accept_compression_encodings = self.accept_compression_encodings;
1221                    let send_compression_encodings = self.send_compression_encodings;
1222                    let max_decoding_message_size = self.max_decoding_message_size;
1223                    let max_encoding_message_size = self.max_encoding_message_size;
1224                    let inner = self.inner.clone();
1225                    let fut = async move {
1226                        let method = ProductDataSvc(inner);
1227                        let codec = tonic::codec::ProstCodec::default();
1228                        let mut grpc = tonic::server::Grpc::new(codec)
1229                            .apply_compression_config(
1230                                accept_compression_encodings,
1231                                send_compression_encodings,
1232                            )
1233                            .apply_max_message_size_config(
1234                                max_decoding_message_size,
1235                                max_encoding_message_size,
1236                            );
1237                        let res = grpc.unary(method, req).await;
1238                        Ok(res)
1239                    };
1240                    Box::pin(fut)
1241                }
1242                "/products.v1.ProductsService/ProductList" => {
1243                    #[allow(non_camel_case_types)]
1244                    struct ProductListSvc<T: ProductsService>(pub Arc<T>);
1245                    impl<
1246                        T: ProductsService,
1247                    > tonic::server::UnaryService<super::ProductListRequest>
1248                    for ProductListSvc<T> {
1249                        type Response = super::ProductListResponse;
1250                        type Future = BoxFuture<
1251                            tonic::Response<Self::Response>,
1252                            tonic::Status,
1253                        >;
1254                        fn call(
1255                            &mut self,
1256                            request: tonic::Request<super::ProductListRequest>,
1257                        ) -> Self::Future {
1258                            let inner = Arc::clone(&self.0);
1259                            let fut = async move {
1260                                <T as ProductsService>::product_list(&inner, request).await
1261                            };
1262                            Box::pin(fut)
1263                        }
1264                    }
1265                    let accept_compression_encodings = self.accept_compression_encodings;
1266                    let send_compression_encodings = self.send_compression_encodings;
1267                    let max_decoding_message_size = self.max_decoding_message_size;
1268                    let max_encoding_message_size = self.max_encoding_message_size;
1269                    let inner = self.inner.clone();
1270                    let fut = async move {
1271                        let method = ProductListSvc(inner);
1272                        let codec = tonic::codec::ProstCodec::default();
1273                        let mut grpc = tonic::server::Grpc::new(codec)
1274                            .apply_compression_config(
1275                                accept_compression_encodings,
1276                                send_compression_encodings,
1277                            )
1278                            .apply_max_message_size_config(
1279                                max_decoding_message_size,
1280                                max_encoding_message_size,
1281                            );
1282                        let res = grpc.unary(method, req).await;
1283                        Ok(res)
1284                    };
1285                    Box::pin(fut)
1286                }
1287                _ => {
1288                    Box::pin(async move {
1289                        let mut response = http::Response::new(
1290                            tonic::body::Body::default(),
1291                        );
1292                        let headers = response.headers_mut();
1293                        headers
1294                            .insert(
1295                                tonic::Status::GRPC_STATUS,
1296                                (tonic::Code::Unimplemented as i32).into(),
1297                            );
1298                        headers
1299                            .insert(
1300                                http::header::CONTENT_TYPE,
1301                                tonic::metadata::GRPC_CONTENT_TYPE,
1302                            );
1303                        Ok(response)
1304                    })
1305                }
1306            }
1307        }
1308    }
1309    impl<T> Clone for ProductsServiceServer<T> {
1310        fn clone(&self) -> Self {
1311            let inner = self.inner.clone();
1312            Self {
1313                inner,
1314                accept_compression_encodings: self.accept_compression_encodings,
1315                send_compression_encodings: self.send_compression_encodings,
1316                max_decoding_message_size: self.max_decoding_message_size,
1317                max_encoding_message_size: self.max_encoding_message_size,
1318            }
1319        }
1320    }
1321    /// Generated gRPC service name
1322    pub const SERVICE_NAME: &str = "products.v1.ProductsService";
1323    impl<T> tonic::server::NamedService for ProductsServiceServer<T> {
1324        const NAME: &'static str = SERVICE_NAME;
1325    }
1326}
1327#[derive(serde::Serialize, serde::Deserialize)]
1328#[derive(Clone, PartialEq, ::prost::Message)]
1329pub struct ChangeFeed {
1330    #[prost(message, optional, tag = "1")]
1331    pub after: ::core::option::Option<ProductOutbox>,
1332    #[prost(message, optional, tag = "2")]
1333    pub before: ::core::option::Option<ProductOutbox>,
1334    #[prost(int64, tag = "3")]
1335    pub updated: i64,
1336    #[prost(int64, tag = "4")]
1337    pub resolved: i64,
1338}
1339#[derive(serde::Serialize, serde::Deserialize)]
1340#[derive(Clone, PartialEq, ::prost::Message)]
1341pub struct ProductOutbox {
1342    #[prost(string, tag = "1")]
1343    pub id: ::prost::alloc::string::String,
1344    /// in other word: the aggregate id
1345    #[prost(string, tag = "2")]
1346    pub product_id: ::prost::alloc::string::String,
1347    /// 'created'|'updated'|'deleted'
1348    #[prost(string, tag = "3")]
1349    pub r#type: ::prost::alloc::string::String,
1350    /// unix timestamp
1351    #[prost(int64, optional, tag = "4")]
1352    pub processed_at: ::core::option::Option<i64>,
1353    #[prost(uint32, tag = "5")]
1354    pub processing_attempts: u32,
1355    #[prost(string, optional, tag = "6")]
1356    pub last_error: ::core::option::Option<::prost::alloc::string::String>,
1357    /// unix timestamp
1358    #[prost(int64, tag = "7")]
1359    pub created_at: i64,
1360    #[prost(int64, tag = "8")]
1361    pub updated_at: i64,
1362    #[prost(oneof = "product_outbox::Payload", tags = "9, 10, 11")]
1363    pub payload: ::core::option::Option<product_outbox::Payload>,
1364}
1365/// Nested message and enum types in `ProductOutbox`.
1366pub mod product_outbox {
1367    #[derive(serde::Serialize, serde::Deserialize)]
1368    #[derive(Clone, PartialEq, ::prost::Oneof)]
1369    pub enum Payload {
1370        #[prost(message, tag = "9")]
1371        Created(super::ProductCreatedEvent),
1372        #[prost(message, tag = "10")]
1373        Updated(super::ProductUpdatedEvent),
1374        #[prost(message, tag = "11")]
1375        Deleted(super::ProductDeletedEvent),
1376    }
1377}
1378#[derive(serde::Serialize, serde::Deserialize)]
1379#[derive(Clone, PartialEq, ::prost::Message)]
1380pub struct ProductCreatedEvent {
1381    #[prost(string, tag = "1")]
1382    pub title: ::prost::alloc::string::String,
1383    #[prost(string, tag = "2")]
1384    pub description: ::prost::alloc::string::String,
1385}
1386#[derive(serde::Serialize, serde::Deserialize)]
1387#[derive(Clone, PartialEq, ::prost::Message)]
1388pub struct ProductUpdatedEvent {
1389    #[prost(string, optional, tag = "1")]
1390    pub title: ::core::option::Option<::prost::alloc::string::String>,
1391    #[prost(string, optional, tag = "2")]
1392    pub description: ::core::option::Option<::prost::alloc::string::String>,
1393}
1394#[derive(serde::Serialize, serde::Deserialize)]
1395#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1396pub struct ProductDeletedEvent {}