pax_global_header00006660000000000000000000000064136520554160014521gustar00rootroot0000000000000052 comment=3a822044bc0ae0a330a7449d52de760218351d49 googleapis-1.4.0/000077500000000000000000000000001365205541600136545ustar00rootroot00000000000000googleapis-1.4.0/.gitignore000066400000000000000000000000071365205541600156410ustar00rootroot00000000000000vendor googleapis-1.4.0/.travis.yml000066400000000000000000000004161365205541600157660ustar00rootroot00000000000000before_install: - ./install-protobuf.sh - PATH=/home/travis/bin:$PATH protoc --version - echo $TRAVIS_GO_VERSION script: - PATH=/home/travis/bin:$PATH GO111MODULE=on make regenerate - git diff --exit-code language: go go: - "1.11.x" - "1.12.x" - tip googleapis-1.4.0/LICENSE000066400000000000000000000261151365205541600146660ustar00rootroot00000000000000Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2015, Google Inc Copyright 2018, GoGo Authors 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. googleapis-1.4.0/Makefile000066400000000000000000000206671365205541600153270ustar00rootroot00000000000000URL="https://raw.githubusercontent.com/googleapis/googleapis/master/" regenerate: go install ./protoc-gen-gogogoogleapis protoc \ --gogogoogleapis_out=\ Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,\ Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,\ :. \ -I=. \ google/rpc/status.proto \ google/rpc/error_details.proto \ google/rpc/code.proto \ protoc \ --gogogoogleapis_out=\ Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor,\ :. \ -I=. \ google/api/http.proto \ google/api/annotations.proto \ google/api/client.proto protoc \ --gogogoogleapis_out=\ Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,\ Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,\ Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,\ Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,\ Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor,\ :. \ -I=. \ google/api/expr/v1alpha1/syntax.proto \ google/api/expr/v1alpha1/value.proto protoc \ --gogogoogleapis_out=plugins=grpc,\ Mgoogle/api/annotations.proto=github.com/gogo/googleapis/google/api,\ Mgoogle/api/http.proto=github.com/gogo/googleapis/google/api,\ Mgoogle/api/client.proto=github.com/gogo/googleapis/google/api,\ Mgoogle/rpc/status.proto=github.com/gogo/googleapis/google/rpc,\ Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,\ Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,\ Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,\ Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor,\ :. \ -I=. \ google/longrunning/operations.proto protoc \ --gogogoogleapis_out=\ Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor,\ :. \ -I=. \ google/type/calendar_period.proto \ google/type/date.proto \ google/type/dayofweek.proto \ google/type/expr.proto \ google/type/fraction.proto \ google/type/latlng.proto \ google/type/money.proto \ google/type/month.proto \ google/type/postal_address.proto \ google/type/quaternion.proto \ google/type/timeofday.proto protoc \ --gogogoogleapis_out=\ Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,\ :. \ -I=. \ google/type/color.proto protoc \ --gogogoogleapis_out=\ Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,\ Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor,\ :. \ -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 (cd ./google/rpc && rm status.proto; wget ${URL}/google/rpc/status.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/rpc/status;status";' \ 'option go_package = "rpc";' \ ./google/rpc/status.proto (cd ./google/rpc && rm error_details.proto; wget ${URL}/google/rpc/error_details.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/rpc/errdetails;errdetails";' \ 'option go_package = "rpc";' \ ./google/rpc/error_details.proto (cd ./google/rpc && rm code.proto; wget ${URL}/google/rpc/code.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/rpc/code;code";' \ 'option go_package = "rpc";' \ ./google/rpc/code.proto (cd ./google/api && rm http.proto; wget ${URL}/google/api/http.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";' \ 'option go_package = "api";' \ ./google/api/http.proto (cd ./google/api && rm annotations.proto; wget ${URL}/google/api/annotations.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";' \ 'option go_package = "api";' \ ./google/api/annotations.proto (cd ./google/api && rm client.proto; wget ${URL}/google/api/client.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";' \ 'option go_package = "api";' \ ./google/api/client.proto (cd ./google/api/expr/v1alpha1 && rm syntax.proto; wget ${URL}/google/api/expr/v1alpha1/syntax.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/api/expr/v1alpha1;expr";' \ 'option go_package = "expr";' \ ./google/api/expr/v1alpha1/syntax.proto (cd ./google/api/expr/v1alpha1 && rm value.proto; wget ${URL}/google/api/expr/v1alpha1/value.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/api/expr/v1alpha1;expr";' \ 'option go_package = "expr";' \ ./google/api/expr/v1alpha1/value.proto (cd ./google/longrunning && rm operations.proto; wget ${URL}/google/longrunning/operations.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/longrunning;longrunning";' \ 'option go_package = "longrunning";' \ ./google/longrunning/operations.proto (cd ./google/type && rm calendar_period.proto; wget ${URL}/google/type/calendar_period.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/type/calendarperiod;calendarperiod";' \ 'option go_package = "type";' \ ./google/type/calendar_period.proto (cd ./google/type && rm color.proto; wget ${URL}/google/type/color.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/type/color;color";' \ 'option go_package = "type";' \ ./google/type/color.proto (cd ./google/type && rm date.proto; wget ${URL}/google/type/date.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/type/date;date";' \ 'option go_package = "type";' \ ./google/type/date.proto (cd ./google/type && rm datetime.proto; wget ${URL}/google/type/datetime.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/type/datetime;datetime";' \ 'option go_package = "type";' \ ./google/type/datetime.proto (cd ./google/type && rm dayofweek.proto; wget ${URL}/google/type/dayofweek.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/type/dayofweek;dayofweek";' \ 'option go_package = "type";' \ ./google/type/dayofweek.proto (cd ./google/type && rm expr.proto; wget ${URL}/google/type/expr.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/type/expr;expr";' \ 'option go_package = "type";' \ ./google/type/expr.proto (cd ./google/type && rm fraction.proto; wget ${URL}/google/type/fraction.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/type/fraction;fraction";' \ 'option go_package = "type";' \ ./google/type/fraction.proto (cd ./google/type && rm latlng.proto; wget ${URL}/google/type/latlng.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/type/latlng;latlng";' \ 'option go_package = "type";' \ ./google/type/latlng.proto (cd ./google/type && rm money.proto; wget ${URL}/google/type/money.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/type/money;money";' \ 'option go_package = "type";' \ ./google/type/money.proto (cd ./google/type && rm month.proto; wget ${URL}/google/type/month.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/type/month;month";' \ 'option go_package = "type";' \ ./google/type/month.proto (cd ./google/type && rm postal_address.proto; wget ${URL}/google/type/postal_address.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/type/postaladdress;postaladdress";' \ 'option go_package = "type";' \ ./google/type/postal_address.proto (cd ./google/type && rm quaternion.proto; wget ${URL}/google/type/quaternion.proto) gogoreplace \ 'option go_package = "google.golang.org/genproto/googleapis/type/quaternion;quaternion";' \ 'option go_package = "type";' \ ./google/type/quaternion.proto (cd ./google/type && rm timeofday.proto; wget ${URL}/google/type/timeofday.proto) gogoreplace \ '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 googleapis-1.4.0/Readme.md000066400000000000000000000004031365205541600153700ustar00rootroot00000000000000# Google APIs generated by gogoprotobuf [![Build Status](https://travis-ci.org/gogo/googleapis.svg?branch=master)](https://travis-ci.org/gogo/googleapis) The [grpc-example](https://github.com/gogo/grpc-example) includes an example usage of this repository. googleapis-1.4.0/go.mod000066400000000000000000000001241365205541600147570ustar00rootroot00000000000000module github.com/gogo/googleapis go 1.12 require github.com/gogo/protobuf v1.3.1 googleapis-1.4.0/go.sum000066400000000000000000000007061365205541600150120ustar00rootroot00000000000000github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= googleapis-1.4.0/google/000077500000000000000000000000001365205541600151305ustar00rootroot00000000000000googleapis-1.4.0/google/api/000077500000000000000000000000001365205541600157015ustar00rootroot00000000000000googleapis-1.4.0/google/api/annotations.pb.go000066400000000000000000000050471365205541600211730ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/api/annotations.proto package api import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" math "math" ) // 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 var E_Http = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MethodOptions)(nil), ExtensionType: (*HttpRule)(nil), Field: 72295728, Name: "google.api.http", Tag: "bytes,72295728,opt,name=http", Filename: "google/api/annotations.proto", } func init() { proto.RegisterExtension(E_Http) } func init() { proto.RegisterFile("google/api/annotations.proto", fileDescriptor_c591c5aa9fb79aab) } var fileDescriptor_c591c5aa9fb79aab = []byte{ // 226 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0xc8, 0xea, 0x25, 0x16, 0x64, 0x4a, 0x89, 0x22, 0xa9, 0xcc, 0x28, 0x29, 0x29, 0x80, 0x28, 0x91, 0x52, 0x80, 0x0a, 0x83, 0x79, 0x49, 0xa5, 0x69, 0xfa, 0x29, 0xa9, 0xc5, 0xc9, 0x45, 0x99, 0x05, 0x25, 0xf9, 0x45, 0x10, 0x15, 0x56, 0xde, 0x5c, 0x2c, 0x20, 0xf5, 0x42, 0x72, 0x7a, 0x50, 0xd3, 0x60, 0x4a, 0xf5, 0x7c, 0x53, 0x4b, 0x32, 0xf2, 0x53, 0xfc, 0x0b, 0xc0, 0x56, 0x4a, 0x6c, 0x38, 0xb5, 0x47, 0x49, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x44, 0x0f, 0x61, 0xad, 0x9e, 0x47, 0x49, 0x49, 0x41, 0x50, 0x69, 0x4e, 0x6a, 0x10, 0xd8, 0x10, 0xa7, 0x98, 0x1b, 0x0f, 0xe5, 0x18, 0x3e, 0x3c, 0x94, 0x63, 0xfc, 0xf1, 0x50, 0x8e, 0xb1, 0xe1, 0x91, 0x1c, 0xe3, 0x8a, 0x47, 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x8b, 0x47, 0x72, 0x0c, 0x1f, 0x40, 0x62, 0x8f, 0xe5, 0x18, 0xb9, 0xf8, 0x92, 0xf3, 0x73, 0x91, 0x0c, 0x73, 0x12, 0x70, 0x44, 0x78, 0x31, 0x00, 0xe4, 0x8a, 0x00, 0xc6, 0x28, 0xe6, 0xc4, 0x82, 0xcc, 0x45, 0x4c, 0x2c, 0xee, 0x8e, 0x01, 0x9e, 0x49, 0x6c, 0x60, 0xa7, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd0, 0xe9, 0xae, 0xdf, 0x16, 0x01, 0x00, 0x00, } googleapis-1.4.0/google/api/annotations.proto000066400000000000000000000017351365205541600213310ustar00rootroot00000000000000// Copyright (c) 2015, Google Inc. // // 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.api; import "google/api/http.proto"; import "google/protobuf/descriptor.proto"; option go_package = "api"; option java_multiple_files = true; option java_outer_classname = "AnnotationsProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; extend google.protobuf.MethodOptions { // See `HttpRule`. HttpRule http = 72295728; } googleapis-1.4.0/google/api/client.pb.go000066400000000000000000000070701365205541600201120ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/api/client.proto package api import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" math "math" ) // 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 var E_MethodSignature = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MethodOptions)(nil), ExtensionType: ([]string)(nil), Field: 1051, Name: "google.api.method_signature", Tag: "bytes,1051,rep,name=method_signature", Filename: "google/api/client.proto", } var E_DefaultHost = &proto.ExtensionDesc{ ExtendedType: (*descriptor.ServiceOptions)(nil), ExtensionType: (*string)(nil), Field: 1049, Name: "google.api.default_host", Tag: "bytes,1049,opt,name=default_host", Filename: "google/api/client.proto", } var E_OauthScopes = &proto.ExtensionDesc{ ExtendedType: (*descriptor.ServiceOptions)(nil), ExtensionType: (*string)(nil), Field: 1050, Name: "google.api.oauth_scopes", Tag: "bytes,1050,opt,name=oauth_scopes", Filename: "google/api/client.proto", } func init() { proto.RegisterExtension(E_MethodSignature) proto.RegisterExtension(E_DefaultHost) proto.RegisterExtension(E_OauthScopes) } func init() { proto.RegisterFile("google/api/client.proto", fileDescriptor_78f2c6f7c3a942c1) } var fileDescriptor_78f2c6f7c3a942c1 = []byte{ // 286 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xce, 0xc9, 0x4c, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0x48, 0xe8, 0x25, 0x16, 0x64, 0x4a, 0x29, 0x40, 0x15, 0x81, 0x65, 0x92, 0x4a, 0xd3, 0xf4, 0x53, 0x52, 0x8b, 0x93, 0x8b, 0x32, 0x0b, 0x4a, 0xf2, 0x8b, 0x20, 0xaa, 0xad, 0xbc, 0xb8, 0x04, 0x72, 0x53, 0x4b, 0x32, 0xf2, 0x53, 0xe2, 0x8b, 0x33, 0xd3, 0xf3, 0x12, 0x4b, 0x4a, 0x8b, 0x52, 0x85, 0xe4, 0xf4, 0xa0, 0x46, 0xc0, 0xb4, 0xe9, 0xf9, 0x82, 0x95, 0xf8, 0x17, 0x94, 0x64, 0xe6, 0xe7, 0x15, 0x4b, 0xcc, 0xe6, 0x50, 0x60, 0xd6, 0xe0, 0x0c, 0xe2, 0x87, 0x68, 0x0c, 0x86, 0xe9, 0xb3, 0x72, 0xe6, 0xe2, 0x49, 0x49, 0x4d, 0x4b, 0x2c, 0xcd, 0x29, 0x89, 0xcf, 0xc8, 0x2f, 0x2e, 0x11, 0x92, 0xc7, 0x30, 0x27, 0x38, 0xb5, 0xa8, 0x2c, 0x33, 0x39, 0x15, 0x66, 0xd0, 0x4c, 0x0e, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x6e, 0xa8, 0x2e, 0x8f, 0xfc, 0xe2, 0x12, 0x90, 0x21, 0xf9, 0x89, 0xa5, 0x25, 0x19, 0xf1, 0xc5, 0xc9, 0xf9, 0x05, 0xa9, 0xc5, 0x84, 0x0d, 0x99, 0x05, 0x35, 0x04, 0xac, 0x2b, 0x18, 0xac, 0xc9, 0x29, 0xfa, 0xc6, 0x43, 0x39, 0x86, 0x0f, 0x0f, 0xe5, 0x18, 0x7f, 0x3c, 0x94, 0x63, 0x6c, 0x78, 0x24, 0xc7, 0xb8, 0xe2, 0x91, 0x1c, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0xf8, 0xe2, 0x91, 0x1c, 0xc3, 0x07, 0x90, 0xf8, 0x63, 0x39, 0xc6, 0x13, 0x8f, 0xe5, 0x18, 0xb9, 0xf8, 0x92, 0xf3, 0x73, 0xf5, 0x10, 0x21, 0xe7, 0xc4, 0xed, 0x0c, 0x0e, 0xd3, 0x00, 0x90, 0xa5, 0x01, 0x8c, 0x51, 0xcc, 0x89, 0x05, 0x99, 0x8b, 0x98, 0x58, 0xdc, 0x1d, 0x03, 0x3c, 0x93, 0xd8, 0xc0, 0x2e, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x29, 0x0f, 0xad, 0xac, 0x82, 0x01, 0x00, 0x00, } googleapis-1.4.0/google/api/client.proto000066400000000000000000000064061365205541600202520ustar00rootroot00000000000000// 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.api; import "google/protobuf/descriptor.proto"; option go_package = "api"; option java_multiple_files = true; option java_outer_classname = "ClientProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; extend google.protobuf.MethodOptions { // A definition of a client library method signature. // // In client libraries, each proto RPC corresponds to one or more methods // which the end user is able to call, and calls the underlying RPC. // Normally, this method receives a single argument (a struct or instance // corresponding to the RPC request object). Defining this field will // add one or more overloads providing flattened or simpler method signatures // in some languages. // // The fields on the method signature are provided as a comma-separated // string. // // For example, the proto RPC and annotation: // // rpc CreateSubscription(CreateSubscriptionRequest) // returns (Subscription) { // option (google.api.method_signature) = "name,topic"; // } // // Would add the following Java overload (in addition to the method accepting // the request object): // // public final Subscription createSubscription(String name, String topic) // // The following backwards-compatibility guidelines apply: // // * Adding this annotation to an unannotated method is backwards // compatible. // * Adding this annotation to a method which already has existing // method signature annotations is backwards compatible if and only if // the new method signature annotation is last in the sequence. // * Modifying or removing an existing method signature annotation is // a breaking change. // * Re-ordering existing method signature annotations is a breaking // change. repeated string method_signature = 1051; } extend google.protobuf.ServiceOptions { // The hostname for this service. // This should be specified with no prefix or protocol. // // Example: // // service Foo { // option (google.api.default_host) = "foo.googleapi.com"; // ... // } string default_host = 1049; // OAuth scopes needed for the client. // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform"; // ... // } // // If there is more than one scope, use a comma-separated string: // // Example: // // service Foo { // option (google.api.oauth_scopes) = \ // "https://www.googleapis.com/auth/cloud-platform," // "https://www.googleapis.com/auth/monitoring"; // ... // } string oauth_scopes = 1050; } googleapis-1.4.0/google/api/expr/000077500000000000000000000000001365205541600166575ustar00rootroot00000000000000googleapis-1.4.0/google/api/expr/v1alpha1/000077500000000000000000000000001365205541600202745ustar00rootroot00000000000000googleapis-1.4.0/google/api/expr/v1alpha1/syntax.pb.go000066400000000000000000005412161365205541600225620ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/api/expr/v1alpha1/syntax.proto package expr import ( bytes "bytes" encoding_binary "encoding/binary" fmt "fmt" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" types "github.com/gogo/protobuf/types" 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 // An expression together with source information as returned by the parser. type ParsedExpr struct { // The parsed expression. Expr *Expr `protobuf:"bytes,2,opt,name=expr,proto3" json:"expr,omitempty"` // The source info derived from input that generated the parsed `expr`. SourceInfo *SourceInfo `protobuf:"bytes,3,opt,name=source_info,json=sourceInfo,proto3" json:"source_info,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ParsedExpr) Reset() { *m = ParsedExpr{} } func (*ParsedExpr) ProtoMessage() {} func (*ParsedExpr) Descriptor() ([]byte, []int) { return fileDescriptor_d4e2be48009c83cb, []int{0} } func (m *ParsedExpr) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ParsedExpr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ParsedExpr.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 *ParsedExpr) XXX_Merge(src proto.Message) { xxx_messageInfo_ParsedExpr.Merge(m, src) } func (m *ParsedExpr) XXX_Size() int { return m.Size() } func (m *ParsedExpr) XXX_DiscardUnknown() { xxx_messageInfo_ParsedExpr.DiscardUnknown(m) } var xxx_messageInfo_ParsedExpr proto.InternalMessageInfo func (m *ParsedExpr) GetExpr() *Expr { if m != nil { return m.Expr } return nil } func (m *ParsedExpr) GetSourceInfo() *SourceInfo { if m != nil { return m.SourceInfo } return nil } func (*ParsedExpr) XXX_MessageName() string { return "google.api.expr.v1alpha1.ParsedExpr" } // An abstract representation of a common expression. // // Expressions are abstractly represented as a collection of identifiers, // select statements, function calls, literals, and comprehensions. All // operators with the exception of the '.' operator are modelled as function // calls. This makes it easy to represent new operators into the existing AST. // // All references within expressions must resolve to a [Decl][google.api.expr.v1alpha1.Decl] provided at // type-check for an expression to be valid. A reference may either be a bare // identifier `name` or a qualified identifier `google.api.name`. References // may either refer to a value or a function declaration. // // For example, the expression `google.api.name.startsWith('expr')` references // the declaration `google.api.name` within a [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression, and // the function declaration `startsWith`. type Expr struct { // Required. An id assigned to this node by the parser which is unique in a // given expression tree. This is used to associate type information and other // attributes to a node in the parse tree. Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` // Required. Variants of expressions. // // Types that are valid to be assigned to ExprKind: // *Expr_ConstExpr // *Expr_IdentExpr // *Expr_SelectExpr // *Expr_CallExpr // *Expr_ListExpr // *Expr_StructExpr // *Expr_ComprehensionExpr ExprKind isExpr_ExprKind `protobuf_oneof:"expr_kind"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Expr) Reset() { *m = Expr{} } func (*Expr) ProtoMessage() {} func (*Expr) Descriptor() ([]byte, []int) { return fileDescriptor_d4e2be48009c83cb, []int{1} } func (m *Expr) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Expr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Expr.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 *Expr) XXX_Merge(src proto.Message) { xxx_messageInfo_Expr.Merge(m, src) } func (m *Expr) XXX_Size() int { return m.Size() } func (m *Expr) XXX_DiscardUnknown() { xxx_messageInfo_Expr.DiscardUnknown(m) } var xxx_messageInfo_Expr proto.InternalMessageInfo type isExpr_ExprKind interface { isExpr_ExprKind() Equal(interface{}) bool MarshalTo([]byte) (int, error) Size() int } type Expr_ConstExpr struct { ConstExpr *Constant `protobuf:"bytes,3,opt,name=const_expr,json=constExpr,proto3,oneof" json:"const_expr,omitempty"` } type Expr_IdentExpr struct { IdentExpr *Expr_Ident `protobuf:"bytes,4,opt,name=ident_expr,json=identExpr,proto3,oneof" json:"ident_expr,omitempty"` } type Expr_SelectExpr struct { SelectExpr *Expr_Select `protobuf:"bytes,5,opt,name=select_expr,json=selectExpr,proto3,oneof" json:"select_expr,omitempty"` } type Expr_CallExpr struct { CallExpr *Expr_Call `protobuf:"bytes,6,opt,name=call_expr,json=callExpr,proto3,oneof" json:"call_expr,omitempty"` } type Expr_ListExpr struct { ListExpr *Expr_CreateList `protobuf:"bytes,7,opt,name=list_expr,json=listExpr,proto3,oneof" json:"list_expr,omitempty"` } type Expr_StructExpr struct { StructExpr *Expr_CreateStruct `protobuf:"bytes,8,opt,name=struct_expr,json=structExpr,proto3,oneof" json:"struct_expr,omitempty"` } type Expr_ComprehensionExpr struct { ComprehensionExpr *Expr_Comprehension `protobuf:"bytes,9,opt,name=comprehension_expr,json=comprehensionExpr,proto3,oneof" json:"comprehension_expr,omitempty"` } func (*Expr_ConstExpr) isExpr_ExprKind() {} func (*Expr_IdentExpr) isExpr_ExprKind() {} func (*Expr_SelectExpr) isExpr_ExprKind() {} func (*Expr_CallExpr) isExpr_ExprKind() {} func (*Expr_ListExpr) isExpr_ExprKind() {} func (*Expr_StructExpr) isExpr_ExprKind() {} func (*Expr_ComprehensionExpr) isExpr_ExprKind() {} func (m *Expr) GetExprKind() isExpr_ExprKind { if m != nil { return m.ExprKind } return nil } func (m *Expr) GetId() int64 { if m != nil { return m.Id } return 0 } func (m *Expr) GetConstExpr() *Constant { if x, ok := m.GetExprKind().(*Expr_ConstExpr); ok { return x.ConstExpr } return nil } func (m *Expr) GetIdentExpr() *Expr_Ident { if x, ok := m.GetExprKind().(*Expr_IdentExpr); ok { return x.IdentExpr } return nil } func (m *Expr) GetSelectExpr() *Expr_Select { if x, ok := m.GetExprKind().(*Expr_SelectExpr); ok { return x.SelectExpr } return nil } func (m *Expr) GetCallExpr() *Expr_Call { if x, ok := m.GetExprKind().(*Expr_CallExpr); ok { return x.CallExpr } return nil } func (m *Expr) GetListExpr() *Expr_CreateList { if x, ok := m.GetExprKind().(*Expr_ListExpr); ok { return x.ListExpr } return nil } func (m *Expr) GetStructExpr() *Expr_CreateStruct { if x, ok := m.GetExprKind().(*Expr_StructExpr); ok { return x.StructExpr } return nil } func (m *Expr) GetComprehensionExpr() *Expr_Comprehension { if x, ok := m.GetExprKind().(*Expr_ComprehensionExpr); ok { return x.ComprehensionExpr } return nil } // XXX_OneofWrappers is for the internal use of the proto package. func (*Expr) XXX_OneofWrappers() []interface{} { return []interface{}{ (*Expr_ConstExpr)(nil), (*Expr_IdentExpr)(nil), (*Expr_SelectExpr)(nil), (*Expr_CallExpr)(nil), (*Expr_ListExpr)(nil), (*Expr_StructExpr)(nil), (*Expr_ComprehensionExpr)(nil), } } func (*Expr) XXX_MessageName() string { return "google.api.expr.v1alpha1.Expr" } // An identifier expression. e.g. `request`. type Expr_Ident struct { // Required. Holds a single, unqualified identifier, possibly preceded by a // '.'. // // Qualified names are represented by the [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Expr_Ident) Reset() { *m = Expr_Ident{} } func (*Expr_Ident) ProtoMessage() {} func (*Expr_Ident) Descriptor() ([]byte, []int) { return fileDescriptor_d4e2be48009c83cb, []int{1, 0} } func (m *Expr_Ident) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Expr_Ident) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Expr_Ident.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 *Expr_Ident) XXX_Merge(src proto.Message) { xxx_messageInfo_Expr_Ident.Merge(m, src) } func (m *Expr_Ident) XXX_Size() int { return m.Size() } func (m *Expr_Ident) XXX_DiscardUnknown() { xxx_messageInfo_Expr_Ident.DiscardUnknown(m) } var xxx_messageInfo_Expr_Ident proto.InternalMessageInfo func (m *Expr_Ident) GetName() string { if m != nil { return m.Name } return "" } func (*Expr_Ident) XXX_MessageName() string { return "google.api.expr.v1alpha1.Expr.Ident" } // A field selection expression. e.g. `request.auth`. type Expr_Select struct { // Required. The target of the selection expression. // // For example, in the select expression `request.auth`, the `request` // portion of the expression is the `operand`. Operand *Expr `protobuf:"bytes,1,opt,name=operand,proto3" json:"operand,omitempty"` // Required. The name of the field to select. // // For example, in the select expression `request.auth`, the `auth` portion // of the expression would be the `field`. Field string `protobuf:"bytes,2,opt,name=field,proto3" json:"field,omitempty"` // Whether the select is to be interpreted as a field presence test. // // This results from the macro `has(request.auth)`. TestOnly bool `protobuf:"varint,3,opt,name=test_only,json=testOnly,proto3" json:"test_only,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Expr_Select) Reset() { *m = Expr_Select{} } func (*Expr_Select) ProtoMessage() {} func (*Expr_Select) Descriptor() ([]byte, []int) { return fileDescriptor_d4e2be48009c83cb, []int{1, 1} } func (m *Expr_Select) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Expr_Select) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Expr_Select.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 *Expr_Select) XXX_Merge(src proto.Message) { xxx_messageInfo_Expr_Select.Merge(m, src) } func (m *Expr_Select) XXX_Size() int { return m.Size() } func (m *Expr_Select) XXX_DiscardUnknown() { xxx_messageInfo_Expr_Select.DiscardUnknown(m) } var xxx_messageInfo_Expr_Select proto.InternalMessageInfo func (m *Expr_Select) GetOperand() *Expr { if m != nil { return m.Operand } return nil } func (m *Expr_Select) GetField() string { if m != nil { return m.Field } return "" } func (m *Expr_Select) GetTestOnly() bool { if m != nil { return m.TestOnly } return false } func (*Expr_Select) XXX_MessageName() string { return "google.api.expr.v1alpha1.Expr.Select" } // A call expression, including calls to predefined functions and operators. // // For example, `value == 10`, `size(map_value)`. type Expr_Call struct { // The target of an method call-style expression. For example, `x` in // `x.f()`. Target *Expr `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` // Required. The name of the function or method being called. Function string `protobuf:"bytes,2,opt,name=function,proto3" json:"function,omitempty"` // The arguments. Args []*Expr `protobuf:"bytes,3,rep,name=args,proto3" json:"args,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Expr_Call) Reset() { *m = Expr_Call{} } func (*Expr_Call) ProtoMessage() {} func (*Expr_Call) Descriptor() ([]byte, []int) { return fileDescriptor_d4e2be48009c83cb, []int{1, 2} } func (m *Expr_Call) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Expr_Call) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Expr_Call.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 *Expr_Call) XXX_Merge(src proto.Message) { xxx_messageInfo_Expr_Call.Merge(m, src) } func (m *Expr_Call) XXX_Size() int { return m.Size() } func (m *Expr_Call) XXX_DiscardUnknown() { xxx_messageInfo_Expr_Call.DiscardUnknown(m) } var xxx_messageInfo_Expr_Call proto.InternalMessageInfo func (m *Expr_Call) GetTarget() *Expr { if m != nil { return m.Target } return nil } func (m *Expr_Call) GetFunction() string { if m != nil { return m.Function } return "" } func (m *Expr_Call) GetArgs() []*Expr { if m != nil { return m.Args } return nil } func (*Expr_Call) XXX_MessageName() string { return "google.api.expr.v1alpha1.Expr.Call" } // A list creation expression. // // Lists may either be homogenous, e.g. `[1, 2, 3]`, or heterogenous, e.g. // `dyn([1, 'hello', 2.0])` type Expr_CreateList struct { // The elements part of the list. Elements []*Expr `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Expr_CreateList) Reset() { *m = Expr_CreateList{} } func (*Expr_CreateList) ProtoMessage() {} func (*Expr_CreateList) Descriptor() ([]byte, []int) { return fileDescriptor_d4e2be48009c83cb, []int{1, 3} } func (m *Expr_CreateList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Expr_CreateList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Expr_CreateList.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 *Expr_CreateList) XXX_Merge(src proto.Message) { xxx_messageInfo_Expr_CreateList.Merge(m, src) } func (m *Expr_CreateList) XXX_Size() int { return m.Size() } func (m *Expr_CreateList) XXX_DiscardUnknown() { xxx_messageInfo_Expr_CreateList.DiscardUnknown(m) } var xxx_messageInfo_Expr_CreateList proto.InternalMessageInfo func (m *Expr_CreateList) GetElements() []*Expr { if m != nil { return m.Elements } return nil } func (*Expr_CreateList) XXX_MessageName() string { return "google.api.expr.v1alpha1.Expr.CreateList" } // A map or message creation expression. // // Maps are constructed as `{'key_name': 'value'}`. Message construction is // similar, but prefixed with a type name and composed of field ids: // `types.MyType{field_id: 'value'}`. type Expr_CreateStruct struct { // The type name of the message to be created, empty when creating map // literals. MessageName string `protobuf:"bytes,1,opt,name=message_name,json=messageName,proto3" json:"message_name,omitempty"` // The entries in the creation expression. Entries []*Expr_CreateStruct_Entry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Expr_CreateStruct) Reset() { *m = Expr_CreateStruct{} } func (*Expr_CreateStruct) ProtoMessage() {} func (*Expr_CreateStruct) Descriptor() ([]byte, []int) { return fileDescriptor_d4e2be48009c83cb, []int{1, 4} } func (m *Expr_CreateStruct) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Expr_CreateStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Expr_CreateStruct.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 *Expr_CreateStruct) XXX_Merge(src proto.Message) { xxx_messageInfo_Expr_CreateStruct.Merge(m, src) } func (m *Expr_CreateStruct) XXX_Size() int { return m.Size() } func (m *Expr_CreateStruct) XXX_DiscardUnknown() { xxx_messageInfo_Expr_CreateStruct.DiscardUnknown(m) } var xxx_messageInfo_Expr_CreateStruct proto.InternalMessageInfo func (m *Expr_CreateStruct) GetMessageName() string { if m != nil { return m.MessageName } return "" } func (m *Expr_CreateStruct) GetEntries() []*Expr_CreateStruct_Entry { if m != nil { return m.Entries } return nil } func (*Expr_CreateStruct) XXX_MessageName() string { return "google.api.expr.v1alpha1.Expr.CreateStruct" } // Represents an entry. type Expr_CreateStruct_Entry struct { // Required. An id assigned to this node by the parser which is unique // in a given expression tree. This is used to associate type // information and other attributes to the node. Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // The `Entry` key kinds. // // Types that are valid to be assigned to KeyKind: // *Expr_CreateStruct_Entry_FieldKey // *Expr_CreateStruct_Entry_MapKey KeyKind isExpr_CreateStruct_Entry_KeyKind `protobuf_oneof:"key_kind"` // Required. The value assigned to the key. Value *Expr `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Expr_CreateStruct_Entry) Reset() { *m = Expr_CreateStruct_Entry{} } func (*Expr_CreateStruct_Entry) ProtoMessage() {} func (*Expr_CreateStruct_Entry) Descriptor() ([]byte, []int) { return fileDescriptor_d4e2be48009c83cb, []int{1, 4, 0} } func (m *Expr_CreateStruct_Entry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Expr_CreateStruct_Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Expr_CreateStruct_Entry.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 *Expr_CreateStruct_Entry) XXX_Merge(src proto.Message) { xxx_messageInfo_Expr_CreateStruct_Entry.Merge(m, src) } func (m *Expr_CreateStruct_Entry) XXX_Size() int { return m.Size() } func (m *Expr_CreateStruct_Entry) XXX_DiscardUnknown() { xxx_messageInfo_Expr_CreateStruct_Entry.DiscardUnknown(m) } var xxx_messageInfo_Expr_CreateStruct_Entry proto.InternalMessageInfo type isExpr_CreateStruct_Entry_KeyKind interface { isExpr_CreateStruct_Entry_KeyKind() Equal(interface{}) bool MarshalTo([]byte) (int, error) Size() int } type Expr_CreateStruct_Entry_FieldKey struct { FieldKey string `protobuf:"bytes,2,opt,name=field_key,json=fieldKey,proto3,oneof" json:"field_key,omitempty"` } type Expr_CreateStruct_Entry_MapKey struct { MapKey *Expr `protobuf:"bytes,3,opt,name=map_key,json=mapKey,proto3,oneof" json:"map_key,omitempty"` } func (*Expr_CreateStruct_Entry_FieldKey) isExpr_CreateStruct_Entry_KeyKind() {} func (*Expr_CreateStruct_Entry_MapKey) isExpr_CreateStruct_Entry_KeyKind() {} func (m *Expr_CreateStruct_Entry) GetKeyKind() isExpr_CreateStruct_Entry_KeyKind { if m != nil { return m.KeyKind } return nil } func (m *Expr_CreateStruct_Entry) GetId() int64 { if m != nil { return m.Id } return 0 } func (m *Expr_CreateStruct_Entry) GetFieldKey() string { if x, ok := m.GetKeyKind().(*Expr_CreateStruct_Entry_FieldKey); ok { return x.FieldKey } return "" } func (m *Expr_CreateStruct_Entry) GetMapKey() *Expr { if x, ok := m.GetKeyKind().(*Expr_CreateStruct_Entry_MapKey); ok { return x.MapKey } return nil } func (m *Expr_CreateStruct_Entry) GetValue() *Expr { if m != nil { return m.Value } return nil } // XXX_OneofWrappers is for the internal use of the proto package. func (*Expr_CreateStruct_Entry) XXX_OneofWrappers() []interface{} { return []interface{}{ (*Expr_CreateStruct_Entry_FieldKey)(nil), (*Expr_CreateStruct_Entry_MapKey)(nil), } } func (*Expr_CreateStruct_Entry) XXX_MessageName() string { return "google.api.expr.v1alpha1.Expr.CreateStruct.Entry" } // A comprehension expression applied to a list or map. // // Comprehensions are not part of the core syntax, but enabled with macros. // A macro matches a specific call signature within a parsed AST and replaces // the call with an alternate AST block. Macro expansion happens at parse // time. // // The following macros are supported within CEL: // // Aggregate type macros may be applied to all elements in a list or all keys // in a map: // // * `all`, `exists`, `exists_one` - test a predicate expression against // the inputs and return `true` if the predicate is satisfied for all, // any, or only one value `list.all(x, x < 10)`. // * `filter` - test a predicate expression against the inputs and return // the subset of elements which satisfy the predicate: // `payments.filter(p, p > 1000)`. // * `map` - apply an expression to all elements in the input and return the // output aggregate type: `[1, 2, 3].map(i, i * i)`. // // The `has(m.x)` macro tests whether the property `x` is present in struct // `m`. The semantics of this macro depend on the type of `m`. For proto2 // messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the // macro tests whether the property is set to its default. For map and struct // types, the macro tests whether the property `x` is defined on `m`. type Expr_Comprehension struct { // The name of the iteration variable. IterVar string `protobuf:"bytes,1,opt,name=iter_var,json=iterVar,proto3" json:"iter_var,omitempty"` // The range over which var iterates. IterRange *Expr `protobuf:"bytes,2,opt,name=iter_range,json=iterRange,proto3" json:"iter_range,omitempty"` // The name of the variable used for accumulation of the result. AccuVar string `protobuf:"bytes,3,opt,name=accu_var,json=accuVar,proto3" json:"accu_var,omitempty"` // The initial value of the accumulator. AccuInit *Expr `protobuf:"bytes,4,opt,name=accu_init,json=accuInit,proto3" json:"accu_init,omitempty"` // An expression which can contain iter_var and accu_var. // // Returns false when the result has been computed and may be used as // a hint to short-circuit the remainder of the comprehension. LoopCondition *Expr `protobuf:"bytes,5,opt,name=loop_condition,json=loopCondition,proto3" json:"loop_condition,omitempty"` // An expression which can contain iter_var and accu_var. // // Computes the next value of accu_var. LoopStep *Expr `protobuf:"bytes,6,opt,name=loop_step,json=loopStep,proto3" json:"loop_step,omitempty"` // An expression which can contain accu_var. // // Computes the result. Result *Expr `protobuf:"bytes,7,opt,name=result,proto3" json:"result,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Expr_Comprehension) Reset() { *m = Expr_Comprehension{} } func (*Expr_Comprehension) ProtoMessage() {} func (*Expr_Comprehension) Descriptor() ([]byte, []int) { return fileDescriptor_d4e2be48009c83cb, []int{1, 5} } func (m *Expr_Comprehension) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Expr_Comprehension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Expr_Comprehension.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 *Expr_Comprehension) XXX_Merge(src proto.Message) { xxx_messageInfo_Expr_Comprehension.Merge(m, src) } func (m *Expr_Comprehension) XXX_Size() int { return m.Size() } func (m *Expr_Comprehension) XXX_DiscardUnknown() { xxx_messageInfo_Expr_Comprehension.DiscardUnknown(m) } var xxx_messageInfo_Expr_Comprehension proto.InternalMessageInfo func (m *Expr_Comprehension) GetIterVar() string { if m != nil { return m.IterVar } return "" } func (m *Expr_Comprehension) GetIterRange() *Expr { if m != nil { return m.IterRange } return nil } func (m *Expr_Comprehension) GetAccuVar() string { if m != nil { return m.AccuVar } return "" } func (m *Expr_Comprehension) GetAccuInit() *Expr { if m != nil { return m.AccuInit } return nil } func (m *Expr_Comprehension) GetLoopCondition() *Expr { if m != nil { return m.LoopCondition } return nil } func (m *Expr_Comprehension) GetLoopStep() *Expr { if m != nil { return m.LoopStep } return nil } func (m *Expr_Comprehension) GetResult() *Expr { if m != nil { return m.Result } return nil } func (*Expr_Comprehension) XXX_MessageName() string { return "google.api.expr.v1alpha1.Expr.Comprehension" } // Represents a primitive literal. // // Named 'Constant' here for backwards compatibility. // // This is similar as the primitives supported in the well-known type // `google.protobuf.Value`, but richer so it can represent CEL's full range of // primitives. // // Lists and structs are not included as constants as these aggregate types may // contain [Expr][google.api.expr.v1alpha1.Expr] elements which require evaluation and are thus not constant. // // Examples of literals include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`, // `true`, `null`. type Constant struct { // Required. The valid constant kinds. // // Types that are valid to be assigned to ConstantKind: // *Constant_NullValue // *Constant_BoolValue // *Constant_Int64Value // *Constant_Uint64Value // *Constant_DoubleValue // *Constant_StringValue // *Constant_BytesValue // *Constant_DurationValue // *Constant_TimestampValue ConstantKind isConstant_ConstantKind `protobuf_oneof:"constant_kind"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Constant) Reset() { *m = Constant{} } func (*Constant) ProtoMessage() {} func (*Constant) Descriptor() ([]byte, []int) { return fileDescriptor_d4e2be48009c83cb, []int{2} } func (m *Constant) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Constant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Constant.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 *Constant) XXX_Merge(src proto.Message) { xxx_messageInfo_Constant.Merge(m, src) } func (m *Constant) XXX_Size() int { return m.Size() } func (m *Constant) XXX_DiscardUnknown() { xxx_messageInfo_Constant.DiscardUnknown(m) } var xxx_messageInfo_Constant proto.InternalMessageInfo type isConstant_ConstantKind interface { isConstant_ConstantKind() Equal(interface{}) bool MarshalTo([]byte) (int, error) Size() int } type Constant_NullValue struct { NullValue types.NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof" json:"null_value,omitempty"` } type Constant_BoolValue struct { BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof" json:"bool_value,omitempty"` } type Constant_Int64Value struct { Int64Value int64 `protobuf:"varint,3,opt,name=int64_value,json=int64Value,proto3,oneof" json:"int64_value,omitempty"` } type Constant_Uint64Value struct { Uint64Value uint64 `protobuf:"varint,4,opt,name=uint64_value,json=uint64Value,proto3,oneof" json:"uint64_value,omitempty"` } type Constant_DoubleValue struct { DoubleValue float64 `protobuf:"fixed64,5,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` } type Constant_StringValue struct { StringValue string `protobuf:"bytes,6,opt,name=string_value,json=stringValue,proto3,oneof" json:"string_value,omitempty"` } type Constant_BytesValue struct { BytesValue []byte `protobuf:"bytes,7,opt,name=bytes_value,json=bytesValue,proto3,oneof" json:"bytes_value,omitempty"` } type Constant_DurationValue struct { DurationValue *types.Duration `protobuf:"bytes,8,opt,name=duration_value,json=durationValue,proto3,oneof" json:"duration_value,omitempty"` } type Constant_TimestampValue struct { TimestampValue *types.Timestamp `protobuf:"bytes,9,opt,name=timestamp_value,json=timestampValue,proto3,oneof" json:"timestamp_value,omitempty"` } func (*Constant_NullValue) isConstant_ConstantKind() {} func (*Constant_BoolValue) isConstant_ConstantKind() {} func (*Constant_Int64Value) isConstant_ConstantKind() {} func (*Constant_Uint64Value) isConstant_ConstantKind() {} func (*Constant_DoubleValue) isConstant_ConstantKind() {} func (*Constant_StringValue) isConstant_ConstantKind() {} func (*Constant_BytesValue) isConstant_ConstantKind() {} func (*Constant_DurationValue) isConstant_ConstantKind() {} func (*Constant_TimestampValue) isConstant_ConstantKind() {} func (m *Constant) GetConstantKind() isConstant_ConstantKind { if m != nil { return m.ConstantKind } return nil } func (m *Constant) GetNullValue() types.NullValue { if x, ok := m.GetConstantKind().(*Constant_NullValue); ok { return x.NullValue } return types.NullValue_NULL_VALUE } func (m *Constant) GetBoolValue() bool { if x, ok := m.GetConstantKind().(*Constant_BoolValue); ok { return x.BoolValue } return false } func (m *Constant) GetInt64Value() int64 { if x, ok := m.GetConstantKind().(*Constant_Int64Value); ok { return x.Int64Value } return 0 } func (m *Constant) GetUint64Value() uint64 { if x, ok := m.GetConstantKind().(*Constant_Uint64Value); ok { return x.Uint64Value } return 0 } func (m *Constant) GetDoubleValue() float64 { if x, ok := m.GetConstantKind().(*Constant_DoubleValue); ok { return x.DoubleValue } return 0 } func (m *Constant) GetStringValue() string { if x, ok := m.GetConstantKind().(*Constant_StringValue); ok { return x.StringValue } return "" } func (m *Constant) GetBytesValue() []byte { if x, ok := m.GetConstantKind().(*Constant_BytesValue); ok { return x.BytesValue } return nil } // Deprecated: Do not use. func (m *Constant) GetDurationValue() *types.Duration { if x, ok := m.GetConstantKind().(*Constant_DurationValue); ok { return x.DurationValue } return nil } // Deprecated: Do not use. func (m *Constant) GetTimestampValue() *types.Timestamp { if x, ok := m.GetConstantKind().(*Constant_TimestampValue); ok { return x.TimestampValue } return nil } // XXX_OneofWrappers is for the internal use of the proto package. func (*Constant) XXX_OneofWrappers() []interface{} { return []interface{}{ (*Constant_NullValue)(nil), (*Constant_BoolValue)(nil), (*Constant_Int64Value)(nil), (*Constant_Uint64Value)(nil), (*Constant_DoubleValue)(nil), (*Constant_StringValue)(nil), (*Constant_BytesValue)(nil), (*Constant_DurationValue)(nil), (*Constant_TimestampValue)(nil), } } func (*Constant) XXX_MessageName() string { return "google.api.expr.v1alpha1.Constant" } // Source information collected at parse time. type SourceInfo struct { // The syntax version of the source, e.g. `cel1`. SyntaxVersion string `protobuf:"bytes,1,opt,name=syntax_version,json=syntaxVersion,proto3" json:"syntax_version,omitempty"` // The location name. All position information attached to an expression is // relative to this location. // // The location could be a file, UI element, or similar. For example, // `acme/app/AnvilPolicy.cel`. Location string `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"` // Monotonically increasing list of character offsets where newlines appear. // // The line number of a given position is the index `i` where for a given // `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The // column may be derivd from `id_positions[id] - line_offsets[i]`. LineOffsets []int32 `protobuf:"varint,3,rep,packed,name=line_offsets,json=lineOffsets,proto3" json:"line_offsets,omitempty"` // A map from the parse node id (e.g. `Expr.id`) to the character offset // within source. Positions map[int64]int32 `protobuf:"bytes,4,rep,name=positions,proto3" json:"positions,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // A map from the parse node id where a macro replacement was made to the // call `Expr` that resulted in a macro expansion. // // For example, `has(value.field)` is a function call that is replaced by a // `test_only` field selection in the AST. Likewise, the call // `list.exists(e, e > 10)` translates to a comprehension expression. The key // in the map corresponds to the expression id of the expanded macro, and the // value is the call `Expr` that was replaced. MacroCalls map[int64]*Expr `protobuf:"bytes,5,rep,name=macro_calls,json=macroCalls,proto3" json:"macro_calls,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *SourceInfo) Reset() { *m = SourceInfo{} } func (*SourceInfo) ProtoMessage() {} func (*SourceInfo) Descriptor() ([]byte, []int) { return fileDescriptor_d4e2be48009c83cb, []int{3} } func (m *SourceInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *SourceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SourceInfo.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 *SourceInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_SourceInfo.Merge(m, src) } func (m *SourceInfo) XXX_Size() int { return m.Size() } func (m *SourceInfo) XXX_DiscardUnknown() { xxx_messageInfo_SourceInfo.DiscardUnknown(m) } var xxx_messageInfo_SourceInfo proto.InternalMessageInfo func (m *SourceInfo) GetSyntaxVersion() string { if m != nil { return m.SyntaxVersion } return "" } func (m *SourceInfo) GetLocation() string { if m != nil { return m.Location } return "" } func (m *SourceInfo) GetLineOffsets() []int32 { if m != nil { return m.LineOffsets } return nil } func (m *SourceInfo) GetPositions() map[int64]int32 { if m != nil { return m.Positions } return nil } func (m *SourceInfo) GetMacroCalls() map[int64]*Expr { if m != nil { return m.MacroCalls } return nil } func (*SourceInfo) XXX_MessageName() string { return "google.api.expr.v1alpha1.SourceInfo" } // A specific position in source. type SourcePosition struct { // The soucre location name (e.g. file name). Location string `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"` // The character offset. Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` // The 1-based index of the starting line in the source text // where the issue occurs, or 0 if unknown. Line int32 `protobuf:"varint,3,opt,name=line,proto3" json:"line,omitempty"` // The 0-based index of the starting position within the line of source text // where the issue occurs. Only meaningful if line is nonzero. Column int32 `protobuf:"varint,4,opt,name=column,proto3" json:"column,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *SourcePosition) Reset() { *m = SourcePosition{} } func (*SourcePosition) ProtoMessage() {} func (*SourcePosition) Descriptor() ([]byte, []int) { return fileDescriptor_d4e2be48009c83cb, []int{4} } func (m *SourcePosition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *SourcePosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SourcePosition.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 *SourcePosition) XXX_Merge(src proto.Message) { xxx_messageInfo_SourcePosition.Merge(m, src) } func (m *SourcePosition) XXX_Size() int { return m.Size() } func (m *SourcePosition) XXX_DiscardUnknown() { xxx_messageInfo_SourcePosition.DiscardUnknown(m) } var xxx_messageInfo_SourcePosition proto.InternalMessageInfo func (m *SourcePosition) GetLocation() string { if m != nil { return m.Location } return "" } func (m *SourcePosition) GetOffset() int32 { if m != nil { return m.Offset } return 0 } func (m *SourcePosition) GetLine() int32 { if m != nil { return m.Line } return 0 } func (m *SourcePosition) GetColumn() int32 { if m != nil { return m.Column } return 0 } func (*SourcePosition) XXX_MessageName() string { return "google.api.expr.v1alpha1.SourcePosition" } func init() { proto.RegisterType((*ParsedExpr)(nil), "google.api.expr.v1alpha1.ParsedExpr") proto.RegisterType((*Expr)(nil), "google.api.expr.v1alpha1.Expr") proto.RegisterType((*Expr_Ident)(nil), "google.api.expr.v1alpha1.Expr.Ident") proto.RegisterType((*Expr_Select)(nil), "google.api.expr.v1alpha1.Expr.Select") proto.RegisterType((*Expr_Call)(nil), "google.api.expr.v1alpha1.Expr.Call") proto.RegisterType((*Expr_CreateList)(nil), "google.api.expr.v1alpha1.Expr.CreateList") proto.RegisterType((*Expr_CreateStruct)(nil), "google.api.expr.v1alpha1.Expr.CreateStruct") proto.RegisterType((*Expr_CreateStruct_Entry)(nil), "google.api.expr.v1alpha1.Expr.CreateStruct.Entry") proto.RegisterType((*Expr_Comprehension)(nil), "google.api.expr.v1alpha1.Expr.Comprehension") proto.RegisterType((*Constant)(nil), "google.api.expr.v1alpha1.Constant") proto.RegisterType((*SourceInfo)(nil), "google.api.expr.v1alpha1.SourceInfo") proto.RegisterMapType((map[int64]*Expr)(nil), "google.api.expr.v1alpha1.SourceInfo.MacroCallsEntry") proto.RegisterMapType((map[int64]int32)(nil), "google.api.expr.v1alpha1.SourceInfo.PositionsEntry") proto.RegisterType((*SourcePosition)(nil), "google.api.expr.v1alpha1.SourcePosition") } func init() { proto.RegisterFile("google/api/expr/v1alpha1/syntax.proto", fileDescriptor_d4e2be48009c83cb) } var fileDescriptor_d4e2be48009c83cb = []byte{ // 1209 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x96, 0xbf, 0x8f, 0x1b, 0x45, 0x1b, 0xc7, 0xbd, 0xfe, 0x75, 0xf6, 0xe3, 0x3b, 0xe7, 0x7d, 0x47, 0x08, 0x39, 0x9b, 0xe0, 0x24, 0x17, 0x22, 0x05, 0x81, 0x7c, 0x4a, 0x72, 0x8a, 0x42, 0x02, 0x8d, 0x8f, 0x43, 0x3e, 0x05, 0x92, 0x63, 0x0f, 0x52, 0x20, 0x45, 0xab, 0xb9, 0xf5, 0xd8, 0x59, 0x65, 0x77, 0x66, 0xb5, 0x33, 0x7b, 0x8a, 0x3b, 0x3a, 0x3a, 0xfe, 0x0e, 0x7a, 0x68, 0x28, 0xe9, 0x28, 0x29, 0x29, 0x28, 0xc8, 0xd1, 0x50, 0xa6, 0x4c, 0x83, 0x84, 0x9e, 0x67, 0x66, 0x7d, 0xbe, 0x0b, 0x27, 0x9b, 0x6e, 0xe7, 0x99, 0xef, 0xf7, 0xb3, 0xcf, 0xce, 0x33, 0xf3, 0xcc, 0xc2, 0x8d, 0xa9, 0x52, 0xd3, 0x44, 0x6c, 0xf1, 0x2c, 0xde, 0x12, 0x2f, 0xb2, 0x7c, 0xeb, 0xe8, 0x16, 0x4f, 0xb2, 0x67, 0xfc, 0xd6, 0x96, 0x9e, 0x49, 0xc3, 0x5f, 0x0c, 0xb2, 0x5c, 0x19, 0xc5, 0x7a, 0x56, 0x36, 0xe0, 0x59, 0x3c, 0x40, 0xd9, 0xa0, 0x94, 0xf9, 0x7d, 0x07, 0x20, 0xdd, 0x61, 0x31, 0xd9, 0x1a, 0x17, 0x39, 0x37, 0xb1, 0x92, 0xd6, 0xe9, 0x5f, 0x3e, 0x3b, 0xaf, 0x4d, 0x5e, 0x44, 0xc6, 0xcd, 0x5e, 0x39, 0x3b, 0x6b, 0xe2, 0x54, 0x68, 0xc3, 0xd3, 0xcc, 0x0a, 0x36, 0xbf, 0xf5, 0x00, 0xf6, 0x79, 0xae, 0xc5, 0x78, 0xf7, 0x45, 0x96, 0xb3, 0xdb, 0x50, 0xc7, 0xd7, 0xf7, 0xaa, 0x57, 0xbd, 0x9b, 0x9d, 0xdb, 0xfd, 0xc1, 0x79, 0x69, 0x0d, 0x50, 0x1d, 0x90, 0x96, 0xed, 0x42, 0x47, 0xab, 0x22, 0x8f, 0x44, 0x18, 0xcb, 0x89, 0xea, 0xd5, 0xc8, 0xfa, 0xee, 0xf9, 0xd6, 0x03, 0x12, 0xef, 0xc9, 0x89, 0x0a, 0x40, 0xcf, 0x9f, 0x37, 0x7f, 0x5f, 0x87, 0x3a, 0xe5, 0xd0, 0x85, 0x6a, 0x3c, 0xa6, 0x0c, 0x6a, 0x41, 0x35, 0x1e, 0xb3, 0x1d, 0x80, 0x48, 0x49, 0x6d, 0x42, 0xca, 0xcc, 0xe2, 0x37, 0xcf, 0xc7, 0xef, 0xa0, 0x96, 0x4b, 0x33, 0xaa, 0x04, 0x6d, 0xf2, 0xed, 0xda, 0x24, 0x21, 0x1e, 0x0b, 0xe9, 0x20, 0xf5, 0x65, 0x39, 0xa2, 0x67, 0xb0, 0x87, 0x06, 0xc4, 0x90, 0x93, 0x30, 0x23, 0xe8, 0x68, 0x91, 0x88, 0xc8, 0x71, 0x1a, 0xc4, 0xb9, 0xb1, 0x84, 0x73, 0x40, 0x8e, 0x51, 0x25, 0x00, 0xeb, 0x25, 0xd2, 0x10, 0xda, 0x11, 0x4f, 0x12, 0xcb, 0x69, 0x12, 0xe7, 0xfa, 0x12, 0xce, 0x0e, 0x4f, 0x92, 0x51, 0x25, 0x68, 0xa1, 0xcf, 0x65, 0xd3, 0x4e, 0xe2, 0x72, 0x61, 0xd6, 0x88, 0xf1, 0xde, 0x32, 0x46, 0x2e, 0xb8, 0x11, 0x9f, 0xc5, 0x1a, 0xf3, 0x69, 0xa1, 0x9b, 0x48, 0x8f, 0xa0, 0x63, 0xf7, 0x8d, 0x65, 0xb5, 0x88, 0xf5, 0xfe, 0x4a, 0xac, 0x03, 0xf2, 0xd1, 0xd7, 0xd1, 0x13, 0xf1, 0x9e, 0x02, 0x8b, 0x54, 0x9a, 0xe5, 0xe2, 0x99, 0x90, 0x3a, 0x56, 0xd2, 0x62, 0xdb, 0x84, 0xfd, 0x60, 0x19, 0x76, 0xd1, 0x38, 0xaa, 0x04, 0xff, 0x3f, 0x45, 0x42, 0x89, 0x7f, 0x09, 0x1a, 0x54, 0x1c, 0xc6, 0xa0, 0x2e, 0x79, 0x2a, 0x7a, 0xde, 0x55, 0xef, 0x66, 0x3b, 0xa0, 0x67, 0xbf, 0x80, 0xa6, 0x5d, 0x71, 0x76, 0x0f, 0xd6, 0x54, 0x26, 0x72, 0x2e, 0xc7, 0x24, 0x58, 0xbe, 0xa1, 0x4b, 0x39, 0x7b, 0x0b, 0x1a, 0x93, 0x58, 0x24, 0x76, 0x1b, 0xb6, 0x03, 0x3b, 0x60, 0x97, 0xa0, 0x6d, 0x84, 0x36, 0xa1, 0x92, 0xc9, 0x8c, 0x36, 0x62, 0x2b, 0x68, 0x61, 0xe0, 0xb1, 0x4c, 0x66, 0xfe, 0x77, 0x1e, 0xd4, 0xb1, 0x42, 0xec, 0x2e, 0x34, 0x0d, 0xcf, 0xa7, 0xc2, 0xac, 0xf8, 0x52, 0xa7, 0x66, 0x3e, 0xb4, 0x26, 0x85, 0x8c, 0xf0, 0x6c, 0xbb, 0xd7, 0xce, 0xc7, 0x78, 0x2e, 0x79, 0x3e, 0xd5, 0xbd, 0xda, 0xd5, 0xda, 0x2a, 0xe7, 0x12, 0xb5, 0xfe, 0x08, 0xe0, 0xa4, 0xda, 0xec, 0x3e, 0xb4, 0x44, 0x22, 0x52, 0x21, 0x8d, 0xee, 0x79, 0x2b, 0x51, 0xe6, 0x7a, 0xff, 0xc7, 0x2a, 0xac, 0x2f, 0x16, 0x9b, 0x5d, 0x83, 0xf5, 0x54, 0x68, 0xcd, 0xa7, 0x22, 0x5c, 0x58, 0xfe, 0x8e, 0x8b, 0x3d, 0xe2, 0xa9, 0x60, 0x0f, 0x61, 0x4d, 0x48, 0x93, 0xc7, 0x42, 0xf7, 0xaa, 0xf4, 0xba, 0x5b, 0xff, 0x61, 0x37, 0x0d, 0x76, 0xa5, 0xc9, 0x67, 0x41, 0x49, 0xf0, 0x7f, 0xf0, 0xa0, 0x41, 0x21, 0xd7, 0x1c, 0xbc, 0x79, 0x73, 0x78, 0x07, 0xda, 0x54, 0x9b, 0xf0, 0xb9, 0x98, 0xd9, 0x55, 0xc3, 0x7d, 0x4d, 0xa1, 0x87, 0x62, 0xc6, 0x3e, 0x84, 0xb5, 0x94, 0x67, 0x34, 0x59, 0x5b, 0xa5, 0x18, 0xa3, 0x4a, 0xd0, 0x4c, 0x79, 0x86, 0xd6, 0x6d, 0x68, 0x1c, 0xf1, 0xa4, 0x10, 0xae, 0x59, 0x2c, 0x5b, 0x2d, 0x2b, 0x1e, 0x02, 0xb4, 0x9e, 0x8b, 0x59, 0xf8, 0x3c, 0x96, 0x63, 0xff, 0xef, 0x2a, 0x6c, 0x9c, 0xda, 0xcc, 0xec, 0x22, 0xb4, 0x62, 0x23, 0xf2, 0xf0, 0x88, 0xe7, 0x6e, 0xcd, 0xd6, 0x70, 0xfc, 0x84, 0xe7, 0xec, 0x63, 0x00, 0x9a, 0xca, 0xb9, 0x9c, 0x8a, 0x15, 0xfb, 0x6f, 0x1b, 0x1d, 0x01, 0x1a, 0x90, 0xcc, 0xa3, 0xa8, 0x20, 0x72, 0xcd, 0x92, 0x71, 0x8c, 0xe4, 0x07, 0xd0, 0xa6, 0xa9, 0x58, 0xc6, 0x66, 0xc5, 0x8f, 0x21, 0xd6, 0x9e, 0x8c, 0x0d, 0xdb, 0x85, 0x6e, 0xa2, 0x54, 0x16, 0x46, 0x4a, 0x8e, 0x63, 0xda, 0x9a, 0x8d, 0x95, 0x08, 0x1b, 0xe8, 0xda, 0x29, 0x4d, 0x98, 0x03, 0x61, 0xb4, 0x11, 0x99, 0xeb, 0x76, 0x4b, 0x73, 0x40, 0xc3, 0x81, 0x11, 0x19, 0x1e, 0xa8, 0x5c, 0xe8, 0x22, 0x31, 0xae, 0xc7, 0x2d, 0x3d, 0x50, 0x56, 0x3d, 0xec, 0x40, 0x1b, 0x67, 0xa9, 0x18, 0x9b, 0x3f, 0xd7, 0xa0, 0x55, 0x5e, 0x0d, 0xec, 0x01, 0x80, 0x2c, 0x92, 0x24, 0xb4, 0x05, 0xc6, 0x4a, 0x74, 0x6f, 0xfb, 0x25, 0xb5, 0xbc, 0x2b, 0x07, 0x8f, 0x8a, 0x24, 0x79, 0x82, 0x0a, 0xbc, 0x03, 0x64, 0x39, 0x60, 0x57, 0x00, 0x0e, 0x95, 0x2a, 0xcd, 0x58, 0xa9, 0x16, 0x0a, 0x30, 0x66, 0x05, 0xd7, 0xa0, 0x13, 0x4b, 0x73, 0x77, 0xdb, 0x29, 0xb0, 0x1c, 0x35, 0xec, 0x8f, 0x14, 0xb4, 0x92, 0xeb, 0xb0, 0x5e, 0x2c, 0x6a, 0xb0, 0x2c, 0xf5, 0x51, 0x25, 0xe8, 0x14, 0xa7, 0x45, 0x63, 0x55, 0x1c, 0x26, 0xc2, 0x89, 0x70, 0xe5, 0x3d, 0x14, 0xd9, 0xe8, 0x5c, 0xa4, 0x4d, 0x1e, 0xcb, 0xa9, 0x13, 0x35, 0xdd, 0x19, 0xe8, 0xd8, 0xe8, 0x3c, 0xa3, 0xc3, 0x99, 0x11, 0xda, 0x69, 0x70, 0x19, 0xd7, 0x31, 0x23, 0x0a, 0x5a, 0xc9, 0xa7, 0xd0, 0x2d, 0xff, 0x2c, 0x9c, 0xca, 0x5e, 0x02, 0x17, 0xdf, 0x58, 0x96, 0x4f, 0x9c, 0x6c, 0x58, 0xed, 0x61, 0x36, 0x1b, 0xa5, 0xcd, 0x72, 0xf6, 0xe0, 0xc2, 0xfc, 0x1f, 0xc3, 0x81, 0x6c, 0xdb, 0x7f, 0x73, 0x7d, 0xbf, 0x2c, 0x75, 0x8e, 0xd4, 0x9d, 0x1b, 0x09, 0x35, 0xbc, 0x00, 0x1b, 0x91, 0xab, 0x98, 0xad, 0xe1, 0x4f, 0x35, 0x80, 0x93, 0xbf, 0x07, 0x76, 0x03, 0xba, 0xf6, 0x27, 0x2a, 0x3c, 0x12, 0x39, 0x9e, 0x2f, 0x77, 0xa6, 0x36, 0x6c, 0xf4, 0x89, 0x0d, 0x62, 0x5f, 0x4d, 0x54, 0xc4, 0x17, 0xfb, 0x6a, 0x39, 0xc6, 0x46, 0x96, 0xc4, 0x52, 0x84, 0x6a, 0x32, 0xd1, 0xc2, 0xd8, 0xfe, 0xda, 0x08, 0x3a, 0x18, 0x7b, 0x6c, 0x43, 0xec, 0x0b, 0x68, 0x67, 0x4a, 0xd3, 0x36, 0xd6, 0xbd, 0x3a, 0xb5, 0xb2, 0x3b, 0xab, 0xfc, 0xdc, 0x0c, 0xf6, 0x4b, 0x97, 0x6d, 0x66, 0x27, 0x14, 0xf6, 0x15, 0x74, 0x52, 0x1e, 0xe5, 0x2a, 0xc4, 0x9b, 0x5c, 0xf7, 0x1a, 0x04, 0xdd, 0x5e, 0x09, 0xfa, 0x39, 0xfa, 0xf0, 0x9a, 0x71, 0x54, 0x48, 0xe7, 0x01, 0xff, 0x23, 0xe8, 0x9e, 0x7e, 0x27, 0xfb, 0x1f, 0xd4, 0xb0, 0xf5, 0xd9, 0x76, 0x89, 0x8f, 0x78, 0xb1, 0x9d, 0xec, 0xdb, 0x86, 0xeb, 0x5a, 0xf7, 0xab, 0xf7, 0x3c, 0xff, 0x29, 0x5c, 0x38, 0x03, 0xff, 0x17, 0xfb, 0xf6, 0xa2, 0x7d, 0xd5, 0xa6, 0x88, 0xf8, 0xcd, 0x0c, 0xba, 0xf6, 0x33, 0xca, 0x14, 0x4f, 0xd5, 0xc5, 0x3b, 0x53, 0x97, 0xb7, 0xa1, 0x69, 0x4b, 0xe2, 0xf2, 0x74, 0x23, 0xbc, 0xef, 0xb1, 0x36, 0x74, 0xa6, 0x1a, 0x01, 0x3d, 0xa3, 0x36, 0x52, 0x49, 0x91, 0x4a, 0x3a, 0x45, 0x8d, 0xc0, 0x8d, 0x86, 0x87, 0xbf, 0xbd, 0xec, 0x57, 0x5e, 0xbd, 0xec, 0x7b, 0xaf, 0x5f, 0xf6, 0xbd, 0x6f, 0x8e, 0xfb, 0xde, 0xf7, 0xc7, 0x7d, 0xef, 0x97, 0xe3, 0xbe, 0xf7, 0xeb, 0x71, 0xdf, 0xfb, 0xe3, 0xb8, 0xef, 0xfd, 0x75, 0xdc, 0xaf, 0xbc, 0xc2, 0xd8, 0x9f, 0x7d, 0x0f, 0x2e, 0x47, 0x2a, 0x3d, 0xf7, 0x6b, 0x86, 0x9d, 0x03, 0xda, 0x52, 0xfb, 0xb8, 0x75, 0xf7, 0xbd, 0xaf, 0xe9, 0xc7, 0xf7, 0xb5, 0xe7, 0x1d, 0x36, 0x69, 0x33, 0xdf, 0xf9, 0x27, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x37, 0x05, 0x25, 0xe7, 0x0b, 0x00, 0x00, } func (this *ParsedExpr) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*ParsedExpr) if !ok { that2, ok := that.(ParsedExpr) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.Expr.Equal(that1.Expr) { return false } if !this.SourceInfo.Equal(that1.SourceInfo) { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Expr) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr) if !ok { that2, ok := that.(Expr) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Id != that1.Id { return false } if that1.ExprKind == nil { if this.ExprKind != nil { return false } } else if this.ExprKind == nil { return false } else if !this.ExprKind.Equal(that1.ExprKind) { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Expr_ConstExpr) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_ConstExpr) if !ok { that2, ok := that.(Expr_ConstExpr) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.ConstExpr.Equal(that1.ConstExpr) { return false } return true } func (this *Expr_IdentExpr) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_IdentExpr) if !ok { that2, ok := that.(Expr_IdentExpr) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.IdentExpr.Equal(that1.IdentExpr) { return false } return true } func (this *Expr_SelectExpr) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_SelectExpr) if !ok { that2, ok := that.(Expr_SelectExpr) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.SelectExpr.Equal(that1.SelectExpr) { return false } return true } func (this *Expr_CallExpr) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_CallExpr) if !ok { that2, ok := that.(Expr_CallExpr) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.CallExpr.Equal(that1.CallExpr) { return false } return true } func (this *Expr_ListExpr) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_ListExpr) if !ok { that2, ok := that.(Expr_ListExpr) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.ListExpr.Equal(that1.ListExpr) { return false } return true } func (this *Expr_StructExpr) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_StructExpr) if !ok { that2, ok := that.(Expr_StructExpr) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.StructExpr.Equal(that1.StructExpr) { return false } return true } func (this *Expr_ComprehensionExpr) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_ComprehensionExpr) if !ok { that2, ok := that.(Expr_ComprehensionExpr) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.ComprehensionExpr.Equal(that1.ComprehensionExpr) { return false } return true } func (this *Expr_Ident) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_Ident) if !ok { that2, ok := that.(Expr_Ident) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Name != that1.Name { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Expr_Select) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_Select) if !ok { that2, ok := that.(Expr_Select) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.Operand.Equal(that1.Operand) { return false } if this.Field != that1.Field { return false } if this.TestOnly != that1.TestOnly { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Expr_Call) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_Call) if !ok { that2, ok := that.(Expr_Call) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.Target.Equal(that1.Target) { return false } if this.Function != that1.Function { return false } if len(this.Args) != len(that1.Args) { return false } for i := range this.Args { if !this.Args[i].Equal(that1.Args[i]) { return false } } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Expr_CreateList) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_CreateList) if !ok { that2, ok := that.(Expr_CreateList) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if len(this.Elements) != len(that1.Elements) { return false } for i := range this.Elements { if !this.Elements[i].Equal(that1.Elements[i]) { return false } } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Expr_CreateStruct) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_CreateStruct) if !ok { that2, ok := that.(Expr_CreateStruct) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.MessageName != that1.MessageName { return false } if len(this.Entries) != len(that1.Entries) { return false } for i := range this.Entries { if !this.Entries[i].Equal(that1.Entries[i]) { return false } } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Expr_CreateStruct_Entry) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_CreateStruct_Entry) if !ok { that2, ok := that.(Expr_CreateStruct_Entry) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Id != that1.Id { return false } if that1.KeyKind == nil { if this.KeyKind != nil { return false } } else if this.KeyKind == nil { return false } else if !this.KeyKind.Equal(that1.KeyKind) { return false } if !this.Value.Equal(that1.Value) { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Expr_CreateStruct_Entry_FieldKey) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_CreateStruct_Entry_FieldKey) if !ok { that2, ok := that.(Expr_CreateStruct_Entry_FieldKey) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.FieldKey != that1.FieldKey { return false } return true } func (this *Expr_CreateStruct_Entry_MapKey) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_CreateStruct_Entry_MapKey) if !ok { that2, ok := that.(Expr_CreateStruct_Entry_MapKey) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.MapKey.Equal(that1.MapKey) { return false } return true } func (this *Expr_Comprehension) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr_Comprehension) if !ok { that2, ok := that.(Expr_Comprehension) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.IterVar != that1.IterVar { return false } if !this.IterRange.Equal(that1.IterRange) { return false } if this.AccuVar != that1.AccuVar { return false } if !this.AccuInit.Equal(that1.AccuInit) { return false } if !this.LoopCondition.Equal(that1.LoopCondition) { return false } if !this.LoopStep.Equal(that1.LoopStep) { return false } if !this.Result.Equal(that1.Result) { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Constant) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Constant) if !ok { that2, ok := that.(Constant) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if that1.ConstantKind == nil { if this.ConstantKind != nil { return false } } else if this.ConstantKind == nil { return false } else if !this.ConstantKind.Equal(that1.ConstantKind) { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Constant_NullValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Constant_NullValue) if !ok { that2, ok := that.(Constant_NullValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.NullValue != that1.NullValue { return false } return true } func (this *Constant_BoolValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Constant_BoolValue) if !ok { that2, ok := that.(Constant_BoolValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.BoolValue != that1.BoolValue { return false } return true } func (this *Constant_Int64Value) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Constant_Int64Value) if !ok { that2, ok := that.(Constant_Int64Value) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Int64Value != that1.Int64Value { return false } return true } func (this *Constant_Uint64Value) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Constant_Uint64Value) if !ok { that2, ok := that.(Constant_Uint64Value) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Uint64Value != that1.Uint64Value { return false } return true } func (this *Constant_DoubleValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Constant_DoubleValue) if !ok { that2, ok := that.(Constant_DoubleValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.DoubleValue != that1.DoubleValue { return false } return true } func (this *Constant_StringValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Constant_StringValue) if !ok { that2, ok := that.(Constant_StringValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.StringValue != that1.StringValue { return false } return true } func (this *Constant_BytesValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Constant_BytesValue) if !ok { that2, ok := that.(Constant_BytesValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !bytes.Equal(this.BytesValue, that1.BytesValue) { return false } return true } func (this *Constant_DurationValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Constant_DurationValue) if !ok { that2, ok := that.(Constant_DurationValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.DurationValue.Equal(that1.DurationValue) { return false } return true } func (this *Constant_TimestampValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Constant_TimestampValue) if !ok { that2, ok := that.(Constant_TimestampValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.TimestampValue.Equal(that1.TimestampValue) { return false } return true } func (this *SourceInfo) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*SourceInfo) if !ok { that2, ok := that.(SourceInfo) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.SyntaxVersion != that1.SyntaxVersion { return false } if this.Location != that1.Location { return false } if len(this.LineOffsets) != len(that1.LineOffsets) { return false } for i := range this.LineOffsets { if this.LineOffsets[i] != that1.LineOffsets[i] { return false } } if len(this.Positions) != len(that1.Positions) { return false } for i := range this.Positions { if this.Positions[i] != that1.Positions[i] { return false } } if len(this.MacroCalls) != len(that1.MacroCalls) { return false } for i := range this.MacroCalls { if !this.MacroCalls[i].Equal(that1.MacroCalls[i]) { return false } } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *SourcePosition) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*SourcePosition) if !ok { that2, ok := that.(SourcePosition) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Location != that1.Location { return false } if this.Offset != that1.Offset { return false } if this.Line != that1.Line { return false } if this.Column != that1.Column { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *ParsedExpr) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&expr.ParsedExpr{") if this.Expr != nil { s = append(s, "Expr: "+fmt.Sprintf("%#v", this.Expr)+",\n") } if this.SourceInfo != nil { s = append(s, "SourceInfo: "+fmt.Sprintf("%#v", this.SourceInfo)+",\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 (this *Expr) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 12) s = append(s, "&expr.Expr{") s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n") if this.ExprKind != nil { s = append(s, "ExprKind: "+fmt.Sprintf("%#v", this.ExprKind)+",\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 (this *Expr_ConstExpr) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Expr_ConstExpr{` + `ConstExpr:` + fmt.Sprintf("%#v", this.ConstExpr) + `}`}, ", ") return s } func (this *Expr_IdentExpr) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Expr_IdentExpr{` + `IdentExpr:` + fmt.Sprintf("%#v", this.IdentExpr) + `}`}, ", ") return s } func (this *Expr_SelectExpr) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Expr_SelectExpr{` + `SelectExpr:` + fmt.Sprintf("%#v", this.SelectExpr) + `}`}, ", ") return s } func (this *Expr_CallExpr) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Expr_CallExpr{` + `CallExpr:` + fmt.Sprintf("%#v", this.CallExpr) + `}`}, ", ") return s } func (this *Expr_ListExpr) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Expr_ListExpr{` + `ListExpr:` + fmt.Sprintf("%#v", this.ListExpr) + `}`}, ", ") return s } func (this *Expr_StructExpr) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Expr_StructExpr{` + `StructExpr:` + fmt.Sprintf("%#v", this.StructExpr) + `}`}, ", ") return s } func (this *Expr_ComprehensionExpr) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Expr_ComprehensionExpr{` + `ComprehensionExpr:` + fmt.Sprintf("%#v", this.ComprehensionExpr) + `}`}, ", ") return s } func (this *Expr_Ident) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&expr.Expr_Ident{") s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\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 (this *Expr_Select) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 7) s = append(s, "&expr.Expr_Select{") if this.Operand != nil { s = append(s, "Operand: "+fmt.Sprintf("%#v", this.Operand)+",\n") } s = append(s, "Field: "+fmt.Sprintf("%#v", this.Field)+",\n") s = append(s, "TestOnly: "+fmt.Sprintf("%#v", this.TestOnly)+",\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 (this *Expr_Call) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 7) s = append(s, "&expr.Expr_Call{") if this.Target != nil { s = append(s, "Target: "+fmt.Sprintf("%#v", this.Target)+",\n") } s = append(s, "Function: "+fmt.Sprintf("%#v", this.Function)+",\n") if this.Args != nil { s = append(s, "Args: "+fmt.Sprintf("%#v", this.Args)+",\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 (this *Expr_CreateList) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&expr.Expr_CreateList{") if this.Elements != nil { s = append(s, "Elements: "+fmt.Sprintf("%#v", this.Elements)+",\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 (this *Expr_CreateStruct) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&expr.Expr_CreateStruct{") s = append(s, "MessageName: "+fmt.Sprintf("%#v", this.MessageName)+",\n") if this.Entries != nil { s = append(s, "Entries: "+fmt.Sprintf("%#v", this.Entries)+",\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 (this *Expr_CreateStruct_Entry) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 8) s = append(s, "&expr.Expr_CreateStruct_Entry{") s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n") if this.KeyKind != nil { s = append(s, "KeyKind: "+fmt.Sprintf("%#v", this.KeyKind)+",\n") } if this.Value != nil { s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\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 (this *Expr_CreateStruct_Entry_FieldKey) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Expr_CreateStruct_Entry_FieldKey{` + `FieldKey:` + fmt.Sprintf("%#v", this.FieldKey) + `}`}, ", ") return s } func (this *Expr_CreateStruct_Entry_MapKey) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Expr_CreateStruct_Entry_MapKey{` + `MapKey:` + fmt.Sprintf("%#v", this.MapKey) + `}`}, ", ") return s } func (this *Expr_Comprehension) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 11) s = append(s, "&expr.Expr_Comprehension{") s = append(s, "IterVar: "+fmt.Sprintf("%#v", this.IterVar)+",\n") if this.IterRange != nil { s = append(s, "IterRange: "+fmt.Sprintf("%#v", this.IterRange)+",\n") } s = append(s, "AccuVar: "+fmt.Sprintf("%#v", this.AccuVar)+",\n") if this.AccuInit != nil { s = append(s, "AccuInit: "+fmt.Sprintf("%#v", this.AccuInit)+",\n") } if this.LoopCondition != nil { s = append(s, "LoopCondition: "+fmt.Sprintf("%#v", this.LoopCondition)+",\n") } if this.LoopStep != nil { s = append(s, "LoopStep: "+fmt.Sprintf("%#v", this.LoopStep)+",\n") } if this.Result != nil { s = append(s, "Result: "+fmt.Sprintf("%#v", this.Result)+",\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 (this *Constant) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 13) s = append(s, "&expr.Constant{") if this.ConstantKind != nil { s = append(s, "ConstantKind: "+fmt.Sprintf("%#v", this.ConstantKind)+",\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 (this *Constant_NullValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Constant_NullValue{` + `NullValue:` + fmt.Sprintf("%#v", this.NullValue) + `}`}, ", ") return s } func (this *Constant_BoolValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Constant_BoolValue{` + `BoolValue:` + fmt.Sprintf("%#v", this.BoolValue) + `}`}, ", ") return s } func (this *Constant_Int64Value) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Constant_Int64Value{` + `Int64Value:` + fmt.Sprintf("%#v", this.Int64Value) + `}`}, ", ") return s } func (this *Constant_Uint64Value) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Constant_Uint64Value{` + `Uint64Value:` + fmt.Sprintf("%#v", this.Uint64Value) + `}`}, ", ") return s } func (this *Constant_DoubleValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Constant_DoubleValue{` + `DoubleValue:` + fmt.Sprintf("%#v", this.DoubleValue) + `}`}, ", ") return s } func (this *Constant_StringValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Constant_StringValue{` + `StringValue:` + fmt.Sprintf("%#v", this.StringValue) + `}`}, ", ") return s } func (this *Constant_BytesValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Constant_BytesValue{` + `BytesValue:` + fmt.Sprintf("%#v", this.BytesValue) + `}`}, ", ") return s } func (this *Constant_DurationValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Constant_DurationValue{` + `DurationValue:` + fmt.Sprintf("%#v", this.DurationValue) + `}`}, ", ") return s } func (this *Constant_TimestampValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Constant_TimestampValue{` + `TimestampValue:` + fmt.Sprintf("%#v", this.TimestampValue) + `}`}, ", ") return s } func (this *SourceInfo) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 9) s = append(s, "&expr.SourceInfo{") s = append(s, "SyntaxVersion: "+fmt.Sprintf("%#v", this.SyntaxVersion)+",\n") s = append(s, "Location: "+fmt.Sprintf("%#v", this.Location)+",\n") s = append(s, "LineOffsets: "+fmt.Sprintf("%#v", this.LineOffsets)+",\n") keysForPositions := make([]int64, 0, len(this.Positions)) for k, _ := range this.Positions { keysForPositions = append(keysForPositions, k) } github_com_gogo_protobuf_sortkeys.Int64s(keysForPositions) mapStringForPositions := "map[int64]int32{" for _, k := range keysForPositions { mapStringForPositions += fmt.Sprintf("%#v: %#v,", k, this.Positions[k]) } mapStringForPositions += "}" if this.Positions != nil { s = append(s, "Positions: "+mapStringForPositions+",\n") } keysForMacroCalls := make([]int64, 0, len(this.MacroCalls)) for k, _ := range this.MacroCalls { keysForMacroCalls = append(keysForMacroCalls, k) } github_com_gogo_protobuf_sortkeys.Int64s(keysForMacroCalls) mapStringForMacroCalls := "map[int64]*Expr{" for _, k := range keysForMacroCalls { mapStringForMacroCalls += fmt.Sprintf("%#v: %#v,", k, this.MacroCalls[k]) } mapStringForMacroCalls += "}" if this.MacroCalls != nil { s = append(s, "MacroCalls: "+mapStringForMacroCalls+",\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 (this *SourcePosition) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 8) s = append(s, "&expr.SourcePosition{") s = append(s, "Location: "+fmt.Sprintf("%#v", this.Location)+",\n") s = append(s, "Offset: "+fmt.Sprintf("%#v", this.Offset)+",\n") s = append(s, "Line: "+fmt.Sprintf("%#v", this.Line)+",\n") s = append(s, "Column: "+fmt.Sprintf("%#v", this.Column)+",\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 valueToGoStringSyntax(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 *ParsedExpr) 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 *ParsedExpr) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ParsedExpr) 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.SourceInfo != nil { { size, err := m.SourceInfo.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } if m.Expr != nil { { size, err := m.Expr.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } return len(dAtA) - i, nil } func (m *Expr) 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 *Expr) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr) 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.ExprKind != nil { { size := m.ExprKind.Size() i -= size if _, err := m.ExprKind.MarshalTo(dAtA[i:]); err != nil { return 0, err } } } if m.Id != 0 { i = encodeVarintSyntax(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x10 } return len(dAtA) - i, nil } func (m *Expr_ConstExpr) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_ConstExpr) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.ConstExpr != nil { { size, err := m.ConstExpr.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } return len(dAtA) - i, nil } func (m *Expr_IdentExpr) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_IdentExpr) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.IdentExpr != nil { { size, err := m.IdentExpr.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } return len(dAtA) - i, nil } func (m *Expr_SelectExpr) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_SelectExpr) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.SelectExpr != nil { { size, err := m.SelectExpr.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a } return len(dAtA) - i, nil } func (m *Expr_CallExpr) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_CallExpr) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.CallExpr != nil { { size, err := m.CallExpr.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x32 } return len(dAtA) - i, nil } func (m *Expr_ListExpr) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_ListExpr) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.ListExpr != nil { { size, err := m.ListExpr.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x3a } return len(dAtA) - i, nil } func (m *Expr_StructExpr) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_StructExpr) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.StructExpr != nil { { size, err := m.StructExpr.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 } return len(dAtA) - i, nil } func (m *Expr_ComprehensionExpr) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_ComprehensionExpr) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.ComprehensionExpr != nil { { size, err := m.ComprehensionExpr.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a } return len(dAtA) - i, nil } func (m *Expr_Ident) 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 *Expr_Ident) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_Ident) 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 len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintSyntax(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Expr_Select) 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 *Expr_Select) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_Select) 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.TestOnly { i-- if m.TestOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x18 } if len(m.Field) > 0 { i -= len(m.Field) copy(dAtA[i:], m.Field) i = encodeVarintSyntax(dAtA, i, uint64(len(m.Field))) i-- dAtA[i] = 0x12 } if m.Operand != nil { { size, err := m.Operand.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Expr_Call) 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 *Expr_Call) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_Call) 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 len(m.Args) > 0 { for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Args[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } } if len(m.Function) > 0 { i -= len(m.Function) copy(dAtA[i:], m.Function) i = encodeVarintSyntax(dAtA, i, uint64(len(m.Function))) i-- dAtA[i] = 0x12 } if m.Target != nil { { size, err := m.Target.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Expr_CreateList) 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 *Expr_CreateList) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_CreateList) 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 len(m.Elements) > 0 { for iNdEx := len(m.Elements) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Elements[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *Expr_CreateStruct) 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 *Expr_CreateStruct) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_CreateStruct) 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 len(m.Entries) > 0 { for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } } if len(m.MessageName) > 0 { i -= len(m.MessageName) copy(dAtA[i:], m.MessageName) i = encodeVarintSyntax(dAtA, i, uint64(len(m.MessageName))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Expr_CreateStruct_Entry) 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 *Expr_CreateStruct_Entry) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_CreateStruct_Entry) 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.Value != nil { { size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } if m.KeyKind != nil { { size := m.KeyKind.Size() i -= size if _, err := m.KeyKind.MarshalTo(dAtA[i:]); err != nil { return 0, err } } } if m.Id != 0 { i = encodeVarintSyntax(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *Expr_CreateStruct_Entry_FieldKey) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_CreateStruct_Entry_FieldKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i -= len(m.FieldKey) copy(dAtA[i:], m.FieldKey) i = encodeVarintSyntax(dAtA, i, uint64(len(m.FieldKey))) i-- dAtA[i] = 0x12 return len(dAtA) - i, nil } func (m *Expr_CreateStruct_Entry_MapKey) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_CreateStruct_Entry_MapKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.MapKey != nil { { size, err := m.MapKey.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } return len(dAtA) - i, nil } func (m *Expr_Comprehension) 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 *Expr_Comprehension) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr_Comprehension) 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.Result != nil { { size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x3a } if m.LoopStep != nil { { size, err := m.LoopStep.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x32 } if m.LoopCondition != nil { { size, err := m.LoopCondition.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a } if m.AccuInit != nil { { size, err := m.AccuInit.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } if len(m.AccuVar) > 0 { i -= len(m.AccuVar) copy(dAtA[i:], m.AccuVar) i = encodeVarintSyntax(dAtA, i, uint64(len(m.AccuVar))) i-- dAtA[i] = 0x1a } if m.IterRange != nil { { size, err := m.IterRange.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if len(m.IterVar) > 0 { i -= len(m.IterVar) copy(dAtA[i:], m.IterVar) i = encodeVarintSyntax(dAtA, i, uint64(len(m.IterVar))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Constant) 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 *Constant) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Constant) 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.ConstantKind != nil { { size := m.ConstantKind.Size() i -= size if _, err := m.ConstantKind.MarshalTo(dAtA[i:]); err != nil { return 0, err } } } return len(dAtA) - i, nil } func (m *Constant_NullValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Constant_NullValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i = encodeVarintSyntax(dAtA, i, uint64(m.NullValue)) i-- dAtA[i] = 0x8 return len(dAtA) - i, nil } func (m *Constant_BoolValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Constant_BoolValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i-- if m.BoolValue { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x10 return len(dAtA) - i, nil } func (m *Constant_Int64Value) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Constant_Int64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i = encodeVarintSyntax(dAtA, i, uint64(m.Int64Value)) i-- dAtA[i] = 0x18 return len(dAtA) - i, nil } func (m *Constant_Uint64Value) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Constant_Uint64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i = encodeVarintSyntax(dAtA, i, uint64(m.Uint64Value)) i-- dAtA[i] = 0x20 return len(dAtA) - i, nil } func (m *Constant_DoubleValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Constant_DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DoubleValue)))) i-- dAtA[i] = 0x29 return len(dAtA) - i, nil } func (m *Constant_StringValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Constant_StringValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i -= len(m.StringValue) copy(dAtA[i:], m.StringValue) i = encodeVarintSyntax(dAtA, i, uint64(len(m.StringValue))) i-- dAtA[i] = 0x32 return len(dAtA) - i, nil } func (m *Constant_BytesValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Constant_BytesValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.BytesValue != nil { i -= len(m.BytesValue) copy(dAtA[i:], m.BytesValue) i = encodeVarintSyntax(dAtA, i, uint64(len(m.BytesValue))) i-- dAtA[i] = 0x3a } return len(dAtA) - i, nil } func (m *Constant_DurationValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Constant_DurationValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.DurationValue != nil { { size, err := m.DurationValue.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 } return len(dAtA) - i, nil } func (m *Constant_TimestampValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Constant_TimestampValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.TimestampValue != nil { { size, err := m.TimestampValue.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a } return len(dAtA) - i, nil } func (m *SourceInfo) 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 *SourceInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *SourceInfo) 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 len(m.MacroCalls) > 0 { for k := range m.MacroCalls { v := m.MacroCalls[k] baseI := i if v != nil { { size, err := v.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintSyntax(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } i = encodeVarintSyntax(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 i = encodeVarintSyntax(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x2a } } if len(m.Positions) > 0 { for k := range m.Positions { v := m.Positions[k] baseI := i i = encodeVarintSyntax(dAtA, i, uint64(v)) i-- dAtA[i] = 0x10 i = encodeVarintSyntax(dAtA, i, uint64(k)) i-- dAtA[i] = 0x8 i = encodeVarintSyntax(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x22 } } if len(m.LineOffsets) > 0 { dAtA23 := make([]byte, len(m.LineOffsets)*10) var j22 int for _, num1 := range m.LineOffsets { num := uint64(num1) for num >= 1<<7 { dAtA23[j22] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 j22++ } dAtA23[j22] = uint8(num) j22++ } i -= j22 copy(dAtA[i:], dAtA23[:j22]) i = encodeVarintSyntax(dAtA, i, uint64(j22)) i-- dAtA[i] = 0x1a } if len(m.Location) > 0 { i -= len(m.Location) copy(dAtA[i:], m.Location) i = encodeVarintSyntax(dAtA, i, uint64(len(m.Location))) i-- dAtA[i] = 0x12 } if len(m.SyntaxVersion) > 0 { i -= len(m.SyntaxVersion) copy(dAtA[i:], m.SyntaxVersion) i = encodeVarintSyntax(dAtA, i, uint64(len(m.SyntaxVersion))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *SourcePosition) 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 *SourcePosition) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *SourcePosition) 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.Column != 0 { i = encodeVarintSyntax(dAtA, i, uint64(m.Column)) i-- dAtA[i] = 0x20 } if m.Line != 0 { i = encodeVarintSyntax(dAtA, i, uint64(m.Line)) i-- dAtA[i] = 0x18 } if m.Offset != 0 { i = encodeVarintSyntax(dAtA, i, uint64(m.Offset)) i-- dAtA[i] = 0x10 } if len(m.Location) > 0 { i -= len(m.Location) copy(dAtA[i:], m.Location) i = encodeVarintSyntax(dAtA, i, uint64(len(m.Location))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintSyntax(dAtA []byte, offset int, v uint64) int { offset -= sovSyntax(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedParsedExpr(r randySyntax, easy bool) *ParsedExpr { this := &ParsedExpr{} if r.Intn(5) == 0 { this.Expr = NewPopulatedExpr(r, easy) } if r.Intn(5) == 0 { this.SourceInfo = NewPopulatedSourceInfo(r, easy) } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedSyntax(r, 4) } return this } func NewPopulatedExpr(r randySyntax, easy bool) *Expr { this := &Expr{} this.Id = int64(r.Int63()) if r.Intn(2) == 0 { this.Id *= -1 } oneofNumber_ExprKind := []int32{3, 4, 5, 6, 7, 8, 9}[r.Intn(7)] switch oneofNumber_ExprKind { case 3: this.ExprKind = NewPopulatedExpr_ConstExpr(r, easy) case 4: this.ExprKind = NewPopulatedExpr_IdentExpr(r, easy) case 5: this.ExprKind = NewPopulatedExpr_SelectExpr(r, easy) case 6: this.ExprKind = NewPopulatedExpr_CallExpr(r, easy) case 7: this.ExprKind = NewPopulatedExpr_ListExpr(r, easy) case 8: this.ExprKind = NewPopulatedExpr_StructExpr(r, easy) case 9: this.ExprKind = NewPopulatedExpr_ComprehensionExpr(r, easy) } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedSyntax(r, 10) } return this } func NewPopulatedExpr_ConstExpr(r randySyntax, easy bool) *Expr_ConstExpr { this := &Expr_ConstExpr{} this.ConstExpr = NewPopulatedConstant(r, easy) return this } func NewPopulatedExpr_IdentExpr(r randySyntax, easy bool) *Expr_IdentExpr { this := &Expr_IdentExpr{} this.IdentExpr = NewPopulatedExpr_Ident(r, easy) return this } func NewPopulatedExpr_SelectExpr(r randySyntax, easy bool) *Expr_SelectExpr { this := &Expr_SelectExpr{} this.SelectExpr = NewPopulatedExpr_Select(r, easy) return this } func NewPopulatedExpr_CallExpr(r randySyntax, easy bool) *Expr_CallExpr { this := &Expr_CallExpr{} this.CallExpr = NewPopulatedExpr_Call(r, easy) return this } func NewPopulatedExpr_ListExpr(r randySyntax, easy bool) *Expr_ListExpr { this := &Expr_ListExpr{} this.ListExpr = NewPopulatedExpr_CreateList(r, easy) return this } func NewPopulatedExpr_StructExpr(r randySyntax, easy bool) *Expr_StructExpr { this := &Expr_StructExpr{} this.StructExpr = NewPopulatedExpr_CreateStruct(r, easy) return this } func NewPopulatedExpr_ComprehensionExpr(r randySyntax, easy bool) *Expr_ComprehensionExpr { this := &Expr_ComprehensionExpr{} this.ComprehensionExpr = NewPopulatedExpr_Comprehension(r, easy) return this } func NewPopulatedExpr_Ident(r randySyntax, easy bool) *Expr_Ident { this := &Expr_Ident{} this.Name = string(randStringSyntax(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedSyntax(r, 2) } return this } func NewPopulatedExpr_Select(r randySyntax, easy bool) *Expr_Select { this := &Expr_Select{} if r.Intn(5) == 0 { this.Operand = NewPopulatedExpr(r, easy) } this.Field = string(randStringSyntax(r)) this.TestOnly = bool(bool(r.Intn(2) == 0)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedSyntax(r, 4) } return this } func NewPopulatedExpr_Call(r randySyntax, easy bool) *Expr_Call { this := &Expr_Call{} if r.Intn(5) == 0 { this.Target = NewPopulatedExpr(r, easy) } this.Function = string(randStringSyntax(r)) if r.Intn(5) == 0 { v1 := r.Intn(5) this.Args = make([]*Expr, v1) for i := 0; i < v1; i++ { this.Args[i] = NewPopulatedExpr(r, easy) } } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedSyntax(r, 4) } return this } func NewPopulatedExpr_CreateList(r randySyntax, easy bool) *Expr_CreateList { this := &Expr_CreateList{} if r.Intn(5) == 0 { v2 := r.Intn(5) this.Elements = make([]*Expr, v2) for i := 0; i < v2; i++ { this.Elements[i] = NewPopulatedExpr(r, easy) } } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedSyntax(r, 2) } return this } func NewPopulatedExpr_CreateStruct(r randySyntax, easy bool) *Expr_CreateStruct { this := &Expr_CreateStruct{} this.MessageName = string(randStringSyntax(r)) if r.Intn(5) == 0 { v3 := r.Intn(5) this.Entries = make([]*Expr_CreateStruct_Entry, v3) for i := 0; i < v3; i++ { this.Entries[i] = NewPopulatedExpr_CreateStruct_Entry(r, easy) } } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedSyntax(r, 3) } return this } func NewPopulatedExpr_CreateStruct_Entry(r randySyntax, easy bool) *Expr_CreateStruct_Entry { this := &Expr_CreateStruct_Entry{} this.Id = int64(r.Int63()) if r.Intn(2) == 0 { this.Id *= -1 } oneofNumber_KeyKind := []int32{2, 3}[r.Intn(2)] switch oneofNumber_KeyKind { case 2: this.KeyKind = NewPopulatedExpr_CreateStruct_Entry_FieldKey(r, easy) case 3: this.KeyKind = NewPopulatedExpr_CreateStruct_Entry_MapKey(r, easy) } if r.Intn(5) == 0 { this.Value = NewPopulatedExpr(r, easy) } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedSyntax(r, 5) } return this } func NewPopulatedExpr_CreateStruct_Entry_FieldKey(r randySyntax, easy bool) *Expr_CreateStruct_Entry_FieldKey { this := &Expr_CreateStruct_Entry_FieldKey{} this.FieldKey = string(randStringSyntax(r)) return this } func NewPopulatedExpr_CreateStruct_Entry_MapKey(r randySyntax, easy bool) *Expr_CreateStruct_Entry_MapKey { this := &Expr_CreateStruct_Entry_MapKey{} this.MapKey = NewPopulatedExpr(r, easy) return this } func NewPopulatedExpr_Comprehension(r randySyntax, easy bool) *Expr_Comprehension { this := &Expr_Comprehension{} this.IterVar = string(randStringSyntax(r)) if r.Intn(5) == 0 { this.IterRange = NewPopulatedExpr(r, easy) } this.AccuVar = string(randStringSyntax(r)) if r.Intn(5) == 0 { this.AccuInit = NewPopulatedExpr(r, easy) } if r.Intn(5) == 0 { this.LoopCondition = NewPopulatedExpr(r, easy) } if r.Intn(5) == 0 { this.LoopStep = NewPopulatedExpr(r, easy) } if r.Intn(5) == 0 { this.Result = NewPopulatedExpr(r, easy) } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedSyntax(r, 8) } return this } func NewPopulatedConstant(r randySyntax, easy bool) *Constant { this := &Constant{} oneofNumber_ConstantKind := []int32{1, 2, 3, 4, 5, 6, 7, 8, 9}[r.Intn(9)] switch oneofNumber_ConstantKind { case 1: this.ConstantKind = NewPopulatedConstant_NullValue(r, easy) case 2: this.ConstantKind = NewPopulatedConstant_BoolValue(r, easy) case 3: this.ConstantKind = NewPopulatedConstant_Int64Value(r, easy) case 4: this.ConstantKind = NewPopulatedConstant_Uint64Value(r, easy) case 5: this.ConstantKind = NewPopulatedConstant_DoubleValue(r, easy) case 6: this.ConstantKind = NewPopulatedConstant_StringValue(r, easy) case 7: this.ConstantKind = NewPopulatedConstant_BytesValue(r, easy) case 8: this.ConstantKind = NewPopulatedConstant_DurationValue(r, easy) case 9: this.ConstantKind = NewPopulatedConstant_TimestampValue(r, easy) } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedSyntax(r, 10) } return this } func NewPopulatedConstant_NullValue(r randySyntax, easy bool) *Constant_NullValue { this := &Constant_NullValue{} this.NullValue = types.NullValue([]int32{0}[r.Intn(1)]) return this } func NewPopulatedConstant_BoolValue(r randySyntax, easy bool) *Constant_BoolValue { this := &Constant_BoolValue{} this.BoolValue = bool(bool(r.Intn(2) == 0)) return this } func NewPopulatedConstant_Int64Value(r randySyntax, easy bool) *Constant_Int64Value { this := &Constant_Int64Value{} this.Int64Value = int64(r.Int63()) if r.Intn(2) == 0 { this.Int64Value *= -1 } return this } func NewPopulatedConstant_Uint64Value(r randySyntax, easy bool) *Constant_Uint64Value { this := &Constant_Uint64Value{} this.Uint64Value = uint64(uint64(r.Uint32())) return this } func NewPopulatedConstant_DoubleValue(r randySyntax, easy bool) *Constant_DoubleValue { this := &Constant_DoubleValue{} this.DoubleValue = float64(r.Float64()) if r.Intn(2) == 0 { this.DoubleValue *= -1 } return this } func NewPopulatedConstant_StringValue(r randySyntax, easy bool) *Constant_StringValue { this := &Constant_StringValue{} this.StringValue = string(randStringSyntax(r)) return this } func NewPopulatedConstant_BytesValue(r randySyntax, easy bool) *Constant_BytesValue { this := &Constant_BytesValue{} v4 := r.Intn(100) this.BytesValue = make([]byte, v4) for i := 0; i < v4; i++ { this.BytesValue[i] = byte(r.Intn(256)) } return this } func NewPopulatedConstant_DurationValue(r randySyntax, easy bool) *Constant_DurationValue { this := &Constant_DurationValue{} this.DurationValue = types.NewPopulatedDuration(r, easy) return this } func NewPopulatedConstant_TimestampValue(r randySyntax, easy bool) *Constant_TimestampValue { this := &Constant_TimestampValue{} this.TimestampValue = types.NewPopulatedTimestamp(r, easy) return this } func NewPopulatedSourceInfo(r randySyntax, easy bool) *SourceInfo { this := &SourceInfo{} this.SyntaxVersion = string(randStringSyntax(r)) this.Location = string(randStringSyntax(r)) v5 := r.Intn(10) this.LineOffsets = make([]int32, v5) for i := 0; i < v5; i++ { this.LineOffsets[i] = int32(r.Int31()) if r.Intn(2) == 0 { this.LineOffsets[i] *= -1 } } if r.Intn(5) != 0 { v6 := r.Intn(10) this.Positions = make(map[int64]int32) for i := 0; i < v6; i++ { v7 := int64(r.Int63()) this.Positions[v7] = int32(r.Int31()) if r.Intn(2) == 0 { this.Positions[v7] *= -1 } } } if r.Intn(5) == 0 { v8 := r.Intn(10) this.MacroCalls = make(map[int64]*Expr) for i := 0; i < v8; i++ { this.MacroCalls[int64(r.Int63())] = NewPopulatedExpr(r, easy) } } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedSyntax(r, 6) } return this } func NewPopulatedSourcePosition(r randySyntax, easy bool) *SourcePosition { this := &SourcePosition{} this.Location = string(randStringSyntax(r)) this.Offset = int32(r.Int31()) if r.Intn(2) == 0 { this.Offset *= -1 } this.Line = int32(r.Int31()) if r.Intn(2) == 0 { this.Line *= -1 } this.Column = int32(r.Int31()) if r.Intn(2) == 0 { this.Column *= -1 } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedSyntax(r, 5) } return this } type randySyntax interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneSyntax(r randySyntax) 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 randStringSyntax(r randySyntax) string { v9 := r.Intn(100) tmps := make([]rune, v9) for i := 0; i < v9; i++ { tmps[i] = randUTF8RuneSyntax(r) } return string(tmps) } func randUnrecognizedSyntax(r randySyntax, 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 = randFieldSyntax(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldSyntax(dAtA []byte, r randySyntax, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateSyntax(dAtA, uint64(key)) v10 := r.Int63() if r.Intn(2) == 0 { v10 *= -1 } dAtA = encodeVarintPopulateSyntax(dAtA, uint64(v10)) case 1: dAtA = encodeVarintPopulateSyntax(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 = encodeVarintPopulateSyntax(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateSyntax(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateSyntax(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 encodeVarintPopulateSyntax(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 *ParsedExpr) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Expr != nil { l = m.Expr.Size() n += 1 + l + sovSyntax(uint64(l)) } if m.SourceInfo != nil { l = m.SourceInfo.Size() n += 1 + l + sovSyntax(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Expr) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Id != 0 { n += 1 + sovSyntax(uint64(m.Id)) } if m.ExprKind != nil { n += m.ExprKind.Size() } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Expr_ConstExpr) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.ConstExpr != nil { l = m.ConstExpr.Size() n += 1 + l + sovSyntax(uint64(l)) } return n } func (m *Expr_IdentExpr) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.IdentExpr != nil { l = m.IdentExpr.Size() n += 1 + l + sovSyntax(uint64(l)) } return n } func (m *Expr_SelectExpr) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.SelectExpr != nil { l = m.SelectExpr.Size() n += 1 + l + sovSyntax(uint64(l)) } return n } func (m *Expr_CallExpr) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.CallExpr != nil { l = m.CallExpr.Size() n += 1 + l + sovSyntax(uint64(l)) } return n } func (m *Expr_ListExpr) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.ListExpr != nil { l = m.ListExpr.Size() n += 1 + l + sovSyntax(uint64(l)) } return n } func (m *Expr_StructExpr) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.StructExpr != nil { l = m.StructExpr.Size() n += 1 + l + sovSyntax(uint64(l)) } return n } func (m *Expr_ComprehensionExpr) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.ComprehensionExpr != nil { l = m.ComprehensionExpr.Size() n += 1 + l + sovSyntax(uint64(l)) } return n } func (m *Expr_Ident) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovSyntax(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Expr_Select) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Operand != nil { l = m.Operand.Size() n += 1 + l + sovSyntax(uint64(l)) } l = len(m.Field) if l > 0 { n += 1 + l + sovSyntax(uint64(l)) } if m.TestOnly { n += 2 } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Expr_Call) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Target != nil { l = m.Target.Size() n += 1 + l + sovSyntax(uint64(l)) } l = len(m.Function) if l > 0 { n += 1 + l + sovSyntax(uint64(l)) } if len(m.Args) > 0 { for _, e := range m.Args { l = e.Size() n += 1 + l + sovSyntax(uint64(l)) } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Expr_CreateList) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Elements) > 0 { for _, e := range m.Elements { l = e.Size() n += 1 + l + sovSyntax(uint64(l)) } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Expr_CreateStruct) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.MessageName) if l > 0 { n += 1 + l + sovSyntax(uint64(l)) } if len(m.Entries) > 0 { for _, e := range m.Entries { l = e.Size() n += 1 + l + sovSyntax(uint64(l)) } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Expr_CreateStruct_Entry) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Id != 0 { n += 1 + sovSyntax(uint64(m.Id)) } if m.KeyKind != nil { n += m.KeyKind.Size() } if m.Value != nil { l = m.Value.Size() n += 1 + l + sovSyntax(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Expr_CreateStruct_Entry_FieldKey) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.FieldKey) n += 1 + l + sovSyntax(uint64(l)) return n } func (m *Expr_CreateStruct_Entry_MapKey) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.MapKey != nil { l = m.MapKey.Size() n += 1 + l + sovSyntax(uint64(l)) } return n } func (m *Expr_Comprehension) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.IterVar) if l > 0 { n += 1 + l + sovSyntax(uint64(l)) } if m.IterRange != nil { l = m.IterRange.Size() n += 1 + l + sovSyntax(uint64(l)) } l = len(m.AccuVar) if l > 0 { n += 1 + l + sovSyntax(uint64(l)) } if m.AccuInit != nil { l = m.AccuInit.Size() n += 1 + l + sovSyntax(uint64(l)) } if m.LoopCondition != nil { l = m.LoopCondition.Size() n += 1 + l + sovSyntax(uint64(l)) } if m.LoopStep != nil { l = m.LoopStep.Size() n += 1 + l + sovSyntax(uint64(l)) } if m.Result != nil { l = m.Result.Size() n += 1 + l + sovSyntax(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Constant) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.ConstantKind != nil { n += m.ConstantKind.Size() } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Constant_NullValue) Size() (n int) { if m == nil { return 0 } var l int _ = l n += 1 + sovSyntax(uint64(m.NullValue)) return n } func (m *Constant_BoolValue) Size() (n int) { if m == nil { return 0 } var l int _ = l n += 2 return n } func (m *Constant_Int64Value) Size() (n int) { if m == nil { return 0 } var l int _ = l n += 1 + sovSyntax(uint64(m.Int64Value)) return n } func (m *Constant_Uint64Value) Size() (n int) { if m == nil { return 0 } var l int _ = l n += 1 + sovSyntax(uint64(m.Uint64Value)) return n } func (m *Constant_DoubleValue) Size() (n int) { if m == nil { return 0 } var l int _ = l n += 9 return n } func (m *Constant_StringValue) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.StringValue) n += 1 + l + sovSyntax(uint64(l)) return n } func (m *Constant_BytesValue) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.BytesValue != nil { l = len(m.BytesValue) n += 1 + l + sovSyntax(uint64(l)) } return n } func (m *Constant_DurationValue) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.DurationValue != nil { l = m.DurationValue.Size() n += 1 + l + sovSyntax(uint64(l)) } return n } func (m *Constant_TimestampValue) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.TimestampValue != nil { l = m.TimestampValue.Size() n += 1 + l + sovSyntax(uint64(l)) } return n } func (m *SourceInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.SyntaxVersion) if l > 0 { n += 1 + l + sovSyntax(uint64(l)) } l = len(m.Location) if l > 0 { n += 1 + l + sovSyntax(uint64(l)) } if len(m.LineOffsets) > 0 { l = 0 for _, e := range m.LineOffsets { l += sovSyntax(uint64(e)) } n += 1 + sovSyntax(uint64(l)) + l } if len(m.Positions) > 0 { for k, v := range m.Positions { _ = k _ = v mapEntrySize := 1 + sovSyntax(uint64(k)) + 1 + sovSyntax(uint64(v)) n += mapEntrySize + 1 + sovSyntax(uint64(mapEntrySize)) } } if len(m.MacroCalls) > 0 { for k, v := range m.MacroCalls { _ = k _ = v l = 0 if v != nil { l = v.Size() l += 1 + sovSyntax(uint64(l)) } mapEntrySize := 1 + sovSyntax(uint64(k)) + l n += mapEntrySize + 1 + sovSyntax(uint64(mapEntrySize)) } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *SourcePosition) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Location) if l > 0 { n += 1 + l + sovSyntax(uint64(l)) } if m.Offset != 0 { n += 1 + sovSyntax(uint64(m.Offset)) } if m.Line != 0 { n += 1 + sovSyntax(uint64(m.Line)) } if m.Column != 0 { n += 1 + sovSyntax(uint64(m.Column)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovSyntax(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozSyntax(x uint64) (n int) { return sovSyntax(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *ParsedExpr) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ParsedExpr{`, `Expr:` + strings.Replace(this.Expr.String(), "Expr", "Expr", 1) + `,`, `SourceInfo:` + strings.Replace(this.SourceInfo.String(), "SourceInfo", "SourceInfo", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *Expr) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Expr{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `ExprKind:` + fmt.Sprintf("%v", this.ExprKind) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *Expr_ConstExpr) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Expr_ConstExpr{`, `ConstExpr:` + strings.Replace(fmt.Sprintf("%v", this.ConstExpr), "Constant", "Constant", 1) + `,`, `}`, }, "") return s } func (this *Expr_IdentExpr) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Expr_IdentExpr{`, `IdentExpr:` + strings.Replace(fmt.Sprintf("%v", this.IdentExpr), "Expr_Ident", "Expr_Ident", 1) + `,`, `}`, }, "") return s } func (this *Expr_SelectExpr) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Expr_SelectExpr{`, `SelectExpr:` + strings.Replace(fmt.Sprintf("%v", this.SelectExpr), "Expr_Select", "Expr_Select", 1) + `,`, `}`, }, "") return s } func (this *Expr_CallExpr) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Expr_CallExpr{`, `CallExpr:` + strings.Replace(fmt.Sprintf("%v", this.CallExpr), "Expr_Call", "Expr_Call", 1) + `,`, `}`, }, "") return s } func (this *Expr_ListExpr) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Expr_ListExpr{`, `ListExpr:` + strings.Replace(fmt.Sprintf("%v", this.ListExpr), "Expr_CreateList", "Expr_CreateList", 1) + `,`, `}`, }, "") return s } func (this *Expr_StructExpr) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Expr_StructExpr{`, `StructExpr:` + strings.Replace(fmt.Sprintf("%v", this.StructExpr), "Expr_CreateStruct", "Expr_CreateStruct", 1) + `,`, `}`, }, "") return s } func (this *Expr_ComprehensionExpr) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Expr_ComprehensionExpr{`, `ComprehensionExpr:` + strings.Replace(fmt.Sprintf("%v", this.ComprehensionExpr), "Expr_Comprehension", "Expr_Comprehension", 1) + `,`, `}`, }, "") return s } func (this *Expr_Ident) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Expr_Ident{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *Expr_Select) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Expr_Select{`, `Operand:` + strings.Replace(this.Operand.String(), "Expr", "Expr", 1) + `,`, `Field:` + fmt.Sprintf("%v", this.Field) + `,`, `TestOnly:` + fmt.Sprintf("%v", this.TestOnly) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *Expr_Call) String() string { if this == nil { return "nil" } repeatedStringForArgs := "[]*Expr{" for _, f := range this.Args { repeatedStringForArgs += strings.Replace(f.String(), "Expr", "Expr", 1) + "," } repeatedStringForArgs += "}" s := strings.Join([]string{`&Expr_Call{`, `Target:` + strings.Replace(this.Target.String(), "Expr", "Expr", 1) + `,`, `Function:` + fmt.Sprintf("%v", this.Function) + `,`, `Args:` + repeatedStringForArgs + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *Expr_CreateList) String() string { if this == nil { return "nil" } repeatedStringForElements := "[]*Expr{" for _, f := range this.Elements { repeatedStringForElements += strings.Replace(f.String(), "Expr", "Expr", 1) + "," } repeatedStringForElements += "}" s := strings.Join([]string{`&Expr_CreateList{`, `Elements:` + repeatedStringForElements + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *Expr_CreateStruct) String() string { if this == nil { return "nil" } repeatedStringForEntries := "[]*Expr_CreateStruct_Entry{" for _, f := range this.Entries { repeatedStringForEntries += strings.Replace(fmt.Sprintf("%v", f), "Expr_CreateStruct_Entry", "Expr_CreateStruct_Entry", 1) + "," } repeatedStringForEntries += "}" s := strings.Join([]string{`&Expr_CreateStruct{`, `MessageName:` + fmt.Sprintf("%v", this.MessageName) + `,`, `Entries:` + repeatedStringForEntries + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *Expr_CreateStruct_Entry) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Expr_CreateStruct_Entry{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `KeyKind:` + fmt.Sprintf("%v", this.KeyKind) + `,`, `Value:` + strings.Replace(this.Value.String(), "Expr", "Expr", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *Expr_CreateStruct_Entry_FieldKey) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Expr_CreateStruct_Entry_FieldKey{`, `FieldKey:` + fmt.Sprintf("%v", this.FieldKey) + `,`, `}`, }, "") return s } func (this *Expr_CreateStruct_Entry_MapKey) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Expr_CreateStruct_Entry_MapKey{`, `MapKey:` + strings.Replace(fmt.Sprintf("%v", this.MapKey), "Expr", "Expr", 1) + `,`, `}`, }, "") return s } func (this *Expr_Comprehension) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Expr_Comprehension{`, `IterVar:` + fmt.Sprintf("%v", this.IterVar) + `,`, `IterRange:` + strings.Replace(this.IterRange.String(), "Expr", "Expr", 1) + `,`, `AccuVar:` + fmt.Sprintf("%v", this.AccuVar) + `,`, `AccuInit:` + strings.Replace(this.AccuInit.String(), "Expr", "Expr", 1) + `,`, `LoopCondition:` + strings.Replace(this.LoopCondition.String(), "Expr", "Expr", 1) + `,`, `LoopStep:` + strings.Replace(this.LoopStep.String(), "Expr", "Expr", 1) + `,`, `Result:` + strings.Replace(this.Result.String(), "Expr", "Expr", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *Constant) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Constant{`, `ConstantKind:` + fmt.Sprintf("%v", this.ConstantKind) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *Constant_NullValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Constant_NullValue{`, `NullValue:` + fmt.Sprintf("%v", this.NullValue) + `,`, `}`, }, "") return s } func (this *Constant_BoolValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Constant_BoolValue{`, `BoolValue:` + fmt.Sprintf("%v", this.BoolValue) + `,`, `}`, }, "") return s } func (this *Constant_Int64Value) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Constant_Int64Value{`, `Int64Value:` + fmt.Sprintf("%v", this.Int64Value) + `,`, `}`, }, "") return s } func (this *Constant_Uint64Value) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Constant_Uint64Value{`, `Uint64Value:` + fmt.Sprintf("%v", this.Uint64Value) + `,`, `}`, }, "") return s } func (this *Constant_DoubleValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Constant_DoubleValue{`, `DoubleValue:` + fmt.Sprintf("%v", this.DoubleValue) + `,`, `}`, }, "") return s } func (this *Constant_StringValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Constant_StringValue{`, `StringValue:` + fmt.Sprintf("%v", this.StringValue) + `,`, `}`, }, "") return s } func (this *Constant_BytesValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Constant_BytesValue{`, `BytesValue:` + fmt.Sprintf("%v", this.BytesValue) + `,`, `}`, }, "") return s } func (this *Constant_DurationValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Constant_DurationValue{`, `DurationValue:` + strings.Replace(fmt.Sprintf("%v", this.DurationValue), "Duration", "types.Duration", 1) + `,`, `}`, }, "") return s } func (this *Constant_TimestampValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Constant_TimestampValue{`, `TimestampValue:` + strings.Replace(fmt.Sprintf("%v", this.TimestampValue), "Timestamp", "types.Timestamp", 1) + `,`, `}`, }, "") return s } func (this *SourceInfo) String() string { if this == nil { return "nil" } keysForPositions := make([]int64, 0, len(this.Positions)) for k, _ := range this.Positions { keysForPositions = append(keysForPositions, k) } github_com_gogo_protobuf_sortkeys.Int64s(keysForPositions) mapStringForPositions := "map[int64]int32{" for _, k := range keysForPositions { mapStringForPositions += fmt.Sprintf("%v: %v,", k, this.Positions[k]) } mapStringForPositions += "}" keysForMacroCalls := make([]int64, 0, len(this.MacroCalls)) for k, _ := range this.MacroCalls { keysForMacroCalls = append(keysForMacroCalls, k) } github_com_gogo_protobuf_sortkeys.Int64s(keysForMacroCalls) mapStringForMacroCalls := "map[int64]*Expr{" for _, k := range keysForMacroCalls { mapStringForMacroCalls += fmt.Sprintf("%v: %v,", k, this.MacroCalls[k]) } mapStringForMacroCalls += "}" s := strings.Join([]string{`&SourceInfo{`, `SyntaxVersion:` + fmt.Sprintf("%v", this.SyntaxVersion) + `,`, `Location:` + fmt.Sprintf("%v", this.Location) + `,`, `LineOffsets:` + fmt.Sprintf("%v", this.LineOffsets) + `,`, `Positions:` + mapStringForPositions + `,`, `MacroCalls:` + mapStringForMacroCalls + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *SourcePosition) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&SourcePosition{`, `Location:` + fmt.Sprintf("%v", this.Location) + `,`, `Offset:` + fmt.Sprintf("%v", this.Offset) + `,`, `Line:` + fmt.Sprintf("%v", this.Line) + `,`, `Column:` + fmt.Sprintf("%v", this.Column) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringSyntax(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *ParsedExpr) 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 ErrIntOverflowSyntax } 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: ParsedExpr: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ParsedExpr: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Expr", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } if m.Expr == nil { m.Expr = &Expr{} } if err := m.Expr.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SourceInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } if m.SourceInfo == nil { m.SourceInfo = &SourceInfo{} } if err := m.SourceInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSyntax(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSyntax } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSyntax } 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 (m *Expr) 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 ErrIntOverflowSyntax } 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: Expr: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Expr: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Id |= int64(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ConstExpr", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } v := &Constant{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.ExprKind = &Expr_ConstExpr{v} iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field IdentExpr", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } v := &Expr_Ident{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.ExprKind = &Expr_IdentExpr{v} iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SelectExpr", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } v := &Expr_Select{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.ExprKind = &Expr_SelectExpr{v} iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CallExpr", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } v := &Expr_Call{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.ExprKind = &Expr_CallExpr{v} iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ListExpr", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } v := &Expr_CreateList{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.ExprKind = &Expr_ListExpr{v} iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StructExpr", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } v := &Expr_CreateStruct{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.ExprKind = &Expr_StructExpr{v} iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ComprehensionExpr", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } v := &Expr_Comprehension{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.ExprKind = &Expr_ComprehensionExpr{v} iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSyntax(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSyntax } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSyntax } 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 (m *Expr_Ident) 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 ErrIntOverflowSyntax } 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: Ident: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Ident: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSyntax(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSyntax } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSyntax } 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 (m *Expr_Select) 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 ErrIntOverflowSyntax } 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: Select: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Select: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Operand", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } if m.Operand == nil { m.Operand = &Expr{} } if err := m.Operand.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } m.Field = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field TestOnly", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.TestOnly = bool(v != 0) default: iNdEx = preIndex skippy, err := skipSyntax(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSyntax } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSyntax } 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 (m *Expr_Call) 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 ErrIntOverflowSyntax } 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: Call: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Call: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } if m.Target == nil { m.Target = &Expr{} } if err := m.Target.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Function", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } m.Function = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } m.Args = append(m.Args, &Expr{}) if err := m.Args[len(m.Args)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSyntax(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSyntax } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSyntax } 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 (m *Expr_CreateList) 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 ErrIntOverflowSyntax } 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: CreateList: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CreateList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Elements", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } m.Elements = append(m.Elements, &Expr{}) if err := m.Elements[len(m.Elements)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSyntax(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSyntax } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSyntax } 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 (m *Expr_CreateStruct) 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 ErrIntOverflowSyntax } 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: CreateStruct: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CreateStruct: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MessageName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } m.MessageName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } m.Entries = append(m.Entries, &Expr_CreateStruct_Entry{}) if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSyntax(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSyntax } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSyntax } 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 (m *Expr_CreateStruct_Entry) 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 ErrIntOverflowSyntax } 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: Entry: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Entry: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Id |= int64(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FieldKey", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } m.KeyKind = &Expr_CreateStruct_Entry_FieldKey{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MapKey", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } v := &Expr{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.KeyKind = &Expr_CreateStruct_Entry_MapKey{v} iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } if m.Value == nil { m.Value = &Expr{} } if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSyntax(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSyntax } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSyntax } 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 (m *Expr_Comprehension) 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 ErrIntOverflowSyntax } 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: Comprehension: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Comprehension: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field IterVar", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } m.IterVar = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field IterRange", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } if m.IterRange == nil { m.IterRange = &Expr{} } if err := m.IterRange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AccuVar", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } m.AccuVar = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AccuInit", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } if m.AccuInit == nil { m.AccuInit = &Expr{} } if err := m.AccuInit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LoopCondition", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } if m.LoopCondition == nil { m.LoopCondition = &Expr{} } if err := m.LoopCondition.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LoopStep", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } if m.LoopStep == nil { m.LoopStep = &Expr{} } if err := m.LoopStep.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } if m.Result == nil { m.Result = &Expr{} } if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSyntax(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSyntax } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSyntax } 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 (m *Constant) 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 ErrIntOverflowSyntax } 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: Constant: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Constant: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field NullValue", wireType) } var v types.NullValue for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= types.NullValue(b&0x7F) << shift if b < 0x80 { break } } m.ConstantKind = &Constant_NullValue{v} case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field BoolValue", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } b := bool(v != 0) m.ConstantKind = &Constant_BoolValue{b} case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Int64Value", wireType) } var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int64(b&0x7F) << shift if b < 0x80 { break } } m.ConstantKind = &Constant_Int64Value{v} case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Uint64Value", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= uint64(b&0x7F) << shift if b < 0x80 { break } } m.ConstantKind = &Constant_Uint64Value{v} case 5: if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field DoubleValue", wireType) } var v uint64 if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 m.ConstantKind = &Constant_DoubleValue{float64(math.Float64frombits(v))} case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StringValue", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } m.ConstantKind = &Constant_StringValue{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BytesValue", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } v := make([]byte, postIndex-iNdEx) copy(v, dAtA[iNdEx:postIndex]) m.ConstantKind = &Constant_BytesValue{v} iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DurationValue", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } v := &types.Duration{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.ConstantKind = &Constant_DurationValue{v} iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TimestampValue", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } v := &types.Timestamp{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.ConstantKind = &Constant_TimestampValue{v} iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSyntax(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSyntax } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSyntax } 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 (m *SourceInfo) 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 ErrIntOverflowSyntax } 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: SourceInfo: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: SourceInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SyntaxVersion", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } m.SyntaxVersion = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Location", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } m.Location = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType == 0 { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int32(b&0x7F) << shift if b < 0x80 { break } } m.LineOffsets = append(m.LineOffsets, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ packedLen |= int(b&0x7F) << shift if b < 0x80 { break } } if packedLen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + packedLen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } var elementCount int var count int for _, integer := range dAtA[iNdEx:postIndex] { if integer < 128 { count++ } } elementCount = count if elementCount != 0 && len(m.LineOffsets) == 0 { m.LineOffsets = make([]int32, 0, elementCount) } for iNdEx < postIndex { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int32(b&0x7F) << shift if b < 0x80 { break } } m.LineOffsets = append(m.LineOffsets, v) } } else { return fmt.Errorf("proto: wrong wireType = %d for field LineOffsets", wireType) } case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Positions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } if m.Positions == nil { m.Positions = make(map[int64]int32) } var mapkey int64 var mapvalue int32 for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ mapkey |= int64(b&0x7F) << shift if b < 0x80 { break } } } else if fieldNum == 2 { for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ mapvalue |= int32(b&0x7F) << shift if b < 0x80 { break } } } else { iNdEx = entryPreIndex skippy, err := skipSyntax(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSyntax } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Positions[mapkey] = mapvalue iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MacroCalls", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } if m.MacroCalls == nil { m.MacroCalls = make(map[int64]*Expr) } var mapkey int64 var mapvalue *Expr for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ mapkey |= int64(b&0x7F) << shift if b < 0x80 { break } } } else if fieldNum == 2 { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ mapmsglen |= int(b&0x7F) << shift if b < 0x80 { break } } if mapmsglen < 0 { return ErrInvalidLengthSyntax } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { return ErrInvalidLengthSyntax } if postmsgIndex > l { return io.ErrUnexpectedEOF } mapvalue = &Expr{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } iNdEx = postmsgIndex } else { iNdEx = entryPreIndex skippy, err := skipSyntax(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSyntax } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.MacroCalls[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSyntax(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSyntax } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSyntax } 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 (m *SourcePosition) 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 ErrIntOverflowSyntax } 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: SourcePosition: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: SourcePosition: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Location", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthSyntax } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthSyntax } if postIndex > l { return io.ErrUnexpectedEOF } m.Location = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) } m.Offset = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Offset |= int32(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Line", wireType) } m.Line = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Line |= int32(b&0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Column", wireType) } m.Column = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowSyntax } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Column |= int32(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipSyntax(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthSyntax } if (iNdEx + skippy) < 0 { return ErrInvalidLengthSyntax } 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 skipSyntax(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, ErrIntOverflowSyntax } 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, ErrIntOverflowSyntax } 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, ErrIntOverflowSyntax } 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, ErrInvalidLengthSyntax } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupSyntax } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthSyntax } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthSyntax = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowSyntax = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupSyntax = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/api/expr/v1alpha1/syntax.proto000066400000000000000000000256131365205541600227160ustar00rootroot00000000000000// 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. // 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.api.expr.v1alpha1; import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; option cc_enable_arenas = true; option go_package = "expr"; option java_multiple_files = true; option java_outer_classname = "SyntaxProto"; option java_package = "com.google.api.expr.v1alpha1"; // A representation of the abstract syntax of the Common Expression Language. // An expression together with source information as returned by the parser. message ParsedExpr { // The parsed expression. Expr expr = 2; // The source info derived from input that generated the parsed `expr`. SourceInfo source_info = 3; } // An abstract representation of a common expression. // // Expressions are abstractly represented as a collection of identifiers, // select statements, function calls, literals, and comprehensions. All // operators with the exception of the '.' operator are modelled as function // calls. This makes it easy to represent new operators into the existing AST. // // All references within expressions must resolve to a [Decl][google.api.expr.v1alpha1.Decl] provided at // type-check for an expression to be valid. A reference may either be a bare // identifier `name` or a qualified identifier `google.api.name`. References // may either refer to a value or a function declaration. // // For example, the expression `google.api.name.startsWith('expr')` references // the declaration `google.api.name` within a [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression, and // the function declaration `startsWith`. message Expr { // An identifier expression. e.g. `request`. message Ident { // Required. Holds a single, unqualified identifier, possibly preceded by a // '.'. // // Qualified names are represented by the [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression. string name = 1; } // A field selection expression. e.g. `request.auth`. message Select { // Required. The target of the selection expression. // // For example, in the select expression `request.auth`, the `request` // portion of the expression is the `operand`. Expr operand = 1; // Required. The name of the field to select. // // For example, in the select expression `request.auth`, the `auth` portion // of the expression would be the `field`. string field = 2; // Whether the select is to be interpreted as a field presence test. // // This results from the macro `has(request.auth)`. bool test_only = 3; } // A call expression, including calls to predefined functions and operators. // // For example, `value == 10`, `size(map_value)`. message Call { // The target of an method call-style expression. For example, `x` in // `x.f()`. Expr target = 1; // Required. The name of the function or method being called. string function = 2; // The arguments. repeated Expr args = 3; } // A list creation expression. // // Lists may either be homogenous, e.g. `[1, 2, 3]`, or heterogenous, e.g. // `dyn([1, 'hello', 2.0])` message CreateList { // The elements part of the list. repeated Expr elements = 1; } // A map or message creation expression. // // Maps are constructed as `{'key_name': 'value'}`. Message construction is // similar, but prefixed with a type name and composed of field ids: // `types.MyType{field_id: 'value'}`. message CreateStruct { // Represents an entry. message Entry { // Required. An id assigned to this node by the parser which is unique // in a given expression tree. This is used to associate type // information and other attributes to the node. int64 id = 1; // The `Entry` key kinds. oneof key_kind { // The field key for a message creator statement. string field_key = 2; // The key expression for a map creation statement. Expr map_key = 3; } // Required. The value assigned to the key. Expr value = 4; } // The type name of the message to be created, empty when creating map // literals. string message_name = 1; // The entries in the creation expression. repeated Entry entries = 2; } // A comprehension expression applied to a list or map. // // Comprehensions are not part of the core syntax, but enabled with macros. // A macro matches a specific call signature within a parsed AST and replaces // the call with an alternate AST block. Macro expansion happens at parse // time. // // The following macros are supported within CEL: // // Aggregate type macros may be applied to all elements in a list or all keys // in a map: // // * `all`, `exists`, `exists_one` - test a predicate expression against // the inputs and return `true` if the predicate is satisfied for all, // any, or only one value `list.all(x, x < 10)`. // * `filter` - test a predicate expression against the inputs and return // the subset of elements which satisfy the predicate: // `payments.filter(p, p > 1000)`. // * `map` - apply an expression to all elements in the input and return the // output aggregate type: `[1, 2, 3].map(i, i * i)`. // // The `has(m.x)` macro tests whether the property `x` is present in struct // `m`. The semantics of this macro depend on the type of `m`. For proto2 // messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the // macro tests whether the property is set to its default. For map and struct // types, the macro tests whether the property `x` is defined on `m`. message Comprehension { // The name of the iteration variable. string iter_var = 1; // The range over which var iterates. Expr iter_range = 2; // The name of the variable used for accumulation of the result. string accu_var = 3; // The initial value of the accumulator. Expr accu_init = 4; // An expression which can contain iter_var and accu_var. // // Returns false when the result has been computed and may be used as // a hint to short-circuit the remainder of the comprehension. Expr loop_condition = 5; // An expression which can contain iter_var and accu_var. // // Computes the next value of accu_var. Expr loop_step = 6; // An expression which can contain accu_var. // // Computes the result. Expr result = 7; } // Required. An id assigned to this node by the parser which is unique in a // given expression tree. This is used to associate type information and other // attributes to a node in the parse tree. int64 id = 2; // Required. Variants of expressions. oneof expr_kind { // A literal expression. Constant const_expr = 3; // An identifier expression. Ident ident_expr = 4; // A field selection expression, e.g. `request.auth`. Select select_expr = 5; // A call expression, including calls to predefined functions and operators. Call call_expr = 6; // A list creation expression. CreateList list_expr = 7; // A map or message creation expression. CreateStruct struct_expr = 8; // A comprehension expression. Comprehension comprehension_expr = 9; } } // Represents a primitive literal. // // Named 'Constant' here for backwards compatibility. // // This is similar as the primitives supported in the well-known type // `google.protobuf.Value`, but richer so it can represent CEL's full range of // primitives. // // Lists and structs are not included as constants as these aggregate types may // contain [Expr][google.api.expr.v1alpha1.Expr] elements which require evaluation and are thus not constant. // // Examples of literals include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`, // `true`, `null`. message Constant { // Required. The valid constant kinds. oneof constant_kind { // null value. google.protobuf.NullValue null_value = 1; // boolean value. bool bool_value = 2; // int64 value. int64 int64_value = 3; // uint64 value. uint64 uint64_value = 4; // double value. double double_value = 5; // string value. string string_value = 6; // bytes value. bytes bytes_value = 7; // protobuf.Duration value. // // Deprecated: duration is no longer considered a builtin cel type. google.protobuf.Duration duration_value = 8 [deprecated = true]; // protobuf.Timestamp value. // // Deprecated: timestamp is no longer considered a builtin cel type. google.protobuf.Timestamp timestamp_value = 9 [deprecated = true]; } } // Source information collected at parse time. message SourceInfo { // The syntax version of the source, e.g. `cel1`. string syntax_version = 1; // The location name. All position information attached to an expression is // relative to this location. // // The location could be a file, UI element, or similar. For example, // `acme/app/AnvilPolicy.cel`. string location = 2; // Monotonically increasing list of character offsets where newlines appear. // // The line number of a given position is the index `i` where for a given // `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The // column may be derivd from `id_positions[id] - line_offsets[i]`. repeated int32 line_offsets = 3; // A map from the parse node id (e.g. `Expr.id`) to the character offset // within source. map positions = 4; // A map from the parse node id where a macro replacement was made to the // call `Expr` that resulted in a macro expansion. // // For example, `has(value.field)` is a function call that is replaced by a // `test_only` field selection in the AST. Likewise, the call // `list.exists(e, e > 10)` translates to a comprehension expression. The key // in the map corresponds to the expression id of the expanded macro, and the // value is the call `Expr` that was replaced. map macro_calls = 5; } // A specific position in source. message SourcePosition { // The soucre location name (e.g. file name). string location = 1; // The character offset. int32 offset = 2; // The 1-based index of the starting line in the source text // where the issue occurs, or 0 if unknown. int32 line = 3; // The 0-based index of the starting position within the line of source text // where the issue occurs. Only meaningful if line is nonzero. int32 column = 4; } googleapis-1.4.0/google/api/expr/v1alpha1/value.pb.go000066400000000000000000002170001365205541600223370ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/api/expr/v1alpha1/value.proto package expr import ( bytes "bytes" encoding_binary "encoding/binary" fmt "fmt" proto "github.com/gogo/protobuf/proto" types "github.com/gogo/protobuf/types" 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 // Represents a CEL value. // // This is similar to `google.protobuf.Value`, but can represent CEL's full // range of values. type Value struct { // Required. The valid kinds of values. // // Types that are valid to be assigned to Kind: // *Value_NullValue // *Value_BoolValue // *Value_Int64Value // *Value_Uint64Value // *Value_DoubleValue // *Value_StringValue // *Value_BytesValue // *Value_EnumValue // *Value_ObjectValue // *Value_MapValue // *Value_ListValue // *Value_TypeValue Kind isValue_Kind `protobuf_oneof:"kind"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Value) Reset() { *m = Value{} } func (*Value) ProtoMessage() {} func (*Value) Descriptor() ([]byte, []int) { return fileDescriptor_24bee359d1e5798a, []int{0} } func (m *Value) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Value.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 *Value) XXX_Merge(src proto.Message) { xxx_messageInfo_Value.Merge(m, src) } func (m *Value) XXX_Size() int { return m.Size() } func (m *Value) XXX_DiscardUnknown() { xxx_messageInfo_Value.DiscardUnknown(m) } var xxx_messageInfo_Value proto.InternalMessageInfo type isValue_Kind interface { isValue_Kind() Equal(interface{}) bool MarshalTo([]byte) (int, error) Size() int } type Value_NullValue struct { NullValue types.NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof" json:"null_value,omitempty"` } type Value_BoolValue struct { BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof" json:"bool_value,omitempty"` } type Value_Int64Value struct { Int64Value int64 `protobuf:"varint,3,opt,name=int64_value,json=int64Value,proto3,oneof" json:"int64_value,omitempty"` } type Value_Uint64Value struct { Uint64Value uint64 `protobuf:"varint,4,opt,name=uint64_value,json=uint64Value,proto3,oneof" json:"uint64_value,omitempty"` } type Value_DoubleValue struct { DoubleValue float64 `protobuf:"fixed64,5,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` } type Value_StringValue struct { StringValue string `protobuf:"bytes,6,opt,name=string_value,json=stringValue,proto3,oneof" json:"string_value,omitempty"` } type Value_BytesValue struct { BytesValue []byte `protobuf:"bytes,7,opt,name=bytes_value,json=bytesValue,proto3,oneof" json:"bytes_value,omitempty"` } type Value_EnumValue struct { EnumValue *EnumValue `protobuf:"bytes,9,opt,name=enum_value,json=enumValue,proto3,oneof" json:"enum_value,omitempty"` } type Value_ObjectValue struct { ObjectValue *types.Any `protobuf:"bytes,10,opt,name=object_value,json=objectValue,proto3,oneof" json:"object_value,omitempty"` } type Value_MapValue struct { MapValue *MapValue `protobuf:"bytes,11,opt,name=map_value,json=mapValue,proto3,oneof" json:"map_value,omitempty"` } type Value_ListValue struct { ListValue *ListValue `protobuf:"bytes,12,opt,name=list_value,json=listValue,proto3,oneof" json:"list_value,omitempty"` } type Value_TypeValue struct { TypeValue string `protobuf:"bytes,15,opt,name=type_value,json=typeValue,proto3,oneof" json:"type_value,omitempty"` } func (*Value_NullValue) isValue_Kind() {} func (*Value_BoolValue) isValue_Kind() {} func (*Value_Int64Value) isValue_Kind() {} func (*Value_Uint64Value) isValue_Kind() {} func (*Value_DoubleValue) isValue_Kind() {} func (*Value_StringValue) isValue_Kind() {} func (*Value_BytesValue) isValue_Kind() {} func (*Value_EnumValue) isValue_Kind() {} func (*Value_ObjectValue) isValue_Kind() {} func (*Value_MapValue) isValue_Kind() {} func (*Value_ListValue) isValue_Kind() {} func (*Value_TypeValue) isValue_Kind() {} func (m *Value) GetKind() isValue_Kind { if m != nil { return m.Kind } return nil } func (m *Value) GetNullValue() types.NullValue { if x, ok := m.GetKind().(*Value_NullValue); ok { return x.NullValue } return types.NullValue_NULL_VALUE } func (m *Value) GetBoolValue() bool { if x, ok := m.GetKind().(*Value_BoolValue); ok { return x.BoolValue } return false } func (m *Value) GetInt64Value() int64 { if x, ok := m.GetKind().(*Value_Int64Value); ok { return x.Int64Value } return 0 } func (m *Value) GetUint64Value() uint64 { if x, ok := m.GetKind().(*Value_Uint64Value); ok { return x.Uint64Value } return 0 } func (m *Value) GetDoubleValue() float64 { if x, ok := m.GetKind().(*Value_DoubleValue); ok { return x.DoubleValue } return 0 } func (m *Value) GetStringValue() string { if x, ok := m.GetKind().(*Value_StringValue); ok { return x.StringValue } return "" } func (m *Value) GetBytesValue() []byte { if x, ok := m.GetKind().(*Value_BytesValue); ok { return x.BytesValue } return nil } func (m *Value) GetEnumValue() *EnumValue { if x, ok := m.GetKind().(*Value_EnumValue); ok { return x.EnumValue } return nil } func (m *Value) GetObjectValue() *types.Any { if x, ok := m.GetKind().(*Value_ObjectValue); ok { return x.ObjectValue } return nil } func (m *Value) GetMapValue() *MapValue { if x, ok := m.GetKind().(*Value_MapValue); ok { return x.MapValue } return nil } func (m *Value) GetListValue() *ListValue { if x, ok := m.GetKind().(*Value_ListValue); ok { return x.ListValue } return nil } func (m *Value) GetTypeValue() string { if x, ok := m.GetKind().(*Value_TypeValue); ok { return x.TypeValue } return "" } // XXX_OneofWrappers is for the internal use of the proto package. func (*Value) XXX_OneofWrappers() []interface{} { return []interface{}{ (*Value_NullValue)(nil), (*Value_BoolValue)(nil), (*Value_Int64Value)(nil), (*Value_Uint64Value)(nil), (*Value_DoubleValue)(nil), (*Value_StringValue)(nil), (*Value_BytesValue)(nil), (*Value_EnumValue)(nil), (*Value_ObjectValue)(nil), (*Value_MapValue)(nil), (*Value_ListValue)(nil), (*Value_TypeValue)(nil), } } func (*Value) XXX_MessageName() string { return "google.api.expr.v1alpha1.Value" } // An enum value. type EnumValue struct { // The fully qualified name of the enum type. Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // The value of the enum. Value int32 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *EnumValue) Reset() { *m = EnumValue{} } func (*EnumValue) ProtoMessage() {} func (*EnumValue) Descriptor() ([]byte, []int) { return fileDescriptor_24bee359d1e5798a, []int{1} } func (m *EnumValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *EnumValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EnumValue.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 *EnumValue) XXX_Merge(src proto.Message) { xxx_messageInfo_EnumValue.Merge(m, src) } func (m *EnumValue) XXX_Size() int { return m.Size() } func (m *EnumValue) XXX_DiscardUnknown() { xxx_messageInfo_EnumValue.DiscardUnknown(m) } var xxx_messageInfo_EnumValue proto.InternalMessageInfo func (m *EnumValue) GetType() string { if m != nil { return m.Type } return "" } func (m *EnumValue) GetValue() int32 { if m != nil { return m.Value } return 0 } func (*EnumValue) XXX_MessageName() string { return "google.api.expr.v1alpha1.EnumValue" } // A list. // // Wrapped in a message so 'not set' and empty can be differentiated, which is // required for use in a 'oneof'. type ListValue struct { // The ordered values in the list. Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListValue) Reset() { *m = ListValue{} } func (*ListValue) ProtoMessage() {} func (*ListValue) Descriptor() ([]byte, []int) { return fileDescriptor_24bee359d1e5798a, []int{2} } func (m *ListValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListValue.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 *ListValue) XXX_Merge(src proto.Message) { xxx_messageInfo_ListValue.Merge(m, src) } func (m *ListValue) XXX_Size() int { return m.Size() } func (m *ListValue) XXX_DiscardUnknown() { xxx_messageInfo_ListValue.DiscardUnknown(m) } var xxx_messageInfo_ListValue proto.InternalMessageInfo func (m *ListValue) GetValues() []*Value { if m != nil { return m.Values } return nil } func (*ListValue) XXX_MessageName() string { return "google.api.expr.v1alpha1.ListValue" } // A map. // // Wrapped in a message so 'not set' and empty can be differentiated, which is // required for use in a 'oneof'. type MapValue struct { // The set of map entries. // // CEL has fewer restrictions on keys, so a protobuf map represenation // cannot be used. Entries []*MapValue_Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *MapValue) Reset() { *m = MapValue{} } func (*MapValue) ProtoMessage() {} func (*MapValue) Descriptor() ([]byte, []int) { return fileDescriptor_24bee359d1e5798a, []int{3} } func (m *MapValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *MapValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MapValue.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 *MapValue) XXX_Merge(src proto.Message) { xxx_messageInfo_MapValue.Merge(m, src) } func (m *MapValue) XXX_Size() int { return m.Size() } func (m *MapValue) XXX_DiscardUnknown() { xxx_messageInfo_MapValue.DiscardUnknown(m) } var xxx_messageInfo_MapValue proto.InternalMessageInfo func (m *MapValue) GetEntries() []*MapValue_Entry { if m != nil { return m.Entries } return nil } func (*MapValue) XXX_MessageName() string { return "google.api.expr.v1alpha1.MapValue" } // An entry in the map. type MapValue_Entry struct { // The key. // // Must be unique with in the map. // Currently only boolean, int, uint, and string values can be keys. Key *Value `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // The value. Value *Value `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *MapValue_Entry) Reset() { *m = MapValue_Entry{} } func (*MapValue_Entry) ProtoMessage() {} func (*MapValue_Entry) Descriptor() ([]byte, []int) { return fileDescriptor_24bee359d1e5798a, []int{3, 0} } func (m *MapValue_Entry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *MapValue_Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MapValue_Entry.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 *MapValue_Entry) XXX_Merge(src proto.Message) { xxx_messageInfo_MapValue_Entry.Merge(m, src) } func (m *MapValue_Entry) XXX_Size() int { return m.Size() } func (m *MapValue_Entry) XXX_DiscardUnknown() { xxx_messageInfo_MapValue_Entry.DiscardUnknown(m) } var xxx_messageInfo_MapValue_Entry proto.InternalMessageInfo func (m *MapValue_Entry) GetKey() *Value { if m != nil { return m.Key } return nil } func (m *MapValue_Entry) GetValue() *Value { if m != nil { return m.Value } return nil } func (*MapValue_Entry) XXX_MessageName() string { return "google.api.expr.v1alpha1.MapValue.Entry" } func init() { proto.RegisterType((*Value)(nil), "google.api.expr.v1alpha1.Value") proto.RegisterType((*EnumValue)(nil), "google.api.expr.v1alpha1.EnumValue") proto.RegisterType((*ListValue)(nil), "google.api.expr.v1alpha1.ListValue") proto.RegisterType((*MapValue)(nil), "google.api.expr.v1alpha1.MapValue") proto.RegisterType((*MapValue_Entry)(nil), "google.api.expr.v1alpha1.MapValue.Entry") } func init() { proto.RegisterFile("google/api/expr/v1alpha1/value.proto", fileDescriptor_24bee359d1e5798a) } var fileDescriptor_24bee359d1e5798a = []byte{ // 541 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x3d, 0x6f, 0xd3, 0x50, 0x14, 0x86, 0x73, 0x88, 0x93, 0xd6, 0x27, 0x11, 0x48, 0x57, 0x1d, 0x42, 0x54, 0xb9, 0x26, 0x65, 0xf0, 0xe4, 0x28, 0x81, 0x82, 0x10, 0x53, 0xa3, 0x56, 0xca, 0x00, 0xa8, 0xf2, 0xc0, 0xc0, 0x82, 0xec, 0xd4, 0x04, 0x53, 0xe7, 0xda, 0xd8, 0xf7, 0x56, 0x78, 0xe3, 0xe7, 0xf0, 0x37, 0xd8, 0x58, 0x90, 0x18, 0x19, 0x89, 0x59, 0x18, 0x3b, 0x76, 0x44, 0xf7, 0xcb, 0x14, 0x50, 0xd4, 0x6e, 0x3e, 0xef, 0x7d, 0xde, 0xf3, 0xe5, 0x83, 0xf7, 0x97, 0x59, 0xb6, 0x4c, 0xe3, 0x71, 0x98, 0x27, 0xe3, 0xf8, 0x43, 0x5e, 0x8c, 0xcf, 0x27, 0x61, 0x9a, 0xbf, 0x0d, 0x27, 0xe3, 0xf3, 0x30, 0xe5, 0xb1, 0x9f, 0x17, 0x19, 0xcb, 0xc8, 0x40, 0x51, 0x7e, 0x98, 0x27, 0xbe, 0xa0, 0x7c, 0x43, 0x0d, 0xef, 0x6a, 0xbf, 0xe4, 0x22, 0xfe, 0x66, 0x1c, 0xd2, 0x4a, 0x99, 0x86, 0xbb, 0xff, 0x3e, 0x95, 0xac, 0xe0, 0x0b, 0xa6, 0x5e, 0x47, 0x5f, 0x2d, 0xec, 0xbc, 0x14, 0x25, 0xc8, 0x53, 0x44, 0xca, 0xd3, 0xf4, 0xb5, 0x2c, 0x38, 0x00, 0x17, 0xbc, 0xdb, 0xd3, 0xa1, 0xaf, 0x2b, 0x1a, 0xb3, 0xff, 0x82, 0xa7, 0xa9, 0xe4, 0xe7, 0xad, 0xc0, 0xa6, 0x26, 0x20, 0x7b, 0x88, 0x51, 0x96, 0x19, 0xf3, 0x2d, 0x17, 0xbc, 0x6d, 0x01, 0x08, 0x4d, 0x01, 0xf7, 0xb0, 0x97, 0x50, 0xf6, 0xe8, 0xa1, 0x26, 0xda, 0x2e, 0x78, 0xed, 0x79, 0x2b, 0x40, 0x29, 0x2a, 0x64, 0x1f, 0xfb, 0xfc, 0x2a, 0x63, 0xb9, 0xe0, 0x59, 0xf3, 0x56, 0xd0, 0xe3, 0x7f, 0x43, 0xa7, 0x19, 0x8f, 0xd2, 0x58, 0x43, 0x1d, 0x17, 0x3c, 0x10, 0x90, 0x52, 0x1b, 0xa8, 0x64, 0x45, 0x42, 0x97, 0x1a, 0xea, 0xba, 0xe0, 0xd9, 0x02, 0x52, 0x6a, 0xd3, 0x51, 0x54, 0xb1, 0xb8, 0xd4, 0xcc, 0x96, 0x0b, 0x5e, 0x5f, 0x74, 0x24, 0x45, 0x85, 0x1c, 0x21, 0xc6, 0x94, 0xaf, 0x34, 0x61, 0xbb, 0xe0, 0xf5, 0xa6, 0xfb, 0xfe, 0xa6, 0x9f, 0xe0, 0x1f, 0x53, 0xbe, 0x6a, 0x76, 0x13, 0x9b, 0x80, 0x3c, 0xc1, 0x7e, 0x16, 0xbd, 0x8b, 0x17, 0x4c, 0xe7, 0x41, 0x99, 0x67, 0xe7, 0xbf, 0xd5, 0x1e, 0xd2, 0x4a, 0xf4, 0xa8, 0x58, 0x65, 0x3d, 0x44, 0x7b, 0x15, 0xe6, 0xda, 0xd7, 0x93, 0xbe, 0xd1, 0xe6, 0xfa, 0xcf, 0xc3, 0xdc, 0x94, 0xdf, 0x5e, 0xe9, 0x6f, 0x31, 0x43, 0x9a, 0x94, 0xa6, 0x76, 0xff, 0xba, 0x19, 0x9e, 0x25, 0x25, 0x6b, 0x66, 0x48, 0x4d, 0x20, 0xfe, 0x2f, 0xab, 0x72, 0xb3, 0xf4, 0x3b, 0x7a, 0x9f, 0xb6, 0xd0, 0x24, 0x30, 0xeb, 0xa2, 0x75, 0x96, 0xd0, 0xd3, 0xd1, 0x01, 0xda, 0xcd, 0x1a, 0x08, 0x41, 0x4b, 0x10, 0xf2, 0x98, 0xec, 0x40, 0x7e, 0x93, 0x1d, 0xec, 0xfc, 0x39, 0x92, 0x4e, 0xa0, 0x82, 0xd1, 0x11, 0xda, 0x4d, 0x65, 0xf2, 0x18, 0xbb, 0x52, 0x2d, 0x07, 0xe0, 0xb6, 0xbd, 0xde, 0x74, 0x6f, 0x73, 0xbb, 0xd2, 0x10, 0x68, 0x7c, 0xf4, 0x19, 0x70, 0xdb, 0x2c, 0x81, 0xcc, 0x70, 0x2b, 0xa6, 0xac, 0x48, 0x9a, 0x34, 0xde, 0xf5, 0x9b, 0xf3, 0x8f, 0x29, 0x2b, 0xaa, 0xc0, 0x18, 0x87, 0xef, 0xb1, 0x23, 0x15, 0x32, 0xc1, 0xf6, 0x59, 0x5c, 0xc9, 0x41, 0x6e, 0xd0, 0x8f, 0x60, 0xc9, 0xc1, 0xd5, 0x41, 0x6f, 0x60, 0x52, 0xf4, 0x2c, 0xfc, 0xbe, 0x76, 0x5a, 0x17, 0x6b, 0x07, 0x2e, 0xd7, 0x0e, 0x7c, 0xac, 0x1d, 0xf8, 0x54, 0x3b, 0xf0, 0xa5, 0x76, 0xe0, 0x5b, 0xed, 0xc0, 0x8f, 0xda, 0x81, 0x5f, 0xb5, 0xd3, 0xba, 0x10, 0xda, 0x4f, 0x07, 0x70, 0x77, 0x91, 0xad, 0x36, 0x26, 0x9e, 0xa1, 0xcc, 0x7c, 0x22, 0x0e, 0xec, 0x04, 0x5e, 0x59, 0xe2, 0xf1, 0x12, 0x20, 0xea, 0xca, 0x93, 0x7b, 0xf0, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xb0, 0xf9, 0x74, 0x3d, 0x75, 0x04, 0x00, 0x00, } func (this *Value) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Value) if !ok { that2, ok := that.(Value) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if that1.Kind == nil { if this.Kind != nil { return false } } else if this.Kind == nil { return false } else if !this.Kind.Equal(that1.Kind) { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Value_NullValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Value_NullValue) if !ok { that2, ok := that.(Value_NullValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.NullValue != that1.NullValue { return false } return true } func (this *Value_BoolValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Value_BoolValue) if !ok { that2, ok := that.(Value_BoolValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.BoolValue != that1.BoolValue { return false } return true } func (this *Value_Int64Value) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Value_Int64Value) if !ok { that2, ok := that.(Value_Int64Value) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Int64Value != that1.Int64Value { return false } return true } func (this *Value_Uint64Value) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Value_Uint64Value) if !ok { that2, ok := that.(Value_Uint64Value) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Uint64Value != that1.Uint64Value { return false } return true } func (this *Value_DoubleValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Value_DoubleValue) if !ok { that2, ok := that.(Value_DoubleValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.DoubleValue != that1.DoubleValue { return false } return true } func (this *Value_StringValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Value_StringValue) if !ok { that2, ok := that.(Value_StringValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.StringValue != that1.StringValue { return false } return true } func (this *Value_BytesValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Value_BytesValue) if !ok { that2, ok := that.(Value_BytesValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !bytes.Equal(this.BytesValue, that1.BytesValue) { return false } return true } func (this *Value_EnumValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Value_EnumValue) if !ok { that2, ok := that.(Value_EnumValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.EnumValue.Equal(that1.EnumValue) { return false } return true } func (this *Value_ObjectValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Value_ObjectValue) if !ok { that2, ok := that.(Value_ObjectValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.ObjectValue.Equal(that1.ObjectValue) { return false } return true } func (this *Value_MapValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Value_MapValue) if !ok { that2, ok := that.(Value_MapValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.MapValue.Equal(that1.MapValue) { return false } return true } func (this *Value_ListValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Value_ListValue) if !ok { that2, ok := that.(Value_ListValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.ListValue.Equal(that1.ListValue) { return false } return true } func (this *Value_TypeValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Value_TypeValue) if !ok { that2, ok := that.(Value_TypeValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.TypeValue != that1.TypeValue { return false } return true } func (this *EnumValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*EnumValue) if !ok { that2, ok := that.(EnumValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Type != that1.Type { return false } if this.Value != that1.Value { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *ListValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*ListValue) if !ok { that2, ok := that.(ListValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if len(this.Values) != len(that1.Values) { return false } for i := range this.Values { if !this.Values[i].Equal(that1.Values[i]) { return false } } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *MapValue) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*MapValue) if !ok { that2, ok := that.(MapValue) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if len(this.Entries) != len(that1.Entries) { return false } for i := range this.Entries { if !this.Entries[i].Equal(that1.Entries[i]) { return false } } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *MapValue_Entry) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*MapValue_Entry) if !ok { that2, ok := that.(MapValue_Entry) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.Key.Equal(that1.Key) { return false } if !this.Value.Equal(that1.Value) { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Value) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 16) s = append(s, "&expr.Value{") if this.Kind != nil { s = append(s, "Kind: "+fmt.Sprintf("%#v", this.Kind)+",\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 (this *Value_NullValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Value_NullValue{` + `NullValue:` + fmt.Sprintf("%#v", this.NullValue) + `}`}, ", ") return s } func (this *Value_BoolValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Value_BoolValue{` + `BoolValue:` + fmt.Sprintf("%#v", this.BoolValue) + `}`}, ", ") return s } func (this *Value_Int64Value) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Value_Int64Value{` + `Int64Value:` + fmt.Sprintf("%#v", this.Int64Value) + `}`}, ", ") return s } func (this *Value_Uint64Value) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Value_Uint64Value{` + `Uint64Value:` + fmt.Sprintf("%#v", this.Uint64Value) + `}`}, ", ") return s } func (this *Value_DoubleValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Value_DoubleValue{` + `DoubleValue:` + fmt.Sprintf("%#v", this.DoubleValue) + `}`}, ", ") return s } func (this *Value_StringValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Value_StringValue{` + `StringValue:` + fmt.Sprintf("%#v", this.StringValue) + `}`}, ", ") return s } func (this *Value_BytesValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Value_BytesValue{` + `BytesValue:` + fmt.Sprintf("%#v", this.BytesValue) + `}`}, ", ") return s } func (this *Value_EnumValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Value_EnumValue{` + `EnumValue:` + fmt.Sprintf("%#v", this.EnumValue) + `}`}, ", ") return s } func (this *Value_ObjectValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Value_ObjectValue{` + `ObjectValue:` + fmt.Sprintf("%#v", this.ObjectValue) + `}`}, ", ") return s } func (this *Value_MapValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Value_MapValue{` + `MapValue:` + fmt.Sprintf("%#v", this.MapValue) + `}`}, ", ") return s } func (this *Value_ListValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Value_ListValue{` + `ListValue:` + fmt.Sprintf("%#v", this.ListValue) + `}`}, ", ") return s } func (this *Value_TypeValue) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&expr.Value_TypeValue{` + `TypeValue:` + fmt.Sprintf("%#v", this.TypeValue) + `}`}, ", ") return s } func (this *EnumValue) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&expr.EnumValue{") s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n") s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\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 (this *ListValue) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&expr.ListValue{") if this.Values != nil { s = append(s, "Values: "+fmt.Sprintf("%#v", this.Values)+",\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 (this *MapValue) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&expr.MapValue{") if this.Entries != nil { s = append(s, "Entries: "+fmt.Sprintf("%#v", this.Entries)+",\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 (this *MapValue_Entry) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&expr.MapValue_Entry{") if this.Key != nil { s = append(s, "Key: "+fmt.Sprintf("%#v", this.Key)+",\n") } if this.Value != nil { s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\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 valueToGoStringValue(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 *Value) 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 *Value) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Value) 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.Kind != nil { { size := m.Kind.Size() i -= size if _, err := m.Kind.MarshalTo(dAtA[i:]); err != nil { return 0, err } } } return len(dAtA) - i, nil } func (m *Value_NullValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Value_NullValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i = encodeVarintValue(dAtA, i, uint64(m.NullValue)) i-- dAtA[i] = 0x8 return len(dAtA) - i, nil } func (m *Value_BoolValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Value_BoolValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i-- if m.BoolValue { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x10 return len(dAtA) - i, nil } func (m *Value_Int64Value) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Value_Int64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i = encodeVarintValue(dAtA, i, uint64(m.Int64Value)) i-- dAtA[i] = 0x18 return len(dAtA) - i, nil } func (m *Value_Uint64Value) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Value_Uint64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i = encodeVarintValue(dAtA, i, uint64(m.Uint64Value)) i-- dAtA[i] = 0x20 return len(dAtA) - i, nil } func (m *Value_DoubleValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Value_DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DoubleValue)))) i-- dAtA[i] = 0x29 return len(dAtA) - i, nil } func (m *Value_StringValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Value_StringValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i -= len(m.StringValue) copy(dAtA[i:], m.StringValue) i = encodeVarintValue(dAtA, i, uint64(len(m.StringValue))) i-- dAtA[i] = 0x32 return len(dAtA) - i, nil } func (m *Value_BytesValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Value_BytesValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.BytesValue != nil { i -= len(m.BytesValue) copy(dAtA[i:], m.BytesValue) i = encodeVarintValue(dAtA, i, uint64(len(m.BytesValue))) i-- dAtA[i] = 0x3a } return len(dAtA) - i, nil } func (m *Value_EnumValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Value_EnumValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.EnumValue != nil { { size, err := m.EnumValue.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintValue(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a } return len(dAtA) - i, nil } func (m *Value_ObjectValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Value_ObjectValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.ObjectValue != nil { { size, err := m.ObjectValue.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintValue(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x52 } return len(dAtA) - i, nil } func (m *Value_MapValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Value_MapValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.MapValue != nil { { size, err := m.MapValue.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintValue(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x5a } return len(dAtA) - i, nil } func (m *Value_ListValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Value_ListValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.ListValue != nil { { size, err := m.ListValue.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintValue(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x62 } return len(dAtA) - i, nil } func (m *Value_TypeValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Value_TypeValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i -= len(m.TypeValue) copy(dAtA[i:], m.TypeValue) i = encodeVarintValue(dAtA, i, uint64(len(m.TypeValue))) i-- dAtA[i] = 0x7a return len(dAtA) - i, nil } func (m *EnumValue) 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 *EnumValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *EnumValue) 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.Value != 0 { i = encodeVarintValue(dAtA, i, uint64(m.Value)) i-- dAtA[i] = 0x10 } if len(m.Type) > 0 { i -= len(m.Type) copy(dAtA[i:], m.Type) i = encodeVarintValue(dAtA, i, uint64(len(m.Type))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ListValue) 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 *ListValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListValue) 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 len(m.Values) > 0 { for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Values[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintValue(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *MapValue) 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 *MapValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *MapValue) 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 len(m.Entries) > 0 { for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintValue(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *MapValue_Entry) 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 *MapValue_Entry) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *MapValue_Entry) 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.Value != nil { { size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintValue(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.Key != nil { { size, err := m.Key.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintValue(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintValue(dAtA []byte, offset int, v uint64) int { offset -= sovValue(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedValue(r randyValue, easy bool) *Value { this := &Value{} oneofNumber_Kind := []int32{1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 15}[r.Intn(12)] switch oneofNumber_Kind { case 1: this.Kind = NewPopulatedValue_NullValue(r, easy) case 2: this.Kind = NewPopulatedValue_BoolValue(r, easy) case 3: this.Kind = NewPopulatedValue_Int64Value(r, easy) case 4: this.Kind = NewPopulatedValue_Uint64Value(r, easy) case 5: this.Kind = NewPopulatedValue_DoubleValue(r, easy) case 6: this.Kind = NewPopulatedValue_StringValue(r, easy) case 7: this.Kind = NewPopulatedValue_BytesValue(r, easy) case 9: this.Kind = NewPopulatedValue_EnumValue(r, easy) case 10: this.Kind = NewPopulatedValue_ObjectValue(r, easy) case 11: this.Kind = NewPopulatedValue_MapValue(r, easy) case 12: this.Kind = NewPopulatedValue_ListValue(r, easy) case 15: this.Kind = NewPopulatedValue_TypeValue(r, easy) } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedValue(r, 16) } return this } func NewPopulatedValue_NullValue(r randyValue, easy bool) *Value_NullValue { this := &Value_NullValue{} this.NullValue = types.NullValue([]int32{0}[r.Intn(1)]) return this } func NewPopulatedValue_BoolValue(r randyValue, easy bool) *Value_BoolValue { this := &Value_BoolValue{} this.BoolValue = bool(bool(r.Intn(2) == 0)) return this } func NewPopulatedValue_Int64Value(r randyValue, easy bool) *Value_Int64Value { this := &Value_Int64Value{} this.Int64Value = int64(r.Int63()) if r.Intn(2) == 0 { this.Int64Value *= -1 } return this } func NewPopulatedValue_Uint64Value(r randyValue, easy bool) *Value_Uint64Value { this := &Value_Uint64Value{} this.Uint64Value = uint64(uint64(r.Uint32())) return this } func NewPopulatedValue_DoubleValue(r randyValue, easy bool) *Value_DoubleValue { this := &Value_DoubleValue{} this.DoubleValue = float64(r.Float64()) if r.Intn(2) == 0 { this.DoubleValue *= -1 } return this } func NewPopulatedValue_StringValue(r randyValue, easy bool) *Value_StringValue { this := &Value_StringValue{} this.StringValue = string(randStringValue(r)) return this } func NewPopulatedValue_BytesValue(r randyValue, easy bool) *Value_BytesValue { this := &Value_BytesValue{} v1 := r.Intn(100) this.BytesValue = make([]byte, v1) for i := 0; i < v1; i++ { this.BytesValue[i] = byte(r.Intn(256)) } return this } func NewPopulatedValue_EnumValue(r randyValue, easy bool) *Value_EnumValue { this := &Value_EnumValue{} this.EnumValue = NewPopulatedEnumValue(r, easy) return this } func NewPopulatedValue_ObjectValue(r randyValue, easy bool) *Value_ObjectValue { this := &Value_ObjectValue{} this.ObjectValue = types.NewPopulatedAny(r, easy) return this } func NewPopulatedValue_MapValue(r randyValue, easy bool) *Value_MapValue { this := &Value_MapValue{} this.MapValue = NewPopulatedMapValue(r, easy) return this } func NewPopulatedValue_ListValue(r randyValue, easy bool) *Value_ListValue { this := &Value_ListValue{} this.ListValue = NewPopulatedListValue(r, easy) return this } func NewPopulatedValue_TypeValue(r randyValue, easy bool) *Value_TypeValue { this := &Value_TypeValue{} this.TypeValue = string(randStringValue(r)) return this } func NewPopulatedEnumValue(r randyValue, easy bool) *EnumValue { this := &EnumValue{} this.Type = string(randStringValue(r)) this.Value = int32(r.Int31()) if r.Intn(2) == 0 { this.Value *= -1 } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedValue(r, 3) } return this } func NewPopulatedListValue(r randyValue, easy bool) *ListValue { this := &ListValue{} if r.Intn(5) == 0 { v2 := r.Intn(5) this.Values = make([]*Value, v2) for i := 0; i < v2; i++ { this.Values[i] = NewPopulatedValue(r, easy) } } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedValue(r, 2) } return this } func NewPopulatedMapValue(r randyValue, easy bool) *MapValue { this := &MapValue{} if r.Intn(5) == 0 { v3 := r.Intn(5) this.Entries = make([]*MapValue_Entry, v3) for i := 0; i < v3; i++ { this.Entries[i] = NewPopulatedMapValue_Entry(r, easy) } } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedValue(r, 2) } return this } func NewPopulatedMapValue_Entry(r randyValue, easy bool) *MapValue_Entry { this := &MapValue_Entry{} if r.Intn(5) == 0 { this.Key = NewPopulatedValue(r, easy) } if r.Intn(5) == 0 { this.Value = NewPopulatedValue(r, easy) } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedValue(r, 3) } return this } type randyValue interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneValue(r randyValue) 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 randStringValue(r randyValue) string { v4 := r.Intn(100) tmps := make([]rune, v4) for i := 0; i < v4; i++ { tmps[i] = randUTF8RuneValue(r) } return string(tmps) } func randUnrecognizedValue(r randyValue, 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 = randFieldValue(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldValue(dAtA []byte, r randyValue, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateValue(dAtA, uint64(key)) v5 := r.Int63() if r.Intn(2) == 0 { v5 *= -1 } dAtA = encodeVarintPopulateValue(dAtA, uint64(v5)) case 1: dAtA = encodeVarintPopulateValue(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 = encodeVarintPopulateValue(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateValue(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateValue(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 encodeVarintPopulateValue(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 *Value) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Kind != nil { n += m.Kind.Size() } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Value_NullValue) Size() (n int) { if m == nil { return 0 } var l int _ = l n += 1 + sovValue(uint64(m.NullValue)) return n } func (m *Value_BoolValue) Size() (n int) { if m == nil { return 0 } var l int _ = l n += 2 return n } func (m *Value_Int64Value) Size() (n int) { if m == nil { return 0 } var l int _ = l n += 1 + sovValue(uint64(m.Int64Value)) return n } func (m *Value_Uint64Value) Size() (n int) { if m == nil { return 0 } var l int _ = l n += 1 + sovValue(uint64(m.Uint64Value)) return n } func (m *Value_DoubleValue) Size() (n int) { if m == nil { return 0 } var l int _ = l n += 9 return n } func (m *Value_StringValue) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.StringValue) n += 1 + l + sovValue(uint64(l)) return n } func (m *Value_BytesValue) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.BytesValue != nil { l = len(m.BytesValue) n += 1 + l + sovValue(uint64(l)) } return n } func (m *Value_EnumValue) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.EnumValue != nil { l = m.EnumValue.Size() n += 1 + l + sovValue(uint64(l)) } return n } func (m *Value_ObjectValue) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.ObjectValue != nil { l = m.ObjectValue.Size() n += 1 + l + sovValue(uint64(l)) } return n } func (m *Value_MapValue) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.MapValue != nil { l = m.MapValue.Size() n += 1 + l + sovValue(uint64(l)) } return n } func (m *Value_ListValue) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.ListValue != nil { l = m.ListValue.Size() n += 1 + l + sovValue(uint64(l)) } return n } func (m *Value_TypeValue) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.TypeValue) n += 1 + l + sovValue(uint64(l)) return n } func (m *EnumValue) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Type) if l > 0 { n += 1 + l + sovValue(uint64(l)) } if m.Value != 0 { n += 1 + sovValue(uint64(m.Value)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *ListValue) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Values) > 0 { for _, e := range m.Values { l = e.Size() n += 1 + l + sovValue(uint64(l)) } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *MapValue) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Entries) > 0 { for _, e := range m.Entries { l = e.Size() n += 1 + l + sovValue(uint64(l)) } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *MapValue_Entry) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Key != nil { l = m.Key.Size() n += 1 + l + sovValue(uint64(l)) } if m.Value != nil { l = m.Value.Size() n += 1 + l + sovValue(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovValue(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozValue(x uint64) (n int) { return sovValue(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *Value) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Value{`, `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *Value_NullValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Value_NullValue{`, `NullValue:` + fmt.Sprintf("%v", this.NullValue) + `,`, `}`, }, "") return s } func (this *Value_BoolValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Value_BoolValue{`, `BoolValue:` + fmt.Sprintf("%v", this.BoolValue) + `,`, `}`, }, "") return s } func (this *Value_Int64Value) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Value_Int64Value{`, `Int64Value:` + fmt.Sprintf("%v", this.Int64Value) + `,`, `}`, }, "") return s } func (this *Value_Uint64Value) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Value_Uint64Value{`, `Uint64Value:` + fmt.Sprintf("%v", this.Uint64Value) + `,`, `}`, }, "") return s } func (this *Value_DoubleValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Value_DoubleValue{`, `DoubleValue:` + fmt.Sprintf("%v", this.DoubleValue) + `,`, `}`, }, "") return s } func (this *Value_StringValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Value_StringValue{`, `StringValue:` + fmt.Sprintf("%v", this.StringValue) + `,`, `}`, }, "") return s } func (this *Value_BytesValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Value_BytesValue{`, `BytesValue:` + fmt.Sprintf("%v", this.BytesValue) + `,`, `}`, }, "") return s } func (this *Value_EnumValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Value_EnumValue{`, `EnumValue:` + strings.Replace(fmt.Sprintf("%v", this.EnumValue), "EnumValue", "EnumValue", 1) + `,`, `}`, }, "") return s } func (this *Value_ObjectValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Value_ObjectValue{`, `ObjectValue:` + strings.Replace(fmt.Sprintf("%v", this.ObjectValue), "Any", "types.Any", 1) + `,`, `}`, }, "") return s } func (this *Value_MapValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Value_MapValue{`, `MapValue:` + strings.Replace(fmt.Sprintf("%v", this.MapValue), "MapValue", "MapValue", 1) + `,`, `}`, }, "") return s } func (this *Value_ListValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Value_ListValue{`, `ListValue:` + strings.Replace(fmt.Sprintf("%v", this.ListValue), "ListValue", "ListValue", 1) + `,`, `}`, }, "") return s } func (this *Value_TypeValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Value_TypeValue{`, `TypeValue:` + fmt.Sprintf("%v", this.TypeValue) + `,`, `}`, }, "") return s } func (this *EnumValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&EnumValue{`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Value:` + fmt.Sprintf("%v", this.Value) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *ListValue) String() string { if this == nil { return "nil" } repeatedStringForValues := "[]*Value{" for _, f := range this.Values { repeatedStringForValues += strings.Replace(f.String(), "Value", "Value", 1) + "," } repeatedStringForValues += "}" s := strings.Join([]string{`&ListValue{`, `Values:` + repeatedStringForValues + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *MapValue) String() string { if this == nil { return "nil" } repeatedStringForEntries := "[]*MapValue_Entry{" for _, f := range this.Entries { repeatedStringForEntries += strings.Replace(fmt.Sprintf("%v", f), "MapValue_Entry", "MapValue_Entry", 1) + "," } repeatedStringForEntries += "}" s := strings.Join([]string{`&MapValue{`, `Entries:` + repeatedStringForEntries + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *MapValue_Entry) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&MapValue_Entry{`, `Key:` + strings.Replace(this.Key.String(), "Value", "Value", 1) + `,`, `Value:` + strings.Replace(this.Value.String(), "Value", "Value", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringValue(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *Value) 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 ErrIntOverflowValue } 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: Value: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Value: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field NullValue", wireType) } var v types.NullValue for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= types.NullValue(b&0x7F) << shift if b < 0x80 { break } } m.Kind = &Value_NullValue{v} case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field BoolValue", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } b := bool(v != 0) m.Kind = &Value_BoolValue{b} case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Int64Value", wireType) } var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int64(b&0x7F) << shift if b < 0x80 { break } } m.Kind = &Value_Int64Value{v} case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Uint64Value", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= uint64(b&0x7F) << shift if b < 0x80 { break } } m.Kind = &Value_Uint64Value{v} case 5: if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field DoubleValue", wireType) } var v uint64 if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 m.Kind = &Value_DoubleValue{float64(math.Float64frombits(v))} case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StringValue", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthValue } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthValue } if postIndex > l { return io.ErrUnexpectedEOF } m.Kind = &Value_StringValue{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BytesValue", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthValue } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthValue } if postIndex > l { return io.ErrUnexpectedEOF } v := make([]byte, postIndex-iNdEx) copy(v, dAtA[iNdEx:postIndex]) m.Kind = &Value_BytesValue{v} iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field EnumValue", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthValue } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthValue } if postIndex > l { return io.ErrUnexpectedEOF } v := &EnumValue{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Kind = &Value_EnumValue{v} iNdEx = postIndex case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ObjectValue", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthValue } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthValue } if postIndex > l { return io.ErrUnexpectedEOF } v := &types.Any{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Kind = &Value_ObjectValue{v} iNdEx = postIndex case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MapValue", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthValue } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthValue } if postIndex > l { return io.ErrUnexpectedEOF } v := &MapValue{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Kind = &Value_MapValue{v} iNdEx = postIndex case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ListValue", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthValue } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthValue } if postIndex > l { return io.ErrUnexpectedEOF } v := &ListValue{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Kind = &Value_ListValue{v} iNdEx = postIndex case 15: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TypeValue", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthValue } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthValue } if postIndex > l { return io.ErrUnexpectedEOF } m.Kind = &Value_TypeValue{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipValue(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthValue } if (iNdEx + skippy) < 0 { return ErrInvalidLengthValue } 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 (m *EnumValue) 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 ErrIntOverflowValue } 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: EnumValue: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: EnumValue: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthValue } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthValue } if postIndex > l { return io.ErrUnexpectedEOF } m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Value |= int32(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipValue(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthValue } if (iNdEx + skippy) < 0 { return ErrInvalidLengthValue } 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 (m *ListValue) 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 ErrIntOverflowValue } 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: ListValue: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListValue: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthValue } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthValue } if postIndex > l { return io.ErrUnexpectedEOF } m.Values = append(m.Values, &Value{}) if err := m.Values[len(m.Values)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipValue(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthValue } if (iNdEx + skippy) < 0 { return ErrInvalidLengthValue } 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 (m *MapValue) 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 ErrIntOverflowValue } 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: MapValue: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MapValue: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthValue } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthValue } if postIndex > l { return io.ErrUnexpectedEOF } m.Entries = append(m.Entries, &MapValue_Entry{}) if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipValue(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthValue } if (iNdEx + skippy) < 0 { return ErrInvalidLengthValue } 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 (m *MapValue_Entry) 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 ErrIntOverflowValue } 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: Entry: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Entry: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthValue } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthValue } if postIndex > l { return io.ErrUnexpectedEOF } if m.Key == nil { m.Key = &Value{} } if err := m.Key.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowValue } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthValue } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthValue } if postIndex > l { return io.ErrUnexpectedEOF } if m.Value == nil { m.Value = &Value{} } if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipValue(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthValue } if (iNdEx + skippy) < 0 { return ErrInvalidLengthValue } 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 skipValue(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, ErrIntOverflowValue } 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, ErrIntOverflowValue } 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, ErrIntOverflowValue } 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, ErrInvalidLengthValue } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupValue } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthValue } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthValue = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowValue = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupValue = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/api/expr/v1alpha1/value.proto000066400000000000000000000053431365205541600225020ustar00rootroot00000000000000// 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. // 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.api.expr.v1alpha1; import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; option cc_enable_arenas = true; option go_package = "expr"; option java_multiple_files = true; option java_outer_classname = "ValueProto"; option java_package = "com.google.api.expr.v1alpha1"; // Contains representations for CEL runtime values. // Represents a CEL value. // // This is similar to `google.protobuf.Value`, but can represent CEL's full // range of values. message Value { // Required. The valid kinds of values. oneof kind { // Null value. google.protobuf.NullValue null_value = 1; // Boolean value. bool bool_value = 2; // Signed integer value. int64 int64_value = 3; // Unsigned integer value. uint64 uint64_value = 4; // Floating point value. double double_value = 5; // UTF-8 string value. string string_value = 6; // Byte string value. bytes bytes_value = 7; // An enum value. EnumValue enum_value = 9; // The proto message backing an object value. google.protobuf.Any object_value = 10; // Map value. MapValue map_value = 11; // List value. ListValue list_value = 12; // Type value. string type_value = 15; } } // An enum value. message EnumValue { // The fully qualified name of the enum type. string type = 1; // The value of the enum. int32 value = 2; } // A list. // // Wrapped in a message so 'not set' and empty can be differentiated, which is // required for use in a 'oneof'. message ListValue { // The ordered values in the list. repeated Value values = 1; } // A map. // // Wrapped in a message so 'not set' and empty can be differentiated, which is // required for use in a 'oneof'. message MapValue { // An entry in the map. message Entry { // The key. // // Must be unique with in the map. // Currently only boolean, int, uint, and string values can be keys. Value key = 1; // The value. Value value = 2; } // The set of map entries. // // CEL has fewer restrictions on keys, so a protobuf map represenation // cannot be used. repeated Entry entries = 1; } googleapis-1.4.0/google/api/http.pb.go000066400000000000000000001733551365205541600176250ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/api/http.proto package api import ( bytes "bytes" fmt "fmt" 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 // Defines the HTTP configuration for an API service. It contains a list of // [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method // to one or more HTTP REST API methods. type Http struct { // A list of HTTP configuration rules that apply to individual API methods. // // **NOTE:** All service configuration rules follow "last one wins" order. Rules []*HttpRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"` // When set to true, URL path parameters will be fully URI-decoded except in // cases of single segment matches in reserved expansion, where "%2F" will be // left encoded. // // The default behavior is to not decode RFC 6570 reserved characters in multi // segment matches. FullyDecodeReservedExpansion bool `protobuf:"varint,2,opt,name=fully_decode_reserved_expansion,json=fullyDecodeReservedExpansion,proto3" json:"fully_decode_reserved_expansion,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Http) Reset() { *m = Http{} } func (*Http) ProtoMessage() {} func (*Http) Descriptor() ([]byte, []int) { return fileDescriptor_ff9994be407cdcc9, []int{0} } func (m *Http) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Http) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Http.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 *Http) XXX_Merge(src proto.Message) { xxx_messageInfo_Http.Merge(m, src) } func (m *Http) XXX_Size() int { return m.Size() } func (m *Http) XXX_DiscardUnknown() { xxx_messageInfo_Http.DiscardUnknown(m) } var xxx_messageInfo_Http proto.InternalMessageInfo func (m *Http) GetRules() []*HttpRule { if m != nil { return m.Rules } return nil } func (m *Http) GetFullyDecodeReservedExpansion() bool { if m != nil { return m.FullyDecodeReservedExpansion } return false } func (*Http) XXX_MessageName() string { return "google.api.Http" } // # gRPC Transcoding // // gRPC Transcoding is a feature for mapping between a gRPC method and one or // more HTTP REST endpoints. It allows developers to build a single API service // that supports both gRPC APIs and REST APIs. Many systems, including [Google // APIs](https://github.com/googleapis/googleapis), // [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC // Gateway](https://github.com/grpc-ecosystem/grpc-gateway), // and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature // and use it for large scale production services. // // `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies // how different portions of the gRPC request message are mapped to the URL // path, URL query parameters, and HTTP request body. It also controls how the // gRPC response message is mapped to the HTTP response body. `HttpRule` is // typically specified as an `google.api.http` annotation on the gRPC method. // // Each mapping specifies a URL path template and an HTTP method. The path // template may refer to one or more fields in the gRPC request message, as long // as each field is a non-repeated field with a primitive (non-message) type. // The path template controls how fields of the request message are mapped to // the URL path. // // Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/{name=messages/*}" // }; // } // } // message GetMessageRequest { // string name = 1; // Mapped to URL path. // } // message Message { // string text = 1; // The resource content. // } // // This enables an HTTP REST to gRPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` // // Any fields in the request message which are not bound by the path template // automatically become HTTP query parameters if there is no HTTP request body. // For example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get:"/v1/messages/{message_id}" // }; // } // } // message GetMessageRequest { // message SubMessage { // string subfield = 1; // } // string message_id = 1; // Mapped to URL path. // int64 revision = 2; // Mapped to URL query parameter `revision`. // SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. // } // // This enables a HTTP JSON to RPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456?revision=2&sub.subfield=foo` | // `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: // "foo"))` // // Note that fields which are mapped to URL query parameters must have a // primitive type or a repeated primitive type or a non-repeated message type. // In the case of a repeated type, the parameter can be repeated in the URL // as `...?param=A¶m=B`. In the case of a message type, each field of the // message is mapped to a separate parameter, such as // `...?foo.a=A&foo.b=B&foo.c=C`. // // For HTTP methods that allow a request body, the `body` field // specifies the mapping. Consider a REST update method on the // message resource collection: // // service Messaging { // rpc UpdateMessage(UpdateMessageRequest) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "message" // }; // } // } // message UpdateMessageRequest { // string message_id = 1; // mapped to the URL // Message message = 2; // mapped to the body // } // // The following HTTP JSON to RPC mapping is enabled, where the // representation of the JSON in the request body is determined by // protos JSON encoding: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" message { text: "Hi!" })` // // The special name `*` can be used in the body mapping to define that // every field not bound by the path template should be mapped to the // request body. This enables the following alternative definition of // the update method: // // service Messaging { // rpc UpdateMessage(Message) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "*" // }; // } // } // message Message { // string message_id = 1; // string text = 2; // } // // // The following HTTP JSON to RPC mapping is enabled: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" text: "Hi!")` // // Note that when using `*` in the body mapping, it is not possible to // have HTTP parameters, as all fields not bound by the path end in // the body. This makes this option more rarely used in practice when // defining REST APIs. The common usage of `*` is in custom methods // which don't use the URL at all for transferring data. // // It is possible to define multiple HTTP methods for one RPC by using // the `additional_bindings` option. Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/messages/{message_id}" // additional_bindings { // get: "/v1/users/{user_id}/messages/{message_id}" // } // }; // } // } // message GetMessageRequest { // string message_id = 1; // string user_id = 2; // } // // This enables the following two alternative HTTP JSON to RPC mappings: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: // "123456")` // // ## Rules for HTTP mapping // // 1. Leaf request fields (recursive expansion nested messages in the request // message) are classified into three categories: // - Fields referred by the path template. They are passed via the URL path. // - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP // request body. // - All other fields are passed via the URL query parameters, and the // parameter name is the field path in the request message. A repeated // field can be represented as multiple query parameters under the same // name. // 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields // are passed via URL path and HTTP request body. // 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all // fields are passed via URL path and URL query parameters. // // ### Path template syntax // // Template = "/" Segments [ Verb ] ; // Segments = Segment { "/" Segment } ; // Segment = "*" | "**" | LITERAL | Variable ; // Variable = "{" FieldPath [ "=" Segments ] "}" ; // FieldPath = IDENT { "." IDENT } ; // Verb = ":" LITERAL ; // // The syntax `*` matches a single URL path segment. The syntax `**` matches // zero or more URL path segments, which must be the last part of the URL path // except the `Verb`. // // The syntax `Variable` matches part of the URL path as specified by its // template. A variable template must not contain other variables. If a variable // matches a single path segment, its template may be omitted, e.g. `{var}` // is equivalent to `{var=*}`. // // The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` // contains any reserved character, such characters should be percent-encoded // before the matching. // // If a variable contains exactly one path segment, such as `"{var}"` or // `"{var=*}"`, when such a variable is expanded into a URL path on the client // side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The // server side does the reverse decoding. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{var}`. // // If a variable contains multiple path segments, such as `"{var=foo/*}"` // or `"{var=**}"`, when such a variable is expanded into a URL path on the // client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. // The server side does the reverse decoding, except "%2F" and "%2f" are left // unchanged. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{+var}`. // // ## Using gRPC API Service Configuration // // gRPC API Service Configuration (service config) is a configuration language // for configuring a gRPC service to become a user-facing product. The // service config is simply the YAML representation of the `google.api.Service` // proto message. // // As an alternative to annotating your proto file, you can configure gRPC // transcoding in your service config YAML files. You do this by specifying a // `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same // effect as the proto annotation. This can be particularly useful if you // have a proto that is reused in multiple services. Note that any transcoding // specified in the service config will override any matching transcoding // configuration in the proto. // // Example: // // http: // rules: // # Selects a gRPC method and applies HttpRule to it. // - selector: example.v1.Messaging.GetMessage // get: /v1/messages/{message_id}/{sub.subfield} // // ## Special notes // // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the // proto to JSON conversion must follow the [proto3 // specification](https://developers.google.com/protocol-buffers/docs/proto3#json). // // While the single segment variable follows the semantics of // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String // Expansion, the multi segment variable **does not** follow RFC 6570 Section // 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion // does not expand special characters like `?` and `#`, which would lead // to invalid URLs. As the result, gRPC Transcoding uses a custom encoding // for multi segment variables. // // The path variables **must not** refer to any repeated or mapped field, // because client libraries are not capable of handling such variable expansion. // // The path variables **must not** capture the leading "/" character. The reason // is that the most common use case "{var}" does not capture the leading "/" // character. For consistency, all path variables must share the same behavior. // // Repeated message fields must not be mapped to URL query parameters, because // no client library can support such complicated mapping. // // If an API needs to use a JSON array for request or response body, it can map // the request or response body to a repeated field. However, some gRPC // Transcoding implementations may not support this feature. type HttpRule struct { // Selects a method to which this rule applies. // // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` // Determines the URL pattern is matched by this rules. This pattern can be // used with any of the {get|put|post|delete|patch} methods. A custom method // can be defined using the 'custom' field. // // Types that are valid to be assigned to Pattern: // *HttpRule_Get // *HttpRule_Put // *HttpRule_Post // *HttpRule_Delete // *HttpRule_Patch // *HttpRule_Custom Pattern isHttpRule_Pattern `protobuf_oneof:"pattern"` // The name of the request field whose value is mapped to the HTTP request // body, or `*` for mapping all request fields not captured by the path // pattern to the HTTP body, or omitted for not having any HTTP request body. // // NOTE: the referred field must be present at the top-level of the request // message type. Body string `protobuf:"bytes,7,opt,name=body,proto3" json:"body,omitempty"` // Optional. The name of the response field whose value is mapped to the HTTP // response body. When omitted, the entire response message will be used // as the HTTP response body. // // NOTE: The referred field must be present at the top-level of the response // message type. ResponseBody string `protobuf:"bytes,12,opt,name=response_body,json=responseBody,proto3" json:"response_body,omitempty"` // Additional HTTP bindings for the selector. Nested bindings must // not contain an `additional_bindings` field themselves (that is, // the nesting may only be one level deep). AdditionalBindings []*HttpRule `protobuf:"bytes,11,rep,name=additional_bindings,json=additionalBindings,proto3" json:"additional_bindings,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *HttpRule) Reset() { *m = HttpRule{} } func (*HttpRule) ProtoMessage() {} func (*HttpRule) Descriptor() ([]byte, []int) { return fileDescriptor_ff9994be407cdcc9, []int{1} } func (m *HttpRule) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *HttpRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_HttpRule.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 *HttpRule) XXX_Merge(src proto.Message) { xxx_messageInfo_HttpRule.Merge(m, src) } func (m *HttpRule) XXX_Size() int { return m.Size() } func (m *HttpRule) XXX_DiscardUnknown() { xxx_messageInfo_HttpRule.DiscardUnknown(m) } var xxx_messageInfo_HttpRule proto.InternalMessageInfo type isHttpRule_Pattern interface { isHttpRule_Pattern() Equal(interface{}) bool MarshalTo([]byte) (int, error) Size() int } type HttpRule_Get struct { Get string `protobuf:"bytes,2,opt,name=get,proto3,oneof" json:"get,omitempty"` } type HttpRule_Put struct { Put string `protobuf:"bytes,3,opt,name=put,proto3,oneof" json:"put,omitempty"` } type HttpRule_Post struct { Post string `protobuf:"bytes,4,opt,name=post,proto3,oneof" json:"post,omitempty"` } type HttpRule_Delete struct { Delete string `protobuf:"bytes,5,opt,name=delete,proto3,oneof" json:"delete,omitempty"` } type HttpRule_Patch struct { Patch string `protobuf:"bytes,6,opt,name=patch,proto3,oneof" json:"patch,omitempty"` } type HttpRule_Custom struct { Custom *CustomHttpPattern `protobuf:"bytes,8,opt,name=custom,proto3,oneof" json:"custom,omitempty"` } func (*HttpRule_Get) isHttpRule_Pattern() {} func (*HttpRule_Put) isHttpRule_Pattern() {} func (*HttpRule_Post) isHttpRule_Pattern() {} func (*HttpRule_Delete) isHttpRule_Pattern() {} func (*HttpRule_Patch) isHttpRule_Pattern() {} func (*HttpRule_Custom) isHttpRule_Pattern() {} func (m *HttpRule) GetPattern() isHttpRule_Pattern { if m != nil { return m.Pattern } return nil } func (m *HttpRule) GetSelector() string { if m != nil { return m.Selector } return "" } func (m *HttpRule) GetGet() string { if x, ok := m.GetPattern().(*HttpRule_Get); ok { return x.Get } return "" } func (m *HttpRule) GetPut() string { if x, ok := m.GetPattern().(*HttpRule_Put); ok { return x.Put } return "" } func (m *HttpRule) GetPost() string { if x, ok := m.GetPattern().(*HttpRule_Post); ok { return x.Post } return "" } func (m *HttpRule) GetDelete() string { if x, ok := m.GetPattern().(*HttpRule_Delete); ok { return x.Delete } return "" } func (m *HttpRule) GetPatch() string { if x, ok := m.GetPattern().(*HttpRule_Patch); ok { return x.Patch } return "" } func (m *HttpRule) GetCustom() *CustomHttpPattern { if x, ok := m.GetPattern().(*HttpRule_Custom); ok { return x.Custom } return nil } func (m *HttpRule) GetBody() string { if m != nil { return m.Body } return "" } func (m *HttpRule) GetResponseBody() string { if m != nil { return m.ResponseBody } return "" } func (m *HttpRule) GetAdditionalBindings() []*HttpRule { if m != nil { return m.AdditionalBindings } return nil } // XXX_OneofWrappers is for the internal use of the proto package. func (*HttpRule) XXX_OneofWrappers() []interface{} { return []interface{}{ (*HttpRule_Get)(nil), (*HttpRule_Put)(nil), (*HttpRule_Post)(nil), (*HttpRule_Delete)(nil), (*HttpRule_Patch)(nil), (*HttpRule_Custom)(nil), } } func (*HttpRule) XXX_MessageName() string { return "google.api.HttpRule" } // A custom pattern is used for defining custom HTTP verb. type CustomHttpPattern struct { // The name of this custom HTTP verb. Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` // The path matched by this custom verb. Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *CustomHttpPattern) Reset() { *m = CustomHttpPattern{} } func (*CustomHttpPattern) ProtoMessage() {} func (*CustomHttpPattern) Descriptor() ([]byte, []int) { return fileDescriptor_ff9994be407cdcc9, []int{2} } func (m *CustomHttpPattern) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *CustomHttpPattern) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_CustomHttpPattern.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 *CustomHttpPattern) XXX_Merge(src proto.Message) { xxx_messageInfo_CustomHttpPattern.Merge(m, src) } func (m *CustomHttpPattern) XXX_Size() int { return m.Size() } func (m *CustomHttpPattern) XXX_DiscardUnknown() { xxx_messageInfo_CustomHttpPattern.DiscardUnknown(m) } var xxx_messageInfo_CustomHttpPattern proto.InternalMessageInfo func (m *CustomHttpPattern) GetKind() string { if m != nil { return m.Kind } return "" } func (m *CustomHttpPattern) GetPath() string { if m != nil { return m.Path } return "" } func (*CustomHttpPattern) XXX_MessageName() string { return "google.api.CustomHttpPattern" } func init() { proto.RegisterType((*Http)(nil), "google.api.Http") proto.RegisterType((*HttpRule)(nil), "google.api.HttpRule") proto.RegisterType((*CustomHttpPattern)(nil), "google.api.CustomHttpPattern") } func init() { proto.RegisterFile("google/api/http.proto", fileDescriptor_ff9994be407cdcc9) } var fileDescriptor_ff9994be407cdcc9 = []byte{ // 440 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xb1, 0x8f, 0xd3, 0x30, 0x14, 0xc6, 0xeb, 0x36, 0xed, 0xb5, 0xaf, 0x07, 0x12, 0xe6, 0x40, 0x16, 0x02, 0x53, 0x95, 0xa5, 0x62, 0xe8, 0x49, 0xc7, 0xc0, 0xc0, 0x44, 0xa0, 0xe2, 0xd8, 0xaa, 0x4c, 0x88, 0x25, 0x72, 0xe3, 0x47, 0x6b, 0x91, 0x8b, 0xad, 0xd8, 0x41, 0x74, 0xe3, 0x6f, 0x61, 0xe2, 0x4f, 0x61, 0x64, 0x44, 0x4c, 0x34, 0x2c, 0x8c, 0x37, 0xde, 0x88, 0xec, 0xa4, 0x5c, 0x25, 0x24, 0xb6, 0xf7, 0x7d, 0xef, 0x97, 0x97, 0x2f, 0x2f, 0x0f, 0xee, 0xac, 0xb5, 0x5e, 0xe7, 0x78, 0x2a, 0x8c, 0x3a, 0xdd, 0x38, 0x67, 0xe6, 0xa6, 0xd4, 0x4e, 0x53, 0x68, 0xec, 0xb9, 0x30, 0x6a, 0xba, 0x85, 0xe8, 0xdc, 0x39, 0x43, 0x1f, 0x43, 0xbf, 0xac, 0x72, 0xb4, 0x8c, 0x4c, 0x7a, 0xb3, 0xf1, 0xd9, 0xc9, 0xfc, 0x9a, 0x99, 0x7b, 0x20, 0xa9, 0x72, 0x4c, 0x1a, 0x84, 0x2e, 0xe0, 0xe1, 0xbb, 0x2a, 0xcf, 0xb7, 0xa9, 0xc4, 0x4c, 0x4b, 0x4c, 0x4b, 0xb4, 0x58, 0x7e, 0x40, 0x99, 0xe2, 0x47, 0x23, 0x0a, 0xab, 0x74, 0xc1, 0xba, 0x13, 0x32, 0x1b, 0x26, 0xf7, 0x03, 0xf6, 0x32, 0x50, 0x49, 0x0b, 0x2d, 0xf6, 0xcc, 0xf4, 0x47, 0x17, 0x86, 0xfb, 0xd1, 0xf4, 0x1e, 0x0c, 0x2d, 0xe6, 0x98, 0x39, 0x5d, 0x32, 0x32, 0x21, 0xb3, 0x51, 0xf2, 0x57, 0x53, 0x0a, 0xbd, 0x35, 0xba, 0x30, 0x73, 0x74, 0xde, 0x49, 0xbc, 0xf0, 0x9e, 0xa9, 0x1c, 0xeb, 0xed, 0x3d, 0x53, 0x39, 0x7a, 0x02, 0x91, 0xd1, 0xd6, 0xb1, 0xa8, 0x35, 0x83, 0xa2, 0x0c, 0x06, 0x12, 0x73, 0x74, 0xc8, 0xfa, 0xad, 0xdf, 0x6a, 0x7a, 0x17, 0xfa, 0x46, 0xb8, 0x6c, 0xc3, 0x06, 0x6d, 0xa3, 0x91, 0xf4, 0x29, 0x0c, 0xb2, 0xca, 0x3a, 0x7d, 0xc1, 0x86, 0x13, 0x32, 0x1b, 0x9f, 0x3d, 0x38, 0x5c, 0xc6, 0x8b, 0xd0, 0xf1, 0xb9, 0x97, 0xc2, 0x39, 0x2c, 0x0b, 0x3f, 0xb0, 0xc1, 0x29, 0x85, 0x68, 0xa5, 0xe5, 0x96, 0x1d, 0x85, 0x0f, 0x08, 0x35, 0x7d, 0x04, 0x37, 0x4a, 0xb4, 0x46, 0x17, 0x16, 0xd3, 0xd0, 0x3c, 0x0e, 0xcd, 0xe3, 0xbd, 0x19, 0x7b, 0x68, 0x01, 0xb7, 0x85, 0x94, 0xca, 0x29, 0x5d, 0x88, 0x3c, 0x5d, 0xa9, 0x42, 0xaa, 0x62, 0x6d, 0xd9, 0xf8, 0x3f, 0xff, 0x82, 0x5e, 0x3f, 0x10, 0xb7, 0x7c, 0x3c, 0x82, 0x23, 0xd3, 0x84, 0x9a, 0x3e, 0x83, 0x5b, 0xff, 0x24, 0xf5, 0xf9, 0xde, 0xab, 0x42, 0xb6, 0x0b, 0x0e, 0xb5, 0xf7, 0x8c, 0x70, 0x9b, 0x66, 0xbb, 0x49, 0xa8, 0xe3, 0x37, 0xdf, 0x77, 0xbc, 0x73, 0xb9, 0xe3, 0xe4, 0x6a, 0xc7, 0xc9, 0xa7, 0x9a, 0x93, 0x2f, 0x35, 0x27, 0x5f, 0x6b, 0x4e, 0xbe, 0xd5, 0x9c, 0xfc, 0xac, 0x39, 0xf9, 0x5d, 0xf3, 0xce, 0xa5, 0xf7, 0x7e, 0x71, 0x02, 0x37, 0x33, 0x7d, 0x71, 0x10, 0x31, 0x1e, 0x85, 0x57, 0xfa, 0x4b, 0x5b, 0x92, 0xb7, 0x3d, 0x61, 0xd4, 0x15, 0x21, 0x9f, 0xbb, 0xd1, 0xab, 0xe7, 0xcb, 0xd7, 0xab, 0x41, 0xb8, 0xc0, 0x27, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x1e, 0x40, 0xdc, 0xc0, 0x9a, 0x02, 0x00, 0x00, } func (this *Http) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Http) if !ok { that2, ok := that.(Http) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if len(this.Rules) != len(that1.Rules) { return false } for i := range this.Rules { if !this.Rules[i].Equal(that1.Rules[i]) { return false } } if this.FullyDecodeReservedExpansion != that1.FullyDecodeReservedExpansion { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *HttpRule) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*HttpRule) if !ok { that2, ok := that.(HttpRule) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Selector != that1.Selector { return false } if that1.Pattern == nil { if this.Pattern != nil { return false } } else if this.Pattern == nil { return false } else if !this.Pattern.Equal(that1.Pattern) { return false } if this.Body != that1.Body { return false } if this.ResponseBody != that1.ResponseBody { return false } if len(this.AdditionalBindings) != len(that1.AdditionalBindings) { return false } for i := range this.AdditionalBindings { if !this.AdditionalBindings[i].Equal(that1.AdditionalBindings[i]) { return false } } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *HttpRule_Get) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*HttpRule_Get) if !ok { that2, ok := that.(HttpRule_Get) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Get != that1.Get { return false } return true } func (this *HttpRule_Put) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*HttpRule_Put) if !ok { that2, ok := that.(HttpRule_Put) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Put != that1.Put { return false } return true } func (this *HttpRule_Post) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*HttpRule_Post) if !ok { that2, ok := that.(HttpRule_Post) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Post != that1.Post { return false } return true } func (this *HttpRule_Delete) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*HttpRule_Delete) if !ok { that2, ok := that.(HttpRule_Delete) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Delete != that1.Delete { return false } return true } func (this *HttpRule_Patch) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*HttpRule_Patch) if !ok { that2, ok := that.(HttpRule_Patch) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Patch != that1.Patch { return false } return true } func (this *HttpRule_Custom) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*HttpRule_Custom) if !ok { that2, ok := that.(HttpRule_Custom) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.Custom.Equal(that1.Custom) { return false } return true } func (this *CustomHttpPattern) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*CustomHttpPattern) if !ok { that2, ok := that.(CustomHttpPattern) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Kind != that1.Kind { return false } if this.Path != that1.Path { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Http) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&api.Http{") if this.Rules != nil { s = append(s, "Rules: "+fmt.Sprintf("%#v", this.Rules)+",\n") } s = append(s, "FullyDecodeReservedExpansion: "+fmt.Sprintf("%#v", this.FullyDecodeReservedExpansion)+",\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 (this *HttpRule) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 14) s = append(s, "&api.HttpRule{") s = append(s, "Selector: "+fmt.Sprintf("%#v", this.Selector)+",\n") if this.Pattern != nil { s = append(s, "Pattern: "+fmt.Sprintf("%#v", this.Pattern)+",\n") } s = append(s, "Body: "+fmt.Sprintf("%#v", this.Body)+",\n") s = append(s, "ResponseBody: "+fmt.Sprintf("%#v", this.ResponseBody)+",\n") if this.AdditionalBindings != nil { s = append(s, "AdditionalBindings: "+fmt.Sprintf("%#v", this.AdditionalBindings)+",\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 (this *HttpRule_Get) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&api.HttpRule_Get{` + `Get:` + fmt.Sprintf("%#v", this.Get) + `}`}, ", ") return s } func (this *HttpRule_Put) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&api.HttpRule_Put{` + `Put:` + fmt.Sprintf("%#v", this.Put) + `}`}, ", ") return s } func (this *HttpRule_Post) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&api.HttpRule_Post{` + `Post:` + fmt.Sprintf("%#v", this.Post) + `}`}, ", ") return s } func (this *HttpRule_Delete) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&api.HttpRule_Delete{` + `Delete:` + fmt.Sprintf("%#v", this.Delete) + `}`}, ", ") return s } func (this *HttpRule_Patch) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&api.HttpRule_Patch{` + `Patch:` + fmt.Sprintf("%#v", this.Patch) + `}`}, ", ") return s } func (this *HttpRule_Custom) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&api.HttpRule_Custom{` + `Custom:` + fmt.Sprintf("%#v", this.Custom) + `}`}, ", ") return s } func (this *CustomHttpPattern) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&api.CustomHttpPattern{") s = append(s, "Kind: "+fmt.Sprintf("%#v", this.Kind)+",\n") s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\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 valueToGoStringHttp(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 *Http) 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 *Http) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Http) 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.FullyDecodeReservedExpansion { i-- if m.FullyDecodeReservedExpansion { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x10 } if len(m.Rules) > 0 { for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Rules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintHttp(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *HttpRule) 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 *HttpRule) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *HttpRule) 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 len(m.ResponseBody) > 0 { i -= len(m.ResponseBody) copy(dAtA[i:], m.ResponseBody) i = encodeVarintHttp(dAtA, i, uint64(len(m.ResponseBody))) i-- dAtA[i] = 0x62 } if len(m.AdditionalBindings) > 0 { for iNdEx := len(m.AdditionalBindings) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.AdditionalBindings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintHttp(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x5a } } if m.Pattern != nil { { size := m.Pattern.Size() i -= size if _, err := m.Pattern.MarshalTo(dAtA[i:]); err != nil { return 0, err } } } if len(m.Body) > 0 { i -= len(m.Body) copy(dAtA[i:], m.Body) i = encodeVarintHttp(dAtA, i, uint64(len(m.Body))) i-- dAtA[i] = 0x3a } if len(m.Selector) > 0 { i -= len(m.Selector) copy(dAtA[i:], m.Selector) i = encodeVarintHttp(dAtA, i, uint64(len(m.Selector))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *HttpRule_Get) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *HttpRule_Get) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i -= len(m.Get) copy(dAtA[i:], m.Get) i = encodeVarintHttp(dAtA, i, uint64(len(m.Get))) i-- dAtA[i] = 0x12 return len(dAtA) - i, nil } func (m *HttpRule_Put) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *HttpRule_Put) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i -= len(m.Put) copy(dAtA[i:], m.Put) i = encodeVarintHttp(dAtA, i, uint64(len(m.Put))) i-- dAtA[i] = 0x1a return len(dAtA) - i, nil } func (m *HttpRule_Post) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *HttpRule_Post) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i -= len(m.Post) copy(dAtA[i:], m.Post) i = encodeVarintHttp(dAtA, i, uint64(len(m.Post))) i-- dAtA[i] = 0x22 return len(dAtA) - i, nil } func (m *HttpRule_Delete) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *HttpRule_Delete) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i -= len(m.Delete) copy(dAtA[i:], m.Delete) i = encodeVarintHttp(dAtA, i, uint64(len(m.Delete))) i-- dAtA[i] = 0x2a return len(dAtA) - i, nil } func (m *HttpRule_Patch) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *HttpRule_Patch) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) i -= len(m.Patch) copy(dAtA[i:], m.Patch) i = encodeVarintHttp(dAtA, i, uint64(len(m.Patch))) i-- dAtA[i] = 0x32 return len(dAtA) - i, nil } func (m *HttpRule_Custom) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *HttpRule_Custom) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.Custom != nil { { size, err := m.Custom.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintHttp(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 } return len(dAtA) - i, nil } func (m *CustomHttpPattern) 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 *CustomHttpPattern) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *CustomHttpPattern) 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 len(m.Path) > 0 { i -= len(m.Path) copy(dAtA[i:], m.Path) i = encodeVarintHttp(dAtA, i, uint64(len(m.Path))) i-- dAtA[i] = 0x12 } if len(m.Kind) > 0 { i -= len(m.Kind) copy(dAtA[i:], m.Kind) i = encodeVarintHttp(dAtA, i, uint64(len(m.Kind))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintHttp(dAtA []byte, offset int, v uint64) int { offset -= sovHttp(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedHttp(r randyHttp, easy bool) *Http { this := &Http{} if r.Intn(5) == 0 { v1 := r.Intn(5) this.Rules = make([]*HttpRule, v1) for i := 0; i < v1; i++ { this.Rules[i] = NewPopulatedHttpRule(r, easy) } } this.FullyDecodeReservedExpansion = bool(bool(r.Intn(2) == 0)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedHttp(r, 3) } return this } func NewPopulatedHttpRule(r randyHttp, easy bool) *HttpRule { this := &HttpRule{} this.Selector = string(randStringHttp(r)) oneofNumber_Pattern := []int32{2, 3, 4, 5, 6, 8}[r.Intn(6)] switch oneofNumber_Pattern { case 2: this.Pattern = NewPopulatedHttpRule_Get(r, easy) case 3: this.Pattern = NewPopulatedHttpRule_Put(r, easy) case 4: this.Pattern = NewPopulatedHttpRule_Post(r, easy) case 5: this.Pattern = NewPopulatedHttpRule_Delete(r, easy) case 6: this.Pattern = NewPopulatedHttpRule_Patch(r, easy) case 8: this.Pattern = NewPopulatedHttpRule_Custom(r, easy) } this.Body = string(randStringHttp(r)) if r.Intn(5) == 0 { v2 := r.Intn(5) this.AdditionalBindings = make([]*HttpRule, v2) for i := 0; i < v2; i++ { this.AdditionalBindings[i] = NewPopulatedHttpRule(r, easy) } } this.ResponseBody = string(randStringHttp(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedHttp(r, 13) } return this } func NewPopulatedHttpRule_Get(r randyHttp, easy bool) *HttpRule_Get { this := &HttpRule_Get{} this.Get = string(randStringHttp(r)) return this } func NewPopulatedHttpRule_Put(r randyHttp, easy bool) *HttpRule_Put { this := &HttpRule_Put{} this.Put = string(randStringHttp(r)) return this } func NewPopulatedHttpRule_Post(r randyHttp, easy bool) *HttpRule_Post { this := &HttpRule_Post{} this.Post = string(randStringHttp(r)) return this } func NewPopulatedHttpRule_Delete(r randyHttp, easy bool) *HttpRule_Delete { this := &HttpRule_Delete{} this.Delete = string(randStringHttp(r)) return this } func NewPopulatedHttpRule_Patch(r randyHttp, easy bool) *HttpRule_Patch { this := &HttpRule_Patch{} this.Patch = string(randStringHttp(r)) return this } func NewPopulatedHttpRule_Custom(r randyHttp, easy bool) *HttpRule_Custom { this := &HttpRule_Custom{} this.Custom = NewPopulatedCustomHttpPattern(r, easy) return this } func NewPopulatedCustomHttpPattern(r randyHttp, easy bool) *CustomHttpPattern { this := &CustomHttpPattern{} this.Kind = string(randStringHttp(r)) this.Path = string(randStringHttp(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedHttp(r, 3) } return this } type randyHttp interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneHttp(r randyHttp) 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 randStringHttp(r randyHttp) string { v3 := r.Intn(100) tmps := make([]rune, v3) for i := 0; i < v3; i++ { tmps[i] = randUTF8RuneHttp(r) } return string(tmps) } func randUnrecognizedHttp(r randyHttp, 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 = randFieldHttp(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldHttp(dAtA []byte, r randyHttp, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateHttp(dAtA, uint64(key)) v4 := r.Int63() if r.Intn(2) == 0 { v4 *= -1 } dAtA = encodeVarintPopulateHttp(dAtA, uint64(v4)) case 1: dAtA = encodeVarintPopulateHttp(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 = encodeVarintPopulateHttp(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateHttp(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateHttp(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 encodeVarintPopulateHttp(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 *Http) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Rules) > 0 { for _, e := range m.Rules { l = e.Size() n += 1 + l + sovHttp(uint64(l)) } } if m.FullyDecodeReservedExpansion { n += 2 } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *HttpRule) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Selector) if l > 0 { n += 1 + l + sovHttp(uint64(l)) } if m.Pattern != nil { n += m.Pattern.Size() } l = len(m.Body) if l > 0 { n += 1 + l + sovHttp(uint64(l)) } if len(m.AdditionalBindings) > 0 { for _, e := range m.AdditionalBindings { l = e.Size() n += 1 + l + sovHttp(uint64(l)) } } l = len(m.ResponseBody) if l > 0 { n += 1 + l + sovHttp(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *HttpRule_Get) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Get) n += 1 + l + sovHttp(uint64(l)) return n } func (m *HttpRule_Put) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Put) n += 1 + l + sovHttp(uint64(l)) return n } func (m *HttpRule_Post) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Post) n += 1 + l + sovHttp(uint64(l)) return n } func (m *HttpRule_Delete) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Delete) n += 1 + l + sovHttp(uint64(l)) return n } func (m *HttpRule_Patch) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Patch) n += 1 + l + sovHttp(uint64(l)) return n } func (m *HttpRule_Custom) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Custom != nil { l = m.Custom.Size() n += 1 + l + sovHttp(uint64(l)) } return n } func (m *CustomHttpPattern) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Kind) if l > 0 { n += 1 + l + sovHttp(uint64(l)) } l = len(m.Path) if l > 0 { n += 1 + l + sovHttp(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovHttp(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozHttp(x uint64) (n int) { return sovHttp(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *Http) String() string { if this == nil { return "nil" } repeatedStringForRules := "[]*HttpRule{" for _, f := range this.Rules { repeatedStringForRules += strings.Replace(f.String(), "HttpRule", "HttpRule", 1) + "," } repeatedStringForRules += "}" s := strings.Join([]string{`&Http{`, `Rules:` + repeatedStringForRules + `,`, `FullyDecodeReservedExpansion:` + fmt.Sprintf("%v", this.FullyDecodeReservedExpansion) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *HttpRule) String() string { if this == nil { return "nil" } repeatedStringForAdditionalBindings := "[]*HttpRule{" for _, f := range this.AdditionalBindings { repeatedStringForAdditionalBindings += strings.Replace(f.String(), "HttpRule", "HttpRule", 1) + "," } repeatedStringForAdditionalBindings += "}" s := strings.Join([]string{`&HttpRule{`, `Selector:` + fmt.Sprintf("%v", this.Selector) + `,`, `Pattern:` + fmt.Sprintf("%v", this.Pattern) + `,`, `Body:` + fmt.Sprintf("%v", this.Body) + `,`, `AdditionalBindings:` + repeatedStringForAdditionalBindings + `,`, `ResponseBody:` + fmt.Sprintf("%v", this.ResponseBody) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *HttpRule_Get) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&HttpRule_Get{`, `Get:` + fmt.Sprintf("%v", this.Get) + `,`, `}`, }, "") return s } func (this *HttpRule_Put) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&HttpRule_Put{`, `Put:` + fmt.Sprintf("%v", this.Put) + `,`, `}`, }, "") return s } func (this *HttpRule_Post) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&HttpRule_Post{`, `Post:` + fmt.Sprintf("%v", this.Post) + `,`, `}`, }, "") return s } func (this *HttpRule_Delete) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&HttpRule_Delete{`, `Delete:` + fmt.Sprintf("%v", this.Delete) + `,`, `}`, }, "") return s } func (this *HttpRule_Patch) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&HttpRule_Patch{`, `Patch:` + fmt.Sprintf("%v", this.Patch) + `,`, `}`, }, "") return s } func (this *HttpRule_Custom) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&HttpRule_Custom{`, `Custom:` + strings.Replace(fmt.Sprintf("%v", this.Custom), "CustomHttpPattern", "CustomHttpPattern", 1) + `,`, `}`, }, "") return s } func (this *CustomHttpPattern) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&CustomHttpPattern{`, `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, `Path:` + fmt.Sprintf("%v", this.Path) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringHttp(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *Http) 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 ErrIntOverflowHttp } 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: Http: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Http: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHttp } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthHttp } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthHttp } if postIndex > l { return io.ErrUnexpectedEOF } m.Rules = append(m.Rules, &HttpRule{}) if err := m.Rules[len(m.Rules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field FullyDecodeReservedExpansion", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHttp } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.FullyDecodeReservedExpansion = bool(v != 0) default: iNdEx = preIndex skippy, err := skipHttp(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthHttp } if (iNdEx + skippy) < 0 { return ErrInvalidLengthHttp } 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 (m *HttpRule) 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 ErrIntOverflowHttp } 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: HttpRule: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: HttpRule: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHttp } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthHttp } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthHttp } if postIndex > l { return io.ErrUnexpectedEOF } m.Selector = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Get", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHttp } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthHttp } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthHttp } if postIndex > l { return io.ErrUnexpectedEOF } m.Pattern = &HttpRule_Get{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Put", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHttp } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthHttp } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthHttp } if postIndex > l { return io.ErrUnexpectedEOF } m.Pattern = &HttpRule_Put{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Post", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHttp } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthHttp } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthHttp } if postIndex > l { return io.ErrUnexpectedEOF } m.Pattern = &HttpRule_Post{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Delete", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHttp } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthHttp } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthHttp } if postIndex > l { return io.ErrUnexpectedEOF } m.Pattern = &HttpRule_Delete{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Patch", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHttp } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthHttp } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthHttp } if postIndex > l { return io.ErrUnexpectedEOF } m.Pattern = &HttpRule_Patch{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHttp } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthHttp } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthHttp } if postIndex > l { return io.ErrUnexpectedEOF } m.Body = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Custom", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHttp } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthHttp } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthHttp } if postIndex > l { return io.ErrUnexpectedEOF } v := &CustomHttpPattern{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Pattern = &HttpRule_Custom{v} iNdEx = postIndex case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AdditionalBindings", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHttp } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthHttp } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthHttp } if postIndex > l { return io.ErrUnexpectedEOF } m.AdditionalBindings = append(m.AdditionalBindings, &HttpRule{}) if err := m.AdditionalBindings[len(m.AdditionalBindings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ResponseBody", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHttp } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthHttp } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthHttp } if postIndex > l { return io.ErrUnexpectedEOF } m.ResponseBody = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipHttp(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthHttp } if (iNdEx + skippy) < 0 { return ErrInvalidLengthHttp } 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 (m *CustomHttpPattern) 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 ErrIntOverflowHttp } 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: CustomHttpPattern: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CustomHttpPattern: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHttp } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthHttp } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthHttp } if postIndex > l { return io.ErrUnexpectedEOF } m.Kind = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowHttp } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthHttp } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthHttp } if postIndex > l { return io.ErrUnexpectedEOF } m.Path = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipHttp(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthHttp } if (iNdEx + skippy) < 0 { return ErrInvalidLengthHttp } 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 skipHttp(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, ErrIntOverflowHttp } 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, ErrIntOverflowHttp } 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, ErrIntOverflowHttp } 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, ErrInvalidLengthHttp } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupHttp } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthHttp } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthHttp = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowHttp = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupHttp = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/api/http.proto000066400000000000000000000353521365205541600177550ustar00rootroot00000000000000// 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.api; option cc_enable_arenas = true; option go_package = "api"; option java_multiple_files = true; option java_outer_classname = "HttpProto"; option java_package = "com.google.api"; option objc_class_prefix = "GAPI"; // Defines the HTTP configuration for an API service. It contains a list of // [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method // to one or more HTTP REST API methods. message Http { // A list of HTTP configuration rules that apply to individual API methods. // // **NOTE:** All service configuration rules follow "last one wins" order. repeated HttpRule rules = 1; // When set to true, URL path parameters will be fully URI-decoded except in // cases of single segment matches in reserved expansion, where "%2F" will be // left encoded. // // The default behavior is to not decode RFC 6570 reserved characters in multi // segment matches. bool fully_decode_reserved_expansion = 2; } // # gRPC Transcoding // // gRPC Transcoding is a feature for mapping between a gRPC method and one or // more HTTP REST endpoints. It allows developers to build a single API service // that supports both gRPC APIs and REST APIs. Many systems, including [Google // APIs](https://github.com/googleapis/googleapis), // [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC // Gateway](https://github.com/grpc-ecosystem/grpc-gateway), // and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature // and use it for large scale production services. // // `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies // how different portions of the gRPC request message are mapped to the URL // path, URL query parameters, and HTTP request body. It also controls how the // gRPC response message is mapped to the HTTP response body. `HttpRule` is // typically specified as an `google.api.http` annotation on the gRPC method. // // Each mapping specifies a URL path template and an HTTP method. The path // template may refer to one or more fields in the gRPC request message, as long // as each field is a non-repeated field with a primitive (non-message) type. // The path template controls how fields of the request message are mapped to // the URL path. // // Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/{name=messages/*}" // }; // } // } // message GetMessageRequest { // string name = 1; // Mapped to URL path. // } // message Message { // string text = 1; // The resource content. // } // // This enables an HTTP REST to gRPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` // // Any fields in the request message which are not bound by the path template // automatically become HTTP query parameters if there is no HTTP request body. // For example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get:"/v1/messages/{message_id}" // }; // } // } // message GetMessageRequest { // message SubMessage { // string subfield = 1; // } // string message_id = 1; // Mapped to URL path. // int64 revision = 2; // Mapped to URL query parameter `revision`. // SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. // } // // This enables a HTTP JSON to RPC mapping as below: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456?revision=2&sub.subfield=foo` | // `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: // "foo"))` // // Note that fields which are mapped to URL query parameters must have a // primitive type or a repeated primitive type or a non-repeated message type. // In the case of a repeated type, the parameter can be repeated in the URL // as `...?param=A¶m=B`. In the case of a message type, each field of the // message is mapped to a separate parameter, such as // `...?foo.a=A&foo.b=B&foo.c=C`. // // For HTTP methods that allow a request body, the `body` field // specifies the mapping. Consider a REST update method on the // message resource collection: // // service Messaging { // rpc UpdateMessage(UpdateMessageRequest) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "message" // }; // } // } // message UpdateMessageRequest { // string message_id = 1; // mapped to the URL // Message message = 2; // mapped to the body // } // // The following HTTP JSON to RPC mapping is enabled, where the // representation of the JSON in the request body is determined by // protos JSON encoding: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" message { text: "Hi!" })` // // The special name `*` can be used in the body mapping to define that // every field not bound by the path template should be mapped to the // request body. This enables the following alternative definition of // the update method: // // service Messaging { // rpc UpdateMessage(Message) returns (Message) { // option (google.api.http) = { // patch: "/v1/messages/{message_id}" // body: "*" // }; // } // } // message Message { // string message_id = 1; // string text = 2; // } // // // The following HTTP JSON to RPC mapping is enabled: // // HTTP | gRPC // -----|----- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: // "123456" text: "Hi!")` // // Note that when using `*` in the body mapping, it is not possible to // have HTTP parameters, as all fields not bound by the path end in // the body. This makes this option more rarely used in practice when // defining REST APIs. The common usage of `*` is in custom methods // which don't use the URL at all for transferring data. // // It is possible to define multiple HTTP methods for one RPC by using // the `additional_bindings` option. Example: // // service Messaging { // rpc GetMessage(GetMessageRequest) returns (Message) { // option (google.api.http) = { // get: "/v1/messages/{message_id}" // additional_bindings { // get: "/v1/users/{user_id}/messages/{message_id}" // } // }; // } // } // message GetMessageRequest { // string message_id = 1; // string user_id = 2; // } // // This enables the following two alternative HTTP JSON to RPC mappings: // // HTTP | gRPC // -----|----- // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: // "123456")` // // ## Rules for HTTP mapping // // 1. Leaf request fields (recursive expansion nested messages in the request // message) are classified into three categories: // - Fields referred by the path template. They are passed via the URL path. // - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP // request body. // - All other fields are passed via the URL query parameters, and the // parameter name is the field path in the request message. A repeated // field can be represented as multiple query parameters under the same // name. // 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields // are passed via URL path and HTTP request body. // 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all // fields are passed via URL path and URL query parameters. // // ### Path template syntax // // Template = "/" Segments [ Verb ] ; // Segments = Segment { "/" Segment } ; // Segment = "*" | "**" | LITERAL | Variable ; // Variable = "{" FieldPath [ "=" Segments ] "}" ; // FieldPath = IDENT { "." IDENT } ; // Verb = ":" LITERAL ; // // The syntax `*` matches a single URL path segment. The syntax `**` matches // zero or more URL path segments, which must be the last part of the URL path // except the `Verb`. // // The syntax `Variable` matches part of the URL path as specified by its // template. A variable template must not contain other variables. If a variable // matches a single path segment, its template may be omitted, e.g. `{var}` // is equivalent to `{var=*}`. // // The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` // contains any reserved character, such characters should be percent-encoded // before the matching. // // If a variable contains exactly one path segment, such as `"{var}"` or // `"{var=*}"`, when such a variable is expanded into a URL path on the client // side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The // server side does the reverse decoding. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{var}`. // // If a variable contains multiple path segments, such as `"{var=foo/*}"` // or `"{var=**}"`, when such a variable is expanded into a URL path on the // client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. // The server side does the reverse decoding, except "%2F" and "%2f" are left // unchanged. Such variables show up in the // [Discovery // Document](https://developers.google.com/discovery/v1/reference/apis) as // `{+var}`. // // ## Using gRPC API Service Configuration // // gRPC API Service Configuration (service config) is a configuration language // for configuring a gRPC service to become a user-facing product. The // service config is simply the YAML representation of the `google.api.Service` // proto message. // // As an alternative to annotating your proto file, you can configure gRPC // transcoding in your service config YAML files. You do this by specifying a // `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same // effect as the proto annotation. This can be particularly useful if you // have a proto that is reused in multiple services. Note that any transcoding // specified in the service config will override any matching transcoding // configuration in the proto. // // Example: // // http: // rules: // # Selects a gRPC method and applies HttpRule to it. // - selector: example.v1.Messaging.GetMessage // get: /v1/messages/{message_id}/{sub.subfield} // // ## Special notes // // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the // proto to JSON conversion must follow the [proto3 // specification](https://developers.google.com/protocol-buffers/docs/proto3#json). // // While the single segment variable follows the semantics of // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String // Expansion, the multi segment variable **does not** follow RFC 6570 Section // 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion // does not expand special characters like `?` and `#`, which would lead // to invalid URLs. As the result, gRPC Transcoding uses a custom encoding // for multi segment variables. // // The path variables **must not** refer to any repeated or mapped field, // because client libraries are not capable of handling such variable expansion. // // The path variables **must not** capture the leading "/" character. The reason // is that the most common use case "{var}" does not capture the leading "/" // character. For consistency, all path variables must share the same behavior. // // Repeated message fields must not be mapped to URL query parameters, because // no client library can support such complicated mapping. // // If an API needs to use a JSON array for request or response body, it can map // the request or response body to a repeated field. However, some gRPC // Transcoding implementations may not support this feature. message HttpRule { // Selects a method to which this rule applies. // // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. string selector = 1; // Determines the URL pattern is matched by this rules. This pattern can be // used with any of the {get|put|post|delete|patch} methods. A custom method // can be defined using the 'custom' field. oneof pattern { // Maps to HTTP GET. Used for listing and getting information about // resources. string get = 2; // Maps to HTTP PUT. Used for replacing a resource. string put = 3; // Maps to HTTP POST. Used for creating a resource or performing an action. string post = 4; // Maps to HTTP DELETE. Used for deleting a resource. string delete = 5; // Maps to HTTP PATCH. Used for updating a resource. string patch = 6; // The custom pattern is used for specifying an HTTP method that is not // included in the `pattern` field, such as HEAD, or "*" to leave the // HTTP method unspecified for this rule. The wild-card rule is useful // for services that provide content to Web (HTML) clients. CustomHttpPattern custom = 8; } // The name of the request field whose value is mapped to the HTTP request // body, or `*` for mapping all request fields not captured by the path // pattern to the HTTP body, or omitted for not having any HTTP request body. // // NOTE: the referred field must be present at the top-level of the request // message type. string body = 7; // Optional. The name of the response field whose value is mapped to the HTTP // response body. When omitted, the entire response message will be used // as the HTTP response body. // // NOTE: The referred field must be present at the top-level of the response // message type. string response_body = 12; // Additional HTTP bindings for the selector. Nested bindings must // not contain an `additional_bindings` field themselves (that is, // the nesting may only be one level deep). repeated HttpRule additional_bindings = 11; } // A custom pattern is used for defining custom HTTP verb. message CustomHttpPattern { // The name of this custom HTTP verb. string kind = 1; // The path matched by this custom verb. string path = 2; } googleapis-1.4.0/google/geo/000077500000000000000000000000001365205541600157025ustar00rootroot00000000000000googleapis-1.4.0/google/geo/type/000077500000000000000000000000001365205541600166635ustar00rootroot00000000000000googleapis-1.4.0/google/geo/type/viewport.pb.go000066400000000000000000000361661365205541600215050ustar00rootroot00000000000000// 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") ) googleapis-1.4.0/google/geo/type/viewport.proto000066400000000000000000000044641365205541600216370ustar00rootroot00000000000000// 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; } googleapis-1.4.0/google/longrunning/000077500000000000000000000000001365205541600174705ustar00rootroot00000000000000googleapis-1.4.0/google/longrunning/operations.pb.go000066400000000000000000002707421365205541600226160ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/longrunning/operations.proto package longrunning import ( bytes "bytes" context "context" fmt "fmt" _ "github.com/gogo/googleapis/google/api" rpc "github.com/gogo/googleapis/google/rpc" proto "github.com/gogo/protobuf/proto" descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" types "github.com/gogo/protobuf/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" 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 // This resource represents a long-running operation that is the result of a // network API call. type Operation struct { // The server-assigned name, which is only unique within the same service that // originally returns it. If you use the default HTTP mapping, the // `name` should be a resource name ending with `operations/{unique_id}`. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Service-specific metadata associated with the operation. It typically // contains progress information and common metadata such as create time. // Some services might not provide such metadata. Any method that returns a // long-running operation should document the metadata type, if any. Metadata *types.Any `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` // If the value is `false`, it means the operation is still in progress. // If `true`, the operation is completed, and either `error` or `response` is // available. Done bool `protobuf:"varint,3,opt,name=done,proto3" json:"done,omitempty"` // The operation result, which can be either an `error` or a valid `response`. // If `done` == `false`, neither `error` nor `response` is set. // If `done` == `true`, exactly one of `error` or `response` is set. // // Types that are valid to be assigned to Result: // *Operation_Error // *Operation_Response Result isOperation_Result `protobuf_oneof:"result"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Operation) Reset() { *m = Operation{} } func (*Operation) ProtoMessage() {} func (*Operation) Descriptor() ([]byte, []int) { return fileDescriptor_bff5d3ff9032d7eb, []int{0} } func (m *Operation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Operation.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 *Operation) XXX_Merge(src proto.Message) { xxx_messageInfo_Operation.Merge(m, src) } func (m *Operation) XXX_Size() int { return m.Size() } func (m *Operation) XXX_DiscardUnknown() { xxx_messageInfo_Operation.DiscardUnknown(m) } var xxx_messageInfo_Operation proto.InternalMessageInfo type isOperation_Result interface { isOperation_Result() Equal(interface{}) bool MarshalTo([]byte) (int, error) Size() int } type Operation_Error struct { Error *rpc.Status `protobuf:"bytes,4,opt,name=error,proto3,oneof" json:"error,omitempty"` } type Operation_Response struct { Response *types.Any `protobuf:"bytes,5,opt,name=response,proto3,oneof" json:"response,omitempty"` } func (*Operation_Error) isOperation_Result() {} func (*Operation_Response) isOperation_Result() {} func (m *Operation) GetResult() isOperation_Result { if m != nil { return m.Result } return nil } func (m *Operation) GetName() string { if m != nil { return m.Name } return "" } func (m *Operation) GetMetadata() *types.Any { if m != nil { return m.Metadata } return nil } func (m *Operation) GetDone() bool { if m != nil { return m.Done } return false } func (m *Operation) GetError() *rpc.Status { if x, ok := m.GetResult().(*Operation_Error); ok { return x.Error } return nil } func (m *Operation) GetResponse() *types.Any { if x, ok := m.GetResult().(*Operation_Response); ok { return x.Response } return nil } // XXX_OneofWrappers is for the internal use of the proto package. func (*Operation) XXX_OneofWrappers() []interface{} { return []interface{}{ (*Operation_Error)(nil), (*Operation_Response)(nil), } } func (*Operation) XXX_MessageName() string { return "google.longrunning.Operation" } // The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation]. type GetOperationRequest struct { // The name of the operation resource. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *GetOperationRequest) Reset() { *m = GetOperationRequest{} } func (*GetOperationRequest) ProtoMessage() {} func (*GetOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor_bff5d3ff9032d7eb, []int{1} } func (m *GetOperationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *GetOperationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_GetOperationRequest.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 *GetOperationRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_GetOperationRequest.Merge(m, src) } func (m *GetOperationRequest) XXX_Size() int { return m.Size() } func (m *GetOperationRequest) XXX_DiscardUnknown() { xxx_messageInfo_GetOperationRequest.DiscardUnknown(m) } var xxx_messageInfo_GetOperationRequest proto.InternalMessageInfo func (m *GetOperationRequest) GetName() string { if m != nil { return m.Name } return "" } func (*GetOperationRequest) XXX_MessageName() string { return "google.longrunning.GetOperationRequest" } // The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. type ListOperationsRequest struct { // The name of the operation's parent resource. Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // The standard list filter. Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` // The standard list page size. PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // The standard list page token. PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListOperationsRequest) Reset() { *m = ListOperationsRequest{} } func (*ListOperationsRequest) ProtoMessage() {} func (*ListOperationsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_bff5d3ff9032d7eb, []int{2} } func (m *ListOperationsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListOperationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListOperationsRequest.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 *ListOperationsRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ListOperationsRequest.Merge(m, src) } func (m *ListOperationsRequest) XXX_Size() int { return m.Size() } func (m *ListOperationsRequest) XXX_DiscardUnknown() { xxx_messageInfo_ListOperationsRequest.DiscardUnknown(m) } var xxx_messageInfo_ListOperationsRequest proto.InternalMessageInfo func (m *ListOperationsRequest) GetName() string { if m != nil { return m.Name } return "" } func (m *ListOperationsRequest) GetFilter() string { if m != nil { return m.Filter } return "" } func (m *ListOperationsRequest) GetPageSize() int32 { if m != nil { return m.PageSize } return 0 } func (m *ListOperationsRequest) GetPageToken() string { if m != nil { return m.PageToken } return "" } func (*ListOperationsRequest) XXX_MessageName() string { return "google.longrunning.ListOperationsRequest" } // The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. type ListOperationsResponse struct { // A list of operations that matches the specified filter in the request. Operations []*Operation `protobuf:"bytes,1,rep,name=operations,proto3" json:"operations,omitempty"` // The standard List next-page token. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListOperationsResponse) Reset() { *m = ListOperationsResponse{} } func (*ListOperationsResponse) ProtoMessage() {} func (*ListOperationsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_bff5d3ff9032d7eb, []int{3} } func (m *ListOperationsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListOperationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListOperationsResponse.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 *ListOperationsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ListOperationsResponse.Merge(m, src) } func (m *ListOperationsResponse) XXX_Size() int { return m.Size() } func (m *ListOperationsResponse) XXX_DiscardUnknown() { xxx_messageInfo_ListOperationsResponse.DiscardUnknown(m) } var xxx_messageInfo_ListOperationsResponse proto.InternalMessageInfo func (m *ListOperationsResponse) GetOperations() []*Operation { if m != nil { return m.Operations } return nil } func (m *ListOperationsResponse) GetNextPageToken() string { if m != nil { return m.NextPageToken } return "" } func (*ListOperationsResponse) XXX_MessageName() string { return "google.longrunning.ListOperationsResponse" } // The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]. type CancelOperationRequest struct { // The name of the operation resource to be cancelled. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *CancelOperationRequest) Reset() { *m = CancelOperationRequest{} } func (*CancelOperationRequest) ProtoMessage() {} func (*CancelOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor_bff5d3ff9032d7eb, []int{4} } func (m *CancelOperationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *CancelOperationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_CancelOperationRequest.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 *CancelOperationRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_CancelOperationRequest.Merge(m, src) } func (m *CancelOperationRequest) XXX_Size() int { return m.Size() } func (m *CancelOperationRequest) XXX_DiscardUnknown() { xxx_messageInfo_CancelOperationRequest.DiscardUnknown(m) } var xxx_messageInfo_CancelOperationRequest proto.InternalMessageInfo func (m *CancelOperationRequest) GetName() string { if m != nil { return m.Name } return "" } func (*CancelOperationRequest) XXX_MessageName() string { return "google.longrunning.CancelOperationRequest" } // The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation]. type DeleteOperationRequest struct { // The name of the operation resource to be deleted. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *DeleteOperationRequest) Reset() { *m = DeleteOperationRequest{} } func (*DeleteOperationRequest) ProtoMessage() {} func (*DeleteOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor_bff5d3ff9032d7eb, []int{5} } func (m *DeleteOperationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *DeleteOperationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DeleteOperationRequest.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 *DeleteOperationRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_DeleteOperationRequest.Merge(m, src) } func (m *DeleteOperationRequest) XXX_Size() int { return m.Size() } func (m *DeleteOperationRequest) XXX_DiscardUnknown() { xxx_messageInfo_DeleteOperationRequest.DiscardUnknown(m) } var xxx_messageInfo_DeleteOperationRequest proto.InternalMessageInfo func (m *DeleteOperationRequest) GetName() string { if m != nil { return m.Name } return "" } func (*DeleteOperationRequest) XXX_MessageName() string { return "google.longrunning.DeleteOperationRequest" } // The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation]. type WaitOperationRequest struct { // The name of the operation resource to wait on. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The maximum duration to wait before timing out. If left blank, the wait // will be at most the time permitted by the underlying HTTP/RPC protocol. // If RPC context deadline is also specified, the shorter one will be used. Timeout *types.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *WaitOperationRequest) Reset() { *m = WaitOperationRequest{} } func (*WaitOperationRequest) ProtoMessage() {} func (*WaitOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor_bff5d3ff9032d7eb, []int{6} } func (m *WaitOperationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *WaitOperationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_WaitOperationRequest.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 *WaitOperationRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_WaitOperationRequest.Merge(m, src) } func (m *WaitOperationRequest) XXX_Size() int { return m.Size() } func (m *WaitOperationRequest) XXX_DiscardUnknown() { xxx_messageInfo_WaitOperationRequest.DiscardUnknown(m) } var xxx_messageInfo_WaitOperationRequest proto.InternalMessageInfo func (m *WaitOperationRequest) GetName() string { if m != nil { return m.Name } return "" } func (m *WaitOperationRequest) GetTimeout() *types.Duration { if m != nil { return m.Timeout } return nil } func (*WaitOperationRequest) XXX_MessageName() string { return "google.longrunning.WaitOperationRequest" } // A message representing the message types used by a long-running operation. // // Example: // // rpc LongRunningRecognize(LongRunningRecognizeRequest) // returns (google.longrunning.Operation) { // option (google.longrunning.operation_info) = { // response_type: "LongRunningRecognizeResponse" // metadata_type: "LongRunningRecognizeMetadata" // }; // } type OperationInfo struct { // Required. The message name of the primary return type for this // long-running operation. // This type will be used to deserialize the LRO's response. // // If the response is in a different package from the rpc, a fully-qualified // message name must be used (e.g. `google.protobuf.Struct`). // // Note: Altering this value constitutes a breaking change. ResponseType string `protobuf:"bytes,1,opt,name=response_type,json=responseType,proto3" json:"response_type,omitempty"` // Required. The message name of the metadata type for this long-running // operation. // // If the response is in a different package from the rpc, a fully-qualified // message name must be used (e.g. `google.protobuf.Struct`). // // Note: Altering this value constitutes a breaking change. MetadataType string `protobuf:"bytes,2,opt,name=metadata_type,json=metadataType,proto3" json:"metadata_type,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *OperationInfo) Reset() { *m = OperationInfo{} } func (*OperationInfo) ProtoMessage() {} func (*OperationInfo) Descriptor() ([]byte, []int) { return fileDescriptor_bff5d3ff9032d7eb, []int{7} } func (m *OperationInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *OperationInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_OperationInfo.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 *OperationInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_OperationInfo.Merge(m, src) } func (m *OperationInfo) XXX_Size() int { return m.Size() } func (m *OperationInfo) XXX_DiscardUnknown() { xxx_messageInfo_OperationInfo.DiscardUnknown(m) } var xxx_messageInfo_OperationInfo proto.InternalMessageInfo func (m *OperationInfo) GetResponseType() string { if m != nil { return m.ResponseType } return "" } func (m *OperationInfo) GetMetadataType() string { if m != nil { return m.MetadataType } return "" } func (*OperationInfo) XXX_MessageName() string { return "google.longrunning.OperationInfo" } var E_OperationInfo = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MethodOptions)(nil), ExtensionType: (*OperationInfo)(nil), Field: 1049, Name: "google.longrunning.operation_info", Tag: "bytes,1049,opt,name=operation_info", Filename: "google/longrunning/operations.proto", } func init() { proto.RegisterType((*Operation)(nil), "google.longrunning.Operation") proto.RegisterType((*GetOperationRequest)(nil), "google.longrunning.GetOperationRequest") proto.RegisterType((*ListOperationsRequest)(nil), "google.longrunning.ListOperationsRequest") proto.RegisterType((*ListOperationsResponse)(nil), "google.longrunning.ListOperationsResponse") proto.RegisterType((*CancelOperationRequest)(nil), "google.longrunning.CancelOperationRequest") proto.RegisterType((*DeleteOperationRequest)(nil), "google.longrunning.DeleteOperationRequest") proto.RegisterType((*WaitOperationRequest)(nil), "google.longrunning.WaitOperationRequest") proto.RegisterType((*OperationInfo)(nil), "google.longrunning.OperationInfo") proto.RegisterExtension(E_OperationInfo) } func init() { proto.RegisterFile("google/longrunning/operations.proto", fileDescriptor_bff5d3ff9032d7eb) } var fileDescriptor_bff5d3ff9032d7eb = []byte{ // 804 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcf, 0x4f, 0xe3, 0x46, 0x14, 0xce, 0x04, 0x42, 0x93, 0x17, 0x42, 0xa4, 0x29, 0x84, 0x60, 0x8a, 0x9b, 0x9a, 0xaa, 0x84, 0x14, 0xd9, 0x25, 0xdc, 0x90, 0x38, 0x84, 0x52, 0x41, 0x25, 0x2a, 0x90, 0x41, 0xaa, 0x8a, 0x2a, 0x45, 0xc6, 0x19, 0x52, 0xab, 0xc9, 0x8c, 0x6b, 0x4f, 0xaa, 0x86, 0x8a, 0x52, 0xf5, 0xd4, 0x6b, 0xd5, 0xbd, 0xec, 0x7f, 0xb0, 0xe2, 0x2f, 0x59, 0x71, 0xd9, 0x95, 0xf6, 0xb2, 0xe2, 0xb4, 0x64, 0xf7, 0xb0, 0x47, 0x8e, 0x1c, 0x57, 0xfe, 0x95, 0x18, 0xc7, 0x61, 0x73, 0xf3, 0xbc, 0xf7, 0xcd, 0xfb, 0xbe, 0xf7, 0xde, 0x37, 0x86, 0xe5, 0x26, 0x63, 0xcd, 0x16, 0x51, 0x5a, 0x8c, 0x36, 0xad, 0x0e, 0xa5, 0x06, 0x6d, 0x2a, 0xcc, 0x24, 0x96, 0xc6, 0x0d, 0x46, 0x6d, 0xd9, 0xb4, 0x18, 0x67, 0x18, 0x7b, 0x20, 0x39, 0x04, 0x12, 0x3e, 0xf3, 0x2f, 0x6a, 0xa6, 0xa1, 0x68, 0x94, 0x32, 0x1e, 0xbe, 0x21, 0xcc, 0x87, 0xb2, 0x7a, 0xcb, 0x20, 0x94, 0xfb, 0x89, 0x05, 0x3f, 0xe1, 0x9e, 0x4e, 0x3b, 0x67, 0x8a, 0x46, 0xbb, 0x7e, 0x4a, 0x8c, 0xa6, 0x1a, 0x1d, 0x4f, 0x86, 0x9f, 0x5f, 0x8c, 0xe6, 0x49, 0xdb, 0xe4, 0xdd, 0x08, 0xa1, 0x65, 0xea, 0x8a, 0xcd, 0x35, 0xde, 0x09, 0x94, 0x94, 0x86, 0xaa, 0x12, 0x5b, 0xb7, 0x0c, 0x93, 0x33, 0xcb, 0x43, 0x48, 0x2f, 0x10, 0x64, 0x0e, 0x82, 0x96, 0x31, 0x86, 0x49, 0xaa, 0xb5, 0x49, 0x11, 0x95, 0x50, 0x39, 0xa3, 0xba, 0xdf, 0xf8, 0x1b, 0x48, 0xb7, 0x09, 0xd7, 0x1a, 0x1a, 0xd7, 0x8a, 0xc9, 0x12, 0x2a, 0x67, 0xab, 0xb3, 0xb2, 0x3f, 0x92, 0xa0, 0xac, 0x5c, 0xa3, 0x5d, 0xb5, 0x8f, 0x72, 0xaa, 0x34, 0x18, 0x25, 0xc5, 0x89, 0x12, 0x2a, 0xa7, 0x55, 0xf7, 0x1b, 0x57, 0x20, 0x45, 0x2c, 0x8b, 0x59, 0xc5, 0x49, 0xb7, 0x04, 0x0e, 0x4a, 0x58, 0xa6, 0x2e, 0x1f, 0xb9, 0x92, 0xf7, 0x12, 0xaa, 0x07, 0xc1, 0x55, 0x48, 0x5b, 0xc4, 0x36, 0x19, 0xb5, 0x49, 0x31, 0x35, 0x9a, 0x71, 0x2f, 0xa1, 0xf6, 0x71, 0xdb, 0x69, 0x98, 0xb2, 0x88, 0xdd, 0x69, 0x71, 0x69, 0x15, 0x3e, 0xdd, 0x25, 0xbc, 0xdf, 0x93, 0x4a, 0x7e, 0xeb, 0x10, 0x9b, 0xc7, 0xb5, 0x26, 0x5d, 0xc2, 0xdc, 0xbe, 0x61, 0x0f, 0xb0, 0x76, 0x14, 0x3c, 0x19, 0x9a, 0x43, 0x01, 0xa6, 0xce, 0x8c, 0x16, 0x27, 0x96, 0x5f, 0xc2, 0x3f, 0xe1, 0x45, 0xc8, 0x98, 0x5a, 0x93, 0xd4, 0x6d, 0xe3, 0x9c, 0xb8, 0x03, 0x4a, 0xa9, 0x69, 0x27, 0x70, 0x64, 0x9c, 0x13, 0xbc, 0x04, 0xe0, 0x26, 0x39, 0xfb, 0x95, 0x50, 0x77, 0x20, 0x19, 0xd5, 0x85, 0x1f, 0x3b, 0x01, 0xe9, 0x12, 0x0a, 0x51, 0x01, 0x5e, 0x3f, 0x78, 0x0b, 0x60, 0xe0, 0xc4, 0x22, 0x2a, 0x4d, 0x94, 0xb3, 0xd5, 0x25, 0x79, 0xd8, 0x8a, 0xf2, 0xa0, 0xd1, 0xd0, 0x05, 0xfc, 0x15, 0xe4, 0x29, 0xf9, 0x83, 0xd7, 0x43, 0xe4, 0x49, 0x97, 0x3c, 0xe7, 0x84, 0x0f, 0xfb, 0x02, 0xd6, 0xa0, 0xf0, 0xad, 0x46, 0x75, 0xd2, 0x1a, 0x6b, 0x5e, 0x6b, 0x50, 0xd8, 0x21, 0x2d, 0xc2, 0xc9, 0x58, 0xe8, 0x3a, 0xcc, 0xfe, 0xa8, 0x19, 0x63, 0x6d, 0x02, 0x6f, 0xc0, 0x27, 0xdc, 0x68, 0x13, 0xd6, 0xe1, 0xbe, 0xc7, 0x16, 0x86, 0x36, 0xbe, 0xe3, 0x3f, 0x08, 0x35, 0x40, 0x4a, 0x3f, 0x41, 0xae, 0x5f, 0xfc, 0x7b, 0x7a, 0xc6, 0xf0, 0x32, 0xe4, 0x02, 0x43, 0xd4, 0x79, 0xd7, 0x0c, 0x28, 0xa6, 0x83, 0xe0, 0x71, 0xd7, 0x24, 0x0e, 0x28, 0x70, 0xaa, 0x07, 0xf2, 0x06, 0x33, 0x1d, 0x04, 0x1d, 0x50, 0xf5, 0x2a, 0x05, 0x30, 0xd8, 0x0a, 0x7e, 0x82, 0x60, 0xe6, 0xe1, 0xa2, 0xf0, 0x6a, 0xdc, 0x32, 0x62, 0xdd, 0x24, 0x54, 0xc6, 0x81, 0x7a, 0x0a, 0xa5, 0xaf, 0x6f, 0x6a, 0x59, 0x67, 0x22, 0x6b, 0x9e, 0xbb, 0xfe, 0x79, 0xf5, 0xee, 0xff, 0xe4, 0x3c, 0x9e, 0x53, 0x7e, 0x5f, 0x57, 0xfe, 0x74, 0xe2, 0x5b, 0x83, 0x25, 0x5f, 0xe0, 0x4b, 0x98, 0x0e, 0x5b, 0x1d, 0xaf, 0xc4, 0x11, 0xc5, 0x3c, 0x06, 0xe1, 0x71, 0x27, 0x49, 0x2b, 0x37, 0x35, 0x77, 0x2d, 0x2e, 0xbb, 0x80, 0x8b, 0x71, 0xec, 0x4a, 0xa5, 0x72, 0x81, 0xff, 0x82, 0x7c, 0xc4, 0x10, 0x38, 0xb6, 0xd9, 0x78, 0xd7, 0x08, 0x85, 0xa1, 0x25, 0x7f, 0xe7, 0xfc, 0xd5, 0x22, 0xfc, 0x95, 0xd1, 0xfc, 0xff, 0x22, 0xc8, 0x47, 0xfc, 0x1b, 0x2f, 0x20, 0xde, 0xe4, 0x23, 0x05, 0xac, 0x87, 0x05, 0x7c, 0x29, 0x7d, 0x3e, 0x4a, 0xc0, 0xa6, 0xee, 0xd6, 0xdd, 0x44, 0x15, 0x7c, 0x02, 0xb9, 0x07, 0x6e, 0xc7, 0xe5, 0x38, 0x1d, 0x71, 0x0f, 0xe2, 0x63, 0xdb, 0x48, 0x08, 0x4b, 0xd7, 0x35, 0x21, 0x9c, 0xf3, 0xe0, 0x9a, 0x69, 0xd8, 0xb2, 0xce, 0xda, 0x9b, 0x06, 0xcc, 0xf4, 0x65, 0xd5, 0x0d, 0xe7, 0x21, 0x88, 0x43, 0x7d, 0xfd, 0x40, 0xf8, 0x2f, 0xac, 0x71, 0x60, 0x7a, 0xff, 0x93, 0xa7, 0x69, 0xf7, 0x91, 0x7d, 0xf1, 0x28, 0xb1, 0xf3, 0xa4, 0xd4, 0x1c, 0x0b, 0x1f, 0xb7, 0xff, 0x43, 0xaf, 0x6f, 0xc5, 0xc4, 0xdd, 0xad, 0x88, 0xee, 0x6f, 0x45, 0xf4, 0x77, 0x4f, 0x44, 0xcf, 0x7a, 0x22, 0x7a, 0xde, 0x13, 0xd1, 0xcb, 0x9e, 0x88, 0xde, 0xf4, 0x44, 0xf4, 0xbe, 0x27, 0x26, 0xee, 0x9c, 0xd8, 0x5b, 0x11, 0x41, 0x41, 0x67, 0xed, 0x18, 0x8e, 0xed, 0xfc, 0xc0, 0xf9, 0x87, 0x8e, 0xc2, 0x43, 0x74, 0x92, 0x0d, 0xe5, 0xef, 0x11, 0xba, 0x4a, 0xe2, 0x5d, 0xef, 0xde, 0x3e, 0xa3, 0x4d, 0xd5, 0x8b, 0x5f, 0x07, 0xc1, 0x9f, 0x43, 0xc1, 0xd3, 0x29, 0xb7, 0xc9, 0x8d, 0x0f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x56, 0x32, 0x68, 0xc0, 0xce, 0x07, 0x00, 0x00, } func (this *Operation) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Operation) if !ok { that2, ok := that.(Operation) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Name != that1.Name { return false } if !this.Metadata.Equal(that1.Metadata) { return false } if this.Done != that1.Done { return false } if that1.Result == nil { if this.Result != nil { return false } } else if this.Result == nil { return false } else if !this.Result.Equal(that1.Result) { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Operation_Error) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Operation_Error) if !ok { that2, ok := that.(Operation_Error) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.Error.Equal(that1.Error) { return false } return true } func (this *Operation_Response) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Operation_Response) if !ok { that2, ok := that.(Operation_Response) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.Response.Equal(that1.Response) { return false } return true } func (this *GetOperationRequest) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*GetOperationRequest) if !ok { that2, ok := that.(GetOperationRequest) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Name != that1.Name { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *ListOperationsRequest) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*ListOperationsRequest) if !ok { that2, ok := that.(ListOperationsRequest) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Name != that1.Name { return false } if this.Filter != that1.Filter { return false } if this.PageSize != that1.PageSize { return false } if this.PageToken != that1.PageToken { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *ListOperationsResponse) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*ListOperationsResponse) if !ok { that2, ok := that.(ListOperationsResponse) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if len(this.Operations) != len(that1.Operations) { return false } for i := range this.Operations { if !this.Operations[i].Equal(that1.Operations[i]) { return false } } if this.NextPageToken != that1.NextPageToken { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *CancelOperationRequest) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*CancelOperationRequest) if !ok { that2, ok := that.(CancelOperationRequest) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Name != that1.Name { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *DeleteOperationRequest) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*DeleteOperationRequest) if !ok { that2, ok := that.(DeleteOperationRequest) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Name != that1.Name { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *WaitOperationRequest) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*WaitOperationRequest) if !ok { that2, ok := that.(WaitOperationRequest) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Name != that1.Name { return false } if !this.Timeout.Equal(that1.Timeout) { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *OperationInfo) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*OperationInfo) if !ok { that2, ok := that.(OperationInfo) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.ResponseType != that1.ResponseType { return false } if this.MetadataType != that1.MetadataType { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Operation) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 9) s = append(s, "&longrunning.Operation{") s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") if this.Metadata != nil { s = append(s, "Metadata: "+fmt.Sprintf("%#v", this.Metadata)+",\n") } s = append(s, "Done: "+fmt.Sprintf("%#v", this.Done)+",\n") if this.Result != nil { s = append(s, "Result: "+fmt.Sprintf("%#v", this.Result)+",\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 (this *Operation_Error) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&longrunning.Operation_Error{` + `Error:` + fmt.Sprintf("%#v", this.Error) + `}`}, ", ") return s } func (this *Operation_Response) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&longrunning.Operation_Response{` + `Response:` + fmt.Sprintf("%#v", this.Response) + `}`}, ", ") return s } func (this *GetOperationRequest) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&longrunning.GetOperationRequest{") s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\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 (this *ListOperationsRequest) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 8) s = append(s, "&longrunning.ListOperationsRequest{") s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") s = append(s, "Filter: "+fmt.Sprintf("%#v", this.Filter)+",\n") s = append(s, "PageSize: "+fmt.Sprintf("%#v", this.PageSize)+",\n") s = append(s, "PageToken: "+fmt.Sprintf("%#v", this.PageToken)+",\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 (this *ListOperationsResponse) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&longrunning.ListOperationsResponse{") if this.Operations != nil { s = append(s, "Operations: "+fmt.Sprintf("%#v", this.Operations)+",\n") } s = append(s, "NextPageToken: "+fmt.Sprintf("%#v", this.NextPageToken)+",\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 (this *CancelOperationRequest) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&longrunning.CancelOperationRequest{") s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\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 (this *DeleteOperationRequest) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&longrunning.DeleteOperationRequest{") s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\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 (this *WaitOperationRequest) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&longrunning.WaitOperationRequest{") s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") if this.Timeout != nil { s = append(s, "Timeout: "+fmt.Sprintf("%#v", this.Timeout)+",\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 (this *OperationInfo) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&longrunning.OperationInfo{") s = append(s, "ResponseType: "+fmt.Sprintf("%#v", this.ResponseType)+",\n") s = append(s, "MetadataType: "+fmt.Sprintf("%#v", this.MetadataType)+",\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 valueToGoStringOperations(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) } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // OperationsClient is the client API for Operations service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type OperationsClient interface { // Lists operations that match the specified filter in the request. If the // server doesn't support this method, it returns `UNIMPLEMENTED`. // // NOTE: the `name` binding allows API services to override the binding // to use different resource name schemes, such as `users/*/operations`. To // override the binding, API services can add a binding such as // `"/v1/{name=users/*}/operations"` to their service configuration. // For backwards compatibility, the default name includes the operations // collection id, however overriding users must ensure the name binding // is the parent resource, without the operations collection id. ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) // Gets the latest state of a long-running operation. Clients can use this // method to poll the operation result at intervals as recommended by the API // service. GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) // Deletes a long-running operation. This method indicates that the client is // no longer interested in the operation result. It does not cancel the // operation. If the server doesn't support this method, it returns // `google.rpc.Code.UNIMPLEMENTED`. DeleteOperation(ctx context.Context, in *DeleteOperationRequest, opts ...grpc.CallOption) (*types.Empty, error) // Starts asynchronous cancellation on a long-running operation. The server // makes a best effort to cancel the operation, but success is not // guaranteed. If the server doesn't support this method, it returns // `google.rpc.Code.UNIMPLEMENTED`. Clients can use // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or // other methods to check whether the cancellation succeeded or whether the // operation completed despite cancellation. On successful cancellation, // the operation is not deleted; instead, it becomes an operation with // an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, // corresponding to `Code.CANCELLED`. CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*types.Empty, error) // Waits for the specified long-running operation until it is done or reaches // at most a specified timeout, returning the latest state. If the operation // is already done, the latest state is immediately returned. If the timeout // specified is greater than the default HTTP/RPC timeout, the HTTP/RPC // timeout is used. If the server does not support this method, it returns // `google.rpc.Code.UNIMPLEMENTED`. // Note that this method is on a best-effort basis. It may return the latest // state before the specified timeout (including immediately), meaning even an // immediate response is no guarantee that the operation is done. WaitOperation(ctx context.Context, in *WaitOperationRequest, opts ...grpc.CallOption) (*Operation, error) } type operationsClient struct { cc *grpc.ClientConn } func NewOperationsClient(cc *grpc.ClientConn) OperationsClient { return &operationsClient{cc} } func (c *operationsClient) ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) { out := new(ListOperationsResponse) err := c.cc.Invoke(ctx, "/google.longrunning.Operations/ListOperations", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *operationsClient) GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) { out := new(Operation) err := c.cc.Invoke(ctx, "/google.longrunning.Operations/GetOperation", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *operationsClient) DeleteOperation(ctx context.Context, in *DeleteOperationRequest, opts ...grpc.CallOption) (*types.Empty, error) { out := new(types.Empty) err := c.cc.Invoke(ctx, "/google.longrunning.Operations/DeleteOperation", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *operationsClient) CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*types.Empty, error) { out := new(types.Empty) err := c.cc.Invoke(ctx, "/google.longrunning.Operations/CancelOperation", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *operationsClient) WaitOperation(ctx context.Context, in *WaitOperationRequest, opts ...grpc.CallOption) (*Operation, error) { out := new(Operation) err := c.cc.Invoke(ctx, "/google.longrunning.Operations/WaitOperation", in, out, opts...) if err != nil { return nil, err } return out, nil } // OperationsServer is the server API for Operations service. type OperationsServer interface { // Lists operations that match the specified filter in the request. If the // server doesn't support this method, it returns `UNIMPLEMENTED`. // // NOTE: the `name` binding allows API services to override the binding // to use different resource name schemes, such as `users/*/operations`. To // override the binding, API services can add a binding such as // `"/v1/{name=users/*}/operations"` to their service configuration. // For backwards compatibility, the default name includes the operations // collection id, however overriding users must ensure the name binding // is the parent resource, without the operations collection id. ListOperations(context.Context, *ListOperationsRequest) (*ListOperationsResponse, error) // Gets the latest state of a long-running operation. Clients can use this // method to poll the operation result at intervals as recommended by the API // service. GetOperation(context.Context, *GetOperationRequest) (*Operation, error) // Deletes a long-running operation. This method indicates that the client is // no longer interested in the operation result. It does not cancel the // operation. If the server doesn't support this method, it returns // `google.rpc.Code.UNIMPLEMENTED`. DeleteOperation(context.Context, *DeleteOperationRequest) (*types.Empty, error) // Starts asynchronous cancellation on a long-running operation. The server // makes a best effort to cancel the operation, but success is not // guaranteed. If the server doesn't support this method, it returns // `google.rpc.Code.UNIMPLEMENTED`. Clients can use // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or // other methods to check whether the cancellation succeeded or whether the // operation completed despite cancellation. On successful cancellation, // the operation is not deleted; instead, it becomes an operation with // an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, // corresponding to `Code.CANCELLED`. CancelOperation(context.Context, *CancelOperationRequest) (*types.Empty, error) // Waits for the specified long-running operation until it is done or reaches // at most a specified timeout, returning the latest state. If the operation // is already done, the latest state is immediately returned. If the timeout // specified is greater than the default HTTP/RPC timeout, the HTTP/RPC // timeout is used. If the server does not support this method, it returns // `google.rpc.Code.UNIMPLEMENTED`. // Note that this method is on a best-effort basis. It may return the latest // state before the specified timeout (including immediately), meaning even an // immediate response is no guarantee that the operation is done. WaitOperation(context.Context, *WaitOperationRequest) (*Operation, error) } // UnimplementedOperationsServer can be embedded to have forward compatible implementations. type UnimplementedOperationsServer struct { } func (*UnimplementedOperationsServer) ListOperations(ctx context.Context, req *ListOperationsRequest) (*ListOperationsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListOperations not implemented") } func (*UnimplementedOperationsServer) GetOperation(ctx context.Context, req *GetOperationRequest) (*Operation, error) { return nil, status.Errorf(codes.Unimplemented, "method GetOperation not implemented") } func (*UnimplementedOperationsServer) DeleteOperation(ctx context.Context, req *DeleteOperationRequest) (*types.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteOperation not implemented") } func (*UnimplementedOperationsServer) CancelOperation(ctx context.Context, req *CancelOperationRequest) (*types.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method CancelOperation not implemented") } func (*UnimplementedOperationsServer) WaitOperation(ctx context.Context, req *WaitOperationRequest) (*Operation, error) { return nil, status.Errorf(codes.Unimplemented, "method WaitOperation not implemented") } func RegisterOperationsServer(s *grpc.Server, srv OperationsServer) { s.RegisterService(&_Operations_serviceDesc, srv) } func _Operations_ListOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListOperationsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(OperationsServer).ListOperations(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/google.longrunning.Operations/ListOperations", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(OperationsServer).ListOperations(ctx, req.(*ListOperationsRequest)) } return interceptor(ctx, in, info, handler) } func _Operations_GetOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetOperationRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(OperationsServer).GetOperation(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/google.longrunning.Operations/GetOperation", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(OperationsServer).GetOperation(ctx, req.(*GetOperationRequest)) } return interceptor(ctx, in, info, handler) } func _Operations_DeleteOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteOperationRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(OperationsServer).DeleteOperation(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/google.longrunning.Operations/DeleteOperation", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(OperationsServer).DeleteOperation(ctx, req.(*DeleteOperationRequest)) } return interceptor(ctx, in, info, handler) } func _Operations_CancelOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CancelOperationRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(OperationsServer).CancelOperation(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/google.longrunning.Operations/CancelOperation", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(OperationsServer).CancelOperation(ctx, req.(*CancelOperationRequest)) } return interceptor(ctx, in, info, handler) } func _Operations_WaitOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(WaitOperationRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(OperationsServer).WaitOperation(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/google.longrunning.Operations/WaitOperation", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(OperationsServer).WaitOperation(ctx, req.(*WaitOperationRequest)) } return interceptor(ctx, in, info, handler) } var _Operations_serviceDesc = grpc.ServiceDesc{ ServiceName: "google.longrunning.Operations", HandlerType: (*OperationsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListOperations", Handler: _Operations_ListOperations_Handler, }, { MethodName: "GetOperation", Handler: _Operations_GetOperation_Handler, }, { MethodName: "DeleteOperation", Handler: _Operations_DeleteOperation_Handler, }, { MethodName: "CancelOperation", Handler: _Operations_CancelOperation_Handler, }, { MethodName: "WaitOperation", Handler: _Operations_WaitOperation_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "google/longrunning/operations.proto", } func (m *Operation) 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 *Operation) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Operation) 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.Result != nil { { size := m.Result.Size() i -= size if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { return 0, err } } } if m.Done { i-- if m.Done { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x18 } if m.Metadata != nil { { size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintOperations(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintOperations(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Operation_Error) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Operation_Error) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.Error != nil { { size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintOperations(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } return len(dAtA) - i, nil } func (m *Operation_Response) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Operation_Response) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.Response != nil { { size, err := m.Response.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintOperations(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a } return len(dAtA) - i, nil } func (m *GetOperationRequest) 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 *GetOperationRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *GetOperationRequest) 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 len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintOperations(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ListOperationsRequest) 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 *ListOperationsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListOperationsRequest) 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 len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintOperations(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x22 } if len(m.PageToken) > 0 { i -= len(m.PageToken) copy(dAtA[i:], m.PageToken) i = encodeVarintOperations(dAtA, i, uint64(len(m.PageToken))) i-- dAtA[i] = 0x1a } if m.PageSize != 0 { i = encodeVarintOperations(dAtA, i, uint64(m.PageSize)) i-- dAtA[i] = 0x10 } if len(m.Filter) > 0 { i -= len(m.Filter) copy(dAtA[i:], m.Filter) i = encodeVarintOperations(dAtA, i, uint64(len(m.Filter))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ListOperationsResponse) 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 *ListOperationsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListOperationsResponse) 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 len(m.NextPageToken) > 0 { i -= len(m.NextPageToken) copy(dAtA[i:], m.NextPageToken) i = encodeVarintOperations(dAtA, i, uint64(len(m.NextPageToken))) i-- dAtA[i] = 0x12 } if len(m.Operations) > 0 { for iNdEx := len(m.Operations) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Operations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintOperations(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *CancelOperationRequest) 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 *CancelOperationRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *CancelOperationRequest) 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 len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintOperations(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *DeleteOperationRequest) 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 *DeleteOperationRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *DeleteOperationRequest) 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 len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintOperations(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *WaitOperationRequest) 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 *WaitOperationRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *WaitOperationRequest) 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.Timeout != nil { { size, err := m.Timeout.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintOperations(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintOperations(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *OperationInfo) 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 *OperationInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *OperationInfo) 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 len(m.MetadataType) > 0 { i -= len(m.MetadataType) copy(dAtA[i:], m.MetadataType) i = encodeVarintOperations(dAtA, i, uint64(len(m.MetadataType))) i-- dAtA[i] = 0x12 } if len(m.ResponseType) > 0 { i -= len(m.ResponseType) copy(dAtA[i:], m.ResponseType) i = encodeVarintOperations(dAtA, i, uint64(len(m.ResponseType))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintOperations(dAtA []byte, offset int, v uint64) int { offset -= sovOperations(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedOperation(r randyOperations, easy bool) *Operation { this := &Operation{} this.Name = string(randStringOperations(r)) if r.Intn(5) != 0 { this.Metadata = types.NewPopulatedAny(r, easy) } this.Done = bool(bool(r.Intn(2) == 0)) oneofNumber_Result := []int32{4, 5}[r.Intn(2)] switch oneofNumber_Result { case 4: this.Result = NewPopulatedOperation_Error(r, easy) case 5: this.Result = NewPopulatedOperation_Response(r, easy) } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedOperations(r, 6) } return this } func NewPopulatedOperation_Error(r randyOperations, easy bool) *Operation_Error { this := &Operation_Error{} this.Error = rpc.NewPopulatedStatus(r, easy) return this } func NewPopulatedOperation_Response(r randyOperations, easy bool) *Operation_Response { this := &Operation_Response{} this.Response = types.NewPopulatedAny(r, easy) return this } func NewPopulatedGetOperationRequest(r randyOperations, easy bool) *GetOperationRequest { this := &GetOperationRequest{} this.Name = string(randStringOperations(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedOperations(r, 2) } return this } func NewPopulatedListOperationsRequest(r randyOperations, easy bool) *ListOperationsRequest { this := &ListOperationsRequest{} this.Filter = string(randStringOperations(r)) this.PageSize = int32(r.Int31()) if r.Intn(2) == 0 { this.PageSize *= -1 } this.PageToken = string(randStringOperations(r)) this.Name = string(randStringOperations(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedOperations(r, 5) } return this } func NewPopulatedListOperationsResponse(r randyOperations, easy bool) *ListOperationsResponse { this := &ListOperationsResponse{} if r.Intn(5) != 0 { v1 := r.Intn(5) this.Operations = make([]*Operation, v1) for i := 0; i < v1; i++ { this.Operations[i] = NewPopulatedOperation(r, easy) } } this.NextPageToken = string(randStringOperations(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedOperations(r, 3) } return this } func NewPopulatedCancelOperationRequest(r randyOperations, easy bool) *CancelOperationRequest { this := &CancelOperationRequest{} this.Name = string(randStringOperations(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedOperations(r, 2) } return this } func NewPopulatedDeleteOperationRequest(r randyOperations, easy bool) *DeleteOperationRequest { this := &DeleteOperationRequest{} this.Name = string(randStringOperations(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedOperations(r, 2) } return this } func NewPopulatedWaitOperationRequest(r randyOperations, easy bool) *WaitOperationRequest { this := &WaitOperationRequest{} this.Name = string(randStringOperations(r)) if r.Intn(5) != 0 { this.Timeout = types.NewPopulatedDuration(r, easy) } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedOperations(r, 3) } return this } func NewPopulatedOperationInfo(r randyOperations, easy bool) *OperationInfo { this := &OperationInfo{} this.ResponseType = string(randStringOperations(r)) this.MetadataType = string(randStringOperations(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedOperations(r, 3) } return this } type randyOperations interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneOperations(r randyOperations) 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 randStringOperations(r randyOperations) string { v2 := r.Intn(100) tmps := make([]rune, v2) for i := 0; i < v2; i++ { tmps[i] = randUTF8RuneOperations(r) } return string(tmps) } func randUnrecognizedOperations(r randyOperations, 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 = randFieldOperations(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldOperations(dAtA []byte, r randyOperations, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateOperations(dAtA, uint64(key)) v3 := r.Int63() if r.Intn(2) == 0 { v3 *= -1 } dAtA = encodeVarintPopulateOperations(dAtA, uint64(v3)) case 1: dAtA = encodeVarintPopulateOperations(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 = encodeVarintPopulateOperations(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateOperations(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateOperations(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 encodeVarintPopulateOperations(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 *Operation) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovOperations(uint64(l)) } if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovOperations(uint64(l)) } if m.Done { n += 2 } if m.Result != nil { n += m.Result.Size() } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Operation_Error) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Error != nil { l = m.Error.Size() n += 1 + l + sovOperations(uint64(l)) } return n } func (m *Operation_Response) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Response != nil { l = m.Response.Size() n += 1 + l + sovOperations(uint64(l)) } return n } func (m *GetOperationRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovOperations(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *ListOperationsRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Filter) if l > 0 { n += 1 + l + sovOperations(uint64(l)) } if m.PageSize != 0 { n += 1 + sovOperations(uint64(m.PageSize)) } l = len(m.PageToken) if l > 0 { n += 1 + l + sovOperations(uint64(l)) } l = len(m.Name) if l > 0 { n += 1 + l + sovOperations(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *ListOperationsResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Operations) > 0 { for _, e := range m.Operations { l = e.Size() n += 1 + l + sovOperations(uint64(l)) } } l = len(m.NextPageToken) if l > 0 { n += 1 + l + sovOperations(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *CancelOperationRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovOperations(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *DeleteOperationRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovOperations(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *WaitOperationRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovOperations(uint64(l)) } if m.Timeout != nil { l = m.Timeout.Size() n += 1 + l + sovOperations(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *OperationInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ResponseType) if l > 0 { n += 1 + l + sovOperations(uint64(l)) } l = len(m.MetadataType) if l > 0 { n += 1 + l + sovOperations(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovOperations(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozOperations(x uint64) (n int) { return sovOperations(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *Operation) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Operation{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Metadata:` + strings.Replace(fmt.Sprintf("%v", this.Metadata), "Any", "types.Any", 1) + `,`, `Done:` + fmt.Sprintf("%v", this.Done) + `,`, `Result:` + fmt.Sprintf("%v", this.Result) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *Operation_Error) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Operation_Error{`, `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Status", "rpc.Status", 1) + `,`, `}`, }, "") return s } func (this *Operation_Response) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Operation_Response{`, `Response:` + strings.Replace(fmt.Sprintf("%v", this.Response), "Any", "types.Any", 1) + `,`, `}`, }, "") return s } func (this *GetOperationRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&GetOperationRequest{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *ListOperationsRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListOperationsRequest{`, `Filter:` + fmt.Sprintf("%v", this.Filter) + `,`, `PageSize:` + fmt.Sprintf("%v", this.PageSize) + `,`, `PageToken:` + fmt.Sprintf("%v", this.PageToken) + `,`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *ListOperationsResponse) String() string { if this == nil { return "nil" } repeatedStringForOperations := "[]*Operation{" for _, f := range this.Operations { repeatedStringForOperations += strings.Replace(f.String(), "Operation", "Operation", 1) + "," } repeatedStringForOperations += "}" s := strings.Join([]string{`&ListOperationsResponse{`, `Operations:` + repeatedStringForOperations + `,`, `NextPageToken:` + fmt.Sprintf("%v", this.NextPageToken) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *CancelOperationRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&CancelOperationRequest{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *DeleteOperationRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&DeleteOperationRequest{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *WaitOperationRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&WaitOperationRequest{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Timeout:` + strings.Replace(fmt.Sprintf("%v", this.Timeout), "Duration", "types.Duration", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *OperationInfo) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&OperationInfo{`, `ResponseType:` + fmt.Sprintf("%v", this.ResponseType) + `,`, `MetadataType:` + fmt.Sprintf("%v", this.MetadataType) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringOperations(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *Operation) 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 ErrIntOverflowOperations } 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: Operation: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Operation: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = &types.Any{} } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Done", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Done = bool(v != 0) case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } v := &rpc.Status{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Result = &Operation_Error{v} iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } v := &types.Any{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Result = &Operation_Response{v} iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipOperations(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthOperations } if (iNdEx + skippy) < 0 { return ErrInvalidLengthOperations } 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 (m *GetOperationRequest) 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 ErrIntOverflowOperations } 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: GetOperationRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: GetOperationRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipOperations(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthOperations } if (iNdEx + skippy) < 0 { return ErrInvalidLengthOperations } 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 (m *ListOperationsRequest) 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 ErrIntOverflowOperations } 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: ListOperationsRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListOperationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } m.Filter = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field PageSize", wireType) } m.PageSize = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.PageSize |= int32(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PageToken", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } m.PageToken = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipOperations(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthOperations } if (iNdEx + skippy) < 0 { return ErrInvalidLengthOperations } 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 (m *ListOperationsResponse) 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 ErrIntOverflowOperations } 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: ListOperationsResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListOperationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Operations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } m.Operations = append(m.Operations, &Operation{}) if err := m.Operations[len(m.Operations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NextPageToken", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } m.NextPageToken = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipOperations(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthOperations } if (iNdEx + skippy) < 0 { return ErrInvalidLengthOperations } 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 (m *CancelOperationRequest) 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 ErrIntOverflowOperations } 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: CancelOperationRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CancelOperationRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipOperations(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthOperations } if (iNdEx + skippy) < 0 { return ErrInvalidLengthOperations } 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 (m *DeleteOperationRequest) 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 ErrIntOverflowOperations } 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: DeleteOperationRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: DeleteOperationRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipOperations(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthOperations } if (iNdEx + skippy) < 0 { return ErrInvalidLengthOperations } 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 (m *WaitOperationRequest) 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 ErrIntOverflowOperations } 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: WaitOperationRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: WaitOperationRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } if m.Timeout == nil { m.Timeout = &types.Duration{} } if err := m.Timeout.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipOperations(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthOperations } if (iNdEx + skippy) < 0 { return ErrInvalidLengthOperations } 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 (m *OperationInfo) 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 ErrIntOverflowOperations } 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: OperationInfo: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: OperationInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ResponseType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } m.ResponseType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MetadataType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowOperations } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthOperations } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthOperations } if postIndex > l { return io.ErrUnexpectedEOF } m.MetadataType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipOperations(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthOperations } if (iNdEx + skippy) < 0 { return ErrInvalidLengthOperations } 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 skipOperations(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, ErrIntOverflowOperations } 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, ErrIntOverflowOperations } 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, ErrIntOverflowOperations } 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, ErrInvalidLengthOperations } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupOperations } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthOperations } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthOperations = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowOperations = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupOperations = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/longrunning/operations.proto000066400000000000000000000243411365205541600227440ustar00rootroot00000000000000// 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.longrunning; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/protobuf/any.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "google/rpc/status.proto"; import "google/protobuf/descriptor.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.LongRunning"; option go_package = "longrunning"; option java_multiple_files = true; option java_outer_classname = "OperationsProto"; option java_package = "com.google.longrunning"; option php_namespace = "Google\\LongRunning"; extend google.protobuf.MethodOptions { // Additional information regarding long-running operations. // In particular, this specifies the types that are returned from // long-running operations. // // Required for methods that return `google.longrunning.Operation`; invalid // otherwise. google.longrunning.OperationInfo operation_info = 1049; } // Manages long-running operations with an API service. // // When an API method normally takes long time to complete, it can be designed // to return [Operation][google.longrunning.Operation] to the client, and the client can use this // interface to receive the real response asynchronously by polling the // operation resource, or pass the operation resource to another API (such as // Google Cloud Pub/Sub API) to receive the response. Any API service that // returns long-running operations should implement the `Operations` interface // so developers can have a consistent client experience. service Operations { option (google.api.default_host) = "longrunning.googleapis.com"; // Lists operations that match the specified filter in the request. If the // server doesn't support this method, it returns `UNIMPLEMENTED`. // // NOTE: the `name` binding allows API services to override the binding // to use different resource name schemes, such as `users/*/operations`. To // override the binding, API services can add a binding such as // `"/v1/{name=users/*}/operations"` to their service configuration. // For backwards compatibility, the default name includes the operations // collection id, however overriding users must ensure the name binding // is the parent resource, without the operations collection id. rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) { option (google.api.http) = { get: "/v1/{name=operations}" }; option (google.api.method_signature) = "name,filter"; } // Gets the latest state of a long-running operation. Clients can use this // method to poll the operation result at intervals as recommended by the API // service. rpc GetOperation(GetOperationRequest) returns (Operation) { option (google.api.http) = { get: "/v1/{name=operations/**}" }; option (google.api.method_signature) = "name"; } // Deletes a long-running operation. This method indicates that the client is // no longer interested in the operation result. It does not cancel the // operation. If the server doesn't support this method, it returns // `google.rpc.Code.UNIMPLEMENTED`. rpc DeleteOperation(DeleteOperationRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=operations/**}" }; option (google.api.method_signature) = "name"; } // Starts asynchronous cancellation on a long-running operation. The server // makes a best effort to cancel the operation, but success is not // guaranteed. If the server doesn't support this method, it returns // `google.rpc.Code.UNIMPLEMENTED`. Clients can use // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or // other methods to check whether the cancellation succeeded or whether the // operation completed despite cancellation. On successful cancellation, // the operation is not deleted; instead, it becomes an operation with // an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, // corresponding to `Code.CANCELLED`. rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) { option (google.api.http) = { post: "/v1/{name=operations/**}:cancel" body: "*" }; option (google.api.method_signature) = "name"; } // Waits for the specified long-running operation until it is done or reaches // at most a specified timeout, returning the latest state. If the operation // is already done, the latest state is immediately returned. If the timeout // specified is greater than the default HTTP/RPC timeout, the HTTP/RPC // timeout is used. If the server does not support this method, it returns // `google.rpc.Code.UNIMPLEMENTED`. // Note that this method is on a best-effort basis. It may return the latest // state before the specified timeout (including immediately), meaning even an // immediate response is no guarantee that the operation is done. rpc WaitOperation(WaitOperationRequest) returns (Operation) { } } // This resource represents a long-running operation that is the result of a // network API call. message Operation { // The server-assigned name, which is only unique within the same service that // originally returns it. If you use the default HTTP mapping, the // `name` should be a resource name ending with `operations/{unique_id}`. string name = 1; // Service-specific metadata associated with the operation. It typically // contains progress information and common metadata such as create time. // Some services might not provide such metadata. Any method that returns a // long-running operation should document the metadata type, if any. google.protobuf.Any metadata = 2; // If the value is `false`, it means the operation is still in progress. // If `true`, the operation is completed, and either `error` or `response` is // available. bool done = 3; // The operation result, which can be either an `error` or a valid `response`. // If `done` == `false`, neither `error` nor `response` is set. // If `done` == `true`, exactly one of `error` or `response` is set. oneof result { // The error result of the operation in case of failure or cancellation. google.rpc.Status error = 4; // The normal response of the operation in case of success. If the original // method returns no data on success, such as `Delete`, the response is // `google.protobuf.Empty`. If the original method is standard // `Get`/`Create`/`Update`, the response should be the resource. For other // methods, the response should have the type `XxxResponse`, where `Xxx` // is the original method name. For example, if the original method name // is `TakeSnapshot()`, the inferred response type is // `TakeSnapshotResponse`. google.protobuf.Any response = 5; } } // The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation]. message GetOperationRequest { // The name of the operation resource. string name = 1; } // The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. message ListOperationsRequest { // The name of the operation's parent resource. string name = 4; // The standard list filter. string filter = 1; // The standard list page size. int32 page_size = 2; // The standard list page token. string page_token = 3; } // The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. message ListOperationsResponse { // A list of operations that matches the specified filter in the request. repeated Operation operations = 1; // The standard List next-page token. string next_page_token = 2; } // The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]. message CancelOperationRequest { // The name of the operation resource to be cancelled. string name = 1; } // The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation]. message DeleteOperationRequest { // The name of the operation resource to be deleted. string name = 1; } // The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation]. message WaitOperationRequest { // The name of the operation resource to wait on. string name = 1; // The maximum duration to wait before timing out. If left blank, the wait // will be at most the time permitted by the underlying HTTP/RPC protocol. // If RPC context deadline is also specified, the shorter one will be used. google.protobuf.Duration timeout = 2; } // A message representing the message types used by a long-running operation. // // Example: // // rpc LongRunningRecognize(LongRunningRecognizeRequest) // returns (google.longrunning.Operation) { // option (google.longrunning.operation_info) = { // response_type: "LongRunningRecognizeResponse" // metadata_type: "LongRunningRecognizeMetadata" // }; // } message OperationInfo { // Required. The message name of the primary return type for this // long-running operation. // This type will be used to deserialize the LRO's response. // // If the response is in a different package from the rpc, a fully-qualified // message name must be used (e.g. `google.protobuf.Struct`). // // Note: Altering this value constitutes a breaking change. string response_type = 1; // Required. The message name of the metadata type for this long-running // operation. // // If the response is in a different package from the rpc, a fully-qualified // message name must be used (e.g. `google.protobuf.Struct`). // // Note: Altering this value constitutes a breaking change. string metadata_type = 2; } googleapis-1.4.0/google/rpc/000077500000000000000000000000001365205541600157145ustar00rootroot00000000000000googleapis-1.4.0/google/rpc/code.pb.go000066400000000000000000000245631365205541600175670ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/rpc/code.proto package rpc import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" math "math" strconv "strconv" ) // 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 // The canonical error codes for gRPC APIs. // // // Sometimes multiple error codes may apply. Services should return // the most specific error code that applies. For example, prefer // `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply. // Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`. type Code int32 const ( // Not an error; returned on success // // HTTP Mapping: 200 OK OK Code = 0 // The operation was cancelled, typically by the caller. // // HTTP Mapping: 499 Client Closed Request CANCELLED Code = 1 // Unknown error. For example, this error may be returned when // a `Status` value received from another address space belongs to // an error space that is not known in this address space. Also // errors raised by APIs that do not return enough error information // may be converted to this error. // // HTTP Mapping: 500 Internal Server Error UNKNOWN Code = 2 // The client specified an invalid argument. Note that this differs // from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments // that are problematic regardless of the state of the system // (e.g., a malformed file name). // // HTTP Mapping: 400 Bad Request INVALID_ARGUMENT Code = 3 // The deadline expired before the operation could complete. For operations // that change the state of the system, this error may be returned // even if the operation has completed successfully. For example, a // successful response from a server could have been delayed long // enough for the deadline to expire. // // HTTP Mapping: 504 Gateway Timeout DEADLINE_EXCEEDED Code = 4 // Some requested entity (e.g., file or directory) was not found. // // Note to server developers: if a request is denied for an entire class // of users, such as gradual feature rollout or undocumented whitelist, // `NOT_FOUND` may be used. If a request is denied for some users within // a class of users, such as user-based access control, `PERMISSION_DENIED` // must be used. // // HTTP Mapping: 404 Not Found NOT_FOUND Code = 5 // The entity that a client attempted to create (e.g., file or directory) // already exists. // // HTTP Mapping: 409 Conflict ALREADY_EXISTS Code = 6 // The caller does not have permission to execute the specified // operation. `PERMISSION_DENIED` must not be used for rejections // caused by exhausting some resource (use `RESOURCE_EXHAUSTED` // instead for those errors). `PERMISSION_DENIED` must not be // used if the caller can not be identified (use `UNAUTHENTICATED` // instead for those errors). This error code does not imply the // request is valid or the requested entity exists or satisfies // other pre-conditions. // // HTTP Mapping: 403 Forbidden PERMISSION_DENIED Code = 7 // The request does not have valid authentication credentials for the // operation. // // HTTP Mapping: 401 Unauthorized UNAUTHENTICATED Code = 16 // Some resource has been exhausted, perhaps a per-user quota, or // perhaps the entire file system is out of space. // // HTTP Mapping: 429 Too Many Requests RESOURCE_EXHAUSTED Code = 8 // The operation was rejected because the system is not in a state // required for the operation's execution. For example, the directory // to be deleted is non-empty, an rmdir operation is applied to // a non-directory, etc. // // Service implementors can use the following guidelines to decide // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: // (a) Use `UNAVAILABLE` if the client can retry just the failing call. // (b) Use `ABORTED` if the client should retry at a higher level // (e.g., when a client-specified test-and-set fails, indicating the // client should restart a read-modify-write sequence). // (c) Use `FAILED_PRECONDITION` if the client should not retry until // the system state has been explicitly fixed. E.g., if an "rmdir" // fails because the directory is non-empty, `FAILED_PRECONDITION` // should be returned since the client should not retry unless // the files are deleted from the directory. // // HTTP Mapping: 400 Bad Request FAILED_PRECONDITION Code = 9 // The operation was aborted, typically due to a concurrency issue such as // a sequencer check failure or transaction abort. // // See the guidelines above for deciding between `FAILED_PRECONDITION`, // `ABORTED`, and `UNAVAILABLE`. // // HTTP Mapping: 409 Conflict ABORTED Code = 10 // The operation was attempted past the valid range. E.g., seeking or // reading past end-of-file. // // Unlike `INVALID_ARGUMENT`, this error indicates a problem that may // be fixed if the system state changes. For example, a 32-bit file // system will generate `INVALID_ARGUMENT` if asked to read at an // offset that is not in the range [0,2^32-1], but it will generate // `OUT_OF_RANGE` if asked to read from an offset past the current // file size. // // There is a fair bit of overlap between `FAILED_PRECONDITION` and // `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific // error) when it applies so that callers who are iterating through // a space can easily look for an `OUT_OF_RANGE` error to detect when // they are done. // // HTTP Mapping: 400 Bad Request OUT_OF_RANGE Code = 11 // The operation is not implemented or is not supported/enabled in this // service. // // HTTP Mapping: 501 Not Implemented UNIMPLEMENTED Code = 12 // Internal errors. This means that some invariants expected by the // underlying system have been broken. This error code is reserved // for serious errors. // // HTTP Mapping: 500 Internal Server Error INTERNAL Code = 13 // The service is currently unavailable. This is most likely a // transient condition, which can be corrected by retrying with // a backoff. Note that it is not always safe to retry // non-idempotent operations. // // See the guidelines above for deciding between `FAILED_PRECONDITION`, // `ABORTED`, and `UNAVAILABLE`. // // HTTP Mapping: 503 Service Unavailable UNAVAILABLE Code = 14 // Unrecoverable data loss or corruption. // // HTTP Mapping: 500 Internal Server Error DATA_LOSS Code = 15 ) var Code_name = map[int32]string{ 0: "OK", 1: "CANCELLED", 2: "UNKNOWN", 3: "INVALID_ARGUMENT", 4: "DEADLINE_EXCEEDED", 5: "NOT_FOUND", 6: "ALREADY_EXISTS", 7: "PERMISSION_DENIED", 16: "UNAUTHENTICATED", 8: "RESOURCE_EXHAUSTED", 9: "FAILED_PRECONDITION", 10: "ABORTED", 11: "OUT_OF_RANGE", 12: "UNIMPLEMENTED", 13: "INTERNAL", 14: "UNAVAILABLE", 15: "DATA_LOSS", } var Code_value = map[string]int32{ "OK": 0, "CANCELLED": 1, "UNKNOWN": 2, "INVALID_ARGUMENT": 3, "DEADLINE_EXCEEDED": 4, "NOT_FOUND": 5, "ALREADY_EXISTS": 6, "PERMISSION_DENIED": 7, "UNAUTHENTICATED": 16, "RESOURCE_EXHAUSTED": 8, "FAILED_PRECONDITION": 9, "ABORTED": 10, "OUT_OF_RANGE": 11, "UNIMPLEMENTED": 12, "INTERNAL": 13, "UNAVAILABLE": 14, "DATA_LOSS": 15, } func (Code) EnumDescriptor() ([]byte, []int) { return fileDescriptor_fe593a732623ccf0, []int{0} } func init() { proto.RegisterEnum("google.rpc.Code", Code_name, Code_value) } func init() { proto.RegisterFile("google/rpc/code.proto", fileDescriptor_fe593a732623ccf0) } var fileDescriptor_fe593a732623ccf0 = []byte{ // 393 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x91, 0x3d, 0x6e, 0x13, 0x41, 0x14, 0xc7, 0x3d, 0x76, 0x70, 0xe2, 0xf1, 0xd7, 0xcb, 0x84, 0x40, 0x37, 0x07, 0xa0, 0x70, 0x0a, 0x4e, 0xf0, 0xbc, 0xf3, 0x9c, 0x8c, 0x32, 0x7e, 0xb3, 0x9a, 0x9d, 0x09, 0x01, 0x21, 0xad, 0xc4, 0xc6, 0x4a, 0x03, 0x5a, 0xcb, 0xe2, 0x00, 0x9c, 0x85, 0x8a, 0x1b, 0x70, 0x85, 0x94, 0x29, 0x29, 0xf1, 0xa6, 0xa1, 0x74, 0x49, 0x89, 0x06, 0x0a, 0xda, 0x9f, 0xde, 0xc7, 0xff, 0x43, 0x9e, 0xdf, 0xb7, 0xed, 0xfd, 0xc7, 0xcd, 0xc5, 0x6e, 0xdb, 0x5c, 0x34, 0xed, 0xdd, 0x66, 0xb1, 0xdd, 0xb5, 0x9f, 0x5b, 0x25, 0xff, 0xe1, 0xc5, 0x6e, 0xdb, 0xbc, 0xfa, 0xde, 0x97, 0x47, 0x45, 0x7b, 0xb7, 0x51, 0x43, 0xd9, 0xf7, 0xd7, 0xd0, 0x53, 0x53, 0x39, 0x2a, 0x90, 0x0b, 0x72, 0x8e, 0x0c, 0x08, 0x35, 0x96, 0xc7, 0x89, 0xaf, 0xd9, 0xbf, 0x61, 0xe8, 0xab, 0xe7, 0x12, 0x2c, 0xdf, 0xa0, 0xb3, 0xa6, 0xc6, 0x70, 0x99, 0xd6, 0xc4, 0x11, 0x06, 0xea, 0x5c, 0x9e, 0x1a, 0x42, 0xe3, 0x2c, 0x53, 0x4d, 0xb7, 0x05, 0x91, 0x21, 0x03, 0x47, 0xf9, 0x10, 0xfb, 0x58, 0xaf, 0x7c, 0x62, 0x03, 0xcf, 0x94, 0x92, 0x33, 0x74, 0x81, 0xd0, 0xbc, 0xad, 0xe9, 0xd6, 0x56, 0xb1, 0x82, 0x61, 0xde, 0x2c, 0x29, 0xac, 0x6d, 0x55, 0x59, 0xcf, 0xb5, 0x21, 0xb6, 0x64, 0xe0, 0x58, 0x9d, 0xc9, 0x79, 0x62, 0x4c, 0xf1, 0x8a, 0x38, 0xda, 0x02, 0x23, 0x19, 0x00, 0xf5, 0x42, 0xaa, 0x40, 0x95, 0x4f, 0xa1, 0xc8, 0x5f, 0xae, 0x30, 0x55, 0x99, 0x9f, 0xa8, 0x97, 0xf2, 0x6c, 0x85, 0xd6, 0x91, 0xa9, 0xcb, 0x40, 0x85, 0x67, 0x63, 0xa3, 0xf5, 0x0c, 0xa3, 0xac, 0x1c, 0x97, 0x3e, 0xe4, 0x29, 0xa9, 0x40, 0x4e, 0x7c, 0x8a, 0xb5, 0x5f, 0xd5, 0x01, 0xf9, 0x92, 0x60, 0xac, 0x4e, 0xe5, 0x34, 0xb1, 0x5d, 0x97, 0x8e, 0xb2, 0x0d, 0x32, 0x30, 0x51, 0x13, 0x79, 0x62, 0x39, 0x52, 0x60, 0x74, 0x30, 0x55, 0x73, 0x39, 0x4e, 0x8c, 0x37, 0x68, 0x1d, 0x2e, 0x1d, 0xc1, 0x2c, 0x1b, 0x32, 0x18, 0xb1, 0x76, 0xbe, 0xaa, 0x60, 0xbe, 0x7c, 0xff, 0xb8, 0xd7, 0xbd, 0x1f, 0x7b, 0xdd, 0x3b, 0xec, 0xb5, 0xf8, 0xbd, 0xd7, 0xe2, 0x4b, 0xa7, 0xc5, 0xb7, 0x4e, 0x8b, 0x87, 0x4e, 0x8b, 0xc7, 0x4e, 0x8b, 0x9f, 0x9d, 0x16, 0xbf, 0x3a, 0xdd, 0x3b, 0x64, 0xfe, 0xa4, 0xc5, 0xc3, 0x93, 0x16, 0x72, 0xd6, 0xb4, 0x9f, 0x16, 0xff, 0xf3, 0x5f, 0x8e, 0x72, 0xf8, 0x65, 0xae, 0xa5, 0x14, 0xef, 0x06, 0xbb, 0x6d, 0xf3, 0xb5, 0x3f, 0x08, 0x65, 0xf1, 0x61, 0xf8, 0xb7, 0xaa, 0xd7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x03, 0xd4, 0x27, 0xff, 0xc3, 0x01, 0x00, 0x00, } func (x Code) String() string { s, ok := Code_name[int32(x)] if ok { return s } return strconv.Itoa(int(x)) } googleapis-1.4.0/google/rpc/code.proto000066400000000000000000000156451365205541600177260ustar00rootroot00000000000000// 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. // 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.rpc; option go_package = "rpc"; option java_multiple_files = true; option java_outer_classname = "CodeProto"; option java_package = "com.google.rpc"; option objc_class_prefix = "RPC"; // The canonical error codes for gRPC APIs. // // // Sometimes multiple error codes may apply. Services should return // the most specific error code that applies. For example, prefer // `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply. // Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`. enum Code { // Not an error; returned on success // // HTTP Mapping: 200 OK OK = 0; // The operation was cancelled, typically by the caller. // // HTTP Mapping: 499 Client Closed Request CANCELLED = 1; // Unknown error. For example, this error may be returned when // a `Status` value received from another address space belongs to // an error space that is not known in this address space. Also // errors raised by APIs that do not return enough error information // may be converted to this error. // // HTTP Mapping: 500 Internal Server Error UNKNOWN = 2; // The client specified an invalid argument. Note that this differs // from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments // that are problematic regardless of the state of the system // (e.g., a malformed file name). // // HTTP Mapping: 400 Bad Request INVALID_ARGUMENT = 3; // The deadline expired before the operation could complete. For operations // that change the state of the system, this error may be returned // even if the operation has completed successfully. For example, a // successful response from a server could have been delayed long // enough for the deadline to expire. // // HTTP Mapping: 504 Gateway Timeout DEADLINE_EXCEEDED = 4; // Some requested entity (e.g., file or directory) was not found. // // Note to server developers: if a request is denied for an entire class // of users, such as gradual feature rollout or undocumented whitelist, // `NOT_FOUND` may be used. If a request is denied for some users within // a class of users, such as user-based access control, `PERMISSION_DENIED` // must be used. // // HTTP Mapping: 404 Not Found NOT_FOUND = 5; // The entity that a client attempted to create (e.g., file or directory) // already exists. // // HTTP Mapping: 409 Conflict ALREADY_EXISTS = 6; // The caller does not have permission to execute the specified // operation. `PERMISSION_DENIED` must not be used for rejections // caused by exhausting some resource (use `RESOURCE_EXHAUSTED` // instead for those errors). `PERMISSION_DENIED` must not be // used if the caller can not be identified (use `UNAUTHENTICATED` // instead for those errors). This error code does not imply the // request is valid or the requested entity exists or satisfies // other pre-conditions. // // HTTP Mapping: 403 Forbidden PERMISSION_DENIED = 7; // The request does not have valid authentication credentials for the // operation. // // HTTP Mapping: 401 Unauthorized UNAUTHENTICATED = 16; // Some resource has been exhausted, perhaps a per-user quota, or // perhaps the entire file system is out of space. // // HTTP Mapping: 429 Too Many Requests RESOURCE_EXHAUSTED = 8; // The operation was rejected because the system is not in a state // required for the operation's execution. For example, the directory // to be deleted is non-empty, an rmdir operation is applied to // a non-directory, etc. // // Service implementors can use the following guidelines to decide // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: // (a) Use `UNAVAILABLE` if the client can retry just the failing call. // (b) Use `ABORTED` if the client should retry at a higher level // (e.g., when a client-specified test-and-set fails, indicating the // client should restart a read-modify-write sequence). // (c) Use `FAILED_PRECONDITION` if the client should not retry until // the system state has been explicitly fixed. E.g., if an "rmdir" // fails because the directory is non-empty, `FAILED_PRECONDITION` // should be returned since the client should not retry unless // the files are deleted from the directory. // // HTTP Mapping: 400 Bad Request FAILED_PRECONDITION = 9; // The operation was aborted, typically due to a concurrency issue such as // a sequencer check failure or transaction abort. // // See the guidelines above for deciding between `FAILED_PRECONDITION`, // `ABORTED`, and `UNAVAILABLE`. // // HTTP Mapping: 409 Conflict ABORTED = 10; // The operation was attempted past the valid range. E.g., seeking or // reading past end-of-file. // // Unlike `INVALID_ARGUMENT`, this error indicates a problem that may // be fixed if the system state changes. For example, a 32-bit file // system will generate `INVALID_ARGUMENT` if asked to read at an // offset that is not in the range [0,2^32-1], but it will generate // `OUT_OF_RANGE` if asked to read from an offset past the current // file size. // // There is a fair bit of overlap between `FAILED_PRECONDITION` and // `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific // error) when it applies so that callers who are iterating through // a space can easily look for an `OUT_OF_RANGE` error to detect when // they are done. // // HTTP Mapping: 400 Bad Request OUT_OF_RANGE = 11; // The operation is not implemented or is not supported/enabled in this // service. // // HTTP Mapping: 501 Not Implemented UNIMPLEMENTED = 12; // Internal errors. This means that some invariants expected by the // underlying system have been broken. This error code is reserved // for serious errors. // // HTTP Mapping: 500 Internal Server Error INTERNAL = 13; // The service is currently unavailable. This is most likely a // transient condition, which can be corrected by retrying with // a backoff. Note that it is not always safe to retry // non-idempotent operations. // // See the guidelines above for deciding between `FAILED_PRECONDITION`, // `ABORTED`, and `UNAVAILABLE`. // // HTTP Mapping: 503 Service Unavailable UNAVAILABLE = 14; // Unrecoverable data loss or corruption. // // HTTP Mapping: 500 Internal Server Error DATA_LOSS = 15; } googleapis-1.4.0/google/rpc/error_details.pb.go000066400000000000000000004131041365205541600215040ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/rpc/error_details.proto package rpc import ( bytes "bytes" fmt "fmt" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" types "github.com/gogo/protobuf/types" 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 // Describes when the clients can retry a failed request. Clients could ignore // the recommendation here or retry when this information is missing from error // responses. // // It's always recommended that clients should use exponential backoff when // retrying. // // Clients should wait until `retry_delay` amount of time has passed since // receiving the error response before retrying. If retrying requests also // fail, clients should use an exponential backoff scheme to gradually increase // the delay between retries based on `retry_delay`, until either a maximum // number of retries have been reached or a maximum retry delay cap has been // reached. type RetryInfo struct { // Clients should wait at least this long between retrying the same request. RetryDelay *types.Duration `protobuf:"bytes,1,opt,name=retry_delay,json=retryDelay,proto3" json:"retry_delay,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RetryInfo) Reset() { *m = RetryInfo{} } func (*RetryInfo) ProtoMessage() {} func (*RetryInfo) Descriptor() ([]byte, []int) { return fileDescriptor_851816e4d6b6361a, []int{0} } func (m *RetryInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RetryInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RetryInfo.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 *RetryInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_RetryInfo.Merge(m, src) } func (m *RetryInfo) XXX_Size() int { return m.Size() } func (m *RetryInfo) XXX_DiscardUnknown() { xxx_messageInfo_RetryInfo.DiscardUnknown(m) } var xxx_messageInfo_RetryInfo proto.InternalMessageInfo func (m *RetryInfo) GetRetryDelay() *types.Duration { if m != nil { return m.RetryDelay } return nil } func (*RetryInfo) XXX_MessageName() string { return "google.rpc.RetryInfo" } // Describes additional debugging info. type DebugInfo struct { // The stack trace entries indicating where the error occurred. StackEntries []string `protobuf:"bytes,1,rep,name=stack_entries,json=stackEntries,proto3" json:"stack_entries,omitempty"` // Additional debugging information provided by the server. Detail string `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *DebugInfo) Reset() { *m = DebugInfo{} } func (*DebugInfo) ProtoMessage() {} func (*DebugInfo) Descriptor() ([]byte, []int) { return fileDescriptor_851816e4d6b6361a, []int{1} } func (m *DebugInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *DebugInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DebugInfo.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 *DebugInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_DebugInfo.Merge(m, src) } func (m *DebugInfo) XXX_Size() int { return m.Size() } func (m *DebugInfo) XXX_DiscardUnknown() { xxx_messageInfo_DebugInfo.DiscardUnknown(m) } var xxx_messageInfo_DebugInfo proto.InternalMessageInfo func (m *DebugInfo) GetStackEntries() []string { if m != nil { return m.StackEntries } return nil } func (m *DebugInfo) GetDetail() string { if m != nil { return m.Detail } return "" } func (*DebugInfo) XXX_MessageName() string { return "google.rpc.DebugInfo" } // Describes how a quota check failed. // // For example if a daily limit was exceeded for the calling project, // a service could respond with a QuotaFailure detail containing the project // id and the description of the quota limit that was exceeded. If the // calling project hasn't enabled the service in the developer console, then // a service could respond with the project id and set `service_disabled` // to true. // // Also see RetryInfo and Help types for other details about handling a // quota failure. type QuotaFailure struct { // Describes all quota violations. Violations []*QuotaFailure_Violation `protobuf:"bytes,1,rep,name=violations,proto3" json:"violations,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *QuotaFailure) Reset() { *m = QuotaFailure{} } func (*QuotaFailure) ProtoMessage() {} func (*QuotaFailure) Descriptor() ([]byte, []int) { return fileDescriptor_851816e4d6b6361a, []int{2} } func (m *QuotaFailure) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *QuotaFailure) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QuotaFailure.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 *QuotaFailure) XXX_Merge(src proto.Message) { xxx_messageInfo_QuotaFailure.Merge(m, src) } func (m *QuotaFailure) XXX_Size() int { return m.Size() } func (m *QuotaFailure) XXX_DiscardUnknown() { xxx_messageInfo_QuotaFailure.DiscardUnknown(m) } var xxx_messageInfo_QuotaFailure proto.InternalMessageInfo func (m *QuotaFailure) GetViolations() []*QuotaFailure_Violation { if m != nil { return m.Violations } return nil } func (*QuotaFailure) XXX_MessageName() string { return "google.rpc.QuotaFailure" } // A message type used to describe a single quota violation. For example, a // daily quota or a custom quota that was exceeded. type QuotaFailure_Violation struct { // The subject on which the quota check failed. // For example, "clientip:" or "project:". Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` // A description of how the quota check failed. Clients can use this // description to find more about the quota configuration in the service's // public documentation, or find the relevant quota limit to adjust through // developer console. // // For example: "Service disabled" or "Daily Limit for read operations // exceeded". Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *QuotaFailure_Violation) Reset() { *m = QuotaFailure_Violation{} } func (*QuotaFailure_Violation) ProtoMessage() {} func (*QuotaFailure_Violation) Descriptor() ([]byte, []int) { return fileDescriptor_851816e4d6b6361a, []int{2, 0} } func (m *QuotaFailure_Violation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *QuotaFailure_Violation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QuotaFailure_Violation.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 *QuotaFailure_Violation) XXX_Merge(src proto.Message) { xxx_messageInfo_QuotaFailure_Violation.Merge(m, src) } func (m *QuotaFailure_Violation) XXX_Size() int { return m.Size() } func (m *QuotaFailure_Violation) XXX_DiscardUnknown() { xxx_messageInfo_QuotaFailure_Violation.DiscardUnknown(m) } var xxx_messageInfo_QuotaFailure_Violation proto.InternalMessageInfo func (m *QuotaFailure_Violation) GetSubject() string { if m != nil { return m.Subject } return "" } func (m *QuotaFailure_Violation) GetDescription() string { if m != nil { return m.Description } return "" } func (*QuotaFailure_Violation) XXX_MessageName() string { return "google.rpc.QuotaFailure.Violation" } // Describes the cause of the error with structured details. // // Example of an error when contacting the "pubsub.googleapis.com" API when it // is not enabled: // { "reason": "API_DISABLED" // "domain": "googleapis.com" // "metadata": { // "resource": "projects/123", // "service": "pubsub.googleapis.com" // } // } // This response indicates that the pubsub.googleapis.com API is not enabled. // // Example of an error that is returned when attempting to create a Spanner // instance in a region that is out of stock: // { "reason": "STOCKOUT" // "domain": "spanner.googleapis.com", // "metadata": { // "availableRegions": "us-central1,us-east2" // } // } // type ErrorInfo struct { // 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_]+/. 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 // omitted. The value will be, "googleapis.com". Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` // Additional structured details about this error. // // Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in // length. When identifying the current value of an exceeded limit, the units // should be contained in the key, not the value. For example, rather than // {"instanceLimit": "100/request"}, should be returned as, // {"instanceLimitPerRequest": "100"}, if the client exceeds the number of // instances that can be created in a single (batch) request. Metadata map[string]string `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ErrorInfo) Reset() { *m = ErrorInfo{} } func (*ErrorInfo) ProtoMessage() {} func (*ErrorInfo) Descriptor() ([]byte, []int) { return fileDescriptor_851816e4d6b6361a, []int{3} } func (m *ErrorInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ErrorInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ErrorInfo.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 *ErrorInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_ErrorInfo.Merge(m, src) } func (m *ErrorInfo) XXX_Size() int { return m.Size() } func (m *ErrorInfo) XXX_DiscardUnknown() { xxx_messageInfo_ErrorInfo.DiscardUnknown(m) } var xxx_messageInfo_ErrorInfo proto.InternalMessageInfo func (m *ErrorInfo) GetReason() string { if m != nil { return m.Reason } return "" } func (m *ErrorInfo) GetDomain() string { if m != nil { return m.Domain } return "" } func (m *ErrorInfo) GetMetadata() map[string]string { if m != nil { return m.Metadata } return nil } func (*ErrorInfo) XXX_MessageName() string { return "google.rpc.ErrorInfo" } // Describes what preconditions have failed. // // For example, if an RPC failed because it required the Terms of Service to be // acknowledged, it could list the terms of service violation in the // PreconditionFailure message. type PreconditionFailure struct { // Describes all precondition violations. Violations []*PreconditionFailure_Violation `protobuf:"bytes,1,rep,name=violations,proto3" json:"violations,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PreconditionFailure) Reset() { *m = PreconditionFailure{} } func (*PreconditionFailure) ProtoMessage() {} func (*PreconditionFailure) Descriptor() ([]byte, []int) { return fileDescriptor_851816e4d6b6361a, []int{4} } func (m *PreconditionFailure) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PreconditionFailure) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PreconditionFailure.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 *PreconditionFailure) XXX_Merge(src proto.Message) { xxx_messageInfo_PreconditionFailure.Merge(m, src) } func (m *PreconditionFailure) XXX_Size() int { return m.Size() } func (m *PreconditionFailure) XXX_DiscardUnknown() { xxx_messageInfo_PreconditionFailure.DiscardUnknown(m) } var xxx_messageInfo_PreconditionFailure proto.InternalMessageInfo func (m *PreconditionFailure) GetViolations() []*PreconditionFailure_Violation { if m != nil { return m.Violations } return nil } func (*PreconditionFailure) XXX_MessageName() string { return "google.rpc.PreconditionFailure" } // A message type used to describe a single precondition failure. type PreconditionFailure_Violation struct { // The type of PreconditionFailure. We recommend using a service-specific // enum type to define the supported precondition violation subjects. For // example, "TOS" for "Terms of Service violation". Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // The subject, relative to the type, that failed. // For example, "google.com/cloud" relative to the "TOS" type would indicate // which terms of service is being referenced. Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` // A description of how the precondition failed. Developers can use this // description to understand how to fix the failure. // // For example: "Terms of service not accepted". Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PreconditionFailure_Violation) Reset() { *m = PreconditionFailure_Violation{} } func (*PreconditionFailure_Violation) ProtoMessage() {} func (*PreconditionFailure_Violation) Descriptor() ([]byte, []int) { return fileDescriptor_851816e4d6b6361a, []int{4, 0} } func (m *PreconditionFailure_Violation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PreconditionFailure_Violation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PreconditionFailure_Violation.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 *PreconditionFailure_Violation) XXX_Merge(src proto.Message) { xxx_messageInfo_PreconditionFailure_Violation.Merge(m, src) } func (m *PreconditionFailure_Violation) XXX_Size() int { return m.Size() } func (m *PreconditionFailure_Violation) XXX_DiscardUnknown() { xxx_messageInfo_PreconditionFailure_Violation.DiscardUnknown(m) } var xxx_messageInfo_PreconditionFailure_Violation proto.InternalMessageInfo func (m *PreconditionFailure_Violation) GetType() string { if m != nil { return m.Type } return "" } func (m *PreconditionFailure_Violation) GetSubject() string { if m != nil { return m.Subject } return "" } func (m *PreconditionFailure_Violation) GetDescription() string { if m != nil { return m.Description } return "" } func (*PreconditionFailure_Violation) XXX_MessageName() string { return "google.rpc.PreconditionFailure.Violation" } // Describes violations in a client request. This error type focuses on the // syntactic aspects of the request. type BadRequest struct { // Describes all violations in a client request. FieldViolations []*BadRequest_FieldViolation `protobuf:"bytes,1,rep,name=field_violations,json=fieldViolations,proto3" json:"field_violations,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *BadRequest) Reset() { *m = BadRequest{} } func (*BadRequest) ProtoMessage() {} func (*BadRequest) Descriptor() ([]byte, []int) { return fileDescriptor_851816e4d6b6361a, []int{5} } func (m *BadRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *BadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_BadRequest.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 *BadRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_BadRequest.Merge(m, src) } func (m *BadRequest) XXX_Size() int { return m.Size() } func (m *BadRequest) XXX_DiscardUnknown() { xxx_messageInfo_BadRequest.DiscardUnknown(m) } var xxx_messageInfo_BadRequest proto.InternalMessageInfo func (m *BadRequest) GetFieldViolations() []*BadRequest_FieldViolation { if m != nil { return m.FieldViolations } return nil } func (*BadRequest) XXX_MessageName() string { return "google.rpc.BadRequest" } // A message type used to describe a single bad request field. type BadRequest_FieldViolation struct { // A path leading to a field in the request body. The value will be a // sequence of dot-separated identifiers that identify a protocol buffer // field. E.g., "field_violations.field" would identify this field. Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` // A description of why the request element is bad. Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *BadRequest_FieldViolation) Reset() { *m = BadRequest_FieldViolation{} } func (*BadRequest_FieldViolation) ProtoMessage() {} func (*BadRequest_FieldViolation) Descriptor() ([]byte, []int) { return fileDescriptor_851816e4d6b6361a, []int{5, 0} } func (m *BadRequest_FieldViolation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *BadRequest_FieldViolation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_BadRequest_FieldViolation.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 *BadRequest_FieldViolation) XXX_Merge(src proto.Message) { xxx_messageInfo_BadRequest_FieldViolation.Merge(m, src) } func (m *BadRequest_FieldViolation) XXX_Size() int { return m.Size() } func (m *BadRequest_FieldViolation) XXX_DiscardUnknown() { xxx_messageInfo_BadRequest_FieldViolation.DiscardUnknown(m) } var xxx_messageInfo_BadRequest_FieldViolation proto.InternalMessageInfo func (m *BadRequest_FieldViolation) GetField() string { if m != nil { return m.Field } return "" } func (m *BadRequest_FieldViolation) GetDescription() string { if m != nil { return m.Description } return "" } func (*BadRequest_FieldViolation) XXX_MessageName() string { return "google.rpc.BadRequest.FieldViolation" } // Contains metadata about the request that clients can attach when filing a bug // or providing other forms of feedback. type RequestInfo struct { // An opaque string that should only be interpreted by the service generating // it. For example, it can be used to identify requests in the service's logs. RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // Any data that was used to serve this request. For example, an encrypted // stack trace that can be sent back to the service provider for debugging. ServingData string `protobuf:"bytes,2,opt,name=serving_data,json=servingData,proto3" json:"serving_data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RequestInfo) Reset() { *m = RequestInfo{} } func (*RequestInfo) ProtoMessage() {} func (*RequestInfo) Descriptor() ([]byte, []int) { return fileDescriptor_851816e4d6b6361a, []int{6} } func (m *RequestInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RequestInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RequestInfo.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 *RequestInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_RequestInfo.Merge(m, src) } func (m *RequestInfo) XXX_Size() int { return m.Size() } func (m *RequestInfo) XXX_DiscardUnknown() { xxx_messageInfo_RequestInfo.DiscardUnknown(m) } var xxx_messageInfo_RequestInfo proto.InternalMessageInfo func (m *RequestInfo) GetRequestId() string { if m != nil { return m.RequestId } return "" } func (m *RequestInfo) GetServingData() string { if m != nil { return m.ServingData } return "" } func (*RequestInfo) XXX_MessageName() string { return "google.rpc.RequestInfo" } // Describes the resource that is being accessed. type ResourceInfo struct { // A name for the type of resource being accessed, e.g. "sql table", // "cloud storage bucket", "file", "Google calendar"; or the type URL // of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". ResourceType string `protobuf:"bytes,1,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` // The name of the resource being accessed. For example, a shared calendar // name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current // error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. ResourceName string `protobuf:"bytes,2,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` // The owner of the resource (optional). // For example, "user:" or "project:". Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` // Describes what error is encountered when accessing this resource. // For example, updating a cloud project may require the `writer` permission // on the developer console project. Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ResourceInfo) Reset() { *m = ResourceInfo{} } func (*ResourceInfo) ProtoMessage() {} func (*ResourceInfo) Descriptor() ([]byte, []int) { return fileDescriptor_851816e4d6b6361a, []int{7} } func (m *ResourceInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ResourceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ResourceInfo.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 *ResourceInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_ResourceInfo.Merge(m, src) } func (m *ResourceInfo) XXX_Size() int { return m.Size() } func (m *ResourceInfo) XXX_DiscardUnknown() { xxx_messageInfo_ResourceInfo.DiscardUnknown(m) } var xxx_messageInfo_ResourceInfo proto.InternalMessageInfo func (m *ResourceInfo) GetResourceType() string { if m != nil { return m.ResourceType } return "" } func (m *ResourceInfo) GetResourceName() string { if m != nil { return m.ResourceName } return "" } func (m *ResourceInfo) GetOwner() string { if m != nil { return m.Owner } return "" } func (m *ResourceInfo) GetDescription() string { if m != nil { return m.Description } return "" } func (*ResourceInfo) XXX_MessageName() string { return "google.rpc.ResourceInfo" } // Provides links to documentation or for performing an out of band action. // // For example, if a quota check failed with an error indicating the calling // project hasn't enabled the accessed service, this can contain a URL pointing // directly to the right place in the developer console to flip the bit. type Help struct { // URL(s) pointing to additional information on handling the current error. Links []*Help_Link `protobuf:"bytes,1,rep,name=links,proto3" json:"links,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Help) Reset() { *m = Help{} } func (*Help) ProtoMessage() {} func (*Help) Descriptor() ([]byte, []int) { return fileDescriptor_851816e4d6b6361a, []int{8} } func (m *Help) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Help) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Help.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 *Help) XXX_Merge(src proto.Message) { xxx_messageInfo_Help.Merge(m, src) } func (m *Help) XXX_Size() int { return m.Size() } func (m *Help) XXX_DiscardUnknown() { xxx_messageInfo_Help.DiscardUnknown(m) } var xxx_messageInfo_Help proto.InternalMessageInfo func (m *Help) GetLinks() []*Help_Link { if m != nil { return m.Links } return nil } func (*Help) XXX_MessageName() string { return "google.rpc.Help" } // Describes a URL link. type Help_Link struct { // Describes what the link offers. Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` // The URL of the link. Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Help_Link) Reset() { *m = Help_Link{} } func (*Help_Link) ProtoMessage() {} func (*Help_Link) Descriptor() ([]byte, []int) { return fileDescriptor_851816e4d6b6361a, []int{8, 0} } func (m *Help_Link) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Help_Link) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Help_Link.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 *Help_Link) XXX_Merge(src proto.Message) { xxx_messageInfo_Help_Link.Merge(m, src) } func (m *Help_Link) XXX_Size() int { return m.Size() } func (m *Help_Link) XXX_DiscardUnknown() { xxx_messageInfo_Help_Link.DiscardUnknown(m) } var xxx_messageInfo_Help_Link proto.InternalMessageInfo func (m *Help_Link) GetDescription() string { if m != nil { return m.Description } return "" } func (m *Help_Link) GetUrl() string { if m != nil { return m.Url } return "" } func (*Help_Link) XXX_MessageName() string { return "google.rpc.Help.Link" } // Provides a localized error message that is safe to return to the user // which can be attached to an RPC error. type LocalizedMessage struct { // The locale used following the specification defined at // http://www.rfc-editor.org/rfc/bcp/bcp47.txt. // Examples are: "en-US", "fr-CH", "es-MX" Locale string `protobuf:"bytes,1,opt,name=locale,proto3" json:"locale,omitempty"` // The localized error message in the above locale. Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *LocalizedMessage) Reset() { *m = LocalizedMessage{} } func (*LocalizedMessage) ProtoMessage() {} func (*LocalizedMessage) Descriptor() ([]byte, []int) { return fileDescriptor_851816e4d6b6361a, []int{9} } func (m *LocalizedMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *LocalizedMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_LocalizedMessage.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 *LocalizedMessage) XXX_Merge(src proto.Message) { xxx_messageInfo_LocalizedMessage.Merge(m, src) } func (m *LocalizedMessage) XXX_Size() int { return m.Size() } func (m *LocalizedMessage) XXX_DiscardUnknown() { xxx_messageInfo_LocalizedMessage.DiscardUnknown(m) } var xxx_messageInfo_LocalizedMessage proto.InternalMessageInfo func (m *LocalizedMessage) GetLocale() string { if m != nil { return m.Locale } return "" } func (m *LocalizedMessage) GetMessage() string { if m != nil { return m.Message } return "" } func (*LocalizedMessage) XXX_MessageName() string { return "google.rpc.LocalizedMessage" } func init() { proto.RegisterType((*RetryInfo)(nil), "google.rpc.RetryInfo") proto.RegisterType((*DebugInfo)(nil), "google.rpc.DebugInfo") proto.RegisterType((*QuotaFailure)(nil), "google.rpc.QuotaFailure") proto.RegisterType((*QuotaFailure_Violation)(nil), "google.rpc.QuotaFailure.Violation") proto.RegisterType((*ErrorInfo)(nil), "google.rpc.ErrorInfo") proto.RegisterMapType((map[string]string)(nil), "google.rpc.ErrorInfo.MetadataEntry") proto.RegisterType((*PreconditionFailure)(nil), "google.rpc.PreconditionFailure") proto.RegisterType((*PreconditionFailure_Violation)(nil), "google.rpc.PreconditionFailure.Violation") proto.RegisterType((*BadRequest)(nil), "google.rpc.BadRequest") proto.RegisterType((*BadRequest_FieldViolation)(nil), "google.rpc.BadRequest.FieldViolation") proto.RegisterType((*RequestInfo)(nil), "google.rpc.RequestInfo") proto.RegisterType((*ResourceInfo)(nil), "google.rpc.ResourceInfo") proto.RegisterType((*Help)(nil), "google.rpc.Help") proto.RegisterType((*Help_Link)(nil), "google.rpc.Help.Link") proto.RegisterType((*LocalizedMessage)(nil), "google.rpc.LocalizedMessage") } func init() { proto.RegisterFile("google/rpc/error_details.proto", fileDescriptor_851816e4d6b6361a) } var fileDescriptor_851816e4d6b6361a = []byte{ // 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, 0x2e, 0x28, 0x76, 0x53, 0x92, 0xed, 0x5d, 0x30, 0x9a, 0xd8, 0x49, 0x7a, 0x4a, 0x68, 0x15, 0x16, 0xa3, 0x98, 0x7a, 0xfd, 0x36, 0x86, 0xb1, 0x60, 0x18, 0x55, 0x49, 0xbd, 0xb8, 0x66, 0xb8, 0x15, 0x55, 0xdc, 0x4a, 0x6b, 0xe6, 0x0a, 0x2c, 0xa4, 0x7d, 0x57, 0x0b, 0x75, 0xb2, 0x66, 0xb8, 0x1a, 0xd9, 0x9f, 0x09, 0x54, 0x5e, 0x24, 0x3c, 0xa6, 0xdb, 0x94, 0x05, 0x89, 0x40, 0xb3, 0x01, 0x70, 0xc8, 0x78, 0xa0, 0xee, 0x4c, 0xa5, 0xca, 0x1b, 0xb6, 0x73, 0x6e, 0xd2, 0xc9, 0xb3, 0x9d, 0x57, 0x19, 0xd5, 0xcd, 0x9d, 0xaa, 0xed, 0x80, 0x31, 0xdd, 0x30, 0xab, 0xf0, 0x5f, 0x94, 0x74, 0xde, 0xa2, 0x17, 0x2b, 0x8f, 0x86, 0x9b, 0x41, 0xb3, 0x0e, 0x65, 0x1f, 0x23, 0x4f, 0xb0, 0xa1, 0x24, 0xea, 0xc6, 0xf2, 0x25, 0xfb, 0x2b, 0x01, 0x63, 0x4b, 0x86, 0xae, 0x8c, 0xae, 0xc0, 0x82, 0x40, 0x1a, 0xf1, 0x50, 0x0b, 0x69, 0xa4, 0xbc, 0xf1, 0x01, 0x65, 0xe1, 0xd4, 0x9b, 0x42, 0xe6, 0x13, 0xf8, 0x7f, 0x80, 0x31, 0xf5, 0x69, 0x4c, 0xab, 0x45, 0x65, 0x64, 0x35, 0x6f, 0x64, 0x2a, 0xec, 0x1c, 0x68, 0x96, 0x0c, 0x6b, 0xe4, 0x4e, 0x0f, 0xd5, 0x1e, 0xc3, 0xe2, 0x85, 0x2d, 0x73, 0x19, 0x8a, 0x7d, 0x1c, 0xe9, 0xeb, 0xe5, 0xd2, 0xbc, 0x09, 0xf3, 0x87, 0x34, 0x48, 0x50, 0x5f, 0x9d, 0x82, 0xcd, 0xc2, 0x23, 0x62, 0x7f, 0x23, 0x70, 0xa3, 0x25, 0xd0, 0xe3, 0xa1, 0xcf, 0xa4, 0x99, 0x2c, 0xe0, 0xbd, 0x2b, 0x02, 0xbe, 0x9f, 0xef, 0xeb, 0x8a, 0x43, 0x7f, 0xc8, 0xf9, 0x4d, 0x3e, 0x67, 0x13, 0x4a, 0xf1, 0x68, 0x88, 0xba, 0x39, 0xb5, 0xce, 0x67, 0x5f, 0xf8, 0x6b, 0xf6, 0xc5, 0xd9, 0xec, 0x8f, 0x08, 0x40, 0x83, 0xfa, 0x2e, 0xbe, 0x4b, 0x30, 0x8a, 0xcd, 0x16, 0x2c, 0x77, 0x19, 0x06, 0x7e, 0x7b, 0xa6, 0xf9, 0x7b, 0xf9, 0xe6, 0xcf, 0x4f, 0x38, 0xdb, 0x92, 0x7e, 0xde, 0xf8, 0xb5, 0xee, 0x05, 0x1c, 0xd5, 0x76, 0x61, 0xe9, 0x22, 0x45, 0x86, 0xa9, 0x48, 0xda, 0x43, 0x0a, 0xfe, 0x61, 0x4c, 0x9e, 0x43, 0x59, 0x5f, 0xaa, 0xe6, 0xe4, 0x0e, 0x80, 0x48, 0x61, 0x9b, 0x65, 0x5a, 0x86, 0xae, 0xec, 0xf9, 0xe6, 0x5d, 0xa8, 0x44, 0x28, 0x0e, 0x59, 0xd8, 0x6b, 0xab, 0xd1, 0xd0, 0x82, 0xba, 0xd6, 0xa4, 0x31, 0xb5, 0x3f, 0x11, 0xa8, 0xb8, 0x18, 0xf1, 0x44, 0x78, 0x98, 0xbd, 0x31, 0xa1, 0x71, 0x3b, 0x97, 0x72, 0x25, 0x2b, 0xbe, 0x94, 0x69, 0xe7, 0x49, 0x21, 0x1d, 0x64, 0x33, 0x31, 0x25, 0x3d, 0xa3, 0x03, 0x94, 0x1e, 0xf9, 0xfb, 0x10, 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 { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*RetryInfo) if !ok { that2, ok := that.(RetryInfo) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if c := this.RetryDelay.Compare(that1.RetryDelay); c != 0 { return c } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *DebugInfo) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*DebugInfo) if !ok { that2, ok := that.(DebugInfo) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if len(this.StackEntries) != len(that1.StackEntries) { if len(this.StackEntries) < len(that1.StackEntries) { return -1 } return 1 } for i := range this.StackEntries { if this.StackEntries[i] != that1.StackEntries[i] { if this.StackEntries[i] < that1.StackEntries[i] { return -1 } return 1 } } if this.Detail != that1.Detail { if this.Detail < that1.Detail { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *QuotaFailure) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*QuotaFailure) if !ok { that2, ok := that.(QuotaFailure) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if len(this.Violations) != len(that1.Violations) { if len(this.Violations) < len(that1.Violations) { return -1 } return 1 } for i := range this.Violations { if c := this.Violations[i].Compare(that1.Violations[i]); c != 0 { return c } } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *QuotaFailure_Violation) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*QuotaFailure_Violation) if !ok { that2, ok := that.(QuotaFailure_Violation) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.Subject != that1.Subject { if this.Subject < that1.Subject { return -1 } return 1 } if this.Description != that1.Description { if this.Description < that1.Description { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *ErrorInfo) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*ErrorInfo) if !ok { that2, ok := that.(ErrorInfo) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.Reason != that1.Reason { if this.Reason < that1.Reason { return -1 } return 1 } if this.Domain != that1.Domain { if this.Domain < that1.Domain { return -1 } return 1 } if len(this.Metadata) != len(that1.Metadata) { if len(this.Metadata) < len(that1.Metadata) { return -1 } return 1 } for i := range this.Metadata { if this.Metadata[i] != that1.Metadata[i] { if this.Metadata[i] < that1.Metadata[i] { return -1 } return 1 } } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *PreconditionFailure) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*PreconditionFailure) if !ok { that2, ok := that.(PreconditionFailure) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if len(this.Violations) != len(that1.Violations) { if len(this.Violations) < len(that1.Violations) { return -1 } return 1 } for i := range this.Violations { if c := this.Violations[i].Compare(that1.Violations[i]); c != 0 { return c } } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *PreconditionFailure_Violation) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*PreconditionFailure_Violation) if !ok { that2, ok := that.(PreconditionFailure_Violation) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.Type != that1.Type { if this.Type < that1.Type { return -1 } return 1 } if this.Subject != that1.Subject { if this.Subject < that1.Subject { return -1 } return 1 } if this.Description != that1.Description { if this.Description < that1.Description { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *BadRequest) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*BadRequest) if !ok { that2, ok := that.(BadRequest) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if len(this.FieldViolations) != len(that1.FieldViolations) { if len(this.FieldViolations) < len(that1.FieldViolations) { return -1 } return 1 } for i := range this.FieldViolations { if c := this.FieldViolations[i].Compare(that1.FieldViolations[i]); c != 0 { return c } } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *BadRequest_FieldViolation) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*BadRequest_FieldViolation) if !ok { that2, ok := that.(BadRequest_FieldViolation) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.Field != that1.Field { if this.Field < that1.Field { return -1 } return 1 } if this.Description != that1.Description { if this.Description < that1.Description { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *RequestInfo) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*RequestInfo) if !ok { that2, ok := that.(RequestInfo) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.RequestId != that1.RequestId { if this.RequestId < that1.RequestId { return -1 } return 1 } if this.ServingData != that1.ServingData { if this.ServingData < that1.ServingData { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *ResourceInfo) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*ResourceInfo) if !ok { that2, ok := that.(ResourceInfo) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.ResourceType != that1.ResourceType { if this.ResourceType < that1.ResourceType { return -1 } return 1 } if this.ResourceName != that1.ResourceName { if this.ResourceName < that1.ResourceName { return -1 } return 1 } if this.Owner != that1.Owner { if this.Owner < that1.Owner { return -1 } return 1 } if this.Description != that1.Description { if this.Description < that1.Description { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *Help) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*Help) if !ok { that2, ok := that.(Help) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if len(this.Links) != len(that1.Links) { if len(this.Links) < len(that1.Links) { return -1 } return 1 } for i := range this.Links { if c := this.Links[i].Compare(that1.Links[i]); c != 0 { return c } } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *Help_Link) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*Help_Link) if !ok { that2, ok := that.(Help_Link) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.Description != that1.Description { if this.Description < that1.Description { return -1 } return 1 } if this.Url != that1.Url { if this.Url < that1.Url { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *LocalizedMessage) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*LocalizedMessage) if !ok { that2, ok := that.(LocalizedMessage) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.Locale != that1.Locale { if this.Locale < that1.Locale { return -1 } return 1 } if this.Message != that1.Message { if this.Message < that1.Message { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *RetryInfo) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*RetryInfo) if !ok { that2, ok := that.(RetryInfo) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.RetryDelay.Equal(that1.RetryDelay) { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *DebugInfo) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*DebugInfo) if !ok { that2, ok := that.(DebugInfo) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if len(this.StackEntries) != len(that1.StackEntries) { return false } for i := range this.StackEntries { if this.StackEntries[i] != that1.StackEntries[i] { return false } } if this.Detail != that1.Detail { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *QuotaFailure) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*QuotaFailure) if !ok { that2, ok := that.(QuotaFailure) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if len(this.Violations) != len(that1.Violations) { return false } for i := range this.Violations { if !this.Violations[i].Equal(that1.Violations[i]) { return false } } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *QuotaFailure_Violation) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*QuotaFailure_Violation) if !ok { that2, ok := that.(QuotaFailure_Violation) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Subject != that1.Subject { return false } if this.Description != that1.Description { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *ErrorInfo) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*ErrorInfo) if !ok { that2, ok := that.(ErrorInfo) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Reason != that1.Reason { return false } if this.Domain != that1.Domain { return false } if len(this.Metadata) != len(that1.Metadata) { return false } for i := range this.Metadata { if this.Metadata[i] != that1.Metadata[i] { return false } } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *PreconditionFailure) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*PreconditionFailure) if !ok { that2, ok := that.(PreconditionFailure) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if len(this.Violations) != len(that1.Violations) { return false } for i := range this.Violations { if !this.Violations[i].Equal(that1.Violations[i]) { return false } } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *PreconditionFailure_Violation) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*PreconditionFailure_Violation) if !ok { that2, ok := that.(PreconditionFailure_Violation) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Type != that1.Type { return false } if this.Subject != that1.Subject { return false } if this.Description != that1.Description { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *BadRequest) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*BadRequest) if !ok { that2, ok := that.(BadRequest) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if len(this.FieldViolations) != len(that1.FieldViolations) { return false } for i := range this.FieldViolations { if !this.FieldViolations[i].Equal(that1.FieldViolations[i]) { return false } } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *BadRequest_FieldViolation) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*BadRequest_FieldViolation) if !ok { that2, ok := that.(BadRequest_FieldViolation) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Field != that1.Field { return false } if this.Description != that1.Description { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *RequestInfo) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*RequestInfo) if !ok { that2, ok := that.(RequestInfo) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.RequestId != that1.RequestId { return false } if this.ServingData != that1.ServingData { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *ResourceInfo) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*ResourceInfo) if !ok { that2, ok := that.(ResourceInfo) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.ResourceType != that1.ResourceType { return false } if this.ResourceName != that1.ResourceName { return false } if this.Owner != that1.Owner { return false } if this.Description != that1.Description { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Help) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Help) if !ok { that2, ok := that.(Help) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if len(this.Links) != len(that1.Links) { return false } for i := range this.Links { if !this.Links[i].Equal(that1.Links[i]) { return false } } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Help_Link) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Help_Link) if !ok { that2, ok := that.(Help_Link) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Description != that1.Description { return false } if this.Url != that1.Url { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *LocalizedMessage) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*LocalizedMessage) if !ok { that2, ok := that.(LocalizedMessage) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Locale != that1.Locale { return false } if this.Message != that1.Message { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *RetryInfo) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&rpc.RetryInfo{") if this.RetryDelay != nil { s = append(s, "RetryDelay: "+fmt.Sprintf("%#v", this.RetryDelay)+",\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 (this *DebugInfo) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&rpc.DebugInfo{") s = append(s, "StackEntries: "+fmt.Sprintf("%#v", this.StackEntries)+",\n") s = append(s, "Detail: "+fmt.Sprintf("%#v", this.Detail)+",\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 (this *QuotaFailure) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&rpc.QuotaFailure{") if this.Violations != nil { s = append(s, "Violations: "+fmt.Sprintf("%#v", this.Violations)+",\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 (this *QuotaFailure_Violation) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&rpc.QuotaFailure_Violation{") s = append(s, "Subject: "+fmt.Sprintf("%#v", this.Subject)+",\n") s = append(s, "Description: "+fmt.Sprintf("%#v", this.Description)+",\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 (this *ErrorInfo) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 7) s = append(s, "&rpc.ErrorInfo{") 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 { keysForMetadata = append(keysForMetadata, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) mapStringForMetadata := "map[string]string{" for _, k := range keysForMetadata { mapStringForMetadata += fmt.Sprintf("%#v: %#v,", k, this.Metadata[k]) } mapStringForMetadata += "}" if this.Metadata != nil { s = append(s, "Metadata: "+mapStringForMetadata+",\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 (this *PreconditionFailure) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&rpc.PreconditionFailure{") if this.Violations != nil { s = append(s, "Violations: "+fmt.Sprintf("%#v", this.Violations)+",\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 (this *PreconditionFailure_Violation) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 7) s = append(s, "&rpc.PreconditionFailure_Violation{") s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n") s = append(s, "Subject: "+fmt.Sprintf("%#v", this.Subject)+",\n") s = append(s, "Description: "+fmt.Sprintf("%#v", this.Description)+",\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 (this *BadRequest) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&rpc.BadRequest{") if this.FieldViolations != nil { s = append(s, "FieldViolations: "+fmt.Sprintf("%#v", this.FieldViolations)+",\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 (this *BadRequest_FieldViolation) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&rpc.BadRequest_FieldViolation{") s = append(s, "Field: "+fmt.Sprintf("%#v", this.Field)+",\n") s = append(s, "Description: "+fmt.Sprintf("%#v", this.Description)+",\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 (this *RequestInfo) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&rpc.RequestInfo{") s = append(s, "RequestId: "+fmt.Sprintf("%#v", this.RequestId)+",\n") s = append(s, "ServingData: "+fmt.Sprintf("%#v", this.ServingData)+",\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 (this *ResourceInfo) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 8) s = append(s, "&rpc.ResourceInfo{") s = append(s, "ResourceType: "+fmt.Sprintf("%#v", this.ResourceType)+",\n") s = append(s, "ResourceName: "+fmt.Sprintf("%#v", this.ResourceName)+",\n") s = append(s, "Owner: "+fmt.Sprintf("%#v", this.Owner)+",\n") s = append(s, "Description: "+fmt.Sprintf("%#v", this.Description)+",\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 (this *Help) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&rpc.Help{") if this.Links != nil { s = append(s, "Links: "+fmt.Sprintf("%#v", this.Links)+",\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 (this *Help_Link) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&rpc.Help_Link{") s = append(s, "Description: "+fmt.Sprintf("%#v", this.Description)+",\n") s = append(s, "Url: "+fmt.Sprintf("%#v", this.Url)+",\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 (this *LocalizedMessage) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&rpc.LocalizedMessage{") s = append(s, "Locale: "+fmt.Sprintf("%#v", this.Locale)+",\n") s = append(s, "Message: "+fmt.Sprintf("%#v", this.Message)+",\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 valueToGoStringErrorDetails(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 *RetryInfo) 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 *RetryInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RetryInfo) 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.RetryDelay != nil { { size, err := m.RetryDelay.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintErrorDetails(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *DebugInfo) 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 *DebugInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *DebugInfo) 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 len(m.Detail) > 0 { i -= len(m.Detail) copy(dAtA[i:], m.Detail) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Detail))) i-- dAtA[i] = 0x12 } if len(m.StackEntries) > 0 { for iNdEx := len(m.StackEntries) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.StackEntries[iNdEx]) copy(dAtA[i:], m.StackEntries[iNdEx]) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.StackEntries[iNdEx]))) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *QuotaFailure) 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 *QuotaFailure) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *QuotaFailure) 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 len(m.Violations) > 0 { for iNdEx := len(m.Violations) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Violations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintErrorDetails(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *QuotaFailure_Violation) 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 *QuotaFailure_Violation) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *QuotaFailure_Violation) 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 len(m.Description) > 0 { i -= len(m.Description) copy(dAtA[i:], m.Description) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0x12 } if len(m.Subject) > 0 { i -= len(m.Subject) copy(dAtA[i:], m.Subject) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Subject))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ErrorInfo) 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 *ErrorInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ErrorInfo) 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 len(m.Metadata) > 0 { for k := range m.Metadata { v := m.Metadata[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintErrorDetails(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintErrorDetails(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintErrorDetails(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x1a } } if len(m.Domain) > 0 { i -= len(m.Domain) copy(dAtA[i:], m.Domain) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Domain))) i-- dAtA[i] = 0x12 } 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 } return len(dAtA) - i, nil } func (m *PreconditionFailure) 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 *PreconditionFailure) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PreconditionFailure) 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 len(m.Violations) > 0 { for iNdEx := len(m.Violations) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Violations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintErrorDetails(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *PreconditionFailure_Violation) 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 *PreconditionFailure_Violation) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PreconditionFailure_Violation) 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 len(m.Description) > 0 { i -= len(m.Description) copy(dAtA[i:], m.Description) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0x1a } if len(m.Subject) > 0 { i -= len(m.Subject) copy(dAtA[i:], m.Subject) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Subject))) 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))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *BadRequest) 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 *BadRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *BadRequest) 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 len(m.FieldViolations) > 0 { for iNdEx := len(m.FieldViolations) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.FieldViolations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintErrorDetails(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *BadRequest_FieldViolation) 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 *BadRequest_FieldViolation) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *BadRequest_FieldViolation) 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 len(m.Description) > 0 { i -= len(m.Description) copy(dAtA[i:], m.Description) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0x12 } if len(m.Field) > 0 { i -= len(m.Field) copy(dAtA[i:], m.Field) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Field))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *RequestInfo) 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 *RequestInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RequestInfo) 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 len(m.ServingData) > 0 { i -= len(m.ServingData) copy(dAtA[i:], m.ServingData) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.ServingData))) i-- dAtA[i] = 0x12 } if len(m.RequestId) > 0 { i -= len(m.RequestId) copy(dAtA[i:], m.RequestId) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.RequestId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ResourceInfo) 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 *ResourceInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ResourceInfo) 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 len(m.Description) > 0 { i -= len(m.Description) copy(dAtA[i:], m.Description) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0x22 } if len(m.Owner) > 0 { i -= len(m.Owner) copy(dAtA[i:], m.Owner) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Owner))) i-- dAtA[i] = 0x1a } if len(m.ResourceName) > 0 { i -= len(m.ResourceName) copy(dAtA[i:], m.ResourceName) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.ResourceName))) i-- dAtA[i] = 0x12 } if len(m.ResourceType) > 0 { i -= len(m.ResourceType) copy(dAtA[i:], m.ResourceType) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.ResourceType))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Help) 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 *Help) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Help) 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 len(m.Links) > 0 { for iNdEx := len(m.Links) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Links[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintErrorDetails(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *Help_Link) 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 *Help_Link) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Help_Link) 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 len(m.Url) > 0 { i -= len(m.Url) copy(dAtA[i:], m.Url) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Url))) i-- dAtA[i] = 0x12 } if len(m.Description) > 0 { i -= len(m.Description) copy(dAtA[i:], m.Description) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *LocalizedMessage) 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 *LocalizedMessage) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *LocalizedMessage) 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 len(m.Message) > 0 { i -= len(m.Message) copy(dAtA[i:], m.Message) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Message))) i-- dAtA[i] = 0x12 } if len(m.Locale) > 0 { i -= len(m.Locale) copy(dAtA[i:], m.Locale) i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Locale))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintErrorDetails(dAtA []byte, offset int, v uint64) int { offset -= sovErrorDetails(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedRetryInfo(r randyErrorDetails, easy bool) *RetryInfo { this := &RetryInfo{} if r.Intn(5) != 0 { this.RetryDelay = types.NewPopulatedDuration(r, easy) } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 2) } return this } func NewPopulatedDebugInfo(r randyErrorDetails, easy bool) *DebugInfo { this := &DebugInfo{} v1 := r.Intn(10) this.StackEntries = make([]string, v1) for i := 0; i < v1; i++ { this.StackEntries[i] = string(randStringErrorDetails(r)) } this.Detail = string(randStringErrorDetails(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 3) } return this } func NewPopulatedQuotaFailure(r randyErrorDetails, easy bool) *QuotaFailure { this := &QuotaFailure{} if r.Intn(5) != 0 { v2 := r.Intn(5) this.Violations = make([]*QuotaFailure_Violation, v2) for i := 0; i < v2; i++ { this.Violations[i] = NewPopulatedQuotaFailure_Violation(r, easy) } } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 2) } return this } func NewPopulatedQuotaFailure_Violation(r randyErrorDetails, easy bool) *QuotaFailure_Violation { this := &QuotaFailure_Violation{} this.Subject = string(randStringErrorDetails(r)) this.Description = string(randStringErrorDetails(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 3) } return this } func NewPopulatedErrorInfo(r randyErrorDetails, easy bool) *ErrorInfo { this := &ErrorInfo{} this.Reason = string(randStringErrorDetails(r)) this.Domain = string(randStringErrorDetails(r)) if r.Intn(5) != 0 { v3 := r.Intn(10) this.Metadata = make(map[string]string) for i := 0; i < v3; i++ { this.Metadata[randStringErrorDetails(r)] = randStringErrorDetails(r) } } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 4) } return this } func NewPopulatedPreconditionFailure(r randyErrorDetails, easy bool) *PreconditionFailure { this := &PreconditionFailure{} if r.Intn(5) != 0 { v4 := r.Intn(5) this.Violations = make([]*PreconditionFailure_Violation, v4) for i := 0; i < v4; i++ { this.Violations[i] = NewPopulatedPreconditionFailure_Violation(r, easy) } } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 2) } return this } func NewPopulatedPreconditionFailure_Violation(r randyErrorDetails, easy bool) *PreconditionFailure_Violation { this := &PreconditionFailure_Violation{} this.Type = string(randStringErrorDetails(r)) this.Subject = string(randStringErrorDetails(r)) this.Description = string(randStringErrorDetails(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 4) } return this } func NewPopulatedBadRequest(r randyErrorDetails, easy bool) *BadRequest { this := &BadRequest{} if r.Intn(5) != 0 { v5 := r.Intn(5) this.FieldViolations = make([]*BadRequest_FieldViolation, v5) for i := 0; i < v5; i++ { this.FieldViolations[i] = NewPopulatedBadRequest_FieldViolation(r, easy) } } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 2) } return this } func NewPopulatedBadRequest_FieldViolation(r randyErrorDetails, easy bool) *BadRequest_FieldViolation { this := &BadRequest_FieldViolation{} this.Field = string(randStringErrorDetails(r)) this.Description = string(randStringErrorDetails(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 3) } return this } func NewPopulatedRequestInfo(r randyErrorDetails, easy bool) *RequestInfo { this := &RequestInfo{} this.RequestId = string(randStringErrorDetails(r)) this.ServingData = string(randStringErrorDetails(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 3) } return this } func NewPopulatedResourceInfo(r randyErrorDetails, easy bool) *ResourceInfo { this := &ResourceInfo{} this.ResourceType = string(randStringErrorDetails(r)) this.ResourceName = string(randStringErrorDetails(r)) this.Owner = string(randStringErrorDetails(r)) this.Description = string(randStringErrorDetails(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 5) } return this } func NewPopulatedHelp(r randyErrorDetails, easy bool) *Help { this := &Help{} if r.Intn(5) != 0 { v6 := r.Intn(5) this.Links = make([]*Help_Link, v6) for i := 0; i < v6; i++ { this.Links[i] = NewPopulatedHelp_Link(r, easy) } } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 2) } return this } func NewPopulatedHelp_Link(r randyErrorDetails, easy bool) *Help_Link { this := &Help_Link{} this.Description = string(randStringErrorDetails(r)) this.Url = string(randStringErrorDetails(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 3) } return this } func NewPopulatedLocalizedMessage(r randyErrorDetails, easy bool) *LocalizedMessage { this := &LocalizedMessage{} this.Locale = string(randStringErrorDetails(r)) this.Message = string(randStringErrorDetails(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 3) } return this } type randyErrorDetails interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneErrorDetails(r randyErrorDetails) 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 randStringErrorDetails(r randyErrorDetails) string { v7 := r.Intn(100) tmps := make([]rune, v7) for i := 0; i < v7; i++ { tmps[i] = randUTF8RuneErrorDetails(r) } return string(tmps) } func randUnrecognizedErrorDetails(r randyErrorDetails, 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 = randFieldErrorDetails(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldErrorDetails(dAtA []byte, r randyErrorDetails, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateErrorDetails(dAtA, uint64(key)) v8 := r.Int63() if r.Intn(2) == 0 { v8 *= -1 } dAtA = encodeVarintPopulateErrorDetails(dAtA, uint64(v8)) case 1: dAtA = encodeVarintPopulateErrorDetails(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 = encodeVarintPopulateErrorDetails(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateErrorDetails(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateErrorDetails(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 encodeVarintPopulateErrorDetails(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 *RetryInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.RetryDelay != nil { l = m.RetryDelay.Size() n += 1 + l + sovErrorDetails(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *DebugInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.StackEntries) > 0 { for _, s := range m.StackEntries { l = len(s) n += 1 + l + sovErrorDetails(uint64(l)) } } l = len(m.Detail) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *QuotaFailure) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Violations) > 0 { for _, e := range m.Violations { l = e.Size() n += 1 + l + sovErrorDetails(uint64(l)) } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *QuotaFailure_Violation) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Subject) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } l = len(m.Description) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *ErrorInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Reason) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } l = len(m.Domain) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } if len(m.Metadata) > 0 { for k, v := range m.Metadata { _ = k _ = v mapEntrySize := 1 + len(k) + sovErrorDetails(uint64(len(k))) + 1 + len(v) + sovErrorDetails(uint64(len(v))) n += mapEntrySize + 1 + sovErrorDetails(uint64(mapEntrySize)) } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *PreconditionFailure) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Violations) > 0 { for _, e := range m.Violations { l = e.Size() n += 1 + l + sovErrorDetails(uint64(l)) } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *PreconditionFailure_Violation) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Type) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } l = len(m.Subject) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } l = len(m.Description) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *BadRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.FieldViolations) > 0 { for _, e := range m.FieldViolations { l = e.Size() n += 1 + l + sovErrorDetails(uint64(l)) } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *BadRequest_FieldViolation) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Field) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } l = len(m.Description) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *RequestInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.RequestId) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } l = len(m.ServingData) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *ResourceInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ResourceType) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } l = len(m.ResourceName) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } l = len(m.Owner) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } l = len(m.Description) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Help) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Links) > 0 { for _, e := range m.Links { l = e.Size() n += 1 + l + sovErrorDetails(uint64(l)) } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Help_Link) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Description) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } l = len(m.Url) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *LocalizedMessage) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Locale) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } l = len(m.Message) if l > 0 { n += 1 + l + sovErrorDetails(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovErrorDetails(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozErrorDetails(x uint64) (n int) { return sovErrorDetails(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *RetryInfo) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RetryInfo{`, `RetryDelay:` + strings.Replace(fmt.Sprintf("%v", this.RetryDelay), "Duration", "types.Duration", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *DebugInfo) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&DebugInfo{`, `StackEntries:` + fmt.Sprintf("%v", this.StackEntries) + `,`, `Detail:` + fmt.Sprintf("%v", this.Detail) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *QuotaFailure) String() string { if this == nil { return "nil" } repeatedStringForViolations := "[]*QuotaFailure_Violation{" for _, f := range this.Violations { repeatedStringForViolations += strings.Replace(fmt.Sprintf("%v", f), "QuotaFailure_Violation", "QuotaFailure_Violation", 1) + "," } repeatedStringForViolations += "}" s := strings.Join([]string{`&QuotaFailure{`, `Violations:` + repeatedStringForViolations + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *QuotaFailure_Violation) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&QuotaFailure_Violation{`, `Subject:` + fmt.Sprintf("%v", this.Subject) + `,`, `Description:` + fmt.Sprintf("%v", this.Description) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *ErrorInfo) String() string { if this == nil { return "nil" } keysForMetadata := make([]string, 0, len(this.Metadata)) for k, _ := range this.Metadata { keysForMetadata = append(keysForMetadata, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForMetadata) mapStringForMetadata := "map[string]string{" for _, k := range keysForMetadata { mapStringForMetadata += fmt.Sprintf("%v: %v,", k, this.Metadata[k]) } mapStringForMetadata += "}" s := strings.Join([]string{`&ErrorInfo{`, `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, `Domain:` + fmt.Sprintf("%v", this.Domain) + `,`, `Metadata:` + mapStringForMetadata + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *PreconditionFailure) String() string { if this == nil { return "nil" } repeatedStringForViolations := "[]*PreconditionFailure_Violation{" for _, f := range this.Violations { repeatedStringForViolations += strings.Replace(fmt.Sprintf("%v", f), "PreconditionFailure_Violation", "PreconditionFailure_Violation", 1) + "," } repeatedStringForViolations += "}" s := strings.Join([]string{`&PreconditionFailure{`, `Violations:` + repeatedStringForViolations + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *PreconditionFailure_Violation) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PreconditionFailure_Violation{`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Subject:` + fmt.Sprintf("%v", this.Subject) + `,`, `Description:` + fmt.Sprintf("%v", this.Description) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *BadRequest) String() string { if this == nil { return "nil" } repeatedStringForFieldViolations := "[]*BadRequest_FieldViolation{" for _, f := range this.FieldViolations { repeatedStringForFieldViolations += strings.Replace(fmt.Sprintf("%v", f), "BadRequest_FieldViolation", "BadRequest_FieldViolation", 1) + "," } repeatedStringForFieldViolations += "}" s := strings.Join([]string{`&BadRequest{`, `FieldViolations:` + repeatedStringForFieldViolations + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *BadRequest_FieldViolation) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&BadRequest_FieldViolation{`, `Field:` + fmt.Sprintf("%v", this.Field) + `,`, `Description:` + fmt.Sprintf("%v", this.Description) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *RequestInfo) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RequestInfo{`, `RequestId:` + fmt.Sprintf("%v", this.RequestId) + `,`, `ServingData:` + fmt.Sprintf("%v", this.ServingData) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *ResourceInfo) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ResourceInfo{`, `ResourceType:` + fmt.Sprintf("%v", this.ResourceType) + `,`, `ResourceName:` + fmt.Sprintf("%v", this.ResourceName) + `,`, `Owner:` + fmt.Sprintf("%v", this.Owner) + `,`, `Description:` + fmt.Sprintf("%v", this.Description) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *Help) String() string { if this == nil { return "nil" } repeatedStringForLinks := "[]*Help_Link{" for _, f := range this.Links { repeatedStringForLinks += strings.Replace(fmt.Sprintf("%v", f), "Help_Link", "Help_Link", 1) + "," } repeatedStringForLinks += "}" s := strings.Join([]string{`&Help{`, `Links:` + repeatedStringForLinks + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *Help_Link) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Help_Link{`, `Description:` + fmt.Sprintf("%v", this.Description) + `,`, `Url:` + fmt.Sprintf("%v", this.Url) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *LocalizedMessage) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&LocalizedMessage{`, `Locale:` + fmt.Sprintf("%v", this.Locale) + `,`, `Message:` + fmt.Sprintf("%v", this.Message) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringErrorDetails(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *RetryInfo) 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 ErrIntOverflowErrorDetails } 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: RetryInfo: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RetryInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RetryDelay", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } if m.RetryDelay == nil { m.RetryDelay = &types.Duration{} } if err := m.RetryDelay.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipErrorDetails(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthErrorDetails } if (iNdEx + skippy) < 0 { return ErrInvalidLengthErrorDetails } 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 (m *DebugInfo) 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 ErrIntOverflowErrorDetails } 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: DebugInfo: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: DebugInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StackEntries", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.StackEntries = append(m.StackEntries, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Detail", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Detail = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipErrorDetails(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthErrorDetails } if (iNdEx + skippy) < 0 { return ErrInvalidLengthErrorDetails } 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 (m *QuotaFailure) 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 ErrIntOverflowErrorDetails } 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: QuotaFailure: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: QuotaFailure: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Violations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Violations = append(m.Violations, &QuotaFailure_Violation{}) if err := m.Violations[len(m.Violations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipErrorDetails(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthErrorDetails } if (iNdEx + skippy) < 0 { return ErrInvalidLengthErrorDetails } 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 (m *QuotaFailure_Violation) 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 ErrIntOverflowErrorDetails } 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: Violation: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Violation: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Subject = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipErrorDetails(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthErrorDetails } if (iNdEx + skippy) < 0 { return ErrInvalidLengthErrorDetails } 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 (m *ErrorInfo) 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 ErrIntOverflowErrorDetails } 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: ErrorInfo: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ErrorInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Reason = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Domain = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthErrorDetails } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthErrorDetails } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthErrorDetails } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthErrorDetails } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipErrorDetails(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthErrorDetails } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Metadata[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipErrorDetails(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthErrorDetails } if (iNdEx + skippy) < 0 { return ErrInvalidLengthErrorDetails } 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 (m *PreconditionFailure) 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 ErrIntOverflowErrorDetails } 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: PreconditionFailure: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PreconditionFailure: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Violations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Violations = append(m.Violations, &PreconditionFailure_Violation{}) if err := m.Violations[len(m.Violations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipErrorDetails(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthErrorDetails } if (iNdEx + skippy) < 0 { return ErrInvalidLengthErrorDetails } 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 (m *PreconditionFailure_Violation) 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 ErrIntOverflowErrorDetails } 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: Violation: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Violation: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Subject = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipErrorDetails(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthErrorDetails } if (iNdEx + skippy) < 0 { return ErrInvalidLengthErrorDetails } 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 (m *BadRequest) 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 ErrIntOverflowErrorDetails } 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: BadRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: BadRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FieldViolations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.FieldViolations = append(m.FieldViolations, &BadRequest_FieldViolation{}) if err := m.FieldViolations[len(m.FieldViolations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipErrorDetails(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthErrorDetails } if (iNdEx + skippy) < 0 { return ErrInvalidLengthErrorDetails } 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 (m *BadRequest_FieldViolation) 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 ErrIntOverflowErrorDetails } 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: FieldViolation: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: FieldViolation: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Field = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipErrorDetails(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthErrorDetails } if (iNdEx + skippy) < 0 { return ErrInvalidLengthErrorDetails } 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 (m *RequestInfo) 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 ErrIntOverflowErrorDetails } 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: RequestInfo: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RequestInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.RequestId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ServingData", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.ServingData = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipErrorDetails(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthErrorDetails } if (iNdEx + skippy) < 0 { return ErrInvalidLengthErrorDetails } 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 (m *ResourceInfo) 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 ErrIntOverflowErrorDetails } 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: ResourceInfo: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ResourceInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ResourceType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.ResourceType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ResourceName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.ResourceName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Owner = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipErrorDetails(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthErrorDetails } if (iNdEx + skippy) < 0 { return ErrInvalidLengthErrorDetails } 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 (m *Help) 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 ErrIntOverflowErrorDetails } 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: Help: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Help: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Links", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Links = append(m.Links, &Help_Link{}) if err := m.Links[len(m.Links)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipErrorDetails(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthErrorDetails } if (iNdEx + skippy) < 0 { return ErrInvalidLengthErrorDetails } 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 (m *Help_Link) 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 ErrIntOverflowErrorDetails } 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: Link: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Link: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Url = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipErrorDetails(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthErrorDetails } if (iNdEx + skippy) < 0 { return ErrInvalidLengthErrorDetails } 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 (m *LocalizedMessage) 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 ErrIntOverflowErrorDetails } 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: LocalizedMessage: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LocalizedMessage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Locale", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Locale = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowErrorDetails } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthErrorDetails } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthErrorDetails } if postIndex > l { return io.ErrUnexpectedEOF } m.Message = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipErrorDetails(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthErrorDetails } if (iNdEx + skippy) < 0 { return ErrInvalidLengthErrorDetails } 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 skipErrorDetails(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, ErrIntOverflowErrorDetails } 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, ErrIntOverflowErrorDetails } 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, ErrIntOverflowErrorDetails } 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, ErrInvalidLengthErrorDetails } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupErrorDetails } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthErrorDetails } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthErrorDetails = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowErrorDetails = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupErrorDetails = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/rpc/error_details.proto000066400000000000000000000223401365205541600216400ustar00rootroot00000000000000// 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. // 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.rpc; import "google/protobuf/duration.proto"; option go_package = "rpc"; option java_multiple_files = true; option java_outer_classname = "ErrorDetailsProto"; option java_package = "com.google.rpc"; option objc_class_prefix = "RPC"; // Describes when the clients can retry a failed request. Clients could ignore // the recommendation here or retry when this information is missing from error // responses. // // It's always recommended that clients should use exponential backoff when // retrying. // // Clients should wait until `retry_delay` amount of time has passed since // receiving the error response before retrying. If retrying requests also // fail, clients should use an exponential backoff scheme to gradually increase // the delay between retries based on `retry_delay`, until either a maximum // number of retries have been reached or a maximum retry delay cap has been // reached. message RetryInfo { // Clients should wait at least this long between retrying the same request. google.protobuf.Duration retry_delay = 1; } // Describes additional debugging info. message DebugInfo { // The stack trace entries indicating where the error occurred. repeated string stack_entries = 1; // Additional debugging information provided by the server. string detail = 2; } // Describes how a quota check failed. // // For example if a daily limit was exceeded for the calling project, // a service could respond with a QuotaFailure detail containing the project // id and the description of the quota limit that was exceeded. If the // calling project hasn't enabled the service in the developer console, then // a service could respond with the project id and set `service_disabled` // to true. // // Also see RetryInfo and Help types for other details about handling a // quota failure. message QuotaFailure { // A message type used to describe a single quota violation. For example, a // daily quota or a custom quota that was exceeded. message Violation { // The subject on which the quota check failed. // For example, "clientip:" or "project:". string subject = 1; // A description of how the quota check failed. Clients can use this // description to find more about the quota configuration in the service's // public documentation, or find the relevant quota limit to adjust through // developer console. // // For example: "Service disabled" or "Daily Limit for read operations // exceeded". string description = 2; } // Describes all quota violations. repeated Violation violations = 1; } // Describes the cause of the error with structured details. // // Example of an error when contacting the "pubsub.googleapis.com" API when it // is not enabled: // { "reason": "API_DISABLED" // "domain": "googleapis.com" // "metadata": { // "resource": "projects/123", // "service": "pubsub.googleapis.com" // } // } // This response indicates that the pubsub.googleapis.com API is not enabled. // // Example of an error that is returned when attempting to create a Spanner // instance in a region that is out of stock: // { "reason": "STOCKOUT" // "domain": "spanner.googleapis.com", // "metadata": { // "availableRegions": "us-central1,us-east2" // } // } // message ErrorInfo { // 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 reason = 1; // 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 // omitted. The value will be, "googleapis.com". string domain = 2; // Additional structured details about this error. // // Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in // length. When identifying the current value of an exceeded limit, the units // should be contained in the key, not the value. For example, rather than // {"instanceLimit": "100/request"}, should be returned as, // {"instanceLimitPerRequest": "100"}, if the client exceeds the number of // instances that can be created in a single (batch) request. map metadata = 3; } // Describes what preconditions have failed. // // For example, if an RPC failed because it required the Terms of Service to be // acknowledged, it could list the terms of service violation in the // PreconditionFailure message. message PreconditionFailure { // A message type used to describe a single precondition failure. message Violation { // The type of PreconditionFailure. We recommend using a service-specific // enum type to define the supported precondition violation subjects. For // example, "TOS" for "Terms of Service violation". string type = 1; // The subject, relative to the type, that failed. // For example, "google.com/cloud" relative to the "TOS" type would indicate // which terms of service is being referenced. string subject = 2; // A description of how the precondition failed. Developers can use this // description to understand how to fix the failure. // // For example: "Terms of service not accepted". string description = 3; } // Describes all precondition violations. repeated Violation violations = 1; } // Describes violations in a client request. This error type focuses on the // syntactic aspects of the request. message BadRequest { // A message type used to describe a single bad request field. message FieldViolation { // A path leading to a field in the request body. The value will be a // sequence of dot-separated identifiers that identify a protocol buffer // field. E.g., "field_violations.field" would identify this field. string field = 1; // A description of why the request element is bad. string description = 2; } // Describes all violations in a client request. repeated FieldViolation field_violations = 1; } // Contains metadata about the request that clients can attach when filing a bug // or providing other forms of feedback. message RequestInfo { // An opaque string that should only be interpreted by the service generating // it. For example, it can be used to identify requests in the service's logs. string request_id = 1; // Any data that was used to serve this request. For example, an encrypted // stack trace that can be sent back to the service provider for debugging. string serving_data = 2; } // Describes the resource that is being accessed. message ResourceInfo { // A name for the type of resource being accessed, e.g. "sql table", // "cloud storage bucket", "file", "Google calendar"; or the type URL // of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". string resource_type = 1; // The name of the resource being accessed. For example, a shared calendar // name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current // error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. string resource_name = 2; // The owner of the resource (optional). // For example, "user:" or "project:". string owner = 3; // Describes what error is encountered when accessing this resource. // For example, updating a cloud project may require the `writer` permission // on the developer console project. string description = 4; } // Provides links to documentation or for performing an out of band action. // // For example, if a quota check failed with an error indicating the calling // project hasn't enabled the accessed service, this can contain a URL pointing // directly to the right place in the developer console to flip the bit. message Help { // Describes a URL link. message Link { // Describes what the link offers. string description = 1; // The URL of the link. string url = 2; } // URL(s) pointing to additional information on handling the current error. repeated Link links = 1; } // Provides a localized error message that is safe to return to the user // which can be attached to an RPC error. message LocalizedMessage { // The locale used following the specification defined at // http://www.rfc-editor.org/rfc/bcp/bcp47.txt. // Examples are: "en-US", "fr-CH", "es-MX" string locale = 1; // The localized error message in the above locale. string message = 2; } googleapis-1.4.0/google/rpc/status.pb.go000066400000000000000000000412641365205541600201750ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/rpc/status.proto package rpc import ( bytes "bytes" fmt "fmt" proto "github.com/gogo/protobuf/proto" types "github.com/gogo/protobuf/types" 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 // The `Status` type defines a logical error model that is suitable for // different programming environments, including REST APIs and RPC APIs. It is // used by [gRPC](https://github.com/grpc). Each `Status` message contains // three pieces of data: error code, error message, and error details. // // You can find out more about this error model and how to work with it in the // [API Design Guide](https://cloud.google.com/apis/design/errors). type Status struct { // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // A developer-facing error message, which should be in English. Any // user-facing error message should be localized and sent in the // [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // A list of messages that carry the error details. There is a common set of // message types for APIs to use. Details []*types.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Status) Reset() { *m = Status{} } func (*Status) ProtoMessage() {} func (*Status) Descriptor() ([]byte, []int) { return fileDescriptor_24d244abaf643bfe, []int{0} } func (m *Status) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Status.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 *Status) XXX_Merge(src proto.Message) { xxx_messageInfo_Status.Merge(m, src) } func (m *Status) XXX_Size() int { return m.Size() } func (m *Status) XXX_DiscardUnknown() { xxx_messageInfo_Status.DiscardUnknown(m) } var xxx_messageInfo_Status proto.InternalMessageInfo func (m *Status) GetCode() int32 { if m != nil { return m.Code } return 0 } func (m *Status) GetMessage() string { if m != nil { return m.Message } return "" } func (m *Status) GetDetails() []*types.Any { if m != nil { return m.Details } return nil } func (*Status) XXX_MessageName() string { return "google.rpc.Status" } func init() { proto.RegisterType((*Status)(nil), "google.rpc.Status") } func init() { proto.RegisterFile("google/rpc/status.proto", fileDescriptor_24d244abaf643bfe) } var fileDescriptor_24d244abaf643bfe = []byte{ // 238 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0x2a, 0x48, 0xd6, 0x2f, 0x2e, 0x49, 0x2c, 0x29, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0x48, 0xe8, 0x15, 0x15, 0x24, 0x4b, 0x49, 0x42, 0x15, 0x81, 0x65, 0x92, 0x4a, 0xd3, 0xf4, 0x13, 0xf3, 0x2a, 0x21, 0xca, 0x94, 0xd2, 0xb8, 0xd8, 0x82, 0xc1, 0xda, 0x84, 0x84, 0xb8, 0x58, 0x92, 0xf3, 0x53, 0x52, 0x25, 0x18, 0x15, 0x18, 0x35, 0x58, 0x83, 0xc0, 0x6c, 0x21, 0x09, 0x2e, 0xf6, 0xdc, 0xd4, 0xe2, 0xe2, 0xc4, 0xf4, 0x54, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x18, 0x57, 0x48, 0x8f, 0x8b, 0x3d, 0x25, 0xb5, 0x24, 0x31, 0x33, 0xa7, 0x58, 0x82, 0x59, 0x81, 0x59, 0x83, 0xdb, 0x48, 0x44, 0x0f, 0x6a, 0x21, 0xcc, 0x12, 0x3d, 0xc7, 0xbc, 0xca, 0x20, 0x98, 0x22, 0xa7, 0xc4, 0x0b, 0x0f, 0xe5, 0x18, 0x6e, 0x3c, 0x94, 0x63, 0xf8, 0xf0, 0x50, 0x8e, 0xf1, 0xc7, 0x43, 0x39, 0xc6, 0x86, 0x47, 0x72, 0x8c, 0x2b, 0x1e, 0xc9, 0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x2f, 0x1e, 0xc9, 0x31, 0x7c, 0x00, 0x89, 0x3f, 0x96, 0x63, 0x3c, 0xf1, 0x58, 0x8e, 0x91, 0x8b, 0x2f, 0x39, 0x3f, 0x57, 0x0f, 0xe1, 0x11, 0x27, 0x6e, 0x88, 0x5b, 0x03, 0x40, 0x56, 0x04, 0x30, 0x46, 0x31, 0x17, 0x15, 0x24, 0xff, 0x60, 0x64, 0x5c, 0xc4, 0xc4, 0x1c, 0x14, 0xe0, 0x9c, 0xc4, 0x06, 0xb6, 0xd9, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x16, 0xcd, 0x7b, 0x60, 0x13, 0x01, 0x00, 0x00, } func (this *Status) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*Status) if !ok { that2, ok := that.(Status) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.Code != that1.Code { if this.Code < that1.Code { return -1 } return 1 } if this.Message != that1.Message { if this.Message < that1.Message { return -1 } return 1 } if len(this.Details) != len(that1.Details) { if len(this.Details) < len(that1.Details) { return -1 } return 1 } for i := range this.Details { if c := this.Details[i].Compare(that1.Details[i]); c != 0 { return c } } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *Status) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Status) if !ok { that2, ok := that.(Status) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Code != that1.Code { return false } if this.Message != that1.Message { return false } if len(this.Details) != len(that1.Details) { return false } for i := range this.Details { if !this.Details[i].Equal(that1.Details[i]) { return false } } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Status) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 7) s = append(s, "&rpc.Status{") s = append(s, "Code: "+fmt.Sprintf("%#v", this.Code)+",\n") s = append(s, "Message: "+fmt.Sprintf("%#v", this.Message)+",\n") if this.Details != nil { s = append(s, "Details: "+fmt.Sprintf("%#v", this.Details)+",\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 valueToGoStringStatus(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 *Status) 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 *Status) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Status) 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 len(m.Details) > 0 { for iNdEx := len(m.Details) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Details[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintStatus(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } } if len(m.Message) > 0 { i -= len(m.Message) copy(dAtA[i:], m.Message) i = encodeVarintStatus(dAtA, i, uint64(len(m.Message))) i-- dAtA[i] = 0x12 } if m.Code != 0 { i = encodeVarintStatus(dAtA, i, uint64(m.Code)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func encodeVarintStatus(dAtA []byte, offset int, v uint64) int { offset -= sovStatus(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedStatus(r randyStatus, easy bool) *Status { this := &Status{} this.Code = int32(r.Int31()) if r.Intn(2) == 0 { this.Code *= -1 } this.Message = string(randStringStatus(r)) if r.Intn(5) != 0 { v1 := r.Intn(5) this.Details = make([]*types.Any, v1) for i := 0; i < v1; i++ { this.Details[i] = types.NewPopulatedAny(r, easy) } } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedStatus(r, 4) } return this } type randyStatus interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneStatus(r randyStatus) 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 randStringStatus(r randyStatus) string { v2 := r.Intn(100) tmps := make([]rune, v2) for i := 0; i < v2; i++ { tmps[i] = randUTF8RuneStatus(r) } return string(tmps) } func randUnrecognizedStatus(r randyStatus, 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 = randFieldStatus(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldStatus(dAtA []byte, r randyStatus, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateStatus(dAtA, uint64(key)) v3 := r.Int63() if r.Intn(2) == 0 { v3 *= -1 } dAtA = encodeVarintPopulateStatus(dAtA, uint64(v3)) case 1: dAtA = encodeVarintPopulateStatus(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 = encodeVarintPopulateStatus(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateStatus(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateStatus(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 encodeVarintPopulateStatus(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 *Status) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Code != 0 { n += 1 + sovStatus(uint64(m.Code)) } l = len(m.Message) if l > 0 { n += 1 + l + sovStatus(uint64(l)) } if len(m.Details) > 0 { for _, e := range m.Details { l = e.Size() n += 1 + l + sovStatus(uint64(l)) } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovStatus(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozStatus(x uint64) (n int) { return sovStatus(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *Status) String() string { if this == nil { return "nil" } repeatedStringForDetails := "[]*Any{" for _, f := range this.Details { repeatedStringForDetails += strings.Replace(fmt.Sprintf("%v", f), "Any", "types.Any", 1) + "," } repeatedStringForDetails += "}" s := strings.Join([]string{`&Status{`, `Code:` + fmt.Sprintf("%v", this.Code) + `,`, `Message:` + fmt.Sprintf("%v", this.Message) + `,`, `Details:` + repeatedStringForDetails + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringStatus(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *Status) 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 ErrIntOverflowStatus } 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: Status: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Status: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) } m.Code = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowStatus } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Code |= int32(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowStatus } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthStatus } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthStatus } if postIndex > l { return io.ErrUnexpectedEOF } m.Message = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowStatus } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthStatus } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthStatus } if postIndex > l { return io.ErrUnexpectedEOF } m.Details = append(m.Details, &types.Any{}) if err := m.Details[len(m.Details)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipStatus(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthStatus } if (iNdEx + skippy) < 0 { return ErrInvalidLengthStatus } 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 skipStatus(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, ErrIntOverflowStatus } 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, ErrIntOverflowStatus } 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, ErrIntOverflowStatus } 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, ErrInvalidLengthStatus } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupStatus } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthStatus } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthStatus = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowStatus = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupStatus = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/rpc/status.proto000066400000000000000000000035201365205541600203240ustar00rootroot00000000000000// 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. // 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.rpc; import "google/protobuf/any.proto"; option cc_enable_arenas = true; option go_package = "rpc"; option java_multiple_files = true; option java_outer_classname = "StatusProto"; option java_package = "com.google.rpc"; option objc_class_prefix = "RPC"; // The `Status` type defines a logical error model that is suitable for // different programming environments, including REST APIs and RPC APIs. It is // used by [gRPC](https://github.com/grpc). Each `Status` message contains // three pieces of data: error code, error message, and error details. // // You can find out more about this error model and how to work with it in the // [API Design Guide](https://cloud.google.com/apis/design/errors). message Status { // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. int32 code = 1; // A developer-facing error message, which should be in English. Any // user-facing error message should be localized and sent in the // [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. string message = 2; // A list of messages that carry the error details. There is a common set of // message types for APIs to use. repeated google.protobuf.Any details = 3; } googleapis-1.4.0/google/type/000077500000000000000000000000001365205541600161115ustar00rootroot00000000000000googleapis-1.4.0/google/type/calendar_period.pb.go000066400000000000000000000105211365205541600221520ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/type/calendar_period.proto package _type import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" math "math" strconv "strconv" ) // 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 `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. type CalendarPeriod int32 const ( // Undefined period, raises an error. CalendarPeriod_CALENDAR_PERIOD_UNSPECIFIED CalendarPeriod = 0 // A day. CalendarPeriod_DAY CalendarPeriod = 1 // A week. Weeks begin on Monday, following // [ISO 8601](https://en.wikipedia.org/wiki/ISO_week_date). CalendarPeriod_WEEK CalendarPeriod = 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). CalendarPeriod_FORTNIGHT CalendarPeriod = 3 // A month. CalendarPeriod_MONTH CalendarPeriod = 4 // A quarter. Quarters start on dates 1-Jan, 1-Apr, 1-Jul, and 1-Oct of each // year. CalendarPeriod_QUARTER CalendarPeriod = 5 // A half-year. Half-years start on dates 1-Jan and 1-Jul. CalendarPeriod_HALF CalendarPeriod = 6 // A year. CalendarPeriod_YEAR CalendarPeriod = 7 ) var CalendarPeriod_name = map[int32]string{ 0: "CALENDAR_PERIOD_UNSPECIFIED", 1: "DAY", 2: "WEEK", 3: "FORTNIGHT", 4: "MONTH", 5: "QUARTER", 6: "HALF", 7: "YEAR", } var CalendarPeriod_value = map[string]int32{ "CALENDAR_PERIOD_UNSPECIFIED": 0, "DAY": 1, "WEEK": 2, "FORTNIGHT": 3, "MONTH": 4, "QUARTER": 5, "HALF": 6, "YEAR": 7, } func (CalendarPeriod) EnumDescriptor() ([]byte, []int) { return fileDescriptor_52aec33199a3da0e, []int{0} } func init() { proto.RegisterEnum("google.type.CalendarPeriod", CalendarPeriod_name, CalendarPeriod_value) } func init() { proto.RegisterFile("google/type/calendar_period.proto", fileDescriptor_52aec33199a3da0e) } var fileDescriptor_52aec33199a3da0e = []byte{ // 267 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0x4f, 0x4e, 0xcc, 0x49, 0xcd, 0x4b, 0x49, 0x2c, 0x8a, 0x2f, 0x48, 0x2d, 0xca, 0xcc, 0x4f, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x28, 0xd1, 0x03, 0x29, 0xd1, 0xaa, 0xe7, 0xe2, 0x73, 0x86, 0xaa, 0x0a, 0x00, 0x2b, 0x12, 0x92, 0xe7, 0x92, 0x76, 0x76, 0xf4, 0x71, 0xf5, 0x73, 0x71, 0x0c, 0x8a, 0x0f, 0x70, 0x0d, 0xf2, 0xf4, 0x77, 0x89, 0x0f, 0xf5, 0x0b, 0x0e, 0x70, 0x75, 0xf6, 0x74, 0xf3, 0x74, 0x75, 0x11, 0x60, 0x10, 0x62, 0xe7, 0x62, 0x76, 0x71, 0x8c, 0x14, 0x60, 0x14, 0xe2, 0xe0, 0x62, 0x09, 0x77, 0x75, 0xf5, 0x16, 0x60, 0x12, 0xe2, 0xe5, 0xe2, 0x74, 0xf3, 0x0f, 0x0a, 0xf1, 0xf3, 0x74, 0xf7, 0x08, 0x11, 0x60, 0x16, 0xe2, 0xe4, 0x62, 0xf5, 0xf5, 0xf7, 0x0b, 0xf1, 0x10, 0x60, 0x11, 0xe2, 0xe6, 0x62, 0x0f, 0x0c, 0x75, 0x0c, 0x0a, 0x71, 0x0d, 0x12, 0x60, 0x05, 0x69, 0xf0, 0x70, 0xf4, 0x71, 0x13, 0x60, 0x03, 0xb1, 0x22, 0x5d, 0x1d, 0x83, 0x04, 0xd8, 0x9d, 0x52, 0x6e, 0x3c, 0x94, 0x63, 0xf8, 0xf0, 0x50, 0x8e, 0xf1, 0xc7, 0x43, 0x39, 0xc6, 0x86, 0x47, 0x72, 0x8c, 0x2b, 0x1e, 0xc9, 0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x2f, 0x1e, 0xc9, 0x31, 0x7c, 0x00, 0x89, 0x3f, 0x96, 0x63, 0x3c, 0xf1, 0x58, 0x8e, 0x91, 0x8b, 0x3f, 0x39, 0x3f, 0x57, 0x0f, 0xc9, 0x0f, 0x4e, 0xc2, 0xa8, 0x3e, 0x08, 0x00, 0xf9, 0x32, 0x80, 0x31, 0x8a, 0x05, 0x24, 0xb9, 0x88, 0x89, 0xd9, 0x3d, 0x24, 0x20, 0x89, 0x0d, 0xec, 0x75, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x68, 0x09, 0x75, 0x1f, 0x01, 0x00, 0x00, } func (x CalendarPeriod) String() string { s, ok := CalendarPeriod_name[int32(x)] if ok { return s } return strconv.Itoa(int(x)) } googleapis-1.4.0/google/type/calendar_period.proto000066400000000000000000000032421365205541600223120ustar00rootroot00000000000000// 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 = "type"; 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; } googleapis-1.4.0/google/type/color.pb.go000066400000000000000000000512461365205541600201660ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/type/color.proto package _type import ( bytes "bytes" encoding_binary "encoding/binary" fmt "fmt" proto "github.com/gogo/protobuf/proto" types "github.com/gogo/protobuf/types" 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 // 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. // // 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): // // import com.google.type.Color; // // // ... // public static java.awt.Color fromProto(Color protocolor) { // float alpha = protocolor.hasAlpha() // ? protocolor.getAlpha().getValue() // : 1.0; // // return new java.awt.Color( // protocolor.getRed(), // protocolor.getGreen(), // protocolor.getBlue(), // alpha); // } // // public static Color toProto(java.awt.Color color) { // float red = (float) color.getRed(); // float green = (float) color.getGreen(); // float blue = (float) color.getBlue(); // float denominator = 255.0; // Color.Builder resultBuilder = // Color // .newBuilder() // .setRed(red / denominator) // .setGreen(green / denominator) // .setBlue(blue / denominator); // int alpha = color.getAlpha(); // if (alpha != 255) { // result.setAlpha( // FloatValue // .newBuilder() // .setValue(((float) alpha) / denominator) // .build()); // } // return resultBuilder.build(); // } // // ... // // Example (iOS / Obj-C): // // // ... // static UIColor* fromProto(Color* protocolor) { // float red = [protocolor red]; // float green = [protocolor green]; // float blue = [protocolor blue]; // FloatValue* alpha_wrapper = [protocolor alpha]; // float alpha = 1.0; // if (alpha_wrapper != nil) { // alpha = [alpha_wrapper value]; // } // return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; // } // // static Color* toProto(UIColor* color) { // CGFloat red, green, blue, alpha; // if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { // return nil; // } // Color* result = [[Color alloc] init]; // [result setRed:red]; // [result setGreen:green]; // [result setBlue:blue]; // if (alpha <= 0.9999) { // [result setAlpha:floatWrapperWithValue(alpha)]; // } // [result autorelease]; // return result; // } // // ... // // Example (JavaScript): // // // ... // // var protoToCssColor = function(rgb_color) { // var redFrac = rgb_color.red || 0.0; // var greenFrac = rgb_color.green || 0.0; // var blueFrac = rgb_color.blue || 0.0; // var red = Math.floor(redFrac * 255); // var green = Math.floor(greenFrac * 255); // var blue = Math.floor(blueFrac * 255); // // if (!('alpha' in rgb_color)) { // return rgbToCssColor_(red, green, blue); // } // // var alphaFrac = rgb_color.alpha.value || 0.0; // var rgbParams = [red, green, blue].join(','); // return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); // }; // // var rgbToCssColor_ = function(red, green, blue) { // var rgbNumber = new Number((red << 16) | (green << 8) | blue); // var hexString = rgbNumber.toString(16); // var missingZeros = 6 - hexString.length; // var resultBuilder = ['#']; // for (var i = 0; i < missingZeros; i++) { // resultBuilder.push('0'); // } // resultBuilder.push(hexString); // return resultBuilder.join(''); // }; // // // ... type Color struct { // The amount of red in the color as a value in the interval [0, 1]. Red float32 `protobuf:"fixed32,1,opt,name=red,proto3" json:"red,omitempty"` // The amount of green in the color as a value in the interval [0, 1]. Green float32 `protobuf:"fixed32,2,opt,name=green,proto3" json:"green,omitempty"` // The amount of blue in the color as a value in the interval [0, 1]. Blue float32 `protobuf:"fixed32,3,opt,name=blue,proto3" json:"blue,omitempty"` // The fraction of this color that should be applied to the pixel. That is, // the final pixel color is defined by the equation: // // pixel color = alpha * (this color) + (1.0 - alpha) * (background color) // // This means that a value of 1.0 corresponds to a solid color, whereas // a value of 0.0 corresponds to a completely transparent color. This // uses a wrapper message rather than a simple float scalar so that it is // possible to distinguish between a default value and the value being unset. // If omitted, this color object is to be rendered as a solid color // (as if the alpha value had been explicitly given with a value of 1.0). Alpha *types.FloatValue `protobuf:"bytes,4,opt,name=alpha,proto3" json:"alpha,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Color) Reset() { *m = Color{} } func (*Color) ProtoMessage() {} func (*Color) Descriptor() ([]byte, []int) { return fileDescriptor_8454902cb8a2d34f, []int{0} } func (m *Color) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Color) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Color.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 *Color) XXX_Merge(src proto.Message) { xxx_messageInfo_Color.Merge(m, src) } func (m *Color) XXX_Size() int { return m.Size() } func (m *Color) XXX_DiscardUnknown() { xxx_messageInfo_Color.DiscardUnknown(m) } var xxx_messageInfo_Color proto.InternalMessageInfo func (m *Color) GetRed() float32 { if m != nil { return m.Red } return 0 } func (m *Color) GetGreen() float32 { if m != nil { return m.Green } return 0 } func (m *Color) GetBlue() float32 { if m != nil { return m.Blue } return 0 } func (m *Color) GetAlpha() *types.FloatValue { if m != nil { return m.Alpha } return nil } func (*Color) XXX_MessageName() string { return "google.type.Color" } func init() { proto.RegisterType((*Color)(nil), "google.type.Color") } func init() { proto.RegisterFile("google/type/color.proto", fileDescriptor_8454902cb8a2d34f) } var fileDescriptor_8454902cb8a2d34f = []byte{ // 250 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0x4f, 0xce, 0xcf, 0xc9, 0x2f, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x48, 0xe8, 0x81, 0x24, 0xa4, 0xe4, 0xa0, 0xaa, 0xc0, 0x52, 0x49, 0xa5, 0x69, 0xfa, 0xe5, 0x45, 0x89, 0x05, 0x05, 0xa9, 0x45, 0xc5, 0x10, 0xc5, 0x4a, 0x65, 0x5c, 0xac, 0xce, 0x20, 0xbd, 0x42, 0x02, 0x5c, 0xcc, 0x45, 0xa9, 0x29, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x4c, 0x41, 0x20, 0xa6, 0x90, 0x08, 0x17, 0x6b, 0x7a, 0x51, 0x6a, 0x6a, 0x9e, 0x04, 0x13, 0x58, 0x0c, 0xc2, 0x11, 0x12, 0xe2, 0x62, 0x49, 0xca, 0x29, 0x4d, 0x95, 0x60, 0x06, 0x0b, 0x82, 0xd9, 0x42, 0x86, 0x5c, 0xac, 0x89, 0x39, 0x05, 0x19, 0x89, 0x12, 0x2c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0xd2, 0x7a, 0x50, 0x17, 0xc0, 0x2c, 0xd5, 0x73, 0xcb, 0xc9, 0x4f, 0x2c, 0x09, 0x4b, 0xcc, 0x29, 0x4d, 0x0d, 0x82, 0xa8, 0x74, 0x8a, 0xbb, 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, 0xfe, 0x58, 0x8e, 0xf1, 0xc4, 0x63, 0x39, 0x46, 0x2e, 0xfe, 0xe4, 0xfc, 0x5c, 0x3d, 0x24, 0xaf, 0x39, 0x71, 0x81, 0x1d, 0x1e, 0x00, 0xb2, 0x23, 0x80, 0x31, 0x8a, 0x05, 0x24, 0xf6, 0x83, 0x91, 0x71, 0x11, 0x13, 0xb3, 0x7b, 0x48, 0x40, 0x12, 0x1b, 0xd8, 0x6e, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x2a, 0x27, 0xa6, 0x26, 0x01, 0x00, 0x00, } func (this *Color) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*Color) if !ok { that2, ok := that.(Color) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.Red != that1.Red { if this.Red < that1.Red { return -1 } return 1 } if this.Green != that1.Green { if this.Green < that1.Green { return -1 } return 1 } if this.Blue != that1.Blue { if this.Blue < that1.Blue { return -1 } return 1 } if c := this.Alpha.Compare(that1.Alpha); c != 0 { return c } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *Color) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Color) if !ok { that2, ok := that.(Color) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Red != that1.Red { return false } if this.Green != that1.Green { return false } if this.Blue != that1.Blue { return false } if !this.Alpha.Equal(that1.Alpha) { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Color) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 8) s = append(s, "&_type.Color{") s = append(s, "Red: "+fmt.Sprintf("%#v", this.Red)+",\n") s = append(s, "Green: "+fmt.Sprintf("%#v", this.Green)+",\n") s = append(s, "Blue: "+fmt.Sprintf("%#v", this.Blue)+",\n") if this.Alpha != nil { s = append(s, "Alpha: "+fmt.Sprintf("%#v", this.Alpha)+",\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 valueToGoStringColor(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 *Color) 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 *Color) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Color) 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.Alpha != nil { { size, err := m.Alpha.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintColor(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } if m.Blue != 0 { i -= 4 encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Blue)))) i-- dAtA[i] = 0x1d } if m.Green != 0 { i -= 4 encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Green)))) i-- dAtA[i] = 0x15 } if m.Red != 0 { i -= 4 encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Red)))) i-- dAtA[i] = 0xd } return len(dAtA) - i, nil } func encodeVarintColor(dAtA []byte, offset int, v uint64) int { offset -= sovColor(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedColor(r randyColor, easy bool) *Color { this := &Color{} this.Red = float32(r.Float32()) if r.Intn(2) == 0 { this.Red *= -1 } this.Green = float32(r.Float32()) if r.Intn(2) == 0 { this.Green *= -1 } this.Blue = float32(r.Float32()) if r.Intn(2) == 0 { this.Blue *= -1 } if r.Intn(5) != 0 { this.Alpha = types.NewPopulatedFloatValue(r, easy) } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedColor(r, 5) } return this } type randyColor interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneColor(r randyColor) 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 randStringColor(r randyColor) string { v1 := r.Intn(100) tmps := make([]rune, v1) for i := 0; i < v1; i++ { tmps[i] = randUTF8RuneColor(r) } return string(tmps) } func randUnrecognizedColor(r randyColor, 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 = randFieldColor(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldColor(dAtA []byte, r randyColor, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateColor(dAtA, uint64(key)) v2 := r.Int63() if r.Intn(2) == 0 { v2 *= -1 } dAtA = encodeVarintPopulateColor(dAtA, uint64(v2)) case 1: dAtA = encodeVarintPopulateColor(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 = encodeVarintPopulateColor(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateColor(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateColor(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 encodeVarintPopulateColor(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 *Color) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Red != 0 { n += 5 } if m.Green != 0 { n += 5 } if m.Blue != 0 { n += 5 } if m.Alpha != nil { l = m.Alpha.Size() n += 1 + l + sovColor(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovColor(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozColor(x uint64) (n int) { return sovColor(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *Color) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Color{`, `Red:` + fmt.Sprintf("%v", this.Red) + `,`, `Green:` + fmt.Sprintf("%v", this.Green) + `,`, `Blue:` + fmt.Sprintf("%v", this.Blue) + `,`, `Alpha:` + strings.Replace(fmt.Sprintf("%v", this.Alpha), "FloatValue", "types.FloatValue", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringColor(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *Color) 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 ErrIntOverflowColor } 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: Color: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Color: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 5 { return fmt.Errorf("proto: wrong wireType = %d for field Red", wireType) } var v uint32 if (iNdEx + 4) > l { return io.ErrUnexpectedEOF } v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) iNdEx += 4 m.Red = float32(math.Float32frombits(v)) case 2: if wireType != 5 { return fmt.Errorf("proto: wrong wireType = %d for field Green", wireType) } var v uint32 if (iNdEx + 4) > l { return io.ErrUnexpectedEOF } v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) iNdEx += 4 m.Green = float32(math.Float32frombits(v)) case 3: if wireType != 5 { return fmt.Errorf("proto: wrong wireType = %d for field Blue", wireType) } var v uint32 if (iNdEx + 4) > l { return io.ErrUnexpectedEOF } v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) iNdEx += 4 m.Blue = float32(math.Float32frombits(v)) case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Alpha", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowColor } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthColor } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthColor } if postIndex > l { return io.ErrUnexpectedEOF } if m.Alpha == nil { m.Alpha = &types.FloatValue{} } if err := m.Alpha.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipColor(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthColor } if (iNdEx + skippy) < 0 { return ErrInvalidLengthColor } 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 skipColor(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, ErrIntOverflowColor } 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, ErrIntOverflowColor } 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, ErrIntOverflowColor } 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, ErrInvalidLengthColor } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupColor } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthColor } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthColor = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowColor = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupColor = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/type/color.proto000066400000000000000000000137771365205541600203330ustar00rootroot00000000000000// 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; import "google/protobuf/wrappers.proto"; option cc_enable_arenas = true; option go_package = "type"; 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. // // 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): // // import com.google.type.Color; // // // ... // public static java.awt.Color fromProto(Color protocolor) { // float alpha = protocolor.hasAlpha() // ? protocolor.getAlpha().getValue() // : 1.0; // // return new java.awt.Color( // protocolor.getRed(), // protocolor.getGreen(), // protocolor.getBlue(), // alpha); // } // // public static Color toProto(java.awt.Color color) { // float red = (float) color.getRed(); // float green = (float) color.getGreen(); // float blue = (float) color.getBlue(); // float denominator = 255.0; // Color.Builder resultBuilder = // Color // .newBuilder() // .setRed(red / denominator) // .setGreen(green / denominator) // .setBlue(blue / denominator); // int alpha = color.getAlpha(); // if (alpha != 255) { // result.setAlpha( // FloatValue // .newBuilder() // .setValue(((float) alpha) / denominator) // .build()); // } // return resultBuilder.build(); // } // // ... // // Example (iOS / Obj-C): // // // ... // static UIColor* fromProto(Color* protocolor) { // float red = [protocolor red]; // float green = [protocolor green]; // float blue = [protocolor blue]; // FloatValue* alpha_wrapper = [protocolor alpha]; // float alpha = 1.0; // if (alpha_wrapper != nil) { // alpha = [alpha_wrapper value]; // } // return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; // } // // static Color* toProto(UIColor* color) { // CGFloat red, green, blue, alpha; // if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { // return nil; // } // Color* result = [[Color alloc] init]; // [result setRed:red]; // [result setGreen:green]; // [result setBlue:blue]; // if (alpha <= 0.9999) { // [result setAlpha:floatWrapperWithValue(alpha)]; // } // [result autorelease]; // return result; // } // // ... // // Example (JavaScript): // // // ... // // var protoToCssColor = function(rgb_color) { // var redFrac = rgb_color.red || 0.0; // var greenFrac = rgb_color.green || 0.0; // var blueFrac = rgb_color.blue || 0.0; // var red = Math.floor(redFrac * 255); // var green = Math.floor(greenFrac * 255); // var blue = Math.floor(blueFrac * 255); // // if (!('alpha' in rgb_color)) { // return rgbToCssColor_(red, green, blue); // } // // var alphaFrac = rgb_color.alpha.value || 0.0; // var rgbParams = [red, green, blue].join(','); // return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); // }; // // var rgbToCssColor_ = function(red, green, blue) { // var rgbNumber = new Number((red << 16) | (green << 8) | blue); // var hexString = rgbNumber.toString(16); // var missingZeros = 6 - hexString.length; // var resultBuilder = ['#']; // for (var i = 0; i < missingZeros; i++) { // resultBuilder.push('0'); // } // resultBuilder.push(hexString); // return resultBuilder.join(''); // }; // // // ... message Color { // The amount of red in the color as a value in the interval [0, 1]. float red = 1; // The amount of green in the color as a value in the interval [0, 1]. float green = 2; // The amount of blue in the color as a value in the interval [0, 1]. float blue = 3; // The fraction of this color that should be applied to the pixel. That is, // the final pixel color is defined by the equation: // // pixel color = alpha * (this color) + (1.0 - alpha) * (background color) // // This means that a value of 1.0 corresponds to a solid color, whereas // a value of 0.0 corresponds to a completely transparent color. This // uses a wrapper message rather than a simple float scalar so that it is // possible to distinguish between a default value and the value being unset. // If omitted, this color object is to be rendered as a solid color // (as if the alpha value had been explicitly given with a value of 1.0). google.protobuf.FloatValue alpha = 4; } googleapis-1.4.0/google/type/date.pb.go000066400000000000000000000351461365205541600177660ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/type/date.proto package _type import ( bytes "bytes" fmt "fmt" 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 // 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`. type Date struct { // Year of date. Must be from 1 to 9999, or 0 if specifying a date without // a year. Year int32 `protobuf:"varint,1,opt,name=year,proto3" json:"year,omitempty"` // Month of year. Must be from 1 to 12, or 0 if specifying a year without a // month and day. Month int32 `protobuf:"varint,2,opt,name=month,proto3" json:"month,omitempty"` // Day of month. Must be from 1 to 31 and valid for the year and month, or 0 // if specifying a year by itself or a year and month where the day is not // significant. Day int32 `protobuf:"varint,3,opt,name=day,proto3" json:"day,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Date) Reset() { *m = Date{} } func (*Date) ProtoMessage() {} func (*Date) Descriptor() ([]byte, []int) { return fileDescriptor_92c30699df886e3f, []int{0} } func (m *Date) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Date) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Date.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 *Date) XXX_Merge(src proto.Message) { xxx_messageInfo_Date.Merge(m, src) } func (m *Date) XXX_Size() int { return m.Size() } func (m *Date) XXX_DiscardUnknown() { xxx_messageInfo_Date.DiscardUnknown(m) } var xxx_messageInfo_Date proto.InternalMessageInfo func (m *Date) GetYear() int32 { if m != nil { return m.Year } return 0 } func (m *Date) GetMonth() int32 { if m != nil { return m.Month } return 0 } func (m *Date) GetDay() int32 { if m != nil { return m.Day } return 0 } func (*Date) XXX_MessageName() string { return "google.type.Date" } func init() { proto.RegisterType((*Date)(nil), "google.type.Date") } func init() { proto.RegisterFile("google/type/date.proto", fileDescriptor_92c30699df886e3f) } var fileDescriptor_92c30699df886e3f = []byte{ // 194 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4b, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0x4f, 0x49, 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x88, 0xeb, 0x81, 0xc4, 0x95, 0x9c, 0xb8, 0x58, 0x5c, 0x12, 0x4b, 0x52, 0x85, 0x84, 0xb8, 0x58, 0x2a, 0x53, 0x13, 0x8b, 0x24, 0x18, 0x15, 0x18, 0x35, 0x58, 0x83, 0xc0, 0x6c, 0x21, 0x11, 0x2e, 0xd6, 0xdc, 0xfc, 0xbc, 0x92, 0x0c, 0x09, 0x26, 0xb0, 0x20, 0x84, 0x23, 0x24, 0xc0, 0xc5, 0x9c, 0x92, 0x58, 0x29, 0xc1, 0x0c, 0x16, 0x03, 0x31, 0x9d, 0x62, 0x6f, 0x3c, 0x94, 0x63, 0xf8, 0xf0, 0x50, 0x8e, 0xf1, 0xc7, 0x43, 0x39, 0xc6, 0x86, 0x47, 0x72, 0x8c, 0x2b, 0x1e, 0xc9, 0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x2f, 0x1e, 0xc9, 0x31, 0x7c, 0x00, 0x89, 0x3f, 0x96, 0x63, 0x3c, 0xf1, 0x58, 0x8e, 0x91, 0x8b, 0x3f, 0x39, 0x3f, 0x57, 0x0f, 0xc9, 0x19, 0x4e, 0x9c, 0x20, 0x47, 0x04, 0x80, 0x9c, 0x17, 0xc0, 0x18, 0xc5, 0x02, 0x12, 0xfa, 0xc1, 0xc8, 0xb8, 0x88, 0x89, 0xd9, 0x3d, 0x24, 0x20, 0x89, 0x0d, 0xec, 0x6c, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, 0x82, 0x40, 0xc6, 0xd0, 0x00, 0x00, 0x00, } func (this *Date) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*Date) if !ok { that2, ok := that.(Date) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.Year != that1.Year { if this.Year < that1.Year { return -1 } return 1 } if this.Month != that1.Month { if this.Month < that1.Month { return -1 } return 1 } if this.Day != that1.Day { if this.Day < that1.Day { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *Date) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Date) if !ok { that2, ok := that.(Date) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Year != that1.Year { return false } if this.Month != that1.Month { return false } if this.Day != that1.Day { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Date) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 7) s = append(s, "&_type.Date{") s = append(s, "Year: "+fmt.Sprintf("%#v", this.Year)+",\n") s = append(s, "Month: "+fmt.Sprintf("%#v", this.Month)+",\n") s = append(s, "Day: "+fmt.Sprintf("%#v", this.Day)+",\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 valueToGoStringDate(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 *Date) 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 *Date) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Date) 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.Day != 0 { i = encodeVarintDate(dAtA, i, uint64(m.Day)) i-- dAtA[i] = 0x18 } if m.Month != 0 { i = encodeVarintDate(dAtA, i, uint64(m.Month)) i-- dAtA[i] = 0x10 } if m.Year != 0 { i = encodeVarintDate(dAtA, i, uint64(m.Year)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func encodeVarintDate(dAtA []byte, offset int, v uint64) int { offset -= sovDate(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedDate(r randyDate, easy bool) *Date { this := &Date{} this.Year = int32(r.Int31()) if r.Intn(2) == 0 { this.Year *= -1 } this.Month = int32(r.Int31()) if r.Intn(2) == 0 { this.Month *= -1 } this.Day = int32(r.Int31()) if r.Intn(2) == 0 { this.Day *= -1 } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedDate(r, 4) } return this } type randyDate interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneDate(r randyDate) 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 randStringDate(r randyDate) string { v1 := r.Intn(100) tmps := make([]rune, v1) for i := 0; i < v1; i++ { tmps[i] = randUTF8RuneDate(r) } return string(tmps) } func randUnrecognizedDate(r randyDate, 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 = randFieldDate(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldDate(dAtA []byte, r randyDate, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateDate(dAtA, uint64(key)) v2 := r.Int63() if r.Intn(2) == 0 { v2 *= -1 } dAtA = encodeVarintPopulateDate(dAtA, uint64(v2)) case 1: dAtA = encodeVarintPopulateDate(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 = encodeVarintPopulateDate(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateDate(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateDate(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 encodeVarintPopulateDate(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 *Date) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Year != 0 { n += 1 + sovDate(uint64(m.Year)) } if m.Month != 0 { n += 1 + sovDate(uint64(m.Month)) } if m.Day != 0 { n += 1 + sovDate(uint64(m.Day)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovDate(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozDate(x uint64) (n int) { return sovDate(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *Date) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Date{`, `Year:` + fmt.Sprintf("%v", this.Year) + `,`, `Month:` + fmt.Sprintf("%v", this.Month) + `,`, `Day:` + fmt.Sprintf("%v", this.Day) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringDate(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *Date) 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 ErrIntOverflowDate } 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: Date: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Date: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Year", wireType) } m.Year = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDate } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Year |= int32(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Month", wireType) } m.Month = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDate } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Month |= int32(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Day", wireType) } m.Day = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDate } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Day |= int32(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipDate(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthDate } if (iNdEx + skippy) < 0 { return ErrInvalidLengthDate } 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 skipDate(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, ErrIntOverflowDate } 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, ErrIntOverflowDate } 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, ErrIntOverflowDate } 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, ErrInvalidLengthDate } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupDate } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthDate } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthDate = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowDate = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupDate = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/type/date.proto000066400000000000000000000035351365205541600201210ustar00rootroot00000000000000// 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 = "type"; option java_multiple_files = true; option java_outer_classname = "DateProto"; option java_package = "com.google.type"; option objc_class_prefix = "GTP"; // 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, 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 by itself or a year and month where the day is not // significant. int32 day = 3; } googleapis-1.4.0/google/type/datetime.pb.go000066400000000000000000001037771365205541600206530ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/type/datetime.proto package _type import ( bytes "bytes" fmt "fmt" proto "github.com/gogo/protobuf/proto" types "github.com/gogo/protobuf/types" 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 // Represents civil time in one of a few possible ways: // // * When utc_offset is set and time_zone is unset: a civil time on a calendar // day with a particular offset from UTC. // * When time_zone is set and utc_offset is unset: a civil time on a calendar // day in a particular time zone. // * When neither time_zone nor utc_offset is set: a civil time on a calendar // day in local time. // // The date is relative to the Proleptic Gregorian Calendar. // // If year is 0, the DateTime is considered not to have a specific year. month // and day must have valid, non-zero values. // // This type is more flexible than some applications may want. Make sure to // document and validate your application's limitations. type DateTime struct { // Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a // datetime without a year. Year int32 `protobuf:"varint,1,opt,name=year,proto3" json:"year,omitempty"` // Required. Month of year. Must be from 1 to 12. Month int32 `protobuf:"varint,2,opt,name=month,proto3" json:"month,omitempty"` // Required. Day of month. Must be from 1 to 31 and valid for the year and // month. Day int32 `protobuf:"varint,3,opt,name=day,proto3" json:"day,omitempty"` // Required. 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. Hours int32 `protobuf:"varint,4,opt,name=hours,proto3" json:"hours,omitempty"` // Required. Minutes of hour of day. Must be from 0 to 59. Minutes int32 `protobuf:"varint,5,opt,name=minutes,proto3" json:"minutes,omitempty"` // Required. Seconds of minutes of the time. Must normally be from 0 to 59. An // API may allow the value 60 if it allows leap-seconds. Seconds int32 `protobuf:"varint,6,opt,name=seconds,proto3" json:"seconds,omitempty"` // Required. Fractions of seconds in nanoseconds. Must be from 0 to // 999,999,999. Nanos int32 `protobuf:"varint,7,opt,name=nanos,proto3" json:"nanos,omitempty"` // Optional. Specifies either the UTC offset or the time zone of the DateTime. // Choose carefully between them, considering that time zone data may change // in the future (for example, a country modifies their DST start/end dates, // and future DateTimes in the affected range had already been stored). // If omitted, the DateTime is considered to be in local time. // // Types that are valid to be assigned to TimeOffset: // *DateTime_UtcOffset // *DateTime_TimeZone TimeOffset isDateTime_TimeOffset `protobuf_oneof:"time_offset"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *DateTime) Reset() { *m = DateTime{} } func (*DateTime) ProtoMessage() {} func (*DateTime) Descriptor() ([]byte, []int) { return fileDescriptor_247e8eac669493f4, []int{0} } func (m *DateTime) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *DateTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DateTime.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 *DateTime) XXX_Merge(src proto.Message) { xxx_messageInfo_DateTime.Merge(m, src) } func (m *DateTime) XXX_Size() int { return m.Size() } func (m *DateTime) XXX_DiscardUnknown() { xxx_messageInfo_DateTime.DiscardUnknown(m) } var xxx_messageInfo_DateTime proto.InternalMessageInfo type isDateTime_TimeOffset interface { isDateTime_TimeOffset() Equal(interface{}) bool MarshalTo([]byte) (int, error) Size() int } type DateTime_UtcOffset struct { UtcOffset *types.Duration `protobuf:"bytes,8,opt,name=utc_offset,json=utcOffset,proto3,oneof" json:"utc_offset,omitempty"` } type DateTime_TimeZone struct { TimeZone *TimeZone `protobuf:"bytes,9,opt,name=time_zone,json=timeZone,proto3,oneof" json:"time_zone,omitempty"` } func (*DateTime_UtcOffset) isDateTime_TimeOffset() {} func (*DateTime_TimeZone) isDateTime_TimeOffset() {} func (m *DateTime) GetTimeOffset() isDateTime_TimeOffset { if m != nil { return m.TimeOffset } return nil } func (m *DateTime) GetYear() int32 { if m != nil { return m.Year } return 0 } func (m *DateTime) GetMonth() int32 { if m != nil { return m.Month } return 0 } func (m *DateTime) GetDay() int32 { if m != nil { return m.Day } return 0 } func (m *DateTime) GetHours() int32 { if m != nil { return m.Hours } return 0 } func (m *DateTime) GetMinutes() int32 { if m != nil { return m.Minutes } return 0 } func (m *DateTime) GetSeconds() int32 { if m != nil { return m.Seconds } return 0 } func (m *DateTime) GetNanos() int32 { if m != nil { return m.Nanos } return 0 } func (m *DateTime) GetUtcOffset() *types.Duration { if x, ok := m.GetTimeOffset().(*DateTime_UtcOffset); ok { return x.UtcOffset } return nil } func (m *DateTime) GetTimeZone() *TimeZone { if x, ok := m.GetTimeOffset().(*DateTime_TimeZone); ok { return x.TimeZone } return nil } // XXX_OneofWrappers is for the internal use of the proto package. func (*DateTime) XXX_OneofWrappers() []interface{} { return []interface{}{ (*DateTime_UtcOffset)(nil), (*DateTime_TimeZone)(nil), } } func (*DateTime) XXX_MessageName() string { return "google.type.DateTime" } // Represents a time zone from the // [IANA Time Zone Database](https://www.iana.org/time-zones). type TimeZone struct { // IANA Time Zone Database time zone, e.g. "America/New_York". Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Optional. IANA Time Zone Database version number, e.g. "2019a". Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *TimeZone) Reset() { *m = TimeZone{} } func (*TimeZone) ProtoMessage() {} func (*TimeZone) Descriptor() ([]byte, []int) { return fileDescriptor_247e8eac669493f4, []int{1} } func (m *TimeZone) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *TimeZone) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_TimeZone.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 *TimeZone) XXX_Merge(src proto.Message) { xxx_messageInfo_TimeZone.Merge(m, src) } func (m *TimeZone) XXX_Size() int { return m.Size() } func (m *TimeZone) XXX_DiscardUnknown() { xxx_messageInfo_TimeZone.DiscardUnknown(m) } var xxx_messageInfo_TimeZone proto.InternalMessageInfo func (m *TimeZone) GetId() string { if m != nil { return m.Id } return "" } func (m *TimeZone) GetVersion() string { if m != nil { return m.Version } return "" } func (*TimeZone) XXX_MessageName() string { return "google.type.TimeZone" } func init() { proto.RegisterType((*DateTime)(nil), "google.type.DateTime") proto.RegisterType((*TimeZone)(nil), "google.type.TimeZone") } func init() { proto.RegisterFile("google/type/datetime.proto", fileDescriptor_247e8eac669493f4) } var fileDescriptor_247e8eac669493f4 = []byte{ // 371 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x51, 0x3d, 0x6f, 0xea, 0x30, 0x14, 0x8d, 0xc3, 0x57, 0x62, 0xc4, 0x7b, 0x4f, 0xd6, 0xab, 0xe4, 0x32, 0x58, 0x88, 0x89, 0x29, 0x48, 0x2d, 0x53, 0x47, 0x84, 0x54, 0xb6, 0xa2, 0x88, 0x09, 0xa9, 0x42, 0x21, 0x31, 0x10, 0xa9, 0xf1, 0x45, 0x89, 0x53, 0x89, 0x4e, 0xfd, 0x2d, 0x5d, 0xda, 0x9f, 0xd2, 0xb1, 0x63, 0xc7, 0x92, 0x2e, 0x1d, 0x19, 0x19, 0x2b, 0xdb, 0x89, 0xc4, 0x76, 0xcf, 0xc7, 0xbd, 0xc9, 0x39, 0xc6, 0xdd, 0x0d, 0xc0, 0xe6, 0x81, 0x0f, 0xe5, 0x7e, 0xc7, 0x87, 0x51, 0x20, 0xb9, 0x8c, 0x13, 0xee, 0xed, 0x52, 0x90, 0x40, 0xda, 0x46, 0xf3, 0x94, 0xd6, 0x65, 0xa5, 0x51, 0x4b, 0xab, 0x7c, 0x3d, 0x8c, 0xf2, 0x34, 0x90, 0x31, 0x08, 0x63, 0xee, 0xbf, 0xda, 0xd8, 0x99, 0x04, 0x92, 0xcf, 0xe3, 0x84, 0x13, 0x82, 0xeb, 0x7b, 0x1e, 0xa4, 0x14, 0xf5, 0xd0, 0xa0, 0xe1, 0xeb, 0x99, 0xfc, 0xc7, 0x8d, 0x04, 0x84, 0xdc, 0x52, 0x5b, 0x93, 0x06, 0x90, 0x7f, 0xb8, 0x16, 0x05, 0x7b, 0x5a, 0xd3, 0x9c, 0x1a, 0x95, 0x6f, 0x0b, 0x79, 0x9a, 0xd1, 0xba, 0xf1, 0x69, 0x40, 0x28, 0x6e, 0x25, 0xb1, 0xc8, 0x25, 0xcf, 0x68, 0x43, 0xf3, 0x15, 0x54, 0x4a, 0xc6, 0x43, 0x10, 0x51, 0x46, 0x9b, 0x46, 0x29, 0xa1, 0xba, 0x24, 0x02, 0x01, 0x19, 0x6d, 0x99, 0x4b, 0x1a, 0x90, 0x1b, 0x8c, 0x73, 0x19, 0x2e, 0x61, 0xbd, 0xce, 0xb8, 0xa4, 0x4e, 0x0f, 0x0d, 0xda, 0x57, 0x97, 0x5e, 0x19, 0xb5, 0x4a, 0xe7, 0x4d, 0xca, 0x74, 0x53, 0xcb, 0x77, 0x73, 0x19, 0xde, 0x69, 0x37, 0x19, 0x61, 0x57, 0xf5, 0xb3, 0x7c, 0x02, 0xc1, 0xa9, 0xab, 0x57, 0x2f, 0xbc, 0xb3, 0x96, 0x3c, 0x95, 0x7e, 0x01, 0x82, 0x4f, 0x2d, 0xdf, 0x91, 0xe5, 0x3c, 0xee, 0xe0, 0xb6, 0xde, 0x32, 0x9f, 0xec, 0x8f, 0xb0, 0x53, 0xd9, 0xc8, 0x1f, 0x6c, 0xc7, 0x91, 0xae, 0xc9, 0xf5, 0xed, 0x38, 0x52, 0x61, 0x1e, 0x79, 0x9a, 0xc5, 0x20, 0x74, 0x4d, 0xae, 0x5f, 0xc1, 0xf1, 0xfd, 0xe7, 0x81, 0x59, 0xc7, 0x03, 0x43, 0xa7, 0x03, 0x43, 0xcf, 0x05, 0x43, 0x6f, 0x05, 0x43, 0xef, 0x05, 0x43, 0x1f, 0x05, 0x43, 0x5f, 0x05, 0x43, 0x3f, 0x05, 0xb3, 0x8e, 0x8a, 0xfb, 0x66, 0x08, 0xff, 0x0d, 0x21, 0x39, 0xff, 0xb1, 0x71, 0xa7, 0x7a, 0x9b, 0x99, 0x4a, 0x38, 0x43, 0x8b, 0xba, 0xa2, 0x4f, 0x08, 0xbd, 0xd8, 0xb5, 0xdb, 0xf9, 0x6c, 0xd5, 0xd4, 0xc9, 0xaf, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x43, 0xbb, 0x91, 0xb7, 0x10, 0x02, 0x00, 0x00, } func (this *DateTime) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*DateTime) if !ok { that2, ok := that.(DateTime) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Year != that1.Year { return false } if this.Month != that1.Month { return false } if this.Day != that1.Day { return false } if this.Hours != that1.Hours { return false } if this.Minutes != that1.Minutes { return false } if this.Seconds != that1.Seconds { return false } if this.Nanos != that1.Nanos { return false } if that1.TimeOffset == nil { if this.TimeOffset != nil { return false } } else if this.TimeOffset == nil { return false } else if !this.TimeOffset.Equal(that1.TimeOffset) { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *DateTime_UtcOffset) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*DateTime_UtcOffset) if !ok { that2, ok := that.(DateTime_UtcOffset) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.UtcOffset.Equal(that1.UtcOffset) { return false } return true } func (this *DateTime_TimeZone) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*DateTime_TimeZone) if !ok { that2, ok := that.(DateTime_TimeZone) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.TimeZone.Equal(that1.TimeZone) { return false } return true } func (this *TimeZone) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*TimeZone) if !ok { that2, ok := that.(TimeZone) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Id != that1.Id { return false } if this.Version != that1.Version { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *DateTime) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 13) s = append(s, "&_type.DateTime{") s = append(s, "Year: "+fmt.Sprintf("%#v", this.Year)+",\n") s = append(s, "Month: "+fmt.Sprintf("%#v", this.Month)+",\n") s = append(s, "Day: "+fmt.Sprintf("%#v", this.Day)+",\n") s = append(s, "Hours: "+fmt.Sprintf("%#v", this.Hours)+",\n") s = append(s, "Minutes: "+fmt.Sprintf("%#v", this.Minutes)+",\n") s = append(s, "Seconds: "+fmt.Sprintf("%#v", this.Seconds)+",\n") s = append(s, "Nanos: "+fmt.Sprintf("%#v", this.Nanos)+",\n") if this.TimeOffset != nil { s = append(s, "TimeOffset: "+fmt.Sprintf("%#v", this.TimeOffset)+",\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 (this *DateTime_UtcOffset) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&_type.DateTime_UtcOffset{` + `UtcOffset:` + fmt.Sprintf("%#v", this.UtcOffset) + `}`}, ", ") return s } func (this *DateTime_TimeZone) GoString() string { if this == nil { return "nil" } s := strings.Join([]string{`&_type.DateTime_TimeZone{` + `TimeZone:` + fmt.Sprintf("%#v", this.TimeZone) + `}`}, ", ") return s } func (this *TimeZone) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&_type.TimeZone{") s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n") s = append(s, "Version: "+fmt.Sprintf("%#v", this.Version)+",\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 valueToGoStringDatetime(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 *DateTime) 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 *DateTime) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *DateTime) 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.TimeOffset != nil { { size := m.TimeOffset.Size() i -= size if _, err := m.TimeOffset.MarshalTo(dAtA[i:]); err != nil { return 0, err } } } if m.Nanos != 0 { i = encodeVarintDatetime(dAtA, i, uint64(m.Nanos)) i-- dAtA[i] = 0x38 } if m.Seconds != 0 { i = encodeVarintDatetime(dAtA, i, uint64(m.Seconds)) i-- dAtA[i] = 0x30 } if m.Minutes != 0 { i = encodeVarintDatetime(dAtA, i, uint64(m.Minutes)) i-- dAtA[i] = 0x28 } if m.Hours != 0 { i = encodeVarintDatetime(dAtA, i, uint64(m.Hours)) i-- dAtA[i] = 0x20 } if m.Day != 0 { i = encodeVarintDatetime(dAtA, i, uint64(m.Day)) i-- dAtA[i] = 0x18 } if m.Month != 0 { i = encodeVarintDatetime(dAtA, i, uint64(m.Month)) i-- dAtA[i] = 0x10 } if m.Year != 0 { i = encodeVarintDatetime(dAtA, i, uint64(m.Year)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *DateTime_UtcOffset) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *DateTime_UtcOffset) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.UtcOffset != nil { { size, err := m.UtcOffset.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintDatetime(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 } return len(dAtA) - i, nil } func (m *DateTime_TimeZone) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *DateTime_TimeZone) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.TimeZone != nil { { size, err := m.TimeZone.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintDatetime(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a } return len(dAtA) - i, nil } func (m *TimeZone) 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 *TimeZone) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *TimeZone) 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 len(m.Version) > 0 { i -= len(m.Version) copy(dAtA[i:], m.Version) i = encodeVarintDatetime(dAtA, i, uint64(len(m.Version))) i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) i = encodeVarintDatetime(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintDatetime(dAtA []byte, offset int, v uint64) int { offset -= sovDatetime(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedDateTime(r randyDatetime, easy bool) *DateTime { this := &DateTime{} this.Year = int32(r.Int31()) if r.Intn(2) == 0 { this.Year *= -1 } this.Month = int32(r.Int31()) if r.Intn(2) == 0 { this.Month *= -1 } this.Day = int32(r.Int31()) if r.Intn(2) == 0 { this.Day *= -1 } this.Hours = int32(r.Int31()) if r.Intn(2) == 0 { this.Hours *= -1 } this.Minutes = int32(r.Int31()) if r.Intn(2) == 0 { this.Minutes *= -1 } this.Seconds = int32(r.Int31()) if r.Intn(2) == 0 { this.Seconds *= -1 } this.Nanos = int32(r.Int31()) if r.Intn(2) == 0 { this.Nanos *= -1 } oneofNumber_TimeOffset := []int32{8, 9}[r.Intn(2)] switch oneofNumber_TimeOffset { case 8: this.TimeOffset = NewPopulatedDateTime_UtcOffset(r, easy) case 9: this.TimeOffset = NewPopulatedDateTime_TimeZone(r, easy) } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedDatetime(r, 10) } return this } func NewPopulatedDateTime_UtcOffset(r randyDatetime, easy bool) *DateTime_UtcOffset { this := &DateTime_UtcOffset{} this.UtcOffset = types.NewPopulatedDuration(r, easy) return this } func NewPopulatedDateTime_TimeZone(r randyDatetime, easy bool) *DateTime_TimeZone { this := &DateTime_TimeZone{} this.TimeZone = NewPopulatedTimeZone(r, easy) return this } func NewPopulatedTimeZone(r randyDatetime, easy bool) *TimeZone { this := &TimeZone{} this.Id = string(randStringDatetime(r)) this.Version = string(randStringDatetime(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedDatetime(r, 3) } return this } type randyDatetime interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneDatetime(r randyDatetime) 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 randStringDatetime(r randyDatetime) string { v1 := r.Intn(100) tmps := make([]rune, v1) for i := 0; i < v1; i++ { tmps[i] = randUTF8RuneDatetime(r) } return string(tmps) } func randUnrecognizedDatetime(r randyDatetime, 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 = randFieldDatetime(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldDatetime(dAtA []byte, r randyDatetime, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateDatetime(dAtA, uint64(key)) v2 := r.Int63() if r.Intn(2) == 0 { v2 *= -1 } dAtA = encodeVarintPopulateDatetime(dAtA, uint64(v2)) case 1: dAtA = encodeVarintPopulateDatetime(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 = encodeVarintPopulateDatetime(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateDatetime(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateDatetime(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 encodeVarintPopulateDatetime(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 *DateTime) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Year != 0 { n += 1 + sovDatetime(uint64(m.Year)) } if m.Month != 0 { n += 1 + sovDatetime(uint64(m.Month)) } if m.Day != 0 { n += 1 + sovDatetime(uint64(m.Day)) } if m.Hours != 0 { n += 1 + sovDatetime(uint64(m.Hours)) } if m.Minutes != 0 { n += 1 + sovDatetime(uint64(m.Minutes)) } if m.Seconds != 0 { n += 1 + sovDatetime(uint64(m.Seconds)) } if m.Nanos != 0 { n += 1 + sovDatetime(uint64(m.Nanos)) } if m.TimeOffset != nil { n += m.TimeOffset.Size() } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *DateTime_UtcOffset) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.UtcOffset != nil { l = m.UtcOffset.Size() n += 1 + l + sovDatetime(uint64(l)) } return n } func (m *DateTime_TimeZone) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.TimeZone != nil { l = m.TimeZone.Size() n += 1 + l + sovDatetime(uint64(l)) } return n } func (m *TimeZone) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovDatetime(uint64(l)) } l = len(m.Version) if l > 0 { n += 1 + l + sovDatetime(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovDatetime(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozDatetime(x uint64) (n int) { return sovDatetime(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *DateTime) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&DateTime{`, `Year:` + fmt.Sprintf("%v", this.Year) + `,`, `Month:` + fmt.Sprintf("%v", this.Month) + `,`, `Day:` + fmt.Sprintf("%v", this.Day) + `,`, `Hours:` + fmt.Sprintf("%v", this.Hours) + `,`, `Minutes:` + fmt.Sprintf("%v", this.Minutes) + `,`, `Seconds:` + fmt.Sprintf("%v", this.Seconds) + `,`, `Nanos:` + fmt.Sprintf("%v", this.Nanos) + `,`, `TimeOffset:` + fmt.Sprintf("%v", this.TimeOffset) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func (this *DateTime_UtcOffset) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&DateTime_UtcOffset{`, `UtcOffset:` + strings.Replace(fmt.Sprintf("%v", this.UtcOffset), "Duration", "types.Duration", 1) + `,`, `}`, }, "") return s } func (this *DateTime_TimeZone) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&DateTime_TimeZone{`, `TimeZone:` + strings.Replace(fmt.Sprintf("%v", this.TimeZone), "TimeZone", "TimeZone", 1) + `,`, `}`, }, "") return s } func (this *TimeZone) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&TimeZone{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `Version:` + fmt.Sprintf("%v", this.Version) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringDatetime(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *DateTime) 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 ErrIntOverflowDatetime } 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: DateTime: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: DateTime: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Year", wireType) } m.Year = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDatetime } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Year |= int32(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Month", wireType) } m.Month = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDatetime } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Month |= int32(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Day", wireType) } m.Day = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDatetime } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Day |= int32(b&0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Hours", wireType) } m.Hours = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDatetime } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Hours |= int32(b&0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Minutes", wireType) } m.Minutes = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDatetime } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Minutes |= int32(b&0x7F) << shift if b < 0x80 { break } } case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Seconds", wireType) } m.Seconds = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDatetime } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Seconds |= int32(b&0x7F) << shift if b < 0x80 { break } } case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Nanos", wireType) } m.Nanos = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDatetime } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Nanos |= int32(b&0x7F) << shift if b < 0x80 { break } } case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field UtcOffset", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDatetime } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthDatetime } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthDatetime } if postIndex > l { return io.ErrUnexpectedEOF } v := &types.Duration{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.TimeOffset = &DateTime_UtcOffset{v} iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TimeZone", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDatetime } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthDatetime } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthDatetime } if postIndex > l { return io.ErrUnexpectedEOF } v := &TimeZone{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.TimeOffset = &DateTime_TimeZone{v} iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipDatetime(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthDatetime } if (iNdEx + skippy) < 0 { return ErrInvalidLengthDatetime } 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 (m *TimeZone) 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 ErrIntOverflowDatetime } 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: TimeZone: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: TimeZone: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDatetime } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthDatetime } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthDatetime } if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDatetime } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthDatetime } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthDatetime } if postIndex > l { return io.ErrUnexpectedEOF } m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipDatetime(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthDatetime } if (iNdEx + skippy) < 0 { return ErrInvalidLengthDatetime } 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 skipDatetime(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, ErrIntOverflowDatetime } 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, ErrIntOverflowDatetime } 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, ErrIntOverflowDatetime } 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, ErrInvalidLengthDatetime } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupDatetime } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthDatetime } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthDatetime = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowDatetime = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupDatetime = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/type/datetime.proto000066400000000000000000000065741365205541600210060ustar00rootroot00000000000000// 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; import "google/protobuf/duration.proto"; option cc_enable_arenas = true; option go_package = "type"; option java_multiple_files = true; option java_outer_classname = "DateTimeProto"; option java_package = "com.google.type"; option objc_class_prefix = "GTP"; // Represents civil time in one of a few possible ways: // // * When utc_offset is set and time_zone is unset: a civil time on a calendar // day with a particular offset from UTC. // * When time_zone is set and utc_offset is unset: a civil time on a calendar // day in a particular time zone. // * When neither time_zone nor utc_offset is set: a civil time on a calendar // day in local time. // // The date is relative to the Proleptic Gregorian Calendar. // // If year is 0, the DateTime is considered not to have a specific year. month // and day must have valid, non-zero values. // // This type is more flexible than some applications may want. Make sure to // document and validate your application's limitations. message DateTime { // Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a // datetime without a year. int32 year = 1; // Required. Month of year. Must be from 1 to 12. int32 month = 2; // Required. Day of month. Must be from 1 to 31 and valid for the year and // month. int32 day = 3; // Required. 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. int32 hours = 4; // Required. Minutes of hour of day. Must be from 0 to 59. int32 minutes = 5; // Required. Seconds of minutes of the time. Must normally be from 0 to 59. An // API may allow the value 60 if it allows leap-seconds. int32 seconds = 6; // Required. Fractions of seconds in nanoseconds. Must be from 0 to // 999,999,999. int32 nanos = 7; // Optional. Specifies either the UTC offset or the time zone of the DateTime. // Choose carefully between them, considering that time zone data may change // in the future (for example, a country modifies their DST start/end dates, // and future DateTimes in the affected range had already been stored). // If omitted, the DateTime is considered to be in local time. oneof time_offset { // UTC offset. Must be whole seconds, between -18 hours and +18 hours. // For example, a UTC offset of -4:00 would be represented as // { seconds: -14400 }. google.protobuf.Duration utc_offset = 8; // Time zone. TimeZone time_zone = 9; } } // Represents a time zone from the // [IANA Time Zone Database](https://www.iana.org/time-zones). message TimeZone { // IANA Time Zone Database time zone, e.g. "America/New_York". string id = 1; // Optional. IANA Time Zone Database version number, e.g. "2019a". string version = 2; } googleapis-1.4.0/google/type/dayofweek.pb.go000066400000000000000000000073241365205541600210240ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/type/dayofweek.proto package _type import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" math "math" strconv "strconv" ) // 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 // Represents a day of week. type DayOfWeek int32 const ( // The unspecified day-of-week. DayOfWeek_DAY_OF_WEEK_UNSPECIFIED DayOfWeek = 0 // The day-of-week of Monday. DayOfWeek_MONDAY DayOfWeek = 1 // The day-of-week of Tuesday. DayOfWeek_TUESDAY DayOfWeek = 2 // The day-of-week of Wednesday. DayOfWeek_WEDNESDAY DayOfWeek = 3 // The day-of-week of Thursday. DayOfWeek_THURSDAY DayOfWeek = 4 // The day-of-week of Friday. DayOfWeek_FRIDAY DayOfWeek = 5 // The day-of-week of Saturday. DayOfWeek_SATURDAY DayOfWeek = 6 // The day-of-week of Sunday. DayOfWeek_SUNDAY DayOfWeek = 7 ) var DayOfWeek_name = map[int32]string{ 0: "DAY_OF_WEEK_UNSPECIFIED", 1: "MONDAY", 2: "TUESDAY", 3: "WEDNESDAY", 4: "THURSDAY", 5: "FRIDAY", 6: "SATURDAY", 7: "SUNDAY", } var DayOfWeek_value = map[string]int32{ "DAY_OF_WEEK_UNSPECIFIED": 0, "MONDAY": 1, "TUESDAY": 2, "WEDNESDAY": 3, "THURSDAY": 4, "FRIDAY": 5, "SATURDAY": 6, "SUNDAY": 7, } func (DayOfWeek) EnumDescriptor() ([]byte, []int) { return fileDescriptor_7d916f1831ff5ed9, []int{0} } func init() { proto.RegisterEnum("google.type.DayOfWeek", DayOfWeek_name, DayOfWeek_value) } func init() { proto.RegisterFile("google/type/dayofweek.proto", fileDescriptor_7d916f1831ff5ed9) } var fileDescriptor_7d916f1831ff5ed9 = []byte{ // 255 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0x4f, 0x49, 0xac, 0xcc, 0x4f, 0x2b, 0x4f, 0x4d, 0xcd, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x48, 0xea, 0x81, 0x24, 0xb5, 0x5a, 0x18, 0xb9, 0x38, 0x5d, 0x12, 0x2b, 0xfd, 0xd3, 0xc2, 0x53, 0x53, 0xb3, 0x85, 0xa4, 0xb9, 0xc4, 0x5d, 0x1c, 0x23, 0xe3, 0xfd, 0xdd, 0xe2, 0xc3, 0x5d, 0x5d, 0xbd, 0xe3, 0x43, 0xfd, 0x82, 0x03, 0x5c, 0x9d, 0x3d, 0xdd, 0x3c, 0x5d, 0x5d, 0x04, 0x18, 0x84, 0xb8, 0xb8, 0xd8, 0x7c, 0xfd, 0xfd, 0x5c, 0x1c, 0x23, 0x05, 0x18, 0x85, 0xb8, 0xb9, 0xd8, 0x43, 0x42, 0x5d, 0x83, 0x41, 0x1c, 0x26, 0x21, 0x5e, 0x2e, 0xce, 0x70, 0x57, 0x17, 0x3f, 0x08, 0x97, 0x59, 0x88, 0x87, 0x8b, 0x23, 0xc4, 0x23, 0x34, 0x08, 0xcc, 0x63, 0x01, 0xe9, 0x72, 0x0b, 0xf2, 0x04, 0xb1, 0x59, 0x41, 0x32, 0xc1, 0x8e, 0x21, 0xa1, 0x41, 0x20, 0x1e, 0x1b, 0x48, 0x26, 0x38, 0x14, 0x6c, 0x1e, 0xbb, 0x53, 0xfc, 0x8d, 0x87, 0x72, 0x0c, 0x1f, 0x1e, 0xca, 0x31, 0xfe, 0x78, 0x28, 0xc7, 0xd8, 0xf0, 0x48, 0x8e, 0x71, 0xc5, 0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0xf1, 0xc5, 0x23, 0x39, 0x86, 0x0f, 0x20, 0xf1, 0xc7, 0x72, 0x8c, 0x27, 0x1e, 0xcb, 0x31, 0x72, 0xf1, 0x27, 0xe7, 0xe7, 0xea, 0x21, 0xf9, 0xc4, 0x89, 0x0f, 0xee, 0x8d, 0x00, 0x90, 0x37, 0x03, 0x18, 0xa3, 0x58, 0x40, 0xe2, 0x8b, 0x98, 0x98, 0xdd, 0x43, 0x02, 0x92, 0xd8, 0xc0, 0x7e, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x68, 0x79, 0x57, 0x1a, 0x01, 0x00, 0x00, } func (x DayOfWeek) String() string { s, ok := DayOfWeek_name[int32(x)] if ok { return s } return strconv.Itoa(int(x)) } googleapis-1.4.0/google/type/dayofweek.proto000066400000000000000000000023771365205541600211650ustar00rootroot00000000000000// 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 = "type"; option java_multiple_files = true; 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. DAY_OF_WEEK_UNSPECIFIED = 0; // The day-of-week of Monday. MONDAY = 1; // The day-of-week of Tuesday. TUESDAY = 2; // The day-of-week of Wednesday. WEDNESDAY = 3; // The day-of-week of Thursday. THURSDAY = 4; // The day-of-week of Friday. FRIDAY = 5; // The day-of-week of Saturday. SATURDAY = 6; // The day-of-week of Sunday. SUNDAY = 7; } googleapis-1.4.0/google/type/expr.pb.go000066400000000000000000000426431365205541600200270ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/type/expr.proto package _type import ( bytes "bytes" fmt "fmt" 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 // Represents an expression text. Example: // // title: "User account presence" // description: "Determines whether the request has a user account" // expression: "size(request.user) > 0" type Expr struct { // 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. Expression string `protobuf:"bytes,1,opt,name=expression,proto3" json:"expression,omitempty"` // 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. Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` // An optional description of the expression. This is a longer text which // describes the expression, e.g. when hovered over it in a UI. Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // An optional string indicating the location of the expression for error // reporting, e.g. a file name and a position in the file. Location string `protobuf:"bytes,4,opt,name=location,proto3" json:"location,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Expr) Reset() { *m = Expr{} } func (*Expr) ProtoMessage() {} func (*Expr) Descriptor() ([]byte, []int) { return fileDescriptor_d7920f1ae7a2722f, []int{0} } func (m *Expr) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Expr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Expr.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 *Expr) XXX_Merge(src proto.Message) { xxx_messageInfo_Expr.Merge(m, src) } func (m *Expr) XXX_Size() int { return m.Size() } func (m *Expr) XXX_DiscardUnknown() { xxx_messageInfo_Expr.DiscardUnknown(m) } var xxx_messageInfo_Expr proto.InternalMessageInfo func (m *Expr) GetExpression() string { if m != nil { return m.Expression } return "" } func (m *Expr) GetTitle() string { if m != nil { return m.Title } return "" } func (m *Expr) GetDescription() string { if m != nil { return m.Description } return "" } func (m *Expr) GetLocation() string { if m != nil { return m.Location } return "" } func (*Expr) XXX_MessageName() string { return "google.type.Expr" } func init() { proto.RegisterType((*Expr)(nil), "google.type.Expr") } func init() { proto.RegisterFile("google/type/expr.proto", fileDescriptor_d7920f1ae7a2722f) } var fileDescriptor_d7920f1ae7a2722f = []byte{ // 215 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4b, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0x4f, 0xad, 0x28, 0x28, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x88, 0xeb, 0x81, 0xc4, 0x95, 0xaa, 0xb8, 0x58, 0x5c, 0x2b, 0x0a, 0x8a, 0x84, 0xe4, 0xb8, 0xb8, 0x40, 0x4a, 0x52, 0x8b, 0x8b, 0x33, 0xf3, 0xf3, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x90, 0x44, 0x84, 0x44, 0xb8, 0x58, 0x4b, 0x32, 0x4b, 0x72, 0x52, 0x25, 0x98, 0xc0, 0x52, 0x10, 0x8e, 0x90, 0x02, 0x17, 0x77, 0x4a, 0x6a, 0x71, 0x72, 0x51, 0x66, 0x41, 0x09, 0x48, 0x1b, 0x33, 0x58, 0x0e, 0x59, 0x48, 0x48, 0x8a, 0x8b, 0x23, 0x27, 0x3f, 0x39, 0x11, 0x2c, 0xcd, 0x02, 0x96, 0x86, 0xf3, 0x9d, 0xa2, 0x6e, 0x3c, 0x94, 0x63, 0xf8, 0xf0, 0x50, 0x8e, 0xf1, 0xc7, 0x43, 0x39, 0xc6, 0x86, 0x47, 0x72, 0x8c, 0x2b, 0x1e, 0xc9, 0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x2f, 0x1e, 0xc9, 0x31, 0x7c, 0x00, 0x89, 0x3f, 0x96, 0x63, 0x3c, 0xf1, 0x58, 0x8e, 0x91, 0x8b, 0x3f, 0x39, 0x3f, 0x57, 0x0f, 0xc9, 0xf9, 0x4e, 0x9c, 0x20, 0xc7, 0x07, 0x80, 0xbc, 0x15, 0xc0, 0x18, 0xc5, 0x02, 0x12, 0x5a, 0xc4, 0xc4, 0xec, 0x1e, 0x12, 0x90, 0xc4, 0x06, 0xf6, 0xab, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xd7, 0xd5, 0x2e, 0x53, 0x05, 0x01, 0x00, 0x00, } func (this *Expr) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*Expr) if !ok { that2, ok := that.(Expr) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.Expression != that1.Expression { if this.Expression < that1.Expression { return -1 } return 1 } if this.Title != that1.Title { if this.Title < that1.Title { return -1 } return 1 } if this.Description != that1.Description { if this.Description < that1.Description { return -1 } return 1 } if this.Location != that1.Location { if this.Location < that1.Location { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *Expr) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Expr) if !ok { that2, ok := that.(Expr) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Expression != that1.Expression { return false } if this.Title != that1.Title { return false } if this.Description != that1.Description { return false } if this.Location != that1.Location { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Expr) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 8) s = append(s, "&_type.Expr{") s = append(s, "Expression: "+fmt.Sprintf("%#v", this.Expression)+",\n") s = append(s, "Title: "+fmt.Sprintf("%#v", this.Title)+",\n") s = append(s, "Description: "+fmt.Sprintf("%#v", this.Description)+",\n") s = append(s, "Location: "+fmt.Sprintf("%#v", this.Location)+",\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 valueToGoStringExpr(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 *Expr) 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 *Expr) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Expr) 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 len(m.Location) > 0 { i -= len(m.Location) copy(dAtA[i:], m.Location) i = encodeVarintExpr(dAtA, i, uint64(len(m.Location))) i-- dAtA[i] = 0x22 } if len(m.Description) > 0 { i -= len(m.Description) copy(dAtA[i:], m.Description) i = encodeVarintExpr(dAtA, i, uint64(len(m.Description))) i-- dAtA[i] = 0x1a } if len(m.Title) > 0 { i -= len(m.Title) copy(dAtA[i:], m.Title) i = encodeVarintExpr(dAtA, i, uint64(len(m.Title))) i-- dAtA[i] = 0x12 } if len(m.Expression) > 0 { i -= len(m.Expression) copy(dAtA[i:], m.Expression) i = encodeVarintExpr(dAtA, i, uint64(len(m.Expression))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintExpr(dAtA []byte, offset int, v uint64) int { offset -= sovExpr(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedExpr(r randyExpr, easy bool) *Expr { this := &Expr{} this.Expression = string(randStringExpr(r)) this.Title = string(randStringExpr(r)) this.Description = string(randStringExpr(r)) this.Location = string(randStringExpr(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedExpr(r, 5) } return this } type randyExpr interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneExpr(r randyExpr) 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 randStringExpr(r randyExpr) string { v1 := r.Intn(100) tmps := make([]rune, v1) for i := 0; i < v1; i++ { tmps[i] = randUTF8RuneExpr(r) } return string(tmps) } func randUnrecognizedExpr(r randyExpr, 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 = randFieldExpr(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldExpr(dAtA []byte, r randyExpr, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateExpr(dAtA, uint64(key)) v2 := r.Int63() if r.Intn(2) == 0 { v2 *= -1 } dAtA = encodeVarintPopulateExpr(dAtA, uint64(v2)) case 1: dAtA = encodeVarintPopulateExpr(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 = encodeVarintPopulateExpr(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateExpr(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateExpr(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 encodeVarintPopulateExpr(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 *Expr) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Expression) if l > 0 { n += 1 + l + sovExpr(uint64(l)) } l = len(m.Title) if l > 0 { n += 1 + l + sovExpr(uint64(l)) } l = len(m.Description) if l > 0 { n += 1 + l + sovExpr(uint64(l)) } l = len(m.Location) if l > 0 { n += 1 + l + sovExpr(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovExpr(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozExpr(x uint64) (n int) { return sovExpr(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *Expr) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Expr{`, `Expression:` + fmt.Sprintf("%v", this.Expression) + `,`, `Title:` + fmt.Sprintf("%v", this.Title) + `,`, `Description:` + fmt.Sprintf("%v", this.Description) + `,`, `Location:` + fmt.Sprintf("%v", this.Location) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringExpr(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *Expr) 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 ErrIntOverflowExpr } 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: Expr: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Expr: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Expression", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExpr } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthExpr } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthExpr } if postIndex > l { return io.ErrUnexpectedEOF } m.Expression = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExpr } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthExpr } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthExpr } if postIndex > l { return io.ErrUnexpectedEOF } m.Title = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExpr } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthExpr } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthExpr } if postIndex > l { return io.ErrUnexpectedEOF } m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Location", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExpr } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthExpr } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthExpr } if postIndex > l { return io.ErrUnexpectedEOF } m.Location = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipExpr(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthExpr } if (iNdEx + skippy) < 0 { return ErrInvalidLengthExpr } 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 skipExpr(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, ErrIntOverflowExpr } 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, ErrIntOverflowExpr } 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, ErrIntOverflowExpr } 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, ErrInvalidLengthExpr } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupExpr } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthExpr } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthExpr = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowExpr = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupExpr = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/type/expr.proto000066400000000000000000000033721365205541600201610ustar00rootroot00000000000000// 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 = "type"; 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; } googleapis-1.4.0/google/type/fraction.pb.go000066400000000000000000000327561365205541600206620ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/type/fraction.proto package _type import ( bytes "bytes" fmt "fmt" 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 // Represents a fraction in terms of a numerator divided by a denominator. type Fraction struct { // The portion of the denominator in the faction, e.g. 2 in 2/3. Numerator int64 `protobuf:"varint,1,opt,name=numerator,proto3" json:"numerator,omitempty"` // The value by which the numerator is divided, e.g. 3 in 2/3. Must be // positive. Denominator int64 `protobuf:"varint,2,opt,name=denominator,proto3" json:"denominator,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Fraction) Reset() { *m = Fraction{} } func (*Fraction) ProtoMessage() {} func (*Fraction) Descriptor() ([]byte, []int) { return fileDescriptor_154821c252985829, []int{0} } func (m *Fraction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Fraction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Fraction.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 *Fraction) XXX_Merge(src proto.Message) { xxx_messageInfo_Fraction.Merge(m, src) } func (m *Fraction) XXX_Size() int { return m.Size() } func (m *Fraction) XXX_DiscardUnknown() { xxx_messageInfo_Fraction.DiscardUnknown(m) } var xxx_messageInfo_Fraction proto.InternalMessageInfo func (m *Fraction) GetNumerator() int64 { if m != nil { return m.Numerator } return 0 } func (m *Fraction) GetDenominator() int64 { if m != nil { return m.Denominator } return 0 } func (*Fraction) XXX_MessageName() string { return "google.type.Fraction" } func init() { proto.RegisterType((*Fraction)(nil), "google.type.Fraction") } func init() { proto.RegisterFile("google/type/fraction.proto", fileDescriptor_154821c252985829) } var fileDescriptor_154821c252985829 = []byte{ // 189 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0x4f, 0x2b, 0x4a, 0x4c, 0x2e, 0xc9, 0xcc, 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0xc8, 0xe9, 0x81, 0xe4, 0x94, 0xbc, 0xb8, 0x38, 0xdc, 0xa0, 0xd2, 0x42, 0x32, 0x5c, 0x9c, 0x79, 0xa5, 0xb9, 0xa9, 0x45, 0x89, 0x25, 0xf9, 0x45, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xcc, 0x41, 0x08, 0x01, 0x21, 0x05, 0x2e, 0xee, 0x94, 0xd4, 0xbc, 0xfc, 0xdc, 0xcc, 0x3c, 0xb0, 0x3c, 0x13, 0x58, 0x1e, 0x59, 0xc8, 0x29, 0xee, 0xc6, 0x43, 0x39, 0x86, 0x0f, 0x0f, 0xe5, 0x18, 0x7f, 0x3c, 0x94, 0x63, 0x6c, 0x78, 0x24, 0xc7, 0xb8, 0xe2, 0x91, 0x1c, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0xf8, 0xe2, 0x91, 0x1c, 0xc3, 0x07, 0x90, 0xf8, 0x63, 0x39, 0xc6, 0x13, 0x8f, 0xe5, 0x18, 0xb9, 0xf8, 0x93, 0xf3, 0x73, 0xf5, 0x90, 0x9c, 0xe3, 0xc4, 0x0b, 0x73, 0x4c, 0x00, 0xc8, 0xa9, 0x01, 0x8c, 0x51, 0x2c, 0x20, 0xe1, 0x45, 0x4c, 0xcc, 0xee, 0x21, 0x01, 0x49, 0x6c, 0x60, 0xf7, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x18, 0x16, 0xbc, 0xd4, 0xdd, 0x00, 0x00, 0x00, } func (this *Fraction) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*Fraction) if !ok { that2, ok := that.(Fraction) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.Numerator != that1.Numerator { if this.Numerator < that1.Numerator { return -1 } return 1 } if this.Denominator != that1.Denominator { if this.Denominator < that1.Denominator { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *Fraction) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Fraction) if !ok { that2, ok := that.(Fraction) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Numerator != that1.Numerator { return false } if this.Denominator != that1.Denominator { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Fraction) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&_type.Fraction{") s = append(s, "Numerator: "+fmt.Sprintf("%#v", this.Numerator)+",\n") s = append(s, "Denominator: "+fmt.Sprintf("%#v", this.Denominator)+",\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 valueToGoStringFraction(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 *Fraction) 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 *Fraction) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Fraction) 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.Denominator != 0 { i = encodeVarintFraction(dAtA, i, uint64(m.Denominator)) i-- dAtA[i] = 0x10 } if m.Numerator != 0 { i = encodeVarintFraction(dAtA, i, uint64(m.Numerator)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func encodeVarintFraction(dAtA []byte, offset int, v uint64) int { offset -= sovFraction(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedFraction(r randyFraction, easy bool) *Fraction { this := &Fraction{} this.Numerator = int64(r.Int63()) if r.Intn(2) == 0 { this.Numerator *= -1 } this.Denominator = int64(r.Int63()) if r.Intn(2) == 0 { this.Denominator *= -1 } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedFraction(r, 3) } return this } type randyFraction interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneFraction(r randyFraction) 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 randStringFraction(r randyFraction) string { v1 := r.Intn(100) tmps := make([]rune, v1) for i := 0; i < v1; i++ { tmps[i] = randUTF8RuneFraction(r) } return string(tmps) } func randUnrecognizedFraction(r randyFraction, 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 = randFieldFraction(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldFraction(dAtA []byte, r randyFraction, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateFraction(dAtA, uint64(key)) v2 := r.Int63() if r.Intn(2) == 0 { v2 *= -1 } dAtA = encodeVarintPopulateFraction(dAtA, uint64(v2)) case 1: dAtA = encodeVarintPopulateFraction(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 = encodeVarintPopulateFraction(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateFraction(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateFraction(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 encodeVarintPopulateFraction(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 *Fraction) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Numerator != 0 { n += 1 + sovFraction(uint64(m.Numerator)) } if m.Denominator != 0 { n += 1 + sovFraction(uint64(m.Denominator)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovFraction(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozFraction(x uint64) (n int) { return sovFraction(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *Fraction) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Fraction{`, `Numerator:` + fmt.Sprintf("%v", this.Numerator) + `,`, `Denominator:` + fmt.Sprintf("%v", this.Denominator) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringFraction(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *Fraction) 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 ErrIntOverflowFraction } 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: Fraction: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Fraction: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Numerator", wireType) } m.Numerator = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowFraction } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Numerator |= int64(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Denominator", wireType) } m.Denominator = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowFraction } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Denominator |= int64(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipFraction(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthFraction } if (iNdEx + skippy) < 0 { return ErrInvalidLengthFraction } 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 skipFraction(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, ErrIntOverflowFraction } 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, ErrIntOverflowFraction } 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, ErrIntOverflowFraction } 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, ErrInvalidLengthFraction } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupFraction } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthFraction } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthFraction = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowFraction = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupFraction = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/type/fraction.proto000066400000000000000000000021401365205541600210000ustar00rootroot00000000000000// 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 = "type"; 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; } googleapis-1.4.0/google/type/latlng.pb.go000066400000000000000000000326371365205541600203340ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/type/latlng.proto package _type import ( bytes "bytes" encoding_binary "encoding/binary" fmt "fmt" 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 // 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 // WGS84 // standard. Values must be within normalized ranges. type LatLng struct { // The latitude in degrees. It must be in the range [-90.0, +90.0]. Latitude float64 `protobuf:"fixed64,1,opt,name=latitude,proto3" json:"latitude,omitempty"` // The longitude in degrees. It must be in the range [-180.0, +180.0]. Longitude float64 `protobuf:"fixed64,2,opt,name=longitude,proto3" json:"longitude,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *LatLng) Reset() { *m = LatLng{} } func (*LatLng) ProtoMessage() {} func (*LatLng) Descriptor() ([]byte, []int) { return fileDescriptor_a087c9a103c281a9, []int{0} } func (m *LatLng) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *LatLng) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_LatLng.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 *LatLng) XXX_Merge(src proto.Message) { xxx_messageInfo_LatLng.Merge(m, src) } func (m *LatLng) XXX_Size() int { return m.Size() } func (m *LatLng) XXX_DiscardUnknown() { xxx_messageInfo_LatLng.DiscardUnknown(m) } var xxx_messageInfo_LatLng proto.InternalMessageInfo func (m *LatLng) GetLatitude() float64 { if m != nil { return m.Latitude } return 0 } func (m *LatLng) GetLongitude() float64 { if m != nil { return m.Longitude } return 0 } func (*LatLng) XXX_MessageName() string { return "google.type.LatLng" } func init() { proto.RegisterType((*LatLng)(nil), "google.type.LatLng") } func init() { proto.RegisterFile("google/type/latlng.proto", fileDescriptor_a087c9a103c281a9) } var fileDescriptor_a087c9a103c281a9 = []byte{ // 189 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x48, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0xcf, 0x49, 0x2c, 0xc9, 0xc9, 0x4b, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0xc8, 0xe8, 0x81, 0x64, 0x94, 0x9c, 0xb8, 0xd8, 0x7c, 0x12, 0x4b, 0x7c, 0xf2, 0xd2, 0x85, 0xa4, 0xb8, 0x38, 0x72, 0x12, 0x4b, 0x32, 0x4b, 0x4a, 0x53, 0x52, 0x25, 0x18, 0x15, 0x18, 0x35, 0x18, 0x83, 0xe0, 0x7c, 0x21, 0x19, 0x2e, 0xce, 0x9c, 0xfc, 0xbc, 0x74, 0x88, 0x24, 0x13, 0x58, 0x12, 0x21, 0xe0, 0x14, 0x7f, 0xe3, 0xa1, 0x1c, 0xc3, 0x87, 0x87, 0x72, 0x8c, 0x3f, 0x1e, 0xca, 0x31, 0x36, 0x3c, 0x92, 0x63, 0x5c, 0xf1, 0x48, 0x8e, 0xf1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x7c, 0xf1, 0x48, 0x8e, 0xe1, 0x03, 0x48, 0xfc, 0xb1, 0x1c, 0xe3, 0x89, 0xc7, 0x72, 0x8c, 0x5c, 0xfc, 0xc9, 0xf9, 0xb9, 0x7a, 0x48, 0xce, 0x70, 0xe2, 0x86, 0x38, 0x22, 0x00, 0xe4, 0xc0, 0x00, 0xc6, 0x28, 0x16, 0x90, 0xe0, 0x0f, 0x46, 0xc6, 0x45, 0x4c, 0xcc, 0xee, 0x21, 0x01, 0x49, 0x6c, 0x60, 0x87, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd6, 0xe3, 0x71, 0xfc, 0xd4, 0x00, 0x00, 0x00, } func (this *LatLng) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*LatLng) if !ok { that2, ok := that.(LatLng) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.Latitude != that1.Latitude { if this.Latitude < that1.Latitude { return -1 } return 1 } if this.Longitude != that1.Longitude { if this.Longitude < that1.Longitude { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *LatLng) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*LatLng) if !ok { that2, ok := that.(LatLng) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Latitude != that1.Latitude { return false } if this.Longitude != that1.Longitude { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *LatLng) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&_type.LatLng{") s = append(s, "Latitude: "+fmt.Sprintf("%#v", this.Latitude)+",\n") s = append(s, "Longitude: "+fmt.Sprintf("%#v", this.Longitude)+",\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 valueToGoStringLatlng(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 *LatLng) 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 *LatLng) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *LatLng) 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.Longitude != 0 { i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Longitude)))) i-- dAtA[i] = 0x11 } if m.Latitude != 0 { i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Latitude)))) i-- dAtA[i] = 0x9 } return len(dAtA) - i, nil } func encodeVarintLatlng(dAtA []byte, offset int, v uint64) int { offset -= sovLatlng(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedLatLng(r randyLatlng, easy bool) *LatLng { this := &LatLng{} this.Latitude = float64(r.Float64()) if r.Intn(2) == 0 { this.Latitude *= -1 } this.Longitude = float64(r.Float64()) if r.Intn(2) == 0 { this.Longitude *= -1 } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedLatlng(r, 3) } return this } type randyLatlng interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneLatlng(r randyLatlng) 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 randStringLatlng(r randyLatlng) string { v1 := r.Intn(100) tmps := make([]rune, v1) for i := 0; i < v1; i++ { tmps[i] = randUTF8RuneLatlng(r) } return string(tmps) } func randUnrecognizedLatlng(r randyLatlng, 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 = randFieldLatlng(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldLatlng(dAtA []byte, r randyLatlng, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateLatlng(dAtA, uint64(key)) v2 := r.Int63() if r.Intn(2) == 0 { v2 *= -1 } dAtA = encodeVarintPopulateLatlng(dAtA, uint64(v2)) case 1: dAtA = encodeVarintPopulateLatlng(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 = encodeVarintPopulateLatlng(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateLatlng(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateLatlng(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 encodeVarintPopulateLatlng(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 *LatLng) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Latitude != 0 { n += 9 } if m.Longitude != 0 { n += 9 } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovLatlng(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozLatlng(x uint64) (n int) { return sovLatlng(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *LatLng) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&LatLng{`, `Latitude:` + fmt.Sprintf("%v", this.Latitude) + `,`, `Longitude:` + fmt.Sprintf("%v", this.Longitude) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringLatlng(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *LatLng) 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 ErrIntOverflowLatlng } 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: LatLng: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LatLng: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field Latitude", wireType) } var v uint64 if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 m.Latitude = float64(math.Float64frombits(v)) case 2: if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field Longitude", wireType) } var v uint64 if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 m.Longitude = float64(math.Float64frombits(v)) default: iNdEx = preIndex skippy, err := skipLatlng(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthLatlng } if (iNdEx + skippy) < 0 { return ErrInvalidLengthLatlng } 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 skipLatlng(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, ErrIntOverflowLatlng } 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, ErrIntOverflowLatlng } 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, ErrIntOverflowLatlng } 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, ErrInvalidLengthLatlng } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupLatlng } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthLatlng } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthLatlng = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowLatlng = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupLatlng = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/type/latlng.proto000066400000000000000000000025601365205541600204620ustar00rootroot00000000000000// 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. // 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 = "type"; 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 // WGS84 // standard. Values must be within normalized ranges. message LatLng { // The latitude in degrees. It must be in the range [-90.0, +90.0]. double latitude = 1; // The longitude in degrees. It must be in the range [-180.0, +180.0]. double longitude = 2; } googleapis-1.4.0/google/type/money.pb.go000066400000000000000000000361041365205541600201730ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/type/money.proto package _type import ( bytes "bytes" fmt "fmt" 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 // Represents an amount of money with its currency type. type Money struct { // The 3-letter currency code defined in ISO 4217. CurrencyCode string `protobuf:"bytes,1,opt,name=currency_code,json=currencyCode,proto3" json:"currency_code,omitempty"` // The whole units of the amount. // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. Units int64 `protobuf:"varint,2,opt,name=units,proto3" json:"units,omitempty"` // Number of nano (10^-9) units of the amount. // The value must be between -999,999,999 and +999,999,999 inclusive. // If `units` is positive, `nanos` must be positive or zero. // If `units` is zero, `nanos` can be positive, zero, or negative. // If `units` is negative, `nanos` must be negative or zero. // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. Nanos int32 `protobuf:"varint,3,opt,name=nanos,proto3" json:"nanos,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Money) Reset() { *m = Money{} } func (*Money) ProtoMessage() {} func (*Money) Descriptor() ([]byte, []int) { return fileDescriptor_f093d3d05ab4bbee, []int{0} } func (m *Money) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Money) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Money.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 *Money) XXX_Merge(src proto.Message) { xxx_messageInfo_Money.Merge(m, src) } func (m *Money) XXX_Size() int { return m.Size() } func (m *Money) XXX_DiscardUnknown() { xxx_messageInfo_Money.DiscardUnknown(m) } var xxx_messageInfo_Money proto.InternalMessageInfo func (m *Money) GetCurrencyCode() string { if m != nil { return m.CurrencyCode } return "" } func (m *Money) GetUnits() int64 { if m != nil { return m.Units } return 0 } func (m *Money) GetNanos() int32 { if m != nil { return m.Nanos } return 0 } func (*Money) XXX_MessageName() string { return "google.type.Money" } func init() { proto.RegisterType((*Money)(nil), "google.type.Money") } func init() { proto.RegisterFile("google/type/money.proto", fileDescriptor_f093d3d05ab4bbee) } var fileDescriptor_f093d3d05ab4bbee = []byte{ // 214 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0xcf, 0xcd, 0xcf, 0x4b, 0xad, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x48, 0xe8, 0x81, 0x24, 0x94, 0x22, 0xb8, 0x58, 0x7d, 0x41, 0x72, 0x42, 0xca, 0x5c, 0xbc, 0xc9, 0xa5, 0x45, 0x45, 0xa9, 0x79, 0xc9, 0x95, 0xf1, 0xc9, 0xf9, 0x29, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x3c, 0x30, 0x41, 0xe7, 0xfc, 0x94, 0x54, 0x21, 0x11, 0x2e, 0xd6, 0xd2, 0xbc, 0xcc, 0x92, 0x62, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xe6, 0x20, 0x08, 0x07, 0x24, 0x9a, 0x97, 0x98, 0x97, 0x5f, 0x2c, 0xc1, 0xac, 0xc0, 0xa8, 0xc1, 0x1a, 0x04, 0xe1, 0x38, 0xc5, 0xdd, 0x78, 0x28, 0xc7, 0xf0, 0xe1, 0xa1, 0x1c, 0xe3, 0x8f, 0x87, 0x72, 0x8c, 0x0d, 0x8f, 0xe4, 0x18, 0x57, 0x3c, 0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x5f, 0x3c, 0x92, 0x63, 0xf8, 0x00, 0x12, 0x7f, 0x2c, 0xc7, 0x78, 0xe2, 0xb1, 0x1c, 0x23, 0x17, 0x7f, 0x72, 0x7e, 0xae, 0x1e, 0x92, 0xe3, 0x9c, 0xb8, 0xc0, 0x4e, 0x0b, 0x00, 0xb9, 0x3a, 0x80, 0x31, 0x8a, 0x05, 0x24, 0xf6, 0x83, 0x91, 0x71, 0x11, 0x13, 0xb3, 0x7b, 0x48, 0x40, 0x12, 0x1b, 0xd8, 0x37, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x98, 0xb1, 0xd1, 0xe8, 0x00, 0x00, 0x00, } func (this *Money) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*Money) if !ok { that2, ok := that.(Money) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.CurrencyCode != that1.CurrencyCode { if this.CurrencyCode < that1.CurrencyCode { return -1 } return 1 } if this.Units != that1.Units { if this.Units < that1.Units { return -1 } return 1 } if this.Nanos != that1.Nanos { if this.Nanos < that1.Nanos { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *Money) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Money) if !ok { that2, ok := that.(Money) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.CurrencyCode != that1.CurrencyCode { return false } if this.Units != that1.Units { return false } if this.Nanos != that1.Nanos { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Money) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 7) s = append(s, "&_type.Money{") s = append(s, "CurrencyCode: "+fmt.Sprintf("%#v", this.CurrencyCode)+",\n") s = append(s, "Units: "+fmt.Sprintf("%#v", this.Units)+",\n") s = append(s, "Nanos: "+fmt.Sprintf("%#v", this.Nanos)+",\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 valueToGoStringMoney(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 *Money) 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 *Money) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Money) 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.Nanos != 0 { i = encodeVarintMoney(dAtA, i, uint64(m.Nanos)) i-- dAtA[i] = 0x18 } if m.Units != 0 { i = encodeVarintMoney(dAtA, i, uint64(m.Units)) i-- dAtA[i] = 0x10 } if len(m.CurrencyCode) > 0 { i -= len(m.CurrencyCode) copy(dAtA[i:], m.CurrencyCode) i = encodeVarintMoney(dAtA, i, uint64(len(m.CurrencyCode))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintMoney(dAtA []byte, offset int, v uint64) int { offset -= sovMoney(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedMoney(r randyMoney, easy bool) *Money { this := &Money{} this.CurrencyCode = string(randStringMoney(r)) this.Units = int64(r.Int63()) if r.Intn(2) == 0 { this.Units *= -1 } this.Nanos = int32(r.Int31()) if r.Intn(2) == 0 { this.Nanos *= -1 } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedMoney(r, 4) } return this } type randyMoney interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneMoney(r randyMoney) 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 randStringMoney(r randyMoney) string { v1 := r.Intn(100) tmps := make([]rune, v1) for i := 0; i < v1; i++ { tmps[i] = randUTF8RuneMoney(r) } return string(tmps) } func randUnrecognizedMoney(r randyMoney, 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 = randFieldMoney(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldMoney(dAtA []byte, r randyMoney, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateMoney(dAtA, uint64(key)) v2 := r.Int63() if r.Intn(2) == 0 { v2 *= -1 } dAtA = encodeVarintPopulateMoney(dAtA, uint64(v2)) case 1: dAtA = encodeVarintPopulateMoney(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 = encodeVarintPopulateMoney(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateMoney(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateMoney(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 encodeVarintPopulateMoney(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 *Money) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.CurrencyCode) if l > 0 { n += 1 + l + sovMoney(uint64(l)) } if m.Units != 0 { n += 1 + sovMoney(uint64(m.Units)) } if m.Nanos != 0 { n += 1 + sovMoney(uint64(m.Nanos)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovMoney(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozMoney(x uint64) (n int) { return sovMoney(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *Money) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Money{`, `CurrencyCode:` + fmt.Sprintf("%v", this.CurrencyCode) + `,`, `Units:` + fmt.Sprintf("%v", this.Units) + `,`, `Nanos:` + fmt.Sprintf("%v", this.Nanos) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringMoney(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *Money) 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 ErrIntOverflowMoney } 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: Money: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Money: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CurrencyCode", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMoney } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthMoney } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthMoney } if postIndex > l { return io.ErrUnexpectedEOF } m.CurrencyCode = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Units", wireType) } m.Units = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMoney } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Units |= int64(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Nanos", wireType) } m.Nanos = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMoney } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Nanos |= int32(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipMoney(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthMoney } if (iNdEx + skippy) < 0 { return ErrInvalidLengthMoney } 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 skipMoney(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, ErrIntOverflowMoney } 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, ErrIntOverflowMoney } 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, ErrIntOverflowMoney } 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, ErrInvalidLengthMoney } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupMoney } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthMoney } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthMoney = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowMoney = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupMoney = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/type/money.proto000066400000000000000000000030211365205541600203210ustar00rootroot00000000000000// 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 = "type"; 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. string currency_code = 1; // The whole units of the amount. // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. int64 units = 2; // Number of nano (10^-9) units of the amount. // The value must be between -999,999,999 and +999,999,999 inclusive. // If `units` is positive, `nanos` must be positive or zero. // If `units` is zero, `nanos` can be positive, zero, or negative. // If `units` is negative, `nanos` must be negative or zero. // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. int32 nanos = 3; } googleapis-1.4.0/google/type/month.pb.go000066400000000000000000000102121365205541600201610ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/type/month.proto package _type import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" math "math" strconv "strconv" ) // 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 // Represents a month in the Gregorian calendar. type Month int32 const ( // The unspecifed month. Month_MONTH_UNSPECIFIED Month = 0 // The month of January. Month_JANUARY Month = 1 // The month of February. Month_FEBRUARY Month = 2 // The month of March. Month_MARCH Month = 3 // The month of April. Month_APRIL Month = 4 // The month of May. Month_MAY Month = 5 // The month of June. Month_JUNE Month = 6 // The month of July. Month_JULY Month = 7 // The month of August. Month_AUGUST Month = 8 // The month of September. Month_SEPTEMBER Month = 9 // The month of October. Month_OCTOBER Month = 10 // The month of November. Month_NOVEMBER Month = 11 // The month of December. Month_DECEMBER Month = 12 ) var Month_name = map[int32]string{ 0: "MONTH_UNSPECIFIED", 1: "JANUARY", 2: "FEBRUARY", 3: "MARCH", 4: "APRIL", 5: "MAY", 6: "JUNE", 7: "JULY", 8: "AUGUST", 9: "SEPTEMBER", 10: "OCTOBER", 11: "NOVEMBER", 12: "DECEMBER", } var Month_value = map[string]int32{ "MONTH_UNSPECIFIED": 0, "JANUARY": 1, "FEBRUARY": 2, "MARCH": 3, "APRIL": 4, "MAY": 5, "JUNE": 6, "JULY": 7, "AUGUST": 8, "SEPTEMBER": 9, "OCTOBER": 10, "NOVEMBER": 11, "DECEMBER": 12, } func (Month) EnumDescriptor() ([]byte, []int) { return fileDescriptor_3bd21fd11ded5e73, []int{0} } func init() { proto.RegisterEnum("google.type.Month", Month_name, Month_value) } func init() { proto.RegisterFile("google/type/month.proto", fileDescriptor_3bd21fd11ded5e73) } var fileDescriptor_3bd21fd11ded5e73 = []byte{ // 287 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0x3b, 0x4e, 0xf3, 0x40, 0x14, 0x85, 0x73, 0xf3, 0xf0, 0xe3, 0x3a, 0xbf, 0xfe, 0x61, 0x24, 0x44, 0x37, 0x0b, 0xa0, 0x70, 0x0a, 0x56, 0x30, 0x76, 0x26, 0x89, 0xa3, 0xd8, 0x1e, 0xf9, 0x81, 0x64, 0x28, 0x90, 0x40, 0x51, 0x28, 0x08, 0x13, 0x21, 0x37, 0x74, 0xac, 0x85, 0x8a, 0x92, 0x65, 0xa4, 0xa4, 0xa4, 0xc4, 0x93, 0x86, 0x32, 0x25, 0x25, 0x1a, 0xbb, 0xa1, 0xbb, 0xdf, 0xfd, 0x8a, 0xa3, 0x73, 0xf0, 0x6c, 0xa3, 0xd4, 0xe6, 0x61, 0x3d, 0xa9, 0x9f, 0x77, 0xeb, 0xc9, 0x56, 0x3d, 0xd6, 0xf7, 0xfe, 0xee, 0x49, 0xd5, 0x8a, 0x7a, 0x9d, 0xf0, 0x8d, 0x38, 0x7f, 0x07, 0x1c, 0xc5, 0x46, 0xd2, 0x53, 0x3c, 0x89, 0xd3, 0xa4, 0x58, 0xdc, 0x94, 0x49, 0x2e, 0x45, 0x18, 0xcd, 0x22, 0x31, 0x25, 0x3d, 0xea, 0xa1, 0xbd, 0xe4, 0x49, 0xc9, 0xb3, 0x8a, 0x00, 0x1d, 0xa3, 0x33, 0x13, 0x41, 0xd6, 0x52, 0x9f, 0xba, 0x38, 0x8a, 0x79, 0x16, 0x2e, 0xc8, 0xc0, 0x9c, 0x5c, 0x66, 0xd1, 0x8a, 0x0c, 0xa9, 0x8d, 0x83, 0x98, 0x57, 0x64, 0x44, 0x1d, 0x1c, 0x2e, 0xcb, 0x44, 0x10, 0xab, 0xbb, 0x56, 0x15, 0xb1, 0x29, 0xa2, 0xc5, 0xcb, 0x79, 0x99, 0x17, 0xc4, 0xa1, 0xff, 0xd0, 0xcd, 0x85, 0x2c, 0x44, 0x1c, 0x88, 0x8c, 0xb8, 0x26, 0x28, 0x0d, 0x8b, 0xd4, 0x00, 0x9a, 0xa0, 0x24, 0xbd, 0xec, 0x94, 0x67, 0x68, 0x2a, 0xc2, 0x8e, 0xc6, 0xc1, 0xf5, 0x67, 0xc3, 0x7a, 0xc7, 0x86, 0xc1, 0x4f, 0xc3, 0xe0, 0x45, 0x33, 0x78, 0xd3, 0x0c, 0xf6, 0x9a, 0xc1, 0x87, 0x66, 0xf0, 0xa5, 0x19, 0x7c, 0x6b, 0xd6, 0x3b, 0x9a, 0xff, 0x81, 0xc1, 0xfe, 0xc0, 0x00, 0xff, 0xdf, 0xa9, 0xad, 0xff, 0xa7, 0x75, 0x80, 0x6d, 0x65, 0x69, 0xe6, 0x90, 0x70, 0x35, 0x34, 0xbf, 0xd7, 0xfe, 0x60, 0x5e, 0xc8, 0x5b, 0xab, 0xdd, 0xe8, 0xe2, 0x37, 0x00, 0x00, 0xff, 0xff, 0xf1, 0x15, 0xdf, 0xc5, 0x3e, 0x01, 0x00, 0x00, } func (x Month) String() string { s, ok := Month_name[int32(x)] if ok { return s } return strconv.Itoa(int(x)) } googleapis-1.4.0/google/type/month.proto000066400000000000000000000026301365205541600203240ustar00rootroot00000000000000// 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 = "type"; option java_multiple_files = true; option java_outer_classname = "MonthProto"; option java_package = "com.google.type"; option objc_class_prefix = "GTP"; // Represents a month in the Gregorian calendar. enum Month { // The unspecifed month. MONTH_UNSPECIFIED = 0; // The month of January. JANUARY = 1; // The month of February. FEBRUARY = 2; // The month of March. MARCH = 3; // The month of April. APRIL = 4; // The month of May. MAY = 5; // The month of June. JUNE = 6; // The month of July. JULY = 7; // The month of August. AUGUST = 8; // The month of September. SEPTEMBER = 9; // The month of October. OCTOBER = 10; // The month of November. NOVEMBER = 11; // The month of December. DECEMBER = 12; } googleapis-1.4.0/google/type/postal_address.pb.go000066400000000000000000001064521365205541600220570ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/type/postal_address.proto package _type import ( bytes "bytes" fmt "fmt" 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 // Represents a postal address, e.g. for postal delivery or payments addresses. // Given a postal address, a postal service can deliver items to a premise, P.O. // Box or similar. // It is not intended to model geographical locations (roads, towns, // mountains). // // In typical usage an address would be created via user input or from importing // existing data, depending on the type of process. // // Advice on address input / editing: // - Use an i18n-ready address widget such as // https://github.com/google/libaddressinput) // - Users should not be presented with UI elements for input or editing of // fields outside countries where that field is used. // // For more guidance on how to use this schema, please see: // https://support.google.com/business/answer/6397478 type PostalAddress struct { // The schema revision of the `PostalAddress`. This must be set to 0, which is // the latest revision. // // All new revisions **must** be backward compatible with old revisions. Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` // Required. CLDR region code of the country/region of the address. This // is never inferred and it is up to the user to ensure the value is // correct. See http://cldr.unicode.org/ and // http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html // for details. Example: "CH" for Switzerland. RegionCode string `protobuf:"bytes,2,opt,name=region_code,json=regionCode,proto3" json:"region_code,omitempty"` // Optional. BCP-47 language code of the contents of this address (if // known). This is often the UI language of the input form or is expected // to match one of the languages used in the address' country/region, or their // transliterated equivalents. // This can affect formatting in certain countries, but is not critical // to the correctness of the data and will never affect any validation or // other non-formatting related operations. // // If this value is not known, it should be omitted (rather than specifying a // possibly incorrect default). // // Examples: "zh-Hant", "ja", "ja-Latn", "en". LanguageCode string `protobuf:"bytes,3,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"` // Optional. Postal code of the address. Not all countries use or require // postal codes to be present, but where they are used, they may trigger // additional validation with other parts of the address (e.g. state/zip // validation in the U.S.A.). PostalCode string `protobuf:"bytes,4,opt,name=postal_code,json=postalCode,proto3" json:"postal_code,omitempty"` // Optional. Additional, country-specific, sorting code. This is not used // in most regions. Where it is used, the value is either a string like // "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number // alone, representing the "sector code" (Jamaica), "delivery area indicator" // (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). SortingCode string `protobuf:"bytes,5,opt,name=sorting_code,json=sortingCode,proto3" json:"sorting_code,omitempty"` // Optional. Highest administrative subdivision which is used for postal // addresses of a country or region. // For example, this can be a state, a province, an oblast, or a prefecture. // Specifically, for Spain this is the province and not the autonomous // community (e.g. "Barcelona" and not "Catalonia"). // Many countries don't use an administrative area in postal addresses. E.g. // in Switzerland this should be left unpopulated. AdministrativeArea string `protobuf:"bytes,6,opt,name=administrative_area,json=administrativeArea,proto3" json:"administrative_area,omitempty"` // Optional. Generally refers to the city/town portion of the address. // Examples: US city, IT comune, UK post town. // In regions of the world where localities are not well defined or do not fit // into this structure well, leave locality empty and use address_lines. Locality string `protobuf:"bytes,7,opt,name=locality,proto3" json:"locality,omitempty"` // Optional. Sublocality of the address. // For example, this can be neighborhoods, boroughs, districts. Sublocality string `protobuf:"bytes,8,opt,name=sublocality,proto3" json:"sublocality,omitempty"` // Unstructured address lines describing the lower levels of an address. // // Because values in address_lines do not have type information and may // sometimes contain multiple values in a single field (e.g. // "Austin, TX"), it is important that the line order is clear. The order of // address lines should be "envelope order" for the country/region of the // address. In places where this can vary (e.g. Japan), address_language is // used to make it explicit (e.g. "ja" for large-to-small ordering and // "ja-Latn" or "en" for small-to-large). This way, the most specific line of // an address can be selected based on the language. // // The minimum permitted structural representation of an address consists // of a region_code with all remaining information placed in the // address_lines. It would be possible to format such an address very // approximately without geocoding, but no semantic reasoning could be // made about any of the address components until it was at least // partially resolved. // // Creating an address only containing a region_code and address_lines, and // then geocoding is the recommended way to handle completely unstructured // addresses (as opposed to guessing which parts of the address should be // localities or administrative areas). AddressLines []string `protobuf:"bytes,9,rep,name=address_lines,json=addressLines,proto3" json:"address_lines,omitempty"` // Optional. The recipient at the address. // This field may, under certain circumstances, contain multiline information. // For example, it might contain "care of" information. Recipients []string `protobuf:"bytes,10,rep,name=recipients,proto3" json:"recipients,omitempty"` // Optional. The name of the organization at the address. Organization string `protobuf:"bytes,11,opt,name=organization,proto3" json:"organization,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PostalAddress) Reset() { *m = PostalAddress{} } func (*PostalAddress) ProtoMessage() {} func (*PostalAddress) Descriptor() ([]byte, []int) { return fileDescriptor_17c0e9bca935790c, []int{0} } func (m *PostalAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PostalAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PostalAddress.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 *PostalAddress) XXX_Merge(src proto.Message) { xxx_messageInfo_PostalAddress.Merge(m, src) } func (m *PostalAddress) XXX_Size() int { return m.Size() } func (m *PostalAddress) XXX_DiscardUnknown() { xxx_messageInfo_PostalAddress.DiscardUnknown(m) } var xxx_messageInfo_PostalAddress proto.InternalMessageInfo func (m *PostalAddress) GetRevision() int32 { if m != nil { return m.Revision } return 0 } func (m *PostalAddress) GetRegionCode() string { if m != nil { return m.RegionCode } return "" } func (m *PostalAddress) GetLanguageCode() string { if m != nil { return m.LanguageCode } return "" } func (m *PostalAddress) GetPostalCode() string { if m != nil { return m.PostalCode } return "" } func (m *PostalAddress) GetSortingCode() string { if m != nil { return m.SortingCode } return "" } func (m *PostalAddress) GetAdministrativeArea() string { if m != nil { return m.AdministrativeArea } return "" } func (m *PostalAddress) GetLocality() string { if m != nil { return m.Locality } return "" } func (m *PostalAddress) GetSublocality() string { if m != nil { return m.Sublocality } return "" } func (m *PostalAddress) GetAddressLines() []string { if m != nil { return m.AddressLines } return nil } func (m *PostalAddress) GetRecipients() []string { if m != nil { return m.Recipients } return nil } func (m *PostalAddress) GetOrganization() string { if m != nil { return m.Organization } return "" } func (*PostalAddress) XXX_MessageName() string { return "google.type.PostalAddress" } func init() { proto.RegisterType((*PostalAddress)(nil), "google.type.PostalAddress") } func init() { proto.RegisterFile("google/type/postal_address.proto", fileDescriptor_17c0e9bca935790c) } var fileDescriptor_17c0e9bca935790c = []byte{ // 367 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x92, 0xb1, 0x6e, 0xea, 0x30, 0x14, 0x86, 0x31, 0x01, 0x2e, 0x38, 0xa0, 0x2b, 0xb9, 0x4b, 0xd4, 0xc1, 0xa4, 0x74, 0x61, 0x82, 0xa1, 0x4f, 0x00, 0x1d, 0xba, 0x74, 0x88, 0x50, 0xa7, 0x2e, 0x91, 0x49, 0xdc, 0xc8, 0x52, 0xb0, 0x23, 0xdb, 0x20, 0xd1, 0xa9, 0x2f, 0xd0, 0x97, 0xe8, 0xd4, 0x47, 0x61, 0xec, 0xd8, 0xb1, 0x84, 0xa5, 0x23, 0x23, 0x63, 0x65, 0x3b, 0xa5, 0x30, 0x9e, 0xef, 0x7c, 0xb2, 0x7d, 0xce, 0x6f, 0x18, 0x66, 0x42, 0x64, 0x39, 0x1d, 0xeb, 0x75, 0x41, 0xc7, 0x85, 0x50, 0x9a, 0xe4, 0x31, 0x49, 0x53, 0x49, 0x95, 0x1a, 0x15, 0x52, 0x68, 0x81, 0x7c, 0x67, 0x8c, 0x8c, 0x31, 0x78, 0xf5, 0x60, 0x2f, 0xb2, 0xd6, 0xc4, 0x49, 0xe8, 0x12, 0xb6, 0x25, 0x5d, 0x31, 0xc5, 0x04, 0x0f, 0x40, 0x08, 0x86, 0xcd, 0xd9, 0xb1, 0x46, 0x7d, 0xe8, 0x4b, 0x9a, 0x31, 0xc1, 0xe3, 0x44, 0xa4, 0x34, 0xa8, 0x87, 0x60, 0xd8, 0x99, 0x41, 0x87, 0x6e, 0x45, 0x4a, 0xd1, 0x35, 0xec, 0xe5, 0x84, 0x67, 0x4b, 0x92, 0x51, 0xa7, 0x78, 0x56, 0xe9, 0xfe, 0x42, 0x2b, 0xf5, 0xa1, 0x5f, 0x3d, 0xcc, 0x2a, 0x0d, 0x77, 0x8a, 0x43, 0x56, 0xb8, 0x82, 0x5d, 0x25, 0xa4, 0x66, 0x3c, 0x73, 0x46, 0xd3, 0x1a, 0x7e, 0xc5, 0xac, 0x32, 0x86, 0x17, 0x24, 0x5d, 0x30, 0xce, 0x94, 0x96, 0x44, 0xb3, 0x15, 0x8d, 0x89, 0xa4, 0x24, 0x68, 0x59, 0x13, 0x9d, 0xb7, 0x26, 0x92, 0x12, 0x33, 0x56, 0x2e, 0x12, 0x92, 0x33, 0xbd, 0x0e, 0xfe, 0x59, 0xeb, 0x58, 0xa3, 0x10, 0xfa, 0x6a, 0x39, 0x3f, 0xb6, 0xdb, 0xd5, 0x75, 0x7f, 0xc8, 0xcc, 0x55, 0x2d, 0x31, 0xce, 0x19, 0xa7, 0x2a, 0xe8, 0x84, 0x9e, 0x99, 0xab, 0x82, 0xf7, 0x86, 0x21, 0x0c, 0xa1, 0xa4, 0x09, 0x2b, 0x18, 0xe5, 0x5a, 0x05, 0xd0, 0x1a, 0x27, 0x04, 0x0d, 0x60, 0x57, 0xc8, 0x8c, 0x70, 0xf6, 0x4c, 0xb4, 0xd9, 0xae, 0xef, 0x76, 0x73, 0xca, 0xa6, 0x4f, 0x9f, 0x5b, 0x5c, 0xdb, 0x6f, 0x31, 0x38, 0x6c, 0x31, 0x78, 0x29, 0x31, 0x78, 0x2f, 0x31, 0xd8, 0x94, 0x18, 0x7c, 0x94, 0x18, 0x7c, 0x95, 0x18, 0x7c, 0x97, 0xb8, 0xb6, 0x37, 0x7c, 0x87, 0xc1, 0x66, 0x87, 0x01, 0xfc, 0x9f, 0x88, 0xc5, 0xe8, 0x24, 0xd2, 0x29, 0x3a, 0xcb, 0x33, 0x32, 0x99, 0x47, 0xe0, 0xb1, 0x61, 0x7a, 0x07, 0x00, 0xde, 0xea, 0xde, 0xdd, 0x43, 0x34, 0x6f, 0xd9, 0xbf, 0x70, 0xf3, 0x13, 0x00, 0x00, 0xff, 0xff, 0xd3, 0x06, 0xa1, 0xfa, 0x2f, 0x02, 0x00, 0x00, } func (this *PostalAddress) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*PostalAddress) if !ok { that2, ok := that.(PostalAddress) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.Revision != that1.Revision { if this.Revision < that1.Revision { return -1 } return 1 } if this.RegionCode != that1.RegionCode { if this.RegionCode < that1.RegionCode { return -1 } return 1 } if this.LanguageCode != that1.LanguageCode { if this.LanguageCode < that1.LanguageCode { return -1 } return 1 } if this.PostalCode != that1.PostalCode { if this.PostalCode < that1.PostalCode { return -1 } return 1 } if this.SortingCode != that1.SortingCode { if this.SortingCode < that1.SortingCode { return -1 } return 1 } if this.AdministrativeArea != that1.AdministrativeArea { if this.AdministrativeArea < that1.AdministrativeArea { return -1 } return 1 } if this.Locality != that1.Locality { if this.Locality < that1.Locality { return -1 } return 1 } if this.Sublocality != that1.Sublocality { if this.Sublocality < that1.Sublocality { return -1 } return 1 } if len(this.AddressLines) != len(that1.AddressLines) { if len(this.AddressLines) < len(that1.AddressLines) { return -1 } return 1 } for i := range this.AddressLines { if this.AddressLines[i] != that1.AddressLines[i] { if this.AddressLines[i] < that1.AddressLines[i] { return -1 } return 1 } } if len(this.Recipients) != len(that1.Recipients) { if len(this.Recipients) < len(that1.Recipients) { return -1 } return 1 } for i := range this.Recipients { if this.Recipients[i] != that1.Recipients[i] { if this.Recipients[i] < that1.Recipients[i] { return -1 } return 1 } } if this.Organization != that1.Organization { if this.Organization < that1.Organization { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *PostalAddress) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*PostalAddress) if !ok { that2, ok := that.(PostalAddress) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Revision != that1.Revision { return false } if this.RegionCode != that1.RegionCode { return false } if this.LanguageCode != that1.LanguageCode { return false } if this.PostalCode != that1.PostalCode { return false } if this.SortingCode != that1.SortingCode { return false } if this.AdministrativeArea != that1.AdministrativeArea { return false } if this.Locality != that1.Locality { return false } if this.Sublocality != that1.Sublocality { return false } if len(this.AddressLines) != len(that1.AddressLines) { return false } for i := range this.AddressLines { if this.AddressLines[i] != that1.AddressLines[i] { return false } } if len(this.Recipients) != len(that1.Recipients) { return false } for i := range this.Recipients { if this.Recipients[i] != that1.Recipients[i] { return false } } if this.Organization != that1.Organization { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *PostalAddress) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 15) s = append(s, "&_type.PostalAddress{") s = append(s, "Revision: "+fmt.Sprintf("%#v", this.Revision)+",\n") s = append(s, "RegionCode: "+fmt.Sprintf("%#v", this.RegionCode)+",\n") s = append(s, "LanguageCode: "+fmt.Sprintf("%#v", this.LanguageCode)+",\n") s = append(s, "PostalCode: "+fmt.Sprintf("%#v", this.PostalCode)+",\n") s = append(s, "SortingCode: "+fmt.Sprintf("%#v", this.SortingCode)+",\n") s = append(s, "AdministrativeArea: "+fmt.Sprintf("%#v", this.AdministrativeArea)+",\n") s = append(s, "Locality: "+fmt.Sprintf("%#v", this.Locality)+",\n") s = append(s, "Sublocality: "+fmt.Sprintf("%#v", this.Sublocality)+",\n") s = append(s, "AddressLines: "+fmt.Sprintf("%#v", this.AddressLines)+",\n") s = append(s, "Recipients: "+fmt.Sprintf("%#v", this.Recipients)+",\n") s = append(s, "Organization: "+fmt.Sprintf("%#v", this.Organization)+",\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 valueToGoStringPostalAddress(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 *PostalAddress) 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 *PostalAddress) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PostalAddress) 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 len(m.Organization) > 0 { i -= len(m.Organization) copy(dAtA[i:], m.Organization) i = encodeVarintPostalAddress(dAtA, i, uint64(len(m.Organization))) i-- dAtA[i] = 0x5a } if len(m.Recipients) > 0 { for iNdEx := len(m.Recipients) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Recipients[iNdEx]) copy(dAtA[i:], m.Recipients[iNdEx]) i = encodeVarintPostalAddress(dAtA, i, uint64(len(m.Recipients[iNdEx]))) i-- dAtA[i] = 0x52 } } if len(m.AddressLines) > 0 { for iNdEx := len(m.AddressLines) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.AddressLines[iNdEx]) copy(dAtA[i:], m.AddressLines[iNdEx]) i = encodeVarintPostalAddress(dAtA, i, uint64(len(m.AddressLines[iNdEx]))) i-- dAtA[i] = 0x4a } } if len(m.Sublocality) > 0 { i -= len(m.Sublocality) copy(dAtA[i:], m.Sublocality) i = encodeVarintPostalAddress(dAtA, i, uint64(len(m.Sublocality))) i-- dAtA[i] = 0x42 } if len(m.Locality) > 0 { i -= len(m.Locality) copy(dAtA[i:], m.Locality) i = encodeVarintPostalAddress(dAtA, i, uint64(len(m.Locality))) i-- dAtA[i] = 0x3a } if len(m.AdministrativeArea) > 0 { i -= len(m.AdministrativeArea) copy(dAtA[i:], m.AdministrativeArea) i = encodeVarintPostalAddress(dAtA, i, uint64(len(m.AdministrativeArea))) i-- dAtA[i] = 0x32 } if len(m.SortingCode) > 0 { i -= len(m.SortingCode) copy(dAtA[i:], m.SortingCode) i = encodeVarintPostalAddress(dAtA, i, uint64(len(m.SortingCode))) i-- dAtA[i] = 0x2a } if len(m.PostalCode) > 0 { i -= len(m.PostalCode) copy(dAtA[i:], m.PostalCode) i = encodeVarintPostalAddress(dAtA, i, uint64(len(m.PostalCode))) i-- dAtA[i] = 0x22 } if len(m.LanguageCode) > 0 { i -= len(m.LanguageCode) copy(dAtA[i:], m.LanguageCode) i = encodeVarintPostalAddress(dAtA, i, uint64(len(m.LanguageCode))) i-- dAtA[i] = 0x1a } if len(m.RegionCode) > 0 { i -= len(m.RegionCode) copy(dAtA[i:], m.RegionCode) i = encodeVarintPostalAddress(dAtA, i, uint64(len(m.RegionCode))) i-- dAtA[i] = 0x12 } if m.Revision != 0 { i = encodeVarintPostalAddress(dAtA, i, uint64(m.Revision)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func encodeVarintPostalAddress(dAtA []byte, offset int, v uint64) int { offset -= sovPostalAddress(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedPostalAddress(r randyPostalAddress, easy bool) *PostalAddress { this := &PostalAddress{} this.Revision = int32(r.Int31()) if r.Intn(2) == 0 { this.Revision *= -1 } this.RegionCode = string(randStringPostalAddress(r)) this.LanguageCode = string(randStringPostalAddress(r)) this.PostalCode = string(randStringPostalAddress(r)) this.SortingCode = string(randStringPostalAddress(r)) this.AdministrativeArea = string(randStringPostalAddress(r)) this.Locality = string(randStringPostalAddress(r)) this.Sublocality = string(randStringPostalAddress(r)) v1 := r.Intn(10) this.AddressLines = make([]string, v1) for i := 0; i < v1; i++ { this.AddressLines[i] = string(randStringPostalAddress(r)) } v2 := r.Intn(10) this.Recipients = make([]string, v2) for i := 0; i < v2; i++ { this.Recipients[i] = string(randStringPostalAddress(r)) } this.Organization = string(randStringPostalAddress(r)) if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedPostalAddress(r, 12) } return this } type randyPostalAddress interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RunePostalAddress(r randyPostalAddress) 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 randStringPostalAddress(r randyPostalAddress) string { v3 := r.Intn(100) tmps := make([]rune, v3) for i := 0; i < v3; i++ { tmps[i] = randUTF8RunePostalAddress(r) } return string(tmps) } func randUnrecognizedPostalAddress(r randyPostalAddress, 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 = randFieldPostalAddress(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldPostalAddress(dAtA []byte, r randyPostalAddress, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulatePostalAddress(dAtA, uint64(key)) v4 := r.Int63() if r.Intn(2) == 0 { v4 *= -1 } dAtA = encodeVarintPopulatePostalAddress(dAtA, uint64(v4)) case 1: dAtA = encodeVarintPopulatePostalAddress(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 = encodeVarintPopulatePostalAddress(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulatePostalAddress(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulatePostalAddress(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 encodeVarintPopulatePostalAddress(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 *PostalAddress) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Revision != 0 { n += 1 + sovPostalAddress(uint64(m.Revision)) } l = len(m.RegionCode) if l > 0 { n += 1 + l + sovPostalAddress(uint64(l)) } l = len(m.LanguageCode) if l > 0 { n += 1 + l + sovPostalAddress(uint64(l)) } l = len(m.PostalCode) if l > 0 { n += 1 + l + sovPostalAddress(uint64(l)) } l = len(m.SortingCode) if l > 0 { n += 1 + l + sovPostalAddress(uint64(l)) } l = len(m.AdministrativeArea) if l > 0 { n += 1 + l + sovPostalAddress(uint64(l)) } l = len(m.Locality) if l > 0 { n += 1 + l + sovPostalAddress(uint64(l)) } l = len(m.Sublocality) if l > 0 { n += 1 + l + sovPostalAddress(uint64(l)) } if len(m.AddressLines) > 0 { for _, s := range m.AddressLines { l = len(s) n += 1 + l + sovPostalAddress(uint64(l)) } } if len(m.Recipients) > 0 { for _, s := range m.Recipients { l = len(s) n += 1 + l + sovPostalAddress(uint64(l)) } } l = len(m.Organization) if l > 0 { n += 1 + l + sovPostalAddress(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovPostalAddress(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozPostalAddress(x uint64) (n int) { return sovPostalAddress(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *PostalAddress) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PostalAddress{`, `Revision:` + fmt.Sprintf("%v", this.Revision) + `,`, `RegionCode:` + fmt.Sprintf("%v", this.RegionCode) + `,`, `LanguageCode:` + fmt.Sprintf("%v", this.LanguageCode) + `,`, `PostalCode:` + fmt.Sprintf("%v", this.PostalCode) + `,`, `SortingCode:` + fmt.Sprintf("%v", this.SortingCode) + `,`, `AdministrativeArea:` + fmt.Sprintf("%v", this.AdministrativeArea) + `,`, `Locality:` + fmt.Sprintf("%v", this.Locality) + `,`, `Sublocality:` + fmt.Sprintf("%v", this.Sublocality) + `,`, `AddressLines:` + fmt.Sprintf("%v", this.AddressLines) + `,`, `Recipients:` + fmt.Sprintf("%v", this.Recipients) + `,`, `Organization:` + fmt.Sprintf("%v", this.Organization) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringPostalAddress(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *PostalAddress) 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 ErrIntOverflowPostalAddress } 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: PostalAddress: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PostalAddress: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) } m.Revision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPostalAddress } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Revision |= int32(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RegionCode", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPostalAddress } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPostalAddress } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPostalAddress } if postIndex > l { return io.ErrUnexpectedEOF } m.RegionCode = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LanguageCode", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPostalAddress } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPostalAddress } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPostalAddress } if postIndex > l { return io.ErrUnexpectedEOF } m.LanguageCode = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PostalCode", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPostalAddress } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPostalAddress } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPostalAddress } if postIndex > l { return io.ErrUnexpectedEOF } m.PostalCode = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SortingCode", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPostalAddress } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPostalAddress } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPostalAddress } if postIndex > l { return io.ErrUnexpectedEOF } m.SortingCode = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AdministrativeArea", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPostalAddress } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPostalAddress } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPostalAddress } if postIndex > l { return io.ErrUnexpectedEOF } m.AdministrativeArea = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Locality", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPostalAddress } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPostalAddress } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPostalAddress } if postIndex > l { return io.ErrUnexpectedEOF } m.Locality = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Sublocality", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPostalAddress } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPostalAddress } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPostalAddress } if postIndex > l { return io.ErrUnexpectedEOF } m.Sublocality = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AddressLines", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPostalAddress } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPostalAddress } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPostalAddress } if postIndex > l { return io.ErrUnexpectedEOF } m.AddressLines = append(m.AddressLines, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Recipients", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPostalAddress } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPostalAddress } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPostalAddress } if postIndex > l { return io.ErrUnexpectedEOF } m.Recipients = append(m.Recipients, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Organization", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPostalAddress } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPostalAddress } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPostalAddress } if postIndex > l { return io.ErrUnexpectedEOF } m.Organization = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPostalAddress(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPostalAddress } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPostalAddress } 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 skipPostalAddress(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, ErrIntOverflowPostalAddress } 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, ErrIntOverflowPostalAddress } 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, ErrIntOverflowPostalAddress } 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, ErrInvalidLengthPostalAddress } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupPostalAddress } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthPostalAddress } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthPostalAddress = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowPostalAddress = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupPostalAddress = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/type/postal_address.proto000066400000000000000000000140351365205541600222100ustar00rootroot00000000000000// 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 = "type"; option java_multiple_files = true; option java_outer_classname = "PostalAddressProto"; option java_package = "com.google.type"; option objc_class_prefix = "GTP"; // Represents a postal address, e.g. for postal delivery or payments addresses. // Given a postal address, a postal service can deliver items to a premise, P.O. // Box or similar. // It is not intended to model geographical locations (roads, towns, // mountains). // // In typical usage an address would be created via user input or from importing // existing data, depending on the type of process. // // Advice on address input / editing: // - Use an i18n-ready address widget such as // https://github.com/google/libaddressinput) // - Users should not be presented with UI elements for input or editing of // fields outside countries where that field is used. // // For more guidance on how to use this schema, please see: // https://support.google.com/business/answer/6397478 message PostalAddress { // The schema revision of the `PostalAddress`. This must be set to 0, which is // the latest revision. // // All new revisions **must** be backward compatible with old revisions. int32 revision = 1; // Required. CLDR region code of the country/region of the address. This // is never inferred and it is up to the user to ensure the value is // correct. See http://cldr.unicode.org/ and // http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html // for details. Example: "CH" for Switzerland. string region_code = 2; // Optional. BCP-47 language code of the contents of this address (if // known). This is often the UI language of the input form or is expected // to match one of the languages used in the address' country/region, or their // transliterated equivalents. // This can affect formatting in certain countries, but is not critical // to the correctness of the data and will never affect any validation or // other non-formatting related operations. // // If this value is not known, it should be omitted (rather than specifying a // possibly incorrect default). // // Examples: "zh-Hant", "ja", "ja-Latn", "en". string language_code = 3; // Optional. Postal code of the address. Not all countries use or require // postal codes to be present, but where they are used, they may trigger // additional validation with other parts of the address (e.g. state/zip // validation in the U.S.A.). string postal_code = 4; // Optional. Additional, country-specific, sorting code. This is not used // in most regions. Where it is used, the value is either a string like // "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number // alone, representing the "sector code" (Jamaica), "delivery area indicator" // (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). string sorting_code = 5; // Optional. Highest administrative subdivision which is used for postal // addresses of a country or region. // For example, this can be a state, a province, an oblast, or a prefecture. // Specifically, for Spain this is the province and not the autonomous // community (e.g. "Barcelona" and not "Catalonia"). // Many countries don't use an administrative area in postal addresses. E.g. // in Switzerland this should be left unpopulated. string administrative_area = 6; // Optional. Generally refers to the city/town portion of the address. // Examples: US city, IT comune, UK post town. // In regions of the world where localities are not well defined or do not fit // into this structure well, leave locality empty and use address_lines. string locality = 7; // Optional. Sublocality of the address. // For example, this can be neighborhoods, boroughs, districts. string sublocality = 8; // Unstructured address lines describing the lower levels of an address. // // Because values in address_lines do not have type information and may // sometimes contain multiple values in a single field (e.g. // "Austin, TX"), it is important that the line order is clear. The order of // address lines should be "envelope order" for the country/region of the // address. In places where this can vary (e.g. Japan), address_language is // used to make it explicit (e.g. "ja" for large-to-small ordering and // "ja-Latn" or "en" for small-to-large). This way, the most specific line of // an address can be selected based on the language. // // The minimum permitted structural representation of an address consists // of a region_code with all remaining information placed in the // address_lines. It would be possible to format such an address very // approximately without geocoding, but no semantic reasoning could be // made about any of the address components until it was at least // partially resolved. // // Creating an address only containing a region_code and address_lines, and // then geocoding is the recommended way to handle completely unstructured // addresses (as opposed to guessing which parts of the address should be // localities or administrative areas). repeated string address_lines = 9; // Optional. The recipient at the address. // This field may, under certain circumstances, contain multiline information. // For example, it might contain "care of" information. repeated string recipients = 10; // Optional. The name of the organization at the address. string organization = 11; } googleapis-1.4.0/google/type/quaternion.pb.go000066400000000000000000000427451365205541600212410ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/type/quaternion.proto package _type import ( bytes "bytes" encoding_binary "encoding/binary" fmt "fmt" 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 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. // type Quaternion struct { // The x component. X float64 `protobuf:"fixed64,1,opt,name=x,proto3" json:"x,omitempty"` // The y component. Y float64 `protobuf:"fixed64,2,opt,name=y,proto3" json:"y,omitempty"` // The z component. Z float64 `protobuf:"fixed64,3,opt,name=z,proto3" json:"z,omitempty"` // The scalar component. W float64 `protobuf:"fixed64,4,opt,name=w,proto3" json:"w,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Quaternion) Reset() { *m = Quaternion{} } func (*Quaternion) ProtoMessage() {} func (*Quaternion) Descriptor() ([]byte, []int) { return fileDescriptor_6b847e1bdd83ff5e, []int{0} } func (m *Quaternion) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Quaternion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Quaternion.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 *Quaternion) XXX_Merge(src proto.Message) { xxx_messageInfo_Quaternion.Merge(m, src) } func (m *Quaternion) XXX_Size() int { return m.Size() } func (m *Quaternion) XXX_DiscardUnknown() { xxx_messageInfo_Quaternion.DiscardUnknown(m) } var xxx_messageInfo_Quaternion proto.InternalMessageInfo func (m *Quaternion) GetX() float64 { if m != nil { return m.X } return 0 } func (m *Quaternion) GetY() float64 { if m != nil { return m.Y } return 0 } func (m *Quaternion) GetZ() float64 { if m != nil { return m.Z } return 0 } func (m *Quaternion) GetW() float64 { if m != nil { return m.W } return 0 } func (*Quaternion) XXX_MessageName() string { return "google.type.Quaternion" } func init() { proto.RegisterType((*Quaternion)(nil), "google.type.Quaternion") } func init() { proto.RegisterFile("google/type/quaternion.proto", fileDescriptor_6b847e1bdd83ff5e) } var fileDescriptor_6b847e1bdd83ff5e = []byte{ // 191 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0x2f, 0x2c, 0x4d, 0x2c, 0x49, 0x2d, 0xca, 0xcb, 0xcc, 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0xc8, 0xea, 0x81, 0x64, 0x95, 0x5c, 0xb8, 0xb8, 0x02, 0xe1, 0x0a, 0x84, 0x78, 0xb8, 0x18, 0x2b, 0x24, 0x18, 0x15, 0x18, 0x35, 0x18, 0x83, 0x18, 0x2b, 0x40, 0xbc, 0x4a, 0x09, 0x26, 0x08, 0xaf, 0x12, 0xc4, 0xab, 0x92, 0x60, 0x86, 0xf0, 0xaa, 0x40, 0xbc, 0x72, 0x09, 0x16, 0x08, 0xaf, 0xdc, 0x29, 0xf9, 0xc6, 0x43, 0x39, 0x86, 0x0f, 0x0f, 0xe5, 0x18, 0x7f, 0x3c, 0x94, 0x63, 0x6c, 0x78, 0x24, 0xc7, 0xb8, 0xe2, 0x91, 0x1c, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0xf8, 0xe2, 0x91, 0x1c, 0xc3, 0x07, 0x90, 0xf8, 0x63, 0x39, 0xc6, 0x13, 0x8f, 0xe5, 0x18, 0xb9, 0xf8, 0x93, 0xf3, 0x73, 0xf5, 0x90, 0x1c, 0xe2, 0xc4, 0x8f, 0x70, 0x46, 0x00, 0xc8, 0x99, 0x01, 0x8c, 0x51, 0x2c, 0x20, 0x89, 0x1f, 0x8c, 0x8c, 0x8b, 0x98, 0x98, 0xdd, 0x43, 0x02, 0x92, 0xd8, 0xc0, 0xce, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xe8, 0xce, 0x8f, 0x8b, 0xde, 0x00, 0x00, 0x00, } func (this *Quaternion) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*Quaternion) if !ok { that2, ok := that.(Quaternion) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.X != that1.X { if this.X < that1.X { return -1 } return 1 } if this.Y != that1.Y { if this.Y < that1.Y { return -1 } return 1 } if this.Z != that1.Z { if this.Z < that1.Z { return -1 } return 1 } if this.W != that1.W { if this.W < that1.W { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *Quaternion) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Quaternion) if !ok { that2, ok := that.(Quaternion) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.X != that1.X { return false } if this.Y != that1.Y { return false } if this.Z != that1.Z { return false } if this.W != that1.W { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *Quaternion) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 8) s = append(s, "&_type.Quaternion{") s = append(s, "X: "+fmt.Sprintf("%#v", this.X)+",\n") s = append(s, "Y: "+fmt.Sprintf("%#v", this.Y)+",\n") s = append(s, "Z: "+fmt.Sprintf("%#v", this.Z)+",\n") s = append(s, "W: "+fmt.Sprintf("%#v", this.W)+",\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 valueToGoStringQuaternion(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 *Quaternion) 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 *Quaternion) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Quaternion) 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.W != 0 { i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.W)))) i-- dAtA[i] = 0x21 } if m.Z != 0 { i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Z)))) i-- dAtA[i] = 0x19 } if m.Y != 0 { i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Y)))) i-- dAtA[i] = 0x11 } if m.X != 0 { i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.X)))) i-- dAtA[i] = 0x9 } return len(dAtA) - i, nil } func encodeVarintQuaternion(dAtA []byte, offset int, v uint64) int { offset -= sovQuaternion(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedQuaternion(r randyQuaternion, easy bool) *Quaternion { this := &Quaternion{} this.X = float64(r.Float64()) if r.Intn(2) == 0 { this.X *= -1 } this.Y = float64(r.Float64()) if r.Intn(2) == 0 { this.Y *= -1 } this.Z = float64(r.Float64()) if r.Intn(2) == 0 { this.Z *= -1 } this.W = float64(r.Float64()) if r.Intn(2) == 0 { this.W *= -1 } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedQuaternion(r, 5) } return this } type randyQuaternion interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneQuaternion(r randyQuaternion) 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 randStringQuaternion(r randyQuaternion) string { v1 := r.Intn(100) tmps := make([]rune, v1) for i := 0; i < v1; i++ { tmps[i] = randUTF8RuneQuaternion(r) } return string(tmps) } func randUnrecognizedQuaternion(r randyQuaternion, 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 = randFieldQuaternion(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldQuaternion(dAtA []byte, r randyQuaternion, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateQuaternion(dAtA, uint64(key)) v2 := r.Int63() if r.Intn(2) == 0 { v2 *= -1 } dAtA = encodeVarintPopulateQuaternion(dAtA, uint64(v2)) case 1: dAtA = encodeVarintPopulateQuaternion(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 = encodeVarintPopulateQuaternion(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateQuaternion(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateQuaternion(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 encodeVarintPopulateQuaternion(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 *Quaternion) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.X != 0 { n += 9 } if m.Y != 0 { n += 9 } if m.Z != 0 { n += 9 } if m.W != 0 { n += 9 } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovQuaternion(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozQuaternion(x uint64) (n int) { return sovQuaternion(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *Quaternion) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Quaternion{`, `X:` + fmt.Sprintf("%v", this.X) + `,`, `Y:` + fmt.Sprintf("%v", this.Y) + `,`, `Z:` + fmt.Sprintf("%v", this.Z) + `,`, `W:` + fmt.Sprintf("%v", this.W) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringQuaternion(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *Quaternion) 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 ErrIntOverflowQuaternion } 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: Quaternion: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Quaternion: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) } var v uint64 if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 m.X = float64(math.Float64frombits(v)) case 2: if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field Y", wireType) } var v uint64 if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 m.Y = float64(math.Float64frombits(v)) case 3: if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field Z", wireType) } var v uint64 if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 m.Z = float64(math.Float64frombits(v)) case 4: if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field W", wireType) } var v uint64 if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 m.W = float64(math.Float64frombits(v)) default: iNdEx = preIndex skippy, err := skipQuaternion(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthQuaternion } if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuaternion } 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 skipQuaternion(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, ErrIntOverflowQuaternion } 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, ErrIntOverflowQuaternion } 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, ErrIntOverflowQuaternion } 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, ErrInvalidLengthQuaternion } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupQuaternion } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthQuaternion } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthQuaternion = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowQuaternion = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupQuaternion = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/type/quaternion.proto000066400000000000000000000072271365205541600213730ustar00rootroot00000000000000// 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 = "type"; 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. // 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; } googleapis-1.4.0/google/type/timeofday.pb.go000066400000000000000000000401601365205541600210220ustar00rootroot00000000000000// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: google/type/timeofday.proto package _type import ( bytes "bytes" fmt "fmt" 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 // Represents a time of day. The date and time zone are either not significant // 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`. type TimeOfDay struct { // 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. Hours int32 `protobuf:"varint,1,opt,name=hours,proto3" json:"hours,omitempty"` // Minutes of hour of day. Must be from 0 to 59. Minutes int32 `protobuf:"varint,2,opt,name=minutes,proto3" json:"minutes,omitempty"` // Seconds of minutes of the time. Must normally be from 0 to 59. An API may // allow the value 60 if it allows leap-seconds. Seconds int32 `protobuf:"varint,3,opt,name=seconds,proto3" json:"seconds,omitempty"` // Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. Nanos int32 `protobuf:"varint,4,opt,name=nanos,proto3" json:"nanos,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *TimeOfDay) Reset() { *m = TimeOfDay{} } func (*TimeOfDay) ProtoMessage() {} func (*TimeOfDay) Descriptor() ([]byte, []int) { return fileDescriptor_6c354ab94588cebb, []int{0} } func (m *TimeOfDay) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *TimeOfDay) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_TimeOfDay.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 *TimeOfDay) XXX_Merge(src proto.Message) { xxx_messageInfo_TimeOfDay.Merge(m, src) } func (m *TimeOfDay) XXX_Size() int { return m.Size() } func (m *TimeOfDay) XXX_DiscardUnknown() { xxx_messageInfo_TimeOfDay.DiscardUnknown(m) } var xxx_messageInfo_TimeOfDay proto.InternalMessageInfo func (m *TimeOfDay) GetHours() int32 { if m != nil { return m.Hours } return 0 } func (m *TimeOfDay) GetMinutes() int32 { if m != nil { return m.Minutes } return 0 } func (m *TimeOfDay) GetSeconds() int32 { if m != nil { return m.Seconds } return 0 } func (m *TimeOfDay) GetNanos() int32 { if m != nil { return m.Nanos } return 0 } func (*TimeOfDay) XXX_MessageName() string { return "google.type.TimeOfDay" } func init() { proto.RegisterType((*TimeOfDay)(nil), "google.type.TimeOfDay") } func init() { proto.RegisterFile("google/type/timeofday.proto", fileDescriptor_6c354ab94588cebb) } var fileDescriptor_6c354ab94588cebb = []byte{ // 221 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0xd5, 0x2f, 0xc9, 0xcc, 0x4d, 0xcd, 0x4f, 0x4b, 0x49, 0xac, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x48, 0xea, 0x81, 0x24, 0x95, 0xb2, 0xb9, 0x38, 0x43, 0x32, 0x73, 0x53, 0xfd, 0xd3, 0x5c, 0x12, 0x2b, 0x85, 0x44, 0xb8, 0x58, 0x33, 0xf2, 0x4b, 0x8b, 0x8a, 0x25, 0x18, 0x15, 0x18, 0x35, 0x58, 0x83, 0x20, 0x1c, 0x21, 0x09, 0x2e, 0xf6, 0xdc, 0xcc, 0xbc, 0xd2, 0x92, 0xd4, 0x62, 0x09, 0x26, 0xb0, 0x38, 0x8c, 0x0b, 0x92, 0x29, 0x4e, 0x4d, 0xce, 0xcf, 0x4b, 0x29, 0x96, 0x60, 0x86, 0xc8, 0x40, 0xb9, 0x20, 0x93, 0xf2, 0x12, 0xf3, 0xf2, 0x8b, 0x25, 0x58, 0x20, 0x26, 0x81, 0x39, 0x4e, 0x49, 0x37, 0x1e, 0xca, 0x31, 0x7c, 0x78, 0x28, 0xc7, 0xf8, 0xe3, 0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, 0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x17, 0x8f, 0xe4, 0x18, 0x3e, 0x80, 0xc4, 0x1f, 0xcb, 0x31, 0x9e, 0x78, 0x2c, 0xc7, 0xc8, 0xc5, 0x9f, 0x9c, 0x9f, 0xab, 0x87, 0xe4, 0x5e, 0x27, 0x3e, 0xb8, 0x6b, 0x03, 0x40, 0x9e, 0x09, 0x60, 0x8c, 0x62, 0x01, 0x89, 0xff, 0x60, 0x64, 0x5c, 0xc4, 0xc4, 0xec, 0x1e, 0x12, 0x90, 0xc4, 0x06, 0xf6, 0xa4, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x7e, 0xc2, 0x1f, 0x03, 0x01, 0x00, 0x00, } func (this *TimeOfDay) Compare(that interface{}) int { if that == nil { if this == nil { return 0 } return 1 } that1, ok := that.(*TimeOfDay) if !ok { that2, ok := that.(TimeOfDay) if ok { that1 = &that2 } else { return 1 } } if that1 == nil { if this == nil { return 0 } return 1 } else if this == nil { return -1 } if this.Hours != that1.Hours { if this.Hours < that1.Hours { return -1 } return 1 } if this.Minutes != that1.Minutes { if this.Minutes < that1.Minutes { return -1 } return 1 } if this.Seconds != that1.Seconds { if this.Seconds < that1.Seconds { return -1 } return 1 } if this.Nanos != that1.Nanos { if this.Nanos < that1.Nanos { return -1 } return 1 } if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { return c } return 0 } func (this *TimeOfDay) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*TimeOfDay) if !ok { that2, ok := that.(TimeOfDay) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Hours != that1.Hours { return false } if this.Minutes != that1.Minutes { return false } if this.Seconds != that1.Seconds { return false } if this.Nanos != that1.Nanos { return false } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } return true } func (this *TimeOfDay) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 8) s = append(s, "&_type.TimeOfDay{") s = append(s, "Hours: "+fmt.Sprintf("%#v", this.Hours)+",\n") s = append(s, "Minutes: "+fmt.Sprintf("%#v", this.Minutes)+",\n") s = append(s, "Seconds: "+fmt.Sprintf("%#v", this.Seconds)+",\n") s = append(s, "Nanos: "+fmt.Sprintf("%#v", this.Nanos)+",\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 valueToGoStringTimeofday(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 *TimeOfDay) 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 *TimeOfDay) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *TimeOfDay) 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.Nanos != 0 { i = encodeVarintTimeofday(dAtA, i, uint64(m.Nanos)) i-- dAtA[i] = 0x20 } if m.Seconds != 0 { i = encodeVarintTimeofday(dAtA, i, uint64(m.Seconds)) i-- dAtA[i] = 0x18 } if m.Minutes != 0 { i = encodeVarintTimeofday(dAtA, i, uint64(m.Minutes)) i-- dAtA[i] = 0x10 } if m.Hours != 0 { i = encodeVarintTimeofday(dAtA, i, uint64(m.Hours)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func encodeVarintTimeofday(dAtA []byte, offset int, v uint64) int { offset -= sovTimeofday(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedTimeOfDay(r randyTimeofday, easy bool) *TimeOfDay { this := &TimeOfDay{} this.Hours = int32(r.Int31()) if r.Intn(2) == 0 { this.Hours *= -1 } this.Minutes = int32(r.Int31()) if r.Intn(2) == 0 { this.Minutes *= -1 } this.Seconds = int32(r.Int31()) if r.Intn(2) == 0 { this.Seconds *= -1 } this.Nanos = int32(r.Int31()) if r.Intn(2) == 0 { this.Nanos *= -1 } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedTimeofday(r, 5) } return this } type randyTimeofday interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RuneTimeofday(r randyTimeofday) 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 randStringTimeofday(r randyTimeofday) string { v1 := r.Intn(100) tmps := make([]rune, v1) for i := 0; i < v1; i++ { tmps[i] = randUTF8RuneTimeofday(r) } return string(tmps) } func randUnrecognizedTimeofday(r randyTimeofday, 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 = randFieldTimeofday(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldTimeofday(dAtA []byte, r randyTimeofday, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulateTimeofday(dAtA, uint64(key)) v2 := r.Int63() if r.Intn(2) == 0 { v2 *= -1 } dAtA = encodeVarintPopulateTimeofday(dAtA, uint64(v2)) case 1: dAtA = encodeVarintPopulateTimeofday(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 = encodeVarintPopulateTimeofday(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulateTimeofday(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulateTimeofday(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 encodeVarintPopulateTimeofday(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 *TimeOfDay) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Hours != 0 { n += 1 + sovTimeofday(uint64(m.Hours)) } if m.Minutes != 0 { n += 1 + sovTimeofday(uint64(m.Minutes)) } if m.Seconds != 0 { n += 1 + sovTimeofday(uint64(m.Seconds)) } if m.Nanos != 0 { n += 1 + sovTimeofday(uint64(m.Nanos)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovTimeofday(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozTimeofday(x uint64) (n int) { return sovTimeofday(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *TimeOfDay) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&TimeOfDay{`, `Hours:` + fmt.Sprintf("%v", this.Hours) + `,`, `Minutes:` + fmt.Sprintf("%v", this.Minutes) + `,`, `Seconds:` + fmt.Sprintf("%v", this.Seconds) + `,`, `Nanos:` + fmt.Sprintf("%v", this.Nanos) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") return s } func valueToStringTimeofday(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *TimeOfDay) 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 ErrIntOverflowTimeofday } 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: TimeOfDay: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: TimeOfDay: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Hours", wireType) } m.Hours = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTimeofday } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Hours |= int32(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Minutes", wireType) } m.Minutes = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTimeofday } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Minutes |= int32(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Seconds", wireType) } m.Seconds = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTimeofday } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Seconds |= int32(b&0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Nanos", wireType) } m.Nanos = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTimeofday } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Nanos |= int32(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipTimeofday(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthTimeofday } if (iNdEx + skippy) < 0 { return ErrInvalidLengthTimeofday } 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 skipTimeofday(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, ErrIntOverflowTimeofday } 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, ErrIntOverflowTimeofday } 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, ErrIntOverflowTimeofday } 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, ErrInvalidLengthTimeofday } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupTimeofday } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthTimeofday } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthTimeofday = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTimeofday = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTimeofday = fmt.Errorf("proto: unexpected end of group") ) googleapis-1.4.0/google/type/timeofday.proto000066400000000000000000000031121365205541600211540ustar00rootroot00000000000000// 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 = "type"; 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 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. int32 hours = 1; // Minutes of hour of day. Must be from 0 to 59. int32 minutes = 2; // Seconds of minutes of the time. Must normally be from 0 to 59. An API may // allow the value 60 if it allows leap-seconds. int32 seconds = 3; // Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. int32 nanos = 4; } googleapis-1.4.0/install-protobuf.sh000077500000000000000000000003741365205541600175230ustar00rootroot00000000000000#!/usr/bin/env bash set -ex cd /home/travis VERSION=3.9.1 wget https://github.com/protocolbuffers/protobuf/releases/download/v$VERSION/protoc-$VERSION-linux-x86_64.zip unzip protoc-$VERSION-linux-x86_64.zip rm -rf protoc-$VERSION-linux-x86_64.zip googleapis-1.4.0/protoc-gen-gogogoogleapis/000077500000000000000000000000001365205541600207345ustar00rootroot00000000000000googleapis-1.4.0/protoc-gen-gogogoogleapis/main.go000066400000000000000000000041701365205541600222110ustar00rootroot00000000000000// Copyright (c) 2018, The GoGo Authors. // // 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. package main import ( "strings" "github.com/gogo/protobuf/vanity" "github.com/gogo/protobuf/vanity/command" ) func main() { req := command.Read() files := req.GetProtoFile() files = vanity.FilterFiles(files, vanity.NotGoogleProtobufDescriptorProto) vanity.ForEachFile(files, vanity.TurnOnMarshalerAll) vanity.ForEachFile(files, vanity.TurnOnSizerAll) vanity.ForEachFile(files, vanity.TurnOnUnmarshalerAll) for _, file := range files { if strings.HasPrefix(file.GetName(), "google/rpc") { vanity.TurnOffGoEnumPrefixAll(file) } } vanity.ForEachFile(files, vanity.TurnOffGoEnumStringerAll) vanity.ForEachFile(files, vanity.TurnOnEnumStringerAll) vanity.ForEachFile(files, vanity.TurnOnEqualAll) vanity.ForEachFile(files, vanity.TurnOnGoStringAll) vanity.ForEachFile(files, vanity.TurnOffGoStringerAll) vanity.ForEachFile(files, vanity.TurnOnMessageNameAll) for _, file := range files { if strings.HasSuffix(file.GetName(), "annotations.proto") { continue } if strings.HasSuffix(file.GetName(), "datetime.proto") { continue } if strings.HasSuffix(file.GetName(), "http.proto") { continue } if strings.HasPrefix(file.GetName(), "google/api/expr/v1alpha1") { continue } if strings.HasSuffix(file.GetName(), "operations.proto") { continue } if strings.HasSuffix(file.GetName(), "viewport.proto") { continue } vanity.TurnOnCompareAll(file) } for _, file := range files { vanity.TurnOnStringerAll(file) vanity.TurnOnPopulateAll(file) } resp := command.Generate(req) command.Write(resp) }