megacommerce_proto/
shared.v1.rs

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