gcp_client/google/
type.rs

1/// Represents an expression text. Example:
2///
3///     title: "User account presence"
4///     description: "Determines whether the request has a user account"
5///     expression: "size(request.user) > 0"
6#[derive(Clone, PartialEq, ::prost::Message)]
7pub struct Expr {
8    /// Textual representation of an expression in
9    /// Common Expression Language syntax.
10    ///
11    /// The application context of the containing message determines which
12    /// well-known feature set of CEL is supported.
13    #[prost(string, tag="1")]
14    pub expression: std::string::String,
15    /// An optional title for the expression, i.e. a short string describing
16    /// its purpose. This can be used e.g. in UIs which allow to enter the
17    /// expression.
18    #[prost(string, tag="2")]
19    pub title: std::string::String,
20    /// An optional description of the expression. This is a longer text which
21    /// describes the expression, e.g. when hovered over it in a UI.
22    #[prost(string, tag="3")]
23    pub description: std::string::String,
24    /// An optional string indicating the location of the expression for error
25    /// reporting, e.g. a file name and a position in the file.
26    #[prost(string, tag="4")]
27    pub location: std::string::String,
28}
29/// An object representing a latitude/longitude pair. This is expressed as a pair
30/// of doubles representing degrees latitude and degrees longitude. Unless
31/// specified otherwise, this must conform to the
32/// <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
33/// standard</a>. Values must be within normalized ranges.
34#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct LatLng {
36    /// The latitude in degrees. It must be in the range [-90.0, +90.0].
37    #[prost(double, tag="1")]
38    pub latitude: f64,
39    /// The longitude in degrees. It must be in the range [-180.0, +180.0].
40    #[prost(double, tag="2")]
41    pub longitude: f64,
42}
43/// Represents a color in the RGBA color space. This representation is designed
44/// for simplicity of conversion to/from color representations in various
45/// languages over compactness; for example, the fields of this representation
46/// can be trivially provided to the constructor of "java.awt.Color" in Java; it
47/// can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
48/// method in iOS; and, with just a little work, it can be easily formatted into
49/// a CSS "rgba()" string in JavaScript, as well.
50///
51/// Note: this proto does not carry information about the absolute color space
52/// that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
53/// DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
54/// space.
55///
56/// Example (Java):
57///
58///      import com.google.type.Color;
59///
60///      // ...
61///      public static java.awt.Color fromProto(Color protocolor) {
62///        float alpha = protocolor.hasAlpha()
63///            ? protocolor.getAlpha().getValue()
64///            : 1.0;
65///
66///        return new java.awt.Color(
67///            protocolor.getRed(),
68///            protocolor.getGreen(),
69///            protocolor.getBlue(),
70///            alpha);
71///      }
72///
73///      public static Color toProto(java.awt.Color color) {
74///        float red = (float) color.getRed();
75///        float green = (float) color.getGreen();
76///        float blue = (float) color.getBlue();
77///        float denominator = 255.0;
78///        Color.Builder resultBuilder =
79///            Color
80///                .newBuilder()
81///                .setRed(red / denominator)
82///                .setGreen(green / denominator)
83///                .setBlue(blue / denominator);
84///        int alpha = color.getAlpha();
85///        if (alpha != 255) {
86///          result.setAlpha(
87///              FloatValue
88///                  .newBuilder()
89///                  .setValue(((float) alpha) / denominator)
90///                  .build());
91///        }
92///        return resultBuilder.build();
93///      }
94///      // ...
95///
96/// Example (iOS / Obj-C):
97///
98///      // ...
99///      static UIColor* fromProto(Color* protocolor) {
100///         float red = [protocolor red];
101///         float green = [protocolor green];
102///         float blue = [protocolor blue];
103///         FloatValue* alpha_wrapper = [protocolor alpha];
104///         float alpha = 1.0;
105///         if (alpha_wrapper != nil) {
106///           alpha = [alpha_wrapper value];
107///         }
108///         return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
109///      }
110///
111///      static Color* toProto(UIColor* color) {
112///          CGFloat red, green, blue, alpha;
113///          if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
114///            return nil;
115///          }
116///          Color* result = [[Color alloc] init];
117///          [result setRed:red];
118///          [result setGreen:green];
119///          [result setBlue:blue];
120///          if (alpha <= 0.9999) {
121///            [result setAlpha:floatWrapperWithValue(alpha)];
122///          }
123///          [result autorelease];
124///          return result;
125///     }
126///     // ...
127///
128///  Example (JavaScript):
129///
130///     // ...
131///
132///     var protoToCssColor = function(rgb_color) {
133///        var redFrac = rgb_color.red || 0.0;
134///        var greenFrac = rgb_color.green || 0.0;
135///        var blueFrac = rgb_color.blue || 0.0;
136///        var red = Math.floor(redFrac * 255);
137///        var green = Math.floor(greenFrac * 255);
138///        var blue = Math.floor(blueFrac * 255);
139///
140///        if (!('alpha' in rgb_color)) {
141///           return rgbToCssColor_(red, green, blue);
142///        }
143///
144///        var alphaFrac = rgb_color.alpha.value || 0.0;
145///        var rgbParams = [red, green, blue].join(',');
146///        return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
147///     };
148///
149///     var rgbToCssColor_ = function(red, green, blue) {
150///       var rgbNumber = new Number((red << 16) | (green << 8) | blue);
151///       var hexString = rgbNumber.toString(16);
152///       var missingZeros = 6 - hexString.length;
153///       var resultBuilder = ['#'];
154///       for (var i = 0; i < missingZeros; i++) {
155///          resultBuilder.push('0');
156///       }
157///       resultBuilder.push(hexString);
158///       return resultBuilder.join('');
159///     };
160///
161///     // ...
162#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct Color {
164    /// The amount of red in the color as a value in the interval [0, 1].
165    #[prost(float, tag="1")]
166    pub red: f32,
167    /// The amount of green in the color as a value in the interval [0, 1].
168    #[prost(float, tag="2")]
169    pub green: f32,
170    /// The amount of blue in the color as a value in the interval [0, 1].
171    #[prost(float, tag="3")]
172    pub blue: f32,
173    /// The fraction of this color that should be applied to the pixel. That is,
174    /// the final pixel color is defined by the equation:
175    ///
176    ///   pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
177    ///
178    /// This means that a value of 1.0 corresponds to a solid color, whereas
179    /// a value of 0.0 corresponds to a completely transparent color. This
180    /// uses a wrapper message rather than a simple float scalar so that it is
181    /// possible to distinguish between a default value and the value being unset.
182    /// If omitted, this color object is to be rendered as a solid color
183    /// (as if the alpha value had been explicitly given with a value of 1.0).
184    #[prost(message, optional, tag="4")]
185    pub alpha: ::std::option::Option<f32>,
186}
187/// Represents a whole or partial calendar date, e.g. a birthday. The time of day
188/// and time zone are either specified elsewhere or are not significant. The date
189/// is relative to the Proleptic Gregorian Calendar. This can represent:
190///
191/// * A full date, with non-zero year, month and day values
192/// * A month and day value, with a zero year, e.g. an anniversary
193/// * A year on its own, with zero month and day values
194/// * A year and month value, with a zero day, e.g. a credit card expiration date
195///
196/// Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`.
197#[derive(Clone, PartialEq, ::prost::Message)]
198pub struct Date {
199    /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without
200    /// a year.
201    #[prost(int32, tag="1")]
202    pub year: i32,
203    /// Month of year. Must be from 1 to 12, or 0 if specifying a year without a
204    /// month and day.
205    #[prost(int32, tag="2")]
206    pub month: i32,
207    /// Day of month. Must be from 1 to 31 and valid for the year and month, or 0
208    /// if specifying a year by itself or a year and month where the day is not
209    /// significant.
210    #[prost(int32, tag="3")]
211    pub day: i32,
212}
213/// Represents an amount of money with its currency type.
214#[derive(Clone, PartialEq, ::prost::Message)]
215pub struct Money {
216    /// The 3-letter currency code defined in ISO 4217.
217    #[prost(string, tag="1")]
218    pub currency_code: std::string::String,
219    /// The whole units of the amount.
220    /// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
221    #[prost(int64, tag="2")]
222    pub units: i64,
223    /// Number of nano (10^-9) units of the amount.
224    /// The value must be between -999,999,999 and +999,999,999 inclusive.
225    /// If `units` is positive, `nanos` must be positive or zero.
226    /// If `units` is zero, `nanos` can be positive, zero, or negative.
227    /// If `units` is negative, `nanos` must be negative or zero.
228    /// For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
229    #[prost(int32, tag="3")]
230    pub nanos: i32,
231}
232/// Represents civil time in one of a few possible ways:
233///
234///  * When utc_offset is set and time_zone is unset: a civil time on a calendar
235///    day with a particular offset from UTC.
236///  * When time_zone is set and utc_offset is unset: a civil time on a calendar
237///    day in a particular time zone.
238///  * When neither time_zone nor utc_offset is set: a civil time on a calendar
239///    day in local time.
240///
241/// The date is relative to the Proleptic Gregorian Calendar.
242///
243/// If year is 0, the DateTime is considered not to have a specific year. month
244/// and day must have valid, non-zero values.
245///
246/// This type is more flexible than some applications may want. Make sure to
247/// document and validate your application's limitations.
248#[derive(Clone, PartialEq, ::prost::Message)]
249pub struct DateTime {
250    /// Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a
251    /// datetime without a year.
252    #[prost(int32, tag="1")]
253    pub year: i32,
254    /// Required. Month of year. Must be from 1 to 12.
255    #[prost(int32, tag="2")]
256    pub month: i32,
257    /// Required. Day of month. Must be from 1 to 31 and valid for the year and
258    /// month.
259    #[prost(int32, tag="3")]
260    pub day: i32,
261    /// Required. Hours of day in 24 hour format. Should be from 0 to 23. An API
262    /// may choose to allow the value "24:00:00" for scenarios like business
263    /// closing time.
264    #[prost(int32, tag="4")]
265    pub hours: i32,
266    /// Required. Minutes of hour of day. Must be from 0 to 59.
267    #[prost(int32, tag="5")]
268    pub minutes: i32,
269    /// Required. Seconds of minutes of the time. Must normally be from 0 to 59. An
270    /// API may allow the value 60 if it allows leap-seconds.
271    #[prost(int32, tag="6")]
272    pub seconds: i32,
273    /// Required. Fractions of seconds in nanoseconds. Must be from 0 to
274    /// 999,999,999.
275    #[prost(int32, tag="7")]
276    pub nanos: i32,
277    /// Optional. Specifies either the UTC offset or the time zone of the DateTime.
278    /// Choose carefully between them, considering that time zone data may change
279    /// in the future (for example, a country modifies their DST start/end dates,
280    /// and future DateTimes in the affected range had already been stored).
281    /// If omitted, the DateTime is considered to be in local time.
282    #[prost(oneof="date_time::TimeOffset", tags="8, 9")]
283    pub time_offset: ::std::option::Option<date_time::TimeOffset>,
284}
285pub mod date_time {
286    /// Optional. Specifies either the UTC offset or the time zone of the DateTime.
287    /// Choose carefully between them, considering that time zone data may change
288    /// in the future (for example, a country modifies their DST start/end dates,
289    /// and future DateTimes in the affected range had already been stored).
290    /// If omitted, the DateTime is considered to be in local time.
291    #[derive(Clone, PartialEq, ::prost::Oneof)]
292    pub enum TimeOffset {
293        /// UTC offset. Must be whole seconds, between -18 hours and +18 hours.
294        /// For example, a UTC offset of -4:00 would be represented as
295        /// { seconds: -14400 }.
296        #[prost(message, tag="8")]
297        UtcOffset(::prost_types::Duration),
298        /// Time zone.
299        #[prost(message, tag="9")]
300        TimeZone(super::TimeZone),
301    }
302}
303/// Represents a time zone from the
304/// [IANA Time Zone Database](https://www.iana.org/time-zones).
305#[derive(Clone, PartialEq, ::prost::Message)]
306pub struct TimeZone {
307    /// IANA Time Zone Database time zone, e.g. "America/New_York".
308    #[prost(string, tag="1")]
309    pub id: std::string::String,
310    /// Optional. IANA Time Zone Database version number, e.g. "2019a".
311    #[prost(string, tag="2")]
312    pub version: std::string::String,
313}
314/// Represents a day of week.
315#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
316#[repr(i32)]
317pub enum DayOfWeek {
318    /// The unspecified day-of-week.
319    Unspecified = 0,
320    /// The day-of-week of Monday.
321    Monday = 1,
322    /// The day-of-week of Tuesday.
323    Tuesday = 2,
324    /// The day-of-week of Wednesday.
325    Wednesday = 3,
326    /// The day-of-week of Thursday.
327    Thursday = 4,
328    /// The day-of-week of Friday.
329    Friday = 5,
330    /// The day-of-week of Saturday.
331    Saturday = 6,
332    /// The day-of-week of Sunday.
333    Sunday = 7,
334}
335/// Represents a time of day. The date and time zone are either not significant
336/// or are specified elsewhere. An API may choose to allow leap seconds. Related
337/// types are [google.type.Date][google.type.Date] and `google.protobuf.Timestamp`.
338#[derive(Clone, PartialEq, ::prost::Message)]
339pub struct TimeOfDay {
340    /// Hours of day in 24 hour format. Should be from 0 to 23. An API may choose
341    /// to allow the value "24:00:00" for scenarios like business closing time.
342    #[prost(int32, tag="1")]
343    pub hours: i32,
344    /// Minutes of hour of day. Must be from 0 to 59.
345    #[prost(int32, tag="2")]
346    pub minutes: i32,
347    /// Seconds of minutes of the time. Must normally be from 0 to 59. An API may
348    /// allow the value 60 if it allows leap-seconds.
349    #[prost(int32, tag="3")]
350    pub seconds: i32,
351    /// Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.
352    #[prost(int32, tag="4")]
353    pub nanos: i32,
354}
355/// Represents a postal address, e.g. for postal delivery or payments addresses.
356/// Given a postal address, a postal service can deliver items to a premise, P.O.
357/// Box or similar.
358/// It is not intended to model geographical locations (roads, towns,
359/// mountains).
360///
361/// In typical usage an address would be created via user input or from importing
362/// existing data, depending on the type of process.
363///
364/// Advice on address input / editing:
365///  - Use an i18n-ready address widget such as
366///    https://github.com/google/libaddressinput)
367/// - Users should not be presented with UI elements for input or editing of
368///   fields outside countries where that field is used.
369///
370/// For more guidance on how to use this schema, please see:
371/// https://support.google.com/business/answer/6397478
372#[derive(Clone, PartialEq, ::prost::Message)]
373pub struct PostalAddress {
374    /// The schema revision of the `PostalAddress`. This must be set to 0, which is
375    /// the latest revision.
376    ///
377    /// All new revisions **must** be backward compatible with old revisions.
378    #[prost(int32, tag="1")]
379    pub revision: i32,
380    /// Required. CLDR region code of the country/region of the address. This
381    /// is never inferred and it is up to the user to ensure the value is
382    /// correct. See http://cldr.unicode.org/ and
383    /// http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html
384    /// for details. Example: "CH" for Switzerland.
385    #[prost(string, tag="2")]
386    pub region_code: std::string::String,
387    /// Optional. BCP-47 language code of the contents of this address (if
388    /// known). This is often the UI language of the input form or is expected
389    /// to match one of the languages used in the address' country/region, or their
390    /// transliterated equivalents.
391    /// This can affect formatting in certain countries, but is not critical
392    /// to the correctness of the data and will never affect any validation or
393    /// other non-formatting related operations.
394    ///
395    /// If this value is not known, it should be omitted (rather than specifying a
396    /// possibly incorrect default).
397    ///
398    /// Examples: "zh-Hant", "ja", "ja-Latn", "en".
399    #[prost(string, tag="3")]
400    pub language_code: std::string::String,
401    /// Optional. Postal code of the address. Not all countries use or require
402    /// postal codes to be present, but where they are used, they may trigger
403    /// additional validation with other parts of the address (e.g. state/zip
404    /// validation in the U.S.A.).
405    #[prost(string, tag="4")]
406    pub postal_code: std::string::String,
407    /// Optional. Additional, country-specific, sorting code. This is not used
408    /// in most regions. Where it is used, the value is either a string like
409    /// "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number
410    /// alone, representing the "sector code" (Jamaica), "delivery area indicator"
411    /// (Malawi) or "post office indicator" (e.g. Côte d'Ivoire).
412    #[prost(string, tag="5")]
413    pub sorting_code: std::string::String,
414    /// Optional. Highest administrative subdivision which is used for postal
415    /// addresses of a country or region.
416    /// For example, this can be a state, a province, an oblast, or a prefecture.
417    /// Specifically, for Spain this is the province and not the autonomous
418    /// community (e.g. "Barcelona" and not "Catalonia").
419    /// Many countries don't use an administrative area in postal addresses. E.g.
420    /// in Switzerland this should be left unpopulated.
421    #[prost(string, tag="6")]
422    pub administrative_area: std::string::String,
423    /// Optional. Generally refers to the city/town portion of the address.
424    /// Examples: US city, IT comune, UK post town.
425    /// In regions of the world where localities are not well defined or do not fit
426    /// into this structure well, leave locality empty and use address_lines.
427    #[prost(string, tag="7")]
428    pub locality: std::string::String,
429    /// Optional. Sublocality of the address.
430    /// For example, this can be neighborhoods, boroughs, districts.
431    #[prost(string, tag="8")]
432    pub sublocality: std::string::String,
433    /// Unstructured address lines describing the lower levels of an address.
434    ///
435    /// Because values in address_lines do not have type information and may
436    /// sometimes contain multiple values in a single field (e.g.
437    /// "Austin, TX"), it is important that the line order is clear. The order of
438    /// address lines should be "envelope order" for the country/region of the
439    /// address. In places where this can vary (e.g. Japan), address_language is
440    /// used to make it explicit (e.g. "ja" for large-to-small ordering and
441    /// "ja-Latn" or "en" for small-to-large). This way, the most specific line of
442    /// an address can be selected based on the language.
443    ///
444    /// The minimum permitted structural representation of an address consists
445    /// of a region_code with all remaining information placed in the
446    /// address_lines. It would be possible to format such an address very
447    /// approximately without geocoding, but no semantic reasoning could be
448    /// made about any of the address components until it was at least
449    /// partially resolved.
450    ///
451    /// Creating an address only containing a region_code and address_lines, and
452    /// then geocoding is the recommended way to handle completely unstructured
453    /// addresses (as opposed to guessing which parts of the address should be
454    /// localities or administrative areas).
455    #[prost(string, repeated, tag="9")]
456    pub address_lines: ::std::vec::Vec<std::string::String>,
457    /// Optional. The recipient at the address.
458    /// This field may, under certain circumstances, contain multiline information.
459    /// For example, it might contain "care of" information.
460    #[prost(string, repeated, tag="10")]
461    pub recipients: ::std::vec::Vec<std::string::String>,
462    /// Optional. The name of the organization at the address.
463    #[prost(string, tag="11")]
464    pub organization: std::string::String,
465}