diff --git a/Makefile b/Makefile index 50b3af2..3e563f6 100644 --- a/Makefile +++ b/Makefile @@ -80,6 +80,13 @@ regenerate: -I=. \ google/type/datetime.proto + protoc \ + --gogogoogleapis_out=\ + Mgoogle/type/latlng.proto=github.com/gogo/googleapis/google/type,\ + :. \ + -I=. \ + google/geo/type/viewport.proto + update: go get github.com/gogo/protobuf/gogoreplace @@ -214,3 +221,9 @@ update: 'option go_package = "google.golang.org/genproto/googleapis/type/timeofday;timeofday";' \ 'option go_package = "type";' \ ./google/type/timeofday.proto + + (cd ./google/geo/type && rm viewport.proto; wget ${URL}/google/geo/type/viewport.proto) + gogoreplace \ + 'option go_package = "google.golang.org/genproto/googleapis/geo/type/viewport;viewport";' \ + 'option go_package = "type";' \ + ./google/geo/type/viewport.proto diff --git a/google/api/expr/v1alpha1/syntax.proto b/google/api/expr/v1alpha1/syntax.proto index 24065aa..8726679 100644 --- a/google/api/expr/v1alpha1/syntax.proto +++ b/google/api/expr/v1alpha1/syntax.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 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,7 +11,6 @@ // 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"; diff --git a/google/api/expr/v1alpha1/value.proto b/google/api/expr/v1alpha1/value.proto index 18b40d7..6cd4275 100644 --- a/google/api/expr/v1alpha1/value.proto +++ b/google/api/expr/v1alpha1/value.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 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,7 +11,6 @@ // 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"; diff --git a/google/geo/type/viewport.pb.go b/google/geo/type/viewport.pb.go new file mode 100644 index 0000000..48ec1dd --- /dev/null +++ b/google/geo/type/viewport.pb.go @@ -0,0 +1,606 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: google/geo/type/viewport.proto + +package _type + +import ( + bytes "bytes" + fmt "fmt" + _type "github.com/gogo/googleapis/google/type" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// A latitude-longitude viewport, represented as two diagonally opposite `low` +// and `high` points. A viewport is considered a closed region, i.e. it includes +// its boundary. The latitude bounds must range between -90 to 90 degrees +// inclusive, and the longitude bounds must range between -180 to 180 degrees +// inclusive. Various cases include: +// +// - If `low` = `high`, the viewport consists of that single point. +// +// - If `low.longitude` > `high.longitude`, the longitude range is inverted +// (the viewport crosses the 180 degree longitude line). +// +// - If `low.longitude` = -180 degrees and `high.longitude` = 180 degrees, +// the viewport includes all longitudes. +// +// - If `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, +// the longitude range is empty. +// +// - If `low.latitude` > `high.latitude`, the latitude range is empty. +// +// Both `low` and `high` must be populated, and the represented box cannot be +// empty (as specified by the definitions above). An empty viewport will result +// in an error. +// +// For example, this viewport fully encloses New York City: +// +// { +// "low": { +// "latitude": 40.477398, +// "longitude": -74.259087 +// }, +// "high": { +// "latitude": 40.91618, +// "longitude": -73.70018 +// } +// } +type Viewport struct { + // Required. The low point of the viewport. + Low *_type.LatLng `protobuf:"bytes,1,opt,name=low,proto3" json:"low,omitempty"` + // Required. The high point of the viewport. + High *_type.LatLng `protobuf:"bytes,2,opt,name=high,proto3" json:"high,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Viewport) Reset() { *m = Viewport{} } +func (*Viewport) ProtoMessage() {} +func (*Viewport) Descriptor() ([]byte, []int) { + return fileDescriptor_52240f0f30767909, []int{0} +} +func (m *Viewport) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Viewport) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Viewport.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Viewport) XXX_Merge(src proto.Message) { + xxx_messageInfo_Viewport.Merge(m, src) +} +func (m *Viewport) XXX_Size() int { + return m.Size() +} +func (m *Viewport) XXX_DiscardUnknown() { + xxx_messageInfo_Viewport.DiscardUnknown(m) +} + +var xxx_messageInfo_Viewport proto.InternalMessageInfo + +func (m *Viewport) GetLow() *_type.LatLng { + if m != nil { + return m.Low + } + return nil +} + +func (m *Viewport) GetHigh() *_type.LatLng { + if m != nil { + return m.High + } + return nil +} + +func (*Viewport) XXX_MessageName() string { + return "google.geo.type.Viewport" +} +func init() { + proto.RegisterType((*Viewport)(nil), "google.geo.type.Viewport") +} + +func init() { proto.RegisterFile("google/geo/type/viewport.proto", fileDescriptor_52240f0f30767909) } + +var fileDescriptor_52240f0f30767909 = []byte{ + // 212 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4f, 0x4f, 0xcd, 0xd7, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0x2f, 0xcb, 0x4c, 0x2d, + 0x2f, 0xc8, 0x2f, 0x2a, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x87, 0xc8, 0xeb, 0xa5, + 0xa7, 0xe6, 0xeb, 0x81, 0xe4, 0xa5, 0x24, 0xa0, 0x1a, 0xc0, 0x8a, 0x73, 0x12, 0x4b, 0x72, 0xf2, + 0xd2, 0x21, 0x4a, 0x95, 0xa2, 0xb8, 0x38, 0xc2, 0xa0, 0x9a, 0x85, 0x54, 0xb9, 0x98, 0x73, 0xf2, + 0xcb, 0x25, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0x84, 0xf5, 0xa0, 0x86, 0x80, 0xf4, 0xe8, 0xf9, + 0x24, 0x96, 0xf8, 0xe4, 0xa5, 0x07, 0x81, 0xe4, 0x85, 0xd4, 0xb9, 0x58, 0x32, 0x32, 0xd3, 0x33, + 0x24, 0x98, 0x70, 0xab, 0x03, 0x2b, 0x70, 0x8a, 0xbf, 0xf1, 0x50, 0x8e, 0xe1, 0xc3, 0x43, 0x39, + 0xc6, 0x1f, 0x0f, 0xe5, 0x18, 0x1b, 0x1e, 0xc9, 0x31, 0xae, 0x78, 0x24, 0xc7, 0x78, 0xe2, 0x91, + 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0xbe, 0x78, 0x24, 0xc7, 0xf0, 0x01, + 0x24, 0xf6, 0x58, 0x8e, 0x91, 0x4b, 0x38, 0x39, 0x3f, 0x57, 0x0f, 0xcd, 0xe1, 0x4e, 0xbc, 0x30, + 0xc7, 0x05, 0x80, 0x5c, 0x1b, 0xc0, 0x18, 0xc5, 0x02, 0x12, 0x5e, 0xc4, 0xc4, 0xe2, 0xee, 0x1e, + 0x12, 0x90, 0xc4, 0x06, 0xf6, 0x83, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x40, 0xdd, 0xeb, 0x99, + 0x10, 0x01, 0x00, 0x00, +} + +func (this *Viewport) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Viewport) + if !ok { + that2, ok := that.(Viewport) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Low.Equal(that1.Low) { + return false + } + if !this.High.Equal(that1.High) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Viewport) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&_type.Viewport{") + if this.Low != nil { + s = append(s, "Low: "+fmt.Sprintf("%#v", this.Low)+",\n") + } + if this.High != nil { + s = append(s, "High: "+fmt.Sprintf("%#v", this.High)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringViewport(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *Viewport) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Viewport) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Viewport) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.High != nil { + { + size, err := m.High.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintViewport(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Low != nil { + { + size, err := m.Low.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintViewport(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintViewport(dAtA []byte, offset int, v uint64) int { + offset -= sovViewport(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func NewPopulatedViewport(r randyViewport, easy bool) *Viewport { + this := &Viewport{} + if r.Intn(5) != 0 { + this.Low = _type.NewPopulatedLatLng(r, easy) + } + if r.Intn(5) != 0 { + this.High = _type.NewPopulatedLatLng(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedViewport(r, 3) + } + return this +} + +type randyViewport interface { + Float32() float32 + Float64() float64 + Int63() int64 + Int31() int32 + Uint32() uint32 + Intn(n int) int +} + +func randUTF8RuneViewport(r randyViewport) rune { + ru := r.Intn(62) + if ru < 10 { + return rune(ru + 48) + } else if ru < 36 { + return rune(ru + 55) + } + return rune(ru + 61) +} +func randStringViewport(r randyViewport) string { + v1 := r.Intn(100) + tmps := make([]rune, v1) + for i := 0; i < v1; i++ { + tmps[i] = randUTF8RuneViewport(r) + } + return string(tmps) +} +func randUnrecognizedViewport(r randyViewport, maxFieldNumber int) (dAtA []byte) { + l := r.Intn(5) + for i := 0; i < l; i++ { + wire := r.Intn(4) + if wire == 3 { + wire = 5 + } + fieldNumber := maxFieldNumber + r.Intn(100) + dAtA = randFieldViewport(dAtA, r, fieldNumber, wire) + } + return dAtA +} +func randFieldViewport(dAtA []byte, r randyViewport, fieldNumber int, wire int) []byte { + key := uint32(fieldNumber)<<3 | uint32(wire) + switch wire { + case 0: + dAtA = encodeVarintPopulateViewport(dAtA, uint64(key)) + v2 := r.Int63() + if r.Intn(2) == 0 { + v2 *= -1 + } + dAtA = encodeVarintPopulateViewport(dAtA, uint64(v2)) + case 1: + dAtA = encodeVarintPopulateViewport(dAtA, uint64(key)) + dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + case 2: + dAtA = encodeVarintPopulateViewport(dAtA, uint64(key)) + ll := r.Intn(100) + dAtA = encodeVarintPopulateViewport(dAtA, uint64(ll)) + for j := 0; j < ll; j++ { + dAtA = append(dAtA, byte(r.Intn(256))) + } + default: + dAtA = encodeVarintPopulateViewport(dAtA, uint64(key)) + dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + } + return dAtA +} +func encodeVarintPopulateViewport(dAtA []byte, v uint64) []byte { + for v >= 1<<7 { + dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) + v >>= 7 + } + dAtA = append(dAtA, uint8(v)) + return dAtA +} +func (m *Viewport) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Low != nil { + l = m.Low.Size() + n += 1 + l + sovViewport(uint64(l)) + } + if m.High != nil { + l = m.High.Size() + n += 1 + l + sovViewport(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovViewport(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozViewport(x uint64) (n int) { + return sovViewport(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Viewport) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Viewport{`, + `Low:` + strings.Replace(fmt.Sprintf("%v", this.Low), "LatLng", "_type.LatLng", 1) + `,`, + `High:` + strings.Replace(fmt.Sprintf("%v", this.High), "LatLng", "_type.LatLng", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func valueToStringViewport(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Viewport) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowViewport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Viewport: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Viewport: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Low", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowViewport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthViewport + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthViewport + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Low == nil { + m.Low = &_type.LatLng{} + } + if err := m.Low.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field High", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowViewport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthViewport + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthViewport + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.High == nil { + m.High = &_type.LatLng{} + } + if err := m.High.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipViewport(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthViewport + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthViewport + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipViewport(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowViewport + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowViewport + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowViewport + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthViewport + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupViewport + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthViewport + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthViewport = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowViewport = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupViewport = fmt.Errorf("proto: unexpected end of group") +) diff --git a/google/geo/type/viewport.proto b/google/geo/type/viewport.proto new file mode 100644 index 0000000..ec28077 --- /dev/null +++ b/google/geo/type/viewport.proto @@ -0,0 +1,69 @@ +// 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.geo.type; + +import "google/type/latlng.proto"; + +option go_package = "type"; +option java_multiple_files = true; +option java_outer_classname = "ViewportProto"; +option java_package = "com.google.geo.type"; +option objc_class_prefix = "GGTP"; + +// A latitude-longitude viewport, represented as two diagonally opposite `low` +// and `high` points. A viewport is considered a closed region, i.e. it includes +// its boundary. The latitude bounds must range between -90 to 90 degrees +// inclusive, and the longitude bounds must range between -180 to 180 degrees +// inclusive. Various cases include: +// +// - If `low` = `high`, the viewport consists of that single point. +// +// - If `low.longitude` > `high.longitude`, the longitude range is inverted +// (the viewport crosses the 180 degree longitude line). +// +// - If `low.longitude` = -180 degrees and `high.longitude` = 180 degrees, +// the viewport includes all longitudes. +// +// - If `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, +// the longitude range is empty. +// +// - If `low.latitude` > `high.latitude`, the latitude range is empty. +// +// Both `low` and `high` must be populated, and the represented box cannot be +// empty (as specified by the definitions above). An empty viewport will result +// in an error. +// +// For example, this viewport fully encloses New York City: +// +// { +// "low": { +// "latitude": 40.477398, +// "longitude": -74.259087 +// }, +// "high": { +// "latitude": 40.91618, +// "longitude": -73.70018 +// } +// } +message Viewport { + // Required. The low point of the viewport. + google.type.LatLng low = 1; + + // Required. The high point of the viewport. + google.type.LatLng high = 2; +} diff --git a/google/rpc/code.proto b/google/rpc/code.proto index 01b74c9..29954b1 100644 --- a/google/rpc/code.proto +++ b/google/rpc/code.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 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,7 +11,6 @@ // 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"; diff --git a/google/rpc/error_details.pb.go b/google/rpc/error_details.pb.go index 2c08487..8b9d7b8 100644 --- a/google/rpc/error_details.pb.go +++ b/google/rpc/error_details.pb.go @@ -288,7 +288,7 @@ func (*QuotaFailure_Violation) XXX_MessageName() string { // // Example of an error when contacting the "pubsub.googleapis.com" API when it // is not enabled: -// { "type": "API_DISABLED" +// { "reason": "API_DISABLED" // "domain": "googleapis.com" // "metadata": { // "resource": "projects/123", @@ -299,20 +299,20 @@ func (*QuotaFailure_Violation) XXX_MessageName() string { // // Example of an error that is returned when attempting to create a Spanner // instance in a region that is out of stock: -// { "type": "STOCKOUT" +// { "reason": "STOCKOUT" // "domain": "spanner.googleapis.com", // "metadata": { -// "availableRegions": ""us-central1,us-east2" +// "availableRegions": "us-central1,us-east2" // } // } // type ErrorInfo struct { - // The type of the error. This is a constant value that identifies the - // proximate cause of the error. Error types are unique within a particular - // source of errors. This should be at most 63 characters and match + // The reason of the error. This is a constant value that identifies the + // proximate cause of the error. Error reasons are unique within a particular + // domain of errors. This should be at most 63 characters and match // /[A-Z0-9_]+/. - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // The logical grouping to which the "type" belongs. Often "domain" will + Reason string `protobuf:"bytes,1,opt,name=reason,proto3" json:"reason,omitempty"` + // The logical grouping to which the "reason" belongs. Often "domain" will // contain the registered service name of the tool or product that is the // source of the error. Example: "pubsub.googleapis.com". If the error is // common across many APIs, the first segment of the example above will be @@ -364,9 +364,9 @@ func (m *ErrorInfo) XXX_DiscardUnknown() { var xxx_messageInfo_ErrorInfo proto.InternalMessageInfo -func (m *ErrorInfo) GetType() string { +func (m *ErrorInfo) GetReason() string { if m != nil { - return m.Type + return m.Reason } return "" } @@ -990,51 +990,52 @@ func init() { func init() { proto.RegisterFile("google/rpc/error_details.proto", fileDescriptor_851816e4d6b6361a) } var fileDescriptor_851816e4d6b6361a = []byte{ - // 701 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xbf, 0x6f, 0xd3, 0x40, - 0x14, 0xee, 0x25, 0x69, 0xc1, 0x2f, 0x69, 0x29, 0xe6, 0x87, 0x42, 0x24, 0xac, 0xe0, 0x0a, 0xa9, - 0x08, 0xc9, 0x95, 0xca, 0x82, 0xca, 0x80, 0x14, 0xd2, 0x5f, 0x52, 0x0b, 0xc1, 0x42, 0x0c, 0x30, - 0x44, 0x17, 0xfb, 0x25, 0x3a, 0xe2, 0xf8, 0xc2, 0xd9, 0x2e, 0x0a, 0x13, 0x7f, 0x02, 0x3b, 0x1b, - 0x53, 0xff, 0x01, 0x46, 0xf6, 0x8e, 0x1d, 0x19, 0x49, 0xba, 0x30, 0x76, 0x64, 0x44, 0x77, 0x3e, - 0xa7, 0x6e, 0x53, 0x10, 0xdb, 0x7d, 0xef, 0xbe, 0xfb, 0xee, 0x7d, 0x9f, 0xde, 0x1d, 0x58, 0x3d, - 0xce, 0x7b, 0x01, 0xae, 0x89, 0xa1, 0xb7, 0x86, 0x42, 0x70, 0xd1, 0xf6, 0x31, 0xa6, 0x2c, 0x88, - 0x9c, 0xa1, 0xe0, 0x31, 0x37, 0x21, 0xdd, 0x77, 0xc4, 0xd0, 0xab, 0x65, 0x5c, 0xb5, 0xd3, 0x49, - 0xba, 0x6b, 0x7e, 0x22, 0x68, 0xcc, 0x78, 0x98, 0x72, 0xed, 0x6d, 0x30, 0x5c, 0x8c, 0xc5, 0x68, - 0x37, 0xec, 0x72, 0x73, 0x03, 0xca, 0x42, 0x82, 0xb6, 0x8f, 0x01, 0x1d, 0x55, 0x49, 0x9d, 0xac, - 0x96, 0xd7, 0xef, 0x38, 0x5a, 0x2e, 0x93, 0x70, 0x9a, 0x5a, 0xc2, 0x05, 0xc5, 0x6e, 0x4a, 0xb2, - 0xbd, 0x03, 0x46, 0x13, 0x3b, 0x49, 0x4f, 0x09, 0xad, 0xc0, 0x62, 0x14, 0x53, 0xaf, 0xdf, 0xc6, - 0x30, 0x16, 0x0c, 0xa3, 0x2a, 0xa9, 0x17, 0x57, 0x0d, 0xb7, 0xa2, 0x8a, 0x9b, 0x69, 0xcd, 0xbc, - 0x0d, 0x0b, 0x69, 0xdf, 0xd5, 0x42, 0x9d, 0xac, 0x1a, 0xae, 0x46, 0xf6, 0x17, 0x02, 0x95, 0x97, - 0x09, 0x8f, 0xe9, 0x16, 0x65, 0x41, 0x22, 0xd0, 0x6c, 0x00, 0x1c, 0x30, 0x1e, 0xa8, 0x3b, 0x53, - 0xa9, 0xf2, 0xba, 0xed, 0x9c, 0x99, 0x74, 0xf2, 0x6c, 0xe7, 0x75, 0x46, 0x75, 0x73, 0xa7, 0x6a, - 0xdb, 0x60, 0x4c, 0x37, 0xcc, 0x2a, 0x5c, 0x89, 0x92, 0xce, 0x3b, 0xf4, 0x62, 0xe5, 0xd1, 0x70, - 0x33, 0x68, 0xd6, 0xa1, 0xec, 0x63, 0xe4, 0x09, 0x36, 0x94, 0x44, 0xdd, 0x58, 0xbe, 0x64, 0x7f, - 0x23, 0x60, 0x6c, 0xca, 0xd0, 0x95, 0x51, 0x13, 0x4a, 0xf1, 0x68, 0x88, 0x5a, 0x46, 0xad, 0x95, - 0x2f, 0x3e, 0xa0, 0x2c, 0x9c, 0xfa, 0x52, 0xc8, 0x7c, 0x0a, 0x57, 0x07, 0x18, 0x53, 0x9f, 0xc6, - 0xb4, 0x5a, 0x54, 0x26, 0x56, 0xf2, 0x26, 0xa6, 0xa2,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 0xff, 0x95, 0x4d, 0x91, 0x21, 0xa9, 0x05, 0x00, 0x00, + // 710 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x3f, 0x6f, 0xd3, 0x4e, + 0x18, 0xee, 0x25, 0x69, 0x7f, 0x3f, 0xbf, 0x49, 0x4b, 0x31, 0x50, 0x85, 0x48, 0x58, 0xc1, 0x15, + 0x52, 0x11, 0x92, 0x2b, 0x95, 0x05, 0x95, 0x01, 0x29, 0xa4, 0xff, 0xa4, 0x16, 0x82, 0x85, 0x18, + 0x60, 0x88, 0x2e, 0xf6, 0x9b, 0xe8, 0x88, 0xe3, 0x0b, 0x67, 0xbb, 0x28, 0x4c, 0x7c, 0x04, 0x76, + 0x36, 0xa6, 0x7e, 0x05, 0x06, 0xf6, 0x8e, 0x1d, 0x19, 0x49, 0xba, 0x30, 0x76, 0x64, 0x44, 0x77, + 0x3e, 0xa7, 0x6e, 0x53, 0x10, 0xdb, 0x3d, 0xef, 0x3d, 0xf7, 0xdc, 0xfb, 0x3c, 0x7a, 0xef, 0xc0, + 0xea, 0x71, 0xde, 0x0b, 0x70, 0x5d, 0x0c, 0xbd, 0x75, 0x14, 0x82, 0x8b, 0xb6, 0x8f, 0x31, 0x65, + 0x41, 0xe4, 0x0c, 0x05, 0x8f, 0xb9, 0x09, 0xe9, 0xbe, 0x23, 0x86, 0x5e, 0x2d, 0xe3, 0xaa, 0x9d, + 0x4e, 0xd2, 0x5d, 0xf7, 0x13, 0x41, 0x63, 0xc6, 0xc3, 0x94, 0x6b, 0xef, 0x80, 0xe1, 0x62, 0x2c, + 0x46, 0x7b, 0x61, 0x97, 0x9b, 0x9b, 0x50, 0x16, 0x12, 0xb4, 0x7d, 0x0c, 0xe8, 0xa8, 0x4a, 0xea, + 0x64, 0xad, 0xbc, 0x71, 0xdb, 0xd1, 0x72, 0x99, 0x84, 0xd3, 0xd4, 0x12, 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0x85, 0x8e, 0x3c, 0x05, 0x97, 0x3d, 0x96, + 0x66, 0x3d, 0x72, 0x28, 0xed, 0x62, 0x30, 0x34, 0x1f, 0xc0, 0x7c, 0xc0, 0xc2, 0x7e, 0x16, 0xfe, + 0xad, 0x7c, 0xf8, 0x92, 0xe0, 0xec, 0xb3, 0xb0, 0xef, 0xa6, 0x9c, 0xda, 0x26, 0x94, 0x24, 0xbc, + 0x2c, 0x4f, 0x66, 0xe4, 0xe5, 0x64, 0x27, 0x22, 0xfb, 0x1c, 0xe4, 0xd2, 0x6e, 0xc2, 0xf2, 0x3e, + 0xf7, 0x68, 0xc0, 0x3e, 0xa0, 0x7f, 0x80, 0x51, 0x44, 0x7b, 0x28, 0x5f, 0x5a, 0x20, 0x6b, 0x99, + 0x7f, 0x8d, 0xe4, 0x9c, 0x0d, 0x52, 0x4a, 0x36, 0x67, 0x1a, 0x36, 0xfc, 0x93, 0xb1, 0x35, 0xf7, + 0x7d, 0x6c, 0xcd, 0x9d, 0x8d, 0x2d, 0xf2, 0x6b, 0x6c, 0x91, 0x8f, 0x13, 0x8b, 0x1c, 0x4d, 0x2c, + 0x72, 0x3c, 0xb1, 0xc8, 0xc9, 0xc4, 0x22, 0x3f, 0x26, 0x16, 0xf9, 0x39, 0xb1, 0xe6, 0xce, 0x64, + 0xfd, 0xd4, 0x22, 0xc7, 0xa7, 0x16, 0x81, 0x25, 0x8f, 0x0f, 0x72, 0xc6, 0x1a, 0xd7, 0xd5, 0x5b, + 0x6d, 0xa6, 0x1f, 0x6f, 0x4b, 0x7e, 0x8d, 0x2d, 0xf2, 0xba, 0x28, 0x86, 0xde, 0x97, 0x42, 0xd1, + 0x6d, 0x3d, 0xed, 0x2c, 0xa8, 0xef, 0xf2, 0xe1, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x94, 0xc6, + 0xb7, 0xdd, 0xad, 0x05, 0x00, 0x00, } func (this *RetryInfo) Compare(that interface{}) int { @@ -1228,8 +1229,8 @@ func (this *ErrorInfo) Compare(that interface{}) int { } else if this == nil { return -1 } - if this.Type != that1.Type { - if this.Type < that1.Type { + if this.Reason != that1.Reason { + if this.Reason < that1.Reason { return -1 } return 1 @@ -1795,7 +1796,7 @@ func (this *ErrorInfo) Equal(that interface{}) bool { } else if this == nil { return false } - if this.Type != that1.Type { + if this.Reason != that1.Reason { return false } if this.Domain != that1.Domain { @@ -2163,7 +2164,7 @@ func (this *ErrorInfo) GoString() string { } s := make([]string, 0, 7) s = append(s, "&rpc.ErrorInfo{") - s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n") + s = append(s, "Reason: "+fmt.Sprintf("%#v", this.Reason)+",\n") s = append(s, "Domain: "+fmt.Sprintf("%#v", this.Domain)+",\n") keysForMetadata := make([]string, 0, len(this.Metadata)) for k, _ := range this.Metadata { @@ -2538,10 +2539,10 @@ func (m *ErrorInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Type))) + if len(m.Reason) > 0 { + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Reason))) i-- dAtA[i] = 0xa } @@ -3001,7 +3002,7 @@ func NewPopulatedQuotaFailure_Violation(r randyErrorDetails, easy bool) *QuotaFa func NewPopulatedErrorInfo(r randyErrorDetails, easy bool) *ErrorInfo { this := &ErrorInfo{} - this.Type = string(randStringErrorDetails(r)) + this.Reason = string(randStringErrorDetails(r)) this.Domain = string(randStringErrorDetails(r)) if r.Intn(5) != 0 { v3 := r.Intn(10) @@ -3278,7 +3279,7 @@ func (m *ErrorInfo) Size() (n int) { } var l int _ = l - l = len(m.Type) + l = len(m.Reason) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } @@ -3558,7 +3559,7 @@ func (this *ErrorInfo) String() string { } mapStringForMetadata += "}" s := strings.Join([]string{`&ErrorInfo{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, `Domain:` + fmt.Sprintf("%v", this.Domain) + `,`, `Metadata:` + mapStringForMetadata + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, @@ -4142,7 +4143,7 @@ func (m *ErrorInfo) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4170,7 +4171,7 @@ func (m *ErrorInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = string(dAtA[iNdEx:postIndex]) + m.Reason = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { diff --git a/google/rpc/error_details.proto b/google/rpc/error_details.proto index c8a8228..d0f8c18 100644 --- a/google/rpc/error_details.proto +++ b/google/rpc/error_details.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 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,7 +11,6 @@ // 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"; @@ -90,7 +89,7 @@ message QuotaFailure { // // Example of an error when contacting the "pubsub.googleapis.com" API when it // is not enabled: -// { "type": "API_DISABLED" +// { "reason": "API_DISABLED" // "domain": "googleapis.com" // "metadata": { // "resource": "projects/123", @@ -101,21 +100,21 @@ message QuotaFailure { // // Example of an error that is returned when attempting to create a Spanner // instance in a region that is out of stock: -// { "type": "STOCKOUT" +// { "reason": "STOCKOUT" // "domain": "spanner.googleapis.com", // "metadata": { -// "availableRegions": ""us-central1,us-east2" +// "availableRegions": "us-central1,us-east2" // } // } // message ErrorInfo { - // The type of the error. This is a constant value that identifies the - // proximate cause of the error. Error types are unique within a particular - // source of errors. This should be at most 63 characters and match + // The reason of the error. This is a constant value that identifies the + // proximate cause of the error. Error reasons are unique within a particular + // domain of errors. This should be at most 63 characters and match // /[A-Z0-9_]+/. - string type = 1; + string reason = 1; - // The logical grouping to which the "type" belongs. Often "domain" will + // The logical grouping to which the "reason" belongs. Often "domain" will // contain the registered service name of the tool or product that is the // source of the error. Example: "pubsub.googleapis.com". If the error is // common across many APIs, the first segment of the example above will be diff --git a/google/rpc/status.proto b/google/rpc/status.proto index cef8204..4edafe1 100644 --- a/google/rpc/status.proto +++ b/google/rpc/status.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 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,7 +11,6 @@ // 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"; diff --git a/protoc-gen-gogogoogleapis/main.go b/protoc-gen-gogogoogleapis/main.go index 8dfad78..b30db34 100644 --- a/protoc-gen-gogogoogleapis/main.go +++ b/protoc-gen-gogogoogleapis/main.go @@ -61,6 +61,9 @@ func main() { if strings.HasSuffix(file.GetName(), "operations.proto") { continue } + if strings.HasSuffix(file.GetName(), "viewport.proto") { + continue + } vanity.TurnOnCompareAll(file) }