Synchronize new proto/yaml changes.

PiperOrigin-RevId: 237945492
This commit is contained in:
Google APIs 2019-03-11 21:22:40 -07:00 committed by Copybara-Service
parent 4d96a08055
commit abd1c9a99c
11 changed files with 320 additions and 55 deletions

View File

@ -0,0 +1,58 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.type;
option go_package = "google.golang.org/genproto/googleapis/type/calendarperiod;calendarperiod";
option java_multiple_files = true;
option java_outer_classname = "CalendarPeriodProto";
option java_package = "com.google.type";
option objc_class_prefix = "GTP";
// A `CalendarPeriod` represents the abstract concept of a time period that has
// a canonical start. Grammatically, "the start of the current
// `CalendarPeriod`." All calendar times begin at midnight UTC.
enum CalendarPeriod {
// Undefined period, raises an error.
CALENDAR_PERIOD_UNSPECIFIED = 0;
// A day.
DAY = 1;
// A week. Weeks begin on Monday, following
// [ISO 8601](https://en.wikipedia.org/wiki/ISO_week_date).
WEEK = 2;
// A fortnight. The first calendar fortnight of the year begins at the start
// of week 1 according to
// [ISO 8601](https://en.wikipedia.org/wiki/ISO_week_date).
FORTNIGHT = 3;
// A month.
MONTH = 4;
// A quarter. Quarters start on dates 1-Jan, 1-Apr, 1-Jul, and 1-Oct of each
// year.
QUARTER = 5;
// A half-year. Half-years start on dates 1-Jan and 1-Jul.
HALF = 6;
// A year.
YEAR = 7;
}

View File

@ -1,4 +1,4 @@
// Copyright 2016 Google Inc.
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
@ -18,19 +19,26 @@ package google.type;
import "google/protobuf/wrappers.proto";
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/type/color;color";
option java_multiple_files = true;
option java_outer_classname = "ColorProto";
option java_package = "com.google.type";
option objc_class_prefix = "GTP";
// Represents a color in the RGBA color space. This representation is designed
// for simplicity of conversion to/from color representations in various
// languages over compactness; for example, the fields of this representation
// can be trivially provided to the constructor of "java.awt.Color" in Java; it
// can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
// method in iOS; and, with just a little work, it can be easily formatted into
// a CSS "rgba()" string in JavaScript, as well. Here are some examples:
// a CSS "rgba()" string in JavaScript, as well.
//
// Note: this proto does not carry information about the absolute color space
// that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
// DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
// space.
//
// Example (Java):
//
@ -92,7 +100,7 @@ option objc_class_prefix = "GTP";
// if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
// return nil;
// }
// Color* result = [Color alloc] init];
// Color* result = [[Color alloc] init];
// [result setRed:red];
// [result setGreen:green];
// [result setBlue:blue];

View File

@ -1,4 +1,4 @@
// Copyright 2016 Google Inc.
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
@ -23,23 +24,28 @@ option java_outer_classname = "DateProto";
option java_package = "com.google.type";
option objc_class_prefix = "GTP";
// Represents a whole calendar date, e.g. date of birth. The time of day and
// time zone are either specified elsewhere or are not significant. The date
// is relative to the Proleptic Gregorian Calendar. The day may be 0 to
// represent a year and month where the day is not significant, e.g. credit card
// expiration date. The year may be 0 to represent a month and day independent
// of year, e.g. anniversary date. Related types are
// [google.type.TimeOfDay][google.type.TimeOfDay] and
// `google.protobuf.Timestamp`.
// Represents a whole or partial calendar date, e.g. a birthday. The time of day
// and time zone are either specified elsewhere or are not significant. The date
// is relative to the Proleptic Gregorian Calendar. This can represent:
//
// * A full date, with non-zero year, month and day values
// * A month and day value, with a zero year, e.g. an anniversary
// * A year on its own, with zero month and day values
// * A year and month value, with a zero day, e.g. a credit card expiration date
//
// Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`.
message Date {
// Year of date. Must be from 1 to 9999, or 0 if specifying a date without
// a year.
int32 year = 1;
// Month of year. Must be from 1 to 12.
// Month of year. Must be from 1 to 12, or 0 if specifying a year without a
// month and day.
int32 month = 2;
// Day of month. Must be from 1 to 31 and valid for the year and month, or 0
// if specifying a year/month where the day is not significant.
// if specifying a year by itself or a year and month where the day is not
// significant.
int32 day = 3;
}

View File

@ -1,4 +1,4 @@
// Copyright 2016 Google Inc.
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
@ -22,6 +23,7 @@ option java_outer_classname = "DayOfWeekProto";
option java_package = "com.google.type";
option objc_class_prefix = "GTP";
// Represents a day of week.
enum DayOfWeek {
// The unspecified day-of-week.

52
google/type/expr.proto Normal file
View File

@ -0,0 +1,52 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.type;
option go_package = "google.golang.org/genproto/googleapis/type/expr;expr";
option java_multiple_files = true;
option java_outer_classname = "ExprProto";
option java_package = "com.google.type";
option objc_class_prefix = "GTP";
// Represents an expression text. Example:
//
// title: "User account presence"
// description: "Determines whether the request has a user account"
// expression: "size(request.user) > 0"
message Expr {
// Textual representation of an expression in
// Common Expression Language syntax.
//
// The application context of the containing message determines which
// well-known feature set of CEL is supported.
string expression = 1;
// An optional title for the expression, i.e. a short string describing
// its purpose. This can be used e.g. in UIs which allow to enter the
// expression.
string title = 2;
// An optional description of the expression. This is a longer text which
// describes the expression, e.g. when hovered over it in a UI.
string description = 3;
// An optional string indicating the location of the expression for error
// reporting, e.g. a file name and a position in the file.
string location = 4;
}

View File

@ -0,0 +1,35 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.type;
option go_package = "google.golang.org/genproto/googleapis/type/fraction;fraction";
option java_multiple_files = true;
option java_outer_classname = "FractionProto";
option java_package = "com.google.type";
option objc_class_prefix = "GTP";
// Represents a fraction in terms of a numerator divided by a denominator.
message Fraction {
// The portion of the denominator in the faction, e.g. 2 in 2/3.
int64 numerator = 1;
// The value by which the numerator is divided, e.g. 3 in 2/3. Must be
// positive.
int64 denominator = 2;
}

View File

@ -1,4 +1,4 @@
// Copyright 2016 Google Inc.
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -11,56 +11,25 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.type;
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/type/latlng;latlng";
option java_multiple_files = true;
option java_outer_classname = "LatLngProto";
option java_package = "com.google.type";
option objc_class_prefix = "GTP";
// An object representing a latitude/longitude pair. This is expressed as a pair
// of doubles representing degrees latitude and degrees longitude. Unless
// specified otherwise, this must conform to the
// <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
// standard</a>. Values must be within normalized ranges.
//
// Example of normalization code in Python:
//
// def NormalizeLongitude(longitude):
// """Wraps decimal degrees longitude to [-180.0, 180.0]."""
// q, r = divmod(longitude, 360.0)
// if r > 180.0 or (r == 180.0 and q <= -1.0):
// return r - 360.0
// return r
//
// def NormalizeLatLng(latitude, longitude):
// """Wraps decimal degrees latitude and longitude to
// [-90.0, 90.0] and [-180.0, 180.0], respectively."""
// r = latitude % 360.0
// if r <= 90.0:
// return r, NormalizeLongitude(longitude)
// elif r >= 270.0:
// return r - 360, NormalizeLongitude(longitude)
// else:
// return 180 - r, NormalizeLongitude(longitude + 180.0)
//
// assert 180.0 == NormalizeLongitude(180.0)
// assert -180.0 == NormalizeLongitude(-180.0)
// assert -179.0 == NormalizeLongitude(181.0)
// assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
// assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
// assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
// assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
// assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
// assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
// assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
// assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
// assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
// assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
message LatLng {
// The latitude in degrees. It must be in the range [-90.0, +90.0].
double latitude = 1;

View File

@ -1,4 +1,4 @@
// Copyright 2016 Google Inc.
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -11,17 +11,20 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.type;
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/type/money;money";
option java_multiple_files = true;
option java_outer_classname = "MoneyProto";
option java_package = "com.google.type";
option objc_class_prefix = "GTP";
// Represents an amount of money with its currency type.
message Money {
// The 3-letter currency code defined in ISO 4217.

View File

@ -0,0 +1,97 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.type;
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/type/quaternion;quaternion";
option java_multiple_files = true;
option java_outer_classname = "QuaternionProto";
option java_package = "com.google.type";
option objc_class_prefix = "GTP";
// A quaternion is defined as the quotient of two directed lines in a
// three-dimensional space or equivalently as the quotient of two Euclidean
// vectors (https://en.wikipedia.org/wiki/Quaternion).
//
// Quaternions are often used in calculations involving three-dimensional
// rotations (https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation),
// as they provide greater mathematical robustness by avoiding the gimbal lock
// problems that can be encountered when using Euler angles
// (https://en.wikipedia.org/wiki/Gimbal_lock).
//
// Quaternions are generally represented in this form:
//
// w + xi + yj + zk
//
// where x, y, z, and w are real numbers, and i, j, and k are three imaginary
// numbers.
//
// Our naming choice (x, y, z, w) comes from the desire to avoid confusion for
// those interested in the geometric properties of the quaternion in the 3D
// Cartesian space. Other texts often use alternative names or subscripts, such
// as (a, b, c, d), (1, i, j, k), or (0, 1, 2, 3), which are perhaps better
// suited for mathematical interpretations.
//
// To avoid any confusion, as well as to maintain compatibility with a large
// number of software libraries, the quaternions represented using the protocol
// buffer below *must* follow the Hamilton convention, which defines ij = k
// (i.e. a right-handed algebra), and therefore:
//
// i^2 = j^2 = k^2 = ijk = 1
// ij = ji = k
// jk = kj = i
// ki = ik = j
//
// Please DO NOT use this to represent quaternions that follow the JPL
// convention, or any of the other quaternion flavors out there.
//
// Definitions:
//
// - Quaternion norm (or magnitude): sqrt(x^2 + y^2 + z^2 + w^2).
// - Unit (or normalized) quaternion: a quaternion whose norm is 1.
// - Pure quaternion: a quaternion whose scalar component (w) is 0.
// - Rotation quaternion: a unit quaternion used to represent rotation.
// - Orientation quaternion: a unit quaternion used to represent orientation.
//
// A quaternion can be normalized by dividing it by its norm. The resulting
// quaternion maintains the same direction, but has a norm of 1, i.e. it moves
// on the unit sphere. This is generally necessary for rotation and orientation
// quaternions, to avoid rounding errors:
// https://en.wikipedia.org/wiki/Rotation_formalisms_in_three_dimensions
//
// Note that (x, y, z, w) and (-x, -y, -z, -w) represent the same rotation, but
// normalization would be even more useful, e.g. for comparison purposes, if it
// would produce a unique representation. It is thus recommended that w be kept
// positive, which can be achieved by changing all the signs when w is negative.
//
//
// Next available tag: 5
message Quaternion {
// The x component.
double x = 1;
// The y component.
double y = 2;
// The z component.
double z = 3;
// The scalar component.
double w = 4;
}

View File

@ -1,4 +1,4 @@
// Copyright 2016 Google Inc.
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -11,21 +11,23 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.type;
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/type/timeofday;timeofday";
option java_multiple_files = true;
option java_outer_classname = "TimeOfDayProto";
option java_package = "com.google.type";
option objc_class_prefix = "GTP";
// Represents a time of day. The date and time zone are either not significant
// or are specified elsewhere. An API may chose to allow leap seconds. Related
// types are [google.type.Date][google.type.Date] and
// `google.protobuf.Timestamp`.
// or are specified elsewhere. An API may choose to allow leap seconds. Related
// types are [google.type.Date][google.type.Date] and `google.protobuf.Timestamp`.
message TimeOfDay {
// Hours of day in 24 hour format. Should be from 0 to 23. An API may choose
// to allow the value "24:00:00" for scenarios like business closing time.

33
google/type/type.yaml Normal file
View File

@ -0,0 +1,33 @@
type: google.api.Service
config_version: 1
name: type.googleapis.com
title: Common Types
types:
- name: google.type.Color
- name: google.type.Date
- name: google.type.Expr
- name: google.type.Fraction
- name: google.type.LatLng
- name: google.type.Money
- name: google.type.PostalAddress
- name: google.type.Quaternion
- name: google.type.TimeOfDay
enums:
- name: google.type.CalendarPeriod
- name: google.type.DayOfWeek
documentation:
summary: Defines common types for Google APIs.
overview: |-
# Google Common Types
This package contains definitions of common types for Google APIs. All types
defined in this package are suitable for different APIs to exchange data,
and will never break binary compatibility. They should have design quality
comparable to major programming languages like Java and C#.
NOTE: Some common types are defined in the package `google.protobuf` as they
are directly supported by Protocol Buffers compiler and runtime. Those types
are called Well-Known Types.