megacommerce_proto/
shared.v1.rs

1// This file is @generated by prost-build.
2#[derive(serde::Serialize, serde::Deserialize)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct StringMap {
5    #[prost(map = "string, string", tag = "1")]
6    pub data: ::std::collections::HashMap<
7        ::prost::alloc::string::String,
8        ::prost::alloc::string::String,
9    >,
10}
11#[derive(serde::Serialize, serde::Deserialize)]
12#[derive(Clone, PartialEq, ::prost::Message)]
13pub struct NestedStringMap {
14    #[prost(map = "string, message", tag = "1")]
15    pub data: ::std::collections::HashMap<::prost::alloc::string::String, StringMap>,
16}
17#[derive(serde::Serialize, serde::Deserialize)]
18#[derive(Clone, Copy, PartialEq, ::prost::Message)]
19pub struct OrderDirection {
20    #[prost(oneof = "order_direction::Order", tags = "1, 2")]
21    pub order: ::core::option::Option<order_direction::Order>,
22}
23/// Nested message and enum types in `OrderDirection`.
24pub mod order_direction {
25    #[derive(serde::Serialize, serde::Deserialize)]
26    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
27    pub enum Order {
28        #[prost(bool, tag = "1")]
29        Asc(bool),
30        #[prost(bool, tag = "2")]
31        Desc(bool),
32    }
33}
34#[derive(serde::Serialize, serde::Deserialize)]
35#[derive(Clone, PartialEq, ::prost::Message)]
36pub struct SuccessResponseData {
37    #[prost(string, optional, tag = "1")]
38    pub message: ::core::option::Option<::prost::alloc::string::String>,
39    #[prost(map = "string, string", tag = "2")]
40    pub metadata: ::std::collections::HashMap<
41        ::prost::alloc::string::String,
42        ::prost::alloc::string::String,
43    >,
44}
45/// Custom Any message to avoid google.protobuf.Any issues
46#[derive(serde::Serialize, serde::Deserialize)]
47#[derive(Clone, PartialEq, ::prost::Message)]
48pub struct Any {
49    /// Identifies the type of the serialized message
50    #[prost(string, tag = "1")]
51    pub type_url: ::prost::alloc::string::String,
52    /// Serialized proto data
53    #[prost(bytes = "vec", tag = "2")]
54    pub value: ::prost::alloc::vec::Vec<u8>,
55}
56#[derive(serde::Serialize, serde::Deserialize)]
57#[derive(Clone, Copy, PartialEq, ::prost::Message)]
58pub struct Empty {}
59#[derive(serde::Serialize, serde::Deserialize)]
60#[derive(Clone, PartialEq, ::prost::Message)]
61pub struct AppError {
62    #[prost(string, tag = "1")]
63    pub id: ::prost::alloc::string::String,
64    /// displayed to the end user without debugging info
65    #[prost(string, tag = "2")]
66    pub message: ::prost::alloc::string::String,
67    /// Internal debug info
68    #[prost(string, tag = "3")]
69    pub detailed_error: ::prost::alloc::string::String,
70    /// For correlation
71    #[prost(string, tag = "4")]
72    pub request_id: ::prost::alloc::string::String,
73    /// grpc status code
74    #[prost(int32, tag = "5")]
75    pub status_code: i32,
76    /// Code path or func name
77    #[prost(string, tag = "6")]
78    pub r#where: ::prost::alloc::string::String,
79    /// If false, i18n may not apply
80    #[prost(bool, tag = "7")]
81    pub skip_translation: bool,
82    #[prost(message, optional, tag = "8")]
83    pub errors: ::core::option::Option<StringMap>,
84    #[prost(message, optional, tag = "9")]
85    pub errors_nested: ::core::option::Option<NestedStringMap>,
86}
87/// `Struct` represents a structured data value, consisting of fields
88/// which map to dynamically typed values. In some languages, `Struct`
89/// might be supported by a native representation. For example, in
90/// scripting languages like JS a struct is represented as an
91/// object. The details of that representation are described together
92/// with the proto support for the language.
93///
94/// The JSON representation for `Struct` is JSON object.
95#[derive(serde::Serialize, serde::Deserialize)]
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct Struct {
98    /// Unordered map of dynamically typed values.
99    #[prost(map = "string, message", tag = "1")]
100    pub fields: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
101}
102/// `Value` represents a dynamically typed value which can be either
103/// null, a number, a string, a boolean, a recursive struct value, or a
104/// list of values. A producer of value is expected to set one of these
105/// variants. Absence of any variant indicates an error.
106///
107/// The JSON representation for `Value` is JSON value.
108#[derive(serde::Serialize, serde::Deserialize)]
109#[derive(Clone, PartialEq, ::prost::Message)]
110pub struct Value {
111    /// The kind of value.
112    #[prost(oneof = "value::Kind", tags = "1, 2, 3, 4, 5, 6")]
113    pub kind: ::core::option::Option<value::Kind>,
114}
115/// Nested message and enum types in `Value`.
116pub mod value {
117    /// The kind of value.
118    #[derive(serde::Serialize, serde::Deserialize)]
119    #[derive(Clone, PartialEq, ::prost::Oneof)]
120    pub enum Kind {
121        /// Represents a null value.
122        #[prost(enumeration = "super::NullValue", tag = "1")]
123        NullValue(i32),
124        /// Represents a double value.
125        #[prost(double, tag = "2")]
126        NumberValue(f64),
127        /// Represents a string value.
128        #[prost(string, tag = "3")]
129        StringValue(::prost::alloc::string::String),
130        /// Represents a boolean value.
131        #[prost(bool, tag = "4")]
132        BoolValue(bool),
133        /// Represents a structured value.
134        #[prost(message, tag = "5")]
135        StructValue(super::Struct),
136        /// Represents a repeated `Value`.
137        #[prost(message, tag = "6")]
138        ListValue(super::ListValue),
139    }
140}
141/// `ListValue` is a wrapper around a repeated field of values.
142///
143/// The JSON representation for `ListValue` is JSON array.
144#[derive(serde::Serialize, serde::Deserialize)]
145#[derive(Clone, PartialEq, ::prost::Message)]
146pub struct ListValue {
147    /// Repeated field of dynamically typed values.
148    #[prost(message, repeated, tag = "1")]
149    pub values: ::prost::alloc::vec::Vec<Value>,
150}
151/// `NullValue` is a singleton enumeration to represent the null value for the
152/// `Value` type union.
153///
154/// The JSON representation for `NullValue` is JSON `null`.
155#[derive(serde::Serialize, serde::Deserialize)]
156#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
157#[repr(i32)]
158pub enum NullValue {
159    /// Null value.
160    NullValue = 0,
161}
162impl NullValue {
163    /// String value of the enum field names used in the ProtoBuf definition.
164    ///
165    /// The values are not transformed in any way and thus are considered stable
166    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
167    pub fn as_str_name(&self) -> &'static str {
168        match self {
169            Self::NullValue => "NULL_VALUE",
170        }
171    }
172    /// Creates an enum from field names used in the ProtoBuf definition.
173    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
174        match value {
175            "NULL_VALUE" => Some(Self::NullValue),
176            _ => None,
177        }
178    }
179}
180#[derive(serde::Serialize, serde::Deserialize)]
181#[derive(Clone, PartialEq, ::prost::Message)]
182pub struct Attachment {
183    #[prost(string, tag = "1")]
184    pub id: ::prost::alloc::string::String,
185    #[prost(string, tag = "2")]
186    pub filename: ::prost::alloc::string::String,
187    #[prost(string, tag = "3")]
188    pub file_type: ::prost::alloc::string::String,
189    #[prost(int64, tag = "4")]
190    pub file_size: i64,
191    #[prost(string, tag = "5")]
192    pub file_extension: ::prost::alloc::string::String,
193    #[prost(string, tag = "6")]
194    pub base64: ::prost::alloc::string::String,
195    #[prost(int32, tag = "7")]
196    pub exif_orientation: i32,
197    #[prost(message, optional, tag = "8")]
198    pub crop: ::core::option::Option<Crop>,
199    /// arbitrary JSON-like object
200    #[prost(message, optional, tag = "9")]
201    pub metadata: ::core::option::Option<Struct>,
202    /// usually set by the backend
203    #[prost(bytes = "vec", tag = "10")]
204    pub data: ::prost::alloc::vec::Vec<u8>,
205    /// usually set by the backend
206    #[prost(string, tag = "11")]
207    pub mime: ::prost::alloc::string::String,
208}
209#[derive(serde::Serialize, serde::Deserialize)]
210#[derive(Clone, Copy, PartialEq, ::prost::Message)]
211pub struct Crop {
212    #[prost(float, tag = "1")]
213    pub x: f32,
214    #[prost(float, tag = "2")]
215    pub y: f32,
216    #[prost(float, tag = "3")]
217    pub width: f32,
218    #[prost(float, tag = "4")]
219    pub height: f32,
220    #[prost(float, tag = "5")]
221    pub aspect_ratio: f32,
222}
223#[derive(serde::Serialize, serde::Deserialize)]
224#[derive(Clone, PartialEq, ::prost::Message)]
225pub struct AttachmentError {
226    /// the attachment id
227    #[prost(string, tag = "1")]
228    pub id: ::prost::alloc::string::String,
229    #[prost(enumeration = "AttachmentErrorType", tag = "2")]
230    pub r#type: i32,
231    /// shown to the user
232    #[prost(string, tag = "3")]
233    pub message: ::prost::alloc::string::String,
234    /// used for the backend
235    #[prost(string, tag = "4")]
236    pub error: ::prost::alloc::string::String,
237}
238#[derive(serde::Serialize, serde::Deserialize)]
239#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
240#[repr(i32)]
241pub enum AttachmentErrorType {
242    Unspecified = 0,
243    InvalidBase64 = 1,
244    InvalidFileType = 2,
245    BigFile = 3,
246    DecodeImg = 4,
247    BigDimensionsImg = 5,
248    UnsupportedFileType = 6,
249}
250impl AttachmentErrorType {
251    /// String value of the enum field names used in the ProtoBuf definition.
252    ///
253    /// The values are not transformed in any way and thus are considered stable
254    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
255    pub fn as_str_name(&self) -> &'static str {
256        match self {
257            Self::Unspecified => "UNSPECIFIED",
258            Self::InvalidBase64 => "INVALID_BASE64",
259            Self::InvalidFileType => "INVALID_FILE_TYPE",
260            Self::BigFile => "BIG_FILE",
261            Self::DecodeImg => "DECODE_IMG",
262            Self::BigDimensionsImg => "BIG_DIMENSIONS_IMG",
263            Self::UnsupportedFileType => "UNSUPPORTED_FILE_TYPE",
264        }
265    }
266    /// Creates an enum from field names used in the ProtoBuf definition.
267    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
268        match value {
269            "UNSPECIFIED" => Some(Self::Unspecified),
270            "INVALID_BASE64" => Some(Self::InvalidBase64),
271            "INVALID_FILE_TYPE" => Some(Self::InvalidFileType),
272            "BIG_FILE" => Some(Self::BigFile),
273            "DECODE_IMG" => Some(Self::DecodeImg),
274            "BIG_DIMENSIONS_IMG" => Some(Self::BigDimensionsImg),
275            "UNSUPPORTED_FILE_TYPE" => Some(Self::UnsupportedFileType),
276            _ => None,
277        }
278    }
279}
280/// A Timestamp represents a point in time independent of any time zone or local
281/// calendar, encoded as a count of seconds and fractions of seconds at
282/// nanosecond resolution. The count is relative to an epoch at UTC midnight on
283/// January 1, 1970, in the proleptic Gregorian calendar which extends the
284/// Gregorian calendar backwards to year one.
285///
286/// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
287/// second table is needed for interpretation, using a
288/// [24-hour linear smear](<https://developers.google.com/time/smear>).
289///
290/// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
291/// restricting to that range, we ensure that we can convert to and from
292/// [RFC 3339](<https://www.ietf.org/rfc/rfc3339.txt>) date strings.
293///
294/// # Examples
295///
296/// Example 1: Compute Timestamp from POSIX `time()`.
297///
298///      Timestamp timestamp;
299///      timestamp.set_seconds(time(NULL));
300///      timestamp.set_nanos(0);
301///
302/// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
303///
304///      struct timeval tv;
305///      gettimeofday(&tv, NULL);
306///
307///      Timestamp timestamp;
308///      timestamp.set_seconds(tv.tv_sec);
309///      timestamp.set_nanos(tv.tv_usec * 1000);
310///
311/// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
312///
313///      FILETIME ft;
314///      GetSystemTimeAsFileTime(&ft);
315///      UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
316///
317///      // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
318///      // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
319///      Timestamp timestamp;
320///      timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
321///      timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
322///
323/// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
324///
325///      long millis = System.currentTimeMillis();
326///
327///      Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
328///          .setNanos((int) ((millis % 1000) * 1000000)).build();
329///
330/// Example 5: Compute Timestamp from Java `Instant.now()`.
331///
332///      Instant now = Instant.now();
333///
334///      Timestamp timestamp =
335///          Timestamp.newBuilder().setSeconds(now.getEpochSecond())
336///              .setNanos(now.getNano()).build();
337///
338/// Example 6: Compute Timestamp from current time in Python.
339///
340///      timestamp = Timestamp()
341///      timestamp.GetCurrentTime()
342///
343/// # JSON Mapping
344///
345/// In JSON format, the Timestamp type is encoded as a string in the
346/// [RFC 3339](<https://www.ietf.org/rfc/rfc3339.txt>) format. That is, the
347/// format is "{year}-{month}-{day}T{hour}:{min}:{sec}\[.{frac_sec}\]Z"
348/// where {year} is always expressed using four digits while {month}, {day},
349/// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
350/// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
351/// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
352/// is required. A proto3 JSON serializer should always use UTC (as indicated by "Z")
353/// when printing the Timestamp type and a proto3 JSON parser should be
354/// able to accept both UTC and other timezones (as indicated by an offset).
355///
356/// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
357/// 01:30 UTC on January 15, 2017.
358///
359/// In JavaScript, one can convert a Date object to this format using the standard
360/// [toISOString()](<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString>)
361/// method. In Python, a standard `datetime.datetime` object can be converted
362/// to this format using
363/// [`strftime`](<https://docs.python.org/2/library/time.html#time.strftime>) with
364/// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
365/// the Joda Time's [`ISODateTimeFormat.dateTime()`](
366/// <http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime(>)
367/// ) to obtain a formatter capable of generating timestamps in this format.
368///
369#[derive(serde::Serialize, serde::Deserialize)]
370#[derive(Clone, Copy, PartialEq, ::prost::Message)]
371pub struct Timestamp {
372    /// Represents seconds of UTC time since Unix epoch
373    /// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
374    /// 9999-12-31T23:59:59Z inclusive.
375    #[prost(int64, tag = "1")]
376    pub seconds: i64,
377    /// Non-negative fractions of a second at nanosecond resolution. Negative
378    /// second values with fractions must still have non-negative nanos values
379    /// that count forward in time. Must be from 0 to 999,999,999 inclusive.
380    #[prost(int32, tag = "2")]
381    pub nanos: i32,
382}