Skip to main content

proto_types/common/
google.type.rs

1// This file is @generated by prost-build.
2/// Represents a time of day.
3///
4/// The date and time zone are either not significant
5/// or are specified elsewhere. An API may choose to allow leap seconds. Related
6/// types are [google.type.Date][google.type.Date] and
7/// `google.protobuf.Timestamp`.
8#[cfg(feature = "timeofday")]
9#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
11#[cfg_attr(
12  any(feature = "diesel-postgres", feature = "diesel-sqlite"),
13  derive(diesel::QueryId, diesel::AsExpression, diesel::FromSqlRow),
14  diesel(sql_type = diesel::sql_types::Time)
15)]
16pub struct TimeOfDay {
17  /// Hours of day in 24 hour format. Should be from 0 to 23. An API may choose
18  /// to allow the value "24:00:00" for scenarios like business closing time.
19  #[prost(int32, tag = "1")]
20  pub hours: i32,
21  /// Minutes of hour of day. Must be from 0 to 59.
22  #[prost(int32, tag = "2")]
23  pub minutes: i32,
24  /// Seconds of minutes of the time. Must normally be from 0 to 59. An API may
25  /// allow the value 60 if it allows leap-seconds.
26  #[prost(int32, tag = "3")]
27  pub seconds: i32,
28  /// Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.
29  #[prost(int32, tag = "4")]
30  pub nanos: i32,
31}
32/// Localized variant of a text in a particular language.
33#[cfg(feature = "localized_text")]
34#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
35#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
36#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
37pub struct LocalizedText {
38  /// Localized string in the language corresponding to `language_code' below.
39  #[prost(string, tag = "1")]
40  pub text: ::prost::alloc::string::String,
41  /// The text's BCP-47 language code, such as "en-US" or "sr-Latn".
42  ///
43  /// For more information, see
44  /// <http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.>
45  #[prost(string, tag = "2")]
46  pub language_code: ::prost::alloc::string::String,
47}
48/// A quaternion is defined as the quotient of two directed lines in a
49/// three-dimensional space or equivalently as the quotient of two Euclidean
50/// vectors (<https://en.wikipedia.org/wiki/Quaternion>).
51///
52/// Quaternions are often used in calculations involving three-dimensional
53/// rotations (<https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation>),
54/// as they provide greater mathematical robustness by avoiding the gimbal lock
55/// problems that can be encountered when using Euler angles
56/// (<https://en.wikipedia.org/wiki/Gimbal_lock>).
57///
58/// Quaternions are generally represented in this form:
59///
60///   w + xi + yj + zk
61///
62/// where x, y, z, and w are real numbers, and i, j, and k are three imaginary
63/// numbers.
64///
65/// Our naming choice `(x, y, z, w)` comes from the desire to avoid confusion for
66/// those interested in the geometric properties of the quaternion in the 3D
67/// Cartesian space. Other texts often use alternative names or subscripts, such
68/// as `(a, b, c, d)`, `(1, i, j, k)`, or `(0, 1, 2, 3)`, which are perhaps
69/// better suited for mathematical interpretations.
70///
71/// To avoid any confusion, as well as to maintain compatibility with a large
72/// number of software libraries, the quaternions represented using the protocol
73/// buffer below *must* follow the Hamilton convention, which defines `ij = k`
74/// (i.e. a right-handed algebra), and therefore:
75///
76///   i^2 = j^2 = k^2 = ijk = −1
77///   ij = −ji = k
78///   jk = −kj = i
79///   ki = −ik = j
80///
81/// Please DO NOT use this to represent quaternions that follow the JPL
82/// convention, or any of the other quaternion flavors out there.
83///
84/// Definitions:
85///
86///  - Quaternion norm (or magnitude): `sqrt(x^2 + y^2 + z^2 + w^2)`.
87///  - Unit (or normalized) quaternion: a quaternion whose norm is 1.
88///  - Pure quaternion: a quaternion whose scalar component (`w`) is 0.
89///  - Rotation quaternion: a unit quaternion used to represent rotation.
90///  - Orientation quaternion: a unit quaternion used to represent orientation.
91///
92/// A quaternion can be normalized by dividing it by its norm. The resulting
93/// quaternion maintains the same direction, but has a norm of 1, i.e. it moves
94/// on the unit sphere. This is generally necessary for rotation and orientation
95/// quaternions, to avoid rounding errors:
96/// <https://en.wikipedia.org/wiki/Rotation_formalisms_in_three_dimensions>
97///
98/// Note that `(x, y, z, w)` and `(-x, -y, -z, -w)` represent the same rotation,
99/// but normalization would be even more useful, e.g. for comparison purposes, if
100/// it would produce a unique representation. It is thus recommended that `w` be
101/// kept positive, which can be achieved by changing all the signs when `w` is
102/// negative.
103///
104#[cfg(feature = "quaternion")]
105#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
106#[derive(Clone, Copy, PartialEq, ::prost::Message)]
107pub struct Quaternion {
108  /// The x component.
109  #[prost(double, tag = "1")]
110  pub x: f64,
111  /// The y component.
112  #[prost(double, tag = "2")]
113  pub y: f64,
114  /// The z component.
115  #[prost(double, tag = "3")]
116  pub z: f64,
117  /// The scalar component.
118  #[prost(double, tag = "4")]
119  pub w: f64,
120}
121/// A `CalendarPeriod` represents the abstract concept of a time period that has
122/// a canonical start. Grammatically, "the start of the current
123/// `CalendarPeriod`." All calendar times begin at midnight UTC.
124#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
125#[repr(i32)]
126pub enum CalendarPeriod {
127  /// Undefined period, raises an error.
128  Unspecified = 0,
129  /// A day.
130  Day = 1,
131  /// A week. Weeks begin on Monday, following
132  /// [ISO 8601](<https://en.wikipedia.org/wiki/ISO_week_date>).
133  Week = 2,
134  /// A fortnight. The first calendar fortnight of the year begins at the start
135  /// of week 1 according to
136  /// [ISO 8601](<https://en.wikipedia.org/wiki/ISO_week_date>).
137  Fortnight = 3,
138  /// A month.
139  Month = 4,
140  /// A quarter. Quarters start on dates 1-Jan, 1-Apr, 1-Jul, and 1-Oct of each
141  /// year.
142  Quarter = 5,
143  /// A half-year. Half-years start on dates 1-Jan and 1-Jul.
144  Half = 6,
145  /// A year.
146  Year = 7,
147}
148impl CalendarPeriod {
149  /// String value of the enum field names used in the ProtoBuf definition.
150  ///
151  /// The values are not transformed in any way and thus are considered stable
152  /// (if the ProtoBuf definition does not change) and safe for programmatic use.
153  #[must_use]
154  pub const fn as_str_name(&self) -> &'static str {
155    match self {
156      Self::Unspecified => "CALENDAR_PERIOD_UNSPECIFIED",
157      Self::Day => "DAY",
158      Self::Week => "WEEK",
159      Self::Fortnight => "FORTNIGHT",
160      Self::Month => "MONTH",
161      Self::Quarter => "QUARTER",
162      Self::Half => "HALF",
163      Self::Year => "YEAR",
164    }
165  }
166  /// Creates an enum from field names used in the ProtoBuf definition.
167  #[must_use]
168  pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
169    match value {
170      "CALENDAR_PERIOD_UNSPECIFIED" => Some(Self::Unspecified),
171      "DAY" => Some(Self::Day),
172      "WEEK" => Some(Self::Week),
173      "FORTNIGHT" => Some(Self::Fortnight),
174      "MONTH" => Some(Self::Month),
175      "QUARTER" => Some(Self::Quarter),
176      "HALF" => Some(Self::Half),
177      "YEAR" => Some(Self::Year),
178      _ => None,
179    }
180  }
181}
182
183/// Represents an amount of money with its currency type.
184#[cfg(feature = "money")]
185#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
186#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
187#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
188pub struct Money {
189  /// The three-letter currency code defined in ISO 4217.
190  #[prost(string, tag = "1")]
191  pub currency_code: ::prost::alloc::string::String,
192  /// The whole units of the amount.
193  /// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
194  #[prost(int64, tag = "2")]
195  pub units: i64,
196  /// Number of nano (10^-9) units of the amount.
197  /// The value must be between -999,999,999 and +999,999,999 inclusive.
198  /// If `units` is positive, `nanos` must be positive or zero.
199  /// If `units` is zero, `nanos` can be positive, zero, or negative.
200  /// If `units` is negative, `nanos` must be negative or zero.
201  /// For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
202  #[prost(int32, tag = "3")]
203  pub nanos: i32,
204}
205/// Represents civil time (or occasionally physical time).
206///
207/// This type can represent a civil time in one of a few possible ways:
208///
209///   * When utc_offset is set and time_zone is unset: a civil time on a calendar
210///     day with a particular offset from UTC.
211///   * When time_zone is set and utc_offset is unset: a civil time on a calendar
212///     day in a particular time zone.
213///   * When neither time_zone nor utc_offset is set: a civil time on a calendar
214///     day in local time.
215///
216/// The date is relative to the Proleptic Gregorian Calendar.
217///
218/// If year is 0, the DateTime is considered not to have a specific year. month
219/// and day must have valid, non-zero values.
220///
221/// This type may also be used to represent a physical time if all the date and
222/// time fields are set and either case of the `time_offset` oneof is set.
223/// Consider using `Timestamp` message for physical time instead. If your use
224/// case also would like to store the user's timezone, that can be done in
225/// another field.
226///
227/// This type is more flexible than some applications may want. Make sure to
228/// document and validate your application's limitations.
229#[cfg(feature = "datetime")]
230#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
231#[cfg_attr(
232  any(feature = "diesel-postgres", feature = "diesel-sqlite"),
233  derive(diesel::QueryId, diesel::AsExpression, diesel::FromSqlRow),
234  diesel(sql_type = diesel::sql_types::Timestamp)
235)]
236#[cfg_attr(
237  feature = "diesel-postgres",
238  diesel(sql_type = diesel::sql_types::Timestamptz)
239)]
240#[cfg_attr(
241  feature = "diesel-sqlite",
242  diesel(sql_type = diesel::sql_types::TimestamptzSqlite)
243)]
244#[cfg_attr(
245  feature = "diesel-mysql",
246  diesel(sql_type = diesel::sql_types::Datetime)
247)]
248pub struct DateTime {
249  /// Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a
250  /// datetime without a year.
251  #[prost(int32, tag = "1")]
252  pub year: i32,
253  /// Required. Month of year. Must be from 1 to 12.
254  #[prost(int32, tag = "2")]
255  pub month: i32,
256  /// Required. Day of month. Must be from 1 to 31 and valid for the year and
257  /// month.
258  #[prost(int32, tag = "3")]
259  pub day: i32,
260  /// Required. Hours of day in 24 hour format. Should be from 0 to 23. An API
261  /// may choose to allow the value "24:00:00" for scenarios like business
262  /// closing time.
263  #[prost(int32, tag = "4")]
264  pub hours: i32,
265  /// Required. Minutes of hour of day. Must be from 0 to 59.
266  #[prost(int32, tag = "5")]
267  pub minutes: i32,
268  /// Required. Seconds of minutes of the time. Must normally be from 0 to 59. An
269  /// API may allow the value 60 if it allows leap-seconds.
270  #[prost(int32, tag = "6")]
271  pub seconds: i32,
272  /// Required. Fractions of seconds in nanoseconds. Must be from 0 to
273  /// 999,999,999.
274  #[prost(int32, tag = "7")]
275  pub nanos: i32,
276  /// Optional. Specifies either the UTC offset or the time zone of the DateTime.
277  /// Choose carefully between them, considering that time zone data may change
278  /// in the future (for example, a country modifies their DST start/end dates,
279  /// and future DateTimes in the affected range had already been stored).
280  /// If omitted, the DateTime is considered to be in local time.
281  #[prost(oneof = "date_time::TimeOffset", tags = "8, 9")]
282  pub time_offset: ::core::option::Option<date_time::TimeOffset>,
283}
284/// Nested message and enum types in `DateTime`.
285#[cfg(feature = "datetime")]
286pub mod date_time {
287  /// Optional. Specifies either the UTC offset or the time zone of the DateTime.
288  ///
289  ///
290  /// Choose carefully between them, considering that time zone data may change
291  /// in the future (for example, a country modifies their DST start/end dates,
292  /// and future DateTimes in the affected range had already been stored).
293  /// If omitted, the DateTime is considered to be in local time.
294  #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
295  #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
296  pub enum TimeOffset {
297    /// UTC offset. Must be whole seconds, between -18 hours and +18 hours.
298    /// For example, a UTC offset of -4:00 would be represented as
299    /// { seconds: -14400 }.
300    #[prost(message, tag = "8")]
301    UtcOffset(crate::protobuf::Duration),
302    /// Time zone.
303    #[prost(message, tag = "9")]
304    TimeZone(super::TimeZone),
305  }
306}
307
308/// Represents a time zone from the
309/// [IANA Time Zone Database](<https://www.iana.org/time-zones>).
310#[cfg(feature = "datetime")]
311#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
312#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
313pub struct TimeZone {
314  /// IANA Time Zone Database time zone, e.g. "America/New_York".
315  #[prost(string, tag = "1")]
316  pub id: ::prost::alloc::string::String,
317  /// Optional. IANA Time Zone Database version number, e.g. "2019a".
318  #[prost(string, tag = "2")]
319  pub version: ::prost::alloc::string::String,
320}
321/// An object that represents a latitude/longitude pair.
322///
323/// This is expressed as a
324/// pair of doubles to represent degrees latitude and degrees longitude. Unless
325/// specified otherwise, this must conform to the
326/// <a href="<http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84>
327/// standard</a>. Values must be within normalized ranges.
328#[cfg(feature = "latlng")]
329#[derive(Clone, Copy, PartialEq, ::prost::Message)]
330#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
331pub struct LatLng {
332  /// The latitude in degrees. It must be in the range \[-90.0, +90.0\].
333  #[prost(double, tag = "1")]
334  pub latitude: f64,
335  /// The longitude in degrees. It must be in the range \[-180.0, +180.0\].
336  #[prost(double, tag = "2")]
337  pub longitude: f64,
338}
339/// Represents a postal address, e.g. for postal delivery or payments addresses.
340///
341///
342/// Given a postal address, a postal service can deliver items to a premise, P.O.
343/// Box or similar.
344/// It is not intended to model geographical locations (roads, towns,
345/// mountains).
346///
347/// In typical usage an address would be created via user input or from importing
348/// existing data, depending on the type of process.
349///
350/// Advice on address input / editing:
351///   - Use an i18n-ready address widget such as
352///     <https://github.com/google/libaddressinput>)
353/// - Users should not be presented with UI elements for input or editing of
354///    fields outside countries where that field is used.
355///
356/// For more guidance on how to use this schema, please see:
357/// <https://support.google.com/business/answer/6397478>
358#[cfg(feature = "postal_address")]
359#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
360#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
361#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
362pub struct PostalAddress {
363  /// The schema revision of the `PostalAddress`. This must be set to 0, which is
364  /// the latest revision.
365  ///
366  /// All new revisions **must** be backward compatible with old revisions.
367  #[prost(int32, tag = "1")]
368  pub revision: i32,
369  /// Required. CLDR region code of the country/region of the address. This
370  /// is never inferred and it is up to the user to ensure the value is
371  /// correct. See <http://cldr.unicode.org/> and
372  /// <http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html>
373  /// for details. Example: "CH" for Switzerland.
374  #[prost(string, tag = "2")]
375  pub region_code: ::prost::alloc::string::String,
376  /// Optional. BCP-47 language code of the contents of this address (if
377  /// known). This is often the UI language of the input form or is expected
378  /// to match one of the languages used in the address' country/region, or their
379  /// transliterated equivalents.
380  /// This can affect formatting in certain countries, but is not critical
381  /// to the correctness of the data and will never affect any validation or
382  /// other non-formatting related operations.
383  ///
384  /// If this value is not known, it should be omitted (rather than specifying a
385  /// possibly incorrect default).
386  ///
387  /// Examples: "zh-Hant", "ja", "ja-Latn", "en".
388  #[prost(string, tag = "3")]
389  pub language_code: ::prost::alloc::string::String,
390  /// Optional. Postal code of the address. Not all countries use or require
391  /// postal codes to be present, but where they are used, they may trigger
392  /// additional validation with other parts of the address (e.g. state/zip
393  /// validation in the U.S.A.).
394  #[prost(string, tag = "4")]
395  pub postal_code: ::prost::alloc::string::String,
396  /// Optional. Additional, country-specific, sorting code. This is not used
397  /// in most regions. Where it is used, the value is either a string like
398  /// "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number
399  /// alone, representing the "sector code" (Jamaica), "delivery area indicator"
400  /// (Malawi) or "post office indicator" (e.g. Côte d'Ivoire).
401  #[prost(string, tag = "5")]
402  pub sorting_code: ::prost::alloc::string::String,
403  /// Optional. Highest administrative subdivision which is used for postal
404  /// addresses of a country or region.
405  /// For example, this can be a state, a province, an oblast, or a prefecture.
406  /// Specifically, for Spain this is the province and not the autonomous
407  /// community (e.g. "Barcelona" and not "Catalonia").
408  /// Many countries don't use an administrative area in postal addresses. E.g.
409  /// in Switzerland this should be left unpopulated.
410  #[prost(string, tag = "6")]
411  pub administrative_area: ::prost::alloc::string::String,
412  /// Optional. Generally refers to the city/town portion of the address.
413  /// Examples: US city, IT comune, UK post town.
414  /// In regions of the world where localities are not well defined or do not fit
415  /// into this structure well, leave locality empty and use address_lines.
416  #[prost(string, tag = "7")]
417  pub locality: ::prost::alloc::string::String,
418  /// Optional. Sublocality of the address.
419  /// For example, this can be neighborhoods, boroughs, districts.
420  #[prost(string, tag = "8")]
421  pub sublocality: ::prost::alloc::string::String,
422  /// Unstructured address lines describing the lower levels of an address.
423  ///
424  /// Because values in address_lines do not have type information and may
425  /// sometimes contain multiple values in a single field (e.g.
426  /// "Austin, TX"), it is important that the line order is clear. The order of
427  /// address lines should be "envelope order" for the country/region of the
428  /// address. In places where this can vary (e.g. Japan), address_language is
429  /// used to make it explicit (e.g. "ja" for large-to-small ordering and
430  /// "ja-Latn" or "en" for small-to-large). This way, the most specific line of
431  /// an address can be selected based on the language.
432  ///
433  /// The minimum permitted structural representation of an address consists
434  /// of a region_code with all remaining information placed in the
435  /// address_lines. It would be possible to format such an address very
436  /// approximately without geocoding, but no semantic reasoning could be
437  /// made about any of the address components until it was at least
438  /// partially resolved.
439  ///
440  /// Creating an address only containing a region_code and address_lines, and
441  /// then geocoding is the recommended way to handle completely unstructured
442  /// addresses (as opposed to guessing which parts of the address should be
443  /// localities or administrative areas).
444  #[prost(string, repeated, tag = "9")]
445  pub address_lines: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
446  /// Optional. The recipient at the address.
447  /// This field may, under certain circumstances, contain multiline information.
448  /// For example, it might contain "care of" information.
449  #[prost(string, repeated, tag = "10")]
450  pub recipients: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
451  /// Optional. The name of the organization at the address.
452  #[prost(string, tag = "11")]
453  pub organization: ::prost::alloc::string::String,
454}
455/// Represents a whole or partial calendar date, such as a birthday.
456///
457/// The time of
458/// day and time zone are either specified elsewhere or are insignificant. The
459/// date is relative to the Gregorian Calendar. This can represent one of the
460/// following:
461///
462/// * A full date, with non-zero year, month, and day values
463/// * A month and day value, with a zero year, such as an anniversary
464/// * A year on its own, with zero month and day values
465/// * A year and month value, with a zero day, such as a credit card expiration
466/// date
467///
468/// Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and
469/// `google.protobuf.Timestamp`.
470#[cfg(feature = "date")]
471#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
472#[cfg_attr(
473  any(feature = "diesel-postgres", feature = "diesel-sqlite"),
474  derive(diesel::QueryId, diesel::AsExpression, diesel::FromSqlRow),
475  diesel(sql_type = diesel::sql_types::Date)
476)]
477pub struct Date {
478  /// Year of the date. Must be from 1 to 9999, or 0 to specify a date without
479  /// a year.
480  #[prost(int32, tag = "1")]
481  pub year: i32,
482  /// Month of a year. Must be from 1 to 12, or 0 to specify a year without a
483  /// month and day.
484  #[prost(int32, tag = "2")]
485  pub month: i32,
486  /// Day of a month. Must be from 1 to 31 and valid for the year and month, or 0
487  /// to specify a year by itself or a year and month where the day isn't
488  /// significant.
489  #[prost(int32, tag = "3")]
490  pub day: i32,
491}
492/// Represents a time interval, encoded as a Timestamp start (inclusive) and a
493/// Timestamp end (exclusive).
494///
495/// The start must be less than or equal to the end.
496/// When the start equals the end, the interval is empty (matches no time).
497/// When both start and end are unspecified, the interval matches any time.
498#[cfg(feature = "interval")]
499#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
500#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
501#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
502pub struct Interval {
503  /// Optional. Inclusive start of the interval.
504  ///
505  /// If specified, a Timestamp matching this interval will have to be the same
506  /// or after the start.
507  #[prost(message, optional, tag = "1")]
508  pub start_time: ::core::option::Option<crate::protobuf::Timestamp>,
509  /// Optional. Exclusive end of the interval.
510  ///
511  /// If specified, a Timestamp matching this interval will have to be before the
512  /// end.
513  #[prost(message, optional, tag = "2")]
514  pub end_time: ::core::option::Option<crate::protobuf::Timestamp>,
515}
516/// Represents a textual expression in the Common Expression Language (CEL)
517/// syntax.
518///
519/// CEL is a C-like expression language. The syntax and semantics of CEL
520/// are documented at <https://github.com/google/cel-spec.>
521///
522/// Example (Comparison):
523///
524///   title: "Summary size limit"
525///   description: "Determines if a summary is less than 100 chars"
526///   expression: "document.summary.size() < 100"
527///
528/// Example (Equality):
529///
530///   title: "Requestor is owner"
531///   description: "Determines if requestor is the document owner"
532///   expression: "document.owner == request.auth.claims.email"
533///
534/// Example (Logic):
535///
536///   title: "Public documents"
537///   description: "Determine whether the document should be publicly visible"
538///   expression: "document.type != 'private' && document.type != 'internal'"
539///
540/// Example (Data Manipulation):
541///
542///   title: "Notification string"
543///   description: "Create a notification string with a timestamp."
544///   expression: "'New message received at ' + string(document.create_time)"
545///
546/// The exact variables and functions that may be referenced within an expression
547/// are determined by the service that evaluates it. See the service
548/// documentation for additional information.
549#[cfg(feature = "expr")]
550#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
551#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
552pub struct Expr {
553  /// Textual representation of an expression in Common Expression Language
554  /// syntax.
555  #[prost(string, tag = "1")]
556  pub expression: ::prost::alloc::string::String,
557  /// Optional. Title for the expression, i.e. a short string describing
558  /// its purpose. This can be used e.g. in UIs which allow to enter the
559  /// expression.
560  #[prost(string, tag = "2")]
561  pub title: ::prost::alloc::string::String,
562  /// Optional. Description of the expression. This is a longer text which
563  /// describes the expression, e.g. when hovered over it in a UI.
564  #[prost(string, tag = "3")]
565  pub description: ::prost::alloc::string::String,
566  /// Optional. String indicating the location of the expression for error
567  /// reporting, e.g. a file name and a position in the file.
568  #[prost(string, tag = "4")]
569  pub location: ::prost::alloc::string::String,
570}
571/// Represents a color in the RGBA color space.
572///
573/// This representation is designed
574/// for simplicity of conversion to/from color representations in various
575/// languages over compactness. For example, the fields of this representation
576/// can be trivially provided to the constructor of `java.awt.Color` in Java; it
577/// can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
578/// method in iOS; and, with just a little work, it can be easily formatted into
579/// a CSS `rgba()` string in JavaScript.
580///
581/// This reference page doesn't carry information about the absolute color
582/// space
583/// that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
584/// DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color
585/// space.
586///
587/// When color equality needs to be decided, implementations, unless
588/// documented otherwise, treat two colors as equal if all their red,
589/// green, blue, and alpha values each differ by at most 1e-5.
590///
591/// Example (Java):
592/// ```java
593///       import com.google.type.Color;
594///
595///       // ...
596///       public static java.awt.Color fromProto(Color protocolor) {
597///         float alpha = protocolor.hasAlpha()
598///             ? protocolor.getAlpha().getValue()
599///             : 1.0;
600///
601///         return new java.awt.Color(
602///             protocolor.getRed(),
603///             protocolor.getGreen(),
604///             protocolor.getBlue(),
605///             alpha);
606///       }
607///
608///       public static Color toProto(java.awt.Color color) {
609///         float red = (float) color.getRed();
610///         float green = (float) color.getGreen();
611///         float blue = (float) color.getBlue();
612///         float denominator = 255.0;
613///         Color.Builder resultBuilder =
614///             Color
615///                 .newBuilder()
616///                 .setRed(red / denominator)
617///                 .setGreen(green / denominator)
618///                 .setBlue(blue / denominator);
619///         int alpha = color.getAlpha();
620///         if (alpha != 255) {
621///           result.setAlpha(
622///               FloatValue
623///                   .newBuilder()
624///                   .setValue(((float) alpha) / denominator)
625///                   .build());
626///         }
627///         return resultBuilder.build();
628///       }
629///       // ...
630/// ```
631///
632/// Example (iOS / Obj-C):
633///
634/// ```text
635///       // ...
636///       static UIColor* fromProto(Color* protocolor) {
637///          float red = \[protocolor red\];
638///          float green = \[protocolor green\];
639///          float blue = \[protocolor blue\];
640///          FloatValue* alpha_wrapper = \[protocolor alpha\];
641///          float alpha = 1.0;
642///          if (alpha_wrapper != nil) {
643///            alpha = \[alpha_wrapper value\];
644///          }
645///          return \[UIColor colorWithRed:red green:green blue:blue alpha:alpha\];
646///       }
647///
648///       static Color* toProto(UIColor* color) {
649///           CGFloat red, green, blue, alpha;
650///           if (!\[color getRed:&red green:&green blue:&blue alpha:&alpha\]) {
651///             return nil;
652///           }
653///           Color* result = \[[Color alloc\] init];
654///           \[result setRed:red\];
655///           \[result setGreen:green\];
656///           \[result setBlue:blue\];
657///           if (alpha <= 0.9999) {
658///             \[result setAlpha:floatWrapperWithValue(alpha)\];
659///           }
660///           \[result autorelease\];
661///           return result;
662///      }
663///      // ...
664/// ```
665///   Example (JavaScript):
666///
667/// ```javascript
668///      // ...
669///
670///      var protoToCssColor = function(rgb_color) {
671///         var redFrac = rgb_color.red || 0.0;
672///         var greenFrac = rgb_color.green || 0.0;
673///         var blueFrac = rgb_color.blue || 0.0;
674///         var red = Math.floor(redFrac * 255);
675///         var green = Math.floor(greenFrac * 255);
676///         var blue = Math.floor(blueFrac * 255);
677///
678///         if (!('alpha' in rgb_color)) {
679///            return rgbToCssColor(red, green, blue);
680///         }
681///
682///         var alphaFrac = rgb_color.alpha.value || 0.0;
683///         var rgbParams = \[red, green, blue\].join(',');
684///         return \['rgba(', rgbParams, ',', alphaFrac, ')'\].join('');
685///      };
686///
687///      var rgbToCssColor = function(red, green, blue) {
688///        var rgbNumber = new Number((red << 16) | (green << 8) | blue);
689///        var hexString = rgbNumber.toString(16);
690///        var missingZeros = 6 - hexString.length;
691///        var resultBuilder = \['#'\];
692///        for (var i = 0; i < missingZeros; i++) {
693///           resultBuilder.push('0');
694///        }
695///        resultBuilder.push(hexString);
696///        return resultBuilder.join('');
697///      };
698///
699///      // ...
700/// ```
701#[cfg(feature = "color")]
702#[derive(Clone, Copy, PartialEq, ::prost::Message)]
703#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
704pub struct Color {
705  /// The amount of red in the color as a value in the interval \[0, 1\].
706  #[prost(float, tag = "1")]
707  pub red: f32,
708  /// The amount of green in the color as a value in the interval \[0, 1\].
709  #[prost(float, tag = "2")]
710  pub green: f32,
711  /// The amount of blue in the color as a value in the interval \[0, 1\].
712  #[prost(float, tag = "3")]
713  pub blue: f32,
714  /// The fraction of this color that should be applied to the pixel. That is,
715  /// the final pixel color is defined by the equation:
716  ///
717  ///   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
718  ///
719  /// This means that a value of 1.0 corresponds to a solid color, whereas
720  /// a value of 0.0 corresponds to a completely transparent color. This
721  /// uses a wrapper message rather than a simple float scalar so that it is
722  /// possible to distinguish between a default value and the value being unset.
723  /// If omitted, this color object is rendered as a solid color
724  /// (as if the alpha value had been explicitly given a value of 1.0).
725  #[prost(message, optional, tag = "4")]
726  pub alpha: ::core::option::Option<crate::protobuf::FloatValue>,
727}
728
729/// Represents a fraction in terms of a numerator divided by a denominator.
730#[cfg(feature = "fraction")]
731#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
732#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
733pub struct Fraction {
734  /// The numerator in the fraction, e.g. 2 in 2/3.
735  #[prost(int64, tag = "1")]
736  pub numerator: i64,
737  /// The value by which the numerator is divided, e.g. 3 in 2/3. Must be
738  /// positive.
739  #[prost(int64, tag = "2")]
740  pub denominator: i64,
741}
742/// A representation of a decimal value, such as 2.5. Clients may convert values
743/// into language-native decimal formats, such as Java's [BigDecimal][] or
744/// Python's [decimal.Decimal][].
745///
746/// \[BigDecimal\]:
747/// <https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/math/BigDecimal.html>
748/// \[decimal.Decimal\]: <https://docs.python.org/3/library/decimal.html>
749#[cfg(feature = "decimal")]
750#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
751#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
752pub struct Decimal {
753  /// The decimal value, as a string.
754  ///
755  /// The string representation consists of an optional sign, `+` (`U+002B`)
756  /// or `-` (`U+002D`), followed by a sequence of zero or more decimal digits
757  /// ("the integer"), optionally followed by a fraction, optionally followed
758  /// by an exponent.
759  ///
760  /// The fraction consists of a decimal point followed by zero or more decimal
761  /// digits. The string must contain at least one digit in either the integer
762  /// or the fraction. The number formed by the sign, the integer and the
763  /// fraction is referred to as the significand.
764  ///
765  /// The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`)
766  /// followed by one or more decimal digits.
767  ///
768  /// Services **should** normalize decimal values before storing them by:
769  ///
770  ///   - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
771  ///   - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
772  ///   - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
773  ///   - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
774  ///
775  /// Services **may** perform additional normalization based on its own needs
776  /// and the internal decimal implementation selected, such as shifting the
777  /// decimal point and exponent value together (example: `2.5e-1` <-> `0.25`).
778  /// Additionally, services **may** preserve trailing zeroes in the fraction
779  /// to indicate increased precision, but are not required to do so.
780  ///
781  /// Note that only the `.` character is supported to divide the integer
782  /// and the fraction; `,` **should not** be supported regardless of locale.
783  /// Additionally, thousand separators **should not** be supported. If a
784  /// service does support them, values **must** be normalized.
785  ///
786  /// The ENBF grammar is:
787  ///
788  ///   DecimalString =
789  ///        \[Sign\] Significand \[Exponent\];
790  ///
791  ///   Sign = '+' | '-';
792  ///
793  ///   Significand =
794  ///     Digits \['.'\] [Digits] | \[Digits\] '.' Digits;
795  ///
796  ///   Exponent = ('e' | 'E') \[Sign\] Digits;
797  ///
798  ///   Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
799  ///
800  /// Services **should** clearly document the range of supported values, the
801  /// maximum supported precision (total number of digits), and, if applicable,
802  /// the scale (number of digits after the decimal point), as well as how it
803  /// behaves when receiving out-of-bounds values.
804  ///
805  /// Services **may** choose to accept values passed as input even when the
806  /// value has a higher precision or scale than the service supports, and
807  /// **should** round the value to fit the supported scale. Alternatively, the
808  /// service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC)
809  /// if precision would be lost.
810  ///
811  /// Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in
812  /// gRPC) if the service receives a value outside of the supported range.
813  #[prost(string, tag = "1")]
814  pub value: ::prost::alloc::string::String,
815}
816/// Represents a day of the week.
817#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
818#[repr(i32)]
819pub enum DayOfWeek {
820  /// The day of the week is unspecified.
821  Unspecified = 0,
822  /// Monday
823  Monday = 1,
824  /// Tuesday
825  Tuesday = 2,
826  /// Wednesday
827  Wednesday = 3,
828  /// Thursday
829  Thursday = 4,
830  /// Friday
831  Friday = 5,
832  /// Saturday
833  Saturday = 6,
834  /// Sunday
835  Sunday = 7,
836}
837impl DayOfWeek {
838  /// String value of the enum field names used in the ProtoBuf definition.
839  ///
840  /// The values are not transformed in any way and thus are considered stable
841  /// (if the ProtoBuf definition does not change) and safe for programmatic use.
842  #[must_use]
843  pub const fn as_str_name(&self) -> &'static str {
844    match self {
845      Self::Unspecified => "DAY_OF_WEEK_UNSPECIFIED",
846      Self::Monday => "MONDAY",
847      Self::Tuesday => "TUESDAY",
848      Self::Wednesday => "WEDNESDAY",
849      Self::Thursday => "THURSDAY",
850      Self::Friday => "FRIDAY",
851      Self::Saturday => "SATURDAY",
852      Self::Sunday => "SUNDAY",
853    }
854  }
855  /// Creates an enum from field names used in the ProtoBuf definition.
856  #[must_use]
857  pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
858    match value {
859      "DAY_OF_WEEK_UNSPECIFIED" => Some(Self::Unspecified),
860      "MONDAY" => Some(Self::Monday),
861      "TUESDAY" => Some(Self::Tuesday),
862      "WEDNESDAY" => Some(Self::Wednesday),
863      "THURSDAY" => Some(Self::Thursday),
864      "FRIDAY" => Some(Self::Friday),
865      "SATURDAY" => Some(Self::Saturday),
866      "SUNDAY" => Some(Self::Sunday),
867      _ => None,
868    }
869  }
870}
871/// An object representing a phone number, suitable as an API wire format.
872///
873/// This representation:
874///
875///   - should not be used for locale-specific formatting of a phone number, such
876///     as "+1 (650) 253-0000 ext. 123"
877///
878///   - is not designed for efficient storage
879///   - may not be suitable for dialing - specialized libraries (see references)
880///     should be used to parse the number for that purpose
881///
882/// To do something meaningful with this number, such as format it for various
883/// use-cases, convert it to an `i18n.phonenumbers.PhoneNumber` object first.
884///
885/// For instance, in Java this would be:
886/// ```java
887///     com.google.type.PhoneNumber wireProto =
888///         com.google.type.PhoneNumber.newBuilder().build();
889///     com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber =
890///         PhoneNumberUtil.getInstance().parse(wireProto.getE164Number(), "ZZ");
891///     if (!wireProto.getExtension().isEmpty()) {
892///       phoneNumber.setExtension(wireProto.getExtension());
893///     }
894///
895///   Reference(s):
896///    - <https://github.com/google/libphonenumber>
897/// ```
898#[cfg(feature = "phone_number")]
899#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
900#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
901pub struct PhoneNumber {
902  /// The phone number's extension. The extension is not standardized in ITU
903  /// recommendations, except for being defined as a series of numbers with a
904  /// maximum length of 40 digits. Other than digits, some other dialing
905  /// characters such as ',' (indicating a wait) or '#' may be stored here.
906  ///
907  /// Note that no regions currently use extensions with short codes, so this
908  /// field is normally only set in conjunction with an E.164 number. It is held
909  /// separately from the E.164 number to allow for short code extensions in the
910  /// future.
911  #[prost(string, tag = "3")]
912  pub extension: ::prost::alloc::string::String,
913  /// Required.  Either a regular number, or a short code.  New fields may be
914  /// added to the oneof below in the future, so clients should ignore phone
915  /// numbers for which none of the fields they coded against are set.
916  #[prost(oneof = "phone_number::Kind", tags = "1, 2")]
917  pub kind: ::core::option::Option<phone_number::Kind>,
918}
919/// Nested message and enum types in `PhoneNumber`.
920#[cfg(feature = "phone_number")]
921pub mod phone_number {
922  #[allow(clippy::too_long_first_doc_paragraph)]
923  /// An object representing a short code, which is a phone number that is
924  /// typically much shorter than regular phone numbers and can be used to
925  /// address messages in MMS and SMS systems, as well as for abbreviated dialing
926  /// (e.g. "Text 611 to see how many minutes you have remaining on your plan.").
927  ///
928  /// Short codes are restricted to a region and are not internationally
929  /// dialable, which means the same short code can exist in different regions,
930  /// with different usage and pricing, even if those regions share the same
931  /// country calling code (e.g. US and CA).
932  #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
933  #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
934  #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
935  pub struct ShortCode {
936    /// Required. The BCP-47 region code of the location where calls to this
937    /// short code can be made, such as "US" and "BB".
938    ///
939    /// Reference(s):
940    ///   - <http://www.unicode.org/reports/tr35/#unicode_region_subtag>
941    #[prost(string, tag = "1")]
942    pub region_code: ::prost::alloc::string::String,
943    /// Required. The short code digits, without a leading plus ('+') or country
944    /// calling code, e.g. "611".
945    #[prost(string, tag = "2")]
946    pub number: ::prost::alloc::string::String,
947  }
948  /// Required.  Either a regular number, or a short code.
949  ///
950  /// New fields may be
951  /// added to the oneof below in the future, so clients should ignore phone
952  /// numbers for which none of the fields they coded against are set.
953  #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
954  #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
955  #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
956  pub enum Kind {
957    /// The phone number, represented as a leading plus sign ('+'), followed by a
958    /// phone number that uses a relaxed ITU E.164 format consisting of the
959    /// country calling code (1 to 3 digits) and the subscriber number, with no
960    /// additional spaces or formatting, e.g.:
961    ///   - correct: "+15552220123"
962    ///   - incorrect: "+1 (555) 222-01234 x123".
963    ///
964    /// The ITU E.164 format limits the latter to 12 digits, but in practice not
965    /// all countries respect that, so we relax that restriction here.
966    /// National-only numbers are not allowed.
967    ///
968    /// References:
969    ///   - <https://www.itu.int/rec/T-REC-E.164-201011-I>
970    ///   - <https://en.wikipedia.org/wiki/E.164.>
971    ///   - <https://en.wikipedia.org/wiki/List_of_country_calling_codes>
972    #[prost(string, tag = "1")]
973    E164Number(::prost::alloc::string::String),
974    /// A short code.
975    ///
976    /// Reference(s):
977    ///   - <https://en.wikipedia.org/wiki/Short_code>
978    #[prost(message, tag = "2")]
979    ShortCode(ShortCode),
980  }
981}
982/// Represents a month in the Gregorian calendar.
983#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
984#[repr(i32)]
985pub enum Month {
986  /// The unspecified month.
987  Unspecified = 0,
988  /// The month of January.
989  January = 1,
990  /// The month of February.
991  February = 2,
992  /// The month of March.
993  March = 3,
994  /// The month of April.
995  April = 4,
996  /// The month of May.
997  May = 5,
998  /// The month of June.
999  June = 6,
1000  /// The month of July.
1001  July = 7,
1002  /// The month of August.
1003  August = 8,
1004  /// The month of September.
1005  September = 9,
1006  /// The month of October.
1007  October = 10,
1008  /// The month of November.
1009  November = 11,
1010  /// The month of December.
1011  December = 12,
1012}
1013impl Month {
1014  /// String value of the enum field names used in the ProtoBuf definition.
1015  ///
1016  /// The values are not transformed in any way and thus are considered stable
1017  /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1018  #[must_use]
1019  pub const fn as_str_name(&self) -> &'static str {
1020    match self {
1021      Self::Unspecified => "MONTH_UNSPECIFIED",
1022      Self::January => "JANUARY",
1023      Self::February => "FEBRUARY",
1024      Self::March => "MARCH",
1025      Self::April => "APRIL",
1026      Self::May => "MAY",
1027      Self::June => "JUNE",
1028      Self::July => "JULY",
1029      Self::August => "AUGUST",
1030      Self::September => "SEPTEMBER",
1031      Self::October => "OCTOBER",
1032      Self::November => "NOVEMBER",
1033      Self::December => "DECEMBER",
1034    }
1035  }
1036  /// Creates an enum from field names used in the ProtoBuf definition.
1037  #[must_use]
1038  pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1039    match value {
1040      "MONTH_UNSPECIFIED" => Some(Self::Unspecified),
1041      "JANUARY" => Some(Self::January),
1042      "FEBRUARY" => Some(Self::February),
1043      "MARCH" => Some(Self::March),
1044      "APRIL" => Some(Self::April),
1045      "MAY" => Some(Self::May),
1046      "JUNE" => Some(Self::June),
1047      "JULY" => Some(Self::July),
1048      "AUGUST" => Some(Self::August),
1049      "SEPTEMBER" => Some(Self::September),
1050      "OCTOBER" => Some(Self::October),
1051      "NOVEMBER" => Some(Self::November),
1052      "DECEMBER" => Some(Self::December),
1053      _ => None,
1054    }
1055  }
1056}