From 5966977384944e5e3eac4572761a35299c374443 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 14 Sep 2021 15:24:02 +0200 Subject: [PATCH 01/46] Squash history into first public commit --- .gitignore | 78 ++ LICENSE | 174 +++ Makefile | 82 ++ README.md | 92 ++ annotations.proto | 103 ++ annotations/annotations.pb.go | 852 +++++++++++++ cmd/protoc-gen-go-json/main.go | 40 + go.mod | 10 + go.sum | 54 + gogo/gogo.go | 350 ++++++ golang/golang.go | 333 ++++++ internal/gen/enums.go | 75 ++ internal/gen/enums_marshaler.go | 93 ++ internal/gen/enums_unmarshaler.go | 88 ++ internal/gen/gen.go | 111 ++ internal/gen/messages.go | 209 ++++ internal/gen/messages_marshaler.go | 477 ++++++++ internal/gen/messages_unmarshaler.go | 455 +++++++ internal/gogoproto/gogo.pb.go | 1299 ++++++++++++++++++++ internal/gogoproto/gogo.proto | 143 +++ jsonplugin/field_mask.go | 94 ++ jsonplugin/marshal.go | 549 +++++++++ jsonplugin/marshal_test.go | 153 +++ jsonplugin/plugin.go | 30 + jsonplugin/unmarshal.go | 648 ++++++++++ jsonplugin/unmarshal_test.go | 241 ++++ test/api.proto | 8 + test/enums.proto | 61 + test/gogo.proto | 102 ++ test/gogo/api.pb.go | 34 + test/gogo/enums.gogo_overrides.go | 65 + test/gogo/enums.pb.go | 333 ++++++ test/gogo/enums_json.pb.go | 229 ++++ test/gogo/enums_test.go | 172 +++ test/gogo/gogo.pb.go | 364 ++++++ test/gogo/gogo_json.pb.go | 347 ++++++ test/gogo/gogo_test.go | 280 +++++ test/gogo/scalars.pb.go | 903 ++++++++++++++ test/gogo/scalars_json.pb.go | 930 +++++++++++++++ test/gogo/scalars_test.go | 598 ++++++++++ test/gogo/utils_test.go | 136 +++ test/gogo/wkts.pb.go | 972 +++++++++++++++ test/gogo/wkts_json.pb.go | 1640 +++++++++++++++++++++++++ test/gogo/wkts_test.go | 828 +++++++++++++ test/golang/api.pb.go | 68 ++ test/golang/enums.pb.go | 534 +++++++++ test/golang/enums_json.pb.go | 229 ++++ test/golang/enums_test.go | 172 +++ test/golang/gogo.pb.go | 704 +++++++++++ test/golang/gogo_json.pb.go | 348 ++++++ test/golang/gogo_test.go | 262 ++++ test/golang/scalars.pb.go | 1380 +++++++++++++++++++++ test/golang/scalars_json.pb.go | 930 +++++++++++++++ test/golang/scalars_test.go | 598 ++++++++++ test/golang/utils_test.go | 104 ++ test/golang/wkts.pb.go | 1612 +++++++++++++++++++++++++ test/golang/wkts_json.pb.go | 1646 ++++++++++++++++++++++++++ test/golang/wkts_test.go | 830 +++++++++++++ test/scalars.proto | 126 ++ test/types/eui.go | 110 ++ test/wkts.proto | 125 ++ 61 files changed, 24613 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README.md create mode 100644 annotations.proto create mode 100644 annotations/annotations.pb.go create mode 100644 cmd/protoc-gen-go-json/main.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 gogo/gogo.go create mode 100644 golang/golang.go create mode 100644 internal/gen/enums.go create mode 100644 internal/gen/enums_marshaler.go create mode 100644 internal/gen/enums_unmarshaler.go create mode 100644 internal/gen/gen.go create mode 100644 internal/gen/messages.go create mode 100644 internal/gen/messages_marshaler.go create mode 100644 internal/gen/messages_unmarshaler.go create mode 100644 internal/gogoproto/gogo.pb.go create mode 100644 internal/gogoproto/gogo.proto create mode 100644 jsonplugin/field_mask.go create mode 100644 jsonplugin/marshal.go create mode 100644 jsonplugin/marshal_test.go create mode 100644 jsonplugin/plugin.go create mode 100644 jsonplugin/unmarshal.go create mode 100644 jsonplugin/unmarshal_test.go create mode 100644 test/api.proto create mode 100644 test/enums.proto create mode 100644 test/gogo.proto create mode 100644 test/gogo/api.pb.go create mode 100644 test/gogo/enums.gogo_overrides.go create mode 100644 test/gogo/enums.pb.go create mode 100644 test/gogo/enums_json.pb.go create mode 100644 test/gogo/enums_test.go create mode 100644 test/gogo/gogo.pb.go create mode 100644 test/gogo/gogo_json.pb.go create mode 100644 test/gogo/gogo_test.go create mode 100644 test/gogo/scalars.pb.go create mode 100644 test/gogo/scalars_json.pb.go create mode 100644 test/gogo/scalars_test.go create mode 100644 test/gogo/utils_test.go create mode 100644 test/gogo/wkts.pb.go create mode 100644 test/gogo/wkts_json.pb.go create mode 100644 test/gogo/wkts_test.go create mode 100644 test/golang/api.pb.go create mode 100644 test/golang/enums.pb.go create mode 100644 test/golang/enums_json.pb.go create mode 100644 test/golang/enums_test.go create mode 100644 test/golang/gogo.pb.go create mode 100644 test/golang/gogo_json.pb.go create mode 100644 test/golang/gogo_test.go create mode 100644 test/golang/scalars.pb.go create mode 100644 test/golang/scalars_json.pb.go create mode 100644 test/golang/scalars_test.go create mode 100644 test/golang/utils_test.go create mode 100644 test/golang/wkts.pb.go create mode 100644 test/golang/wkts_json.pb.go create mode 100644 test/golang/wkts_test.go create mode 100644 test/scalars.proto create mode 100644 test/types/eui.go create mode 100644 test/wkts.proto diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..77d84fa7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,78 @@ +/.bin +/.dev + +# https://raw.githubusercontent.com/github/gitignore/master/Global/Linux.gitignore + +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# https://raw.githubusercontent.com/github/gitignore/master/Global/macOS.gitignore + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# https://raw.githubusercontent.com/github/gitignore/master/Global/VisualStudioCode.gitignore + +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# https://raw.githubusercontent.com/github/gitignore/master/Go.gitignore + +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..dd5b3a58 --- /dev/null +++ b/LICENSE @@ -0,0 +1,174 @@ + Apache 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. diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..1b0fe560 --- /dev/null +++ b/Makefile @@ -0,0 +1,82 @@ +# Copyright © 2021 The Things Industries B.V. +# SPDX-License-Identifier: Apache-2.0 + +.PHONY: default + +default: build test + +.PHONY: clean + +clean: + rm -f ./annotations/*.pb.go + rm -f ./test/*/*.pb.go + +annotations/annotations.pb.go: annotations.proto + protoc -I . --go_opt=paths=source_relative --go_out=./annotations ./annotations.proto + +internal/gogoproto/gogo.pb.go: internal/gogoproto/gogo.proto + protoc -I . --go_opt=paths=source_relative --go_out=./ ./internal/gogoproto/gogo.proto + +BINARY_DEPS = annotations/annotations.pb.go internal/gogoproto/gogo.pb.go $(wildcard cmd/protoc-gen-go-json/*.go) $(wildcard internal/gen/*.go) + +VERSION ?= 0.0.0-dev + +LDFLAGS = -X github.com/TheThingsIndustries/protoc-gen-go-json/internal/gen.Version=$(VERSION) + +.bin/protoc-gen-go-json: $(BINARY_DEPS) + CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" -o $@ ./cmd/protoc-gen-go-json + +.bin/protoc-gen-go-json-linux-amd64: $(BINARY_DEPS) + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o $@ ./cmd/protoc-gen-go-json + +.bin/protoc-gen-go-json-linux-arm64: $(BINARY_DEPS) + CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o $@ ./cmd/protoc-gen-go-json + +REPLACES = Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor,Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types + +.PHONY: build + +build: .bin/protoc-gen-go-json .bin/protoc-gen-go-json-linux-amd64 .bin/protoc-gen-go-json-linux-arm64 + +.PHONY: watch + +watch: + ls annotations.proto cmd/protoc-gen-go-json/*.go internal/gen/*.go test/*.proto | entr make build test + +OS := +ifeq ($(shell uname -o),Linux) + OS = linux +endif +ifeq ($(shell uname -o),Darwin) + OS = osx +endif + +.dev/golangproto/bin/protoc: + mkdir -p .dev/golangproto/bin + curl -sSL -o .dev/golangproto/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protoc-3.17.3-$(OS)-x86_64.zip + unzip -o .dev/golangproto/protoc.zip -d .dev/golangproto/ + +.dev/gogoproto/bin/protoc: + mkdir -p .dev/gogoproto/bin + curl -sSL -o .dev/gogoproto/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.9.1/protoc-3.9.1-$(OS)-x86_64.zip + unzip -o .dev/gogoproto/protoc.zip -d .dev/gogoproto/ + curl -sSL -o .dev/gogoproto/gogoproto.zip https://github.com/gogo/protobuf/archive/refs/heads/master.zip + unzip -o .dev/gogoproto/gogoproto.zip protobuf-master/protobuf/google/protobuf/*.proto -d .dev/gogoproto + mv .dev/gogoproto/protobuf-master/protobuf/google/protobuf/*.proto .dev/gogoproto/include/google/protobuf/ + +.PHONY: testprotos + +testprotos: build .dev/golangproto/bin/protoc .dev/gogoproto/bin/protoc + PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I ./test -I . \ + --go_opt=paths=source_relative --go_out=./test/golang \ + --go-json_opt=paths=source_relative --go-json_out=./test/golang \ + ./test/*.proto + PATH="$$PWD/.bin:$$PWD/.dev/gogoproto/bin:$$PATH" protoc -I ./test -I . \ + --gogo_opt=paths=source_relative --gogo_opt=$(REPLACES) --gogo_out=./test/gogo \ + --go-json_opt=paths=source_relative --go-json_opt=$(REPLACES) --go-json_opt=lang=gogo --go-json_out=./test/gogo \ + ./test/*.proto + +.PHONY: test + +test: testprotos + go test ./jsonplugin ./test/gogo ./test/golang diff --git a/README.md b/README.md new file mode 100644 index 00000000..accc7109 --- /dev/null +++ b/README.md @@ -0,0 +1,92 @@ +# protoc-gen-go-json + +> Protoc plugin for generating JSON marshalers and unmarshalers in Go + +## Background + +The API of The Things Stack V3 is not compliant with the latest `protojson` package because we used github.com/gogo/protobuf with custom types and custom JSON marshalers. We do want to upgrade to the V2 protobuf library, but also not break the API of The Things Stack. Therefore we'll now generate our own JSON marshalers and unmarshalers. + +## Usage in Proto Code + +```proto +syntax = "proto3"; + +import "github.com/TheThingsIndustries/protoc-gen-go-json/annotations.proto"; + +package thethings.json.example; + +option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/example"; + +option (thethings.json.file) = { + marshaler_all: true, // Generate marshalers for everything in the file. + unmarshaler_all: true, // Generate unmarshalers for everything in the file. +}; + +// This is an enum with custom JSON marshaling. +enum MyCustomEnum { + option (thethings.json.enum) = { + marshal_as_string: true, // The marshaler will render values as strings. + prefix: "CUSTOM" // The unmarshaler will accept both UNKNOWN and CUSTOM_UNKNOWN, etc. + }; + + CUSTOM_UNKNOWN = 0; + CUSTOM_V1_0 = 1 [ + (thethings.json.enum_value) = { + value: "1.0", // The marshaler will render this value as "1.0". + aliases: ["1.0.0"] // The unmarshaler will also accept "1.0.0". + } + ]; + CUSTOM_V1_0_1 = 2 [ + (thethings.json.enum_value) = { + value: "1.0.1" // The marshaler will render this value as "1.0.1". + } + ]; +} + +message CustomEnumWrapper { + option (thethings.json.message) = { + wrapper: true // This message acts as a wrapper WKT. + }; + CustomEnum value = 1; +} + +message MessageWithCustomRenderedField { + bytes hex_field = 1 [ + (thethings.json.field) = { + marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEX", + unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEX" + } + ]; +} +``` + +## Generating Go Code + +```bash +$ protoc -I ./path/to -I . \ + --go_opt=paths=source_relative --go_out=./path/to \ + --go-json_opt=paths=source_relative --go-json_out=./path/to \ + ./path/to/*.proto +``` + +## Usage in Go Code + +```go +data, err := jsonplugin.MarshalerConfig{ + // config ... +}.Marshal(msg) +``` + +```go +err := jsonplugin.UnmarshalerConfig{ + // config... +}.Unmarshal(data, msg) +``` + +## Contributing + +We do not accept external issues with feature requests. This plugin only supports what we actually use ourselves at The Things Industries. + +We do not accept external pull requests with new features, but everyone is free to fork it and add features in their own fork. + +We do accept issues with bug reports and pull requests with bug fixes. diff --git a/annotations.proto b/annotations.proto new file mode 100644 index 00000000..1a59f4b3 --- /dev/null +++ b/annotations.proto @@ -0,0 +1,103 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +syntax = "proto2"; + +package thethings.json; + +option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/annotations"; + +import "google/protobuf/descriptor.proto"; + +// TODO: The extension number 1885 is temporary. +// It will change after we register an extension number on +// https://github.com/protocolbuffers/protobuf/blob/master/docs/options.md. + +message FileOptions { + // Generate marshalers for all messages and enums in this file. + // Message options can be used to override this. + optional bool marshaler_all = 1; + // Generate unmarshalers for all messages and enums in this file. + // Message options can be used to override this. + optional bool unmarshaler_all = 2; +} + +extend google.protobuf.FileOptions { + optional FileOptions file = 1885; +} + +message MessageOptions { + // Generate a marshaler for this message. + optional bool marshaler = 1; + // Generate an unmarshaler for this message. + optional bool unmarshaler = 2; + // Treat this message as a wrapper for the value field inside it. + optional bool wrapper = 3; +} + +extend google.protobuf.MessageOptions { + optional MessageOptions message = 1885; +} + +message FieldOptions { + // Custom marshaler function. Specified as github.com/username/repo/package.FuncName. + optional string marshaler_func = 1; + // Custom unmarshaler function. Specified as github.com/username/repo/package.FuncName. + optional string unmarshaler_func = 2; +} + +extend google.protobuf.FieldOptions { + optional FieldOptions field = 1885; +} + +message OneofOptions { + +} + +extend google.protobuf.OneofOptions { + optional OneofOptions oneof = 1885; +} + +message EnumOptions { + // Generate a marshaler for this enum. + optional bool marshaler = 1; + // Always marshal as a number. + optional bool marshal_as_number = 2; + // Always marshal as a string. + optional bool marshal_as_string = 3; + // Generate an unmarshaler for this enum. + optional bool unmarshaler = 4; + // Consider string values with this prefix when unmarshaling. + optional string prefix = 5; +} + +extend google.protobuf.EnumOptions { + optional EnumOptions enum = 1885; +} + +message EnumValueOptions { + // The value to emit when marshaling as string. + optional string value = 1; + // Aliases to accept when unmarshaling from string. + repeated string aliases = 2; +} + +extend google.protobuf.EnumValueOptions { + optional EnumValueOptions enum_value = 1885; +} + +message ServiceOptions { + +} + +extend google.protobuf.ServiceOptions { + optional ServiceOptions service = 1885; +} + +message MethodOptions { + +} + +extend google.protobuf.MethodOptions { + optional MethodOptions method = 1885; +} diff --git a/annotations/annotations.pb.go b/annotations/annotations.pb.go new file mode 100644 index 00000000..da2acc56 --- /dev/null +++ b/annotations/annotations.pb.go @@ -0,0 +1,852 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.17.3 +// source: annotations.proto + +package annotations + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type FileOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Generate marshalers for all messages and enums in this file. + // Message options can be used to override this. + MarshalerAll *bool `protobuf:"varint,1,opt,name=marshaler_all,json=marshalerAll" json:"marshaler_all,omitempty"` + // Generate unmarshalers for all messages and enums in this file. + // Message options can be used to override this. + UnmarshalerAll *bool `protobuf:"varint,2,opt,name=unmarshaler_all,json=unmarshalerAll" json:"unmarshaler_all,omitempty"` +} + +func (x *FileOptions) Reset() { + *x = FileOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_annotations_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FileOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FileOptions) ProtoMessage() {} + +func (x *FileOptions) ProtoReflect() protoreflect.Message { + mi := &file_annotations_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FileOptions.ProtoReflect.Descriptor instead. +func (*FileOptions) Descriptor() ([]byte, []int) { + return file_annotations_proto_rawDescGZIP(), []int{0} +} + +func (x *FileOptions) GetMarshalerAll() bool { + if x != nil && x.MarshalerAll != nil { + return *x.MarshalerAll + } + return false +} + +func (x *FileOptions) GetUnmarshalerAll() bool { + if x != nil && x.UnmarshalerAll != nil { + return *x.UnmarshalerAll + } + return false +} + +type MessageOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Generate a marshaler for this message. + Marshaler *bool `protobuf:"varint,1,opt,name=marshaler" json:"marshaler,omitempty"` + // Generate an unmarshaler for this message. + Unmarshaler *bool `protobuf:"varint,2,opt,name=unmarshaler" json:"unmarshaler,omitempty"` + // Treat this message as a wrapper for the value field inside it. + Wrapper *bool `protobuf:"varint,3,opt,name=wrapper" json:"wrapper,omitempty"` +} + +func (x *MessageOptions) Reset() { + *x = MessageOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_annotations_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageOptions) ProtoMessage() {} + +func (x *MessageOptions) ProtoReflect() protoreflect.Message { + mi := &file_annotations_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageOptions.ProtoReflect.Descriptor instead. +func (*MessageOptions) Descriptor() ([]byte, []int) { + return file_annotations_proto_rawDescGZIP(), []int{1} +} + +func (x *MessageOptions) GetMarshaler() bool { + if x != nil && x.Marshaler != nil { + return *x.Marshaler + } + return false +} + +func (x *MessageOptions) GetUnmarshaler() bool { + if x != nil && x.Unmarshaler != nil { + return *x.Unmarshaler + } + return false +} + +func (x *MessageOptions) GetWrapper() bool { + if x != nil && x.Wrapper != nil { + return *x.Wrapper + } + return false +} + +type FieldOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Custom marshaler function. Specified as github.com/username/repo/package.FuncName. + MarshalerFunc *string `protobuf:"bytes,1,opt,name=marshaler_func,json=marshalerFunc" json:"marshaler_func,omitempty"` + // Custom unmarshaler function. Specified as github.com/username/repo/package.FuncName. + UnmarshalerFunc *string `protobuf:"bytes,2,opt,name=unmarshaler_func,json=unmarshalerFunc" json:"unmarshaler_func,omitempty"` +} + +func (x *FieldOptions) Reset() { + *x = FieldOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_annotations_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FieldOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldOptions) ProtoMessage() {} + +func (x *FieldOptions) ProtoReflect() protoreflect.Message { + mi := &file_annotations_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FieldOptions.ProtoReflect.Descriptor instead. +func (*FieldOptions) Descriptor() ([]byte, []int) { + return file_annotations_proto_rawDescGZIP(), []int{2} +} + +func (x *FieldOptions) GetMarshalerFunc() string { + if x != nil && x.MarshalerFunc != nil { + return *x.MarshalerFunc + } + return "" +} + +func (x *FieldOptions) GetUnmarshalerFunc() string { + if x != nil && x.UnmarshalerFunc != nil { + return *x.UnmarshalerFunc + } + return "" +} + +type OneofOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *OneofOptions) Reset() { + *x = OneofOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_annotations_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OneofOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OneofOptions) ProtoMessage() {} + +func (x *OneofOptions) ProtoReflect() protoreflect.Message { + mi := &file_annotations_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OneofOptions.ProtoReflect.Descriptor instead. +func (*OneofOptions) Descriptor() ([]byte, []int) { + return file_annotations_proto_rawDescGZIP(), []int{3} +} + +type EnumOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Generate a marshaler for this enum. + Marshaler *bool `protobuf:"varint,1,opt,name=marshaler" json:"marshaler,omitempty"` + // Always marshal as a number. + MarshalAsNumber *bool `protobuf:"varint,2,opt,name=marshal_as_number,json=marshalAsNumber" json:"marshal_as_number,omitempty"` + // Always marshal as a string. + MarshalAsString *bool `protobuf:"varint,3,opt,name=marshal_as_string,json=marshalAsString" json:"marshal_as_string,omitempty"` + // Generate an unmarshaler for this enum. + Unmarshaler *bool `protobuf:"varint,4,opt,name=unmarshaler" json:"unmarshaler,omitempty"` + // Consider string values with this prefix when unmarshaling. + Prefix *string `protobuf:"bytes,5,opt,name=prefix" json:"prefix,omitempty"` +} + +func (x *EnumOptions) Reset() { + *x = EnumOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_annotations_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EnumOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnumOptions) ProtoMessage() {} + +func (x *EnumOptions) ProtoReflect() protoreflect.Message { + mi := &file_annotations_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EnumOptions.ProtoReflect.Descriptor instead. +func (*EnumOptions) Descriptor() ([]byte, []int) { + return file_annotations_proto_rawDescGZIP(), []int{4} +} + +func (x *EnumOptions) GetMarshaler() bool { + if x != nil && x.Marshaler != nil { + return *x.Marshaler + } + return false +} + +func (x *EnumOptions) GetMarshalAsNumber() bool { + if x != nil && x.MarshalAsNumber != nil { + return *x.MarshalAsNumber + } + return false +} + +func (x *EnumOptions) GetMarshalAsString() bool { + if x != nil && x.MarshalAsString != nil { + return *x.MarshalAsString + } + return false +} + +func (x *EnumOptions) GetUnmarshaler() bool { + if x != nil && x.Unmarshaler != nil { + return *x.Unmarshaler + } + return false +} + +func (x *EnumOptions) GetPrefix() string { + if x != nil && x.Prefix != nil { + return *x.Prefix + } + return "" +} + +type EnumValueOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The value to emit when marshaling as string. + Value *string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` + // Aliases to accept when unmarshaling from string. + Aliases []string `protobuf:"bytes,2,rep,name=aliases" json:"aliases,omitempty"` +} + +func (x *EnumValueOptions) Reset() { + *x = EnumValueOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_annotations_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EnumValueOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnumValueOptions) ProtoMessage() {} + +func (x *EnumValueOptions) ProtoReflect() protoreflect.Message { + mi := &file_annotations_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EnumValueOptions.ProtoReflect.Descriptor instead. +func (*EnumValueOptions) Descriptor() ([]byte, []int) { + return file_annotations_proto_rawDescGZIP(), []int{5} +} + +func (x *EnumValueOptions) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + +func (x *EnumValueOptions) GetAliases() []string { + if x != nil { + return x.Aliases + } + return nil +} + +type ServiceOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ServiceOptions) Reset() { + *x = ServiceOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_annotations_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServiceOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServiceOptions) ProtoMessage() {} + +func (x *ServiceOptions) ProtoReflect() protoreflect.Message { + mi := &file_annotations_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServiceOptions.ProtoReflect.Descriptor instead. +func (*ServiceOptions) Descriptor() ([]byte, []int) { + return file_annotations_proto_rawDescGZIP(), []int{6} +} + +type MethodOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MethodOptions) Reset() { + *x = MethodOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_annotations_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MethodOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MethodOptions) ProtoMessage() {} + +func (x *MethodOptions) ProtoReflect() protoreflect.Message { + mi := &file_annotations_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MethodOptions.ProtoReflect.Descriptor instead. +func (*MethodOptions) Descriptor() ([]byte, []int) { + return file_annotations_proto_rawDescGZIP(), []int{7} +} + +var file_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*FileOptions)(nil), + Field: 1885, + Name: "thethings.json.file", + Tag: "bytes,1885,opt,name=file", + Filename: "annotations.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*MessageOptions)(nil), + Field: 1885, + Name: "thethings.json.message", + Tag: "bytes,1885,opt,name=message", + Filename: "annotations.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*FieldOptions)(nil), + Field: 1885, + Name: "thethings.json.field", + Tag: "bytes,1885,opt,name=field", + Filename: "annotations.proto", + }, + { + ExtendedType: (*descriptorpb.OneofOptions)(nil), + ExtensionType: (*OneofOptions)(nil), + Field: 1885, + Name: "thethings.json.oneof", + Tag: "bytes,1885,opt,name=oneof", + Filename: "annotations.proto", + }, + { + ExtendedType: (*descriptorpb.EnumOptions)(nil), + ExtensionType: (*EnumOptions)(nil), + Field: 1885, + Name: "thethings.json.enum", + Tag: "bytes,1885,opt,name=enum", + Filename: "annotations.proto", + }, + { + ExtendedType: (*descriptorpb.EnumValueOptions)(nil), + ExtensionType: (*EnumValueOptions)(nil), + Field: 1885, + Name: "thethings.json.enum_value", + Tag: "bytes,1885,opt,name=enum_value", + Filename: "annotations.proto", + }, + { + ExtendedType: (*descriptorpb.ServiceOptions)(nil), + ExtensionType: (*ServiceOptions)(nil), + Field: 1885, + Name: "thethings.json.service", + Tag: "bytes,1885,opt,name=service", + Filename: "annotations.proto", + }, + { + ExtendedType: (*descriptorpb.MethodOptions)(nil), + ExtensionType: (*MethodOptions)(nil), + Field: 1885, + Name: "thethings.json.method", + Tag: "bytes,1885,opt,name=method", + Filename: "annotations.proto", + }, +} + +// Extension fields to descriptorpb.FileOptions. +var ( + // optional thethings.json.FileOptions file = 1885; + E_File = &file_annotations_proto_extTypes[0] +) + +// Extension fields to descriptorpb.MessageOptions. +var ( + // optional thethings.json.MessageOptions message = 1885; + E_Message = &file_annotations_proto_extTypes[1] +) + +// Extension fields to descriptorpb.FieldOptions. +var ( + // optional thethings.json.FieldOptions field = 1885; + E_Field = &file_annotations_proto_extTypes[2] +) + +// Extension fields to descriptorpb.OneofOptions. +var ( + // optional thethings.json.OneofOptions oneof = 1885; + E_Oneof = &file_annotations_proto_extTypes[3] +) + +// Extension fields to descriptorpb.EnumOptions. +var ( + // optional thethings.json.EnumOptions enum = 1885; + E_Enum = &file_annotations_proto_extTypes[4] +) + +// Extension fields to descriptorpb.EnumValueOptions. +var ( + // optional thethings.json.EnumValueOptions enum_value = 1885; + E_EnumValue = &file_annotations_proto_extTypes[5] +) + +// Extension fields to descriptorpb.ServiceOptions. +var ( + // optional thethings.json.ServiceOptions service = 1885; + E_Service = &file_annotations_proto_extTypes[6] +) + +// Extension fields to descriptorpb.MethodOptions. +var ( + // optional thethings.json.MethodOptions method = 1885; + E_Method = &file_annotations_proto_extTypes[7] +) + +var File_annotations_proto protoreflect.FileDescriptor + +var file_annotations_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, + 0x73, 0x6f, 0x6e, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5b, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, + 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6d, 0x61, 0x72, + 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x75, 0x6e, 0x6d, + 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0e, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, + 0x6c, 0x6c, 0x22, 0x6a, 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, + 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, + 0x61, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x22, 0x60, + 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, + 0x0a, 0x0e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x66, 0x75, 0x6e, 0x63, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, + 0x72, 0x46, 0x75, 0x6e, 0x63, 0x12, 0x29, 0x0a, 0x10, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, + 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x46, 0x75, 0x6e, 0x63, + 0x22, 0x0e, 0x0a, 0x0c, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x22, 0xbd, 0x01, 0x0a, 0x0b, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x2a, + 0x0a, 0x11, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x5f, 0x61, 0x73, 0x5f, 0x6e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6d, 0x61, 0x72, 0x73, 0x68, + 0x61, 0x6c, 0x41, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x61, + 0x72, 0x73, 0x68, 0x61, 0x6c, 0x5f, 0x61, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x41, 0x73, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, + 0x68, 0x61, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x6d, + 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, + 0x69, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, + 0x22, 0x42, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x6c, + 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61, 0x6c, 0x69, + 0x61, 0x73, 0x65, 0x73, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x0f, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x4e, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, + 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xdd, 0x0e, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x3a, 0x5a, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0xdd, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x3a, 0x52, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x1d, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xdd, 0x0e, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, + 0x73, 0x6f, 0x6e, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x3a, 0x52, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, + 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0xdd, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x3a, 0x4e, 0x0a, 0x04, 0x65, + 0x6e, 0x75, 0x6d, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0xdd, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x3a, 0x63, 0x0a, 0x0a, 0x65, + 0x6e, 0x75, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xdd, 0x0e, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x5a, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xdd, 0x0e, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x56, 0x0a, 0x06, + 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xdd, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x06, 0x6d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x42, 0x3f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, + 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, + 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, +} + +var ( + file_annotations_proto_rawDescOnce sync.Once + file_annotations_proto_rawDescData = file_annotations_proto_rawDesc +) + +func file_annotations_proto_rawDescGZIP() []byte { + file_annotations_proto_rawDescOnce.Do(func() { + file_annotations_proto_rawDescData = protoimpl.X.CompressGZIP(file_annotations_proto_rawDescData) + }) + return file_annotations_proto_rawDescData +} + +var file_annotations_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_annotations_proto_goTypes = []interface{}{ + (*FileOptions)(nil), // 0: thethings.json.FileOptions + (*MessageOptions)(nil), // 1: thethings.json.MessageOptions + (*FieldOptions)(nil), // 2: thethings.json.FieldOptions + (*OneofOptions)(nil), // 3: thethings.json.OneofOptions + (*EnumOptions)(nil), // 4: thethings.json.EnumOptions + (*EnumValueOptions)(nil), // 5: thethings.json.EnumValueOptions + (*ServiceOptions)(nil), // 6: thethings.json.ServiceOptions + (*MethodOptions)(nil), // 7: thethings.json.MethodOptions + (*descriptorpb.FileOptions)(nil), // 8: google.protobuf.FileOptions + (*descriptorpb.MessageOptions)(nil), // 9: google.protobuf.MessageOptions + (*descriptorpb.FieldOptions)(nil), // 10: google.protobuf.FieldOptions + (*descriptorpb.OneofOptions)(nil), // 11: google.protobuf.OneofOptions + (*descriptorpb.EnumOptions)(nil), // 12: google.protobuf.EnumOptions + (*descriptorpb.EnumValueOptions)(nil), // 13: google.protobuf.EnumValueOptions + (*descriptorpb.ServiceOptions)(nil), // 14: google.protobuf.ServiceOptions + (*descriptorpb.MethodOptions)(nil), // 15: google.protobuf.MethodOptions +} +var file_annotations_proto_depIdxs = []int32{ + 8, // 0: thethings.json.file:extendee -> google.protobuf.FileOptions + 9, // 1: thethings.json.message:extendee -> google.protobuf.MessageOptions + 10, // 2: thethings.json.field:extendee -> google.protobuf.FieldOptions + 11, // 3: thethings.json.oneof:extendee -> google.protobuf.OneofOptions + 12, // 4: thethings.json.enum:extendee -> google.protobuf.EnumOptions + 13, // 5: thethings.json.enum_value:extendee -> google.protobuf.EnumValueOptions + 14, // 6: thethings.json.service:extendee -> google.protobuf.ServiceOptions + 15, // 7: thethings.json.method:extendee -> google.protobuf.MethodOptions + 0, // 8: thethings.json.file:type_name -> thethings.json.FileOptions + 1, // 9: thethings.json.message:type_name -> thethings.json.MessageOptions + 2, // 10: thethings.json.field:type_name -> thethings.json.FieldOptions + 3, // 11: thethings.json.oneof:type_name -> thethings.json.OneofOptions + 4, // 12: thethings.json.enum:type_name -> thethings.json.EnumOptions + 5, // 13: thethings.json.enum_value:type_name -> thethings.json.EnumValueOptions + 6, // 14: thethings.json.service:type_name -> thethings.json.ServiceOptions + 7, // 15: thethings.json.method:type_name -> thethings.json.MethodOptions + 16, // [16:16] is the sub-list for method output_type + 16, // [16:16] is the sub-list for method input_type + 8, // [8:16] is the sub-list for extension type_name + 0, // [0:8] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_annotations_proto_init() } +func file_annotations_proto_init() { + if File_annotations_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_annotations_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FileOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_annotations_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_annotations_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FieldOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_annotations_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OneofOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_annotations_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EnumOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_annotations_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EnumValueOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_annotations_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServiceOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_annotations_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MethodOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_annotations_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 8, + NumServices: 0, + }, + GoTypes: file_annotations_proto_goTypes, + DependencyIndexes: file_annotations_proto_depIdxs, + MessageInfos: file_annotations_proto_msgTypes, + ExtensionInfos: file_annotations_proto_extTypes, + }.Build() + File_annotations_proto = out.File + file_annotations_proto_rawDesc = nil + file_annotations_proto_goTypes = nil + file_annotations_proto_depIdxs = nil +} diff --git a/cmd/protoc-gen-go-json/main.go b/cmd/protoc-gen-go-json/main.go new file mode 100644 index 00000000..f5a0398d --- /dev/null +++ b/cmd/protoc-gen-go-json/main.go @@ -0,0 +1,40 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "flag" + "fmt" + + plugin "github.com/TheThingsIndustries/protoc-gen-go-json/internal/gen" + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/reflect/protoreflect" +) + +func main() { + showVersion := flag.Bool("version", false, "print the version and exit") + flag.Parse() + if *showVersion { + fmt.Printf("protoc-gen-go-json %v\n", plugin.Version) + return + } + + var flags flag.FlagSet + flags.StringVar(&plugin.Params.Lang, "lang", "go", "language (go or gogo)") + + protogen.Options{ + ParamFunc: flags.Set, + }.Run(func(gen *protogen.Plugin) error { + for _, f := range gen.Files { + if !f.Generate { + continue + } + if f.Desc.Syntax() != protoreflect.Proto3 { + return fmt.Errorf("the protoc-gen-go-json plugin only supports proto3 syntax") + } + plugin.GenerateFile(gen, f) + } + return nil + }) +} diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..db6e9ba6 --- /dev/null +++ b/go.mod @@ -0,0 +1,10 @@ +module github.com/TheThingsIndustries/protoc-gen-go-json + +go 1.16 + +require ( + github.com/gogo/protobuf v1.3.2 + github.com/google/go-cmp v0.5.6 + github.com/json-iterator/go v1.1.11 + google.golang.org/protobuf v1.27.1 +) diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..23840b3a --- /dev/null +++ b/go.sum @@ -0,0 +1,54 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= diff --git a/gogo/gogo.go b/gogo/gogo.go new file mode 100644 index 00000000..9d06412c --- /dev/null +++ b/gogo/gogo.go @@ -0,0 +1,350 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package gogoplugin + +import ( + "bytes" + "reflect" + "strings" + + "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" + "github.com/gogo/protobuf/jsonpb" + "github.com/gogo/protobuf/proto" + "github.com/gogo/protobuf/types" +) + +// MarshalMessage marshals a message with the standard JSON marshaler. +func MarshalMessage(s *jsonplugin.MarshalState, v proto.Message) { + rv := reflect.ValueOf(v) + + // If v is nil or typed nil, we write null. + if v == nil || (rv.Kind() == reflect.Ptr && rv.IsNil()) { + s.WriteNil() + return + } + + // Let gogo jsonpb marshal v. + err := (&jsonpb.Marshaler{ + OrigName: true, + EnumsAsInts: s.Config().EnumsAsInts, + }).Marshal(s, v) + if err != nil { + s.SetErrorf("failed to marshal %s to JSON: %w", proto.MessageName(v), err) + } +} + +// UnmarshalMessage unmarshals a message with the standard JSON unmarshaler. +func UnmarshalMessage(s *jsonplugin.UnmarshalState, v proto.Message) { + // If we read null, don't do anything. + if s.ReadNil() { + return + } + + // Read the raw object. + data := s.ReadRawMessage() + if s.Err() != nil { + return + } + + // Let gogo jsonpb unmarshal v. + err := (&jsonpb.Unmarshaler{ + AllowUnknownFields: true, + }).Unmarshal(bytes.NewBuffer(data), v) + if err != nil { + s.SetErrorf("failed to unmarshal %s from JSON: %w", proto.MessageName(v), err) + } +} + +// MarshalAny marshals a Any WKT. +func MarshalAny(s *jsonplugin.MarshalState, v *types.Any) { + if v == nil { + s.WriteNil() + return + } + + // We first need to get the wrapped message out of the Any. + // To do this, we instantiate an empty message of the type of the wrapped message. + // Then we unmarshal the Any into that empty message. + msg, err := types.EmptyAny(v) + if err != nil { + s.SetErrorf("unknown message type %q for Any: %w", v.GetTypeUrl(), err) + } + if err = types.UnmarshalAny(v, msg); err != nil { + s.SetErrorf("failed to unmarshal wrapped message from Any: %w", err) + } + + if marshaler, ok := msg.(jsonplugin.Marshaler); ok { + // Instantiate a sub-marshaler with the same configuration and marshal the wrapped message to that. + sub := s.Sub() + marshaler.MarshalProtoJSON(sub) + data, err := sub.Bytes() + if err != nil { + return + } + + // We need to prepend the @type field to that object, so we read the { character. + buf := bytes.NewBuffer(data) + objectStart, err := buf.ReadByte() + if err != nil { + s.SetError(err) + return + } + if objectStart != '{' { + s.SetErrorf("marshaled Any is not an object") + return + } + + // We take a look at the next token, because if it's a ", we'll need a comma after we write the @type field. + nextToken, err := buf.ReadByte() + if err != nil { + s.SetError(err) + return + } + buf.UnreadByte() + + // Write the opening { and the type field to the main marshaler. + s.WriteObjectStart() + s.WriteObjectField("@type") + s.WriteString(v.GetTypeUrl()) + + // If the next token is a ", we have more fields, so we need to write a comma. + // Otherwise, it's a } and we don't need a comma. + if nextToken == '"' { + s.WriteMore() + } + + // Write the rest of the buffer (the sub-object without the { character). + s.Write(buf.Bytes()) + return + } + + // If v doesn't implement jsonplugin.Marshaler, delegate to gogo jsonpb. + MarshalMessage(s, v) +} + +// UnmarshalAny unmarshals an Any WKT. +func UnmarshalAny(s *jsonplugin.UnmarshalState) *types.Any { + if s.ReadNil() { + return nil + } + + // Read the raw object and create a sub-unmarshaler for it. + data := s.ReadRawMessage() + if s.Err() != nil { + return nil + } + sub := s.Sub(data) + + // Read the first field in the object. This should be @type. + if key := sub.ReadObjectField(); key != "@type" { + s.SetErrorf("first field in Any is not @type, but %q", key) + return nil + } + typeURL := sub.ReadString() + if err := sub.Err(); err != nil { + return nil + } + + // Find the message type by the name that's in the type URL. + slash := strings.LastIndex(typeURL, "/") + if slash < 0 { + s.SetErrorf("invalid type URL %q", typeURL) + return nil + } + t := proto.MessageType(typeURL[slash+1:]) + if t == nil { + s.SetErrorf("unknown message type %q", typeURL[slash+1:]) + return nil + } + + // Allocate a new message of that type. + msg := reflect.New(t.Elem()).Interface().(proto.Message) + + if unmarshaler, ok := msg.(jsonplugin.Unmarshaler); ok { + // Create another sub-unmarshaler for the raw data and unmarshal the message. + sub := s.Sub(data) + unmarshaler.UnmarshalProtoJSON(sub) + if err := sub.Err(); err != nil { + return nil + } + } else { + // Delegate unmarshaling to gogo jsonpb. + if err := (&jsonpb.Unmarshaler{ + AllowUnknownFields: true, + }).Unmarshal(bytes.NewBuffer(data), msg); err != nil { + s.SetErrorf("failed to unmarshal Any to JSON: %w", err) + return nil + } + } + + // Wrap the unmarshaled message in an Any and return that. + v, err := types.MarshalAny(msg) + if err != nil { + s.SetError(err) + return nil + } + return v +} + +// MarshalDuration marshals a Duration WKT. +func MarshalDuration(s *jsonplugin.MarshalState, v *types.Duration) { + if v == nil { + s.WriteNil() + return + } + d, err := types.DurationFromProto(v) + if err != nil { + s.SetErrorf("invalid duration: %w", err) + } + s.WriteDuration(d) +} + +// UnmarshalDuration unmarshals a Duration WKT. +func UnmarshalDuration(s *jsonplugin.UnmarshalState) *types.Duration { + if s.ReadNil() { + return nil + } + d := s.ReadDuration() + if s.Err() != nil { + return nil + } + return types.DurationProto(*d) +} + +// MarshalEmpty marshals an Empty WKT. +func MarshalEmpty(s *jsonplugin.MarshalState, _ *types.Empty) { + s.WriteObjectStart() + s.WriteObjectEnd() +} + +// UnmarshalEmpty unmarshals a Empty WKT. +func UnmarshalEmpty(s *jsonplugin.UnmarshalState) *types.Empty { + if s.ReadNil() { + return nil + } + s.ReadObject(func(key string) { + s.SetErrorf("unexpected key %q in Empty", key) + }) + if s.Err() != nil { + return nil + } + return &types.Empty{} +} + +// MarshalFieldMask marshals a FieldMask WKT. +func MarshalFieldMask(s *jsonplugin.MarshalState, v *types.FieldMask) { + if v == nil { + s.WriteNil() + return + } + s.WriteFieldMask(v) +} + +// UnmarshalFieldMask unmarshals a FieldMask WKT. +func UnmarshalFieldMask(s *jsonplugin.UnmarshalState) *types.FieldMask { + if s.ReadNil() { + return nil + } + m := s.ReadFieldMask() + if s.Err() != nil { + return nil + } + return &types.FieldMask{Paths: m.GetPaths()} +} + +// MarshalStruct marshals a Struct WKT. +func MarshalStruct(s *jsonplugin.MarshalState, v *types.Struct) { + if v == nil { + s.WriteNil() + return + } + MarshalMessage(s, v) +} + +// UnmarshalStruct unmarshals a Struct WKT. +func UnmarshalStruct(s *jsonplugin.UnmarshalState) *types.Struct { + if s.ReadNil() { + return nil + } + var v types.Struct + UnmarshalMessage(s, &v) + if s.Err() != nil { + return nil + } + return &v +} + +// MarshalValue marshals a Value WKT. +func MarshalValue(s *jsonplugin.MarshalState, v *types.Value) { + if v == nil { + s.WriteNil() + return + } + MarshalMessage(s, v) +} + +// UnmarshalValue unmarshals a Value WKT. +func UnmarshalValue(s *jsonplugin.UnmarshalState) *types.Value { + if s.ReadNil() { + return &types.Value{Kind: &types.Value_NullValue{}} + } + var v types.Value + UnmarshalMessage(s, &v) + if s.Err() != nil { + return nil + } + return &v +} + +// MarshalListValue marshals a ListValue WKT. +func MarshalListValue(s *jsonplugin.MarshalState, v *types.ListValue) { + if v == nil { + s.WriteNil() + return + } + MarshalMessage(s, v) +} + +// UnmarshalListValue unmarshals a ListValue WKT. +func UnmarshalListValue(s *jsonplugin.UnmarshalState) *types.ListValue { + if s.ReadNil() { + return nil + } + var v types.ListValue + UnmarshalMessage(s, &v) + if s.Err() != nil { + return nil + } + return &v +} + +// MarshalTimestamp marshals a Timestamp WKT. +func MarshalTimestamp(s *jsonplugin.MarshalState, v *types.Timestamp) { + if v == nil { + s.WriteNil() + return + } + t, err := types.TimestampFromProto(v) + if err != nil { + s.SetErrorf("invalid time: %w", err) + } + s.WriteTime(t) +} + +// UnmarshalTimestamp unmarshals a Timestamp WKT. +func UnmarshalTimestamp(s *jsonplugin.UnmarshalState) *types.Timestamp { + if s.ReadNil() { + return nil + } + d := s.ReadTime() + if s.Err() != nil { + return nil + } + v, err := types.TimestampProto(*d) + if err != nil { + s.SetErrorf("invalid time: %w", err) + return nil + } + return v +} diff --git a/golang/golang.go b/golang/golang.go new file mode 100644 index 00000000..45eaece9 --- /dev/null +++ b/golang/golang.go @@ -0,0 +1,333 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package golangplugin + +import ( + "bytes" + "reflect" + + "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" + protojson "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoregistry" + anypb "google.golang.org/protobuf/types/known/anypb" + durationpb "google.golang.org/protobuf/types/known/durationpb" + emptypb "google.golang.org/protobuf/types/known/emptypb" + fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + structpb "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" +) + +// MarshalMessage marshals a message with the standard JSON marshaler. +func MarshalMessage(s *jsonplugin.MarshalState, v proto.Message) { + rv := reflect.ValueOf(v) + + // If v is nil or typed nil, we write null. + if v == nil || (rv.Kind() == reflect.Ptr && rv.IsNil()) { + s.WriteNil() + return + } + + // Let protojson marshal v. + b, err := protojson.MarshalOptions{ + UseProtoNames: true, + UseEnumNumbers: s.Config().EnumsAsInts, + }.Marshal(v) + if err != nil { + s.SetErrorf("failed to marshal %s to JSON: %w", proto.MessageName(v), err) + } + s.Write(b) +} + +// UnmarshalMessage unmarshals a message with the standard JSON unmarshaler. +func UnmarshalMessage(s *jsonplugin.UnmarshalState, v proto.Message) { + // If we read null, don't do anything. + if s.ReadNil() { + return + } + + // Read the raw object. + data := s.ReadRawMessage() + if s.Err() != nil { + return + } + + // Let protojson unmarshal v. + err := protojson.UnmarshalOptions{ + DiscardUnknown: true, + }.Unmarshal(data, v) + if err != nil { + s.SetErrorf("failed to unmarshal %s from JSON: %w", proto.MessageName(v), err) + } +} + +// MarshalAny marshals an Any WKT. +func MarshalAny(s *jsonplugin.MarshalState, v *anypb.Any) { + if v == nil { + s.WriteNil() + return + } + + // We first need to get the wrapped message out of the Any. + msg, err := v.UnmarshalNew() + if err != nil { + s.SetErrorf("failed to unmarshal wrapped message from Any: %w", err) + } + + if marshaler, ok := msg.(jsonplugin.Marshaler); ok { + // Instantiate a sub-marshaler with the same configuration and marshal the wrapped message to that. + sub := s.Sub() + marshaler.MarshalProtoJSON(sub) + data, err := sub.Bytes() + if err != nil { + return + } + + // We need to prepend the @type field to that object, so we read the { character. + buf := bytes.NewBuffer(data) + objectStart, err := buf.ReadByte() + if err != nil { + s.SetError(err) + return + } + if objectStart != '{' { + s.SetErrorf("marshaled Any is not an object") + return + } + + // We take a look at the next token, because if it's a ", we'll need a comma after we write the @type field. + nextToken, err := buf.ReadByte() + if err != nil { + s.SetError(err) + return + } + buf.UnreadByte() + + // Write the opening { and the type field to the main marshaler. + s.WriteObjectStart() + s.WriteObjectField("@type") + s.WriteString(v.GetTypeUrl()) + + // If the next token is a ", we have more fields, so we need to write a comma. + // Otherwise, it's a } and we don't need a comma. + if nextToken == '"' { + s.WriteMore() + } + + // Write the rest of the buffer (the sub-object without the { character). + s.Write(buf.Bytes()) + return + } + + // If v doesn't implement jsonplugin.Marshaler, delegate to protojson. + MarshalMessage(s, v) +} + +// UnmarshalAny unmarshals an Any WKT. +func UnmarshalAny(s *jsonplugin.UnmarshalState) *anypb.Any { + if s.ReadNil() { + return nil + } + + // Read the raw object and create a sub-unmarshaler for it. + data := s.ReadRawMessage() + if s.Err() != nil { + return nil + } + sub := s.Sub(data) + + // Read the first field in the object. This should be @type. + if key := sub.ReadObjectField(); key != "@type" { + s.SetErrorf("first field in Any is not @type, but %q", key) + return nil + } + typeURL := sub.ReadString() + if err := sub.Err(); err != nil { + return nil + } + + // Find the message type by the type URL. + t, err := protoregistry.GlobalTypes.FindMessageByURL(typeURL) + if err != nil { + s.SetError(err) + return nil + } + + // Allocate a new message of that type. + msg := t.New().Interface() + + if unmarshaler, ok := msg.(jsonplugin.Unmarshaler); ok { + // Create another sub-unmarshaler for the raw data and unmarshal the message. + sub := s.Sub(data) + unmarshaler.UnmarshalProtoJSON(sub) + if err := sub.Err(); err != nil { + return nil + } + } else { + // Delegate unmarshaling to protojson. + if err := (&protojson.UnmarshalOptions{ + DiscardUnknown: true, + }).Unmarshal(data, msg); err != nil { + s.SetErrorf("failed to unmarshal Any to JSON: %w", err) + return nil + } + } + + // Wrap the unmarshaled message in an Any and return that. + v, err := anypb.New(msg) + if err != nil { + s.SetError(err) + return nil + } + return v +} + +// MarshalDuration marshals a Duration WKT. +func MarshalDuration(s *jsonplugin.MarshalState, v *durationpb.Duration) { + if v == nil { + s.WriteNil() + return + } + s.WriteDuration(v.AsDuration()) +} + +// UnmarshalDuration unmarshals a Duration WKT. +func UnmarshalDuration(s *jsonplugin.UnmarshalState) *durationpb.Duration { + if s.ReadNil() { + return nil + } + d := s.ReadDuration() + if s.Err() != nil { + return nil + } + return durationpb.New(*d) +} + +// MarshalEmpty marshals an Empty WKT. +func MarshalEmpty(s *jsonplugin.MarshalState, _ *emptypb.Empty) { + s.WriteObjectStart() + s.WriteObjectEnd() +} + +// UnmarshalEmpty unmarshals a Empty WKT. +func UnmarshalEmpty(s *jsonplugin.UnmarshalState) *emptypb.Empty { + if s.ReadNil() { + return nil + } + s.ReadObject(func(key string) { + s.SetErrorf("unexpected key %q in Empty", key) + }) + if s.Err() != nil { + return nil + } + return &emptypb.Empty{} +} + +// MarshalFieldMask marshals a FieldMask WKT. +func MarshalFieldMask(s *jsonplugin.MarshalState, v *fieldmaskpb.FieldMask) { + if v == nil { + s.WriteNil() + return + } + s.WriteFieldMask(v) +} + +// UnmarshalFieldMask unmarshals a FieldMask WKT. +func UnmarshalFieldMask(s *jsonplugin.UnmarshalState) *fieldmaskpb.FieldMask { + if s.ReadNil() { + return nil + } + m := s.ReadFieldMask() + if s.Err() != nil { + return nil + } + return &fieldmaskpb.FieldMask{Paths: m.GetPaths()} +} + +// MarshalStruct marshals a Struct WKT. +func MarshalStruct(s *jsonplugin.MarshalState, v *structpb.Struct) { + if v == nil { + s.WriteNil() + return + } + MarshalMessage(s, v) +} + +// UnmarshalStruct unmarshals a Struct WKT. +func UnmarshalStruct(s *jsonplugin.UnmarshalState) *structpb.Struct { + if s.ReadNil() { + return nil + } + var v structpb.Struct + UnmarshalMessage(s, &v) + if s.Err() != nil { + return nil + } + return &v +} + +// MarshalValue marshals a Value WKT. +func MarshalValue(s *jsonplugin.MarshalState, v *structpb.Value) { + if v == nil { + s.WriteNil() + return + } + MarshalMessage(s, v) +} + +// UnmarshalValue unmarshals a Value WKT. +func UnmarshalValue(s *jsonplugin.UnmarshalState) *structpb.Value { + if s.ReadNil() { + return &structpb.Value{Kind: &structpb.Value_NullValue{}} + } + var v structpb.Value + UnmarshalMessage(s, &v) + if s.Err() != nil { + return nil + } + return &v +} + +// MarshalListValue marshals a ListValue WKT. +func MarshalListValue(s *jsonplugin.MarshalState, v *structpb.ListValue) { + if v == nil { + s.WriteNil() + return + } + MarshalMessage(s, v) +} + +// UnmarshalListValue unmarshals a ListValue WKT. +func UnmarshalListValue(s *jsonplugin.UnmarshalState) *structpb.ListValue { + if s.ReadNil() { + return nil + } + var v structpb.ListValue + UnmarshalMessage(s, &v) + if s.Err() != nil { + return nil + } + return &v +} + +// MarshalTimestamp marshals a Timestamp WKT. +func MarshalTimestamp(s *jsonplugin.MarshalState, v *timestamppb.Timestamp) { + if v == nil { + s.WriteNil() + return + } + s.WriteTime(v.AsTime()) +} + +// UnmarshalTimestamp unmarshals a Timestamp WKT. +func UnmarshalTimestamp(s *jsonplugin.UnmarshalState) *timestamppb.Timestamp { + if s.ReadNil() { + return nil + } + t := s.ReadTime() + if s.Err() != nil { + return nil + } + return timestamppb.New(*t) +} diff --git a/internal/gen/enums.go b/internal/gen/enums.go new file mode 100644 index 00000000..e2bdb29d --- /dev/null +++ b/internal/gen/enums.go @@ -0,0 +1,75 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package gen + +import ( + "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/descriptorpb" +) + +func (g *generator) enumHasAnyMarshaler(enum *protogen.Enum) bool { + return g.enumHasMarshaler(enum) || g.enumHasUnmarshaler(enum) +} + +func (g *generator) genEnum(enum *protogen.Enum) { + if g.enumHasMarshaler(enum) { + g.genEnumMarshaler(enum) + } + + if g.enumHasUnmarshaler(enum) { + g.genEnumUnmarshaler(enum) + } +} + +func (*generator) enumHasCustomValues(enum *protogen.Enum) bool { + for _, value := range enum.Values { + // If the file has the (thethings.json.enum_value) option, and a value is set we have custom values. + opts := value.Desc.Options().(*descriptorpb.EnumValueOptions) + if ext, ok := proto.GetExtension(opts, annotations.E_EnumValue).(*annotations.EnumValueOptions); ok && ext.GetValue() != "" { + return true + } + } + return false +} + +func (*generator) enumHasCustomAliases(enum *protogen.Enum) bool { + for _, value := range enum.Values { + // If the file has the (thethings.json.enum_value) option, and a value is set, or aliases are set, we have custom aliases. + opts := value.Desc.Options().(*descriptorpb.EnumValueOptions) + if ext, ok := proto.GetExtension(opts, annotations.E_EnumValue).(*annotations.EnumValueOptions); ok { + if ext.GetValue() != "" { + return true + } + if len(ext.GetAliases()) > 0 { + return true + } + } + } + return false +} + +func (*generator) enumValueAliases(value *protogen.EnumValue) []string { + opts := value.Desc.Options().(*descriptorpb.EnumValueOptions) + ext, ok := proto.GetExtension(opts, annotations.E_EnumValue).(*annotations.EnumValueOptions) + if !ok { + return nil + } + aliases := ext.GetAliases() + // If the enum value has a custom value, add it to aliases if it's not already there. + if value := ext.GetValue(); value != "" { + var found bool + for _, alias := range aliases { + if alias == value { + found = true + break + } + } + if !found { + return append([]string{value}, aliases...) + } + } + return aliases +} diff --git a/internal/gen/enums_marshaler.go b/internal/gen/enums_marshaler.go new file mode 100644 index 00000000..0aa7e86a --- /dev/null +++ b/internal/gen/enums_marshaler.go @@ -0,0 +1,93 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package gen + +import ( + "fmt" + "strconv" + + "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/descriptorpb" +) + +func (g *generator) enumHasMarshaler(enum *protogen.Enum) bool { + var generateMarshaler bool + + // If the file has the (thethings.json.file) option, and marshaler_all is set, we start with that. + fileOpts := enum.Desc.ParentFile().Options().(*descriptorpb.FileOptions) + if proto.HasExtension(fileOpts, annotations.E_File) { + if fileExt, ok := proto.GetExtension(fileOpts, annotations.E_File).(*annotations.FileOptions); ok { + if fileExt.MarshalerAll != nil { + generateMarshaler = *fileExt.MarshalerAll + } + } + } + + if g.enumHasCustomValues(enum) { + generateMarshaler = true + } + + // If the enum has the (thethings.json.enum) option and wants to always marshal as a number/string, we need to generate a marshaler. + // Finally, the marshaler field can still override to true or false if explicitly set. + enumOpts := enum.Desc.Options().(*descriptorpb.EnumOptions) + if proto.HasExtension(enumOpts, annotations.E_Enum) { + if enumExt, ok := proto.GetExtension(enumOpts, annotations.E_Enum).(*annotations.EnumOptions); ok { + if enumExt.GetMarshalAsNumber() || enumExt.GetMarshalAsString() { + generateMarshaler = true + } + if enumExt.Marshaler != nil { + generateMarshaler = *enumExt.Marshaler + } + } + } + + return generateMarshaler +} + +func (g *generator) genEnumMarshaler(enum *protogen.Enum) { + ext, _ := proto.GetExtension(enum.Desc.Options().(*descriptorpb.EnumOptions), annotations.E_Enum).(*annotations.EnumOptions) + + // If the enum has custom values, we create a map[int32]string that maps the number to those values. + hasCustomValues := g.enumHasCustomValues(enum) + if hasCustomValues { + g.P("// ", enum.GoIdent, "_customname contains custom string values that override ", enum.GoIdent, "_name.") + g.P("var ", enum.GoIdent, "_customname = map[int32]string{") + for _, value := range enum.Values { + opts := value.Desc.Options().(*descriptorpb.EnumValueOptions) + if ext, ok := proto.GetExtension(opts, annotations.E_EnumValue).(*annotations.EnumValueOptions); ok { + if customValue := ext.GetValue(); customValue != "" { + g.P(value.Desc.Number(), " : ", strconv.Quote(customValue), ",") + } + } + } + g.P("}") + } + + g.P("// MarshalProtoJSON marshals the ", enum.GoIdent, " to JSON.") + g.P("func (x ", enum.GoIdent, ") MarshalProtoJSON(s *", jsonPluginPackage.Ident("MarshalState"), ") {") + if ext.GetMarshalAsNumber() { + if ext.GetMarshalAsString() { + g.gen.Error(fmt.Errorf("%s has both marshal_as_numer and marshal_as_string", enum.Desc.Name())) + } + g.P("s.WriteEnumNumber(int32(x))") + } else { + // WriteEnum writes the enum according to the EnumsAsInts config. + // If we really want strings, we use WriteEnumString. + fun := "WriteEnum" + if ext.GetMarshalAsString() { + fun = "WriteEnumString" + } + if hasCustomValues { + // We write the enum, passing both the original mapping, and our custom mapping to the marshaler. + g.P("s.", fun, "(int32(x), ", enum.GoIdent, "_customname, ", enum.GoIdent, "_name)") + } else { + // We write the enum, passing only the original mapping to the marshaler. + g.P("s.", fun, "(int32(x), ", enum.GoIdent, "_name)") + } + } + g.P("}") + g.P() +} diff --git a/internal/gen/enums_unmarshaler.go b/internal/gen/enums_unmarshaler.go new file mode 100644 index 00000000..58b9306c --- /dev/null +++ b/internal/gen/enums_unmarshaler.go @@ -0,0 +1,88 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package gen + +import ( + "strconv" + "strings" + + "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/descriptorpb" +) + +func (g *generator) enumHasUnmarshaler(enum *protogen.Enum) bool { + var generateUnmarshaler bool + + // If the file has the (thethings.json.file) option, and unmarshaler_all is set, we start with that. + fileOpts := enum.Desc.ParentFile().Options().(*descriptorpb.FileOptions) + if proto.HasExtension(fileOpts, annotations.E_File) { + if fileExt, ok := proto.GetExtension(fileOpts, annotations.E_File).(*annotations.FileOptions); ok { + if fileExt.UnmarshalerAll != nil { + generateUnmarshaler = *fileExt.UnmarshalerAll + } + } + } + + // NOTE: enumHasCustomAliases already checks if there are custom values, but just in case, we also check it. + if g.enumHasCustomValues(enum) || g.enumHasCustomAliases(enum) { + generateUnmarshaler = true + } + + // If the enum has the (thethings.json.enum) option and wants to always marshal as a number/string or has a prefix, we need to generate an unmarshaler. + // Finally, the unmarshaler field can still override to true or false if explicitly set. + enumOpts := enum.Desc.Options().(*descriptorpb.EnumOptions) + if proto.HasExtension(enumOpts, annotations.E_Enum) { + if enumExt, ok := proto.GetExtension(enumOpts, annotations.E_Enum).(*annotations.EnumOptions); ok { + if enumExt.GetMarshalAsNumber() || enumExt.GetMarshalAsString() || enumExt.GetPrefix() != "" { + generateUnmarshaler = true + } + if enumExt.Unmarshaler != nil { + generateUnmarshaler = *enumExt.Unmarshaler + } + } + } + return generateUnmarshaler +} + +func (g *generator) genEnumUnmarshaler(enum *protogen.Enum) { + ext, _ := proto.GetExtension(enum.Desc.Options().(*descriptorpb.EnumOptions), annotations.E_Enum).(*annotations.EnumOptions) + + // If the enum has a prefix, or any aliases, we create a map[string]int32 that maps the non-prefixed values and aliases to the number. + prefix := strings.TrimSuffix(ext.GetPrefix(), "_") + "_" + hasCustomAliases := g.enumHasCustomAliases(enum) || prefix != "_" + if hasCustomAliases { + g.P("// ", enum.GoIdent, "_customvalue contains custom string values that extend ", enum.GoIdent, "_value.") + g.P("var ", enum.GoIdent, "_customvalue = map[string]int32{") + for _, value := range enum.Values { + if prefix != "_" { + if strings.HasPrefix(string(value.Desc.Name()), prefix) { + g.P(strconv.Quote(strings.TrimPrefix(string(value.Desc.Name()), prefix)), ": ", value.Desc.Number(), ",") + } + } + for _, customValue := range g.enumValueAliases(value) { + g.P(strconv.Quote(customValue), ": ", value.Desc.Number(), ",") + } + } + g.P("}") + } + + g.P("// UnmarshalProtoJSON unmarshals the ", enum.GoIdent, " from JSON.") + g.P("func (x *", enum.GoIdent, ") UnmarshalProtoJSON(s *", jsonPluginPackage.Ident("UnmarshalState"), ") {") + if hasCustomAliases { + // We read the enum, passing both the original mapping, and our custom mapping to the unmarshaler. + g.P("v := s.ReadEnum(", enum.GoIdent, "_value, ", enum.GoIdent, "_customvalue)") + } else { + // We read the enum, passing only the original mapping to the unmarshaler. + g.P("v := s.ReadEnum(", enum.GoIdent, "_value)") + } + g.P("if err := s.Err(); err != nil {") + g.P(`s.SetErrorf("could not read `, enum.Desc.Name(), ` enum: %v", err)`) + g.P("return") + g.P("}") + g.P("*x = ", enum.GoIdent, "(v)") + g.P("}") + g.P() +} diff --git a/internal/gen/gen.go b/internal/gen/gen.go new file mode 100644 index 00000000..555e8889 --- /dev/null +++ b/internal/gen/gen.go @@ -0,0 +1,111 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package gen + +import ( + "fmt" + + "google.golang.org/protobuf/compiler/protogen" +) + +// Version is the version of the generator. +var Version = "0.0.0-dev" + +// Params are the parameters for the generator. +var Params struct { + Lang string +} + +const ( + bytesPackage = protogen.GoImportPath("bytes") + fmtPackage = protogen.GoImportPath("fmt") + jsonPackage = protogen.GoImportPath("encoding/json") + strconvPackage = protogen.GoImportPath("strconv") + + gogoProtoTypesPackage = protogen.GoImportPath("github.com/gogo/protobuf/types") + + gogoProtoJSONPackage = protogen.GoImportPath("github.com/gogo/protobuf/jsonpb") + golangProtoJSONPackage = protogen.GoImportPath("google.golang.org/protobuf/encoding/protojson") + + jsonPluginPackage = protogen.GoImportPath("github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin") + gogoPluginPackage = protogen.GoImportPath("github.com/TheThingsIndustries/protoc-gen-go-json/gogo") + golangPluginPackage = protogen.GoImportPath("github.com/TheThingsIndustries/protoc-gen-go-json/golang") +) + +type generator struct { + gen *protogen.Plugin + file *protogen.File + *protogen.GeneratedFile +} + +// GenerateFile generates a file with JSON marshalers and unmarshalers. +func GenerateFile(gen *protogen.Plugin, file *protogen.File) *protogen.GeneratedFile { + g := &generator{ + gen: gen, + file: file, + } + + // If the file doesn't have marshalers or unmarshalers, we kan skip it. + if !g.fileHasAnyMarshaler() { + return nil + } + + // Generate a new file that ends with `_json.pb.go`. + filename := file.GeneratedFilenamePrefix + "_json.pb.go" + g.GeneratedFile = gen.NewGeneratedFile(filename, file.GoImportPath) + + // The standard header for generated files. + g.P("// Code generated by protoc-gen-go-json. DO NOT EDIT.") + g.P("// versions:") + g.P("// - protoc-gen-go-json v", Version) + g.P("// - protoc ", g.protocVersion()) + if file.Proto.GetOptions().GetDeprecated() { + g.P("// ", file.Desc.Path(), " is a deprecated file.") + } else { + g.P("// source: ", file.Desc.Path()) + } + + g.P() + g.P("package ", file.GoPackageName) + g.P() + + g.generateFileContent() + + return g.GeneratedFile +} + +func (g *generator) fileHasAnyMarshaler() bool { + for _, enum := range g.file.Enums { + if g.enumHasAnyMarshaler(enum) { + return true + } + } + for _, message := range g.file.Messages { + if g.messageHasAnyMarshaler(message) { + return true + } + } + return false +} + +func (g *generator) protocVersion() string { + v := g.gen.Request.GetCompilerVersion() + if v == nil { + return "(unknown)" + } + var suffix string + if s := v.GetSuffix(); s != "" { + suffix = "-" + s + } + return fmt.Sprintf("v%d.%d.%d%s", v.GetMajor(), v.GetMinor(), v.GetPatch(), suffix) +} + +func (g *generator) generateFileContent() { + for _, enum := range g.file.Enums { + g.genEnum(enum) + } + for _, message := range g.file.Messages { + g.genMessage(message) + } +} diff --git a/internal/gen/messages.go b/internal/gen/messages.go new file mode 100644 index 00000000..07e67edc --- /dev/null +++ b/internal/gen/messages.go @@ -0,0 +1,209 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package gen + +import ( + "fmt" + "strings" + + "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + "github.com/TheThingsIndustries/protoc-gen-go-json/internal/gogoproto" + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/types/descriptorpb" +) + +func (g *generator) messageHasAnyMarshaler(message *protogen.Message) bool { + // We have a marshaler if the message itself has a marshaler or unmarshaler. + if g.messageHasMarshaler(message) || g.messageHasUnmarshaler(message) { + return true + } + + // We have a marshaler if any of the enums defined in the message has a marshaler or unmarshaler. + for _, enum := range message.Enums { + if g.enumHasAnyMarshaler(enum) { + return true + } + } + + // We have a marshaler if any of the sub-messages defined in the message has any marshaler. + for _, message := range message.Messages { + if g.messageHasAnyMarshaler(message) { + return true + } + } + + return false +} + +func (g *generator) genMessage(message *protogen.Message) { + // Generate marshalers and unmarshalers for all enums defined in the message. + for _, enum := range message.Enums { + g.genEnum(enum) + } + + // Generate marshalers and unmarshalers for all sub-messages defined in the message. + for _, message := range message.Messages { + g.genMessage(message) + } + + // Generate marshaler for the message itself, if it has one. + if g.messageHasMarshaler(message) { + g.genMessageMarshaler(message) + } + + // Generate unmarshaler for the message itself, if it has one. + if g.messageHasUnmarshaler(message) { + g.genMessageUnmarshaler(message) + } +} + +func fieldIsNullable(field *protogen.Field) bool { + // Typically, only message fields are nullable (use pointers). + nullable := field.Desc.Kind() == protoreflect.MessageKind + + // If we use gogo, the nullability of fields (messages, but also bytes fields with custom types) is controlled with the (gogoproto.nullable) option. + if Params.Lang == "gogo" { + if proto.HasExtension(field.Desc.Options(), gogoproto.E_Customtype) { + nullable = true + } + if proto.HasExtension(field.Desc.Options(), gogoproto.E_Nullable) { + nullable = proto.GetExtension(field.Desc.Options(), gogoproto.E_Nullable).(bool) + } + } + + return nullable +} + +func fieldGoName(field *protogen.Field) interface{} { + var fieldGoName interface{} = field.GoName + if Params.Lang == "gogo" { + // If we use gogo, the GoName of a field can be overridden with the (gogoproto.customname) option. + if proto.HasExtension(field.Desc.Options(), gogoproto.E_Customname) { + fieldGoName = proto.GetExtension(field.Desc.Options(), gogoproto.E_Customname).(string) + } + // Fields with the (gogoproto.embed) option should use the name of the embedded message. + if proto.HasExtension(field.Desc.Options(), gogoproto.E_Embed) { + if proto.GetExtension(field.Desc.Options(), gogoproto.E_Embed).(bool) { + fieldGoName = field.Message.GoIdent + } + } + } + return fieldGoName +} + +func fieldCustomType(field *protogen.Field) *protogen.GoIdent { + if Params.Lang == "gogo" { + // If we use gogo, the type of a field can be overridden with the (gogoproto.customtype) option. + if proto.HasExtension(field.Desc.Options(), gogoproto.E_Customtype) { + return parseGoIdent(proto.GetExtension(field.Desc.Options(), gogoproto.E_Customtype).(string)) + } + } + return nil +} + +func ifThenElse(condition bool, ifTrue, ifFalse string) string { + if condition { + return ifTrue + } + return ifFalse +} + +// goTypeForField returns the name of the Go type that corresponds to the type of a given field. +func (g *generator) goTypeForField(field *protogen.Field) interface{} { + switch field.Desc.Kind() { + case protoreflect.BoolKind: + return "bool" + case protoreflect.EnumKind: + return field.Enum.GoIdent + case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: + return "int32" + case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: + return "uint32" + case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: + return "int64" + case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: + return "uint64" + case protoreflect.FloatKind: + return "float32" + case protoreflect.DoubleKind: + return "float64" + case protoreflect.StringKind: + return "string" + case protoreflect.BytesKind: + return "[]byte" + case protoreflect.MessageKind: + return field.Message.GoIdent + default: + g.gen.Error(fmt.Errorf("unsupported field kind %q", field.Desc.Kind())) + return "" + } +} + +// libNameForField returns the name used in the protojson func that corresponds to the type of a given field. +func (g *generator) libNameForField(field *protogen.Field) string { + switch field.Desc.Kind() { + case protoreflect.BoolKind: + return "Bool" + case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: + return "Int32" + case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: + return "Uint32" + case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: + return "Int64" + case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: + return "Uint64" + case protoreflect.FloatKind: + return "Float32" + case protoreflect.DoubleKind: + return "Float64" + case protoreflect.StringKind: + return "String" + case protoreflect.BytesKind: + return "Bytes" + default: + g.gen.Error(fmt.Errorf("unsupported field kind %q", field.Desc.Kind())) + return "" + } +} + +// parseGoIdent parses a custom type and returns a GoIdent for it. +// If it's unable to parse the custom type, it returns nil. +func parseGoIdent(customtype string) *protogen.GoIdent { + if customtype == "" { + return nil + } + i := strings.LastIndex(customtype, ".") + ident := protogen.GoImportPath(customtype[:i]).Ident(customtype[i+1:]) + return &ident +} + +// messageIsWrapper returns true if the given message is a wrapper type. +// This is the case for well known wrapper types (google.protobuf.XXXValue) +// and for messages that have the (thethings.json.message) option with wrapper = true. +func messageIsWrapper(message *protogen.Message) bool { + switch message.Desc.FullName() { + case "google.protobuf.DoubleValue", + "google.protobuf.FloatValue", + "google.protobuf.Int64Value", + "google.protobuf.UInt64Value", + "google.protobuf.Int32Value", + "google.protobuf.UInt32Value", + "google.protobuf.BoolValue", + "google.protobuf.StringValue", + "google.protobuf.BytesValue": + return true + } + opts := message.Desc.Options().(*descriptorpb.MessageOptions) + if ext, hasExt := proto.GetExtension(opts, annotations.E_Message).(*annotations.MessageOptions); hasExt { + return ext.GetWrapper() && len(message.Fields) == 1 && message.Fields[0].GoName == "Value" + } + return false +} + +// messageIsWKT returns true if the given message is a well-known type. +func messageIsWKT(message *protogen.Message) bool { + return strings.HasPrefix(string(message.Desc.FullName()), "google.protobuf.") +} diff --git a/internal/gen/messages_marshaler.go b/internal/gen/messages_marshaler.go new file mode 100644 index 00000000..4da3cc19 --- /dev/null +++ b/internal/gen/messages_marshaler.go @@ -0,0 +1,477 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package gen + +import ( + "fmt" + + "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + "github.com/TheThingsIndustries/protoc-gen-go-json/internal/gogoproto" + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/types/descriptorpb" +) + +func (g *generator) messageHasMarshaler(message *protogen.Message, visited ...*protogen.Message) bool { + // Since we're going to be looking at the fields of this message, it's possible that there will be cycles. + // If that's the case, we'll return false here so that the caller can continue with the next field. + for _, visited := range visited { + if message == visited { + return false + } + } + + // No code is generated for map entries, so we also don't need to generate marshalers. + if message.Desc.IsMapEntry() { + return false + } + + var generateMarshaler bool + + // If the file has the (thethings.json.file) option, and marshaler_all is set, we start with that. + fileOpts := message.Desc.ParentFile().Options().(*descriptorpb.FileOptions) + if proto.HasExtension(fileOpts, annotations.E_File) { + if fileExt, ok := proto.GetExtension(fileOpts, annotations.E_File).(*annotations.FileOptions); ok { + if fileExt.MarshalerAll != nil { + generateMarshaler = *fileExt.MarshalerAll + } + } + } + + for _, field := range message.Fields { + // If the field has the (thethings.json.field) option, and marshaler_func is set, we need to generate a marshaler for the message. + fieldOpts := field.Desc.Options().(*descriptorpb.FieldOptions) + if proto.HasExtension(fieldOpts, annotations.E_Field) { + if fieldExt, ok := proto.GetExtension(fieldOpts, annotations.E_Field).(*annotations.FieldOptions); ok { + if fieldExt.MarshalerFunc != nil { + generateMarshaler = true + } + } + } + + // If the field is an enum, and the enum has a marshaler, we need to generate a marshaler for the message. + if field.Enum != nil && g.enumHasMarshaler(field.Enum) { + generateMarshaler = true + } + + // If the field is a message, and that message has a marshaler, we need to generate a marshaler. + if field.Message != nil && g.messageHasMarshaler(field.Message, append(visited, message)...) { + generateMarshaler = true + } + } + + // If the message has the (thethings.json.message) option and is a wrapper, we need to generate a marshaler. + // Finally, the marshaler field can still override to true or false if explicitly set. + messageOpts := message.Desc.Options().(*descriptorpb.MessageOptions) + if proto.HasExtension(messageOpts, annotations.E_Message) { + if messageExt, ok := proto.GetExtension(messageOpts, annotations.E_Message).(*annotations.MessageOptions); ok { + if messageExt.GetWrapper() { + generateMarshaler = true + } + if messageExt.Marshaler != nil { + generateMarshaler = *messageExt.Marshaler + } + } + } + + return generateMarshaler +} + +func (g *generator) genMessageMarshaler(message *protogen.Message) { + g.P("// MarshalProtoJSON marshals the ", message.GoIdent, " message to JSON.") + g.P("func (x *", message.GoIdent, ") MarshalProtoJSON(s *", jsonPluginPackage.Ident("MarshalState"), ") {") + + g.P("if x == nil {") + g.P("s.WriteNil()") + g.P("return") + g.P("}") + + // If the message is a wrapper type, we operate directly on the first field (named Value) inside it. + if messageIsWrapper(message) { + field := message.Fields[0] + switch field.Desc.Kind() { + default: + // Scalar types can be written by the library. + g.P("s.Write", g.libNameForField(field), "(x.Value)") + case protoreflect.EnumKind: + if g.enumHasMarshaler(field.Enum) { + // If the wrapped field is of type enum, and the enum has a marshaler, use that. + g.P(`x.Value.MarshalProtoJSON(s)`) + } else { + // Otherwise we let the library write the enum. + g.P("s.WriteEnum(int32(x.Value), ", field.Enum.GoIdent, "_name)") + } + } + g.P("return") + g.P("}") // end func (x *{message.GoIdent}) MarshalProtoJSON() + g.P() + return + } + + g.P("s.WriteObjectStart()") + + // If the message doesn't have any fields, there's nothing to do. + if len(message.Fields) == 0 { + g.P("s.WriteObjectEnd()") + g.P("}") // end func (x *{message.GoIdent}) MarshalProtoJSON() + g.P() + return + } + + // wroteField keeps track of whether we wrote a field, so that we know when to add a comma before the next. + g.P("var wroteField bool") + +nextField: + for _, field := range message.Fields { + var ( + pluginPackage = golangPluginPackage + fieldGoName interface{} = fieldGoName(field) + nullable = fieldIsNullable(field) + customtype = fieldCustomType(field) + marshalerFunc *protogen.GoIdent + ) + fieldOpts := field.Desc.Options() + if Params.Lang == "gogo" { + pluginPackage = gogoPluginPackage + } else { + if proto.HasExtension(fieldOpts, annotations.E_Field) { + marshalerFunc = parseGoIdent(proto.GetExtension(field.Desc.Options(), annotations.E_Field).(*annotations.FieldOptions).GetMarshalerFunc()) + } + } + + if field.Desc.IsMap() { + // If the field is a map, the field type is a MapEntry message. + // In the MapEntry message, the first field is the key, and the second field is the value. + key := field.Message.Fields[0] + value := field.Message.Fields[1] + + // We emit the field if the map is not nil or if it's specified in the field mask. + g.P("if x.", fieldGoName, ` != nil || s.HasField("`, field.Desc.Name(), `") {`) + + // Write a comma if this isn't the first field. + g.P("s.WriteMoreIf(&wroteField)") + + // Write the field name and a colon. + g.P(`s.WriteObjectField("`, field.Desc.Name(), `")`) + + // If the map value has a custom marshaler, call that and continue with the next field. + if marshalerFunc != nil { + g.P(*marshalerFunc, `(s.WithField("`, field.Desc.Name(), `"), x.`, fieldGoName, ")") + g.P("}") // end if x.{fieldGoName} != nil { + continue nextField + } + + g.P("s.WriteObjectStart()") + + // wroteElement keeps track of whether we wrote an element of the map, so that we know when to add a comma before the next. + g.P("var wroteElement bool") + + g.P("for k, v := range x.", fieldGoName, " {") + + // Write a comma if this isn't the first element of the map. + g.P("s.WriteMoreIf(&wroteElement)") + + // Write the key and a a colon. Since they key can be of other types than string, we use the library to convert those. + g.P("s.WriteObject", g.libNameForField(key), "Field(k)") + + switch value.Desc.Kind() { + default: + // Scalar types can be written by the library. + g.P("s.Write", g.libNameForField(value), "(v)") + case protoreflect.EnumKind: + if g.enumHasMarshaler(value.Enum) { + // If the map value is of type enum, and the enum has a marshaler, use that. + g.P("v.MarshalProtoJSON(s)") + } else { + // Otherwise we write the enum with the standard settings. + g.P("s.WriteEnum(int32(v), ", value.Enum.GoIdent, "_name)") + } + case protoreflect.MessageKind: + switch { + case g.messageHasMarshaler(value.Message): + // If the map value is of type message, and the message has a marshaler, use that. + g.P(`v.MarshalProtoJSON(s.WithField("`, field.Desc.Name(), `"))`) + case messageIsWrapper(value.Message): + // If the map value is a wrapper, write the wrapped value. + g.writeWrapperValue(value.Message, "v") + case messageIsWKT(value.Message): + // If the map value is a WKT, write the WKT. + g.writeWKTValue(field, value.Message, "v") + default: + // Otherwise delegate to the library. + g.P("// NOTE: ", value.Message.GoIdent.GoName, " does not seem to implement MarshalProtoJSON.") + g.P(pluginPackage.Ident("MarshalMessage"), "(s, v)") + } + } + + g.P("}") // end for k, v := range x.{fieldGoName} { + g.P("s.WriteObjectEnd()") + g.P("}") // end if x.{fieldGoName} != nil { + + continue nextField + } + + if field.Desc.IsList() { + // We emit the field if the list is not empty or if it's specified in the field mask. + g.P("if len(x.", fieldGoName, `) > 0 || s.HasField("`, field.Desc.Name(), `") {`) + + // Write a comma if this isn't the first field. + g.P("s.WriteMoreIf(&wroteField)") + + // Write the field name and a colon. + g.P(`s.WriteObjectField("`, field.Desc.Name(), `")`) + + // If the field has a custom marshaler, call that and continue with the next field. + if marshalerFunc != nil { + g.P(*marshalerFunc, `(s.WithField("`, field.Desc.Name(), `"), x.`, fieldGoName, ")") + g.P("}") // end if len(x.{fieldGoName}) > 0 { + + continue nextField + } + + // If the field has a custom type, call MarshalProtoJSON for each element. + if customtype != nil { + g.P("s.WriteArrayStart()") + + // wroteElement keeps track of whether we wrote an element of the list, so that we know when to add a comma before the next. + g.P("var wroteElement bool") + + g.P("for _, element := range x.", fieldGoName, " {") + + // Write a comma if this isn't the first element of the list. + g.P("s.WriteMoreIf(&wroteElement)") + + g.P(`element.MarshalProtoJSON(s.WithField("`, field.Desc.Name(), `"))`) + + g.P("}") // end for _, element := range x.{fieldGoName} { + g.P("s.WriteArrayEnd()") + g.P("}") // end if len(x.{fieldGoName}) > 0 { + + continue nextField + } + + switch field.Desc.Kind() { + default: + g.P("s.Write", g.libNameForField(field), "Array(x.", fieldGoName, ")") + case protoreflect.EnumKind: + g.P("s.WriteArrayStart()") + + // wroteElement keeps track of whether we wrote an element of the list, so that we know when to add a comma before the next. + g.P("var wroteElement bool") + + g.P("for _, element := range x.", fieldGoName, " {") + + // Write a comma if this isn't the first element of the list. + g.P("s.WriteMoreIf(&wroteElement)") + + if g.enumHasMarshaler(field.Enum) { + // If the field is of type enum, and the enum has a marshaler, use that. + g.P("element.MarshalProtoJSON(s)") + } else { + // Otherwise we write the enum with the standard settings. + g.P("s.WriteEnum(int32(element), ", field.Enum.GoIdent, "_name)") + } + + g.P("}") // end for _, element := range x.{fieldGoName} { + g.P("s.WriteArrayEnd()") + case protoreflect.MessageKind: + g.P("s.WriteArrayStart()") + + // wroteElement keeps track of whether we wrote an element of the list, so that we know when to add a comma before the next. + g.P("var wroteElement bool") + + g.P("for _, element := range x.", fieldGoName, " {") + + // Write a comma if this isn't the first element of the list. + g.P("s.WriteMoreIf(&wroteElement)") + + switch { + case g.messageHasMarshaler(field.Message): + // If the list element is of type message, and the message has a marshaler, use that. + g.P(`element.MarshalProtoJSON(s.WithField("`, field.Desc.Name(), `"))`) + case messageIsWrapper(field.Message): + // If the list element is a wrapper, write the wrapped value. + g.writeWrapperValue(field.Message, "element") + case messageIsWKT(field.Message): + // If the list element is a WKT, write the WKT. + g.writeWKTValue(field, field.Message, "element") + default: + // Otherwise delegate to the library. + g.P("// NOTE: ", field.Message.GoIdent.GoName, " does not seem to implement MarshalProtoJSON.") + g.P(pluginPackage.Ident("MarshalMessage"), "(s, ", ifThenElse(nullable, "", "&"), "element)") + } + + g.P("}") // end for _, element := range x.{fieldGoName} { + g.P("s.WriteArrayEnd()") + } + + g.P("}") // end if len(x.{fieldGoName}) > 0 { + + continue nextField + } + + // The identifier of the message is x, but in case of a oneof, we'll be operating on ov. + messageOrOneofIdent := "x" + + // If this is the first field in a oneof, write the if statement that checks for nil + // and start the switch statement for the oneof type. + if field.Oneof != nil && field == field.Oneof.Fields[0] { + // NOTE: we don't support field masks here (yet). + g.P("if x.", field.Oneof.GoName, " != nil {") + g.P("switch ov := x.", field.Oneof.GoName, ".(type) {") + } + + if field.Oneof != nil { + // If we're in a oneof, check if this is the field that's set in the oneof. + g.P("case *", field.GoIdent.GoName, ":") + messageOrOneofIdent = "ov" + } else { + // If we're not in a oneof, start "if not zero value". + if nullable { + // If this field is nullable, we emit it if it's not nil or if it's specified in the field mask. + g.P("if ", messageOrOneofIdent, ".", fieldGoName, ` != nil || s.HasField("`, field.Desc.Name(), `") {`) + } else { + // If this field is not nullable, we emit it if it's not the zero value or if it's specified in the field mask. + switch field.Desc.Kind() { + case protoreflect.BoolKind: + g.P("if ", messageOrOneofIdent, ".", fieldGoName, ` || s.HasField("`, field.Desc.Name(), `") {`) + case protoreflect.EnumKind: + g.P("if ", messageOrOneofIdent, ".", fieldGoName, ` != 0 || s.HasField("`, field.Desc.Name(), `") {`) + case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind, + protoreflect.Uint32Kind, protoreflect.Fixed32Kind, + protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind, + protoreflect.Uint64Kind, protoreflect.Fixed64Kind, + protoreflect.FloatKind, + protoreflect.DoubleKind: + g.P("if ", messageOrOneofIdent, ".", fieldGoName, ` != 0 || s.HasField("`, field.Desc.Name(), `") {`) + case protoreflect.StringKind: + g.P("if ", messageOrOneofIdent, ".", fieldGoName, ` != "" || s.HasField("`, field.Desc.Name(), `") {`) + case protoreflect.BytesKind: + g.P("if len(", messageOrOneofIdent, ".", fieldGoName, `) > 0 || s.HasField("`, field.Desc.Name(), `") {`) + case protoreflect.MessageKind: + // For not-nullable messages we have a dummy check. + g.P("if true { // (gogoproto.nullable) = false") + } + } + } + + // Write a comma if this isn't the first field. + g.P("s.WriteMoreIf(&wroteField)") + + // Write the field name and a colon. + g.P(`s.WriteObjectField("`, field.Desc.Name(), `")`) + + if marshalerFunc != nil { + // If the field has a custom marshaler, call that. + g.P(*marshalerFunc, `(s.WithField("`, field.Desc.Name(), `"), x.`, fieldGoName, ")") + } else if customtype != nil { + // If the field has a custom type, call MarshalProtoJSON for it. + g.P(messageOrOneofIdent, ".", fieldGoName, `.MarshalProtoJSON(s.WithField("`, field.Desc.Name(), `"))`) + } else { + switch field.Desc.Kind() { + default: + // Scalar types can be written by the library. + g.P("s.Write", g.libNameForField(field), "(", messageOrOneofIdent, ".", fieldGoName, ")") + case protoreflect.EnumKind: + if g.enumHasMarshaler(field.Enum) { + // If the field is of type enum, and the enum has a marshaler, use that. + g.P(messageOrOneofIdent, ".", fieldGoName, ".MarshalProtoJSON(s)") + } else { + // Otherwise we write the enum with the standard settings. + g.P("s.WriteEnum(int32(", messageOrOneofIdent, ".", fieldGoName, "), ", field.Enum.GoIdent, "_name)") + } + case protoreflect.MessageKind: + switch { + case g.messageHasMarshaler(field.Message): + // If the field is of type message, and the message has a marshaler, use that. + g.P(messageOrOneofIdent, ".", fieldGoName, `.MarshalProtoJSON(s.WithField("`, field.Desc.Name(), `"))`) + case messageIsWrapper(field.Message): + // If the field is a wrapper, write the wrapped value. + g.writeWrapperValue(field.Message, fmt.Sprintf("%s.%s", messageOrOneofIdent, fieldGoName)) + case messageIsWKT(field.Message): + // If the field is a WKT, write the WKT. + g.writeWKTValue(field, field.Message, fmt.Sprintf("%s.%s", messageOrOneofIdent, fieldGoName)) + default: + // Otherwise delegate to the library. + g.P("// NOTE: ", field.Message.GoIdent.GoName, " does not seem to implement MarshalProtoJSON.") + g.P(pluginPackage.Ident("MarshalMessage"), "(s, ", ifThenElse(nullable, "", "&"), messageOrOneofIdent, ".", fieldGoName, ")") + } + } + } + + // If we're not in a oneof, end the "if not zero". + if field.Oneof == nil { + g.P("}") // end if x.{field.GoName} != zero value { + } + + // If this is the last field in the oneof, close the switch and if statements. + if field.Oneof != nil && field == field.Oneof.Fields[len(field.Oneof.Fields)-1] { + g.P("}") // end switch v := x.{field.Oneof.GoName}.(type) { + g.P("}") // end if x.{field.Oneof.GoName} != nil { + } + } + + g.P("s.WriteObjectEnd()") + + g.P("}") // end func (x *{message.GoIdent}) MarshalProtoJSON() + g.P() +} + +func (g *generator) writeWrapperValue(message *protogen.Message, ident string) { + g.P("if ", ident, " == nil {") + g.P("s.WriteNil()") + g.P("} else {") + // Wrapper values are scalar types, and scalar types can be written by the library. + g.P("s.Write", g.libNameForField(message.Fields[0]), "(", ident, ".Value)") + g.P("}") // end if {ident} == nil { +} + +func (g *generator) writeWKTValue(field *protogen.Field, message *protogen.Message, ident string) { + nullable := fieldIsNullable(field) + if nullable { + g.P("if ", ident, " == nil {") + g.P("s.WriteNil()") + g.P("} else {") + } + pluginPackage := golangPluginPackage + if Params.Lang == "gogo" { + pluginPackage = gogoPluginPackage + } + switch message.Desc.FullName() { + case "google.protobuf.Any": + g.P(pluginPackage.Ident("MarshalAny"), "(s, ", ident, ")") + case "google.protobuf.Empty": + g.P(pluginPackage.Ident("MarshalEmpty"), "(s, ", ident, ")") + case "google.protobuf.FieldMask": + g.P(pluginPackage.Ident("MarshalFieldMask"), "(s, ", ident, ")") + case "google.protobuf.Struct": + g.P(pluginPackage.Ident("MarshalStruct"), "(s, ", ident, ")") + case "google.protobuf.Value": + g.P(pluginPackage.Ident("MarshalValue"), "(s, ", ident, ")") + case "google.protobuf.ListValue": + g.P(pluginPackage.Ident("MarshalListValue"), "(s, ", ident, ")") + case "google.protobuf.Timestamp": + if Params.Lang == "gogo" && proto.HasExtension(field.Desc.Options(), gogoproto.E_Stdtime) && proto.GetExtension(field.Desc.Options(), gogoproto.E_Stdtime).(bool) { + // If the file has the (gogoproto.stdtime) option, marshal the Go time directly. + g.P("s.WriteTime(", ifThenElse(nullable, "*", ""), ident, ")") + } else { + // Otherwise delegate to the library. + g.P(pluginPackage.Ident("MarshalTimestamp"), "(s, ", ident, ")") + } + case "google.protobuf.Duration": + if Params.Lang == "gogo" && proto.HasExtension(field.Desc.Options(), gogoproto.E_Stdduration) && proto.GetExtension(field.Desc.Options(), gogoproto.E_Stdduration).(bool) { + // If the file has the (gogoproto.stdduration) option, marshal the Go duration directly. + g.P("s.WriteDuration(", ifThenElse(nullable, "*", ""), ident, ")") + } else { + // Otherwise delegate to the library. + g.P(pluginPackage.Ident("MarshalDuration"), "(s, ", ident, ")") + } + default: + g.gen.Error(fmt.Errorf("unsupported WKT %q", message.Desc.FullName())) + } + if nullable { + g.P("}") // end if {ident} == nil { + } +} diff --git a/internal/gen/messages_unmarshaler.go b/internal/gen/messages_unmarshaler.go new file mode 100644 index 00000000..bf3f08b1 --- /dev/null +++ b/internal/gen/messages_unmarshaler.go @@ -0,0 +1,455 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package gen + +import ( + "fmt" + + "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + "github.com/TheThingsIndustries/protoc-gen-go-json/internal/gogoproto" + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/types/descriptorpb" +) + +func (g *generator) messageHasUnmarshaler(message *protogen.Message, visited ...*protogen.Message) bool { + // Since we're going to be looking at the fields of this message, it's possible that there will be cycles. + // If that's the case, we'll return false here so that the caller can continue with the next field. + for _, visited := range visited { + if message == visited { + return false + } + } + + // No code is generated for map entries, so we also don't need to generate unmarshalers. + if message.Desc.IsMapEntry() { + return false + } + + var generateUnmarshaler bool + + // If the file has the (thethings.json.file) option, and unmarshaler_all is set, we start with that. + fileOpts := message.Desc.ParentFile().Options().(*descriptorpb.FileOptions) + if proto.HasExtension(fileOpts, annotations.E_File) { + if fileExt, ok := proto.GetExtension(fileOpts, annotations.E_File).(*annotations.FileOptions); ok { + if fileExt.UnmarshalerAll != nil { + generateUnmarshaler = *fileExt.UnmarshalerAll + } + } + } + + for _, field := range message.Fields { + // If the field has the (thethings.json.field) option, and unmarshaler_func is set, we need to generate an unmarshaler for the message. + fieldOpts := field.Desc.Options().(*descriptorpb.FieldOptions) + if proto.HasExtension(fieldOpts, annotations.E_Field) { + if fieldExt, ok := proto.GetExtension(fieldOpts, annotations.E_Field).(*annotations.FieldOptions); ok { + if fieldExt.UnmarshalerFunc != nil { + generateUnmarshaler = true + } + } + } + + // If the field is an enum, and the enum has an unmarshaler, we need to generate an unmarshaler for the message. + if field.Enum != nil && g.enumHasUnmarshaler(field.Enum) { + generateUnmarshaler = true + } + + // If the field is a message, and that message has an unmarshaler, we need to generate an unmarshaler. + if field.Message != nil && g.messageHasUnmarshaler(field.Message, append(visited, message)...) { + generateUnmarshaler = true + } + } + + // If the message has the (thethings.json.message) option and is a wrapper, we need to generate an unmarshaler. + // Finally, the unmarshaler field can still override to true or false if explicitly set. + messageOpts := message.Desc.Options().(*descriptorpb.MessageOptions) + if proto.HasExtension(messageOpts, annotations.E_Message) { + if messageExt, ok := proto.GetExtension(messageOpts, annotations.E_Message).(*annotations.MessageOptions); ok { + if messageExt.GetWrapper() { + generateUnmarshaler = true + } + if messageExt.Unmarshaler != nil { + generateUnmarshaler = *messageExt.Unmarshaler + } + } + } + + return generateUnmarshaler +} + +func (g *generator) genMessageUnmarshaler(message *protogen.Message) { + g.P("// UnmarshalProtoJSON unmarshals the ", message.GoIdent, " message from JSON.") + g.P("func (x *", message.GoIdent, ") UnmarshalProtoJSON(s *", jsonPluginPackage.Ident("UnmarshalState"), ") {") + + // If we se a null, there's nothing to do. + g.P("if s.ReadNil() {") + g.P("return") + g.P("}") + + // If the message doesn't have any fields, there's nothing to do. + if len(message.Fields) == 0 { + g.P("}") // end func (x *{message.GoIdent}) MarshalProtoJSON() + g.P() + return + } + + // If the message is a wrapper type, we operate directly on the first field (named Value) inside it. + if messageIsWrapper(message) { + field := message.Fields[0] + switch field.Desc.Kind() { + default: + // Scalar types can be read by the library. + g.P("x.Value = s.Read", g.libNameForField(field), "()") + case protoreflect.EnumKind: + if g.enumHasUnmarshaler(field.Enum) { + // If the wrapped field is of type enum, and the enum has an unmarshaler, use that. + g.P(`x.Value.UnmarshalProtoJSON(s)`) + } else { + // Otherwise we let the library read the enum. + g.P("x.Value = ", field.Enum.GoIdent, "(s.ReadEnum(", field.Enum.GoIdent, "_value))") + } + } + g.P("return") + g.P("}") // end func (x *{message.GoIdent}) MarshalProtoJSON() + g.P() + return + } + + g.P("s.ReadObject(func(key string) {") + g.P("switch key {") + g.P("default:") + g.P("s.ReadAny() // ignore unknown field") + +nextField: + for _, field := range message.Fields { + var ( + pluginPackage = golangPluginPackage + fieldGoName interface{} = fieldGoName(field) + nullable = fieldIsNullable(field) + customtype = fieldCustomType(field) + unmarshalerFunc *protogen.GoIdent + ) + fieldOpts := field.Desc.Options() + if Params.Lang == "gogo" { + pluginPackage = gogoPluginPackage + } else { + if proto.HasExtension(fieldOpts, annotations.E_Field) { + unmarshalerFunc = parseGoIdent(proto.GetExtension(field.Desc.Options(), annotations.E_Field).(*annotations.FieldOptions).GetUnmarshalerFunc()) + } + } + + // We need to match both the snake case field name and the camel case JSON name. + // If those are the same, we only need to match one. + if string(field.Desc.Name()) != field.Desc.JSONName() { + g.P(`case "`, field.Desc.Name(), `", "`, field.Desc.JSONName(), `":`) + } else { + g.P(`case "`, field.Desc.Name(), `":`) + } + + // For sub-messages, field mask handling will be handled by the unmarshaler of the sub-message. + // For scalar types and fields that don't support field masks (lists, maps, fields without unmarshalers) we do field mask handling here. + delegateMask := "true" + if field.Message == nil || field.Desc.IsList() || field.Desc.IsMap() || !g.messageHasUnmarshaler(field.Message) || messageIsWKT(field.Message) || messageIsWrapper(field.Message) { + delegateMask = "false" + g.P(`s.AddField("`, field.Desc.Name(), `")`) + } + + // If the field has a custom unmarshaler, call that and continue with the next field. + if unmarshalerFunc != nil { + g.P("x.", fieldGoName, " = ", *unmarshalerFunc, `(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) + continue nextField + } + + if field.Desc.IsMap() { + // If the field is a map, the field type is a MapEntry message. + // In the MapEntry message, the first field is the key, and the second field is the value. + key := field.Message.Fields[0] + value := field.Message.Fields[1] + + // Allocate an empty map[T(key)]T(value). + g.P("x.", fieldGoName, " = make(map[", g.goTypeForField(key), "]", ifThenElse(fieldIsNullable(value), "*", ""), g.goTypeForField(value), ")") + + // Tell the library to read a map with keys of the given type, passing our handler func that will be called for each key. + g.P("s.Read", g.libNameForField(key), "Map(func(key ", g.goTypeForField(key), ") {") + + switch value.Desc.Kind() { + default: + // Scalar types can be read by the library. + g.P("x.", fieldGoName, "[key] = s.Read", g.libNameForField(value), "()") + case protoreflect.EnumKind: + if g.enumHasUnmarshaler(value.Enum) { + // If the map value is of type enum, and the enum has an unmarshaler, + // allocate a zero enum, call the unmarshaler, and set the map value for key to the enum. + g.P("var v ", value.Enum.GoIdent) + g.P(`v.UnmarshalProtoJSON(s)`) + g.P("x.", fieldGoName, "[key] = v") + } else { + // Otherwise we let the library read the enum. + g.P("x.", fieldGoName, "[key] = ", value.Enum.GoIdent, "(s.ReadEnum(", value.Enum.GoIdent, "_value))") + } + case protoreflect.MessageKind: + switch { + case g.messageHasUnmarshaler(value.Message): + // If the map value is of type message, and the message has a marshaler, + // allocate a zero message, call the unmarshaler and set the map value for the key to the message. + g.P("var v ", value.Message.GoIdent) + g.P(`v.UnmarshalProtoJSON(s)`) + g.P("x.", fieldGoName, "[key] = &v") + case messageIsWrapper(value.Message): + // If the map value is a wrapper, and we read null, set the map value for the key to nil. + // Otherwise read the wrapped value, and if successful, set the map value for the key to the wrapped value. + g.P("if s.ReadNil() {") + g.P("x.", fieldGoName, "[key] = nil") + g.P("} else {") + g.P("v := ", g.readWrapperValue(value.Message)) + g.P("if s.Err() != nil {") + g.P("return") + g.P("}") + g.P("x.", fieldGoName, "[key] = &", value.Message.GoIdent, "{Value: v}") + g.P("}") // end if s.ReadNil() { + case messageIsWKT(value.Message): + // If the map value is a WKT, read the WKT. + g.P("v := ", g.readWKTValue(field, value.Message)) + g.P("if s.Err() != nil {") + g.P("return") + g.P("}") + g.P("x.", fieldGoName, "[key] = ", ifThenElse(nullable, "", "*"), "v") + default: + // Otherwise, delegate to the library. + g.P("// NOTE: ", value.Message.GoIdent.GoName, " does not seem to implement UnmarshalProtoJSON.") + g.P("var v ", value.Message.GoIdent) + g.P(pluginPackage.Ident("UnmarshalMessage"), "(s, &v)") + g.P("x.", fieldGoName, "[key] = &v") + } + } + + g.P("})") // end s.Read{key}Map() + continue nextField + } + + if field.Desc.IsList() { + if customtype != nil { + // If the field has a custom type, for each element, we will + // allocate a zero value, call the unmarshaler and append the value to the list. + g.P("s.ReadArray(func() {") + g.P("var v ", *customtype) + g.P(`v.UnmarshalProtoJSON(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", v)") + g.P("})") + } else { + switch field.Desc.Kind() { + default: + // Lists of scalar types can be read by the library. + g.P("x.", fieldGoName, " = s.Read", g.libNameForField(field), "Array()") + case protoreflect.EnumKind: + g.P("s.ReadArray(func() {") + if g.enumHasUnmarshaler(field.Enum) { + // If the list value is of type enum, and the enum has an unmarshaler, + // allocate a zero enum, call the unmarshaler, and append the enum to the list. + g.P("var v ", field.Enum.GoIdent) + g.P(`v.UnmarshalProtoJSON(s)`) + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", v)") + } else { + // Otherwise we let the library read the enum. + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", ", field.Enum.GoIdent, "(s.ReadEnum(", field.Enum.GoIdent, "_value)))") + } + g.P("})") // end s.ReadArray() + case protoreflect.MessageKind: + g.P("s.ReadArray(func() {") + switch { + case g.messageHasUnmarshaler(field.Message): + if nullable { + // If we read nil, append nil and return so that we can continue with the next key. + g.P("if s.ReadNil() {") + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", nil)") + g.P("return") + g.P("}") // end if s.ReadNil() { + } + // Allocate a zero message, call the unmarshaler and append the message to the list. + g.P("v := ", ifThenElse(nullable, "&", ""), field.Message.GoIdent, "{}") + g.P(`v.UnmarshalProtoJSON(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) + g.P("if s.Err() != nil {") + g.P("return") + g.P("}") + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", v)") + case messageIsWrapper(field.Message): + if nullable { + // If we read nil, append nil and return so that we can continue with the next key. + g.P("if s.ReadNil() {") + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", nil)") + g.P("return") + g.P("}") // end if s.ReadNil() { + } + // Read the wrapped value, and if successful, append the wrapped value to the list. + g.P("v := ", g.readWrapperValue(field.Message)) + g.P("if s.Err() != nil {") + g.P("return") + g.P("}") + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", &", field.Message.GoIdent, "{Value: v})") + case messageIsWKT(field.Message): + // If the list value is a WKT, read the WKT, and if successful, append it to the list. + g.P("v := ", g.readWKTValue(field, field.Message)) + g.P("if s.Err() != nil {") + g.P("return") + g.P("}") + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", ", ifThenElse(nullable, "", "*"), "v)") + default: + // Otherwise, delegate to the library. + g.P("// NOTE: ", field.Message.GoIdent.GoName, " does not seem to implement UnmarshalProtoJSON.") + g.P("var v ", field.Message.GoIdent) + g.P(pluginPackage.Ident("UnmarshalMessage"), "(s, &v)") + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", ", ifThenElse(nullable, "&", ""), "v)") + } + + g.P("})") // end s.ReadArray() + } + } + + continue nextField + } + + // The identifier of the message is x, but in case of a oneof, we'll be operating on ov. + messageOrOneofIdent := "x" + + // If this field is in a oneof, allocate a new oneof value wrapper. + if field.Oneof != nil { + g.P("ov := &", field.GoIdent.GoName, "{}") + messageOrOneofIdent = "ov" + } + + if customtype != nil { + if nullable { + g.P("if !s.ReadNil() {") + // Set the field to a newly allocated custom type. + g.P(messageOrOneofIdent, ".", fieldGoName, " = &", *customtype, "{}") + // Call UnmarshalProtoJSON on the field. + g.P(messageOrOneofIdent, ".", fieldGoName, `.UnmarshalProtoJSON(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) + g.P("}") + } else { + // Call UnmarshalProtoJSON on the field. + g.P(messageOrOneofIdent, ".", fieldGoName, `.UnmarshalProtoJSON(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) + } + } else { + switch field.Desc.Kind() { + default: + // Scalar types can be read by the library. + g.P(messageOrOneofIdent, ".", fieldGoName, " = s.Read", g.libNameForField(field), "()") + case protoreflect.EnumKind: + if g.enumHasUnmarshaler(field.Enum) { + // If the field is of type enum, and the enum has an unmarshaler, call the unmarshaler. + g.P(messageOrOneofIdent, ".", fieldGoName, ".UnmarshalProtoJSON(s)") + } else { + // Otherwise we let the library read the enum. + g.P(messageOrOneofIdent, ".", fieldGoName, " = ", field.Enum.GoIdent, "(s.ReadEnum(", field.Enum.GoIdent, "_value))") + } + case protoreflect.MessageKind: + switch { + case g.messageHasUnmarshaler(field.Message): + g.P("if !s.ReadNil() {") + if nullable { + // Set the field (or enum wrapper) to a newly allocated custom type. + g.P(messageOrOneofIdent, ".", fieldGoName, " = &", field.Message.GoIdent, "{}") + } + // Call UnmarshalProtoJSON on the field. + g.P(messageOrOneofIdent, ".", fieldGoName, `.UnmarshalProtoJSON(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) + g.P("}") // end if !s.ReadNil() { + case messageIsWrapper(field.Message): + g.P("if !s.ReadNil() {") + // Read the wrapped value, and if successful, set the wrapped value in the field. + g.P("v := ", g.readWrapperValue(field.Message)) + g.P("if s.Err() != nil {") + g.P("return") + g.P("}") + g.P(messageOrOneofIdent, ".", fieldGoName, " = &", field.Message.GoIdent, "{Value: v}") + g.P("}") // end if !s.ReadNil() { + case messageIsWKT(field.Message): + // Read the WKT, and if successful, set it in the field. + g.P("v := ", g.readWKTValue(field, field.Message)) + g.P("if s.Err() != nil {") + g.P("return") + g.P("}") + g.P(messageOrOneofIdent, ".", fieldGoName, " = ", ifThenElse(nullable, "", "*"), "v") + default: + // Otherwise, delegate to the library. + g.P("// NOTE: ", field.Message.GoIdent.GoName, " does not seem to implement UnmarshalProtoJSON.") + g.P("var v ", field.Message.GoIdent) + g.P(pluginPackage.Ident("UnmarshalMessage"), "(s, &v)") + g.P(messageOrOneofIdent, ".", fieldGoName, " = ", ifThenElse(nullable, "&", ""), "v") + } + } + } + + if field.Oneof != nil { + // Set the message field to the oneof wrapper. + g.P("x.", field.Oneof.GoName, " = ov") + continue nextField + } + } + + g.P("}") // end switch key { + g.P("})") // end s.ReadObject() + g.P("}") // end func (x *{message.GoIdent}) MarshalProtoJSON() + g.P() +} + +func (g *generator) readWrapperValue(message *protogen.Message) string { + switch message.Desc.FullName() { + case "google.protobuf.DoubleValue": + return "s.ReadFloat64()" + case "google.protobuf.FloatValue": + return "s.ReadFloat32()" + case "google.protobuf.Int64Value": + return "s.ReadInt64()" + case "google.protobuf.UInt64Value": + return "s.ReadUint64()" + case "google.protobuf.Int32Value": + return "s.ReadInt32()" + case "google.protobuf.UInt32Value": + return "s.ReadUint32()" + case "google.protobuf.BoolValue": + return "s.ReadBool()" + case "google.protobuf.StringValue": + return "s.ReadString()" + case "google.protobuf.BytesValue": + return "s.ReadBytes()" + default: + g.gen.Error(fmt.Errorf("unsupported wrapper %q", message.Desc.FullName())) + return "" + } +} + +func (g *generator) readWKTValue(field *protogen.Field, message *protogen.Message) string { + pluginPackage := golangPluginPackage + if Params.Lang == "gogo" { + pluginPackage = gogoPluginPackage + } + switch message.Desc.FullName() { + case "google.protobuf.Any": + return g.QualifiedGoIdent(pluginPackage.Ident("UnmarshalAny")) + "(s)" + case "google.protobuf.Empty": + return g.QualifiedGoIdent(pluginPackage.Ident("UnmarshalEmpty")) + "(s)" + case "google.protobuf.FieldMask": + return g.QualifiedGoIdent(pluginPackage.Ident("UnmarshalFieldMask")) + "(s)" + case "google.protobuf.Struct": + return g.QualifiedGoIdent(pluginPackage.Ident("UnmarshalStruct")) + "(s)" + case "google.protobuf.Value": + return g.QualifiedGoIdent(pluginPackage.Ident("UnmarshalValue")) + "(s)" + case "google.protobuf.ListValue": + return g.QualifiedGoIdent(pluginPackage.Ident("UnmarshalListValue")) + "(s)" + case "google.protobuf.Timestamp": + if Params.Lang == "gogo" && proto.HasExtension(field.Desc.Options(), gogoproto.E_Stdtime) && proto.GetExtension(field.Desc.Options(), gogoproto.E_Stdtime).(bool) { + return "s.ReadTime()" + } + return g.QualifiedGoIdent(pluginPackage.Ident("UnmarshalTimestamp")) + "(s)" + case "google.protobuf.Duration": + if Params.Lang == "gogo" && proto.HasExtension(field.Desc.Options(), gogoproto.E_Stdduration) && proto.GetExtension(field.Desc.Options(), gogoproto.E_Stdduration).(bool) { + return "s.ReadDuration()" + } + return g.QualifiedGoIdent(pluginPackage.Ident("UnmarshalDuration")) + "(s)" + default: + g.gen.Error(fmt.Errorf("unsupported WKT %q", message.Desc.FullName())) + return "" + } +} diff --git a/internal/gogoproto/gogo.pb.go b/internal/gogoproto/gogo.pb.go new file mode 100644 index 00000000..6a013ef2 --- /dev/null +++ b/internal/gogoproto/gogo.pb.go @@ -0,0 +1,1299 @@ +// Protocol Buffers for Go with Gadgets +// +// Copyright (c) 2013, The GoGo Authors. All rights reserved. +// http://github.com/gogo/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.17.3 +// source: internal/gogoproto/gogo.proto + +package gogoproto + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var file_internal_gogoproto_gogo_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.EnumOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 62001, + Name: "gogoproto.goproto_enum_prefix", + Tag: "varint,62001,opt,name=goproto_enum_prefix", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.EnumOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 62021, + Name: "gogoproto.goproto_enum_stringer", + Tag: "varint,62021,opt,name=goproto_enum_stringer", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.EnumOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 62022, + Name: "gogoproto.enum_stringer", + Tag: "varint,62022,opt,name=enum_stringer", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.EnumOptions)(nil), + ExtensionType: (*string)(nil), + Field: 62023, + Name: "gogoproto.enum_customname", + Tag: "bytes,62023,opt,name=enum_customname", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.EnumOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 62024, + Name: "gogoproto.enumdecl", + Tag: "varint,62024,opt,name=enumdecl", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.EnumValueOptions)(nil), + ExtensionType: (*string)(nil), + Field: 66001, + Name: "gogoproto.enumvalue_customname", + Tag: "bytes,66001,opt,name=enumvalue_customname", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63001, + Name: "gogoproto.goproto_getters_all", + Tag: "varint,63001,opt,name=goproto_getters_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63002, + Name: "gogoproto.goproto_enum_prefix_all", + Tag: "varint,63002,opt,name=goproto_enum_prefix_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63003, + Name: "gogoproto.goproto_stringer_all", + Tag: "varint,63003,opt,name=goproto_stringer_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63004, + Name: "gogoproto.verbose_equal_all", + Tag: "varint,63004,opt,name=verbose_equal_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63005, + Name: "gogoproto.face_all", + Tag: "varint,63005,opt,name=face_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63006, + Name: "gogoproto.gostring_all", + Tag: "varint,63006,opt,name=gostring_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63007, + Name: "gogoproto.populate_all", + Tag: "varint,63007,opt,name=populate_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63008, + Name: "gogoproto.stringer_all", + Tag: "varint,63008,opt,name=stringer_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63009, + Name: "gogoproto.onlyone_all", + Tag: "varint,63009,opt,name=onlyone_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63013, + Name: "gogoproto.equal_all", + Tag: "varint,63013,opt,name=equal_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63014, + Name: "gogoproto.description_all", + Tag: "varint,63014,opt,name=description_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63015, + Name: "gogoproto.testgen_all", + Tag: "varint,63015,opt,name=testgen_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63016, + Name: "gogoproto.benchgen_all", + Tag: "varint,63016,opt,name=benchgen_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63017, + Name: "gogoproto.marshaler_all", + Tag: "varint,63017,opt,name=marshaler_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63018, + Name: "gogoproto.unmarshaler_all", + Tag: "varint,63018,opt,name=unmarshaler_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63019, + Name: "gogoproto.stable_marshaler_all", + Tag: "varint,63019,opt,name=stable_marshaler_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63020, + Name: "gogoproto.sizer_all", + Tag: "varint,63020,opt,name=sizer_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63021, + Name: "gogoproto.goproto_enum_stringer_all", + Tag: "varint,63021,opt,name=goproto_enum_stringer_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63022, + Name: "gogoproto.enum_stringer_all", + Tag: "varint,63022,opt,name=enum_stringer_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63023, + Name: "gogoproto.unsafe_marshaler_all", + Tag: "varint,63023,opt,name=unsafe_marshaler_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63024, + Name: "gogoproto.unsafe_unmarshaler_all", + Tag: "varint,63024,opt,name=unsafe_unmarshaler_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63025, + Name: "gogoproto.goproto_extensions_map_all", + Tag: "varint,63025,opt,name=goproto_extensions_map_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63026, + Name: "gogoproto.goproto_unrecognized_all", + Tag: "varint,63026,opt,name=goproto_unrecognized_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63027, + Name: "gogoproto.gogoproto_import", + Tag: "varint,63027,opt,name=gogoproto_import", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63028, + Name: "gogoproto.protosizer_all", + Tag: "varint,63028,opt,name=protosizer_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63029, + Name: "gogoproto.compare_all", + Tag: "varint,63029,opt,name=compare_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63030, + Name: "gogoproto.typedecl_all", + Tag: "varint,63030,opt,name=typedecl_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63031, + Name: "gogoproto.enumdecl_all", + Tag: "varint,63031,opt,name=enumdecl_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63032, + Name: "gogoproto.goproto_registration", + Tag: "varint,63032,opt,name=goproto_registration", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63033, + Name: "gogoproto.messagename_all", + Tag: "varint,63033,opt,name=messagename_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63034, + Name: "gogoproto.goproto_sizecache_all", + Tag: "varint,63034,opt,name=goproto_sizecache_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FileOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 63035, + Name: "gogoproto.goproto_unkeyed_all", + Tag: "varint,63035,opt,name=goproto_unkeyed_all", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64001, + Name: "gogoproto.goproto_getters", + Tag: "varint,64001,opt,name=goproto_getters", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64003, + Name: "gogoproto.goproto_stringer", + Tag: "varint,64003,opt,name=goproto_stringer", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64004, + Name: "gogoproto.verbose_equal", + Tag: "varint,64004,opt,name=verbose_equal", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64005, + Name: "gogoproto.face", + Tag: "varint,64005,opt,name=face", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64006, + Name: "gogoproto.gostring", + Tag: "varint,64006,opt,name=gostring", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64007, + Name: "gogoproto.populate", + Tag: "varint,64007,opt,name=populate", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 67008, + Name: "gogoproto.stringer", + Tag: "varint,67008,opt,name=stringer", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64009, + Name: "gogoproto.onlyone", + Tag: "varint,64009,opt,name=onlyone", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64013, + Name: "gogoproto.equal", + Tag: "varint,64013,opt,name=equal", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64014, + Name: "gogoproto.description", + Tag: "varint,64014,opt,name=description", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64015, + Name: "gogoproto.testgen", + Tag: "varint,64015,opt,name=testgen", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64016, + Name: "gogoproto.benchgen", + Tag: "varint,64016,opt,name=benchgen", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64017, + Name: "gogoproto.marshaler", + Tag: "varint,64017,opt,name=marshaler", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64018, + Name: "gogoproto.unmarshaler", + Tag: "varint,64018,opt,name=unmarshaler", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64019, + Name: "gogoproto.stable_marshaler", + Tag: "varint,64019,opt,name=stable_marshaler", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64020, + Name: "gogoproto.sizer", + Tag: "varint,64020,opt,name=sizer", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64023, + Name: "gogoproto.unsafe_marshaler", + Tag: "varint,64023,opt,name=unsafe_marshaler", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64024, + Name: "gogoproto.unsafe_unmarshaler", + Tag: "varint,64024,opt,name=unsafe_unmarshaler", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64025, + Name: "gogoproto.goproto_extensions_map", + Tag: "varint,64025,opt,name=goproto_extensions_map", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64026, + Name: "gogoproto.goproto_unrecognized", + Tag: "varint,64026,opt,name=goproto_unrecognized", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64028, + Name: "gogoproto.protosizer", + Tag: "varint,64028,opt,name=protosizer", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64029, + Name: "gogoproto.compare", + Tag: "varint,64029,opt,name=compare", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64030, + Name: "gogoproto.typedecl", + Tag: "varint,64030,opt,name=typedecl", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64033, + Name: "gogoproto.messagename", + Tag: "varint,64033,opt,name=messagename", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64034, + Name: "gogoproto.goproto_sizecache", + Tag: "varint,64034,opt,name=goproto_sizecache", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 64035, + Name: "gogoproto.goproto_unkeyed", + Tag: "varint,64035,opt,name=goproto_unkeyed", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 65001, + Name: "gogoproto.nullable", + Tag: "varint,65001,opt,name=nullable", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 65002, + Name: "gogoproto.embed", + Tag: "varint,65002,opt,name=embed", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 65003, + Name: "gogoproto.customtype", + Tag: "bytes,65003,opt,name=customtype", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 65004, + Name: "gogoproto.customname", + Tag: "bytes,65004,opt,name=customname", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 65005, + Name: "gogoproto.jsontag", + Tag: "bytes,65005,opt,name=jsontag", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 65006, + Name: "gogoproto.moretags", + Tag: "bytes,65006,opt,name=moretags", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 65007, + Name: "gogoproto.casttype", + Tag: "bytes,65007,opt,name=casttype", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 65008, + Name: "gogoproto.castkey", + Tag: "bytes,65008,opt,name=castkey", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 65009, + Name: "gogoproto.castvalue", + Tag: "bytes,65009,opt,name=castvalue", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 65010, + Name: "gogoproto.stdtime", + Tag: "varint,65010,opt,name=stdtime", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 65011, + Name: "gogoproto.stdduration", + Tag: "varint,65011,opt,name=stdduration", + Filename: "internal/gogoproto/gogo.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 65012, + Name: "gogoproto.wktpointer", + Tag: "varint,65012,opt,name=wktpointer", + Filename: "internal/gogoproto/gogo.proto", + }, +} + +// Extension fields to descriptorpb.EnumOptions. +var ( + // optional bool goproto_enum_prefix = 62001; + E_GoprotoEnumPrefix = &file_internal_gogoproto_gogo_proto_extTypes[0] + // optional bool goproto_enum_stringer = 62021; + E_GoprotoEnumStringer = &file_internal_gogoproto_gogo_proto_extTypes[1] + // optional bool enum_stringer = 62022; + E_EnumStringer = &file_internal_gogoproto_gogo_proto_extTypes[2] + // optional string enum_customname = 62023; + E_EnumCustomname = &file_internal_gogoproto_gogo_proto_extTypes[3] + // optional bool enumdecl = 62024; + E_Enumdecl = &file_internal_gogoproto_gogo_proto_extTypes[4] +) + +// Extension fields to descriptorpb.EnumValueOptions. +var ( + // optional string enumvalue_customname = 66001; + E_EnumvalueCustomname = &file_internal_gogoproto_gogo_proto_extTypes[5] +) + +// Extension fields to descriptorpb.FileOptions. +var ( + // optional bool goproto_getters_all = 63001; + E_GoprotoGettersAll = &file_internal_gogoproto_gogo_proto_extTypes[6] + // optional bool goproto_enum_prefix_all = 63002; + E_GoprotoEnumPrefixAll = &file_internal_gogoproto_gogo_proto_extTypes[7] + // optional bool goproto_stringer_all = 63003; + E_GoprotoStringerAll = &file_internal_gogoproto_gogo_proto_extTypes[8] + // optional bool verbose_equal_all = 63004; + E_VerboseEqualAll = &file_internal_gogoproto_gogo_proto_extTypes[9] + // optional bool face_all = 63005; + E_FaceAll = &file_internal_gogoproto_gogo_proto_extTypes[10] + // optional bool gostring_all = 63006; + E_GostringAll = &file_internal_gogoproto_gogo_proto_extTypes[11] + // optional bool populate_all = 63007; + E_PopulateAll = &file_internal_gogoproto_gogo_proto_extTypes[12] + // optional bool stringer_all = 63008; + E_StringerAll = &file_internal_gogoproto_gogo_proto_extTypes[13] + // optional bool onlyone_all = 63009; + E_OnlyoneAll = &file_internal_gogoproto_gogo_proto_extTypes[14] + // optional bool equal_all = 63013; + E_EqualAll = &file_internal_gogoproto_gogo_proto_extTypes[15] + // optional bool description_all = 63014; + E_DescriptionAll = &file_internal_gogoproto_gogo_proto_extTypes[16] + // optional bool testgen_all = 63015; + E_TestgenAll = &file_internal_gogoproto_gogo_proto_extTypes[17] + // optional bool benchgen_all = 63016; + E_BenchgenAll = &file_internal_gogoproto_gogo_proto_extTypes[18] + // optional bool marshaler_all = 63017; + E_MarshalerAll = &file_internal_gogoproto_gogo_proto_extTypes[19] + // optional bool unmarshaler_all = 63018; + E_UnmarshalerAll = &file_internal_gogoproto_gogo_proto_extTypes[20] + // optional bool stable_marshaler_all = 63019; + E_StableMarshalerAll = &file_internal_gogoproto_gogo_proto_extTypes[21] + // optional bool sizer_all = 63020; + E_SizerAll = &file_internal_gogoproto_gogo_proto_extTypes[22] + // optional bool goproto_enum_stringer_all = 63021; + E_GoprotoEnumStringerAll = &file_internal_gogoproto_gogo_proto_extTypes[23] + // optional bool enum_stringer_all = 63022; + E_EnumStringerAll = &file_internal_gogoproto_gogo_proto_extTypes[24] + // optional bool unsafe_marshaler_all = 63023; + E_UnsafeMarshalerAll = &file_internal_gogoproto_gogo_proto_extTypes[25] + // optional bool unsafe_unmarshaler_all = 63024; + E_UnsafeUnmarshalerAll = &file_internal_gogoproto_gogo_proto_extTypes[26] + // optional bool goproto_extensions_map_all = 63025; + E_GoprotoExtensionsMapAll = &file_internal_gogoproto_gogo_proto_extTypes[27] + // optional bool goproto_unrecognized_all = 63026; + E_GoprotoUnrecognizedAll = &file_internal_gogoproto_gogo_proto_extTypes[28] + // optional bool gogoproto_import = 63027; + E_GogoprotoImport = &file_internal_gogoproto_gogo_proto_extTypes[29] + // optional bool protosizer_all = 63028; + E_ProtosizerAll = &file_internal_gogoproto_gogo_proto_extTypes[30] + // optional bool compare_all = 63029; + E_CompareAll = &file_internal_gogoproto_gogo_proto_extTypes[31] + // optional bool typedecl_all = 63030; + E_TypedeclAll = &file_internal_gogoproto_gogo_proto_extTypes[32] + // optional bool enumdecl_all = 63031; + E_EnumdeclAll = &file_internal_gogoproto_gogo_proto_extTypes[33] + // optional bool goproto_registration = 63032; + E_GoprotoRegistration = &file_internal_gogoproto_gogo_proto_extTypes[34] + // optional bool messagename_all = 63033; + E_MessagenameAll = &file_internal_gogoproto_gogo_proto_extTypes[35] + // optional bool goproto_sizecache_all = 63034; + E_GoprotoSizecacheAll = &file_internal_gogoproto_gogo_proto_extTypes[36] + // optional bool goproto_unkeyed_all = 63035; + E_GoprotoUnkeyedAll = &file_internal_gogoproto_gogo_proto_extTypes[37] +) + +// Extension fields to descriptorpb.MessageOptions. +var ( + // optional bool goproto_getters = 64001; + E_GoprotoGetters = &file_internal_gogoproto_gogo_proto_extTypes[38] + // optional bool goproto_stringer = 64003; + E_GoprotoStringer = &file_internal_gogoproto_gogo_proto_extTypes[39] + // optional bool verbose_equal = 64004; + E_VerboseEqual = &file_internal_gogoproto_gogo_proto_extTypes[40] + // optional bool face = 64005; + E_Face = &file_internal_gogoproto_gogo_proto_extTypes[41] + // optional bool gostring = 64006; + E_Gostring = &file_internal_gogoproto_gogo_proto_extTypes[42] + // optional bool populate = 64007; + E_Populate = &file_internal_gogoproto_gogo_proto_extTypes[43] + // optional bool stringer = 67008; + E_Stringer = &file_internal_gogoproto_gogo_proto_extTypes[44] + // optional bool onlyone = 64009; + E_Onlyone = &file_internal_gogoproto_gogo_proto_extTypes[45] + // optional bool equal = 64013; + E_Equal = &file_internal_gogoproto_gogo_proto_extTypes[46] + // optional bool description = 64014; + E_Description = &file_internal_gogoproto_gogo_proto_extTypes[47] + // optional bool testgen = 64015; + E_Testgen = &file_internal_gogoproto_gogo_proto_extTypes[48] + // optional bool benchgen = 64016; + E_Benchgen = &file_internal_gogoproto_gogo_proto_extTypes[49] + // optional bool marshaler = 64017; + E_Marshaler = &file_internal_gogoproto_gogo_proto_extTypes[50] + // optional bool unmarshaler = 64018; + E_Unmarshaler = &file_internal_gogoproto_gogo_proto_extTypes[51] + // optional bool stable_marshaler = 64019; + E_StableMarshaler = &file_internal_gogoproto_gogo_proto_extTypes[52] + // optional bool sizer = 64020; + E_Sizer = &file_internal_gogoproto_gogo_proto_extTypes[53] + // optional bool unsafe_marshaler = 64023; + E_UnsafeMarshaler = &file_internal_gogoproto_gogo_proto_extTypes[54] + // optional bool unsafe_unmarshaler = 64024; + E_UnsafeUnmarshaler = &file_internal_gogoproto_gogo_proto_extTypes[55] + // optional bool goproto_extensions_map = 64025; + E_GoprotoExtensionsMap = &file_internal_gogoproto_gogo_proto_extTypes[56] + // optional bool goproto_unrecognized = 64026; + E_GoprotoUnrecognized = &file_internal_gogoproto_gogo_proto_extTypes[57] + // optional bool protosizer = 64028; + E_Protosizer = &file_internal_gogoproto_gogo_proto_extTypes[58] + // optional bool compare = 64029; + E_Compare = &file_internal_gogoproto_gogo_proto_extTypes[59] + // optional bool typedecl = 64030; + E_Typedecl = &file_internal_gogoproto_gogo_proto_extTypes[60] + // optional bool messagename = 64033; + E_Messagename = &file_internal_gogoproto_gogo_proto_extTypes[61] + // optional bool goproto_sizecache = 64034; + E_GoprotoSizecache = &file_internal_gogoproto_gogo_proto_extTypes[62] + // optional bool goproto_unkeyed = 64035; + E_GoprotoUnkeyed = &file_internal_gogoproto_gogo_proto_extTypes[63] +) + +// Extension fields to descriptorpb.FieldOptions. +var ( + // optional bool nullable = 65001; + E_Nullable = &file_internal_gogoproto_gogo_proto_extTypes[64] + // optional bool embed = 65002; + E_Embed = &file_internal_gogoproto_gogo_proto_extTypes[65] + // optional string customtype = 65003; + E_Customtype = &file_internal_gogoproto_gogo_proto_extTypes[66] + // optional string customname = 65004; + E_Customname = &file_internal_gogoproto_gogo_proto_extTypes[67] + // optional string jsontag = 65005; + E_Jsontag = &file_internal_gogoproto_gogo_proto_extTypes[68] + // optional string moretags = 65006; + E_Moretags = &file_internal_gogoproto_gogo_proto_extTypes[69] + // optional string casttype = 65007; + E_Casttype = &file_internal_gogoproto_gogo_proto_extTypes[70] + // optional string castkey = 65008; + E_Castkey = &file_internal_gogoproto_gogo_proto_extTypes[71] + // optional string castvalue = 65009; + E_Castvalue = &file_internal_gogoproto_gogo_proto_extTypes[72] + // optional bool stdtime = 65010; + E_Stdtime = &file_internal_gogoproto_gogo_proto_extTypes[73] + // optional bool stdduration = 65011; + E_Stdduration = &file_internal_gogoproto_gogo_proto_extTypes[74] + // optional bool wktpointer = 65012; + E_Wktpointer = &file_internal_gogoproto_gogo_proto_extTypes[75] +) + +var File_internal_gogoproto_gogo_proto protoreflect.FileDescriptor + +var file_internal_gogoproto_gogo_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x09, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3a, 0x4e, 0x0a, 0x13, + 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x65, + 0x66, 0x69, 0x78, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0xb1, 0xe4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x67, 0x6f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x45, 0x6e, 0x75, 0x6d, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x3a, 0x52, 0x0a, 0x15, + 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0xc5, 0xe4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x67, 0x6f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x45, 0x6e, 0x75, 0x6d, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x3a, 0x43, 0x0a, 0x0d, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0xc6, 0xe4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x65, 0x6e, 0x75, 0x6d, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x3a, 0x47, 0x0a, 0x0f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc7, 0xe4, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, + 0x65, 0x6e, 0x75, 0x6d, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x3a, + 0x0a, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x64, 0x65, 0x63, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, + 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc8, 0xe4, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x64, 0x65, 0x63, 0x6c, 0x3a, 0x56, 0x0a, 0x14, 0x65, 0x6e, + 0x75, 0x6d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xd1, 0x83, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x65, + 0x6e, 0x75, 0x6d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, + 0x6d, 0x65, 0x3a, 0x4e, 0x0a, 0x13, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x67, 0x65, + 0x74, 0x74, 0x65, 0x72, 0x73, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x99, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x11, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x73, 0x41, + 0x6c, 0x6c, 0x3a, 0x55, 0x0a, 0x17, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, 0x6e, + 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9a, 0xec, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x14, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x45, 0x6e, 0x75, 0x6d, + 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x41, 0x6c, 0x6c, 0x3a, 0x50, 0x0a, 0x14, 0x67, 0x6f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x61, 0x6c, + 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x9b, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x4a, 0x0a, 0x11, 0x76, + 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x5f, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x5f, 0x61, 0x6c, 0x6c, + 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9c, + 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x45, + 0x71, 0x75, 0x61, 0x6c, 0x41, 0x6c, 0x6c, 0x3a, 0x39, 0x0a, 0x08, 0x66, 0x61, 0x63, 0x65, 0x5f, + 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x9d, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x41, + 0x6c, 0x6c, 0x3a, 0x41, 0x0a, 0x0c, 0x67, 0x6f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x61, + 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x9e, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x67, 0x6f, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x41, 0x6c, 0x6c, 0x3a, 0x41, 0x0a, 0x0c, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, + 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x9f, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x70, 0x6f, 0x70, + 0x75, 0x6c, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x3a, 0x41, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa0, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x3f, 0x0a, 0x0b, 0x6f, + 0x6e, 0x6c, 0x79, 0x6f, 0x6e, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, + 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa1, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0a, 0x6f, 0x6e, 0x6c, 0x79, 0x6f, 0x6e, 0x65, 0x41, 0x6c, 0x6c, 0x3a, 0x3b, 0x0a, 0x09, + 0x65, 0x71, 0x75, 0x61, 0x6c, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa5, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x41, 0x6c, 0x6c, 0x3a, 0x47, 0x0a, 0x0f, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa6, 0xec, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0e, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, + 0x6c, 0x6c, 0x3a, 0x3f, 0x0a, 0x0b, 0x74, 0x65, 0x73, 0x74, 0x67, 0x65, 0x6e, 0x5f, 0x61, 0x6c, + 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0xa7, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x67, 0x65, 0x6e, + 0x41, 0x6c, 0x6c, 0x3a, 0x41, 0x0a, 0x0c, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x67, 0x65, 0x6e, 0x5f, + 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0xa8, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x62, 0x65, 0x6e, 0x63, 0x68, + 0x67, 0x65, 0x6e, 0x41, 0x6c, 0x6c, 0x3a, 0x43, 0x0a, 0x0d, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, + 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa9, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6d, + 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x47, 0x0a, 0x0f, 0x75, + 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xaa, 0xec, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, + 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x50, 0x0a, 0x14, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6d, + 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xab, 0xec, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x12, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, + 0x6c, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x3b, 0x0a, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x5f, + 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0xac, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, 0x69, 0x7a, 0x65, 0x72, + 0x41, 0x6c, 0x6c, 0x3a, 0x59, 0x0a, 0x19, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, + 0x6e, 0x75, 0x6d, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, + 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, + 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x45, + 0x6e, 0x75, 0x6d, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x4a, + 0x0a, 0x11, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x5f, + 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0xae, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x65, 0x6e, 0x75, 0x6d, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x50, 0x0a, 0x14, 0x75, 0x6e, + 0x73, 0x61, 0x66, 0x65, 0x5f, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, + 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0xaf, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x75, 0x6e, 0x73, 0x61, 0x66, 0x65, + 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x54, 0x0a, 0x16, + 0x75, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, + 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb0, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x75, 0x6e, + 0x73, 0x61, 0x66, 0x65, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, + 0x6c, 0x6c, 0x3a, 0x5b, 0x0a, 0x1a, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x6d, 0x61, 0x70, 0x5f, 0x61, 0x6c, 0x6c, + 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb1, + 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x4d, 0x61, 0x70, 0x41, 0x6c, 0x6c, 0x3a, + 0x58, 0x0a, 0x18, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x63, + 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, + 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb2, 0xec, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x16, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x6e, 0x72, 0x65, 0x63, 0x6f, + 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x64, 0x41, 0x6c, 0x6c, 0x3a, 0x49, 0x0a, 0x10, 0x67, 0x6f, 0x67, + 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb3, 0xec, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0f, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x49, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x3a, 0x45, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x69, 0x7a, + 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb4, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x3f, 0x0a, 0x0b, 0x63, + 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, + 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb5, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x41, 0x6c, 0x6c, 0x3a, 0x41, 0x0a, 0x0c, + 0x74, 0x79, 0x70, 0x65, 0x64, 0x65, 0x63, 0x6c, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb6, 0xec, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0b, 0x74, 0x79, 0x70, 0x65, 0x64, 0x65, 0x63, 0x6c, 0x41, 0x6c, 0x6c, 0x3a, + 0x41, 0x0a, 0x0c, 0x65, 0x6e, 0x75, 0x6d, 0x64, 0x65, 0x63, 0x6c, 0x5f, 0x61, 0x6c, 0x6c, 0x12, + 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb7, 0xec, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x65, 0x6e, 0x75, 0x6d, 0x64, 0x65, 0x63, 0x6c, 0x41, + 0x6c, 0x6c, 0x3a, 0x51, 0x0a, 0x14, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, + 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb8, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x13, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x47, 0x0a, 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb9, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x41, 0x6c, 0x6c, 0x3a, 0x52, + 0x0a, 0x15, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x63, 0x61, + 0x63, 0x68, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xba, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x67, + 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x69, 0x7a, 0x65, 0x63, 0x61, 0x63, 0x68, 0x65, 0x41, + 0x6c, 0x6c, 0x3a, 0x4e, 0x0a, 0x13, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x75, 0x6e, + 0x6b, 0x65, 0x79, 0x65, 0x64, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xbb, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x11, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x6e, 0x6b, 0x65, 0x79, 0x65, 0x64, 0x41, + 0x6c, 0x6c, 0x3a, 0x4a, 0x0a, 0x0f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x67, 0x65, + 0x74, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x81, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, + 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x73, 0x3a, 0x4c, + 0x0a, 0x10, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x83, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x67, 0x6f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x3a, 0x46, 0x0a, 0x0d, + 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x5f, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x12, 0x1f, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x84, + 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x45, + 0x71, 0x75, 0x61, 0x6c, 0x3a, 0x35, 0x0a, 0x04, 0x66, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x85, 0xf4, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x61, 0x63, 0x65, 0x3a, 0x3d, 0x0a, 0x08, 0x67, + 0x6f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x86, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x67, 0x6f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3d, 0x0a, 0x08, 0x70, 0x6f, + 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x87, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x3a, 0x3d, 0x0a, 0x08, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc0, 0x8b, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x3a, 0x3b, 0x0a, 0x07, 0x6f, 0x6e, 0x6c, 0x79, + 0x6f, 0x6e, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x89, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6f, 0x6e, + 0x6c, 0x79, 0x6f, 0x6e, 0x65, 0x3a, 0x37, 0x0a, 0x05, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x12, 0x1f, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x8d, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x3a, 0x43, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x8e, + 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x3a, 0x3b, 0x0a, 0x07, 0x74, 0x65, 0x73, 0x74, 0x67, 0x65, 0x6e, 0x12, 0x1f, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x8f, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x74, 0x65, 0x73, 0x74, 0x67, 0x65, 0x6e, + 0x3a, 0x3d, 0x0a, 0x08, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x67, 0x65, 0x6e, 0x12, 0x1f, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x90, 0xf4, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x67, 0x65, 0x6e, 0x3a, + 0x3f, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x91, 0xf4, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, + 0x3a, 0x43, 0x0a, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, + 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x92, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, + 0x68, 0x61, 0x6c, 0x65, 0x72, 0x3a, 0x4c, 0x0a, 0x10, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x93, 0xf4, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, + 0x6c, 0x65, 0x72, 0x3a, 0x37, 0x0a, 0x05, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x94, 0xf4, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x3a, 0x4c, 0x0a, 0x10, + 0x75, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, + 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x97, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x75, 0x6e, 0x73, 0x61, 0x66, + 0x65, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x3a, 0x50, 0x0a, 0x12, 0x75, 0x6e, + 0x73, 0x61, 0x66, 0x65, 0x5f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, + 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x98, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x75, 0x6e, 0x73, 0x61, 0x66, + 0x65, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x3a, 0x57, 0x0a, 0x16, + 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x5f, 0x6d, 0x61, 0x70, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x99, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x14, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x4d, 0x61, 0x70, 0x3a, 0x54, 0x0a, 0x14, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x63, 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x1f, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9a, + 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x55, + 0x6e, 0x72, 0x65, 0x63, 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x64, 0x3a, 0x41, 0x0a, 0x0a, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9c, 0xf4, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x3a, 0x3b, + 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9d, 0xf4, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x3a, 0x3d, 0x0a, 0x08, 0x74, + 0x79, 0x70, 0x65, 0x64, 0x65, 0x63, 0x6c, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9e, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, 0x64, 0x65, 0x63, 0x6c, 0x3a, 0x43, 0x0a, 0x0b, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa1, 0xf4, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x3a, + 0x4e, 0x0a, 0x11, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x63, + 0x61, 0x63, 0x68, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa2, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x67, + 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x69, 0x7a, 0x65, 0x63, 0x61, 0x63, 0x68, 0x65, 0x3a, + 0x4a, 0x0a, 0x0f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x75, 0x6e, 0x6b, 0x65, 0x79, + 0x65, 0x64, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0xa3, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x67, 0x6f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x6e, 0x6b, 0x65, 0x79, 0x65, 0x64, 0x3a, 0x3b, 0x0a, 0x08, 0x6e, + 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe9, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x3a, 0x35, 0x0a, 0x05, 0x65, 0x6d, 0x62, 0x65, + 0x64, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0xea, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x3a, + 0x3f, 0x0a, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xeb, 0xfb, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x74, 0x79, 0x70, 0x65, + 0x3a, 0x3f, 0x0a, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xec, 0xfb, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, 0x6d, + 0x65, 0x3a, 0x39, 0x0a, 0x07, 0x6a, 0x73, 0x6f, 0x6e, 0x74, 0x61, 0x67, 0x12, 0x1d, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xed, 0xfb, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x73, 0x6f, 0x6e, 0x74, 0x61, 0x67, 0x3a, 0x3b, 0x0a, 0x08, + 0x6d, 0x6f, 0x72, 0x65, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xee, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6d, 0x6f, 0x72, 0x65, 0x74, 0x61, 0x67, 0x73, 0x3a, 0x3b, 0x0a, 0x08, 0x63, 0x61, 0x73, + 0x74, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xef, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, + 0x73, 0x74, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x39, 0x0a, 0x07, 0x63, 0x61, 0x73, 0x74, 0x6b, 0x65, + 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0xf0, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x73, 0x74, 0x6b, 0x65, + 0x79, 0x3a, 0x3d, 0x0a, 0x09, 0x63, 0x61, 0x73, 0x74, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xf1, 0xfb, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x73, 0x74, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x39, 0x0a, 0x07, 0x73, 0x74, 0x64, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xf2, 0xfb, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x73, 0x74, 0x64, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x41, 0x0a, 0x0b, 0x73, + 0x74, 0x64, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xf3, 0xfb, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0b, 0x73, 0x74, 0x64, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3f, + 0x0a, 0x0a, 0x77, 0x6b, 0x74, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xf4, 0xfb, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0a, 0x77, 0x6b, 0x74, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x42, + 0x45, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x0a, 0x47, 0x6f, 0x47, 0x6f, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, + 0x6f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x6f, 0x67, + 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, +} + +var file_internal_gogoproto_gogo_proto_goTypes = []interface{}{ + (*descriptorpb.EnumOptions)(nil), // 0: google.protobuf.EnumOptions + (*descriptorpb.EnumValueOptions)(nil), // 1: google.protobuf.EnumValueOptions + (*descriptorpb.FileOptions)(nil), // 2: google.protobuf.FileOptions + (*descriptorpb.MessageOptions)(nil), // 3: google.protobuf.MessageOptions + (*descriptorpb.FieldOptions)(nil), // 4: google.protobuf.FieldOptions +} +var file_internal_gogoproto_gogo_proto_depIdxs = []int32{ + 0, // 0: gogoproto.goproto_enum_prefix:extendee -> google.protobuf.EnumOptions + 0, // 1: gogoproto.goproto_enum_stringer:extendee -> google.protobuf.EnumOptions + 0, // 2: gogoproto.enum_stringer:extendee -> google.protobuf.EnumOptions + 0, // 3: gogoproto.enum_customname:extendee -> google.protobuf.EnumOptions + 0, // 4: gogoproto.enumdecl:extendee -> google.protobuf.EnumOptions + 1, // 5: gogoproto.enumvalue_customname:extendee -> google.protobuf.EnumValueOptions + 2, // 6: gogoproto.goproto_getters_all:extendee -> google.protobuf.FileOptions + 2, // 7: gogoproto.goproto_enum_prefix_all:extendee -> google.protobuf.FileOptions + 2, // 8: gogoproto.goproto_stringer_all:extendee -> google.protobuf.FileOptions + 2, // 9: gogoproto.verbose_equal_all:extendee -> google.protobuf.FileOptions + 2, // 10: gogoproto.face_all:extendee -> google.protobuf.FileOptions + 2, // 11: gogoproto.gostring_all:extendee -> google.protobuf.FileOptions + 2, // 12: gogoproto.populate_all:extendee -> google.protobuf.FileOptions + 2, // 13: gogoproto.stringer_all:extendee -> google.protobuf.FileOptions + 2, // 14: gogoproto.onlyone_all:extendee -> google.protobuf.FileOptions + 2, // 15: gogoproto.equal_all:extendee -> google.protobuf.FileOptions + 2, // 16: gogoproto.description_all:extendee -> google.protobuf.FileOptions + 2, // 17: gogoproto.testgen_all:extendee -> google.protobuf.FileOptions + 2, // 18: gogoproto.benchgen_all:extendee -> google.protobuf.FileOptions + 2, // 19: gogoproto.marshaler_all:extendee -> google.protobuf.FileOptions + 2, // 20: gogoproto.unmarshaler_all:extendee -> google.protobuf.FileOptions + 2, // 21: gogoproto.stable_marshaler_all:extendee -> google.protobuf.FileOptions + 2, // 22: gogoproto.sizer_all:extendee -> google.protobuf.FileOptions + 2, // 23: gogoproto.goproto_enum_stringer_all:extendee -> google.protobuf.FileOptions + 2, // 24: gogoproto.enum_stringer_all:extendee -> google.protobuf.FileOptions + 2, // 25: gogoproto.unsafe_marshaler_all:extendee -> google.protobuf.FileOptions + 2, // 26: gogoproto.unsafe_unmarshaler_all:extendee -> google.protobuf.FileOptions + 2, // 27: gogoproto.goproto_extensions_map_all:extendee -> google.protobuf.FileOptions + 2, // 28: gogoproto.goproto_unrecognized_all:extendee -> google.protobuf.FileOptions + 2, // 29: gogoproto.gogoproto_import:extendee -> google.protobuf.FileOptions + 2, // 30: gogoproto.protosizer_all:extendee -> google.protobuf.FileOptions + 2, // 31: gogoproto.compare_all:extendee -> google.protobuf.FileOptions + 2, // 32: gogoproto.typedecl_all:extendee -> google.protobuf.FileOptions + 2, // 33: gogoproto.enumdecl_all:extendee -> google.protobuf.FileOptions + 2, // 34: gogoproto.goproto_registration:extendee -> google.protobuf.FileOptions + 2, // 35: gogoproto.messagename_all:extendee -> google.protobuf.FileOptions + 2, // 36: gogoproto.goproto_sizecache_all:extendee -> google.protobuf.FileOptions + 2, // 37: gogoproto.goproto_unkeyed_all:extendee -> google.protobuf.FileOptions + 3, // 38: gogoproto.goproto_getters:extendee -> google.protobuf.MessageOptions + 3, // 39: gogoproto.goproto_stringer:extendee -> google.protobuf.MessageOptions + 3, // 40: gogoproto.verbose_equal:extendee -> google.protobuf.MessageOptions + 3, // 41: gogoproto.face:extendee -> google.protobuf.MessageOptions + 3, // 42: gogoproto.gostring:extendee -> google.protobuf.MessageOptions + 3, // 43: gogoproto.populate:extendee -> google.protobuf.MessageOptions + 3, // 44: gogoproto.stringer:extendee -> google.protobuf.MessageOptions + 3, // 45: gogoproto.onlyone:extendee -> google.protobuf.MessageOptions + 3, // 46: gogoproto.equal:extendee -> google.protobuf.MessageOptions + 3, // 47: gogoproto.description:extendee -> google.protobuf.MessageOptions + 3, // 48: gogoproto.testgen:extendee -> google.protobuf.MessageOptions + 3, // 49: gogoproto.benchgen:extendee -> google.protobuf.MessageOptions + 3, // 50: gogoproto.marshaler:extendee -> google.protobuf.MessageOptions + 3, // 51: gogoproto.unmarshaler:extendee -> google.protobuf.MessageOptions + 3, // 52: gogoproto.stable_marshaler:extendee -> google.protobuf.MessageOptions + 3, // 53: gogoproto.sizer:extendee -> google.protobuf.MessageOptions + 3, // 54: gogoproto.unsafe_marshaler:extendee -> google.protobuf.MessageOptions + 3, // 55: gogoproto.unsafe_unmarshaler:extendee -> google.protobuf.MessageOptions + 3, // 56: gogoproto.goproto_extensions_map:extendee -> google.protobuf.MessageOptions + 3, // 57: gogoproto.goproto_unrecognized:extendee -> google.protobuf.MessageOptions + 3, // 58: gogoproto.protosizer:extendee -> google.protobuf.MessageOptions + 3, // 59: gogoproto.compare:extendee -> google.protobuf.MessageOptions + 3, // 60: gogoproto.typedecl:extendee -> google.protobuf.MessageOptions + 3, // 61: gogoproto.messagename:extendee -> google.protobuf.MessageOptions + 3, // 62: gogoproto.goproto_sizecache:extendee -> google.protobuf.MessageOptions + 3, // 63: gogoproto.goproto_unkeyed:extendee -> google.protobuf.MessageOptions + 4, // 64: gogoproto.nullable:extendee -> google.protobuf.FieldOptions + 4, // 65: gogoproto.embed:extendee -> google.protobuf.FieldOptions + 4, // 66: gogoproto.customtype:extendee -> google.protobuf.FieldOptions + 4, // 67: gogoproto.customname:extendee -> google.protobuf.FieldOptions + 4, // 68: gogoproto.jsontag:extendee -> google.protobuf.FieldOptions + 4, // 69: gogoproto.moretags:extendee -> google.protobuf.FieldOptions + 4, // 70: gogoproto.casttype:extendee -> google.protobuf.FieldOptions + 4, // 71: gogoproto.castkey:extendee -> google.protobuf.FieldOptions + 4, // 72: gogoproto.castvalue:extendee -> google.protobuf.FieldOptions + 4, // 73: gogoproto.stdtime:extendee -> google.protobuf.FieldOptions + 4, // 74: gogoproto.stdduration:extendee -> google.protobuf.FieldOptions + 4, // 75: gogoproto.wktpointer:extendee -> google.protobuf.FieldOptions + 76, // [76:76] is the sub-list for method output_type + 76, // [76:76] is the sub-list for method input_type + 76, // [76:76] is the sub-list for extension type_name + 0, // [0:76] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_internal_gogoproto_gogo_proto_init() } +func file_internal_gogoproto_gogo_proto_init() { + if File_internal_gogoproto_gogo_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_internal_gogoproto_gogo_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 76, + NumServices: 0, + }, + GoTypes: file_internal_gogoproto_gogo_proto_goTypes, + DependencyIndexes: file_internal_gogoproto_gogo_proto_depIdxs, + ExtensionInfos: file_internal_gogoproto_gogo_proto_extTypes, + }.Build() + File_internal_gogoproto_gogo_proto = out.File + file_internal_gogoproto_gogo_proto_rawDesc = nil + file_internal_gogoproto_gogo_proto_goTypes = nil + file_internal_gogoproto_gogo_proto_depIdxs = nil +} diff --git a/internal/gogoproto/gogo.proto b/internal/gogoproto/gogo.proto new file mode 100644 index 00000000..a18a859b --- /dev/null +++ b/internal/gogoproto/gogo.proto @@ -0,0 +1,143 @@ +// Protocol Buffers for Go with Gadgets +// +// Copyright (c) 2013, The GoGo Authors. All rights reserved. +// http://github.com/gogo/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto2"; +package gogoproto; + +import "google/protobuf/descriptor.proto"; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "GoGoProtos"; +option go_package = "github.com/gogo/protobuf/gogoproto"; + +extend google.protobuf.EnumOptions { + optional bool goproto_enum_prefix = 62001; + optional bool goproto_enum_stringer = 62021; + optional bool enum_stringer = 62022; + optional string enum_customname = 62023; + optional bool enumdecl = 62024; +} + +extend google.protobuf.EnumValueOptions { + optional string enumvalue_customname = 66001; +} + +extend google.protobuf.FileOptions { + optional bool goproto_getters_all = 63001; + optional bool goproto_enum_prefix_all = 63002; + optional bool goproto_stringer_all = 63003; + optional bool verbose_equal_all = 63004; + optional bool face_all = 63005; + optional bool gostring_all = 63006; + optional bool populate_all = 63007; + optional bool stringer_all = 63008; + optional bool onlyone_all = 63009; + + optional bool equal_all = 63013; + optional bool description_all = 63014; + optional bool testgen_all = 63015; + optional bool benchgen_all = 63016; + optional bool marshaler_all = 63017; + optional bool unmarshaler_all = 63018; + optional bool stable_marshaler_all = 63019; + + optional bool sizer_all = 63020; + + optional bool goproto_enum_stringer_all = 63021; + optional bool enum_stringer_all = 63022; + + optional bool unsafe_marshaler_all = 63023; + optional bool unsafe_unmarshaler_all = 63024; + + optional bool goproto_extensions_map_all = 63025; + optional bool goproto_unrecognized_all = 63026; + optional bool gogoproto_import = 63027; + optional bool protosizer_all = 63028; + optional bool compare_all = 63029; + optional bool typedecl_all = 63030; + optional bool enumdecl_all = 63031; + + optional bool goproto_registration = 63032; + optional bool messagename_all = 63033; + + optional bool goproto_sizecache_all = 63034; + optional bool goproto_unkeyed_all = 63035; +} + +extend google.protobuf.MessageOptions { + optional bool goproto_getters = 64001; + optional bool goproto_stringer = 64003; + optional bool verbose_equal = 64004; + optional bool face = 64005; + optional bool gostring = 64006; + optional bool populate = 64007; + optional bool stringer = 67008; + optional bool onlyone = 64009; + + optional bool equal = 64013; + optional bool description = 64014; + optional bool testgen = 64015; + optional bool benchgen = 64016; + optional bool marshaler = 64017; + optional bool unmarshaler = 64018; + optional bool stable_marshaler = 64019; + + optional bool sizer = 64020; + + optional bool unsafe_marshaler = 64023; + optional bool unsafe_unmarshaler = 64024; + + optional bool goproto_extensions_map = 64025; + optional bool goproto_unrecognized = 64026; + + optional bool protosizer = 64028; + optional bool compare = 64029; + + optional bool typedecl = 64030; + + optional bool messagename = 64033; + + optional bool goproto_sizecache = 64034; + optional bool goproto_unkeyed = 64035; +} + +extend google.protobuf.FieldOptions { + optional bool nullable = 65001; + optional bool embed = 65002; + optional string customtype = 65003; + optional string customname = 65004; + optional string jsontag = 65005; + optional string moretags = 65006; + optional string casttype = 65007; + optional string castkey = 65008; + optional string castvalue = 65009; + + optional bool stdtime = 65010; + optional bool stdduration = 65011; + optional bool wktpointer = 65012; +} diff --git a/jsonplugin/field_mask.go b/jsonplugin/field_mask.go new file mode 100644 index 00000000..eed2d858 --- /dev/null +++ b/jsonplugin/field_mask.go @@ -0,0 +1,94 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package jsonplugin + +import "strings" + +// FieldMask is the interface for field masks. +type FieldMask interface { + GetPaths() []string +} + +type path struct { + parent *path + element string +} + +func newPath(p string) path { + i := strings.LastIndex(p, ".") + if i == -1 { + return path{ + element: p, + } + } + parent := newPath(p[:i]) + return path{ + parent: &parent, + element: p[i+1:], + } +} + +func (p *path) Equals(other *path) bool { + if p == nil || other == nil { + return p == other + } + if p.element != other.element { + return false + } + return p.parent.Equals(other.parent) +} + +func (p *path) String() string { + if p == nil { + return "" + } + if p.parent == nil { + return p.element + } + return p.parent.String() + "." + p.element +} + +func (p *path) push(field string) *path { + return &path{ + parent: p, + element: field, + } +} + +type pathSlice struct { + paths []path +} + +func newPathSlice(paths ...string) *pathSlice { + m := &pathSlice{} + m.paths = make([]path, len(paths)) + for i, p := range paths { + m.paths[i] = newPath(p) + } + return m +} + +func (m *pathSlice) add(path path) { + m.paths = append(m.paths, path) +} + +func (m *pathSlice) contains(search path) bool { + for _, path := range m.paths { + if path.Equals(&search) { + return true + } + } + return false +} + +func (m *pathSlice) GetPaths() []string { + if m == nil { + return nil + } + paths := make([]string, len(m.paths)) + for i, path := range m.paths { + paths[i] = path.String() + } + return paths +} diff --git a/jsonplugin/marshal.go b/jsonplugin/marshal.go new file mode 100644 index 00000000..ca43b360 --- /dev/null +++ b/jsonplugin/marshal.go @@ -0,0 +1,549 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package jsonplugin + +import ( + "encoding/base64" + "fmt" + "strconv" + "strings" + "time" + + jsoniter "github.com/json-iterator/go" +) + +// Marshaler is the interface implemented by types that are supported by this plugin. +type Marshaler interface { + MarshalProtoJSON(*MarshalState) +} + +type marshalError struct { + Err error + Path *path +} + +func (e *marshalError) Error() string { + if e.Path != nil { + return fmt.Sprintf("marshal error at path %q: %v", e.Path, e.Err) + } + return fmt.Sprintf("marshal error: %v", e.Err) +} + +// MarshalerConfig is the configuration for the Marshaler. +type MarshalerConfig struct { + EnumsAsInts bool +} + +// Marshal marshals a message. +func (c MarshalerConfig) Marshal(m Marshaler) ([]byte, error) { + s := NewMarshalState(c) + m.MarshalProtoJSON(s) + return s.Bytes() +} + +// MarshalState is the internal state of the Marshaler. +type MarshalState struct { + inner *jsoniter.Stream + config *MarshalerConfig + + err *marshalError + path *path + paths *pathSlice +} + +// NewMarshalState creates a new MarshalState. +func NewMarshalState(config MarshalerConfig) *MarshalState { + return &MarshalState{ + inner: jsoniter.NewStream(jsoniterConfig, nil, 1024), + config: &config, + + err: &marshalError{}, + path: nil, + paths: &pathSlice{}, + } +} + +// Config returns a copy of the marshaler configuration. +func (s *MarshalState) Config() MarshalerConfig { + return *s.config +} + +// Sub returns a sub-marshaler with a new buffer, but with the same configuration, error and path info. +func (s *MarshalState) Sub() *MarshalState { + return &MarshalState{ + inner: jsoniter.NewStream(jsoniterConfig, nil, 1024), + config: s.config, + + err: s.err, + path: s.path, + paths: &pathSlice{}, + } +} + +// Err returns an error from the marshaler, if any. +func (s *MarshalState) Err() error { + if s.err.Err != nil { + return s.err + } + if s.inner.Error != nil { + return s.inner.Error + } + return nil +} + +// SetError sets an error in the marshaler state. +// Subsequent operations become no-ops. +func (s *MarshalState) SetError(err error) { + if s.Err() != nil { + return + } + s.err.Err = err + s.err.Path = s.path +} + +// SetErrorf calls SetError with a formatted error. +func (s *MarshalState) SetErrorf(format string, a ...interface{}) { + s.SetError(fmt.Errorf(format, a...)) +} + +// Bytes returns the buffer of the marshaler. +func (s *MarshalState) Bytes() ([]byte, error) { + if err := s.Err(); err != nil { + return nil, err + } + return s.inner.Buffer(), nil +} + +// WithFieldMask returns a MarshalState for the given field mask. +func (s *MarshalState) WithFieldMask(paths ...string) *MarshalState { + return &MarshalState{ + inner: s.inner, + config: s.config, + + err: s.err, + path: s.path, + paths: newPathSlice(paths...), + } +} + +// WithField returns a MarshalState for the given subfield. +func (s *MarshalState) WithField(field string) *MarshalState { + return &MarshalState{ + inner: s.inner, + config: s.config, + + err: s.err, + path: s.path.push(field), + paths: s.paths, + } +} + +// HasField returns whether the field mask contains the given field. +func (s *MarshalState) HasField(field string) bool { + return s.paths.contains(*s.path.push(field)) +} + +// Write writes raw data. +func (s *MarshalState) Write(v []byte) (nn int, err error) { + if s.Err() != nil { + return + } + return s.inner.Write(v) +} + +// WriteFloat32 writes a float32 value. +func (s *MarshalState) WriteFloat32(v float32) { + if s.Err() != nil { + return + } + s.inner.WriteFloat32(v) +} + +// WriteFloat64 writes a float64 value. +func (s *MarshalState) WriteFloat64(v float64) { + if s.Err() != nil { + return + } + s.inner.WriteFloat64(v) +} + +// WriteFloat32Array writes an array of float32 values. +func (s *MarshalState) WriteFloat32Array(vs []float32) { + if s.Err() != nil { + return + } + s.WriteArrayStart() + for i, v := range vs { + if i > 0 { + s.WriteMore() + } + s.WriteFloat32(v) + } + s.WriteArrayEnd() +} + +// WriteFloat64Array writes an array of float64 values. +func (s *MarshalState) WriteFloat64Array(vs []float64) { + if s.Err() != nil { + return + } + s.WriteArrayStart() + for i, v := range vs { + if i > 0 { + s.WriteMore() + } + s.WriteFloat64(v) + } + s.WriteArrayEnd() +} + +// WriteInt32 writes an int32 value. +func (s *MarshalState) WriteInt32(v int32) { + if s.Err() != nil { + return + } + s.inner.WriteInt32(v) +} + +// WriteInt64 writes an int64 value as a string. +func (s *MarshalState) WriteInt64(v int64) { + if s.Err() != nil { + return + } + s.inner.WriteString(strconv.FormatInt(v, 10)) +} + +// WriteInt32Array writes an array of int32 values. +func (s *MarshalState) WriteInt32Array(vs []int32) { + if s.Err() != nil { + return + } + s.WriteArrayStart() + for i, v := range vs { + if i > 0 { + s.WriteMore() + } + s.WriteInt32(v) + } + s.WriteArrayEnd() +} + +// WriteInt64Array writes an array of int64 values. +func (s *MarshalState) WriteInt64Array(vs []int64) { + if s.Err() != nil { + return + } + s.WriteArrayStart() + for i, v := range vs { + if i > 0 { + s.WriteMore() + } + s.WriteInt64(v) + } + s.WriteArrayEnd() +} + +// WriteUint32 writes a uint32 value. +func (s *MarshalState) WriteUint32(v uint32) { + if s.Err() != nil { + return + } + s.inner.WriteUint32(v) +} + +// WriteUint64 writes a uint64 value as a string. +func (s *MarshalState) WriteUint64(v uint64) { + if s.Err() != nil { + return + } + s.inner.WriteString(strconv.FormatUint(v, 10)) +} + +// WriteUint32Array writes an array of uint32 values. +func (s *MarshalState) WriteUint32Array(vs []uint32) { + if s.Err() != nil { + return + } + s.WriteArrayStart() + for i, v := range vs { + if i > 0 { + s.WriteMore() + } + s.WriteUint32(v) + } + s.WriteArrayEnd() +} + +// WriteUint64Array writes an array of uint64 values. +func (s *MarshalState) WriteUint64Array(vs []uint64) { + if s.Err() != nil { + return + } + s.WriteArrayStart() + for i, v := range vs { + if i > 0 { + s.WriteMore() + } + s.WriteUint64(v) + } + s.WriteArrayEnd() +} + +// WriteBool writes a bool value. +func (s *MarshalState) WriteBool(v bool) { + if s.Err() != nil { + return + } + s.inner.WriteBool(v) +} + +// WriteBoolArray writes an array of bool values. +func (s *MarshalState) WriteBoolArray(vs []bool) { + if s.Err() != nil { + return + } + s.WriteArrayStart() + for i, v := range vs { + if i > 0 { + s.WriteMore() + } + s.WriteBool(v) + } + s.WriteArrayEnd() +} + +// WriteString writes a string. +func (s *MarshalState) WriteString(v string) { + if s.Err() != nil { + return + } + s.inner.WriteString(v) +} + +// WriteStringArray writes an array of string values. +func (s *MarshalState) WriteStringArray(vs []string) { + if s.Err() != nil { + return + } + s.WriteArrayStart() + for i, v := range vs { + if i > 0 { + s.WriteMore() + } + s.WriteString(v) + } + s.WriteArrayEnd() +} + +// WriteBytes writes a binary value. +func (s *MarshalState) WriteBytes(v []byte) { + if s.Err() != nil { + return + } + if v == nil { + s.WriteNil() + return + } + s.WriteString(base64.StdEncoding.EncodeToString(v)) +} + +// WriteBytesArray writes an array of binary values. +func (s *MarshalState) WriteBytesArray(vs [][]byte) { + if s.Err() != nil { + return + } + s.WriteArrayStart() + for i, v := range vs { + if i > 0 { + s.WriteMore() + } + s.WriteBytes(v) + } + s.WriteArrayEnd() +} + +// WriteNil writes a null. +func (s *MarshalState) WriteNil() { + if s.Err() != nil { + return + } + s.inner.WriteNil() +} + +// WriteObjectStart writes the starting { of an object. +func (s *MarshalState) WriteObjectStart() { + if s.Err() != nil { + return + } + s.inner.WriteObjectStart() +} + +// WriteObjectField writes a field name and colon. +func (s *MarshalState) WriteObjectField(field string) { + if s.Err() != nil { + return + } + s.inner.WriteObjectField(field) +} + +// WriteObjectBoolField writes a field name and colon. +func (s *MarshalState) WriteObjectBoolField(field bool) { + if s.Err() != nil { + return + } + s.inner.WriteObjectField(strconv.FormatBool(field)) +} + +// WriteObjectInt32Field writes a field name and colon. +func (s *MarshalState) WriteObjectInt32Field(field int32) { + if s.Err() != nil { + return + } + s.inner.WriteObjectField(strconv.FormatInt(int64(field), 10)) +} + +// WriteObjectUint32Field writes a field name and colon. +func (s *MarshalState) WriteObjectUint32Field(field uint32) { + if s.Err() != nil { + return + } + s.inner.WriteObjectField(strconv.FormatUint(uint64(field), 10)) +} + +// WriteObjectInt64Field writes a field name and colon. +func (s *MarshalState) WriteObjectInt64Field(field int64) { + if s.Err() != nil { + return + } + s.inner.WriteObjectField(strconv.FormatInt(field, 10)) +} + +// WriteObjectUint64Field writes a field name and colon. +func (s *MarshalState) WriteObjectUint64Field(field uint64) { + if s.Err() != nil { + return + } + s.inner.WriteObjectField(strconv.FormatUint(field, 10)) +} + +// WriteObjectStringField writes a field name and colon. +func (s *MarshalState) WriteObjectStringField(field string) { + if s.Err() != nil { + return + } + s.inner.WriteObjectField(field) +} + +// WriteObjectEnd writes the ending } of an object. +func (s *MarshalState) WriteObjectEnd() { + if s.Err() != nil { + return + } + s.inner.WriteObjectEnd() +} + +// WriteArrayStart writes the starting [ of an array. +func (s *MarshalState) WriteArrayStart() { + if s.Err() != nil { + return + } + s.inner.WriteArrayStart() +} + +// WriteArrayEnd writes the enting ] of an array. +func (s *MarshalState) WriteArrayEnd() { + if s.Err() != nil { + return + } + s.inner.WriteArrayEnd() +} + +// WriteMore writes a comma. +func (s *MarshalState) WriteMore() { + if s.Err() != nil { + return + } + s.inner.WriteMore() +} + +// WriteMoreIf writes a comma if b is false, and sets b to true. +func (s *MarshalState) WriteMoreIf(b *bool) { + if s.Err() != nil { + return + } + if *b { + s.WriteMore() + } + *b = true +} + +// WriteEnum writes an enum value. +// If config.EnumsAsInts is true or a string value is not found for the value, this writes a number. +func (s *MarshalState) WriteEnum(x int32, valueMaps ...map[int32]string) { + if s.Err() != nil { + return + } + if s.config.EnumsAsInts { + s.WriteEnumNumber(x) + } else { + s.WriteEnumString(x, valueMaps...) + } +} + +// WriteEnumString writes an enum value as a string. +func (s *MarshalState) WriteEnumString(x int32, valueMaps ...map[int32]string) { + if s.Err() != nil { + return + } + for _, valueMap := range valueMaps { + if v, ok := valueMap[x]; ok { + s.WriteString(v) + return + } + } + s.WriteEnumNumber(x) +} + +// WriteEnumNumber writes an enum value as a number. +func (s *MarshalState) WriteEnumNumber(x int32) { + if s.Err() != nil { + return + } + s.WriteInt32(x) +} + +// WriteTime writes a time value. +func (s *MarshalState) WriteTime(x time.Time) { + if s.Err() != nil { + return + } + v := x.UTC().Format("2006-01-02T15:04:05.000000000") + // According to the protobuf spec, nanoseconds in timestamps should be written as 3, 6 or 9 digits. + v = strings.TrimSuffix(v, "000") + v = strings.TrimSuffix(v, "000") + v = strings.TrimSuffix(v, ".000") + s.inner.WriteString(v + "Z") +} + +// WriteDuration writes a duration value. +func (s *MarshalState) WriteDuration(x time.Duration) { + if s.Err() != nil { + return + } + v := fmt.Sprintf("%.09f", x.Seconds()) + // According to the protobuf spec, nanoseconds in durations should be written as 3, 6 or 9 digits. + v = strings.TrimSuffix(v, "000") + v = strings.TrimSuffix(v, "000") + v = strings.TrimSuffix(v, ".000") + s.inner.WriteString(v + "s") +} + +// WriteFieldMask writes a field mask value. +func (s *MarshalState) WriteFieldMask(x FieldMask) { + if s.Err() != nil { + return + } + paths := x.GetPaths() + s.inner.WriteString(strings.Join(paths, ",")) +} diff --git a/jsonplugin/marshal_test.go b/jsonplugin/marshal_test.go new file mode 100644 index 00000000..01e380f6 --- /dev/null +++ b/jsonplugin/marshal_test.go @@ -0,0 +1,153 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package jsonplugin_test + +import ( + "testing" + "time" + + . "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" + "github.com/google/go-cmp/cmp" +) + +var ( + testTime = time.Date(2006, time.January, 2, 15, 4, 5, 123456789, time.FixedZone("07:00", 7*3600)) + testDuration = time.Hour + 2*time.Minute + 3*time.Second + 123456789 +) + +func testMarshal(t *testing.T, f func(s *MarshalState), expected string) { + t.Helper() + + s := NewMarshalState(MarshalerConfig{}) + f(s) + data, err := s.Bytes() + if err != nil { + t.Error(err) + } + if diff := cmp.Diff(expected, string(data)); diff != "" { + t.Errorf("diff: %s", diff) + } +} + +func TestMarshaler(t *testing.T) { + // float + + testMarshal(t, func(s *MarshalState) { + s.WriteFloat32(-12.34) + }, `-12.34`) + + testMarshal(t, func(s *MarshalState) { + s.WriteFloat64(-12.34) + }, `-12.34`) + + testMarshal(t, func(s *MarshalState) { + s.WriteFloat32Array([]float32{-12.34, 56.78}) + }, `[-12.34,56.78]`) + + testMarshal(t, func(s *MarshalState) { + s.WriteFloat64Array([]float64{-12.34, 56.78}) + }, `[-12.34,56.78]`) + + // int + + testMarshal(t, func(s *MarshalState) { + s.WriteInt32(-12) + }, `-12`) + + testMarshal(t, func(s *MarshalState) { + s.WriteInt64(-12) + }, `"-12"`) + + testMarshal(t, func(s *MarshalState) { + s.WriteInt32Array([]int32{-12, 34}) + }, `[-12,34]`) + + testMarshal(t, func(s *MarshalState) { + s.WriteInt64Array([]int64{-12, 34}) + }, `["-12","34"]`) + + // uint + + testMarshal(t, func(s *MarshalState) { + s.WriteUint32(12) + }, `12`) + + testMarshal(t, func(s *MarshalState) { + s.WriteUint64(12) + }, `"12"`) + + testMarshal(t, func(s *MarshalState) { + s.WriteUint32Array([]uint32{12, 34}) + }, `[12,34]`) + + testMarshal(t, func(s *MarshalState) { + s.WriteUint64Array([]uint64{12, 34}) + }, `["12","34"]`) + + // bool + + testMarshal(t, func(s *MarshalState) { + s.WriteBool(true) + }, `true`) + + testMarshal(t, func(s *MarshalState) { + s.WriteBool(false) + }, `false`) + + testMarshal(t, func(s *MarshalState) { + s.WriteBoolArray([]bool{true, false}) + }, `[true,false]`) + + // string + + testMarshal(t, func(s *MarshalState) { + s.WriteString("foo") + }, `"foo"`) + + testMarshal(t, func(s *MarshalState) { + s.WriteStringArray([]string{"foo", "bar"}) + }, `["foo","bar"]`) + + // bytes + + testMarshal(t, func(s *MarshalState) { + s.WriteBytes([]byte("foob")) + }, `"Zm9vYg=="`) + + testMarshal(t, func(s *MarshalState) { + s.WriteBytesArray([][]byte{[]byte("foob"), []byte("ar"), []byte("qs?"), []byte("ps>")}) + }, `["Zm9vYg==","YXI=","cXM/","cHM+"]`) + + // nil + + testMarshal(t, func(s *MarshalState) { + s.WriteNil() + }, `null`) + + // time + + testMarshal(t, func(s *MarshalState) { s.WriteTime(testTime) }, `"2006-01-02T08:04:05.123456789Z"`) + testMarshal(t, func(s *MarshalState) { s.WriteTime(testTime.Truncate(10)) }, `"2006-01-02T08:04:05.123456780Z"`) + testMarshal(t, func(s *MarshalState) { s.WriteTime(testTime.Truncate(100)) }, `"2006-01-02T08:04:05.123456700Z"`) + testMarshal(t, func(s *MarshalState) { s.WriteTime(testTime.Truncate(1000)) }, `"2006-01-02T08:04:05.123456Z"`) + testMarshal(t, func(s *MarshalState) { s.WriteTime(testTime.Truncate(10000)) }, `"2006-01-02T08:04:05.123450Z"`) + testMarshal(t, func(s *MarshalState) { s.WriteTime(testTime.Truncate(100000)) }, `"2006-01-02T08:04:05.123400Z"`) + testMarshal(t, func(s *MarshalState) { s.WriteTime(testTime.Truncate(1000000)) }, `"2006-01-02T08:04:05.123Z"`) + testMarshal(t, func(s *MarshalState) { s.WriteTime(testTime.Truncate(10000000)) }, `"2006-01-02T08:04:05.120Z"`) + testMarshal(t, func(s *MarshalState) { s.WriteTime(testTime.Truncate(100000000)) }, `"2006-01-02T08:04:05.100Z"`) + testMarshal(t, func(s *MarshalState) { s.WriteTime(testTime.Truncate(1000000000)) }, `"2006-01-02T08:04:05Z"`) + + // duration + + testMarshal(t, func(s *MarshalState) { s.WriteDuration(testDuration) }, `"3723.123456789s"`) + testMarshal(t, func(s *MarshalState) { s.WriteDuration(testDuration.Truncate(10)) }, `"3723.123456780s"`) + testMarshal(t, func(s *MarshalState) { s.WriteDuration(testDuration.Truncate(100)) }, `"3723.123456700s"`) + testMarshal(t, func(s *MarshalState) { s.WriteDuration(testDuration.Truncate(1000)) }, `"3723.123456s"`) + testMarshal(t, func(s *MarshalState) { s.WriteDuration(testDuration.Truncate(10000)) }, `"3723.123450s"`) + testMarshal(t, func(s *MarshalState) { s.WriteDuration(testDuration.Truncate(100000)) }, `"3723.123400s"`) + testMarshal(t, func(s *MarshalState) { s.WriteDuration(testDuration.Truncate(1000000)) }, `"3723.123s"`) + testMarshal(t, func(s *MarshalState) { s.WriteDuration(testDuration.Truncate(10000000)) }, `"3723.120s"`) + testMarshal(t, func(s *MarshalState) { s.WriteDuration(testDuration.Truncate(100000000)) }, `"3723.100s"`) + testMarshal(t, func(s *MarshalState) { s.WriteDuration(testDuration.Truncate(1000000000)) }, `"3723s"`) +} diff --git a/jsonplugin/plugin.go b/jsonplugin/plugin.go new file mode 100644 index 00000000..725e60a6 --- /dev/null +++ b/jsonplugin/plugin.go @@ -0,0 +1,30 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package jsonplugin + +import jsoniter "github.com/json-iterator/go" + +var jsoniterConfig = jsoniter.Config{ + EscapeHTML: true, + ValidateJsonRawMessage: true, +}.Froze() + +func valueTypeString(v jsoniter.ValueType) string { + switch v { + case jsoniter.StringValue: + return "String" + case jsoniter.NumberValue: + return "Number" + case jsoniter.NilValue: + return "Null" + case jsoniter.BoolValue: + return "Bool" + case jsoniter.ArrayValue: + return "Array" + case jsoniter.ObjectValue: + return "Object" + default: + return "unknown" + } +} diff --git a/jsonplugin/unmarshal.go b/jsonplugin/unmarshal.go new file mode 100644 index 00000000..3450ac76 --- /dev/null +++ b/jsonplugin/unmarshal.go @@ -0,0 +1,648 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package jsonplugin + +import ( + "encoding/base64" + "encoding/json" + "fmt" + "io" + "strconv" + "strings" + "time" + + jsoniter "github.com/json-iterator/go" +) + +// Unmarshaler is the interface implemented by types that are supported by this plugin. +type Unmarshaler interface { + UnmarshalProtoJSON(*UnmarshalState) +} + +type unmarshalError struct { + Err error + Path *path +} + +func (e *unmarshalError) Error() string { + if e.Path != nil { + return fmt.Sprintf("unmarshal error at path %q: %v", e.Path, e.Err) + } + return fmt.Sprintf("unmarshal error: %v", e.Err) +} + +// UnmarshalerConfig is the configuration for the Unmarshaler. +type UnmarshalerConfig struct{} + +// Unmarshal unmarshals a message. +func (c UnmarshalerConfig) Unmarshal(data []byte, m Unmarshaler) error { + s := NewUnmarshalState(data, c) + m.UnmarshalProtoJSON(s) + return s.Err() +} + +// UnmarshalState is the internal state of the Unmarshaler. +type UnmarshalState struct { + inner *jsoniter.Iterator + config *UnmarshalerConfig + + err *unmarshalError + path *path + paths *pathSlice +} + +// NewUnmarshalState creates a new UnmarshalState. +func NewUnmarshalState(data []byte, config UnmarshalerConfig) *UnmarshalState { + return &UnmarshalState{ + inner: jsoniter.ParseBytes(jsoniterConfig, data), + config: &config, + + err: &unmarshalError{}, + path: nil, + paths: &pathSlice{}, + } +} + +// Config returns a copy of the unmarshaler configuration. +func (s *UnmarshalState) Config() UnmarshalerConfig { + return *s.config +} + +// Sub returns a subunmarshaler with a new buffer, but with the same configuration, error and path info. +func (s *UnmarshalState) Sub(data []byte) *UnmarshalState { + return &UnmarshalState{ + inner: jsoniter.ParseBytes(jsoniterConfig, data), + config: s.config, + + err: s.err, + path: s.path, + paths: &pathSlice{}, + } +} + +// Err returns an error from the marshaler, if any. +func (s *UnmarshalState) Err() error { + if s.err.Err != nil { + return s.err + } + if s.inner.Error != nil && s.inner.Error != io.EOF { + return s.inner.Error + } + return nil +} + +// SetError sets an error in the unmarshaler state. +// Subsequent operations become no-ops. +func (s *UnmarshalState) SetError(err error) { + if s.Err() != nil { + return + } + s.err.Err = err + s.err.Path = s.path +} + +// SetErrorf calls SetError with a formatted error. +func (s *UnmarshalState) SetErrorf(format string, a ...interface{}) { + s.SetError(fmt.Errorf(format, a...)) +} + +// WithField returns a UnmarshalState for the given subfield. +func (s *UnmarshalState) WithField(field string, mask bool) *UnmarshalState { + fm := s.paths + if !mask { + fm = &pathSlice{} + } + return &UnmarshalState{ + inner: s.inner, + config: s.config, + + err: s.err, + path: s.path.push(field), + paths: fm, + } +} + +// AddField registers a field in the field mask of the unmarshaler state. +func (s *UnmarshalState) AddField(field string) { + s.paths.add(*s.path.push(field)) +} + +// FieldMask returns the field mask containing the unmarshaled fields. +func (s *UnmarshalState) FieldMask() FieldMask { + return s.paths +} + +// ReadFloat32 reads a float32 value. This also supports string encoding. +func (s *UnmarshalState) ReadFloat32() float32 { + if s.Err() != nil { + return 0 + } + switch any := s.inner.ReadAny(); any.ValueType() { + case jsoniter.NumberValue: + return any.ToFloat32() + case jsoniter.StringValue: + f, err := strconv.ParseFloat(any.ToString(), 32) + if err != nil { + s.SetErrorf("invalid value for float32: %w", err) + return 0 + } + return float32(f) + default: + s.SetErrorf("invalid value type for float32: %s", valueTypeString(any.ValueType())) + return 0 + } +} + +// ReadFloat64 reads a float64 value. This also supports string encoding. +func (s *UnmarshalState) ReadFloat64() float64 { + if s.Err() != nil { + return 0 + } + switch any := s.inner.ReadAny(); any.ValueType() { + case jsoniter.NumberValue: + return any.ToFloat64() + case jsoniter.StringValue: + f, err := strconv.ParseFloat(any.ToString(), 64) + if err != nil { + s.SetErrorf("invalid value for float64: %w", err) + return 0 + } + return float64(f) + default: + s.SetErrorf("invalid value type for float64: %s", valueTypeString(any.ValueType())) + return 0 + } +} + +// ReadFloat32Array reads an array of float32 values. +func (s *UnmarshalState) ReadFloat32Array() []float32 { + var arr []float32 + s.ReadArray(func() { + n := s.ReadFloat32() + if s.Err() != nil { + return + } + arr = append(arr, n) + }) + if s.Err() != nil { + return nil + } + return arr +} + +// ReadFloat64Array reads an array of float64 values. +func (s *UnmarshalState) ReadFloat64Array() []float64 { + var arr []float64 + s.ReadArray(func() { + n := s.ReadFloat64() + if s.Err() != nil { + return + } + arr = append(arr, n) + }) + if s.Err() != nil { + return nil + } + return arr +} + +// ReadInt32 reads a int32 value. This also supports string encoding. +func (s *UnmarshalState) ReadInt32() int32 { + if s.Err() != nil { + return 0 + } + switch any := s.inner.ReadAny(); any.ValueType() { + case jsoniter.NumberValue: + return any.ToInt32() + case jsoniter.StringValue: + f, err := strconv.ParseInt(any.ToString(), 10, 32) + if err != nil { + s.SetErrorf("invalid value for int32: %w", err) + return 0 + } + return int32(f) + default: + s.SetErrorf("invalid value type for int32: %s", valueTypeString(any.ValueType())) + return 0 + } +} + +// ReadInt64 reads a int64 value. This also supports string encoding. +func (s *UnmarshalState) ReadInt64() int64 { + if s.Err() != nil { + return 0 + } + switch any := s.inner.ReadAny(); any.ValueType() { + case jsoniter.NumberValue: + return any.ToInt64() + case jsoniter.StringValue: + f, err := strconv.ParseInt(any.ToString(), 10, 64) + if err != nil { + s.SetErrorf("invalid value for int64: %w", err) + return 0 + } + return f + default: + s.SetErrorf("invalid value type for int64: %s", valueTypeString(any.ValueType())) + return 0 + } +} + +// ReadInt32Array reads an array of int32 values. +func (s *UnmarshalState) ReadInt32Array() []int32 { + var arr []int32 + s.ReadArray(func() { + n := s.ReadInt32() + if s.Err() != nil { + return + } + arr = append(arr, n) + }) + if s.Err() != nil { + return nil + } + return arr +} + +// ReadInt64Array reads an array of int64 values. +func (s *UnmarshalState) ReadInt64Array() []int64 { + var arr []int64 + s.ReadArray(func() { + n := s.ReadInt64() + if s.Err() != nil { + return + } + arr = append(arr, n) + }) + if s.Err() != nil { + return nil + } + return arr +} + +// ReadUint32 reads a uint32 value. This also supports string encoding. +func (s *UnmarshalState) ReadUint32() uint32 { + if s.Err() != nil { + return 0 + } + switch any := s.inner.ReadAny(); any.ValueType() { + case jsoniter.NumberValue: + return any.ToUint32() + case jsoniter.StringValue: + f, err := strconv.ParseUint(any.ToString(), 10, 32) + if err != nil { + s.SetErrorf("invalid value for uint32: %w", err) + return 0 + } + return uint32(f) + default: + s.SetErrorf("invalid value type for uint32: %s", valueTypeString(any.ValueType())) + return 0 + } +} + +// ReadUint64 reads a uint64 value. This also supports string encoding. +func (s *UnmarshalState) ReadUint64() uint64 { + if s.Err() != nil { + return 0 + } + switch any := s.inner.ReadAny(); any.ValueType() { + case jsoniter.NumberValue: + return any.ToUint64() + case jsoniter.StringValue: + f, err := strconv.ParseUint(any.ToString(), 10, 64) + if err != nil { + s.SetErrorf("invalid value for uint64: %w", err) + return 0 + } + return f + default: + s.SetErrorf("invalid value type for uint64: %s", valueTypeString(any.ValueType())) + return 0 + } +} + +// ReadUint32Array reads an array of uint32 values. +func (s *UnmarshalState) ReadUint32Array() []uint32 { + var arr []uint32 + s.ReadArray(func() { + n := s.ReadUint32() + if s.Err() != nil { + return + } + arr = append(arr, n) + }) + if s.Err() != nil { + return nil + } + return arr +} + +// ReadUint64Array reads an array of uint64 values. +func (s *UnmarshalState) ReadUint64Array() []uint64 { + var arr []uint64 + s.ReadArray(func() { + n := s.ReadUint64() + if s.Err() != nil { + return + } + arr = append(arr, n) + }) + if s.Err() != nil { + return nil + } + return arr +} + +// ReadBool reads a bool value. +func (s *UnmarshalState) ReadBool() bool { + if s.Err() != nil { + return false + } + return s.inner.ReadBool() +} + +// ReadBoolArray reads an array of bool values. +func (s *UnmarshalState) ReadBoolArray() []bool { + var arr []bool + s.ReadArray(func() { + n := s.ReadBool() + if s.Err() != nil { + return + } + arr = append(arr, n) + }) + if s.Err() != nil { + return nil + } + return arr +} + +// ReadString reads a string value. +func (s *UnmarshalState) ReadString() string { + if s.Err() != nil { + return "" + } + return s.inner.ReadString() +} + +// ReadStringArray reads an array of string values. +func (s *UnmarshalState) ReadStringArray() []string { + var arr []string + s.ReadArray(func() { + n := s.ReadString() + if s.Err() != nil { + return + } + arr = append(arr, n) + }) + if s.Err() != nil { + return nil + } + return arr +} + +var base64Replacer = strings.NewReplacer("_", "/", "-", "+") + +// ReadBytes reads a string value. +func (s *UnmarshalState) ReadBytes() []byte { + if s.Err() != nil { + return nil + } + b64 := s.inner.ReadString() + if s.Err() != nil { + return nil + } + // According to the protobuf spec, we need to accept both padded and unpadded base64 strings. + b64 = strings.TrimRight(b64, "=") + // According to the protobuf spec, we need to accept both standard encoding and URL encoding. + b64 = base64Replacer.Replace(b64) + // What's left is raw standard encoding. + v, err := base64.RawStdEncoding.DecodeString(b64) + if err != nil { + s.SetErrorf("invalid value: %w", err) + return nil + } + return v +} + +// ReadBytesArray reads an array of []byte values. +func (s *UnmarshalState) ReadBytesArray() [][]byte { + if s.Err() != nil { + return nil + } + var arr [][]byte + s.ReadArray(func() { + n := s.ReadBytes() + if s.Err() != nil { + return + } + arr = append(arr, n) + }) + if s.Err() != nil { + return nil + } + return arr +} + +// ReadNil reads a null, if there is one. +func (s *UnmarshalState) ReadNil() bool { + return s.inner.ReadNil() +} + +// ReadObjectField reads a single object field. +func (s *UnmarshalState) ReadObjectField() string { + if s.Err() != nil { + return "" + } + return s.inner.ReadObject() +} + +// ReadObject reads all object fields, and calls cb for each. +// cb must always read the value of the field. +func (s *UnmarshalState) ReadObject(cb func(key string)) { + if s.Err() != nil { + return + } + s.inner.ReadObjectCB(func(_ *jsoniter.Iterator, key string) bool { + if s.Err() != nil { + return false + } + cb(key) + return true + }) +} + +// ReadBoolMap reads an object where the keys are bool, and calls cb for each field. +// cb must always read the value of the field. +func (s *UnmarshalState) ReadBoolMap(cb func(key bool)) { + s.ReadObject(func(keyStr string) { + key, err := strconv.ParseBool(keyStr) + if err != nil { + s.SetErrorf("invalid map key %q for bool map", keyStr) + return + } + cb(key) + }) +} + +// ReadInt32Map reads an object where the keys are int32, and calls cb for each field. +// cb must always read the value of the field. +func (s *UnmarshalState) ReadInt32Map(cb func(key int32)) { + s.ReadObject(func(keyStr string) { + key, err := strconv.ParseInt(keyStr, 10, 32) + if err != nil { + s.SetErrorf("invalid map key %q for int32 map", keyStr) + return + } + cb(int32(key)) + }) +} + +// ReadUint32Map reads an object where the keys are uint32, and calls cb for each field. +// cb must always read the value of the field. +func (s *UnmarshalState) ReadUint32Map(cb func(key uint32)) { + s.ReadObject(func(keyStr string) { + key, err := strconv.ParseUint(keyStr, 10, 32) + if err != nil { + s.SetErrorf("invalid map key %q for uint32 map", keyStr) + return + } + cb(uint32(key)) + }) +} + +// ReadInt64Map reads an object where the keys are int64, and calls cb for each field. +// cb must always read the value of the field. +func (s *UnmarshalState) ReadInt64Map(cb func(key int64)) { + s.ReadObject(func(keyStr string) { + key, err := strconv.ParseInt(keyStr, 10, 64) + if err != nil { + s.SetErrorf("invalid map key %q for int64 map", keyStr) + return + } + cb(key) + }) +} + +// ReadUint64Map reads an object where the keys are uint64, and calls cb for each field. +// cb must always read the value of the field. +func (s *UnmarshalState) ReadUint64Map(cb func(key uint64)) { + s.ReadObject(func(keyStr string) { + key, err := strconv.ParseUint(keyStr, 10, 64) + if err != nil { + s.SetErrorf("invalid map key %q for uint64 map", keyStr) + return + } + cb(key) + }) +} + +// ReadStringMap reads an object where the keys are string, and calls cb for each field. +// cb must always read the value of the field. +func (s *UnmarshalState) ReadStringMap(cb func(key string)) { + s.ReadObject(cb) +} + +// ReadArray reads all array elements, and calls cb for each. +// cb must always read the value of the element. +func (s *UnmarshalState) ReadArray(cb func()) { + if s.Err() != nil { + return + } + s.inner.ReadArrayCB(func(_ *jsoniter.Iterator) bool { + if s.Err() != nil { + return false + } + cb() + return true + }) +} + +// ReadEnum reads an enum. It supports numeric values and string values. +func (s *UnmarshalState) ReadEnum(valueMaps ...map[string]int32) int32 { + if s.Err() != nil { + return 0 + } + switch any := s.inner.ReadAny(); any.ValueType() { + case jsoniter.NumberValue: + return any.ToInt32() + case jsoniter.StringValue: + v := any.ToString() + for _, valueMap := range valueMaps { + if v, ok := valueMap[v]; ok { + return v + } + } + s.SetErrorf("unknown value for enum: %q", v) + return 0 + default: + s.SetErrorf("invalid value type for enum: %s", valueTypeString(any.ValueType())) + return 0 + } +} + +// ReadTime reads a time. +func (s *UnmarshalState) ReadTime() *time.Time { + if s.Err() != nil { + return nil + } + if s.ReadNil() { + return nil + } + t, err := time.Parse("2006-01-02T15:04:05.999999999Z", s.inner.ReadString()) + if err != nil { + s.SetErrorf("invalid time: %w", err) + return nil + } + return &t +} + +// ReadDuration reads a duration. +func (s *UnmarshalState) ReadDuration() *time.Duration { + if s.Err() != nil { + return nil + } + if s.ReadNil() { + return nil + } + d, err := time.ParseDuration(s.inner.ReadString()) + if err != nil { + s.SetErrorf("invalid duration: %w", err) + } + return &d +} + +// ReadFieldMask reads a field mask value. +func (s *UnmarshalState) ReadFieldMask() FieldMask { + if s.Err() != nil { + return nil + } + next := s.inner.WhatIsNext() + switch next { + case jsoniter.StringValue: + return newPathSlice(strings.Split(s.ReadString(), ",")...) + case jsoniter.ObjectValue: + if s.ReadObjectField() != "paths" { + s.inner.ReadAny() + break + } + return newPathSlice(s.ReadStringArray()...) + } + s.SetErrorf("invalid value type for field mask: %s", valueTypeString(next)) + return nil +} + +// ReadRawMessage reads a raw JSON message. +func (s *UnmarshalState) ReadRawMessage() json.RawMessage { + var msg json.RawMessage + s.inner.ReadVal(&msg) + if s.Err() != nil { + return nil + } + return msg +} + +// ReadAny reads any type and ignores it. +func (s *UnmarshalState) ReadAny() { s.inner.ReadAny() } diff --git a/jsonplugin/unmarshal_test.go b/jsonplugin/unmarshal_test.go new file mode 100644 index 00000000..20176fb2 --- /dev/null +++ b/jsonplugin/unmarshal_test.go @@ -0,0 +1,241 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package jsonplugin_test + +import ( + "io" + "reflect" + "testing" + + . "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" + "github.com/google/go-cmp/cmp" +) + +func testUnmarshal(t *testing.T, f func(s *UnmarshalState) interface{}, data string, expected interface{}) { + t.Helper() + if expectedValue := reflect.ValueOf(expected); expectedValue.Type().Kind() == reflect.Ptr { + expected = expectedValue.Elem().Interface() + } + s := NewUnmarshalState([]byte(data), UnmarshalerConfig{}) + actual := f(s) + if actualValue := reflect.ValueOf(actual); actualValue.Type().Kind() == reflect.Ptr { + actual = actualValue.Elem().Interface() + } + if err := s.Err(); err != nil && err != io.EOF { + t.Error(err) + } + if diff := cmp.Diff(expected, actual); diff != "" { + t.Errorf("diff: %s", diff) + } +} + +func TestUnmarshaler(t *testing.T) { + // float + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadFloat32() + }, `-12.34`, float32(-12.34)) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadFloat32() + }, `"-12.34"`, float32(-12.34)) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadFloat64() + }, `-12.34`, -12.34) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadFloat64() + }, `"-12.34"`, -12.34) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadFloat32Array() + }, `[-12.34,56.78]`, []float32{-12.34, 56.78}) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadFloat64Array() + }, `[-12.34,56.78]`, []float64{-12.34, 56.78}) + + // int + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadInt32() + }, `-12`, int32(-12)) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadInt32() + }, `"-12"`, int32(-12)) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadInt64() + }, `-12`, int64(-12)) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadInt64() + }, `"-12"`, int64(-12)) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadInt32Array() + }, `[-12,34]`, []int32{-12, 34}) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadInt64Array() + }, `["-12","34"]`, []int64{-12, 34}) + + // uint + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadUint32() + }, `12`, uint32(12)) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadUint32() + }, `"12"`, uint32(12)) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadUint64() + }, `12`, uint64(12)) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadUint64() + }, `"12"`, uint64(12)) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadUint32Array() + }, `[12,34]`, []uint32{12, 34}) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadUint64Array() + }, `["12","34"]`, []uint64{12, 34}) + + // bool + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadBool() + }, `true`, true) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadBool() + }, `false`, false) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadBoolArray() + }, `[true,false]`, []bool{true, false}) + + // string + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadString() + }, `"foo"`, "foo") + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadStringArray() + }, `["foo","bar"]`, []string{"foo", "bar"}) + + // bytes + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadBytes() + }, `"Zm9vYg=="`, []byte("foob")) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadBytes() + }, `"YXI="`, []byte("ar")) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadBytes() + }, `"YXI"`, []byte("ar")) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadBytes() + }, `"cXM/"`, []byte("qs?")) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadBytes() + }, `"cXM_"`, []byte("qs?")) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadBytes() + }, `"cHM+"`, []byte("ps>")) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadBytes() + }, `"cHM-"`, []byte("ps>")) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadBytesArray() + }, `["Zm9vYg==","YXI=","cXM/","cHM+"]`, [][]byte{[]byte("foob"), []byte("ar"), []byte("qs?"), []byte("ps>")}) + + // nil + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadNil() + }, `null`, true) + + // time + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadTime() + }, `"2006-01-02T08:04:05.123456789Z"`, testTime.UTC()) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadTime() + }, `"2006-01-02T08:04:05.123456780Z"`, testTime.UTC().Truncate(10)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadTime() + }, `"2006-01-02T08:04:05.123456700Z"`, testTime.UTC().Truncate(100)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadTime() + }, `"2006-01-02T08:04:05.123456Z"`, testTime.UTC().Truncate(1000)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadTime() + }, `"2006-01-02T08:04:05.123450Z"`, testTime.UTC().Truncate(10000)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadTime() + }, `"2006-01-02T08:04:05.123400Z"`, testTime.UTC().Truncate(100000)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadTime() + }, `"2006-01-02T08:04:05.123Z"`, testTime.UTC().Truncate(1000000)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadTime() + }, `"2006-01-02T08:04:05.120Z"`, testTime.UTC().Truncate(10000000)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadTime() + }, `"2006-01-02T08:04:05.100Z"`, testTime.UTC().Truncate(100000000)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadTime() + }, `"2006-01-02T08:04:05Z"`, testTime.UTC().Truncate(1000000000)) + + // duration + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadDuration() + }, `"3723.123456789s"`, testDuration) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadDuration() + }, `"3723.123456780s"`, testDuration.Truncate(10)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadDuration() + }, `"3723.123456700s"`, testDuration.Truncate(100)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadDuration() + }, `"3723.123456s"`, testDuration.Truncate(1000)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadDuration() + }, `"3723.123450s"`, testDuration.Truncate(10000)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadDuration() + }, `"3723.123400s"`, testDuration.Truncate(100000)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadDuration() + }, `"3723.123s"`, testDuration.Truncate(1000000)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadDuration() + }, `"3723.120s"`, testDuration.Truncate(10000000)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadDuration() + }, `"3723.100s"`, testDuration.Truncate(100000000)) + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadDuration() + }, `"3723s"`, testDuration.Truncate(1000000000)) +} diff --git a/test/api.proto b/test/api.proto new file mode 100644 index 00000000..e62096ce --- /dev/null +++ b/test/api.proto @@ -0,0 +1,8 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +syntax = "proto3"; + +package thethings.json.test; + +option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/test"; diff --git a/test/enums.proto b/test/enums.proto new file mode 100644 index 00000000..e7af87f1 --- /dev/null +++ b/test/enums.proto @@ -0,0 +1,61 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +syntax = "proto3"; + +import "annotations.proto"; +import "internal/gogoproto/gogo.proto"; + +package thethings.json.test; + +option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/test"; + +option (gogoproto.enum_stringer_all) = true; +option (gogoproto.goproto_enum_stringer_all) = false; + +option (thethings.json.file) = { marshaler_all: true, unmarshaler_all: true }; + +enum RegularEnum { + option (thethings.json.enum) = { marshaler: false, unmarshaler: false }; + + option (gogoproto.goproto_enum_prefix) = false; + option (gogoproto.enum_stringer) = false; + + REGULAR_UNKNOWN = 0; + + REGULAR_A = 1; + REGULAR_B = 2; +} + +enum CustomEnum { + option (thethings.json.enum) = { marshal_as_string: true, prefix: "CUSTOM" }; + + CUSTOM_UNKNOWN = 0; + CUSTOM_V1_0 = 1 [ (thethings.json.enum_value) = { value: "1.0", aliases: ["1.0.0"] } ]; + CUSTOM_V1_0_1 = 2 [ (thethings.json.enum_value) = { value: "1.0.1" } ]; +} + +message CustomEnumValue { + option (thethings.json.message) = { wrapper: true }; + + CustomEnum value = 1; +} + +message MessageWithEnums { + RegularEnum regular = 1; + repeated RegularEnum regulars = 2; + + CustomEnum custom = 3; + repeated CustomEnum customs = 4; + + CustomEnumValue wrapped_custom = 5; + repeated CustomEnumValue wrapped_customs = 6; +} + +message MessageWithOneofEnums { + oneof value { + RegularEnum regular = 1; + CustomEnum custom = 2; + CustomEnumValue wrapped_custom = 3; + } +} diff --git a/test/gogo.proto b/test/gogo.proto new file mode 100644 index 00000000..9355750a --- /dev/null +++ b/test/gogo.proto @@ -0,0 +1,102 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +syntax = "proto3"; + +import "annotations.proto"; +import "internal/gogoproto/gogo.proto"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +package thethings.json.test; + +option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/test"; + +option (thethings.json.file) = { marshaler_all: true, unmarshaler_all: true }; + +message MessageWithGoGoOptions { + bytes eui_with_custom_name = 1 [ + (gogoproto.customname) = "EUIWithCustomName" + ]; + + bytes eui_with_custom_name_and_type = 2 [ + (gogoproto.customname) = "EUIWithCustomNameAndType", + (gogoproto.customtype) = "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.EUI64", + (thethings.json.field) = { + marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEX", + unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEX" + } + ]; + + bytes non_nullable_eui_with_custom_name_and_type = 3 [ + (gogoproto.customname) = "NonNullableEUIWithCustomNameAndType", + (gogoproto.customtype) = "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.EUI64", + (gogoproto.nullable) = false, + (thethings.json.field) = { + marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEX", + unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEX" + } + ]; + + repeated bytes euis_with_custom_name_and_type = 4 [ + (gogoproto.customname) = "EUIsWithCustomNameAndType", + (gogoproto.customtype) = "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.EUI64", + (thethings.json.field) = { + marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEXArray", + unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEXArray" + } + ]; + + google.protobuf.Duration duration = 5 [(gogoproto.stdduration) = true]; + google.protobuf.Duration non_nullable_duration = 6 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + + google.protobuf.Timestamp timestamp = 7 [(gogoproto.stdtime) = true]; + google.protobuf.Timestamp non_nullable_timestamp = 8 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +message SubMessage { + string field = 1; +} + +message SubMessageWithoutMarshalers { + option (thethings.json.message) = { marshaler: false, unmarshaler: false }; + + string other_field = 1; +} + +message MessageWithNullable { + SubMessage sub = 1 [ + (gogoproto.nullable) = false + ]; + repeated SubMessage subs = 2 [ + (gogoproto.nullable) = false + ]; + + SubMessageWithoutMarshalers other_sub = 3 [ + (gogoproto.nullable) = false + ]; + repeated SubMessageWithoutMarshalers other_subs = 4 [ + (gogoproto.nullable) = false + ]; +} + +message MessageWithEmbedded{ + SubMessage sub = 1 [ + (gogoproto.embed) = true + ]; + SubMessageWithoutMarshalers other_sub = 2 [ + (gogoproto.embed) = true + ]; +} + +message MessageWithNullableEmbedded{ + SubMessage sub = 1 [ + (gogoproto.nullable) = false, + (gogoproto.embed) = true + ]; + SubMessageWithoutMarshalers other_sub = 2 [ + (gogoproto.nullable) = false, + (gogoproto.embed) = true + ]; +} diff --git a/test/gogo/api.pb.go b/test/gogo/api.pb.go new file mode 100644 index 00000000..9c031701 --- /dev/null +++ b/test/gogo/api.pb.go @@ -0,0 +1,34 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: api.proto + +package test + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + 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 + +func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } + +var fileDescriptor_00212fb1f9d3bf1c = []byte{ + // 109 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x2c, 0xc8, 0xd4, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x2e, 0xc9, 0x48, 0x2d, 0xc9, 0xc8, 0xcc, 0x4b, 0x2f, + 0xd6, 0xcb, 0x2a, 0xce, 0xcf, 0xd3, 0x2b, 0x49, 0x2d, 0x2e, 0x71, 0xb2, 0x88, 0x32, 0x4b, 0xcf, + 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x0f, 0xc9, 0x48, 0x0d, 0x01, 0xab, 0xf0, + 0xcc, 0x4b, 0x29, 0x2d, 0x2e, 0x29, 0xca, 0x4c, 0x2d, 0xd6, 0x07, 0x6b, 0x4e, 0xd6, 0x4d, 0x4f, + 0xcd, 0xd3, 0x4d, 0xcf, 0xd7, 0x05, 0xe9, 0xd4, 0x07, 0xe9, 0x4c, 0x62, 0x03, 0x4b, 0x18, 0x03, + 0x02, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x7e, 0x2f, 0x44, 0x62, 0x00, 0x00, 0x00, +} diff --git a/test/gogo/enums.gogo_overrides.go b/test/gogo/enums.gogo_overrides.go new file mode 100644 index 00000000..2d2c5a01 --- /dev/null +++ b/test/gogo/enums.gogo_overrides.go @@ -0,0 +1,65 @@ +package test + +import ( + "fmt" + "strconv" +) + +// MarshalJSON implements json.Marshaler interface. +func (v CustomEnum) MarshalJSON() ([]byte, error) { + switch v { + case CustomEnum_CUSTOM_UNKNOWN: + return []byte(strconv.Quote("CUSTOM_UNKNOWN")), nil + case CustomEnum_CUSTOM_V1_0: + return []byte(strconv.Quote("1.0")), nil + case CustomEnum_CUSTOM_V1_0_1: + return []byte(strconv.Quote("1.0.1")), nil + } + return []byte(strconv.Itoa(int(v))), nil +} + +func init() { + for k, v := range CustomEnum_customvalue { + CustomEnum_value[k] = v + } +} + +// UnmarshalJSON implements json.Marshaler interface. +func (v *CustomEnum) UnmarshalJSON(b []byte) error { + if unquoted, err := strconv.Unquote(string(b)); err == nil { + switch unquoted { + case "0", "CUSTOM_UNKNOWN", "UNKNOWN": + *v = CustomEnum_CUSTOM_UNKNOWN + case "1.0", "1.0.0", "CUSTOM_V1_0", "V1_0": + *v = CustomEnum_CUSTOM_V1_0 + case "1.0.1", "CUSTOM_V1_0_1", "V1_0_1": + *v = CustomEnum_CUSTOM_V1_0 + default: + return fmt.Errorf("invalid value: %q", unquoted) + } + return nil + } + n, err := strconv.Atoi(string(b)) + if err != nil { + return err + } + *v = CustomEnum(n) + return nil +} + +// MarshalJSON implements json.Marshaler interface. +func (v CustomEnumValue) MarshalJSON() ([]byte, error) { + return v.Value.MarshalJSON() +} + +// UnmarshalJSON implements json.Unmarshaler interface. +func (v *CustomEnumValue) UnmarshalJSON(b []byte) error { + var vv CustomEnum + if err := vv.UnmarshalJSON(b); err != nil { + return err + } + *v = CustomEnumValue{ + Value: vv, + } + return nil +} diff --git a/test/gogo/enums.pb.go b/test/gogo/enums.pb.go new file mode 100644 index 00000000..58a81ac5 --- /dev/null +++ b/test/gogo/enums.pb.go @@ -0,0 +1,333 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: enums.proto + +package test + +import ( + fmt "fmt" + _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + _ "github.com/gogo/protobuf/gogoproto" + 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 + +type RegularEnum int32 + +const ( + REGULAR_UNKNOWN RegularEnum = 0 + REGULAR_A RegularEnum = 1 + REGULAR_B RegularEnum = 2 +) + +var RegularEnum_name = map[int32]string{ + 0: "REGULAR_UNKNOWN", + 1: "REGULAR_A", + 2: "REGULAR_B", +} + +var RegularEnum_value = map[string]int32{ + "REGULAR_UNKNOWN": 0, + "REGULAR_A": 1, + "REGULAR_B": 2, +} + +func (RegularEnum) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_888b6bd9597961ff, []int{0} +} + +type CustomEnum int32 + +const ( + CustomEnum_CUSTOM_UNKNOWN CustomEnum = 0 + CustomEnum_CUSTOM_V1_0 CustomEnum = 1 + CustomEnum_CUSTOM_V1_0_1 CustomEnum = 2 +) + +var CustomEnum_name = map[int32]string{ + 0: "CUSTOM_UNKNOWN", + 1: "CUSTOM_V1_0", + 2: "CUSTOM_V1_0_1", +} + +var CustomEnum_value = map[string]int32{ + "CUSTOM_UNKNOWN": 0, + "CUSTOM_V1_0": 1, + "CUSTOM_V1_0_1": 2, +} + +func (CustomEnum) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_888b6bd9597961ff, []int{1} +} + +type CustomEnumValue struct { + Value CustomEnum `protobuf:"varint,1,opt,name=value,proto3,enum=thethings.json.test.CustomEnum" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CustomEnumValue) Reset() { *m = CustomEnumValue{} } +func (m *CustomEnumValue) String() string { return proto.CompactTextString(m) } +func (*CustomEnumValue) ProtoMessage() {} +func (*CustomEnumValue) Descriptor() ([]byte, []int) { + return fileDescriptor_888b6bd9597961ff, []int{0} +} +func (m *CustomEnumValue) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CustomEnumValue.Unmarshal(m, b) +} +func (m *CustomEnumValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CustomEnumValue.Marshal(b, m, deterministic) +} +func (m *CustomEnumValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_CustomEnumValue.Merge(m, src) +} +func (m *CustomEnumValue) XXX_Size() int { + return xxx_messageInfo_CustomEnumValue.Size(m) +} +func (m *CustomEnumValue) XXX_DiscardUnknown() { + xxx_messageInfo_CustomEnumValue.DiscardUnknown(m) +} + +var xxx_messageInfo_CustomEnumValue proto.InternalMessageInfo + +func (m *CustomEnumValue) GetValue() CustomEnum { + if m != nil { + return m.Value + } + return CustomEnum_CUSTOM_UNKNOWN +} + +type MessageWithEnums struct { + Regular RegularEnum `protobuf:"varint,1,opt,name=regular,proto3,enum=thethings.json.test.RegularEnum" json:"regular,omitempty"` + Regulars []RegularEnum `protobuf:"varint,2,rep,packed,name=regulars,proto3,enum=thethings.json.test.RegularEnum" json:"regulars,omitempty"` + Custom CustomEnum `protobuf:"varint,3,opt,name=custom,proto3,enum=thethings.json.test.CustomEnum" json:"custom,omitempty"` + Customs []CustomEnum `protobuf:"varint,4,rep,packed,name=customs,proto3,enum=thethings.json.test.CustomEnum" json:"customs,omitempty"` + WrappedCustom *CustomEnumValue `protobuf:"bytes,5,opt,name=wrapped_custom,json=wrappedCustom,proto3" json:"wrapped_custom,omitempty"` + WrappedCustoms []*CustomEnumValue `protobuf:"bytes,6,rep,name=wrapped_customs,json=wrappedCustoms,proto3" json:"wrapped_customs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithEnums) Reset() { *m = MessageWithEnums{} } +func (m *MessageWithEnums) String() string { return proto.CompactTextString(m) } +func (*MessageWithEnums) ProtoMessage() {} +func (*MessageWithEnums) Descriptor() ([]byte, []int) { + return fileDescriptor_888b6bd9597961ff, []int{1} +} +func (m *MessageWithEnums) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithEnums.Unmarshal(m, b) +} +func (m *MessageWithEnums) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithEnums.Marshal(b, m, deterministic) +} +func (m *MessageWithEnums) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithEnums.Merge(m, src) +} +func (m *MessageWithEnums) XXX_Size() int { + return xxx_messageInfo_MessageWithEnums.Size(m) +} +func (m *MessageWithEnums) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithEnums.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithEnums proto.InternalMessageInfo + +func (m *MessageWithEnums) GetRegular() RegularEnum { + if m != nil { + return m.Regular + } + return REGULAR_UNKNOWN +} + +func (m *MessageWithEnums) GetRegulars() []RegularEnum { + if m != nil { + return m.Regulars + } + return nil +} + +func (m *MessageWithEnums) GetCustom() CustomEnum { + if m != nil { + return m.Custom + } + return CustomEnum_CUSTOM_UNKNOWN +} + +func (m *MessageWithEnums) GetCustoms() []CustomEnum { + if m != nil { + return m.Customs + } + return nil +} + +func (m *MessageWithEnums) GetWrappedCustom() *CustomEnumValue { + if m != nil { + return m.WrappedCustom + } + return nil +} + +func (m *MessageWithEnums) GetWrappedCustoms() []*CustomEnumValue { + if m != nil { + return m.WrappedCustoms + } + return nil +} + +type MessageWithOneofEnums struct { + // Types that are valid to be assigned to Value: + // *MessageWithOneofEnums_Regular + // *MessageWithOneofEnums_Custom + // *MessageWithOneofEnums_WrappedCustom + Value isMessageWithOneofEnums_Value `protobuf_oneof:"value"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithOneofEnums) Reset() { *m = MessageWithOneofEnums{} } +func (m *MessageWithOneofEnums) String() string { return proto.CompactTextString(m) } +func (*MessageWithOneofEnums) ProtoMessage() {} +func (*MessageWithOneofEnums) Descriptor() ([]byte, []int) { + return fileDescriptor_888b6bd9597961ff, []int{2} +} +func (m *MessageWithOneofEnums) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithOneofEnums.Unmarshal(m, b) +} +func (m *MessageWithOneofEnums) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithOneofEnums.Marshal(b, m, deterministic) +} +func (m *MessageWithOneofEnums) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithOneofEnums.Merge(m, src) +} +func (m *MessageWithOneofEnums) XXX_Size() int { + return xxx_messageInfo_MessageWithOneofEnums.Size(m) +} +func (m *MessageWithOneofEnums) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithOneofEnums.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithOneofEnums proto.InternalMessageInfo + +type isMessageWithOneofEnums_Value interface { + isMessageWithOneofEnums_Value() +} + +type MessageWithOneofEnums_Regular struct { + Regular RegularEnum `protobuf:"varint,1,opt,name=regular,proto3,enum=thethings.json.test.RegularEnum,oneof" json:"regular,omitempty"` +} +type MessageWithOneofEnums_Custom struct { + Custom CustomEnum `protobuf:"varint,2,opt,name=custom,proto3,enum=thethings.json.test.CustomEnum,oneof" json:"custom,omitempty"` +} +type MessageWithOneofEnums_WrappedCustom struct { + WrappedCustom *CustomEnumValue `protobuf:"bytes,3,opt,name=wrapped_custom,json=wrappedCustom,proto3,oneof" json:"wrapped_custom,omitempty"` +} + +func (*MessageWithOneofEnums_Regular) isMessageWithOneofEnums_Value() {} +func (*MessageWithOneofEnums_Custom) isMessageWithOneofEnums_Value() {} +func (*MessageWithOneofEnums_WrappedCustom) isMessageWithOneofEnums_Value() {} + +func (m *MessageWithOneofEnums) GetValue() isMessageWithOneofEnums_Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *MessageWithOneofEnums) GetRegular() RegularEnum { + if x, ok := m.GetValue().(*MessageWithOneofEnums_Regular); ok { + return x.Regular + } + return REGULAR_UNKNOWN +} + +func (m *MessageWithOneofEnums) GetCustom() CustomEnum { + if x, ok := m.GetValue().(*MessageWithOneofEnums_Custom); ok { + return x.Custom + } + return CustomEnum_CUSTOM_UNKNOWN +} + +func (m *MessageWithOneofEnums) GetWrappedCustom() *CustomEnumValue { + if x, ok := m.GetValue().(*MessageWithOneofEnums_WrappedCustom); ok { + return x.WrappedCustom + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MessageWithOneofEnums) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MessageWithOneofEnums_Regular)(nil), + (*MessageWithOneofEnums_Custom)(nil), + (*MessageWithOneofEnums_WrappedCustom)(nil), + } +} + +func init() { + proto.RegisterEnum("thethings.json.test.RegularEnum", RegularEnum_name, RegularEnum_value) + proto.RegisterEnum("thethings.json.test.CustomEnum", CustomEnum_name, CustomEnum_value) + proto.RegisterType((*CustomEnumValue)(nil), "thethings.json.test.CustomEnumValue") + proto.RegisterType((*MessageWithEnums)(nil), "thethings.json.test.MessageWithEnums") + proto.RegisterType((*MessageWithOneofEnums)(nil), "thethings.json.test.MessageWithOneofEnums") +} + +func init() { proto.RegisterFile("enums.proto", fileDescriptor_888b6bd9597961ff) } + +var fileDescriptor_888b6bd9597961ff = []byte{ + // 514 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x41, 0x6e, 0xda, 0x40, + 0x14, 0x86, 0x3d, 0x38, 0x40, 0xfa, 0x28, 0xe0, 0x4e, 0x54, 0xc9, 0x42, 0x0a, 0xb5, 0x50, 0x17, + 0x11, 0x12, 0x06, 0x52, 0xb5, 0x55, 0xa2, 0x6c, 0x42, 0x14, 0x85, 0x2a, 0x05, 0x54, 0x0a, 0x89, + 0xd4, 0x0d, 0x72, 0xc8, 0xd4, 0x76, 0x05, 0x33, 0xc8, 0x33, 0xd3, 0x5e, 0xa1, 0x87, 0xe8, 0xae, + 0x3d, 0x40, 0xcf, 0x94, 0x55, 0xc4, 0xaa, 0x47, 0xa8, 0x3c, 0x36, 0xe0, 0xb4, 0x91, 0xe2, 0xec, + 0x9e, 0xdf, 0xfc, 0xff, 0xff, 0xc6, 0xdf, 0xb3, 0xa1, 0x40, 0xa8, 0x9c, 0x73, 0x7b, 0x11, 0x30, + 0xc1, 0xf0, 0x8e, 0xf0, 0x88, 0xf0, 0x7c, 0xea, 0x72, 0xfb, 0x0b, 0x67, 0xd4, 0x16, 0x84, 0x8b, + 0xca, 0x33, 0x87, 0x52, 0x26, 0x1c, 0xe1, 0x33, 0x1a, 0xeb, 0x2a, 0xbb, 0x3e, 0x15, 0x24, 0xa0, + 0xce, 0xac, 0xe9, 0x32, 0x97, 0xa9, 0x9e, 0xaa, 0xa2, 0xe3, 0xda, 0x00, 0xca, 0x27, 0x92, 0x0b, + 0x36, 0x3f, 0xa5, 0x72, 0x7e, 0xe1, 0xcc, 0x24, 0xc1, 0xaf, 0x21, 0xfb, 0x35, 0x2c, 0x4c, 0x64, + 0xa1, 0xbd, 0xd2, 0xfe, 0x0b, 0xfb, 0x9e, 0x49, 0xf6, 0xc6, 0x34, 0x8c, 0xd4, 0x87, 0xd9, 0xa5, + 0xcc, 0x98, 0xa8, 0xf6, 0x43, 0x07, 0xa3, 0x47, 0x38, 0x77, 0x5c, 0x72, 0xe9, 0x0b, 0x2f, 0x54, + 0x70, 0x7c, 0x08, 0xf9, 0x80, 0xb8, 0x72, 0xe6, 0x04, 0x71, 0xa8, 0x75, 0x6f, 0xe8, 0x30, 0xd2, + 0xa8, 0xd4, 0x95, 0x01, 0x1f, 0xc1, 0x76, 0x5c, 0x72, 0x33, 0x63, 0xe9, 0xa9, 0xcc, 0x6b, 0x07, + 0x7e, 0x0b, 0xb9, 0xa9, 0xba, 0xaa, 0xa9, 0xa7, 0x7b, 0x9b, 0x58, 0x8e, 0x0f, 0x20, 0x1f, 0x55, + 0xdc, 0xdc, 0x52, 0x53, 0x1f, 0x74, 0xae, 0xf4, 0xf8, 0x1c, 0x4a, 0xdf, 0x02, 0x67, 0xb1, 0x20, + 0xd7, 0x93, 0x78, 0x76, 0xd6, 0x42, 0x7b, 0x85, 0xfd, 0x97, 0x0f, 0x24, 0x28, 0xfc, 0xc3, 0x62, + 0xec, 0x8d, 0xfa, 0xb8, 0x07, 0xe5, 0xbb, 0x61, 0xdc, 0xcc, 0x59, 0x7a, 0xea, 0xb4, 0xd2, 0x9d, + 0x34, 0x5e, 0xbb, 0x45, 0xf0, 0x3c, 0xb1, 0x9e, 0x01, 0x25, 0xec, 0x73, 0xb4, 0xa3, 0xa3, 0x47, + 0xef, 0xa8, 0xab, 0x6d, 0xb6, 0x74, 0xb0, 0xe6, 0x9c, 0x49, 0xc5, 0xb9, 0xab, 0xad, 0x49, 0xf7, + 0xfe, 0xc3, 0xa5, 0xa7, 0xc7, 0xd5, 0xd5, 0xfe, 0x01, 0xd6, 0xc9, 0xc7, 0x9f, 0x6f, 0xfd, 0x03, + 0x14, 0x12, 0x97, 0xc5, 0x3b, 0x50, 0x1e, 0x9e, 0x9e, 0x8d, 0xdf, 0x1f, 0x0f, 0x27, 0xe3, 0xfe, + 0x79, 0x7f, 0x70, 0xd9, 0x37, 0x34, 0x5c, 0x84, 0x27, 0xab, 0xe6, 0xb1, 0x81, 0x92, 0x8f, 0x1d, + 0x23, 0x53, 0x29, 0x2f, 0xe5, 0xd6, 0xb6, 0x66, 0x69, 0xdf, 0x7f, 0x56, 0xb5, 0xdf, 0xbf, 0xaa, + 0x5a, 0x7d, 0x01, 0xb0, 0x99, 0x8f, 0x31, 0x94, 0x4e, 0xc6, 0x1f, 0x47, 0x83, 0x5e, 0x22, 0xd0, + 0x82, 0x42, 0xdc, 0xbb, 0x68, 0x4f, 0x5a, 0x06, 0x0a, 0x33, 0x9e, 0x82, 0xde, 0xb6, 0x5b, 0x38, + 0xdb, 0xb6, 0x5b, 0x76, 0x0b, 0xef, 0x42, 0x31, 0xa1, 0x98, 0xb4, 0x8d, 0x4c, 0x05, 0x96, 0x32, + 0x0f, 0xea, 0xb8, 0x5d, 0x29, 0x2e, 0x25, 0x98, 0xa8, 0x9e, 0x8b, 0x34, 0x9d, 0xb3, 0xf0, 0x0a, + 0xc8, 0x40, 0xb7, 0x37, 0x55, 0xed, 0xcf, 0x4d, 0x15, 0x7d, 0x7a, 0xe3, 0xfa, 0xc2, 0x93, 0x57, + 0xf6, 0x94, 0xcd, 0x9b, 0x23, 0x8f, 0x8c, 0x14, 0x9f, 0x77, 0xf4, 0x5a, 0x72, 0x11, 0xf8, 0x84, + 0x37, 0xd5, 0x6f, 0x3d, 0x6d, 0xb8, 0x84, 0x36, 0x5c, 0xd6, 0x08, 0xb9, 0x35, 0x43, 0x6e, 0x57, + 0x39, 0x75, 0xf0, 0xea, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4f, 0x66, 0x55, 0x7e, 0x45, 0x04, + 0x00, 0x00, +} + +func (x CustomEnum) String() string { + s, ok := CustomEnum_name[int32(x)] + if ok { + return s + } + return strconv.Itoa(int(x)) +} diff --git a/test/gogo/enums_json.pb.go b/test/gogo/enums_json.pb.go new file mode 100644 index 00000000..4fdf88e5 --- /dev/null +++ b/test/gogo/enums_json.pb.go @@ -0,0 +1,229 @@ +// Code generated by protoc-gen-go-json. DO NOT EDIT. +// versions: +// - protoc-gen-go-json v0.0.0-dev +// - protoc v3.9.1 +// source: enums.proto + +package test + +import ( + jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" +) + +// CustomEnum_customname contains custom string values that override CustomEnum_name. +var CustomEnum_customname = map[int32]string{ + 1: "1.0", + 2: "1.0.1", +} + +// MarshalProtoJSON marshals the CustomEnum to JSON. +func (x CustomEnum) MarshalProtoJSON(s *jsonplugin.MarshalState) { + s.WriteEnumString(int32(x), CustomEnum_customname, CustomEnum_name) +} + +// CustomEnum_customvalue contains custom string values that extend CustomEnum_value. +var CustomEnum_customvalue = map[string]int32{ + "UNKNOWN": 0, + "V1_0": 1, + "1.0": 1, + "1.0.0": 1, + "V1_0_1": 2, + "1.0.1": 2, +} + +// UnmarshalProtoJSON unmarshals the CustomEnum from JSON. +func (x *CustomEnum) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + v := s.ReadEnum(CustomEnum_value, CustomEnum_customvalue) + if err := s.Err(); err != nil { + s.SetErrorf("could not read CustomEnum enum: %v", err) + return + } + *x = CustomEnum(v) +} + +// MarshalProtoJSON marshals the CustomEnumValue message to JSON. +func (x *CustomEnumValue) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + x.Value.MarshalProtoJSON(s) + return +} + +// UnmarshalProtoJSON unmarshals the CustomEnumValue message from JSON. +func (x *CustomEnumValue) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + x.Value.UnmarshalProtoJSON(s) + return +} + +// MarshalProtoJSON marshals the MessageWithEnums message to JSON. +func (x *MessageWithEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Regular != 0 || s.HasField("regular") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("regular") + s.WriteEnum(int32(x.Regular), RegularEnum_name) + } + if len(x.Regulars) > 0 || s.HasField("regulars") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("regulars") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Regulars { + s.WriteMoreIf(&wroteElement) + s.WriteEnum(int32(element), RegularEnum_name) + } + s.WriteArrayEnd() + } + if x.Custom != 0 || s.HasField("custom") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("custom") + x.Custom.MarshalProtoJSON(s) + } + if len(x.Customs) > 0 || s.HasField("customs") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("customs") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Customs { + s.WriteMoreIf(&wroteElement) + element.MarshalProtoJSON(s) + } + s.WriteArrayEnd() + } + if x.WrappedCustom != nil || s.HasField("wrapped_custom") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("wrapped_custom") + x.WrappedCustom.MarshalProtoJSON(s.WithField("wrapped_custom")) + } + if len(x.WrappedCustoms) > 0 || s.HasField("wrapped_customs") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("wrapped_customs") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.WrappedCustoms { + s.WriteMoreIf(&wroteElement) + element.MarshalProtoJSON(s.WithField("wrapped_customs")) + } + s.WriteArrayEnd() + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithEnums message from JSON. +func (x *MessageWithEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "regular": + s.AddField("regular") + x.Regular = RegularEnum(s.ReadEnum(RegularEnum_value)) + case "regulars": + s.AddField("regulars") + s.ReadArray(func() { + x.Regulars = append(x.Regulars, RegularEnum(s.ReadEnum(RegularEnum_value))) + }) + case "custom": + s.AddField("custom") + x.Custom.UnmarshalProtoJSON(s) + case "customs": + s.AddField("customs") + s.ReadArray(func() { + var v CustomEnum + v.UnmarshalProtoJSON(s) + x.Customs = append(x.Customs, v) + }) + case "wrapped_custom", "wrappedCustom": + s.AddField("wrapped_custom") + if !s.ReadNil() { + x.WrappedCustom = &CustomEnumValue{} + x.WrappedCustom.UnmarshalProtoJSON(s.WithField("wrapped_custom", false)) + } + case "wrapped_customs", "wrappedCustoms": + s.AddField("wrapped_customs") + s.ReadArray(func() { + if s.ReadNil() { + x.WrappedCustoms = append(x.WrappedCustoms, nil) + return + } + v := &CustomEnumValue{} + v.UnmarshalProtoJSON(s.WithField("wrapped_customs", false)) + if s.Err() != nil { + return + } + x.WrappedCustoms = append(x.WrappedCustoms, v) + }) + } + }) +} + +// MarshalProtoJSON marshals the MessageWithOneofEnums message to JSON. +func (x *MessageWithOneofEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Value != nil { + switch ov := x.Value.(type) { + case *MessageWithOneofEnums_Regular: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("regular") + s.WriteEnum(int32(ov.Regular), RegularEnum_name) + case *MessageWithOneofEnums_Custom: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("custom") + ov.Custom.MarshalProtoJSON(s) + case *MessageWithOneofEnums_WrappedCustom: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("wrapped_custom") + ov.WrappedCustom.MarshalProtoJSON(s.WithField("wrapped_custom")) + } + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithOneofEnums message from JSON. +func (x *MessageWithOneofEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "regular": + s.AddField("regular") + ov := &MessageWithOneofEnums_Regular{} + ov.Regular = RegularEnum(s.ReadEnum(RegularEnum_value)) + x.Value = ov + case "custom": + s.AddField("custom") + ov := &MessageWithOneofEnums_Custom{} + ov.Custom.UnmarshalProtoJSON(s) + x.Value = ov + case "wrapped_custom", "wrappedCustom": + s.AddField("wrapped_custom") + ov := &MessageWithOneofEnums_WrappedCustom{} + if !s.ReadNil() { + ov.WrappedCustom = &CustomEnumValue{} + ov.WrappedCustom.UnmarshalProtoJSON(s.WithField("wrapped_custom", false)) + } + x.Value = ov + } + }) +} diff --git a/test/gogo/enums_test.go b/test/gogo/enums_test.go new file mode 100644 index 00000000..9dbf8b72 --- /dev/null +++ b/test/gogo/enums_test.go @@ -0,0 +1,172 @@ +package test_test + +import ( + "testing" + + . "github.com/TheThingsIndustries/protoc-gen-go-json/test/gogo" +) + +var testMessagesWithWithEnums = []struct { + name string + msg MessageWithEnums + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithEnums{}, + expected: `{}`, + }, + { + name: "zero", + msg: MessageWithEnums{}, + expected: `{ + "regular": 0, + "regulars": [], + "custom": "CUSTOM_UNKNOWN", + "customs": [], + "wrapped_custom": null, + "wrapped_customs": [] + }`, + expectedMask: []string{ + "regular", + "regulars", + "custom", + "customs", + "wrapped_custom", + "wrapped_customs", + }, + }, + { + name: "full", + msg: MessageWithEnums{ + Regular: REGULAR_A, + Regulars: []RegularEnum{REGULAR_A, REGULAR_B}, + Custom: CustomEnum_CUSTOM_V1_0, + Customs: []CustomEnum{ + CustomEnum_CUSTOM_V1_0, + CustomEnum_CUSTOM_V1_0_1, + }, + WrappedCustom: &CustomEnumValue{ + Value: CustomEnum_CUSTOM_V1_0, + }, + WrappedCustoms: []*CustomEnumValue{ + {Value: CustomEnum_CUSTOM_V1_0}, + {Value: CustomEnum_CUSTOM_V1_0_1}, + }, + }, + expected: `{ + "regular": 1, + "regulars": [1, 2], + "custom": "1.0", + "customs": ["1.0", "1.0.1"], + "wrapped_custom": "1.0", + "wrapped_customs": ["1.0", "1.0.1"] + }`, + expectedMask: []string{ + "regular", + "regulars", + "custom", + "customs", + "wrapped_custom", + "wrapped_customs", + }, + }, +} + +func TestMarshalMessageWithEnums(t *testing.T) { + for _, tt := range testMessagesWithWithEnums { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithEnums(t *testing.T) { + for _, tt := range testMessagesWithWithEnums { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithWithOneofEnums = []struct { + name string + msg MessageWithOneofEnums + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithOneofEnums{}, + expected: `{}`, + }, + { + name: "regular_zero", + msg: MessageWithOneofEnums{ + Value: &MessageWithOneofEnums_Regular{Regular: REGULAR_UNKNOWN}, + }, + expected: `{"regular": 0}`, + expectedMask: []string{"regular"}, + }, + { + name: "regular", + msg: MessageWithOneofEnums{ + Value: &MessageWithOneofEnums_Regular{Regular: REGULAR_A}, + }, + expected: `{"regular": 1}`, + expectedMask: []string{"regular"}, + }, + { + name: "custom_zero", + msg: MessageWithOneofEnums{ + Value: &MessageWithOneofEnums_Custom{Custom: CustomEnum_CUSTOM_UNKNOWN}, + }, + expected: `{"custom": "CUSTOM_UNKNOWN"}`, + expectedMask: []string{"custom"}, + }, + { + name: "custom", + msg: MessageWithOneofEnums{ + Value: &MessageWithOneofEnums_Custom{Custom: CustomEnum_CUSTOM_V1_0}, + }, + expected: `{"custom": "1.0"}`, + expectedMask: []string{"custom"}, + }, + { + name: "wrapped_zero", + msg: MessageWithOneofEnums{ + Value: &MessageWithOneofEnums_WrappedCustom{WrappedCustom: &CustomEnumValue{ + Value: CustomEnum_CUSTOM_UNKNOWN, + }}, + }, + expected: `{"wrapped_custom": "CUSTOM_UNKNOWN"}`, + expectedMask: []string{"wrapped_custom"}, + }, + { + name: "wrapped", + msg: MessageWithOneofEnums{ + Value: &MessageWithOneofEnums_WrappedCustom{WrappedCustom: &CustomEnumValue{ + Value: CustomEnum_CUSTOM_V1_0, + }}, + }, + expected: `{"wrapped_custom": "1.0"}`, + expectedMask: []string{"wrapped_custom"}, + }, +} + +func TestMarshalMessageWithOneofEnums(t *testing.T) { + for _, tt := range testMessagesWithWithOneofEnums { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithOneofEnums(t *testing.T) { + for _, tt := range testMessagesWithWithOneofEnums { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} diff --git a/test/gogo/gogo.pb.go b/test/gogo/gogo.pb.go new file mode 100644 index 00000000..1fd18f1b --- /dev/null +++ b/test/gogo/gogo.pb.go @@ -0,0 +1,364 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: gogo.proto + +package test + +import ( + fmt "fmt" + _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + github_com_TheThingsIndustries_protoc_gen_go_json_test_types "github.com/TheThingsIndustries/protoc-gen-go-json/test/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + math "math" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +type MessageWithGoGoOptions struct { + EUIWithCustomName []byte `protobuf:"bytes,1,opt,name=eui_with_custom_name,json=euiWithCustomName,proto3" json:"eui_with_custom_name,omitempty"` + EUIWithCustomNameAndType *github_com_TheThingsIndustries_protoc_gen_go_json_test_types.EUI64 `protobuf:"bytes,2,opt,name=eui_with_custom_name_and_type,json=euiWithCustomNameAndType,proto3,customtype=github.com/TheThingsIndustries/protoc-gen-go-json/test/types.EUI64" json:"eui_with_custom_name_and_type,omitempty"` + NonNullableEUIWithCustomNameAndType github_com_TheThingsIndustries_protoc_gen_go_json_test_types.EUI64 `protobuf:"bytes,3,opt,name=non_nullable_eui_with_custom_name_and_type,json=nonNullableEuiWithCustomNameAndType,proto3,customtype=github.com/TheThingsIndustries/protoc-gen-go-json/test/types.EUI64" json:"non_nullable_eui_with_custom_name_and_type"` + EUIsWithCustomNameAndType []github_com_TheThingsIndustries_protoc_gen_go_json_test_types.EUI64 `protobuf:"bytes,4,rep,name=euis_with_custom_name_and_type,json=euisWithCustomNameAndType,proto3,customtype=github.com/TheThingsIndustries/protoc-gen-go-json/test/types.EUI64" json:"euis_with_custom_name_and_type,omitempty"` + Duration *time.Duration `protobuf:"bytes,5,opt,name=duration,proto3,stdduration" json:"duration,omitempty"` + NonNullableDuration time.Duration `protobuf:"bytes,6,opt,name=non_nullable_duration,json=nonNullableDuration,proto3,stdduration" json:"non_nullable_duration"` + Timestamp *time.Time `protobuf:"bytes,7,opt,name=timestamp,proto3,stdtime" json:"timestamp,omitempty"` + NonNullableTimestamp time.Time `protobuf:"bytes,8,opt,name=non_nullable_timestamp,json=nonNullableTimestamp,proto3,stdtime" json:"non_nullable_timestamp"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithGoGoOptions) Reset() { *m = MessageWithGoGoOptions{} } +func (m *MessageWithGoGoOptions) String() string { return proto.CompactTextString(m) } +func (*MessageWithGoGoOptions) ProtoMessage() {} +func (*MessageWithGoGoOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_592445b5231bc2b9, []int{0} +} +func (m *MessageWithGoGoOptions) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithGoGoOptions.Unmarshal(m, b) +} +func (m *MessageWithGoGoOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithGoGoOptions.Marshal(b, m, deterministic) +} +func (m *MessageWithGoGoOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithGoGoOptions.Merge(m, src) +} +func (m *MessageWithGoGoOptions) XXX_Size() int { + return xxx_messageInfo_MessageWithGoGoOptions.Size(m) +} +func (m *MessageWithGoGoOptions) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithGoGoOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithGoGoOptions proto.InternalMessageInfo + +func (m *MessageWithGoGoOptions) GetEUIWithCustomName() []byte { + if m != nil { + return m.EUIWithCustomName + } + return nil +} + +func (m *MessageWithGoGoOptions) GetDuration() *time.Duration { + if m != nil { + return m.Duration + } + return nil +} + +func (m *MessageWithGoGoOptions) GetNonNullableDuration() time.Duration { + if m != nil { + return m.NonNullableDuration + } + return 0 +} + +func (m *MessageWithGoGoOptions) GetTimestamp() *time.Time { + if m != nil { + return m.Timestamp + } + return nil +} + +func (m *MessageWithGoGoOptions) GetNonNullableTimestamp() time.Time { + if m != nil { + return m.NonNullableTimestamp + } + return time.Time{} +} + +type SubMessage struct { + Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SubMessage) Reset() { *m = SubMessage{} } +func (m *SubMessage) String() string { return proto.CompactTextString(m) } +func (*SubMessage) ProtoMessage() {} +func (*SubMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_592445b5231bc2b9, []int{1} +} +func (m *SubMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SubMessage.Unmarshal(m, b) +} +func (m *SubMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SubMessage.Marshal(b, m, deterministic) +} +func (m *SubMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubMessage.Merge(m, src) +} +func (m *SubMessage) XXX_Size() int { + return xxx_messageInfo_SubMessage.Size(m) +} +func (m *SubMessage) XXX_DiscardUnknown() { + xxx_messageInfo_SubMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_SubMessage proto.InternalMessageInfo + +func (m *SubMessage) GetField() string { + if m != nil { + return m.Field + } + return "" +} + +type SubMessageWithoutMarshalers struct { + OtherField string `protobuf:"bytes,1,opt,name=other_field,json=otherField,proto3" json:"other_field,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SubMessageWithoutMarshalers) Reset() { *m = SubMessageWithoutMarshalers{} } +func (m *SubMessageWithoutMarshalers) String() string { return proto.CompactTextString(m) } +func (*SubMessageWithoutMarshalers) ProtoMessage() {} +func (*SubMessageWithoutMarshalers) Descriptor() ([]byte, []int) { + return fileDescriptor_592445b5231bc2b9, []int{2} +} +func (m *SubMessageWithoutMarshalers) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SubMessageWithoutMarshalers.Unmarshal(m, b) +} +func (m *SubMessageWithoutMarshalers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SubMessageWithoutMarshalers.Marshal(b, m, deterministic) +} +func (m *SubMessageWithoutMarshalers) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubMessageWithoutMarshalers.Merge(m, src) +} +func (m *SubMessageWithoutMarshalers) XXX_Size() int { + return xxx_messageInfo_SubMessageWithoutMarshalers.Size(m) +} +func (m *SubMessageWithoutMarshalers) XXX_DiscardUnknown() { + xxx_messageInfo_SubMessageWithoutMarshalers.DiscardUnknown(m) +} + +var xxx_messageInfo_SubMessageWithoutMarshalers proto.InternalMessageInfo + +func (m *SubMessageWithoutMarshalers) GetOtherField() string { + if m != nil { + return m.OtherField + } + return "" +} + +type MessageWithNullable struct { + Sub SubMessage `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub"` + Subs []SubMessage `protobuf:"bytes,2,rep,name=subs,proto3" json:"subs"` + OtherSub SubMessageWithoutMarshalers `protobuf:"bytes,3,opt,name=other_sub,json=otherSub,proto3" json:"other_sub"` + OtherSubs []SubMessageWithoutMarshalers `protobuf:"bytes,4,rep,name=other_subs,json=otherSubs,proto3" json:"other_subs"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithNullable) Reset() { *m = MessageWithNullable{} } +func (m *MessageWithNullable) String() string { return proto.CompactTextString(m) } +func (*MessageWithNullable) ProtoMessage() {} +func (*MessageWithNullable) Descriptor() ([]byte, []int) { + return fileDescriptor_592445b5231bc2b9, []int{3} +} +func (m *MessageWithNullable) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithNullable.Unmarshal(m, b) +} +func (m *MessageWithNullable) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithNullable.Marshal(b, m, deterministic) +} +func (m *MessageWithNullable) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithNullable.Merge(m, src) +} +func (m *MessageWithNullable) XXX_Size() int { + return xxx_messageInfo_MessageWithNullable.Size(m) +} +func (m *MessageWithNullable) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithNullable.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithNullable proto.InternalMessageInfo + +func (m *MessageWithNullable) GetSub() SubMessage { + if m != nil { + return m.Sub + } + return SubMessage{} +} + +func (m *MessageWithNullable) GetSubs() []SubMessage { + if m != nil { + return m.Subs + } + return nil +} + +func (m *MessageWithNullable) GetOtherSub() SubMessageWithoutMarshalers { + if m != nil { + return m.OtherSub + } + return SubMessageWithoutMarshalers{} +} + +func (m *MessageWithNullable) GetOtherSubs() []SubMessageWithoutMarshalers { + if m != nil { + return m.OtherSubs + } + return nil +} + +type MessageWithEmbedded struct { + *SubMessage `protobuf:"bytes,1,opt,name=sub,proto3,embedded=sub" json:"sub,omitempty"` + *SubMessageWithoutMarshalers `protobuf:"bytes,2,opt,name=other_sub,json=otherSub,proto3,embedded=other_sub" json:"other_sub,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithEmbedded) Reset() { *m = MessageWithEmbedded{} } +func (m *MessageWithEmbedded) String() string { return proto.CompactTextString(m) } +func (*MessageWithEmbedded) ProtoMessage() {} +func (*MessageWithEmbedded) Descriptor() ([]byte, []int) { + return fileDescriptor_592445b5231bc2b9, []int{4} +} +func (m *MessageWithEmbedded) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithEmbedded.Unmarshal(m, b) +} +func (m *MessageWithEmbedded) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithEmbedded.Marshal(b, m, deterministic) +} +func (m *MessageWithEmbedded) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithEmbedded.Merge(m, src) +} +func (m *MessageWithEmbedded) XXX_Size() int { + return xxx_messageInfo_MessageWithEmbedded.Size(m) +} +func (m *MessageWithEmbedded) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithEmbedded.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithEmbedded proto.InternalMessageInfo + +type MessageWithNullableEmbedded struct { + SubMessage `protobuf:"bytes,1,opt,name=sub,proto3,embedded=sub" json:"sub"` + SubMessageWithoutMarshalers `protobuf:"bytes,2,opt,name=other_sub,json=otherSub,proto3,embedded=other_sub" json:"other_sub"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithNullableEmbedded) Reset() { *m = MessageWithNullableEmbedded{} } +func (m *MessageWithNullableEmbedded) String() string { return proto.CompactTextString(m) } +func (*MessageWithNullableEmbedded) ProtoMessage() {} +func (*MessageWithNullableEmbedded) Descriptor() ([]byte, []int) { + return fileDescriptor_592445b5231bc2b9, []int{5} +} +func (m *MessageWithNullableEmbedded) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithNullableEmbedded.Unmarshal(m, b) +} +func (m *MessageWithNullableEmbedded) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithNullableEmbedded.Marshal(b, m, deterministic) +} +func (m *MessageWithNullableEmbedded) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithNullableEmbedded.Merge(m, src) +} +func (m *MessageWithNullableEmbedded) XXX_Size() int { + return xxx_messageInfo_MessageWithNullableEmbedded.Size(m) +} +func (m *MessageWithNullableEmbedded) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithNullableEmbedded.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithNullableEmbedded proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MessageWithGoGoOptions)(nil), "thethings.json.test.MessageWithGoGoOptions") + proto.RegisterType((*SubMessage)(nil), "thethings.json.test.SubMessage") + proto.RegisterType((*SubMessageWithoutMarshalers)(nil), "thethings.json.test.SubMessageWithoutMarshalers") + proto.RegisterType((*MessageWithNullable)(nil), "thethings.json.test.MessageWithNullable") + proto.RegisterType((*MessageWithEmbedded)(nil), "thethings.json.test.MessageWithEmbedded") + proto.RegisterType((*MessageWithNullableEmbedded)(nil), "thethings.json.test.MessageWithNullableEmbedded") +} + +func init() { proto.RegisterFile("gogo.proto", fileDescriptor_592445b5231bc2b9) } + +var fileDescriptor_592445b5231bc2b9 = []byte{ + // 749 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x95, 0x3f, 0x4f, 0xdb, 0x4c, + 0x1c, 0xc7, 0xb1, 0x13, 0x20, 0xb9, 0x30, 0xc0, 0xf1, 0x47, 0x21, 0x08, 0x1c, 0x85, 0x05, 0x3d, + 0x12, 0xce, 0x23, 0x9e, 0x47, 0x3c, 0x7a, 0x8a, 0xd4, 0x8a, 0xb4, 0x21, 0x8d, 0x54, 0x52, 0x29, + 0x24, 0xa2, 0x62, 0xb1, 0x6c, 0x7c, 0xd8, 0xae, 0xe2, 0xbb, 0xc8, 0x77, 0xa7, 0x8a, 0xb9, 0xea, + 0xd0, 0xad, 0x43, 0x87, 0x4e, 0x5d, 0xfa, 0x12, 0xaa, 0x6e, 0x7d, 0x01, 0xed, 0xd6, 0xb9, 0x43, + 0x2a, 0xd1, 0x8d, 0x97, 0xd0, 0xa9, 0xba, 0x8b, 0x63, 0x27, 0x4d, 0x80, 0x02, 0x19, 0x3a, 0xfa, + 0x7e, 0xf7, 0xfb, 0xf8, 0x7b, 0x1f, 0x5f, 0x7e, 0x01, 0xc0, 0x21, 0x0e, 0xd1, 0xdb, 0x01, 0x61, + 0x04, 0xce, 0x33, 0x17, 0x31, 0xd7, 0xc3, 0x0e, 0xd5, 0x9f, 0x52, 0x82, 0x75, 0x86, 0x28, 0xcb, + 0xcd, 0x99, 0x18, 0x13, 0x66, 0x32, 0x8f, 0x60, 0xda, 0xdd, 0x97, 0x5b, 0xf5, 0x30, 0x43, 0x01, + 0x36, 0x5b, 0x45, 0xd1, 0x2c, 0xd7, 0x8a, 0x31, 0x26, 0xb7, 0xe6, 0x10, 0xe2, 0xb4, 0x50, 0x51, + 0x3e, 0x59, 0xfc, 0xa4, 0x68, 0xf3, 0x40, 0xf6, 0x87, 0x75, 0xed, 0xd7, 0x3a, 0xf3, 0x7c, 0x44, + 0x99, 0xe9, 0xb7, 0xbb, 0x1b, 0x0a, 0xcf, 0x33, 0x60, 0x69, 0x1f, 0x51, 0x6a, 0x3a, 0xe8, 0xd0, + 0x63, 0x6e, 0x85, 0x54, 0xc8, 0xe3, 0xb6, 0x0c, 0x00, 0xf7, 0xc0, 0x02, 0xe2, 0x9e, 0xf1, 0xcc, + 0x63, 0xae, 0x71, 0xcc, 0x29, 0x23, 0xbe, 0x81, 0x4d, 0x1f, 0x65, 0x95, 0xbc, 0xb2, 0x31, 0x53, + 0x5a, 0x3c, 0xeb, 0x68, 0x73, 0xe5, 0x66, 0x55, 0x74, 0xdd, 0x97, 0xd5, 0x9a, 0xe9, 0xa3, 0xfa, + 0x1c, 0xe2, 0xde, 0xe0, 0x12, 0xfc, 0xa8, 0x82, 0xd5, 0x51, 0x20, 0xc3, 0xc4, 0xb6, 0xc1, 0x4e, + 0xdb, 0x28, 0xab, 0x4a, 0xe2, 0x0f, 0xe5, 0x9c, 0xbf, 0x56, 0x40, 0xc5, 0xf1, 0x98, 0xcb, 0x2d, + 0xfd, 0x98, 0xf8, 0xc5, 0x86, 0x8b, 0x1a, 0x52, 0x52, 0x15, 0xdb, 0x9c, 0xb2, 0xc0, 0x43, 0xb4, + 0x7b, 0x94, 0xe3, 0x4d, 0x07, 0xe1, 0x4d, 0x87, 0x6c, 0x0a, 0x79, 0x45, 0x21, 0xaf, 0x28, 0x48, + 0x54, 0xdf, 0x37, 0x03, 0xea, 0x9a, 0xad, 0x87, 0xe5, 0x27, 0xb0, 0x7a, 0x2b, 0x50, 0x13, 0xfb, + 0x11, 0xea, 0x6b, 0x47, 0x2b, 0xdd, 0x0a, 0x56, 0x6e, 0x56, 0xb7, 0xff, 0x3d, 0xeb, 0x68, 0xd9, + 0x21, 0x61, 0xbb, 0xd8, 0x6e, 0x9c, 0xb6, 0x51, 0x3d, 0x3b, 0xe4, 0x2d, 0xac, 0xc0, 0xef, 0x2a, + 0xf8, 0x0b, 0x13, 0x6c, 0x60, 0xde, 0x6a, 0x99, 0x56, 0x0b, 0x19, 0x97, 0xbb, 0x4c, 0x48, 0x97, + 0x2f, 0xd5, 0x3f, 0xd5, 0xe5, 0xa7, 0x8e, 0x36, 0x31, 0x36, 0x9f, 0xeb, 0x35, 0x82, 0x6b, 0xa1, + 0x97, 0x0b, 0xd5, 0xae, 0xe3, 0xbe, 0x4d, 0x17, 0x59, 0xfe, 0xac, 0x82, 0x35, 0xc4, 0x3d, 0x7a, + 0x89, 0xd9, 0x64, 0x3e, 0xb1, 0x31, 0x53, 0x7a, 0xa1, 0x9e, 0xf3, 0xb7, 0x0a, 0x78, 0x34, 0x26, + 0xb3, 0xbb, 0x41, 0x60, 0x9e, 0xc2, 0xda, 0xd8, 0xf4, 0x4a, 0xde, 0xd8, 0xfc, 0x2e, 0x97, 0x9b, + 0x55, 0x3a, 0xda, 0xea, 0xb2, 0xb0, 0x35, 0xda, 0xe5, 0x0e, 0x48, 0xf5, 0xc6, 0x50, 0x76, 0x32, + 0xaf, 0x6c, 0x64, 0xb6, 0x96, 0xf5, 0xee, 0x1c, 0xd2, 0x7b, 0x73, 0x48, 0x7f, 0x10, 0x6e, 0x28, + 0x25, 0xdf, 0x7c, 0xd3, 0x94, 0x7a, 0xd4, 0x00, 0x0f, 0xc1, 0xe2, 0xc0, 0x6d, 0x8f, 0x48, 0x53, + 0x57, 0x91, 0x52, 0xe2, 0x6a, 0x49, 0xda, 0x7c, 0xdf, 0x17, 0xef, 0x95, 0xe1, 0x5d, 0x90, 0x8e, + 0x86, 0x5f, 0x76, 0x5a, 0xc2, 0x72, 0x43, 0xb0, 0x46, 0x6f, 0x47, 0x29, 0xf9, 0x4a, 0x90, 0xe2, + 0x16, 0x78, 0x04, 0x96, 0x06, 0x82, 0xc5, 0xb0, 0xd4, 0x95, 0x30, 0x19, 0x4d, 0x02, 0x17, 0xfa, + 0xa2, 0x45, 0xf5, 0x42, 0x01, 0x80, 0x03, 0x6e, 0x85, 0x73, 0x18, 0x2e, 0x80, 0xc9, 0x13, 0x0f, + 0xb5, 0x6c, 0x39, 0x69, 0xd3, 0xf5, 0xee, 0x43, 0xa1, 0x02, 0x56, 0xe2, 0x3d, 0x42, 0x3c, 0xe1, + 0x2c, 0xbc, 0x47, 0x28, 0xa0, 0x50, 0x03, 0x19, 0xc2, 0x5c, 0x14, 0x18, 0xfd, 0xad, 0x40, 0x2e, + 0xed, 0x89, 0x95, 0x3b, 0xd3, 0xe7, 0x3c, 0x99, 0x9a, 0x98, 0x9d, 0x28, 0x7c, 0x50, 0xc1, 0x7c, + 0x1f, 0xa6, 0x97, 0x06, 0xfe, 0x07, 0x12, 0x94, 0x5b, 0xb2, 0x33, 0xb3, 0xa5, 0xe9, 0x23, 0xfe, + 0xa0, 0xf4, 0x38, 0x40, 0x29, 0x29, 0x8e, 0x54, 0x17, 0x1d, 0xf0, 0x7f, 0x90, 0xa4, 0xdc, 0xa2, + 0x59, 0x35, 0x9f, 0xf8, 0xfd, 0x4e, 0xd9, 0x02, 0x0f, 0x40, 0xba, 0x9b, 0x5a, 0xbc, 0x39, 0x21, + 0xdf, 0xfc, 0xf7, 0x15, 0xfd, 0x43, 0x47, 0x0f, 0x81, 0x29, 0x09, 0x3a, 0xe0, 0x16, 0x6c, 0x02, + 0x10, 0x41, 0xa9, 0xfc, 0xd9, 0xde, 0x9c, 0x9a, 0xee, 0x51, 0x69, 0xe1, 0x9d, 0x32, 0xe0, 0xad, + 0xec, 0x5b, 0xc8, 0xb6, 0x91, 0x7d, 0x5d, 0x6f, 0x5f, 0x3a, 0x9a, 0xd2, 0xf5, 0x36, 0x70, 0x78, + 0xf5, 0xa6, 0x87, 0x97, 0xbc, 0xe8, 0xf0, 0x85, 0xf7, 0x0a, 0x58, 0x19, 0xf1, 0x75, 0xa3, 0xb4, + 0x3b, 0xd7, 0x4a, 0x2b, 0x2f, 0x6e, 0x9c, 0xf8, 0x70, 0x1c, 0x89, 0x63, 0x66, 0x94, 0xba, 0x74, + 0x4f, 0x5c, 0x4e, 0x65, 0x56, 0x39, 0xda, 0xbe, 0xd9, 0xdc, 0xb2, 0xa6, 0x64, 0xe1, 0x9f, 0x9f, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x89, 0x8f, 0x06, 0x40, 0x64, 0x09, 0x00, 0x00, +} diff --git a/test/gogo/gogo_json.pb.go b/test/gogo/gogo_json.pb.go new file mode 100644 index 00000000..a14052c7 --- /dev/null +++ b/test/gogo/gogo_json.pb.go @@ -0,0 +1,347 @@ +// Code generated by protoc-gen-go-json. DO NOT EDIT. +// versions: +// - protoc-gen-go-json v0.0.0-dev +// - protoc v3.9.1 +// source: gogo.proto + +package test + +import ( + gogo "github.com/TheThingsIndustries/protoc-gen-go-json/gogo" + jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" + types "github.com/TheThingsIndustries/protoc-gen-go-json/test/types" +) + +// MarshalProtoJSON marshals the MessageWithGoGoOptions message to JSON. +func (x *MessageWithGoGoOptions) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if len(x.EUIWithCustomName) > 0 || s.HasField("eui_with_custom_name") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("eui_with_custom_name") + s.WriteBytes(x.EUIWithCustomName) + } + if x.EUIWithCustomNameAndType != nil || s.HasField("eui_with_custom_name_and_type") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("eui_with_custom_name_and_type") + x.EUIWithCustomNameAndType.MarshalProtoJSON(s.WithField("eui_with_custom_name_and_type")) + } + if len(x.NonNullableEUIWithCustomNameAndType) > 0 || s.HasField("non_nullable_eui_with_custom_name_and_type") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("non_nullable_eui_with_custom_name_and_type") + x.NonNullableEUIWithCustomNameAndType.MarshalProtoJSON(s.WithField("non_nullable_eui_with_custom_name_and_type")) + } + if len(x.EUIsWithCustomNameAndType) > 0 || s.HasField("euis_with_custom_name_and_type") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("euis_with_custom_name_and_type") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.EUIsWithCustomNameAndType { + s.WriteMoreIf(&wroteElement) + element.MarshalProtoJSON(s.WithField("euis_with_custom_name_and_type")) + } + s.WriteArrayEnd() + } + if x.Duration != nil || s.HasField("duration") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("duration") + if x.Duration == nil { + s.WriteNil() + } else { + s.WriteDuration(*x.Duration) + } + } + if true { // (gogoproto.nullable) = false + s.WriteMoreIf(&wroteField) + s.WriteObjectField("non_nullable_duration") + s.WriteDuration(x.NonNullableDuration) + } + if x.Timestamp != nil || s.HasField("timestamp") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("timestamp") + if x.Timestamp == nil { + s.WriteNil() + } else { + s.WriteTime(*x.Timestamp) + } + } + if true { // (gogoproto.nullable) = false + s.WriteMoreIf(&wroteField) + s.WriteObjectField("non_nullable_timestamp") + s.WriteTime(x.NonNullableTimestamp) + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithGoGoOptions message from JSON. +func (x *MessageWithGoGoOptions) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "eui_with_custom_name", "euiWithCustomName": + s.AddField("eui_with_custom_name") + x.EUIWithCustomName = s.ReadBytes() + case "eui_with_custom_name_and_type", "euiWithCustomNameAndType": + s.AddField("eui_with_custom_name_and_type") + if !s.ReadNil() { + x.EUIWithCustomNameAndType = &types.EUI64{} + x.EUIWithCustomNameAndType.UnmarshalProtoJSON(s.WithField("eui_with_custom_name_and_type", false)) + } + case "non_nullable_eui_with_custom_name_and_type", "nonNullableEuiWithCustomNameAndType": + s.AddField("non_nullable_eui_with_custom_name_and_type") + x.NonNullableEUIWithCustomNameAndType.UnmarshalProtoJSON(s.WithField("non_nullable_eui_with_custom_name_and_type", false)) + case "euis_with_custom_name_and_type", "euisWithCustomNameAndType": + s.AddField("euis_with_custom_name_and_type") + s.ReadArray(func() { + var v types.EUI64 + v.UnmarshalProtoJSON(s.WithField("euis_with_custom_name_and_type", false)) + x.EUIsWithCustomNameAndType = append(x.EUIsWithCustomNameAndType, v) + }) + case "duration": + s.AddField("duration") + v := s.ReadDuration() + if s.Err() != nil { + return + } + x.Duration = v + case "non_nullable_duration", "nonNullableDuration": + s.AddField("non_nullable_duration") + v := s.ReadDuration() + if s.Err() != nil { + return + } + x.NonNullableDuration = *v + case "timestamp": + s.AddField("timestamp") + v := s.ReadTime() + if s.Err() != nil { + return + } + x.Timestamp = v + case "non_nullable_timestamp", "nonNullableTimestamp": + s.AddField("non_nullable_timestamp") + v := s.ReadTime() + if s.Err() != nil { + return + } + x.NonNullableTimestamp = *v + } + }) +} + +// MarshalProtoJSON marshals the SubMessage message to JSON. +func (x *SubMessage) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Field != "" || s.HasField("field") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("field") + s.WriteString(x.Field) + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the SubMessage message from JSON. +func (x *SubMessage) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "field": + s.AddField("field") + x.Field = s.ReadString() + } + }) +} + +// MarshalProtoJSON marshals the MessageWithNullable message to JSON. +func (x *MessageWithNullable) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if true { // (gogoproto.nullable) = false + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sub") + x.Sub.MarshalProtoJSON(s.WithField("sub")) + } + if len(x.Subs) > 0 || s.HasField("subs") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("subs") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Subs { + s.WriteMoreIf(&wroteElement) + element.MarshalProtoJSON(s.WithField("subs")) + } + s.WriteArrayEnd() + } + if true { // (gogoproto.nullable) = false + s.WriteMoreIf(&wroteField) + s.WriteObjectField("other_sub") + // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. + gogo.MarshalMessage(s, &x.OtherSub) + } + if len(x.OtherSubs) > 0 || s.HasField("other_subs") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("other_subs") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.OtherSubs { + s.WriteMoreIf(&wroteElement) + // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. + gogo.MarshalMessage(s, &element) + } + s.WriteArrayEnd() + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithNullable message from JSON. +func (x *MessageWithNullable) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "sub": + if !s.ReadNil() { + x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) + } + case "subs": + s.AddField("subs") + s.ReadArray(func() { + v := SubMessage{} + v.UnmarshalProtoJSON(s.WithField("subs", false)) + if s.Err() != nil { + return + } + x.Subs = append(x.Subs, v) + }) + case "other_sub", "otherSub": + s.AddField("other_sub") + // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. + var v SubMessageWithoutMarshalers + gogo.UnmarshalMessage(s, &v) + x.OtherSub = v + case "other_subs", "otherSubs": + s.AddField("other_subs") + s.ReadArray(func() { + // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. + var v SubMessageWithoutMarshalers + gogo.UnmarshalMessage(s, &v) + x.OtherSubs = append(x.OtherSubs, v) + }) + } + }) +} + +// MarshalProtoJSON marshals the MessageWithEmbedded message to JSON. +func (x *MessageWithEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.SubMessage != nil || s.HasField("sub") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sub") + x.SubMessage.MarshalProtoJSON(s.WithField("sub")) + } + if x.SubMessageWithoutMarshalers != nil || s.HasField("other_sub") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("other_sub") + // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. + gogo.MarshalMessage(s, x.SubMessageWithoutMarshalers) + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithEmbedded message from JSON. +func (x *MessageWithEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "sub": + if !s.ReadNil() { + x.SubMessage = &SubMessage{} + x.SubMessage.UnmarshalProtoJSON(s.WithField("sub", true)) + } + case "other_sub", "otherSub": + s.AddField("other_sub") + // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. + var v SubMessageWithoutMarshalers + gogo.UnmarshalMessage(s, &v) + x.SubMessageWithoutMarshalers = &v + } + }) +} + +// MarshalProtoJSON marshals the MessageWithNullableEmbedded message to JSON. +func (x *MessageWithNullableEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if true { // (gogoproto.nullable) = false + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sub") + x.SubMessage.MarshalProtoJSON(s.WithField("sub")) + } + if true { // (gogoproto.nullable) = false + s.WriteMoreIf(&wroteField) + s.WriteObjectField("other_sub") + // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. + gogo.MarshalMessage(s, &x.SubMessageWithoutMarshalers) + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithNullableEmbedded message from JSON. +func (x *MessageWithNullableEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "sub": + if !s.ReadNil() { + x.SubMessage.UnmarshalProtoJSON(s.WithField("sub", true)) + } + case "other_sub", "otherSub": + s.AddField("other_sub") + // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. + var v SubMessageWithoutMarshalers + gogo.UnmarshalMessage(s, &v) + x.SubMessageWithoutMarshalers = v + } + }) +} diff --git a/test/gogo/gogo_test.go b/test/gogo/gogo_test.go new file mode 100644 index 00000000..8cf9ef7d --- /dev/null +++ b/test/gogo/gogo_test.go @@ -0,0 +1,280 @@ +package test_test + +import ( + "testing" + + . "github.com/TheThingsIndustries/protoc-gen-go-json/test/gogo" + types "github.com/TheThingsIndustries/protoc-gen-go-json/test/types" +) + +var testMessagesWithGoGoOptions = []struct { + name string + msg MessageWithGoGoOptions + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithGoGoOptions{ + NonNullableEUIWithCustomNameAndType: types.EUI64{1, 2, 3, 4, 5, 6, 7, 8}, + NonNullableDuration: testDuration, + NonNullableTimestamp: testTime, + }, + expected: `{ + "non_nullable_eui_with_custom_name_and_type": "0102030405060708", + "non_nullable_duration": "3723.123456789s", + "non_nullable_timestamp": "2006-01-02T08:04:05.123456789Z" + }`, + expectedMask: []string{ + "non_nullable_eui_with_custom_name_and_type", + "non_nullable_duration", + "non_nullable_timestamp", + }, + }, + { + name: "zero", + msg: MessageWithGoGoOptions{ + NonNullableEUIWithCustomNameAndType: types.EUI64{1, 2, 3, 4, 5, 6, 7, 8}, + NonNullableDuration: testDuration, + NonNullableTimestamp: testTime, + }, + expected: `{ + "eui_with_custom_name": null, + "eui_with_custom_name_and_type": null, + "non_nullable_eui_with_custom_name_and_type": "0102030405060708", + "euis_with_custom_name_and_type": [], + "duration": null, + "non_nullable_duration": "3723.123456789s", + "timestamp": null, + "non_nullable_timestamp": "2006-01-02T08:04:05.123456789Z" + }`, + expectedMask: []string{ + "eui_with_custom_name", + "eui_with_custom_name_and_type", + "non_nullable_eui_with_custom_name_and_type", + "euis_with_custom_name_and_type", + "duration", + "non_nullable_duration", + "timestamp", + "non_nullable_timestamp", + }, + }, + { + name: "full", + msg: MessageWithGoGoOptions{ + EUIWithCustomName: []byte{1, 2, 3, 4, 5, 6, 7, 8}, + EUIWithCustomNameAndType: &types.EUI64{1, 2, 3, 4, 5, 6, 7, 8}, + NonNullableEUIWithCustomNameAndType: types.EUI64{1, 2, 3, 4, 5, 6, 7, 8}, + EUIsWithCustomNameAndType: []types.EUI64{ + {1, 2, 3, 4, 5, 6, 7, 8}, + }, + Duration: &testDuration, + NonNullableDuration: testDuration, + Timestamp: &testTime, + NonNullableTimestamp: testTime, + }, + expected: `{ + "eui_with_custom_name": "AQIDBAUGBwg=", + "eui_with_custom_name_and_type": "0102030405060708", + "non_nullable_eui_with_custom_name_and_type": "0102030405060708", + "euis_with_custom_name_and_type": ["0102030405060708"], + "duration": "3723.123456789s", + "non_nullable_duration": "3723.123456789s", + "timestamp": "2006-01-02T08:04:05.123456789Z", + "non_nullable_timestamp": "2006-01-02T08:04:05.123456789Z" + }`, + expectedMask: []string{ + "eui_with_custom_name", + "eui_with_custom_name_and_type", + "non_nullable_eui_with_custom_name_and_type", + "euis_with_custom_name_and_type", + "duration", + "non_nullable_duration", + "timestamp", + "non_nullable_timestamp", + }, + }, +} + +func TestMarshalMessageWithGoGoOptions(t *testing.T) { + for _, tt := range testMessagesWithGoGoOptions { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithGoGoOptions(t *testing.T) { + for _, tt := range testMessagesWithGoGoOptions { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithNullable = []struct { + name string + msg MessageWithNullable + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithNullable{ + Sub: SubMessage{Field: "foo"}, + OtherSub: SubMessageWithoutMarshalers{OtherField: "foo"}, + }, + expected: `{ + "sub": {"field": "foo"}, + "other_sub": {"other_field": "foo"} + }`, + expectedMask: []string{ + "sub.field", + "other_sub", // NOTE: no marshaler. + }, + }, + { + name: "full", + msg: MessageWithNullable{ + Sub: SubMessage{Field: "foo"}, + Subs: []SubMessage{ + {Field: "foo"}, + {Field: "bar"}, + }, + OtherSub: SubMessageWithoutMarshalers{OtherField: "foo"}, + OtherSubs: []SubMessageWithoutMarshalers{ + {OtherField: "foo"}, + {OtherField: "bar"}, + }, + }, + expected: `{ + "sub": {"field": "foo"}, + "subs": [ + {"field": "foo"}, + {"field": "bar"} + ], + "other_sub": {"other_field": "foo"}, + "other_subs": [ + {"other_field": "foo"}, + {"other_field": "bar"} + ] + }`, + expectedMask: []string{ + "sub.field", + "subs", + "other_sub", // NOTE: no marshaler. + "other_subs", + }, + }, +} + +func TestMarshalMessageWithNullable(t *testing.T) { + for _, tt := range testMessagesWithNullable { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithNullable(t *testing.T) { + for _, tt := range testMessagesWithNullable { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithEmbedded = []struct { + name string + msg MessageWithEmbedded + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithEmbedded{}, + expected: `{}`, + }, + { + name: "zero", + msg: MessageWithEmbedded{ + SubMessage: &SubMessage{}, + }, + expected: `{ + "sub": {"field": ""} + }`, + expectedMask: []string{ + "sub.field", + }, + }, + { + name: "full", + msg: MessageWithEmbedded{ + SubMessage: &SubMessage{Field: "foo"}, + SubMessageWithoutMarshalers: &SubMessageWithoutMarshalers{OtherField: "foo"}, + }, + expected: `{ + "sub": {"field": "foo"}, + "other_sub": {"other_field": "foo"} + }`, + expectedMask: []string{ + "sub.field", + "other_sub", // NOTE: no marshaler. + }, + }, +} + +func TestMarshalMessageWithEmbedded(t *testing.T) { + for _, tt := range testMessagesWithEmbedded { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithEmbedded(t *testing.T) { + for _, tt := range testMessagesWithEmbedded { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithNullableEmbedded = []struct { + name string + msg MessageWithNullableEmbedded + expected string + expectedMask []string +}{ + { + name: "full", + msg: MessageWithNullableEmbedded{ + SubMessage: SubMessage{Field: "foo"}, + SubMessageWithoutMarshalers: SubMessageWithoutMarshalers{OtherField: "foo"}, + }, + expected: `{ + "sub": {"field": "foo"}, + "other_sub": {"other_field": "foo"} + }`, + expectedMask: []string{ + "sub.field", + "other_sub", // NOTE: no marshaler. + }, + }, +} + +func TestMarshalMessageWithNullableEmbedded(t *testing.T) { + for _, tt := range testMessagesWithNullableEmbedded { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithNullableEmbedded(t *testing.T) { + for _, tt := range testMessagesWithNullableEmbedded { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} diff --git a/test/gogo/scalars.pb.go b/test/gogo/scalars.pb.go new file mode 100644 index 00000000..5e2f99ed --- /dev/null +++ b/test/gogo/scalars.pb.go @@ -0,0 +1,903 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: scalars.proto + +package test + +import ( + fmt "fmt" + _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + proto "github.com/gogo/protobuf/proto" + 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 + +type MessageWithScalars struct { + DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3" json:"double_value,omitempty"` + DoubleValues []float64 `protobuf:"fixed64,2,rep,packed,name=double_values,json=doubleValues,proto3" json:"double_values,omitempty"` + FloatValue float32 `protobuf:"fixed32,3,opt,name=float_value,json=floatValue,proto3" json:"float_value,omitempty"` + FloatValues []float32 `protobuf:"fixed32,4,rep,packed,name=float_values,json=floatValues,proto3" json:"float_values,omitempty"` + Int32Value int32 `protobuf:"varint,5,opt,name=int32_value,json=int32Value,proto3" json:"int32_value,omitempty"` + Int32Values []int32 `protobuf:"varint,6,rep,packed,name=int32_values,json=int32Values,proto3" json:"int32_values,omitempty"` + Int64Value int64 `protobuf:"varint,7,opt,name=int64_value,json=int64Value,proto3" json:"int64_value,omitempty"` + Int64Values []int64 `protobuf:"varint,8,rep,packed,name=int64_values,json=int64Values,proto3" json:"int64_values,omitempty"` + Uint32Value uint32 `protobuf:"varint,9,opt,name=uint32_value,json=uint32Value,proto3" json:"uint32_value,omitempty"` + Uint32Values []uint32 `protobuf:"varint,10,rep,packed,name=uint32_values,json=uint32Values,proto3" json:"uint32_values,omitempty"` + Uint64Value uint64 `protobuf:"varint,11,opt,name=uint64_value,json=uint64Value,proto3" json:"uint64_value,omitempty"` + Uint64Values []uint64 `protobuf:"varint,12,rep,packed,name=uint64_values,json=uint64Values,proto3" json:"uint64_values,omitempty"` + Sint32Value int32 `protobuf:"zigzag32,13,opt,name=sint32_value,json=sint32Value,proto3" json:"sint32_value,omitempty"` + Sint32Values []int32 `protobuf:"zigzag32,14,rep,packed,name=sint32_values,json=sint32Values,proto3" json:"sint32_values,omitempty"` + Sint64Value int64 `protobuf:"zigzag64,15,opt,name=sint64_value,json=sint64Value,proto3" json:"sint64_value,omitempty"` + Sint64Values []int64 `protobuf:"zigzag64,16,rep,packed,name=sint64_values,json=sint64Values,proto3" json:"sint64_values,omitempty"` + Fixed32Value uint32 `protobuf:"fixed32,17,opt,name=fixed32_value,json=fixed32Value,proto3" json:"fixed32_value,omitempty"` + Fixed32Values []uint32 `protobuf:"fixed32,18,rep,packed,name=fixed32_values,json=fixed32Values,proto3" json:"fixed32_values,omitempty"` + Fixed64Value uint64 `protobuf:"fixed64,19,opt,name=fixed64_value,json=fixed64Value,proto3" json:"fixed64_value,omitempty"` + Fixed64Values []uint64 `protobuf:"fixed64,20,rep,packed,name=fixed64_values,json=fixed64Values,proto3" json:"fixed64_values,omitempty"` + Sfixed32Value int32 `protobuf:"fixed32,21,opt,name=sfixed32_value,json=sfixed32Value,proto3" json:"sfixed32_value,omitempty"` + Sfixed32Values []int32 `protobuf:"fixed32,22,rep,packed,name=sfixed32_values,json=sfixed32Values,proto3" json:"sfixed32_values,omitempty"` + Sfixed64Value int64 `protobuf:"fixed64,23,opt,name=sfixed64_value,json=sfixed64Value,proto3" json:"sfixed64_value,omitempty"` + Sfixed64Values []int64 `protobuf:"fixed64,24,rep,packed,name=sfixed64_values,json=sfixed64Values,proto3" json:"sfixed64_values,omitempty"` + BoolValue bool `protobuf:"varint,25,opt,name=bool_value,json=boolValue,proto3" json:"bool_value,omitempty"` + BoolValues []bool `protobuf:"varint,26,rep,packed,name=bool_values,json=boolValues,proto3" json:"bool_values,omitempty"` + StringValue string `protobuf:"bytes,27,opt,name=string_value,json=stringValue,proto3" json:"string_value,omitempty"` + StringValues []string `protobuf:"bytes,28,rep,name=string_values,json=stringValues,proto3" json:"string_values,omitempty"` + BytesValue []byte `protobuf:"bytes,29,opt,name=bytes_value,json=bytesValue,proto3" json:"bytes_value,omitempty"` + BytesValues [][]byte `protobuf:"bytes,30,rep,name=bytes_values,json=bytesValues,proto3" json:"bytes_values,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithScalars) Reset() { *m = MessageWithScalars{} } +func (m *MessageWithScalars) String() string { return proto.CompactTextString(m) } +func (*MessageWithScalars) ProtoMessage() {} +func (*MessageWithScalars) Descriptor() ([]byte, []int) { + return fileDescriptor_5d1bcd1a4bdfc194, []int{0} +} +func (m *MessageWithScalars) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithScalars.Unmarshal(m, b) +} +func (m *MessageWithScalars) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithScalars.Marshal(b, m, deterministic) +} +func (m *MessageWithScalars) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithScalars.Merge(m, src) +} +func (m *MessageWithScalars) XXX_Size() int { + return xxx_messageInfo_MessageWithScalars.Size(m) +} +func (m *MessageWithScalars) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithScalars.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithScalars proto.InternalMessageInfo + +func (m *MessageWithScalars) GetDoubleValue() float64 { + if m != nil { + return m.DoubleValue + } + return 0 +} + +func (m *MessageWithScalars) GetDoubleValues() []float64 { + if m != nil { + return m.DoubleValues + } + return nil +} + +func (m *MessageWithScalars) GetFloatValue() float32 { + if m != nil { + return m.FloatValue + } + return 0 +} + +func (m *MessageWithScalars) GetFloatValues() []float32 { + if m != nil { + return m.FloatValues + } + return nil +} + +func (m *MessageWithScalars) GetInt32Value() int32 { + if m != nil { + return m.Int32Value + } + return 0 +} + +func (m *MessageWithScalars) GetInt32Values() []int32 { + if m != nil { + return m.Int32Values + } + return nil +} + +func (m *MessageWithScalars) GetInt64Value() int64 { + if m != nil { + return m.Int64Value + } + return 0 +} + +func (m *MessageWithScalars) GetInt64Values() []int64 { + if m != nil { + return m.Int64Values + } + return nil +} + +func (m *MessageWithScalars) GetUint32Value() uint32 { + if m != nil { + return m.Uint32Value + } + return 0 +} + +func (m *MessageWithScalars) GetUint32Values() []uint32 { + if m != nil { + return m.Uint32Values + } + return nil +} + +func (m *MessageWithScalars) GetUint64Value() uint64 { + if m != nil { + return m.Uint64Value + } + return 0 +} + +func (m *MessageWithScalars) GetUint64Values() []uint64 { + if m != nil { + return m.Uint64Values + } + return nil +} + +func (m *MessageWithScalars) GetSint32Value() int32 { + if m != nil { + return m.Sint32Value + } + return 0 +} + +func (m *MessageWithScalars) GetSint32Values() []int32 { + if m != nil { + return m.Sint32Values + } + return nil +} + +func (m *MessageWithScalars) GetSint64Value() int64 { + if m != nil { + return m.Sint64Value + } + return 0 +} + +func (m *MessageWithScalars) GetSint64Values() []int64 { + if m != nil { + return m.Sint64Values + } + return nil +} + +func (m *MessageWithScalars) GetFixed32Value() uint32 { + if m != nil { + return m.Fixed32Value + } + return 0 +} + +func (m *MessageWithScalars) GetFixed32Values() []uint32 { + if m != nil { + return m.Fixed32Values + } + return nil +} + +func (m *MessageWithScalars) GetFixed64Value() uint64 { + if m != nil { + return m.Fixed64Value + } + return 0 +} + +func (m *MessageWithScalars) GetFixed64Values() []uint64 { + if m != nil { + return m.Fixed64Values + } + return nil +} + +func (m *MessageWithScalars) GetSfixed32Value() int32 { + if m != nil { + return m.Sfixed32Value + } + return 0 +} + +func (m *MessageWithScalars) GetSfixed32Values() []int32 { + if m != nil { + return m.Sfixed32Values + } + return nil +} + +func (m *MessageWithScalars) GetSfixed64Value() int64 { + if m != nil { + return m.Sfixed64Value + } + return 0 +} + +func (m *MessageWithScalars) GetSfixed64Values() []int64 { + if m != nil { + return m.Sfixed64Values + } + return nil +} + +func (m *MessageWithScalars) GetBoolValue() bool { + if m != nil { + return m.BoolValue + } + return false +} + +func (m *MessageWithScalars) GetBoolValues() []bool { + if m != nil { + return m.BoolValues + } + return nil +} + +func (m *MessageWithScalars) GetStringValue() string { + if m != nil { + return m.StringValue + } + return "" +} + +func (m *MessageWithScalars) GetStringValues() []string { + if m != nil { + return m.StringValues + } + return nil +} + +func (m *MessageWithScalars) GetBytesValue() []byte { + if m != nil { + return m.BytesValue + } + return nil +} + +func (m *MessageWithScalars) GetBytesValues() [][]byte { + if m != nil { + return m.BytesValues + } + return nil +} + +type MessageWithOneofScalars struct { + // Types that are valid to be assigned to Value: + // *MessageWithOneofScalars_DoubleValue + // *MessageWithOneofScalars_FloatValue + // *MessageWithOneofScalars_Int32Value + // *MessageWithOneofScalars_Int64Value + // *MessageWithOneofScalars_Uint32Value + // *MessageWithOneofScalars_Uint64Value + // *MessageWithOneofScalars_Sint32Value + // *MessageWithOneofScalars_Sint64Value + // *MessageWithOneofScalars_Fixed32Value + // *MessageWithOneofScalars_Fixed64Value + // *MessageWithOneofScalars_Sfixed32Value + // *MessageWithOneofScalars_Sfixed64Value + // *MessageWithOneofScalars_BoolValue + // *MessageWithOneofScalars_StringValue + // *MessageWithOneofScalars_BytesValue + Value isMessageWithOneofScalars_Value `protobuf_oneof:"value"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithOneofScalars) Reset() { *m = MessageWithOneofScalars{} } +func (m *MessageWithOneofScalars) String() string { return proto.CompactTextString(m) } +func (*MessageWithOneofScalars) ProtoMessage() {} +func (*MessageWithOneofScalars) Descriptor() ([]byte, []int) { + return fileDescriptor_5d1bcd1a4bdfc194, []int{1} +} +func (m *MessageWithOneofScalars) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithOneofScalars.Unmarshal(m, b) +} +func (m *MessageWithOneofScalars) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithOneofScalars.Marshal(b, m, deterministic) +} +func (m *MessageWithOneofScalars) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithOneofScalars.Merge(m, src) +} +func (m *MessageWithOneofScalars) XXX_Size() int { + return xxx_messageInfo_MessageWithOneofScalars.Size(m) +} +func (m *MessageWithOneofScalars) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithOneofScalars.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithOneofScalars proto.InternalMessageInfo + +type isMessageWithOneofScalars_Value interface { + isMessageWithOneofScalars_Value() +} + +type MessageWithOneofScalars_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` +} +type MessageWithOneofScalars_FloatValue struct { + FloatValue float32 `protobuf:"fixed32,2,opt,name=float_value,json=floatValue,proto3,oneof" json:"float_value,omitempty"` +} +type MessageWithOneofScalars_Int32Value struct { + Int32Value int32 `protobuf:"varint,3,opt,name=int32_value,json=int32Value,proto3,oneof" json:"int32_value,omitempty"` +} +type MessageWithOneofScalars_Int64Value struct { + Int64Value int64 `protobuf:"varint,4,opt,name=int64_value,json=int64Value,proto3,oneof" json:"int64_value,omitempty"` +} +type MessageWithOneofScalars_Uint32Value struct { + Uint32Value uint32 `protobuf:"varint,5,opt,name=uint32_value,json=uint32Value,proto3,oneof" json:"uint32_value,omitempty"` +} +type MessageWithOneofScalars_Uint64Value struct { + Uint64Value uint64 `protobuf:"varint,6,opt,name=uint64_value,json=uint64Value,proto3,oneof" json:"uint64_value,omitempty"` +} +type MessageWithOneofScalars_Sint32Value struct { + Sint32Value int32 `protobuf:"zigzag32,7,opt,name=sint32_value,json=sint32Value,proto3,oneof" json:"sint32_value,omitempty"` +} +type MessageWithOneofScalars_Sint64Value struct { + Sint64Value int64 `protobuf:"zigzag64,8,opt,name=sint64_value,json=sint64Value,proto3,oneof" json:"sint64_value,omitempty"` +} +type MessageWithOneofScalars_Fixed32Value struct { + Fixed32Value uint32 `protobuf:"fixed32,9,opt,name=fixed32_value,json=fixed32Value,proto3,oneof" json:"fixed32_value,omitempty"` +} +type MessageWithOneofScalars_Fixed64Value struct { + Fixed64Value uint64 `protobuf:"fixed64,10,opt,name=fixed64_value,json=fixed64Value,proto3,oneof" json:"fixed64_value,omitempty"` +} +type MessageWithOneofScalars_Sfixed32Value struct { + Sfixed32Value int32 `protobuf:"fixed32,11,opt,name=sfixed32_value,json=sfixed32Value,proto3,oneof" json:"sfixed32_value,omitempty"` +} +type MessageWithOneofScalars_Sfixed64Value struct { + Sfixed64Value int64 `protobuf:"fixed64,12,opt,name=sfixed64_value,json=sfixed64Value,proto3,oneof" json:"sfixed64_value,omitempty"` +} +type MessageWithOneofScalars_BoolValue struct { + BoolValue bool `protobuf:"varint,13,opt,name=bool_value,json=boolValue,proto3,oneof" json:"bool_value,omitempty"` +} +type MessageWithOneofScalars_StringValue struct { + StringValue string `protobuf:"bytes,14,opt,name=string_value,json=stringValue,proto3,oneof" json:"string_value,omitempty"` +} +type MessageWithOneofScalars_BytesValue struct { + BytesValue []byte `protobuf:"bytes,15,opt,name=bytes_value,json=bytesValue,proto3,oneof" json:"bytes_value,omitempty"` +} + +func (*MessageWithOneofScalars_DoubleValue) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_FloatValue) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_Int32Value) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_Int64Value) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_Uint32Value) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_Uint64Value) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_Sint32Value) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_Sint64Value) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_Fixed32Value) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_Fixed64Value) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_Sfixed32Value) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_Sfixed64Value) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_BoolValue) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_StringValue) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_BytesValue) isMessageWithOneofScalars_Value() {} + +func (m *MessageWithOneofScalars) GetValue() isMessageWithOneofScalars_Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *MessageWithOneofScalars) GetDoubleValue() float64 { + if x, ok := m.GetValue().(*MessageWithOneofScalars_DoubleValue); ok { + return x.DoubleValue + } + return 0 +} + +func (m *MessageWithOneofScalars) GetFloatValue() float32 { + if x, ok := m.GetValue().(*MessageWithOneofScalars_FloatValue); ok { + return x.FloatValue + } + return 0 +} + +func (m *MessageWithOneofScalars) GetInt32Value() int32 { + if x, ok := m.GetValue().(*MessageWithOneofScalars_Int32Value); ok { + return x.Int32Value + } + return 0 +} + +func (m *MessageWithOneofScalars) GetInt64Value() int64 { + if x, ok := m.GetValue().(*MessageWithOneofScalars_Int64Value); ok { + return x.Int64Value + } + return 0 +} + +func (m *MessageWithOneofScalars) GetUint32Value() uint32 { + if x, ok := m.GetValue().(*MessageWithOneofScalars_Uint32Value); ok { + return x.Uint32Value + } + return 0 +} + +func (m *MessageWithOneofScalars) GetUint64Value() uint64 { + if x, ok := m.GetValue().(*MessageWithOneofScalars_Uint64Value); ok { + return x.Uint64Value + } + return 0 +} + +func (m *MessageWithOneofScalars) GetSint32Value() int32 { + if x, ok := m.GetValue().(*MessageWithOneofScalars_Sint32Value); ok { + return x.Sint32Value + } + return 0 +} + +func (m *MessageWithOneofScalars) GetSint64Value() int64 { + if x, ok := m.GetValue().(*MessageWithOneofScalars_Sint64Value); ok { + return x.Sint64Value + } + return 0 +} + +func (m *MessageWithOneofScalars) GetFixed32Value() uint32 { + if x, ok := m.GetValue().(*MessageWithOneofScalars_Fixed32Value); ok { + return x.Fixed32Value + } + return 0 +} + +func (m *MessageWithOneofScalars) GetFixed64Value() uint64 { + if x, ok := m.GetValue().(*MessageWithOneofScalars_Fixed64Value); ok { + return x.Fixed64Value + } + return 0 +} + +func (m *MessageWithOneofScalars) GetSfixed32Value() int32 { + if x, ok := m.GetValue().(*MessageWithOneofScalars_Sfixed32Value); ok { + return x.Sfixed32Value + } + return 0 +} + +func (m *MessageWithOneofScalars) GetSfixed64Value() int64 { + if x, ok := m.GetValue().(*MessageWithOneofScalars_Sfixed64Value); ok { + return x.Sfixed64Value + } + return 0 +} + +func (m *MessageWithOneofScalars) GetBoolValue() bool { + if x, ok := m.GetValue().(*MessageWithOneofScalars_BoolValue); ok { + return x.BoolValue + } + return false +} + +func (m *MessageWithOneofScalars) GetStringValue() string { + if x, ok := m.GetValue().(*MessageWithOneofScalars_StringValue); ok { + return x.StringValue + } + return "" +} + +func (m *MessageWithOneofScalars) GetBytesValue() []byte { + if x, ok := m.GetValue().(*MessageWithOneofScalars_BytesValue); ok { + return x.BytesValue + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MessageWithOneofScalars) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MessageWithOneofScalars_DoubleValue)(nil), + (*MessageWithOneofScalars_FloatValue)(nil), + (*MessageWithOneofScalars_Int32Value)(nil), + (*MessageWithOneofScalars_Int64Value)(nil), + (*MessageWithOneofScalars_Uint32Value)(nil), + (*MessageWithOneofScalars_Uint64Value)(nil), + (*MessageWithOneofScalars_Sint32Value)(nil), + (*MessageWithOneofScalars_Sint64Value)(nil), + (*MessageWithOneofScalars_Fixed32Value)(nil), + (*MessageWithOneofScalars_Fixed64Value)(nil), + (*MessageWithOneofScalars_Sfixed32Value)(nil), + (*MessageWithOneofScalars_Sfixed64Value)(nil), + (*MessageWithOneofScalars_BoolValue)(nil), + (*MessageWithOneofScalars_StringValue)(nil), + (*MessageWithOneofScalars_BytesValue)(nil), + } +} + +type MessageWithScalarMaps struct { + StringDoubleMap map[string]float64 `protobuf:"bytes,1,rep,name=string_double_map,json=stringDoubleMap,proto3" json:"string_double_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` + StringFloatMap map[string]float32 `protobuf:"bytes,3,rep,name=string_float_map,json=stringFloatMap,proto3" json:"string_float_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` + StringInt32Map map[string]int32 `protobuf:"bytes,5,rep,name=string_int32_map,json=stringInt32Map,proto3" json:"string_int32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Int32StringMap map[int32]string `protobuf:"bytes,6,rep,name=int32_string_map,json=int32StringMap,proto3" json:"int32_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringInt64Map map[string]int64 `protobuf:"bytes,7,rep,name=string_int64_map,json=stringInt64Map,proto3" json:"string_int64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Int64StringMap map[int64]string `protobuf:"bytes,8,rep,name=int64_string_map,json=int64StringMap,proto3" json:"int64_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringUint32Map map[string]uint32 `protobuf:"bytes,9,rep,name=string_uint32_map,json=stringUint32Map,proto3" json:"string_uint32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Uint32StringMap map[uint32]string `protobuf:"bytes,10,rep,name=uint32_string_map,json=uint32StringMap,proto3" json:"uint32_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringUint64Map map[string]uint64 `protobuf:"bytes,11,rep,name=string_uint64_map,json=stringUint64Map,proto3" json:"string_uint64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Uint64StringMap map[uint64]string `protobuf:"bytes,12,rep,name=uint64_string_map,json=uint64StringMap,proto3" json:"uint64_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringSint32Map map[string]int32 `protobuf:"bytes,13,rep,name=string_sint32_map,json=stringSint32Map,proto3" json:"string_sint32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"zigzag32,2,opt,name=value,proto3"` + Sint32StringMap map[int32]string `protobuf:"bytes,14,rep,name=sint32_string_map,json=sint32StringMap,proto3" json:"sint32_string_map,omitempty" protobuf_key:"zigzag32,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringSint64Map map[string]int64 `protobuf:"bytes,15,rep,name=string_sint64_map,json=stringSint64Map,proto3" json:"string_sint64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"zigzag64,2,opt,name=value,proto3"` + Sint64StringMap map[int64]string `protobuf:"bytes,16,rep,name=sint64_string_map,json=sint64StringMap,proto3" json:"sint64_string_map,omitempty" protobuf_key:"zigzag64,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringFixed32Map map[string]uint32 `protobuf:"bytes,17,rep,name=string_fixed32_map,json=stringFixed32Map,proto3" json:"string_fixed32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` + Fixed32StringMap map[uint32]string `protobuf:"bytes,18,rep,name=fixed32_string_map,json=fixed32StringMap,proto3" json:"fixed32_string_map,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringFixed64Map map[string]uint64 `protobuf:"bytes,19,rep,name=string_fixed64_map,json=stringFixed64Map,proto3" json:"string_fixed64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` + Fixed64StringMap map[uint64]string `protobuf:"bytes,20,rep,name=fixed64_string_map,json=fixed64StringMap,proto3" json:"fixed64_string_map,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringSfixed32Map map[string]int32 `protobuf:"bytes,21,rep,name=string_sfixed32_map,json=stringSfixed32Map,proto3" json:"string_sfixed32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` + Sfixed32StringMap map[int32]string `protobuf:"bytes,22,rep,name=sfixed32_string_map,json=sfixed32StringMap,proto3" json:"sfixed32_string_map,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringSfixed64Map map[string]int64 `protobuf:"bytes,23,rep,name=string_sfixed64_map,json=stringSfixed64Map,proto3" json:"string_sfixed64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` + Sfixed64StringMap map[int64]string `protobuf:"bytes,24,rep,name=sfixed64_string_map,json=sfixed64StringMap,proto3" json:"sfixed64_string_map,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringBoolMap map[string]bool `protobuf:"bytes,25,rep,name=string_bool_map,json=stringBoolMap,proto3" json:"string_bool_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + BoolStringMap map[bool]string `protobuf:"bytes,26,rep,name=bool_string_map,json=boolStringMap,proto3" json:"bool_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringStringMap map[string]string `protobuf:"bytes,27,rep,name=string_string_map,json=stringStringMap,proto3" json:"string_string_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringBytesMap map[string][]byte `protobuf:"bytes,29,rep,name=string_bytes_map,json=stringBytesMap,proto3" json:"string_bytes_map,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 *MessageWithScalarMaps) Reset() { *m = MessageWithScalarMaps{} } +func (m *MessageWithScalarMaps) String() string { return proto.CompactTextString(m) } +func (*MessageWithScalarMaps) ProtoMessage() {} +func (*MessageWithScalarMaps) Descriptor() ([]byte, []int) { + return fileDescriptor_5d1bcd1a4bdfc194, []int{2} +} +func (m *MessageWithScalarMaps) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithScalarMaps.Unmarshal(m, b) +} +func (m *MessageWithScalarMaps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithScalarMaps.Marshal(b, m, deterministic) +} +func (m *MessageWithScalarMaps) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithScalarMaps.Merge(m, src) +} +func (m *MessageWithScalarMaps) XXX_Size() int { + return xxx_messageInfo_MessageWithScalarMaps.Size(m) +} +func (m *MessageWithScalarMaps) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithScalarMaps.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithScalarMaps proto.InternalMessageInfo + +func (m *MessageWithScalarMaps) GetStringDoubleMap() map[string]float64 { + if m != nil { + return m.StringDoubleMap + } + return nil +} + +func (m *MessageWithScalarMaps) GetStringFloatMap() map[string]float32 { + if m != nil { + return m.StringFloatMap + } + return nil +} + +func (m *MessageWithScalarMaps) GetStringInt32Map() map[string]int32 { + if m != nil { + return m.StringInt32Map + } + return nil +} + +func (m *MessageWithScalarMaps) GetInt32StringMap() map[int32]string { + if m != nil { + return m.Int32StringMap + } + return nil +} + +func (m *MessageWithScalarMaps) GetStringInt64Map() map[string]int64 { + if m != nil { + return m.StringInt64Map + } + return nil +} + +func (m *MessageWithScalarMaps) GetInt64StringMap() map[int64]string { + if m != nil { + return m.Int64StringMap + } + return nil +} + +func (m *MessageWithScalarMaps) GetStringUint32Map() map[string]uint32 { + if m != nil { + return m.StringUint32Map + } + return nil +} + +func (m *MessageWithScalarMaps) GetUint32StringMap() map[uint32]string { + if m != nil { + return m.Uint32StringMap + } + return nil +} + +func (m *MessageWithScalarMaps) GetStringUint64Map() map[string]uint64 { + if m != nil { + return m.StringUint64Map + } + return nil +} + +func (m *MessageWithScalarMaps) GetUint64StringMap() map[uint64]string { + if m != nil { + return m.Uint64StringMap + } + return nil +} + +func (m *MessageWithScalarMaps) GetStringSint32Map() map[string]int32 { + if m != nil { + return m.StringSint32Map + } + return nil +} + +func (m *MessageWithScalarMaps) GetSint32StringMap() map[int32]string { + if m != nil { + return m.Sint32StringMap + } + return nil +} + +func (m *MessageWithScalarMaps) GetStringSint64Map() map[string]int64 { + if m != nil { + return m.StringSint64Map + } + return nil +} + +func (m *MessageWithScalarMaps) GetSint64StringMap() map[int64]string { + if m != nil { + return m.Sint64StringMap + } + return nil +} + +func (m *MessageWithScalarMaps) GetStringFixed32Map() map[string]uint32 { + if m != nil { + return m.StringFixed32Map + } + return nil +} + +func (m *MessageWithScalarMaps) GetFixed32StringMap() map[uint32]string { + if m != nil { + return m.Fixed32StringMap + } + return nil +} + +func (m *MessageWithScalarMaps) GetStringFixed64Map() map[string]uint64 { + if m != nil { + return m.StringFixed64Map + } + return nil +} + +func (m *MessageWithScalarMaps) GetFixed64StringMap() map[uint64]string { + if m != nil { + return m.Fixed64StringMap + } + return nil +} + +func (m *MessageWithScalarMaps) GetStringSfixed32Map() map[string]int32 { + if m != nil { + return m.StringSfixed32Map + } + return nil +} + +func (m *MessageWithScalarMaps) GetSfixed32StringMap() map[int32]string { + if m != nil { + return m.Sfixed32StringMap + } + return nil +} + +func (m *MessageWithScalarMaps) GetStringSfixed64Map() map[string]int64 { + if m != nil { + return m.StringSfixed64Map + } + return nil +} + +func (m *MessageWithScalarMaps) GetSfixed64StringMap() map[int64]string { + if m != nil { + return m.Sfixed64StringMap + } + return nil +} + +func (m *MessageWithScalarMaps) GetStringBoolMap() map[string]bool { + if m != nil { + return m.StringBoolMap + } + return nil +} + +func (m *MessageWithScalarMaps) GetBoolStringMap() map[bool]string { + if m != nil { + return m.BoolStringMap + } + return nil +} + +func (m *MessageWithScalarMaps) GetStringStringMap() map[string]string { + if m != nil { + return m.StringStringMap + } + return nil +} + +func (m *MessageWithScalarMaps) GetStringBytesMap() map[string][]byte { + if m != nil { + return m.StringBytesMap + } + return nil +} + +func init() { + proto.RegisterType((*MessageWithScalars)(nil), "thethings.json.test.MessageWithScalars") + proto.RegisterType((*MessageWithOneofScalars)(nil), "thethings.json.test.MessageWithOneofScalars") + proto.RegisterType((*MessageWithScalarMaps)(nil), "thethings.json.test.MessageWithScalarMaps") + proto.RegisterMapType((map[bool]string)(nil), "thethings.json.test.MessageWithScalarMaps.BoolStringMapEntry") + proto.RegisterMapType((map[uint32]string)(nil), "thethings.json.test.MessageWithScalarMaps.Fixed32StringMapEntry") + proto.RegisterMapType((map[uint64]string)(nil), "thethings.json.test.MessageWithScalarMaps.Fixed64StringMapEntry") + proto.RegisterMapType((map[int32]string)(nil), "thethings.json.test.MessageWithScalarMaps.Int32StringMapEntry") + proto.RegisterMapType((map[int64]string)(nil), "thethings.json.test.MessageWithScalarMaps.Int64StringMapEntry") + proto.RegisterMapType((map[int32]string)(nil), "thethings.json.test.MessageWithScalarMaps.Sfixed32StringMapEntry") + proto.RegisterMapType((map[int64]string)(nil), "thethings.json.test.MessageWithScalarMaps.Sfixed64StringMapEntry") + proto.RegisterMapType((map[int32]string)(nil), "thethings.json.test.MessageWithScalarMaps.Sint32StringMapEntry") + proto.RegisterMapType((map[int64]string)(nil), "thethings.json.test.MessageWithScalarMaps.Sint64StringMapEntry") + proto.RegisterMapType((map[string]bool)(nil), "thethings.json.test.MessageWithScalarMaps.StringBoolMapEntry") + proto.RegisterMapType((map[string][]byte)(nil), "thethings.json.test.MessageWithScalarMaps.StringBytesMapEntry") + proto.RegisterMapType((map[string]float64)(nil), "thethings.json.test.MessageWithScalarMaps.StringDoubleMapEntry") + proto.RegisterMapType((map[string]uint32)(nil), "thethings.json.test.MessageWithScalarMaps.StringFixed32MapEntry") + proto.RegisterMapType((map[string]uint64)(nil), "thethings.json.test.MessageWithScalarMaps.StringFixed64MapEntry") + proto.RegisterMapType((map[string]float32)(nil), "thethings.json.test.MessageWithScalarMaps.StringFloatMapEntry") + proto.RegisterMapType((map[string]int32)(nil), "thethings.json.test.MessageWithScalarMaps.StringInt32MapEntry") + proto.RegisterMapType((map[string]int64)(nil), "thethings.json.test.MessageWithScalarMaps.StringInt64MapEntry") + proto.RegisterMapType((map[string]int32)(nil), "thethings.json.test.MessageWithScalarMaps.StringSfixed32MapEntry") + proto.RegisterMapType((map[string]int64)(nil), "thethings.json.test.MessageWithScalarMaps.StringSfixed64MapEntry") + proto.RegisterMapType((map[string]int32)(nil), "thethings.json.test.MessageWithScalarMaps.StringSint32MapEntry") + proto.RegisterMapType((map[string]int64)(nil), "thethings.json.test.MessageWithScalarMaps.StringSint64MapEntry") + proto.RegisterMapType((map[string]string)(nil), "thethings.json.test.MessageWithScalarMaps.StringStringMapEntry") + proto.RegisterMapType((map[string]uint32)(nil), "thethings.json.test.MessageWithScalarMaps.StringUint32MapEntry") + proto.RegisterMapType((map[string]uint64)(nil), "thethings.json.test.MessageWithScalarMaps.StringUint64MapEntry") + proto.RegisterMapType((map[uint32]string)(nil), "thethings.json.test.MessageWithScalarMaps.Uint32StringMapEntry") + proto.RegisterMapType((map[uint64]string)(nil), "thethings.json.test.MessageWithScalarMaps.Uint64StringMapEntry") +} + +func init() { proto.RegisterFile("scalars.proto", fileDescriptor_5d1bcd1a4bdfc194) } + +var fileDescriptor_5d1bcd1a4bdfc194 = []byte{ + // 1413 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x59, 0xed, 0x6e, 0xdb, 0x36, + 0x17, 0x8e, 0x2c, 0x7f, 0x52, 0x92, 0x3f, 0x94, 0xa4, 0x55, 0xd3, 0xb7, 0x6f, 0x99, 0x64, 0xc3, + 0xf8, 0x27, 0x0e, 0xd0, 0x1a, 0xc6, 0x30, 0x60, 0x6b, 0x9b, 0x75, 0x43, 0xfa, 0x23, 0x18, 0x40, + 0xb7, 0x1b, 0xb0, 0x3f, 0x85, 0x9d, 0xc8, 0x1f, 0xab, 0x2b, 0x65, 0xa1, 0x34, 0x2c, 0x97, 0xb2, + 0x7b, 0xda, 0x6e, 0x64, 0x57, 0x31, 0x90, 0xa2, 0x24, 0x92, 0x62, 0x22, 0xcb, 0xf9, 0xd7, 0x1e, + 0x1d, 0x3c, 0xcf, 0x73, 0xf8, 0x9c, 0x73, 0x48, 0x23, 0xc0, 0x21, 0x97, 0xd3, 0xf5, 0xf4, 0x86, + 0x0c, 0xaf, 0x6f, 0xc2, 0x28, 0x74, 0x77, 0xa3, 0xa5, 0x1f, 0x2d, 0x57, 0xc1, 0x82, 0x0c, 0x7f, + 0x23, 0x61, 0x30, 0x8c, 0x7c, 0x12, 0x1d, 0x0c, 0xa6, 0x41, 0x10, 0x46, 0xd3, 0x68, 0x15, 0x06, + 0x3c, 0xef, 0xe8, 0xef, 0x36, 0x70, 0x2f, 0x7c, 0x42, 0xa6, 0x0b, 0xff, 0x97, 0x55, 0xb4, 0x9c, + 0x24, 0x20, 0xee, 0x21, 0xb0, 0xaf, 0xc2, 0x78, 0xb6, 0xf6, 0x3f, 0xfe, 0x31, 0x5d, 0xc7, 0xbe, + 0x67, 0x40, 0x03, 0x19, 0xd8, 0x4a, 0x62, 0x3f, 0xd3, 0x90, 0x7b, 0x0c, 0x1c, 0x31, 0x85, 0x78, + 0x35, 0x68, 0x22, 0x03, 0xdb, 0x42, 0x0e, 0x71, 0x9f, 0x03, 0x6b, 0xbe, 0x0e, 0xa7, 0x11, 0x87, + 0x31, 0xa1, 0x81, 0x6a, 0x18, 0xb0, 0x50, 0x82, 0x72, 0x08, 0x6c, 0x21, 0x81, 0x78, 0x75, 0x68, + 0xa2, 0x1a, 0xb6, 0xf2, 0x0c, 0x86, 0xb1, 0x0a, 0xa2, 0x97, 0x2f, 0x38, 0x46, 0x03, 0x1a, 0xa8, + 0x81, 0x01, 0x0b, 0x65, 0x18, 0x42, 0x02, 0xf1, 0x9a, 0xd0, 0x44, 0x0d, 0x6c, 0xe5, 0x19, 0x29, + 0xc6, 0x78, 0xc4, 0x31, 0x5a, 0xd0, 0x40, 0x26, 0xc3, 0x18, 0x8f, 0x44, 0x8c, 0x34, 0x81, 0x78, + 0x6d, 0x68, 0x22, 0x13, 0x5b, 0x79, 0x06, 0x3b, 0x93, 0x58, 0x14, 0xd2, 0x81, 0x06, 0x72, 0xb0, + 0x15, 0x0b, 0x4a, 0x8e, 0x81, 0x13, 0x4b, 0x52, 0x00, 0x34, 0x91, 0x83, 0xed, 0x58, 0xd4, 0xc2, + 0x71, 0x32, 0x31, 0x16, 0x34, 0x50, 0x3d, 0xc1, 0x49, 0xd5, 0x70, 0x9c, 0x5c, 0x8e, 0x0d, 0x4d, + 0x54, 0xc7, 0x76, 0xac, 0xe8, 0x21, 0xa2, 0x1e, 0x07, 0x1a, 0x68, 0x80, 0x2d, 0x22, 0xeb, 0x21, + 0x92, 0x9e, 0x2e, 0x34, 0xd1, 0x00, 0xdb, 0x44, 0xd1, 0x43, 0x44, 0x3d, 0x3d, 0x68, 0x20, 0x37, + 0xc1, 0x11, 0xf4, 0x10, 0x49, 0x4f, 0x1f, 0x9a, 0xc8, 0xc5, 0x36, 0x11, 0xf5, 0x1c, 0x03, 0x67, + 0xbe, 0xfa, 0xd3, 0xbf, 0xca, 0x04, 0x0d, 0xa0, 0x81, 0x5a, 0xd8, 0xe6, 0xc1, 0x04, 0xe9, 0x4b, + 0xd0, 0x95, 0x92, 0x88, 0xe7, 0x42, 0x13, 0xb5, 0xb0, 0x23, 0x66, 0xe5, 0x58, 0x99, 0xa8, 0x5d, + 0x68, 0xa0, 0x26, 0xc7, 0x4a, 0x55, 0xa5, 0x58, 0xb9, 0xac, 0x3d, 0x68, 0xa2, 0x26, 0x76, 0xc4, + 0x2c, 0x42, 0xd3, 0x88, 0x2c, 0x6c, 0x1f, 0x1a, 0xa8, 0x87, 0x1d, 0x22, 0x29, 0xfb, 0x0a, 0xf4, + 0x88, 0x22, 0xed, 0x11, 0x34, 0x51, 0x0f, 0x77, 0x89, 0xac, 0x2d, 0xc3, 0xcb, 0xc4, 0x3d, 0x86, + 0x06, 0xea, 0xa7, 0x78, 0xa9, 0xba, 0x0c, 0x2f, 0x97, 0xe7, 0x41, 0x13, 0xf5, 0x71, 0x97, 0xc8, + 0xfa, 0x9e, 0x01, 0x30, 0x0b, 0xc3, 0x35, 0xc7, 0x7a, 0x02, 0x0d, 0xd4, 0xc6, 0x1d, 0x1a, 0x49, + 0x70, 0x9e, 0x03, 0x2b, 0xff, 0x4c, 0xbc, 0x03, 0x68, 0xa2, 0x36, 0x06, 0xd9, 0xf7, 0xc4, 0xbf, + 0xe8, 0x66, 0x15, 0x2c, 0x38, 0xc2, 0x53, 0x68, 0xa0, 0x0e, 0xb6, 0x92, 0x58, 0xee, 0x9f, 0x90, + 0x42, 0xbc, 0xff, 0x41, 0x13, 0x75, 0xb0, 0x2d, 0xe4, 0xb0, 0x19, 0x99, 0xdd, 0x46, 0x3e, 0xe1, + 0x30, 0xcf, 0xa0, 0x81, 0x6c, 0x0c, 0x58, 0x28, 0x9b, 0x11, 0x21, 0x81, 0x78, 0xff, 0x87, 0x26, + 0xb2, 0xb1, 0x95, 0x67, 0x90, 0xa3, 0x7f, 0xea, 0xe0, 0xb1, 0xb0, 0x4e, 0x7e, 0x0a, 0xfc, 0x70, + 0x9e, 0xee, 0x94, 0x63, 0xdd, 0x4e, 0x39, 0xdf, 0x91, 0xb7, 0xca, 0xa1, 0xbc, 0x30, 0x6a, 0x74, + 0x61, 0x9c, 0xef, 0x28, 0x2b, 0x43, 0xda, 0x07, 0x74, 0xa7, 0x34, 0x68, 0x8a, 0xb4, 0x11, 0xa4, + 0x71, 0xaf, 0xd3, 0x71, 0xe7, 0x29, 0x79, 0x4b, 0xcb, 0xd3, 0x4c, 0xd7, 0x8a, 0x43, 0xd5, 0xc8, + 0xf3, 0x2c, 0x8f, 0x6a, 0x93, 0x8e, 0x6a, 0x9a, 0x24, 0x20, 0x49, 0x73, 0x48, 0x97, 0xcb, 0x80, + 0x26, 0xc9, 0x93, 0x28, 0x0f, 0x59, 0x9b, 0x0e, 0x59, 0x9a, 0x94, 0x37, 0xb4, 0x32, 0x41, 0x74, + 0xc5, 0xb4, 0xce, 0x77, 0x0a, 0x33, 0xa4, 0x0c, 0x07, 0xa0, 0xc3, 0x91, 0xa5, 0xe5, 0x0d, 0xa8, + 0xf6, 0x3d, 0xdd, 0x34, 0xbd, 0xf3, 0x9d, 0x62, 0xe7, 0xab, 0x0d, 0x6d, 0xd3, 0x86, 0xce, 0x13, + 0x53, 0xc4, 0xe7, 0x52, 0xa7, 0xd2, 0x7d, 0xd3, 0x3e, 0xdf, 0x11, 0x7b, 0xf5, 0x58, 0x69, 0xc5, + 0x2e, 0x6d, 0x45, 0x56, 0xa5, 0xd0, 0x8c, 0x87, 0x72, 0x9f, 0xd1, 0x75, 0x63, 0x53, 0x73, 0xf2, + 0x3e, 0x3a, 0x6b, 0x81, 0x06, 0xfb, 0x78, 0xf4, 0xd7, 0x17, 0x60, 0xbf, 0x70, 0x3d, 0x5d, 0x4c, + 0xaf, 0x89, 0xfb, 0x09, 0x0c, 0x38, 0x15, 0x6f, 0xaa, 0xcf, 0xd3, 0x6b, 0xcf, 0x80, 0x26, 0xb2, + 0x5e, 0xbc, 0x1a, 0x6a, 0x2e, 0xbf, 0xa1, 0x16, 0x66, 0x38, 0x61, 0x18, 0x6f, 0x19, 0xc4, 0xc5, + 0xf4, 0xfa, 0x87, 0x20, 0xba, 0xb9, 0xc5, 0x3d, 0x22, 0x47, 0xdd, 0x25, 0xe8, 0x73, 0xb2, 0xa4, + 0x39, 0x29, 0x97, 0xc9, 0xb8, 0xbe, 0xab, 0xcc, 0xf5, 0x23, 0x45, 0xc8, 0xa8, 0xba, 0x44, 0x0a, + 0x0a, 0x4c, 0x49, 0x4b, 0x51, 0xa6, 0xc6, 0x96, 0x4c, 0xef, 0x28, 0x82, 0xca, 0x94, 0x06, 0x29, + 0x53, 0x42, 0xc1, 0xf9, 0x28, 0x53, 0xb3, 0x32, 0x13, 0x83, 0x4b, 0xe8, 0x72, 0xa6, 0x95, 0x14, + 0x94, 0x6b, 0x1a, 0x8f, 0x18, 0x53, 0x6b, 0xfb, 0x9a, 0xc6, 0x23, 0x4d, 0x4d, 0x2c, 0xc8, 0x6b, + 0x1a, 0x8f, 0xc4, 0x9a, 0xda, 0xdb, 0xd4, 0x34, 0x1e, 0x69, 0x6a, 0x12, 0x82, 0x42, 0xfb, 0xc5, + 0xb9, 0x51, 0x9d, 0x2d, 0xdb, 0xef, 0xc3, 0x4a, 0x72, 0x8a, 0xb7, 0x5f, 0x16, 0xa5, 0x64, 0x71, + 0xc1, 0x2b, 0x50, 0x99, 0xec, 0xc3, 0x4a, 0x63, 0x56, 0x2f, 0x56, 0xdc, 0x92, 0x2b, 0xe3, 0x76, + 0x59, 0x0f, 0xa8, 0x4c, 0xf0, 0x4b, 0xa8, 0x2c, 0x31, 0x8c, 0x57, 0x26, 0x3b, 0x66, 0x6f, 0x55, + 0x59, 0xc1, 0xb2, 0x5e, 0x7c, 0xa7, 0x67, 0x24, 0xf7, 0xcc, 0xd9, 0xb2, 0xb2, 0x89, 0xd6, 0xb3, + 0x89, 0xe8, 0x19, 0x29, 0x78, 0xd6, 0xad, 0x4e, 0xa6, 0xf5, 0x8c, 0xdc, 0xe9, 0x19, 0xc9, 0x3d, + 0xeb, 0x3d, 0xa0, 0xb2, 0xa2, 0x67, 0x13, 0xd1, 0x33, 0x52, 0xf0, 0xac, 0xbf, 0x55, 0x65, 0x45, + 0xcf, 0x88, 0xe2, 0x59, 0x00, 0xdc, 0x74, 0xf3, 0xf2, 0xab, 0x8c, 0xb2, 0x0d, 0x18, 0xdb, 0xeb, + 0xea, 0xbb, 0x37, 0xc1, 0xc8, 0xe8, 0xf8, 0x5e, 0xca, 0xc3, 0x94, 0x2f, 0x25, 0x12, 0xaa, 0x73, + 0x2b, 0xf3, 0x71, 0x48, 0xa5, 0xbc, 0xfe, 0x5c, 0x09, 0xab, 0xf5, 0x71, 0xeb, 0x76, 0x1f, 0x52, + 0x9f, 0xe0, 0x9d, 0x58, 0x5f, 0x62, 0x5e, 0x5a, 0x9f, 0xec, 0xde, 0xde, 0x76, 0xf5, 0x15, 0xec, + 0xeb, 0xcf, 0x95, 0xb0, 0xfb, 0x3b, 0xd8, 0x4d, 0x3b, 0x53, 0x34, 0x70, 0x9f, 0x11, 0xbe, 0xa9, + 0xde, 0x9b, 0x73, 0xc5, 0x41, 0xde, 0xf7, 0x42, 0x9c, 0x51, 0x6a, 0x3c, 0x7c, 0x54, 0x9d, 0x72, + 0xae, 0x35, 0x71, 0x40, 0x0a, 0x2e, 0xaa, 0x55, 0x72, 0x1b, 0x1f, 0x3f, 0xa8, 0x4a, 0xc1, 0x47, + 0xa9, 0xca, 0xc4, 0xc8, 0xac, 0x4a, 0xd9, 0x49, 0x6f, 0xcb, 0x2a, 0x0b, 0x56, 0x0e, 0x48, 0xc1, + 0x4b, 0x1f, 0xf0, 0x5d, 0xf0, 0x91, 0xbd, 0x02, 0x29, 0xdd, 0x13, 0x46, 0xf7, 0x6d, 0xe5, 0x0a, + 0xcf, 0xc2, 0x70, 0x9d, 0x51, 0xf1, 0xdf, 0x26, 0x3c, 0x46, 0x69, 0x18, 0xbe, 0x50, 0xd5, 0x41, + 0x65, 0x1a, 0x0a, 0xa6, 0x54, 0xe4, 0xcc, 0xc4, 0x98, 0xb8, 0x33, 0x73, 0xa2, 0xa7, 0xdb, 0xee, + 0x4c, 0x75, 0x8d, 0xc9, 0x51, 0xe1, 0x09, 0x94, 0x3c, 0x7d, 0x29, 0xd7, 0xb3, 0x2d, 0x9f, 0x40, + 0x67, 0x14, 0x41, 0x7d, 0x02, 0xa5, 0xc1, 0x83, 0x33, 0xb0, 0xa7, 0x7b, 0xd3, 0xba, 0x7d, 0x60, + 0x7e, 0xf2, 0x6f, 0xd9, 0x8f, 0xae, 0x0e, 0xa6, 0xff, 0x74, 0xf7, 0xf8, 0x23, 0x9b, 0xfd, 0xc8, + 0x32, 0x70, 0xf2, 0x9f, 0x6f, 0x6a, 0x5f, 0x1b, 0x07, 0x6f, 0xc0, 0xae, 0xe6, 0xad, 0x5a, 0x06, + 0x51, 0xd3, 0x42, 0x48, 0x8f, 0xd0, 0x32, 0x88, 0x86, 0x02, 0xa1, 0x79, 0x5d, 0x8a, 0x10, 0x0d, + 0x0d, 0x44, 0xe7, 0x2e, 0x15, 0xf9, 0x38, 0x95, 0xa9, 0x30, 0x8b, 0x2a, 0xd4, 0xf1, 0x10, 0x21, + 0xcc, 0x32, 0x15, 0x99, 0x25, 0xf2, 0x3b, 0xaf, 0x4c, 0x86, 0xa3, 0x60, 0xe8, 0x9e, 0x6f, 0x22, + 0x86, 0x53, 0x49, 0xc7, 0xe6, 0xc7, 0x51, 0xd7, 0xe8, 0xb8, 0xef, 0x3c, 0xea, 0x1b, 0xeb, 0x98, + 0x54, 0x3a, 0x8f, 0x81, 0x8a, 0x51, 0x72, 0x1e, 0x83, 0x4a, 0x3a, 0x36, 0x3f, 0x0f, 0x57, 0xa3, + 0xe3, 0xbe, 0xf3, 0x70, 0xcb, 0x74, 0x7c, 0x0f, 0xf6, 0xb5, 0xcf, 0x93, 0x32, 0x21, 0x2d, 0x05, + 0x44, 0xfb, 0xe6, 0x10, 0x41, 0x5a, 0xd5, 0x94, 0x6c, 0x7e, 0x24, 0x4d, 0x9d, 0x92, 0xfb, 0xce, + 0xa4, 0x59, 0xa6, 0xe4, 0x2d, 0x78, 0xa4, 0xbf, 0xf1, 0xcb, 0xa4, 0xf4, 0x54, 0x94, 0x79, 0xd9, + 0xa9, 0xf4, 0x2a, 0x6a, 0xd9, 0xfc, 0x58, 0xfa, 0x5a, 0x2d, 0xf7, 0x9d, 0x4b, 0xbf, 0x4c, 0xcb, + 0x6b, 0xe0, 0x16, 0x6f, 0xd0, 0x32, 0x1d, 0x6d, 0x05, 0xa1, 0x78, 0x39, 0x8a, 0x08, 0xed, 0xcd, + 0xe7, 0xe6, 0x4e, 0x8c, 0xce, 0xc6, 0x9b, 0x59, 0xba, 0xcd, 0xca, 0x20, 0x6c, 0x01, 0xe2, 0xec, + 0xd5, 0xbf, 0x71, 0xbd, 0x6d, 0xf4, 0x8d, 0x5f, 0xc7, 0x8b, 0x55, 0xb4, 0x8c, 0x67, 0xc3, 0xcb, + 0xf0, 0xf3, 0xe9, 0xfb, 0xa5, 0xff, 0x9e, 0x5d, 0xa6, 0xef, 0x82, 0xab, 0x98, 0x5e, 0x8d, 0x3e, + 0x39, 0x65, 0x7f, 0xe9, 0xb8, 0x3c, 0x59, 0xf8, 0xc1, 0xc9, 0x22, 0x3c, 0xa1, 0x97, 0xec, 0x29, + 0xbd, 0x64, 0x67, 0x4d, 0xf6, 0xe1, 0xe5, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe7, 0x32, 0x41, + 0x74, 0x3b, 0x19, 0x00, 0x00, +} diff --git a/test/gogo/scalars_json.pb.go b/test/gogo/scalars_json.pb.go new file mode 100644 index 00000000..c885ca22 --- /dev/null +++ b/test/gogo/scalars_json.pb.go @@ -0,0 +1,930 @@ +// Code generated by protoc-gen-go-json. DO NOT EDIT. +// versions: +// - protoc-gen-go-json v0.0.0-dev +// - protoc v3.9.1 +// source: scalars.proto + +package test + +import ( + jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" +) + +// MarshalProtoJSON marshals the MessageWithScalars message to JSON. +func (x *MessageWithScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.DoubleValue != 0 || s.HasField("double_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("double_value") + s.WriteFloat64(x.DoubleValue) + } + if len(x.DoubleValues) > 0 || s.HasField("double_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("double_values") + s.WriteFloat64Array(x.DoubleValues) + } + if x.FloatValue != 0 || s.HasField("float_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("float_value") + s.WriteFloat32(x.FloatValue) + } + if len(x.FloatValues) > 0 || s.HasField("float_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("float_values") + s.WriteFloat32Array(x.FloatValues) + } + if x.Int32Value != 0 || s.HasField("int32_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int32_value") + s.WriteInt32(x.Int32Value) + } + if len(x.Int32Values) > 0 || s.HasField("int32_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int32_values") + s.WriteInt32Array(x.Int32Values) + } + if x.Int64Value != 0 || s.HasField("int64_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int64_value") + s.WriteInt64(x.Int64Value) + } + if len(x.Int64Values) > 0 || s.HasField("int64_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int64_values") + s.WriteInt64Array(x.Int64Values) + } + if x.Uint32Value != 0 || s.HasField("uint32_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint32_value") + s.WriteUint32(x.Uint32Value) + } + if len(x.Uint32Values) > 0 || s.HasField("uint32_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint32_values") + s.WriteUint32Array(x.Uint32Values) + } + if x.Uint64Value != 0 || s.HasField("uint64_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint64_value") + s.WriteUint64(x.Uint64Value) + } + if len(x.Uint64Values) > 0 || s.HasField("uint64_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint64_values") + s.WriteUint64Array(x.Uint64Values) + } + if x.Sint32Value != 0 || s.HasField("sint32_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint32_value") + s.WriteInt32(x.Sint32Value) + } + if len(x.Sint32Values) > 0 || s.HasField("sint32_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint32_values") + s.WriteInt32Array(x.Sint32Values) + } + if x.Sint64Value != 0 || s.HasField("sint64_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint64_value") + s.WriteInt64(x.Sint64Value) + } + if len(x.Sint64Values) > 0 || s.HasField("sint64_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint64_values") + s.WriteInt64Array(x.Sint64Values) + } + if x.Fixed32Value != 0 || s.HasField("fixed32_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed32_value") + s.WriteUint32(x.Fixed32Value) + } + if len(x.Fixed32Values) > 0 || s.HasField("fixed32_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed32_values") + s.WriteUint32Array(x.Fixed32Values) + } + if x.Fixed64Value != 0 || s.HasField("fixed64_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed64_value") + s.WriteUint64(x.Fixed64Value) + } + if len(x.Fixed64Values) > 0 || s.HasField("fixed64_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed64_values") + s.WriteUint64Array(x.Fixed64Values) + } + if x.Sfixed32Value != 0 || s.HasField("sfixed32_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed32_value") + s.WriteInt32(x.Sfixed32Value) + } + if len(x.Sfixed32Values) > 0 || s.HasField("sfixed32_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed32_values") + s.WriteInt32Array(x.Sfixed32Values) + } + if x.Sfixed64Value != 0 || s.HasField("sfixed64_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed64_value") + s.WriteInt64(x.Sfixed64Value) + } + if len(x.Sfixed64Values) > 0 || s.HasField("sfixed64_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed64_values") + s.WriteInt64Array(x.Sfixed64Values) + } + if x.BoolValue || s.HasField("bool_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bool_value") + s.WriteBool(x.BoolValue) + } + if len(x.BoolValues) > 0 || s.HasField("bool_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bool_values") + s.WriteBoolArray(x.BoolValues) + } + if x.StringValue != "" || s.HasField("string_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_value") + s.WriteString(x.StringValue) + } + if len(x.StringValues) > 0 || s.HasField("string_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_values") + s.WriteStringArray(x.StringValues) + } + if len(x.BytesValue) > 0 || s.HasField("bytes_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bytes_value") + s.WriteBytes(x.BytesValue) + } + if len(x.BytesValues) > 0 || s.HasField("bytes_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bytes_values") + s.WriteBytesArray(x.BytesValues) + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithScalars message from JSON. +func (x *MessageWithScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "double_value", "doubleValue": + s.AddField("double_value") + x.DoubleValue = s.ReadFloat64() + case "double_values", "doubleValues": + s.AddField("double_values") + x.DoubleValues = s.ReadFloat64Array() + case "float_value", "floatValue": + s.AddField("float_value") + x.FloatValue = s.ReadFloat32() + case "float_values", "floatValues": + s.AddField("float_values") + x.FloatValues = s.ReadFloat32Array() + case "int32_value", "int32Value": + s.AddField("int32_value") + x.Int32Value = s.ReadInt32() + case "int32_values", "int32Values": + s.AddField("int32_values") + x.Int32Values = s.ReadInt32Array() + case "int64_value", "int64Value": + s.AddField("int64_value") + x.Int64Value = s.ReadInt64() + case "int64_values", "int64Values": + s.AddField("int64_values") + x.Int64Values = s.ReadInt64Array() + case "uint32_value", "uint32Value": + s.AddField("uint32_value") + x.Uint32Value = s.ReadUint32() + case "uint32_values", "uint32Values": + s.AddField("uint32_values") + x.Uint32Values = s.ReadUint32Array() + case "uint64_value", "uint64Value": + s.AddField("uint64_value") + x.Uint64Value = s.ReadUint64() + case "uint64_values", "uint64Values": + s.AddField("uint64_values") + x.Uint64Values = s.ReadUint64Array() + case "sint32_value", "sint32Value": + s.AddField("sint32_value") + x.Sint32Value = s.ReadInt32() + case "sint32_values", "sint32Values": + s.AddField("sint32_values") + x.Sint32Values = s.ReadInt32Array() + case "sint64_value", "sint64Value": + s.AddField("sint64_value") + x.Sint64Value = s.ReadInt64() + case "sint64_values", "sint64Values": + s.AddField("sint64_values") + x.Sint64Values = s.ReadInt64Array() + case "fixed32_value", "fixed32Value": + s.AddField("fixed32_value") + x.Fixed32Value = s.ReadUint32() + case "fixed32_values", "fixed32Values": + s.AddField("fixed32_values") + x.Fixed32Values = s.ReadUint32Array() + case "fixed64_value", "fixed64Value": + s.AddField("fixed64_value") + x.Fixed64Value = s.ReadUint64() + case "fixed64_values", "fixed64Values": + s.AddField("fixed64_values") + x.Fixed64Values = s.ReadUint64Array() + case "sfixed32_value", "sfixed32Value": + s.AddField("sfixed32_value") + x.Sfixed32Value = s.ReadInt32() + case "sfixed32_values", "sfixed32Values": + s.AddField("sfixed32_values") + x.Sfixed32Values = s.ReadInt32Array() + case "sfixed64_value", "sfixed64Value": + s.AddField("sfixed64_value") + x.Sfixed64Value = s.ReadInt64() + case "sfixed64_values", "sfixed64Values": + s.AddField("sfixed64_values") + x.Sfixed64Values = s.ReadInt64Array() + case "bool_value", "boolValue": + s.AddField("bool_value") + x.BoolValue = s.ReadBool() + case "bool_values", "boolValues": + s.AddField("bool_values") + x.BoolValues = s.ReadBoolArray() + case "string_value", "stringValue": + s.AddField("string_value") + x.StringValue = s.ReadString() + case "string_values", "stringValues": + s.AddField("string_values") + x.StringValues = s.ReadStringArray() + case "bytes_value", "bytesValue": + s.AddField("bytes_value") + x.BytesValue = s.ReadBytes() + case "bytes_values", "bytesValues": + s.AddField("bytes_values") + x.BytesValues = s.ReadBytesArray() + } + }) +} + +// MarshalProtoJSON marshals the MessageWithOneofScalars message to JSON. +func (x *MessageWithOneofScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Value != nil { + switch ov := x.Value.(type) { + case *MessageWithOneofScalars_DoubleValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("double_value") + s.WriteFloat64(ov.DoubleValue) + case *MessageWithOneofScalars_FloatValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("float_value") + s.WriteFloat32(ov.FloatValue) + case *MessageWithOneofScalars_Int32Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int32_value") + s.WriteInt32(ov.Int32Value) + case *MessageWithOneofScalars_Int64Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int64_value") + s.WriteInt64(ov.Int64Value) + case *MessageWithOneofScalars_Uint32Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint32_value") + s.WriteUint32(ov.Uint32Value) + case *MessageWithOneofScalars_Uint64Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint64_value") + s.WriteUint64(ov.Uint64Value) + case *MessageWithOneofScalars_Sint32Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint32_value") + s.WriteInt32(ov.Sint32Value) + case *MessageWithOneofScalars_Sint64Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint64_value") + s.WriteInt64(ov.Sint64Value) + case *MessageWithOneofScalars_Fixed32Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed32_value") + s.WriteUint32(ov.Fixed32Value) + case *MessageWithOneofScalars_Fixed64Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed64_value") + s.WriteUint64(ov.Fixed64Value) + case *MessageWithOneofScalars_Sfixed32Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed32_value") + s.WriteInt32(ov.Sfixed32Value) + case *MessageWithOneofScalars_Sfixed64Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed64_value") + s.WriteInt64(ov.Sfixed64Value) + case *MessageWithOneofScalars_BoolValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bool_value") + s.WriteBool(ov.BoolValue) + case *MessageWithOneofScalars_StringValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_value") + s.WriteString(ov.StringValue) + case *MessageWithOneofScalars_BytesValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bytes_value") + s.WriteBytes(ov.BytesValue) + } + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithOneofScalars message from JSON. +func (x *MessageWithOneofScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "double_value", "doubleValue": + s.AddField("double_value") + ov := &MessageWithOneofScalars_DoubleValue{} + ov.DoubleValue = s.ReadFloat64() + x.Value = ov + case "float_value", "floatValue": + s.AddField("float_value") + ov := &MessageWithOneofScalars_FloatValue{} + ov.FloatValue = s.ReadFloat32() + x.Value = ov + case "int32_value", "int32Value": + s.AddField("int32_value") + ov := &MessageWithOneofScalars_Int32Value{} + ov.Int32Value = s.ReadInt32() + x.Value = ov + case "int64_value", "int64Value": + s.AddField("int64_value") + ov := &MessageWithOneofScalars_Int64Value{} + ov.Int64Value = s.ReadInt64() + x.Value = ov + case "uint32_value", "uint32Value": + s.AddField("uint32_value") + ov := &MessageWithOneofScalars_Uint32Value{} + ov.Uint32Value = s.ReadUint32() + x.Value = ov + case "uint64_value", "uint64Value": + s.AddField("uint64_value") + ov := &MessageWithOneofScalars_Uint64Value{} + ov.Uint64Value = s.ReadUint64() + x.Value = ov + case "sint32_value", "sint32Value": + s.AddField("sint32_value") + ov := &MessageWithOneofScalars_Sint32Value{} + ov.Sint32Value = s.ReadInt32() + x.Value = ov + case "sint64_value", "sint64Value": + s.AddField("sint64_value") + ov := &MessageWithOneofScalars_Sint64Value{} + ov.Sint64Value = s.ReadInt64() + x.Value = ov + case "fixed32_value", "fixed32Value": + s.AddField("fixed32_value") + ov := &MessageWithOneofScalars_Fixed32Value{} + ov.Fixed32Value = s.ReadUint32() + x.Value = ov + case "fixed64_value", "fixed64Value": + s.AddField("fixed64_value") + ov := &MessageWithOneofScalars_Fixed64Value{} + ov.Fixed64Value = s.ReadUint64() + x.Value = ov + case "sfixed32_value", "sfixed32Value": + s.AddField("sfixed32_value") + ov := &MessageWithOneofScalars_Sfixed32Value{} + ov.Sfixed32Value = s.ReadInt32() + x.Value = ov + case "sfixed64_value", "sfixed64Value": + s.AddField("sfixed64_value") + ov := &MessageWithOneofScalars_Sfixed64Value{} + ov.Sfixed64Value = s.ReadInt64() + x.Value = ov + case "bool_value", "boolValue": + s.AddField("bool_value") + ov := &MessageWithOneofScalars_BoolValue{} + ov.BoolValue = s.ReadBool() + x.Value = ov + case "string_value", "stringValue": + s.AddField("string_value") + ov := &MessageWithOneofScalars_StringValue{} + ov.StringValue = s.ReadString() + x.Value = ov + case "bytes_value", "bytesValue": + s.AddField("bytes_value") + ov := &MessageWithOneofScalars_BytesValue{} + ov.BytesValue = s.ReadBytes() + x.Value = ov + } + }) +} + +// MarshalProtoJSON marshals the MessageWithScalarMaps message to JSON. +func (x *MessageWithScalarMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.StringDoubleMap != nil || s.HasField("string_double_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_double_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringDoubleMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteFloat64(v) + } + s.WriteObjectEnd() + } + if x.StringFloatMap != nil || s.HasField("string_float_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_float_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringFloatMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteFloat32(v) + } + s.WriteObjectEnd() + } + if x.StringInt32Map != nil || s.HasField("string_int32_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_int32_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringInt32Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteInt32(v) + } + s.WriteObjectEnd() + } + if x.Int32StringMap != nil || s.HasField("int32_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int32_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Int32StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectInt32Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringInt64Map != nil || s.HasField("string_int64_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_int64_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringInt64Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteInt64(v) + } + s.WriteObjectEnd() + } + if x.Int64StringMap != nil || s.HasField("int64_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int64_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Int64StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectInt64Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringUint32Map != nil || s.HasField("string_uint32_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_uint32_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringUint32Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteUint32(v) + } + s.WriteObjectEnd() + } + if x.Uint32StringMap != nil || s.HasField("uint32_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint32_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Uint32StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectUint32Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringUint64Map != nil || s.HasField("string_uint64_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_uint64_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringUint64Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteUint64(v) + } + s.WriteObjectEnd() + } + if x.Uint64StringMap != nil || s.HasField("uint64_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint64_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Uint64StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectUint64Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringSint32Map != nil || s.HasField("string_sint32_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_sint32_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringSint32Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteInt32(v) + } + s.WriteObjectEnd() + } + if x.Sint32StringMap != nil || s.HasField("sint32_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint32_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Sint32StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectInt32Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringSint64Map != nil || s.HasField("string_sint64_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_sint64_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringSint64Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteInt64(v) + } + s.WriteObjectEnd() + } + if x.Sint64StringMap != nil || s.HasField("sint64_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint64_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Sint64StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectInt64Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringFixed32Map != nil || s.HasField("string_fixed32_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_fixed32_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringFixed32Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteUint32(v) + } + s.WriteObjectEnd() + } + if x.Fixed32StringMap != nil || s.HasField("fixed32_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed32_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Fixed32StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectUint32Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringFixed64Map != nil || s.HasField("string_fixed64_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_fixed64_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringFixed64Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteUint64(v) + } + s.WriteObjectEnd() + } + if x.Fixed64StringMap != nil || s.HasField("fixed64_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed64_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Fixed64StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectUint64Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringSfixed32Map != nil || s.HasField("string_sfixed32_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_sfixed32_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringSfixed32Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteInt32(v) + } + s.WriteObjectEnd() + } + if x.Sfixed32StringMap != nil || s.HasField("sfixed32_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed32_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Sfixed32StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectInt32Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringSfixed64Map != nil || s.HasField("string_sfixed64_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_sfixed64_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringSfixed64Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteInt64(v) + } + s.WriteObjectEnd() + } + if x.Sfixed64StringMap != nil || s.HasField("sfixed64_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed64_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Sfixed64StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectInt64Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringBoolMap != nil || s.HasField("string_bool_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_bool_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringBoolMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteBool(v) + } + s.WriteObjectEnd() + } + if x.BoolStringMap != nil || s.HasField("bool_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bool_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.BoolStringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectBoolField(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringStringMap != nil || s.HasField("string_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringStringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringBytesMap != nil || s.HasField("string_bytes_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_bytes_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringBytesMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteBytes(v) + } + s.WriteObjectEnd() + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithScalarMaps message from JSON. +func (x *MessageWithScalarMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "string_double_map", "stringDoubleMap": + s.AddField("string_double_map") + x.StringDoubleMap = make(map[string]float64) + s.ReadStringMap(func(key string) { + x.StringDoubleMap[key] = s.ReadFloat64() + }) + case "string_float_map", "stringFloatMap": + s.AddField("string_float_map") + x.StringFloatMap = make(map[string]float32) + s.ReadStringMap(func(key string) { + x.StringFloatMap[key] = s.ReadFloat32() + }) + case "string_int32_map", "stringInt32Map": + s.AddField("string_int32_map") + x.StringInt32Map = make(map[string]int32) + s.ReadStringMap(func(key string) { + x.StringInt32Map[key] = s.ReadInt32() + }) + case "int32_string_map", "int32StringMap": + s.AddField("int32_string_map") + x.Int32StringMap = make(map[int32]string) + s.ReadInt32Map(func(key int32) { + x.Int32StringMap[key] = s.ReadString() + }) + case "string_int64_map", "stringInt64Map": + s.AddField("string_int64_map") + x.StringInt64Map = make(map[string]int64) + s.ReadStringMap(func(key string) { + x.StringInt64Map[key] = s.ReadInt64() + }) + case "int64_string_map", "int64StringMap": + s.AddField("int64_string_map") + x.Int64StringMap = make(map[int64]string) + s.ReadInt64Map(func(key int64) { + x.Int64StringMap[key] = s.ReadString() + }) + case "string_uint32_map", "stringUint32Map": + s.AddField("string_uint32_map") + x.StringUint32Map = make(map[string]uint32) + s.ReadStringMap(func(key string) { + x.StringUint32Map[key] = s.ReadUint32() + }) + case "uint32_string_map", "uint32StringMap": + s.AddField("uint32_string_map") + x.Uint32StringMap = make(map[uint32]string) + s.ReadUint32Map(func(key uint32) { + x.Uint32StringMap[key] = s.ReadString() + }) + case "string_uint64_map", "stringUint64Map": + s.AddField("string_uint64_map") + x.StringUint64Map = make(map[string]uint64) + s.ReadStringMap(func(key string) { + x.StringUint64Map[key] = s.ReadUint64() + }) + case "uint64_string_map", "uint64StringMap": + s.AddField("uint64_string_map") + x.Uint64StringMap = make(map[uint64]string) + s.ReadUint64Map(func(key uint64) { + x.Uint64StringMap[key] = s.ReadString() + }) + case "string_sint32_map", "stringSint32Map": + s.AddField("string_sint32_map") + x.StringSint32Map = make(map[string]int32) + s.ReadStringMap(func(key string) { + x.StringSint32Map[key] = s.ReadInt32() + }) + case "sint32_string_map", "sint32StringMap": + s.AddField("sint32_string_map") + x.Sint32StringMap = make(map[int32]string) + s.ReadInt32Map(func(key int32) { + x.Sint32StringMap[key] = s.ReadString() + }) + case "string_sint64_map", "stringSint64Map": + s.AddField("string_sint64_map") + x.StringSint64Map = make(map[string]int64) + s.ReadStringMap(func(key string) { + x.StringSint64Map[key] = s.ReadInt64() + }) + case "sint64_string_map", "sint64StringMap": + s.AddField("sint64_string_map") + x.Sint64StringMap = make(map[int64]string) + s.ReadInt64Map(func(key int64) { + x.Sint64StringMap[key] = s.ReadString() + }) + case "string_fixed32_map", "stringFixed32Map": + s.AddField("string_fixed32_map") + x.StringFixed32Map = make(map[string]uint32) + s.ReadStringMap(func(key string) { + x.StringFixed32Map[key] = s.ReadUint32() + }) + case "fixed32_string_map", "fixed32StringMap": + s.AddField("fixed32_string_map") + x.Fixed32StringMap = make(map[uint32]string) + s.ReadUint32Map(func(key uint32) { + x.Fixed32StringMap[key] = s.ReadString() + }) + case "string_fixed64_map", "stringFixed64Map": + s.AddField("string_fixed64_map") + x.StringFixed64Map = make(map[string]uint64) + s.ReadStringMap(func(key string) { + x.StringFixed64Map[key] = s.ReadUint64() + }) + case "fixed64_string_map", "fixed64StringMap": + s.AddField("fixed64_string_map") + x.Fixed64StringMap = make(map[uint64]string) + s.ReadUint64Map(func(key uint64) { + x.Fixed64StringMap[key] = s.ReadString() + }) + case "string_sfixed32_map", "stringSfixed32Map": + s.AddField("string_sfixed32_map") + x.StringSfixed32Map = make(map[string]int32) + s.ReadStringMap(func(key string) { + x.StringSfixed32Map[key] = s.ReadInt32() + }) + case "sfixed32_string_map", "sfixed32StringMap": + s.AddField("sfixed32_string_map") + x.Sfixed32StringMap = make(map[int32]string) + s.ReadInt32Map(func(key int32) { + x.Sfixed32StringMap[key] = s.ReadString() + }) + case "string_sfixed64_map", "stringSfixed64Map": + s.AddField("string_sfixed64_map") + x.StringSfixed64Map = make(map[string]int64) + s.ReadStringMap(func(key string) { + x.StringSfixed64Map[key] = s.ReadInt64() + }) + case "sfixed64_string_map", "sfixed64StringMap": + s.AddField("sfixed64_string_map") + x.Sfixed64StringMap = make(map[int64]string) + s.ReadInt64Map(func(key int64) { + x.Sfixed64StringMap[key] = s.ReadString() + }) + case "string_bool_map", "stringBoolMap": + s.AddField("string_bool_map") + x.StringBoolMap = make(map[string]bool) + s.ReadStringMap(func(key string) { + x.StringBoolMap[key] = s.ReadBool() + }) + case "bool_string_map", "boolStringMap": + s.AddField("bool_string_map") + x.BoolStringMap = make(map[bool]string) + s.ReadBoolMap(func(key bool) { + x.BoolStringMap[key] = s.ReadString() + }) + case "string_string_map", "stringStringMap": + s.AddField("string_string_map") + x.StringStringMap = make(map[string]string) + s.ReadStringMap(func(key string) { + x.StringStringMap[key] = s.ReadString() + }) + case "string_bytes_map", "stringBytesMap": + s.AddField("string_bytes_map") + x.StringBytesMap = make(map[string][]byte) + s.ReadStringMap(func(key string) { + x.StringBytesMap[key] = s.ReadBytes() + }) + } + }) +} diff --git a/test/gogo/scalars_test.go b/test/gogo/scalars_test.go new file mode 100644 index 00000000..b71c6dc0 --- /dev/null +++ b/test/gogo/scalars_test.go @@ -0,0 +1,598 @@ +package test_test + +import ( + "testing" + + . "github.com/TheThingsIndustries/protoc-gen-go-json/test/gogo" +) + +var testMessagesWithScalars = []struct { + name string + msg MessageWithScalars + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithScalars{}, + expected: `{}`, + }, + { + name: "zero", + msg: MessageWithScalars{}, + expected: `{ + "double_value": 0, + "double_values": [], + "float_value": 0, + "float_values": [], + "int32_value": 0, + "int32_values": [], + "int64_value": "0", + "int64_values": [], + "uint32_value": 0, + "uint32_values": [], + "uint64_value": "0", + "uint64_values": [], + "sint32_value": 0, + "sint32_values": [], + "sint64_value": "0", + "sint64_values": [], + "fixed32_value": 0, + "fixed32_values": [], + "fixed64_value": "0", + "fixed64_values": [], + "sfixed32_value": 0, + "sfixed32_values": [], + "sfixed64_value": "0", + "sfixed64_values": [], + "bool_value": false, + "bool_values": [], + "string_value": "", + "string_values": [], + "bytes_value": null, + "bytes_values": [] + }`, + expectedMask: []string{ + "double_value", + "double_values", + "float_value", + "float_values", + "int32_value", + "int32_values", + "int64_value", + "int64_values", + "uint32_value", + "uint32_values", + "uint64_value", + "uint64_values", + "sint32_value", + "sint32_values", + "sint64_value", + "sint64_values", + "fixed32_value", + "fixed32_values", + "fixed64_value", + "fixed64_values", + "sfixed32_value", + "sfixed32_values", + "sfixed64_value", + "sfixed64_values", + "bool_value", + "bool_values", + "string_value", + "string_values", + "bytes_value", + "bytes_values", + }, + }, + { + name: "full", + msg: MessageWithScalars{ + DoubleValue: 12.34, + DoubleValues: []float64{12.34, 56.78}, + FloatValue: 12.34, + FloatValues: []float32{12.34, 56.78}, + Int32Value: -42, + Int32Values: []int32{1, 2, -42}, + Int64Value: -42, + Int64Values: []int64{1, 2, -42}, + Uint32Value: 42, + Uint32Values: []uint32{1, 2, 42}, + Uint64Value: 42, + Uint64Values: []uint64{1, 2, 42}, + Sint32Value: -42, + Sint32Values: []int32{1, 2, -42}, + Sint64Value: -42, + Sint64Values: []int64{1, 2, -42}, + Fixed32Value: 42, + Fixed32Values: []uint32{1, 2, 42}, + Fixed64Value: 42, + Fixed64Values: []uint64{1, 2, 42}, + Sfixed32Value: -42, + Sfixed32Values: []int32{1, 2, -42}, + Sfixed64Value: -42, + Sfixed64Values: []int64{1, 2, -42}, + BoolValue: true, + BoolValues: []bool{true, false}, + StringValue: "foo", + StringValues: []string{"foo", "bar"}, + BytesValue: []byte("foo"), + BytesValues: [][]byte{[]byte("foo"), []byte("bar")}, + }, + expected: `{ + "double_value": 12.34, + "double_values": [12.34, 56.78], + "float_value": 12.34, + "float_values": [12.34, 56.78], + "int32_value": -42, + "int32_values": [1, 2, -42], + "int64_value": "-42", + "int64_values": ["1", "2", "-42"], + "uint32_value": 42, + "uint32_values": [1, 2, 42], + "uint64_value": "42", + "uint64_values": ["1", "2", "42"], + "sint32_value": -42, + "sint32_values": [1, 2, -42], + "sint64_value": "-42", + "sint64_values": ["1", "2", "-42"], + "fixed32_value": 42, + "fixed32_values": [1, 2, 42], + "fixed64_value": "42", + "fixed64_values": ["1", "2", "42"], + "sfixed32_value": -42, + "sfixed32_values": [1, 2, -42], + "sfixed64_value": "-42", + "sfixed64_values": ["1", "2", "-42"], + "bool_value": true, + "bool_values": [true, false], + "string_value": "foo", + "string_values": ["foo", "bar"], + "bytes_value": "Zm9v", + "bytes_values": ["Zm9v", "YmFy"] + }`, + expectedMask: []string{ + "double_value", + "double_values", + "float_value", + "float_values", + "int32_value", + "int32_values", + "int64_value", + "int64_values", + "uint32_value", + "uint32_values", + "uint64_value", + "uint64_values", + "sint32_value", + "sint32_values", + "sint64_value", + "sint64_values", + "fixed32_value", + "fixed32_values", + "fixed64_value", + "fixed64_values", + "sfixed32_value", + "sfixed32_values", + "sfixed64_value", + "sfixed64_values", + "bool_value", + "bool_values", + "string_value", + "string_values", + "bytes_value", + "bytes_values", + }, + }, +} + +func TestMarshalMessageWithScalars(t *testing.T) { + for _, tt := range testMessagesWithScalars { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithScalars(t *testing.T) { + for _, tt := range testMessagesWithScalars { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithOneofScalars = []struct { + name string + msg MessageWithOneofScalars + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithOneofScalars{}, + expected: `{}`, + }, + { + name: "double_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_DoubleValue{}, + }, + expected: `{"double_value": 0}`, + expectedMask: []string{"double_value"}, + }, + { + name: "double_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_DoubleValue{DoubleValue: 12.34}, + }, + expected: `{"double_value": 12.34}`, + expectedMask: []string{"double_value"}, + }, + { + name: "float_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_FloatValue{}, + }, + expected: `{"float_value": 0}`, + expectedMask: []string{"float_value"}, + }, + { + name: "float_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_FloatValue{FloatValue: 12.34}, + }, + expected: `{"float_value": 12.34}`, + expectedMask: []string{"float_value"}, + }, + { + name: "int32_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Int32Value{}, + }, + expected: `{"int32_value": 0}`, + expectedMask: []string{"int32_value"}, + }, + { + name: "int32_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Int32Value{Int32Value: -42}, + }, + expected: `{"int32_value": -42}`, + expectedMask: []string{"int32_value"}, + }, + { + name: "int64_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Int64Value{}, + }, + expected: `{"int64_value": "0"}`, + expectedMask: []string{"int64_value"}, + }, + { + name: "int64_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Int64Value{Int64Value: -42}, + }, + expected: `{"int64_value": "-42"}`, + expectedMask: []string{"int64_value"}, + }, + { + name: "uint32_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Uint32Value{}, + }, + expected: `{"uint32_value": 0}`, + expectedMask: []string{"uint32_value"}, + }, + { + name: "uint32_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Uint32Value{Uint32Value: 42}, + }, + expected: `{"uint32_value": 42}`, + expectedMask: []string{"uint32_value"}, + }, + { + name: "uint64_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Uint64Value{}, + }, + expected: `{"uint64_value": "0"}`, + expectedMask: []string{"uint64_value"}, + }, + { + name: "uint64_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Uint64Value{Uint64Value: 42}, + }, + expected: `{"uint64_value": "42"}`, + expectedMask: []string{"uint64_value"}, + }, + { + name: "sint32_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sint32Value{}, + }, + expected: `{"sint32_value": 0}`, + expectedMask: []string{"sint32_value"}, + }, + { + name: "sint32_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sint32Value{Sint32Value: -42}, + }, + expected: `{"sint32_value": -42}`, + expectedMask: []string{"sint32_value"}, + }, + { + name: "sint64_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sint64Value{}, + }, + expected: `{"sint64_value": "0"}`, + expectedMask: []string{"sint64_value"}, + }, + { + name: "sint64_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sint64Value{Sint64Value: -42}, + }, + expected: `{"sint64_value": "-42"}`, + expectedMask: []string{"sint64_value"}, + }, + { + name: "fixed32_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Fixed32Value{}, + }, + expected: `{"fixed32_value": 0}`, + expectedMask: []string{"fixed32_value"}, + }, + { + name: "fixed32_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Fixed32Value{Fixed32Value: 42}, + }, + expected: `{"fixed32_value": 42}`, + expectedMask: []string{"fixed32_value"}, + }, + { + name: "fixed64_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Fixed64Value{}, + }, + expected: `{"fixed64_value": "0"}`, + expectedMask: []string{"fixed64_value"}, + }, + { + name: "fixed64_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Fixed64Value{Fixed64Value: 42}, + }, + expected: `{"fixed64_value": "42"}`, + expectedMask: []string{"fixed64_value"}, + }, + + { + name: "sfixed32_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sfixed32Value{}, + }, + expected: `{"sfixed32_value": 0}`, + expectedMask: []string{"sfixed32_value"}, + }, + { + name: "sfixed32_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sfixed32Value{Sfixed32Value: -42}, + }, + expected: `{"sfixed32_value": -42}`, + expectedMask: []string{"sfixed32_value"}, + }, + { + name: "sfixed64_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sfixed64Value{}, + }, + expected: `{"sfixed64_value": "0"}`, + expectedMask: []string{"sfixed64_value"}, + }, + { + name: "sfixed64_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sfixed64Value{Sfixed64Value: -42}, + }, + expected: `{"sfixed64_value": "-42"}`, + expectedMask: []string{"sfixed64_value"}, + }, + + { + name: "bool_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_BoolValue{}, + }, + expected: `{"bool_value": false}`, + expectedMask: []string{"bool_value"}, + }, + { + name: "bool_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_BoolValue{BoolValue: true}, + }, + expected: `{"bool_value": true}`, + expectedMask: []string{"bool_value"}, + }, + { + name: "string_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_StringValue{}, + }, + expected: `{"string_value": ""}`, + expectedMask: []string{"string_value"}, + }, + { + name: "string_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_StringValue{StringValue: "foo"}, + }, + expected: `{"string_value": "foo"}`, + expectedMask: []string{"string_value"}, + }, + { + name: "bytes_null", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_BytesValue{}, + }, + expected: `{"bytes_value": null}`, + expectedMask: []string{"bytes_value"}, + }, + { + name: "bytes_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_BytesValue{BytesValue: []byte{}}, + }, + expected: `{"bytes_value": ""}`, + expectedMask: []string{"bytes_value"}, + }, + { + name: "bytes_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_BytesValue{BytesValue: []byte("foo")}, + }, + expected: `{"bytes_value": "Zm9v"}`, + expectedMask: []string{"bytes_value"}, + }, +} + +func TestMarshalMessageWithOneofScalars(t *testing.T) { + for _, tt := range testMessagesWithOneofScalars { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithOneofScalars(t *testing.T) { + for _, tt := range testMessagesWithOneofScalars { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithScalarMaps = []struct { + name string + msg MessageWithScalarMaps + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithScalarMaps{}, + expected: `{}`, + }, + { + name: "full", + msg: MessageWithScalarMaps{ + StringDoubleMap: map[string]float64{"value": -42}, + StringFloatMap: map[string]float32{"value": -42}, + StringInt32Map: map[string]int32{"value": -42}, + Int32StringMap: map[int32]string{-42: "answer"}, + StringInt64Map: map[string]int64{"value": -42}, + Int64StringMap: map[int64]string{-42: "answer"}, + StringUint32Map: map[string]uint32{"value": 42}, + Uint32StringMap: map[uint32]string{42: "answer"}, + StringUint64Map: map[string]uint64{"value": 42}, + Uint64StringMap: map[uint64]string{42: "answer"}, + StringSint32Map: map[string]int32{"value": -42}, + Sint32StringMap: map[int32]string{-42: "answer"}, + StringSint64Map: map[string]int64{"value": -42}, + Sint64StringMap: map[int64]string{-42: "answer"}, + StringFixed32Map: map[string]uint32{"value": 42}, + Fixed32StringMap: map[uint32]string{42: "answer"}, + StringFixed64Map: map[string]uint64{"value": 42}, + Fixed64StringMap: map[uint64]string{42: "answer"}, + StringSfixed32Map: map[string]int32{"value": -42}, + Sfixed32StringMap: map[int32]string{-42: "answer"}, + StringSfixed64Map: map[string]int64{"value": -42}, + Sfixed64StringMap: map[int64]string{-42: "answer"}, + StringBoolMap: map[string]bool{"yes": true}, + BoolStringMap: map[bool]string{true: "yes"}, + StringStringMap: map[string]string{"value": "foo"}, + StringBytesMap: map[string][]byte{"value": []byte("foo")}, + }, + expected: `{ + "string_double_map": {"value": -42}, + "string_float_map": {"value": -42}, + "string_int32_map": {"value": -42}, + "int32_string_map": {"-42": "answer"}, + "string_int64_map": {"value": "-42"}, + "int64_string_map": {"-42": "answer"}, + "string_uint32_map": {"value": 42}, + "uint32_string_map": {"42": "answer"}, + "string_uint64_map": {"value": "42"}, + "uint64_string_map": {"42": "answer"}, + "string_sint32_map": {"value": -42}, + "sint32_string_map": {"-42": "answer"}, + "string_sint64_map": {"value": "-42"}, + "sint64_string_map": {"-42": "answer"}, + "string_fixed32_map": {"value": 42}, + "fixed32_string_map": {"42": "answer"}, + "string_fixed64_map": {"value": "42"}, + "fixed64_string_map": {"42": "answer"}, + "string_sfixed32_map": {"value": -42}, + "sfixed32_string_map": {"-42": "answer"}, + "string_sfixed64_map": {"value": "-42"}, + "sfixed64_string_map": {"-42": "answer"}, + "string_bool_map": {"yes": true}, + "bool_string_map": {"true": "yes"}, + "string_string_map": {"value": "foo"}, + "string_bytes_map": {"value": "Zm9v"} + }`, + expectedMask: []string{ + "string_double_map", + "string_float_map", + "string_int32_map", + "int32_string_map", + "string_int64_map", + "int64_string_map", + "string_uint32_map", + "uint32_string_map", + "string_uint64_map", + "uint64_string_map", + "string_sint32_map", + "sint32_string_map", + "string_sint64_map", + "sint64_string_map", + "string_fixed32_map", + "fixed32_string_map", + "string_fixed64_map", + "fixed64_string_map", + "string_sfixed32_map", + "sfixed32_string_map", + "string_sfixed64_map", + "sfixed64_string_map", + "string_bool_map", + "bool_string_map", + "string_string_map", + "string_bytes_map", + }, + }, +} + +func TestMarshalMessageWithScalarMaps(t *testing.T) { + for _, tt := range testMessagesWithScalarMaps { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithScalarMaps(t *testing.T) { + for _, tt := range testMessagesWithScalarMaps { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} diff --git a/test/gogo/utils_test.go b/test/gogo/utils_test.go new file mode 100644 index 00000000..d88c144f --- /dev/null +++ b/test/gogo/utils_test.go @@ -0,0 +1,136 @@ +package test_test + +import ( + "bytes" + "encoding/json" + "reflect" + "testing" + + "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" + "github.com/gogo/protobuf/jsonpb" + proto "github.com/gogo/protobuf/proto" + "github.com/google/go-cmp/cmp" +) + +var gogoMarshaler = jsonpb.Marshaler{ + OrigName: true, + EnumsAsInts: true, +} + +func gogoMarshal(t *testing.T, msg proto.Message) []byte { + t.Helper() + var buf bytes.Buffer + if err := gogoMarshaler.Marshal(&buf, msg); err != nil { + t.Logf("gogo failed to marshal: %v", err) + } + return buf.Bytes() +} + +var gogoUnmarshaler = jsonpb.Unmarshaler{} + +func gogoUnmarshal(t *testing.T, msg proto.Message, data []byte) { + t.Helper() + buf := bytes.NewBuffer(data) + if err := gogoUnmarshaler.Unmarshal(buf, msg); err != nil { + t.Logf("gogo failed to unmarshal: %v", err) + } +} + +var pluginMarshaler = jsonplugin.MarshalerConfig{ + EnumsAsInts: true, +} + +func generatedMarshal(t *testing.T, msg proto.Message, mask []string) []byte { + t.Helper() + m, ok := msg.(jsonplugin.Marshaler) + if !ok { + t.Fatalf("message %T does not implement the jsonplugin.Marshaler", msg) + } + s := jsonplugin.NewMarshalState(pluginMarshaler).WithFieldMask(mask...) + m.MarshalProtoJSON(s) + b, err := s.Bytes() + if err != nil { + t.Fatalf("generated failed to marshal: %v", err) + } + return b +} + +func generatedUnmarshal(t *testing.T, msg proto.Message, data []byte) []string { + t.Helper() + unmarshaler, ok := msg.(jsonplugin.Unmarshaler) + if !ok { + t.Fatalf("message %T does not implement the jsonplugin.Unmarshaler", msg) + } + s := jsonplugin.NewUnmarshalState(data, jsonplugin.UnmarshalerConfig{}) + unmarshaler.UnmarshalProtoJSON(s) + if err := s.Err(); err != nil { + t.Fatalf("generated failed to unmarshal: %v", err) + } + paths := s.FieldMask().GetPaths() + if len(paths) == 0 { + return nil + } + return paths +} + +func indent(t *testing.T, data []byte) string { + t.Helper() + var buf bytes.Buffer + if err := json.Indent(&buf, data, "", " "); err != nil { + t.Fatalf("failed to indent %s: %v", string(data), err) + } + return buf.String() +} + +func expectMarshalEqual(t *testing.T, msg proto.Message, mask []string, expected []byte) { + t.Helper() + + expectedFormatted := indent(t, expected) + + gogoMarshaled := gogoMarshal(t, msg) + + generatedMarshaled := generatedMarshal(t, msg, mask) + generatedFormatted := indent(t, generatedMarshaled) + generatedDiff := cmp.Diff(expectedFormatted, generatedFormatted) + + if generatedDiff != "" { + t.Errorf("expected : %s", string(expected)) + t.Errorf("gogo : %s", string(gogoMarshaled)) + t.Errorf("generated: %s", string(generatedMarshaled)) + if generatedDiff != "" { + t.Errorf(" diff : %s", generatedDiff) + } + } +} + +func expectUnmarshalEqual(t *testing.T, msg proto.Message, expected []byte, expectedMask []string) { + t.Helper() + if msg == nil { + return + } + + expectedMsgText := proto.MarshalTextString(msg) + + gogoUnmarshaled := reflect.New(reflect.ValueOf(msg).Elem().Type()).Interface().(proto.Message) + gogoUnmarshal(t, gogoUnmarshaled, expected) + gogoMsgText := proto.MarshalTextString(gogoUnmarshaled) + + generatedUnmarshaled := reflect.New(reflect.ValueOf(msg).Elem().Type()).Interface().(proto.Message) + mask := generatedUnmarshal(t, generatedUnmarshaled, expected) + generatedMsgText := proto.MarshalTextString(generatedUnmarshaled) + generatedDiff := cmp.Diff(expectedMsgText, generatedMsgText) + maskDiff := cmp.Diff(expectedMask, mask) + + if generatedDiff != "" { + t.Errorf("expected : %s", string(expectedMsgText)) + t.Errorf("gogo : %s", string(gogoMsgText)) + t.Errorf("generated: %s", string(generatedMsgText)) + if generatedDiff != "" { + t.Errorf(" diff : %s", generatedDiff) + } + } + + if maskDiff != "" { + t.Errorf("mask diff: %s", maskDiff) + } +} diff --git a/test/gogo/wkts.pb.go b/test/gogo/wkts.pb.go new file mode 100644 index 00000000..4bdd4307 --- /dev/null +++ b/test/gogo/wkts.pb.go @@ -0,0 +1,972 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: wkts.proto + +package test + +import ( + fmt "fmt" + _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + 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 + +type MessageWithMarshaler struct { + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithMarshaler) Reset() { *m = MessageWithMarshaler{} } +func (m *MessageWithMarshaler) String() string { return proto.CompactTextString(m) } +func (*MessageWithMarshaler) ProtoMessage() {} +func (*MessageWithMarshaler) Descriptor() ([]byte, []int) { + return fileDescriptor_4f76f3479ade79d3, []int{0} +} +func (m *MessageWithMarshaler) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithMarshaler.Unmarshal(m, b) +} +func (m *MessageWithMarshaler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithMarshaler.Marshal(b, m, deterministic) +} +func (m *MessageWithMarshaler) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithMarshaler.Merge(m, src) +} +func (m *MessageWithMarshaler) XXX_Size() int { + return xxx_messageInfo_MessageWithMarshaler.Size(m) +} +func (m *MessageWithMarshaler) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithMarshaler.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithMarshaler proto.InternalMessageInfo + +func (m *MessageWithMarshaler) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +type MessageWithoutMarshaler struct { + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithoutMarshaler) Reset() { *m = MessageWithoutMarshaler{} } +func (m *MessageWithoutMarshaler) String() string { return proto.CompactTextString(m) } +func (*MessageWithoutMarshaler) ProtoMessage() {} +func (*MessageWithoutMarshaler) Descriptor() ([]byte, []int) { + return fileDescriptor_4f76f3479ade79d3, []int{1} +} +func (m *MessageWithoutMarshaler) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithoutMarshaler.Unmarshal(m, b) +} +func (m *MessageWithoutMarshaler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithoutMarshaler.Marshal(b, m, deterministic) +} +func (m *MessageWithoutMarshaler) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithoutMarshaler.Merge(m, src) +} +func (m *MessageWithoutMarshaler) XXX_Size() int { + return xxx_messageInfo_MessageWithoutMarshaler.Size(m) +} +func (m *MessageWithoutMarshaler) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithoutMarshaler.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithoutMarshaler proto.InternalMessageInfo + +func (m *MessageWithoutMarshaler) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +type MessageWithWKTs struct { + DoubleValue *types.DoubleValue `protobuf:"bytes,1,opt,name=double_value,json=doubleValue,proto3" json:"double_value,omitempty"` + DoubleValues []*types.DoubleValue `protobuf:"bytes,2,rep,name=double_values,json=doubleValues,proto3" json:"double_values,omitempty"` + FloatValue *types.FloatValue `protobuf:"bytes,3,opt,name=float_value,json=floatValue,proto3" json:"float_value,omitempty"` + FloatValues []*types.FloatValue `protobuf:"bytes,4,rep,name=float_values,json=floatValues,proto3" json:"float_values,omitempty"` + Int32Value *types.Int32Value `protobuf:"bytes,5,opt,name=int32_value,json=int32Value,proto3" json:"int32_value,omitempty"` + Int32Values []*types.Int32Value `protobuf:"bytes,6,rep,name=int32_values,json=int32Values,proto3" json:"int32_values,omitempty"` + Int64Value *types.Int64Value `protobuf:"bytes,7,opt,name=int64_value,json=int64Value,proto3" json:"int64_value,omitempty"` + Int64Values []*types.Int64Value `protobuf:"bytes,8,rep,name=int64_values,json=int64Values,proto3" json:"int64_values,omitempty"` + Uint32Value *types.UInt32Value `protobuf:"bytes,9,opt,name=uint32_value,json=uint32Value,proto3" json:"uint32_value,omitempty"` + Uint32Values []*types.UInt32Value `protobuf:"bytes,10,rep,name=uint32_values,json=uint32Values,proto3" json:"uint32_values,omitempty"` + Uint64Value *types.UInt64Value `protobuf:"bytes,11,opt,name=uint64_value,json=uint64Value,proto3" json:"uint64_value,omitempty"` + Uint64Values []*types.UInt64Value `protobuf:"bytes,12,rep,name=uint64_values,json=uint64Values,proto3" json:"uint64_values,omitempty"` + BoolValue *types.BoolValue `protobuf:"bytes,13,opt,name=bool_value,json=boolValue,proto3" json:"bool_value,omitempty"` + BoolValues []*types.BoolValue `protobuf:"bytes,14,rep,name=bool_values,json=boolValues,proto3" json:"bool_values,omitempty"` + StringValue *types.StringValue `protobuf:"bytes,15,opt,name=string_value,json=stringValue,proto3" json:"string_value,omitempty"` + StringValues []*types.StringValue `protobuf:"bytes,16,rep,name=string_values,json=stringValues,proto3" json:"string_values,omitempty"` + BytesValue *types.BytesValue `protobuf:"bytes,17,opt,name=bytes_value,json=bytesValue,proto3" json:"bytes_value,omitempty"` + BytesValues []*types.BytesValue `protobuf:"bytes,18,rep,name=bytes_values,json=bytesValues,proto3" json:"bytes_values,omitempty"` + EmptyValue *types.Empty `protobuf:"bytes,19,opt,name=empty_value,json=emptyValue,proto3" json:"empty_value,omitempty"` + EmptyValues []*types.Empty `protobuf:"bytes,20,rep,name=empty_values,json=emptyValues,proto3" json:"empty_values,omitempty"` + TimestampValue *types.Timestamp `protobuf:"bytes,21,opt,name=timestamp_value,json=timestampValue,proto3" json:"timestamp_value,omitempty"` + TimestampValues []*types.Timestamp `protobuf:"bytes,22,rep,name=timestamp_values,json=timestampValues,proto3" json:"timestamp_values,omitempty"` + DurationValue *types.Duration `protobuf:"bytes,23,opt,name=duration_value,json=durationValue,proto3" json:"duration_value,omitempty"` + DurationValues []*types.Duration `protobuf:"bytes,24,rep,name=duration_values,json=durationValues,proto3" json:"duration_values,omitempty"` + FieldMaskValue *types.FieldMask `protobuf:"bytes,25,opt,name=field_mask_value,json=fieldMaskValue,proto3" json:"field_mask_value,omitempty"` + FieldMaskValues []*types.FieldMask `protobuf:"bytes,26,rep,name=field_mask_values,json=fieldMaskValues,proto3" json:"field_mask_values,omitempty"` + ValueValue *types.Value `protobuf:"bytes,27,opt,name=value_value,json=valueValue,proto3" json:"value_value,omitempty"` + ValueValues []*types.Value `protobuf:"bytes,28,rep,name=value_values,json=valueValues,proto3" json:"value_values,omitempty"` + ListValueValue *types.ListValue `protobuf:"bytes,29,opt,name=list_value_value,json=listValueValue,proto3" json:"list_value_value,omitempty"` + ListValueValues []*types.ListValue `protobuf:"bytes,30,rep,name=list_value_values,json=listValueValues,proto3" json:"list_value_values,omitempty"` + StructValue *types.Struct `protobuf:"bytes,31,opt,name=struct_value,json=structValue,proto3" json:"struct_value,omitempty"` + StructValues []*types.Struct `protobuf:"bytes,32,rep,name=struct_values,json=structValues,proto3" json:"struct_values,omitempty"` + AnyValue *types.Any `protobuf:"bytes,33,opt,name=any_value,json=anyValue,proto3" json:"any_value,omitempty"` + AnyValues []*types.Any `protobuf:"bytes,34,rep,name=any_values,json=anyValues,proto3" json:"any_values,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithWKTs) Reset() { *m = MessageWithWKTs{} } +func (m *MessageWithWKTs) String() string { return proto.CompactTextString(m) } +func (*MessageWithWKTs) ProtoMessage() {} +func (*MessageWithWKTs) Descriptor() ([]byte, []int) { + return fileDescriptor_4f76f3479ade79d3, []int{2} +} +func (m *MessageWithWKTs) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithWKTs.Unmarshal(m, b) +} +func (m *MessageWithWKTs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithWKTs.Marshal(b, m, deterministic) +} +func (m *MessageWithWKTs) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithWKTs.Merge(m, src) +} +func (m *MessageWithWKTs) XXX_Size() int { + return xxx_messageInfo_MessageWithWKTs.Size(m) +} +func (m *MessageWithWKTs) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithWKTs.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithWKTs proto.InternalMessageInfo + +func (m *MessageWithWKTs) GetDoubleValue() *types.DoubleValue { + if m != nil { + return m.DoubleValue + } + return nil +} + +func (m *MessageWithWKTs) GetDoubleValues() []*types.DoubleValue { + if m != nil { + return m.DoubleValues + } + return nil +} + +func (m *MessageWithWKTs) GetFloatValue() *types.FloatValue { + if m != nil { + return m.FloatValue + } + return nil +} + +func (m *MessageWithWKTs) GetFloatValues() []*types.FloatValue { + if m != nil { + return m.FloatValues + } + return nil +} + +func (m *MessageWithWKTs) GetInt32Value() *types.Int32Value { + if m != nil { + return m.Int32Value + } + return nil +} + +func (m *MessageWithWKTs) GetInt32Values() []*types.Int32Value { + if m != nil { + return m.Int32Values + } + return nil +} + +func (m *MessageWithWKTs) GetInt64Value() *types.Int64Value { + if m != nil { + return m.Int64Value + } + return nil +} + +func (m *MessageWithWKTs) GetInt64Values() []*types.Int64Value { + if m != nil { + return m.Int64Values + } + return nil +} + +func (m *MessageWithWKTs) GetUint32Value() *types.UInt32Value { + if m != nil { + return m.Uint32Value + } + return nil +} + +func (m *MessageWithWKTs) GetUint32Values() []*types.UInt32Value { + if m != nil { + return m.Uint32Values + } + return nil +} + +func (m *MessageWithWKTs) GetUint64Value() *types.UInt64Value { + if m != nil { + return m.Uint64Value + } + return nil +} + +func (m *MessageWithWKTs) GetUint64Values() []*types.UInt64Value { + if m != nil { + return m.Uint64Values + } + return nil +} + +func (m *MessageWithWKTs) GetBoolValue() *types.BoolValue { + if m != nil { + return m.BoolValue + } + return nil +} + +func (m *MessageWithWKTs) GetBoolValues() []*types.BoolValue { + if m != nil { + return m.BoolValues + } + return nil +} + +func (m *MessageWithWKTs) GetStringValue() *types.StringValue { + if m != nil { + return m.StringValue + } + return nil +} + +func (m *MessageWithWKTs) GetStringValues() []*types.StringValue { + if m != nil { + return m.StringValues + } + return nil +} + +func (m *MessageWithWKTs) GetBytesValue() *types.BytesValue { + if m != nil { + return m.BytesValue + } + return nil +} + +func (m *MessageWithWKTs) GetBytesValues() []*types.BytesValue { + if m != nil { + return m.BytesValues + } + return nil +} + +func (m *MessageWithWKTs) GetEmptyValue() *types.Empty { + if m != nil { + return m.EmptyValue + } + return nil +} + +func (m *MessageWithWKTs) GetEmptyValues() []*types.Empty { + if m != nil { + return m.EmptyValues + } + return nil +} + +func (m *MessageWithWKTs) GetTimestampValue() *types.Timestamp { + if m != nil { + return m.TimestampValue + } + return nil +} + +func (m *MessageWithWKTs) GetTimestampValues() []*types.Timestamp { + if m != nil { + return m.TimestampValues + } + return nil +} + +func (m *MessageWithWKTs) GetDurationValue() *types.Duration { + if m != nil { + return m.DurationValue + } + return nil +} + +func (m *MessageWithWKTs) GetDurationValues() []*types.Duration { + if m != nil { + return m.DurationValues + } + return nil +} + +func (m *MessageWithWKTs) GetFieldMaskValue() *types.FieldMask { + if m != nil { + return m.FieldMaskValue + } + return nil +} + +func (m *MessageWithWKTs) GetFieldMaskValues() []*types.FieldMask { + if m != nil { + return m.FieldMaskValues + } + return nil +} + +func (m *MessageWithWKTs) GetValueValue() *types.Value { + if m != nil { + return m.ValueValue + } + return nil +} + +func (m *MessageWithWKTs) GetValueValues() []*types.Value { + if m != nil { + return m.ValueValues + } + return nil +} + +func (m *MessageWithWKTs) GetListValueValue() *types.ListValue { + if m != nil { + return m.ListValueValue + } + return nil +} + +func (m *MessageWithWKTs) GetListValueValues() []*types.ListValue { + if m != nil { + return m.ListValueValues + } + return nil +} + +func (m *MessageWithWKTs) GetStructValue() *types.Struct { + if m != nil { + return m.StructValue + } + return nil +} + +func (m *MessageWithWKTs) GetStructValues() []*types.Struct { + if m != nil { + return m.StructValues + } + return nil +} + +func (m *MessageWithWKTs) GetAnyValue() *types.Any { + if m != nil { + return m.AnyValue + } + return nil +} + +func (m *MessageWithWKTs) GetAnyValues() []*types.Any { + if m != nil { + return m.AnyValues + } + return nil +} + +type MessageWithOneofWKTs struct { + // Types that are valid to be assigned to Value: + // *MessageWithOneofWKTs_DoubleValue + // *MessageWithOneofWKTs_FloatValue + // *MessageWithOneofWKTs_Int32Value + // *MessageWithOneofWKTs_Int64Value + // *MessageWithOneofWKTs_Uint32Value + // *MessageWithOneofWKTs_Uint64Value + // *MessageWithOneofWKTs_BoolValue + // *MessageWithOneofWKTs_StringValue + // *MessageWithOneofWKTs_BytesValue + // *MessageWithOneofWKTs_EmptyValue + // *MessageWithOneofWKTs_TimestampValue + // *MessageWithOneofWKTs_DurationValue + // *MessageWithOneofWKTs_FieldMaskValue + // *MessageWithOneofWKTs_ValueValue + // *MessageWithOneofWKTs_ListValueValue + // *MessageWithOneofWKTs_StructValue + // *MessageWithOneofWKTs_AnyValue + Value isMessageWithOneofWKTs_Value `protobuf_oneof:"value"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithOneofWKTs) Reset() { *m = MessageWithOneofWKTs{} } +func (m *MessageWithOneofWKTs) String() string { return proto.CompactTextString(m) } +func (*MessageWithOneofWKTs) ProtoMessage() {} +func (*MessageWithOneofWKTs) Descriptor() ([]byte, []int) { + return fileDescriptor_4f76f3479ade79d3, []int{3} +} +func (m *MessageWithOneofWKTs) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithOneofWKTs.Unmarshal(m, b) +} +func (m *MessageWithOneofWKTs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithOneofWKTs.Marshal(b, m, deterministic) +} +func (m *MessageWithOneofWKTs) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithOneofWKTs.Merge(m, src) +} +func (m *MessageWithOneofWKTs) XXX_Size() int { + return xxx_messageInfo_MessageWithOneofWKTs.Size(m) +} +func (m *MessageWithOneofWKTs) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithOneofWKTs.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithOneofWKTs proto.InternalMessageInfo + +type isMessageWithOneofWKTs_Value interface { + isMessageWithOneofWKTs_Value() +} + +type MessageWithOneofWKTs_DoubleValue struct { + DoubleValue *types.DoubleValue `protobuf:"bytes,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` +} +type MessageWithOneofWKTs_FloatValue struct { + FloatValue *types.FloatValue `protobuf:"bytes,2,opt,name=float_value,json=floatValue,proto3,oneof" json:"float_value,omitempty"` +} +type MessageWithOneofWKTs_Int32Value struct { + Int32Value *types.Int32Value `protobuf:"bytes,3,opt,name=int32_value,json=int32Value,proto3,oneof" json:"int32_value,omitempty"` +} +type MessageWithOneofWKTs_Int64Value struct { + Int64Value *types.Int64Value `protobuf:"bytes,4,opt,name=int64_value,json=int64Value,proto3,oneof" json:"int64_value,omitempty"` +} +type MessageWithOneofWKTs_Uint32Value struct { + Uint32Value *types.UInt32Value `protobuf:"bytes,5,opt,name=uint32_value,json=uint32Value,proto3,oneof" json:"uint32_value,omitempty"` +} +type MessageWithOneofWKTs_Uint64Value struct { + Uint64Value *types.UInt64Value `protobuf:"bytes,6,opt,name=uint64_value,json=uint64Value,proto3,oneof" json:"uint64_value,omitempty"` +} +type MessageWithOneofWKTs_BoolValue struct { + BoolValue *types.BoolValue `protobuf:"bytes,7,opt,name=bool_value,json=boolValue,proto3,oneof" json:"bool_value,omitempty"` +} +type MessageWithOneofWKTs_StringValue struct { + StringValue *types.StringValue `protobuf:"bytes,8,opt,name=string_value,json=stringValue,proto3,oneof" json:"string_value,omitempty"` +} +type MessageWithOneofWKTs_BytesValue struct { + BytesValue *types.BytesValue `protobuf:"bytes,9,opt,name=bytes_value,json=bytesValue,proto3,oneof" json:"bytes_value,omitempty"` +} +type MessageWithOneofWKTs_EmptyValue struct { + EmptyValue *types.Empty `protobuf:"bytes,10,opt,name=empty_value,json=emptyValue,proto3,oneof" json:"empty_value,omitempty"` +} +type MessageWithOneofWKTs_TimestampValue struct { + TimestampValue *types.Timestamp `protobuf:"bytes,11,opt,name=timestamp_value,json=timestampValue,proto3,oneof" json:"timestamp_value,omitempty"` +} +type MessageWithOneofWKTs_DurationValue struct { + DurationValue *types.Duration `protobuf:"bytes,12,opt,name=duration_value,json=durationValue,proto3,oneof" json:"duration_value,omitempty"` +} +type MessageWithOneofWKTs_FieldMaskValue struct { + FieldMaskValue *types.FieldMask `protobuf:"bytes,13,opt,name=field_mask_value,json=fieldMaskValue,proto3,oneof" json:"field_mask_value,omitempty"` +} +type MessageWithOneofWKTs_ValueValue struct { + ValueValue *types.Value `protobuf:"bytes,14,opt,name=value_value,json=valueValue,proto3,oneof" json:"value_value,omitempty"` +} +type MessageWithOneofWKTs_ListValueValue struct { + ListValueValue *types.ListValue `protobuf:"bytes,15,opt,name=list_value_value,json=listValueValue,proto3,oneof" json:"list_value_value,omitempty"` +} +type MessageWithOneofWKTs_StructValue struct { + StructValue *types.Struct `protobuf:"bytes,16,opt,name=struct_value,json=structValue,proto3,oneof" json:"struct_value,omitempty"` +} +type MessageWithOneofWKTs_AnyValue struct { + AnyValue *types.Any `protobuf:"bytes,17,opt,name=any_value,json=anyValue,proto3,oneof" json:"any_value,omitempty"` +} + +func (*MessageWithOneofWKTs_DoubleValue) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_FloatValue) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_Int32Value) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_Int64Value) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_Uint32Value) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_Uint64Value) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_BoolValue) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_StringValue) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_BytesValue) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_EmptyValue) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_TimestampValue) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_DurationValue) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_FieldMaskValue) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_ValueValue) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_ListValueValue) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_StructValue) isMessageWithOneofWKTs_Value() {} +func (*MessageWithOneofWKTs_AnyValue) isMessageWithOneofWKTs_Value() {} + +func (m *MessageWithOneofWKTs) GetValue() isMessageWithOneofWKTs_Value { + if m != nil { + return m.Value + } + return nil +} + +func (m *MessageWithOneofWKTs) GetDoubleValue() *types.DoubleValue { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_DoubleValue); ok { + return x.DoubleValue + } + return nil +} + +func (m *MessageWithOneofWKTs) GetFloatValue() *types.FloatValue { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_FloatValue); ok { + return x.FloatValue + } + return nil +} + +func (m *MessageWithOneofWKTs) GetInt32Value() *types.Int32Value { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_Int32Value); ok { + return x.Int32Value + } + return nil +} + +func (m *MessageWithOneofWKTs) GetInt64Value() *types.Int64Value { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_Int64Value); ok { + return x.Int64Value + } + return nil +} + +func (m *MessageWithOneofWKTs) GetUint32Value() *types.UInt32Value { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_Uint32Value); ok { + return x.Uint32Value + } + return nil +} + +func (m *MessageWithOneofWKTs) GetUint64Value() *types.UInt64Value { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_Uint64Value); ok { + return x.Uint64Value + } + return nil +} + +func (m *MessageWithOneofWKTs) GetBoolValue() *types.BoolValue { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_BoolValue); ok { + return x.BoolValue + } + return nil +} + +func (m *MessageWithOneofWKTs) GetStringValue() *types.StringValue { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_StringValue); ok { + return x.StringValue + } + return nil +} + +func (m *MessageWithOneofWKTs) GetBytesValue() *types.BytesValue { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_BytesValue); ok { + return x.BytesValue + } + return nil +} + +func (m *MessageWithOneofWKTs) GetEmptyValue() *types.Empty { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_EmptyValue); ok { + return x.EmptyValue + } + return nil +} + +func (m *MessageWithOneofWKTs) GetTimestampValue() *types.Timestamp { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_TimestampValue); ok { + return x.TimestampValue + } + return nil +} + +func (m *MessageWithOneofWKTs) GetDurationValue() *types.Duration { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_DurationValue); ok { + return x.DurationValue + } + return nil +} + +func (m *MessageWithOneofWKTs) GetFieldMaskValue() *types.FieldMask { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_FieldMaskValue); ok { + return x.FieldMaskValue + } + return nil +} + +func (m *MessageWithOneofWKTs) GetValueValue() *types.Value { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_ValueValue); ok { + return x.ValueValue + } + return nil +} + +func (m *MessageWithOneofWKTs) GetListValueValue() *types.ListValue { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_ListValueValue); ok { + return x.ListValueValue + } + return nil +} + +func (m *MessageWithOneofWKTs) GetStructValue() *types.Struct { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_StructValue); ok { + return x.StructValue + } + return nil +} + +func (m *MessageWithOneofWKTs) GetAnyValue() *types.Any { + if x, ok := m.GetValue().(*MessageWithOneofWKTs_AnyValue); ok { + return x.AnyValue + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MessageWithOneofWKTs) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MessageWithOneofWKTs_DoubleValue)(nil), + (*MessageWithOneofWKTs_FloatValue)(nil), + (*MessageWithOneofWKTs_Int32Value)(nil), + (*MessageWithOneofWKTs_Int64Value)(nil), + (*MessageWithOneofWKTs_Uint32Value)(nil), + (*MessageWithOneofWKTs_Uint64Value)(nil), + (*MessageWithOneofWKTs_BoolValue)(nil), + (*MessageWithOneofWKTs_StringValue)(nil), + (*MessageWithOneofWKTs_BytesValue)(nil), + (*MessageWithOneofWKTs_EmptyValue)(nil), + (*MessageWithOneofWKTs_TimestampValue)(nil), + (*MessageWithOneofWKTs_DurationValue)(nil), + (*MessageWithOneofWKTs_FieldMaskValue)(nil), + (*MessageWithOneofWKTs_ValueValue)(nil), + (*MessageWithOneofWKTs_ListValueValue)(nil), + (*MessageWithOneofWKTs_StructValue)(nil), + (*MessageWithOneofWKTs_AnyValue)(nil), + } +} + +type MessageWithWKTMaps struct { + StringDoubleMap map[string]*types.DoubleValue `protobuf:"bytes,1,rep,name=string_double_map,json=stringDoubleMap,proto3" json:"string_double_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringFloatMap map[string]*types.FloatValue `protobuf:"bytes,2,rep,name=string_float_map,json=stringFloatMap,proto3" json:"string_float_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringInt32Map map[string]*types.Int32Value `protobuf:"bytes,3,rep,name=string_int32_map,json=stringInt32Map,proto3" json:"string_int32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringInt64Map map[string]*types.Int64Value `protobuf:"bytes,4,rep,name=string_int64_map,json=stringInt64Map,proto3" json:"string_int64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringUint32Map map[string]*types.UInt32Value `protobuf:"bytes,5,rep,name=string_uint32_map,json=stringUint32Map,proto3" json:"string_uint32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringUint64Map map[string]*types.UInt64Value `protobuf:"bytes,6,rep,name=string_uint64_map,json=stringUint64Map,proto3" json:"string_uint64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringBoolMap map[string]*types.BoolValue `protobuf:"bytes,7,rep,name=string_bool_map,json=stringBoolMap,proto3" json:"string_bool_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringStringMap map[string]*types.StringValue `protobuf:"bytes,8,rep,name=string_string_map,json=stringStringMap,proto3" json:"string_string_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringBytesMap map[string]*types.BytesValue `protobuf:"bytes,9,rep,name=string_bytes_map,json=stringBytesMap,proto3" json:"string_bytes_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringEmptyMap map[string]*types.Empty `protobuf:"bytes,10,rep,name=string_empty_map,json=stringEmptyMap,proto3" json:"string_empty_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringTimestampMap map[string]*types.Timestamp `protobuf:"bytes,11,rep,name=string_timestamp_map,json=stringTimestampMap,proto3" json:"string_timestamp_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringDurationMap map[string]*types.Duration `protobuf:"bytes,12,rep,name=string_duration_map,json=stringDurationMap,proto3" json:"string_duration_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringFieldMaskMap map[string]*types.FieldMask `protobuf:"bytes,13,rep,name=string_field_mask_map,json=stringFieldMaskMap,proto3" json:"string_field_mask_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringValueMap map[string]*types.Value `protobuf:"bytes,14,rep,name=string_value_map,json=stringValueMap,proto3" json:"string_value_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringListValueMap map[string]*types.ListValue `protobuf:"bytes,15,rep,name=string_list_value_map,json=stringListValueMap,proto3" json:"string_list_value_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringStructMap map[string]*types.Struct `protobuf:"bytes,16,rep,name=string_struct_map,json=stringStructMap,proto3" json:"string_struct_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringAnyMap map[string]*types.Any `protobuf:"bytes,17,rep,name=string_any_map,json=stringAnyMap,proto3" json:"string_any_map,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 *MessageWithWKTMaps) Reset() { *m = MessageWithWKTMaps{} } +func (m *MessageWithWKTMaps) String() string { return proto.CompactTextString(m) } +func (*MessageWithWKTMaps) ProtoMessage() {} +func (*MessageWithWKTMaps) Descriptor() ([]byte, []int) { + return fileDescriptor_4f76f3479ade79d3, []int{4} +} +func (m *MessageWithWKTMaps) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithWKTMaps.Unmarshal(m, b) +} +func (m *MessageWithWKTMaps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithWKTMaps.Marshal(b, m, deterministic) +} +func (m *MessageWithWKTMaps) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithWKTMaps.Merge(m, src) +} +func (m *MessageWithWKTMaps) XXX_Size() int { + return xxx_messageInfo_MessageWithWKTMaps.Size(m) +} +func (m *MessageWithWKTMaps) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithWKTMaps.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithWKTMaps proto.InternalMessageInfo + +func (m *MessageWithWKTMaps) GetStringDoubleMap() map[string]*types.DoubleValue { + if m != nil { + return m.StringDoubleMap + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringFloatMap() map[string]*types.FloatValue { + if m != nil { + return m.StringFloatMap + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringInt32Map() map[string]*types.Int32Value { + if m != nil { + return m.StringInt32Map + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringInt64Map() map[string]*types.Int64Value { + if m != nil { + return m.StringInt64Map + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringUint32Map() map[string]*types.UInt32Value { + if m != nil { + return m.StringUint32Map + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringUint64Map() map[string]*types.UInt64Value { + if m != nil { + return m.StringUint64Map + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringBoolMap() map[string]*types.BoolValue { + if m != nil { + return m.StringBoolMap + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringStringMap() map[string]*types.StringValue { + if m != nil { + return m.StringStringMap + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringBytesMap() map[string]*types.BytesValue { + if m != nil { + return m.StringBytesMap + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringEmptyMap() map[string]*types.Empty { + if m != nil { + return m.StringEmptyMap + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringTimestampMap() map[string]*types.Timestamp { + if m != nil { + return m.StringTimestampMap + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringDurationMap() map[string]*types.Duration { + if m != nil { + return m.StringDurationMap + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringFieldMaskMap() map[string]*types.FieldMask { + if m != nil { + return m.StringFieldMaskMap + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringValueMap() map[string]*types.Value { + if m != nil { + return m.StringValueMap + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringListValueMap() map[string]*types.ListValue { + if m != nil { + return m.StringListValueMap + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringStructMap() map[string]*types.Struct { + if m != nil { + return m.StringStructMap + } + return nil +} + +func (m *MessageWithWKTMaps) GetStringAnyMap() map[string]*types.Any { + if m != nil { + return m.StringAnyMap + } + return nil +} + +func init() { + proto.RegisterType((*MessageWithMarshaler)(nil), "thethings.json.test.MessageWithMarshaler") + proto.RegisterType((*MessageWithoutMarshaler)(nil), "thethings.json.test.MessageWithoutMarshaler") + proto.RegisterType((*MessageWithWKTs)(nil), "thethings.json.test.MessageWithWKTs") + proto.RegisterType((*MessageWithOneofWKTs)(nil), "thethings.json.test.MessageWithOneofWKTs") + proto.RegisterType((*MessageWithWKTMaps)(nil), "thethings.json.test.MessageWithWKTMaps") + proto.RegisterMapType((map[string]*types.Any)(nil), "thethings.json.test.MessageWithWKTMaps.StringAnyMapEntry") + proto.RegisterMapType((map[string]*types.BoolValue)(nil), "thethings.json.test.MessageWithWKTMaps.StringBoolMapEntry") + proto.RegisterMapType((map[string]*types.BytesValue)(nil), "thethings.json.test.MessageWithWKTMaps.StringBytesMapEntry") + proto.RegisterMapType((map[string]*types.DoubleValue)(nil), "thethings.json.test.MessageWithWKTMaps.StringDoubleMapEntry") + proto.RegisterMapType((map[string]*types.Duration)(nil), "thethings.json.test.MessageWithWKTMaps.StringDurationMapEntry") + proto.RegisterMapType((map[string]*types.Empty)(nil), "thethings.json.test.MessageWithWKTMaps.StringEmptyMapEntry") + proto.RegisterMapType((map[string]*types.FieldMask)(nil), "thethings.json.test.MessageWithWKTMaps.StringFieldMaskMapEntry") + proto.RegisterMapType((map[string]*types.FloatValue)(nil), "thethings.json.test.MessageWithWKTMaps.StringFloatMapEntry") + proto.RegisterMapType((map[string]*types.Int32Value)(nil), "thethings.json.test.MessageWithWKTMaps.StringInt32MapEntry") + proto.RegisterMapType((map[string]*types.Int64Value)(nil), "thethings.json.test.MessageWithWKTMaps.StringInt64MapEntry") + proto.RegisterMapType((map[string]*types.ListValue)(nil), "thethings.json.test.MessageWithWKTMaps.StringListValueMapEntry") + proto.RegisterMapType((map[string]*types.StringValue)(nil), "thethings.json.test.MessageWithWKTMaps.StringStringMapEntry") + proto.RegisterMapType((map[string]*types.Struct)(nil), "thethings.json.test.MessageWithWKTMaps.StringStructMapEntry") + proto.RegisterMapType((map[string]*types.Timestamp)(nil), "thethings.json.test.MessageWithWKTMaps.StringTimestampMapEntry") + proto.RegisterMapType((map[string]*types.UInt32Value)(nil), "thethings.json.test.MessageWithWKTMaps.StringUint32MapEntry") + proto.RegisterMapType((map[string]*types.UInt64Value)(nil), "thethings.json.test.MessageWithWKTMaps.StringUint64MapEntry") + proto.RegisterMapType((map[string]*types.Value)(nil), "thethings.json.test.MessageWithWKTMaps.StringValueMapEntry") +} + +func init() { proto.RegisterFile("wkts.proto", fileDescriptor_4f76f3479ade79d3) } + +var fileDescriptor_4f76f3479ade79d3 = []byte{ + // 1625 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x59, 0xed, 0x52, 0xdb, 0x46, + 0x14, 0x35, 0xe1, 0xcb, 0x5e, 0x19, 0x7f, 0x08, 0x12, 0x14, 0x27, 0x4d, 0x28, 0xbf, 0x3a, 0x9d, + 0x62, 0x92, 0xc0, 0xd0, 0x42, 0x18, 0x28, 0x34, 0x30, 0x64, 0x5a, 0xa6, 0x33, 0x2e, 0x34, 0xd3, + 0x8f, 0x29, 0x95, 0x8d, 0xb0, 0x5d, 0x6c, 0xc9, 0xf5, 0x4a, 0xc9, 0xf0, 0x08, 0x7d, 0xd5, 0x4c, + 0x9f, 0xa0, 0xbf, 0x3a, 0xbb, 0xba, 0xab, 0xbd, 0x2b, 0x69, 0xa5, 0xa0, 0x3f, 0x89, 0xbc, 0xbb, + 0xe7, 0x9e, 0x7b, 0x77, 0x57, 0xe7, 0xac, 0x16, 0x42, 0x3e, 0xdc, 0xfa, 0xb4, 0x3d, 0x99, 0x7a, + 0xbe, 0x67, 0x2e, 0xfb, 0x03, 0xc7, 0x1f, 0x0c, 0xdd, 0x3e, 0x6d, 0xff, 0x45, 0x3d, 0xb7, 0xed, + 0x3b, 0xd4, 0x6f, 0x35, 0x6d, 0xd7, 0xf5, 0x7c, 0xdb, 0x1f, 0x7a, 0x2e, 0x8c, 0x6b, 0x3d, 0xee, + 0x7b, 0x5e, 0x7f, 0xe4, 0x6c, 0xf2, 0x5f, 0xdd, 0xe0, 0x66, 0xd3, 0x76, 0xef, 0xa0, 0xeb, 0x59, + 0xbc, 0xeb, 0x3a, 0x98, 0x72, 0x2c, 0xf4, 0x3f, 0x89, 0xf7, 0x3b, 0xe3, 0x89, 0x2f, 0xc0, 0x6b, + 0xf1, 0xce, 0x9b, 0xa1, 0x33, 0xba, 0xbe, 0x1a, 0xdb, 0xf4, 0x16, 0x46, 0x3c, 0x8d, 0x8f, 0xa0, + 0xfe, 0x34, 0xe8, 0xf9, 0xd0, 0xfb, 0x3c, 0xde, 0xeb, 0x0f, 0xc7, 0x0e, 0xf5, 0xed, 0xf1, 0x44, + 0x97, 0xdd, 0x87, 0xa9, 0x3d, 0x99, 0x38, 0x53, 0x28, 0x6c, 0xfd, 0x05, 0x59, 0x39, 0x77, 0x28, + 0xb5, 0xfb, 0xce, 0xbb, 0xa1, 0x3f, 0x38, 0xb7, 0xa7, 0x74, 0x60, 0x8f, 0x9c, 0xa9, 0x69, 0x91, + 0xc5, 0x71, 0xd8, 0x6e, 0xcd, 0xac, 0xcd, 0x7c, 0x51, 0xe9, 0x88, 0x9f, 0xeb, 0xfb, 0x64, 0x15, + 0x21, 0xbc, 0xc0, 0xff, 0x04, 0xd0, 0xde, 0xe2, 0xc7, 0x60, 0xae, 0x5c, 0x6a, 0x94, 0xd6, 0xff, + 0x69, 0x92, 0x3a, 0x82, 0xbf, 0xfb, 0xfe, 0x82, 0x9a, 0x87, 0xa4, 0x7a, 0xed, 0x05, 0xdd, 0x91, + 0x73, 0xf5, 0xde, 0x1e, 0x05, 0x21, 0xd6, 0x78, 0xf5, 0xb4, 0x1d, 0xa6, 0xde, 0x16, 0xa9, 0xb7, + 0xdf, 0xf0, 0x41, 0x3f, 0xb3, 0x31, 0x1d, 0xe3, 0x5a, 0xfe, 0x30, 0x8f, 0xc8, 0x12, 0x0e, 0x40, + 0xad, 0x07, 0x6b, 0xb3, 0xb9, 0x11, 0xaa, 0x28, 0x02, 0x35, 0xf7, 0x89, 0x71, 0x33, 0xf2, 0x6c, + 0x1f, 0x52, 0x98, 0xe5, 0x29, 0x3c, 0x49, 0x04, 0x38, 0x65, 0x63, 0x42, 0x3c, 0xb9, 0x89, 0x9e, + 0xcd, 0x03, 0x52, 0x45, 0x68, 0x6a, 0xcd, 0x71, 0xfe, 0x4c, 0xb8, 0x21, 0xe1, 0x9c, 0x7d, 0xe8, + 0xfa, 0x5b, 0xaf, 0x80, 0x7d, 0x5e, 0xc3, 0xfe, 0x96, 0x8d, 0x01, 0xf6, 0x61, 0xf4, 0xcc, 0xd8, + 0x11, 0x9a, 0x5a, 0x0b, 0x1a, 0x76, 0x04, 0x37, 0x24, 0x5c, 0xb0, 0xef, 0x6c, 0x03, 0xfb, 0xa2, + 0x9e, 0x7d, 0x67, 0x5b, 0xb2, 0xc3, 0x33, 0xb0, 0x0b, 0x34, 0xb5, 0xca, 0x7a, 0x76, 0x01, 0x37, + 0x24, 0x9c, 0xaf, 0x7e, 0x80, 0x8b, 0xaf, 0x68, 0x56, 0xff, 0x12, 0xa7, 0x1f, 0xa0, 0xf2, 0x8f, + 0xc8, 0x52, 0xa0, 0xd4, 0x4f, 0x34, 0xab, 0x8f, 0x23, 0x54, 0x03, 0x3c, 0x03, 0x90, 0x43, 0x34, + 0x05, 0x46, 0x46, 0x0e, 0x51, 0x11, 0x01, 0x9a, 0x04, 0xc8, 0x41, 0xce, 0x42, 0x35, 0x23, 0x07, + 0x11, 0xa1, 0x1a, 0xe0, 0x79, 0xd8, 0x25, 0xa4, 0xeb, 0x79, 0x23, 0xc8, 0x60, 0x89, 0x67, 0xd0, + 0x4a, 0xe0, 0x8f, 0x3d, 0x6f, 0x14, 0xa2, 0x2b, 0x5d, 0xf1, 0x68, 0xbe, 0x26, 0x86, 0x84, 0x52, + 0xab, 0xc6, 0xb9, 0xb3, 0xb0, 0x24, 0xc2, 0xf2, 0xda, 0xa9, 0x3f, 0x1d, 0xba, 0x7d, 0x60, 0xae, + 0x6b, 0x6a, 0xff, 0x89, 0x0f, 0x82, 0xda, 0xa9, 0xfc, 0xc1, 0x6a, 0xc7, 0x01, 0xa8, 0xd5, 0xd0, + 0xd4, 0x8e, 0x23, 0x54, 0x51, 0x04, 0xbe, 0x03, 0xbb, 0x77, 0xbe, 0x43, 0x21, 0x85, 0xa6, 0x66, + 0x07, 0x1e, 0xb3, 0x31, 0xa2, 0x82, 0xe8, 0x99, 0xed, 0x40, 0x84, 0xa6, 0x96, 0xa9, 0xd9, 0x81, + 0x08, 0x6e, 0x48, 0x38, 0x35, 0xbf, 0x26, 0x06, 0xd7, 0x64, 0x60, 0x5f, 0xe6, 0xec, 0x8f, 0x12, + 0xf0, 0x13, 0x36, 0xa6, 0x43, 0xf8, 0xd0, 0x90, 0x78, 0x97, 0x54, 0x11, 0x90, 0x5a, 0x2b, 0x9c, + 0x58, 0x87, 0x34, 0x24, 0x92, 0x9a, 0xdf, 0x91, 0x7a, 0x24, 0xd5, 0xc0, 0xfb, 0x50, 0xb3, 0xe4, + 0x17, 0x62, 0x5c, 0xa7, 0x16, 0x41, 0x42, 0xfe, 0x13, 0xd2, 0x88, 0x05, 0xa1, 0xd6, 0x23, 0xcd, + 0xe2, 0xcb, 0x28, 0x75, 0x35, 0x0a, 0x35, 0xbf, 0x25, 0x35, 0xe1, 0x59, 0x90, 0xca, 0x2a, 0x4f, + 0xe5, 0x71, 0x52, 0x3f, 0x61, 0x58, 0x67, 0x49, 0x00, 0xc2, 0x44, 0x8e, 0x49, 0x5d, 0x8d, 0x40, + 0x2d, 0x8b, 0xe7, 0x91, 0x11, 0xa2, 0xa6, 0x84, 0xa0, 0xe6, 0x1b, 0xd2, 0x90, 0xe6, 0x07, 0x79, + 0x3c, 0xd6, 0x4c, 0xc9, 0x29, 0x1b, 0x78, 0x6e, 0xd3, 0xdb, 0x4e, 0xed, 0x46, 0x3c, 0x86, 0x99, + 0x9c, 0x92, 0x66, 0x3c, 0x0a, 0xb5, 0x5a, 0x9a, 0x39, 0x91, 0x61, 0xea, 0x6a, 0x18, 0xbe, 0x27, + 0x38, 0x18, 0x12, 0x79, 0xa2, 0xd9, 0x13, 0xb0, 0x19, 0xf9, 0xa0, 0x68, 0x4f, 0x20, 0x20, 0xb5, + 0x9e, 0x6a, 0xf6, 0x04, 0xec, 0x43, 0x89, 0xe4, 0x33, 0x30, 0x1a, 0x52, 0x30, 0x11, 0x20, 0xfe, + 0x4c, 0x33, 0x03, 0x3f, 0x0c, 0x29, 0x18, 0x49, 0x6d, 0x24, 0x1e, 0xa3, 0x19, 0x88, 0x47, 0xa1, + 0xd6, 0x33, 0xcd, 0x0c, 0xc8, 0x30, 0x75, 0x35, 0x0c, 0x35, 0xf7, 0xb8, 0x2e, 0x04, 0x3d, 0x61, + 0x89, 0xcf, 0x79, 0x26, 0xab, 0x69, 0x6f, 0x75, 0xd0, 0xf3, 0xb9, 0x24, 0x04, 0x3d, 0xf0, 0xc3, + 0x7d, 0x2e, 0x09, 0x11, 0x96, 0x5a, 0x6b, 0x9c, 0x5f, 0x0b, 0xae, 0x22, 0x30, 0x35, 0x5f, 0x92, + 0x8a, 0xed, 0x8a, 0xb7, 0xf1, 0x73, 0x4e, 0xbb, 0x92, 0x40, 0x1e, 0xb9, 0x77, 0x9d, 0xb2, 0xed, + 0xc2, 0x9b, 0xb8, 0x45, 0x48, 0x04, 0xa1, 0xd6, 0x3a, 0x67, 0x4b, 0xc7, 0x54, 0x04, 0x86, 0xae, + 0xff, 0x5b, 0x56, 0x0e, 0x3f, 0x3f, 0xba, 0x8e, 0x77, 0xc3, 0x0f, 0x24, 0x47, 0xf7, 0x3f, 0x90, + 0x9c, 0x95, 0xd4, 0x23, 0xc9, 0x81, 0x7a, 0x9e, 0x78, 0x90, 0x7b, 0x9e, 0x38, 0x2b, 0xc5, 0x4e, + 0x14, 0xca, 0x89, 0x60, 0x36, 0xf7, 0x44, 0xc0, 0xf0, 0xca, 0x99, 0x40, 0xf1, 0xf4, 0xb9, 0x5c, + 0x4f, 0x07, 0xbc, 0x34, 0x34, 0xd5, 0x95, 0xe7, 0xf3, 0x5d, 0x99, 0x4d, 0x81, 0xea, 0xcb, 0xaa, + 0xa9, 0x2e, 0xe4, 0x9b, 0xaa, 0x08, 0x21, 0xb2, 0x78, 0xad, 0x78, 0xe2, 0x62, 0x9e, 0x27, 0x9e, + 0x95, 0xb0, 0x2b, 0x1e, 0xc5, 0x8c, 0xad, 0x9c, 0x6f, 0x6c, 0x8c, 0x1f, 0x5b, 0xdb, 0x81, 0xea, + 0x4b, 0x95, 0x5c, 0x5f, 0x62, 0xb3, 0x88, 0x9c, 0x69, 0x57, 0x75, 0x16, 0x92, 0xe5, 0x2c, 0x0c, + 0x8a, 0xbc, 0xe5, 0x24, 0x69, 0x10, 0x46, 0x9e, 0x41, 0x9c, 0x95, 0x12, 0x16, 0x71, 0x9c, 0xd0, + 0xf6, 0x6a, 0x8e, 0xb6, 0x9f, 0x95, 0xe2, 0xea, 0x7e, 0x9a, 0xa2, 0xcc, 0x4b, 0x79, 0xca, 0xcc, + 0x72, 0x89, 0x69, 0xf3, 0xae, 0xaa, 0xa9, 0xb5, 0x2c, 0x4d, 0x65, 0xb3, 0xf1, 0x1e, 0x8b, 0x5a, + 0x52, 0x1a, 0xeb, 0x79, 0xd2, 0xc8, 0x52, 0x88, 0x89, 0xe3, 0x7e, 0x4c, 0xd4, 0x1a, 0x99, 0xa2, + 0x06, 0xdb, 0x21, 0x92, 0xb5, 0x2d, 0x2c, 0x4c, 0x4d, 0xbd, 0x30, 0x9d, 0x95, 0xa4, 0x34, 0x1d, + 0x2f, 0x92, 0x79, 0x0e, 0x58, 0xff, 0xaf, 0x45, 0x4c, 0xf5, 0xd3, 0xe7, 0xdc, 0x9e, 0x50, 0x73, + 0x40, 0x9a, 0xb0, 0x4d, 0x41, 0x73, 0xc6, 0xf6, 0xc4, 0x9a, 0xe1, 0x0a, 0xb6, 0xdf, 0x4e, 0xf9, + 0x3c, 0x6d, 0x27, 0x63, 0xc0, 0x16, 0x0e, 0xe5, 0xe8, 0xdc, 0x9e, 0x9c, 0xb8, 0xfe, 0xf4, 0xae, + 0x53, 0xa7, 0x6a, 0xab, 0xe9, 0x90, 0x06, 0x30, 0x85, 0xd2, 0xc4, 0x88, 0xc2, 0x2f, 0xa5, 0xd7, + 0xf7, 0x23, 0xe2, 0xaa, 0x15, 0xf1, 0xd4, 0xa8, 0xd2, 0x88, 0x68, 0x42, 0x01, 0x61, 0x34, 0xb3, + 0x45, 0x68, 0xb8, 0xb4, 0xc4, 0x69, 0x44, 0xa3, 0x4a, 0xb3, 0xb3, 0xcd, 0x69, 0xe6, 0x0a, 0xd2, + 0xec, 0x6c, 0xa7, 0xd0, 0xf0, 0x46, 0xb4, 0x3c, 0x81, 0x2c, 0x67, 0xbe, 0xc8, 0xf2, 0x5c, 0x0e, + 0x95, 0x7a, 0x60, 0x79, 0xa2, 0xd6, 0x18, 0x13, 0x54, 0xb4, 0x50, 0x94, 0x09, 0x95, 0x84, 0x98, + 0xc2, 0x9a, 0xba, 0x04, 0x9a, 0xae, 0xb8, 0xba, 0x32, 0x9e, 0x45, 0xce, 0xb3, 0x77, 0x3f, 0x1e, + 0x26, 0xbc, 0x11, 0x0b, 0x7c, 0x04, 0x40, 0x1b, 0xaa, 0x06, 0xfe, 0x63, 0x2c, 0xe5, 0x22, 0xd5, + 0x84, 0xff, 0xc6, 0xab, 0x89, 0x5a, 0xd1, 0x46, 0x08, 0xb5, 0x9a, 0x11, 0x55, 0x8a, 0x6c, 0x04, + 0x2e, 0xe3, 0xf1, 0x8d, 0x20, 0x1a, 0x11, 0x4d, 0x28, 0xe9, 0x8c, 0x86, 0x14, 0xa1, 0xe1, 0x6a, + 0x1f, 0xa7, 0x11, 0x8d, 0xe6, 0xdf, 0x64, 0x05, 0x68, 0xa4, 0xfc, 0x33, 0x2a, 0x83, 0x53, 0x1d, + 0xde, 0x8f, 0x2a, 0x72, 0x86, 0x88, 0xce, 0xa4, 0x89, 0x0e, 0xd3, 0x25, 0xcb, 0x42, 0x81, 0x84, + 0x55, 0x30, 0xc6, 0xf0, 0x13, 0xf6, 0xe0, 0x9e, 0x1a, 0x04, 0x11, 0x22, 0x42, 0xd8, 0x05, 0xa8, + 0xdd, 0x9c, 0x92, 0x87, 0x42, 0x87, 0xa4, 0xad, 0x30, 0xc6, 0xa5, 0x22, 0x35, 0x46, 0x8e, 0x13, + 0xaf, 0x11, 0x77, 0xa0, 0xd5, 0x0b, 0x2d, 0x84, 0xd1, 0xd5, 0x8a, 0xac, 0x1e, 0x17, 0xf5, 0xf8, + 0xea, 0x89, 0x46, 0x54, 0x1a, 0xb2, 0x2b, 0xc6, 0x55, 0x2f, 0x52, 0x5a, 0xe4, 0x64, 0xf1, 0xd2, + 0x70, 0x87, 0xfa, 0xa6, 0x31, 0x6b, 0x63, 0x7c, 0x8d, 0x82, 0x6f, 0x5a, 0xd0, 0xf3, 0x53, 0xde, + 0xb4, 0xb0, 0xd5, 0xbc, 0x22, 0x50, 0xef, 0x15, 0xb3, 0x41, 0x46, 0xd3, 0xe4, 0x34, 0xbb, 0xf7, + 0xa3, 0x39, 0x72, 0xe5, 0xf6, 0x87, 0x23, 0x5a, 0xd8, 0xd4, 0xfa, 0x93, 0xac, 0xa4, 0x59, 0x99, + 0xd9, 0x20, 0xb3, 0xb7, 0xce, 0x1d, 0x5c, 0x2a, 0xb2, 0x47, 0xf3, 0x15, 0xb8, 0x2a, 0x9c, 0xac, + 0xb3, 0xaf, 0xfa, 0xc2, 0xa1, 0x7b, 0x0f, 0xbe, 0x99, 0x69, 0xfd, 0x41, 0x96, 0x53, 0x3c, 0x2c, + 0x85, 0xe0, 0xa5, 0x4a, 0x90, 0x79, 0x97, 0x97, 0x16, 0x5f, 0x31, 0xaf, 0x22, 0xf1, 0xd1, 0x65, + 0x95, 0x26, 0xbe, 0x94, 0xf8, 0x82, 0xf1, 0xc5, 0x45, 0x14, 0x8a, 0x1f, 0xad, 0x80, 0xea, 0x56, + 0x45, 0x56, 0xe0, 0x32, 0xbd, 0x02, 0x85, 0x21, 0xb3, 0x84, 0x4f, 0x62, 0x48, 0xa9, 0xe1, 0x77, + 0x62, 0x26, 0xfd, 0x29, 0x25, 0xfe, 0x0b, 0x35, 0x7e, 0xd6, 0x85, 0x59, 0x5a, 0xfe, 0xaa, 0x2f, + 0x15, 0xc9, 0x1f, 0x5f, 0x88, 0xa5, 0xad, 0xb1, 0x62, 0x48, 0x45, 0xd6, 0x18, 0xdd, 0x78, 0xa1, + 0xf8, 0xbf, 0x88, 0xf8, 0x8a, 0x13, 0xa5, 0xc4, 0xff, 0x4a, 0x8d, 0xaf, 0xbb, 0xd8, 0x42, 0xa1, + 0x6d, 0xb2, 0xaa, 0x71, 0x9e, 0x22, 0xf3, 0x2f, 0xef, 0xac, 0x10, 0xc5, 0x15, 0x79, 0x94, 0x6e, + 0x35, 0x29, 0x0c, 0x9b, 0x2a, 0x43, 0xc6, 0x6d, 0x54, 0x5a, 0x0d, 0x09, 0x67, 0x29, 0x52, 0x83, + 0xbc, 0x63, 0x4a, 0x5b, 0x01, 0x45, 0xdd, 0x8b, 0xac, 0x40, 0x62, 0x71, 0xa3, 0xec, 0x13, 0xe6, + 0x51, 0x24, 0x7b, 0x79, 0x3f, 0x84, 0x28, 0x7e, 0x43, 0x6f, 0x00, 0xf2, 0x8b, 0x94, 0xf8, 0x1b, + 0x6a, 0x7c, 0xed, 0xfd, 0x0f, 0x0a, 0x7e, 0x49, 0x9a, 0x09, 0x97, 0x48, 0x89, 0xfc, 0xa5, 0x1a, + 0x39, 0xfd, 0xae, 0x47, 0x86, 0x3d, 0x3e, 0xfc, 0x18, 0xcc, 0x95, 0x67, 0x1a, 0x33, 0xbf, 0xee, + 0xf4, 0x87, 0xfe, 0x20, 0xe8, 0xb6, 0x7b, 0xde, 0x78, 0xf3, 0x62, 0xe0, 0x5c, 0x70, 0xd7, 0x7a, + 0xeb, 0x5e, 0x07, 0xcc, 0x88, 0x1c, 0x1a, 0xfe, 0xa1, 0xac, 0xb7, 0xd1, 0x77, 0xdc, 0x8d, 0xbe, + 0xb7, 0xc1, 0xdc, 0x6c, 0x93, 0xb9, 0x59, 0x77, 0x81, 0x77, 0x6c, 0xfd, 0x1f, 0x00, 0x00, 0xff, + 0xff, 0x05, 0xb4, 0xcc, 0x9f, 0x3e, 0x1c, 0x00, 0x00, +} diff --git a/test/gogo/wkts_json.pb.go b/test/gogo/wkts_json.pb.go new file mode 100644 index 00000000..0905fe21 --- /dev/null +++ b/test/gogo/wkts_json.pb.go @@ -0,0 +1,1640 @@ +// Code generated by protoc-gen-go-json. DO NOT EDIT. +// versions: +// - protoc-gen-go-json v0.0.0-dev +// - protoc v3.9.1 +// source: wkts.proto + +package test + +import ( + gogo "github.com/TheThingsIndustries/protoc-gen-go-json/gogo" + jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" + types "github.com/gogo/protobuf/types" +) + +// MarshalProtoJSON marshals the MessageWithMarshaler message to JSON. +func (x *MessageWithMarshaler) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Message != "" || s.HasField("message") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("message") + s.WriteString(x.Message) + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithMarshaler message from JSON. +func (x *MessageWithMarshaler) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "message": + s.AddField("message") + x.Message = s.ReadString() + } + }) +} + +// MarshalProtoJSON marshals the MessageWithWKTs message to JSON. +func (x *MessageWithWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.DoubleValue != nil || s.HasField("double_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("double_value") + if x.DoubleValue == nil { + s.WriteNil() + } else { + s.WriteFloat64(x.DoubleValue.Value) + } + } + if len(x.DoubleValues) > 0 || s.HasField("double_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("double_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.DoubleValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteFloat64(element.Value) + } + } + s.WriteArrayEnd() + } + if x.FloatValue != nil || s.HasField("float_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("float_value") + if x.FloatValue == nil { + s.WriteNil() + } else { + s.WriteFloat32(x.FloatValue.Value) + } + } + if len(x.FloatValues) > 0 || s.HasField("float_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("float_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.FloatValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteFloat32(element.Value) + } + } + s.WriteArrayEnd() + } + if x.Int32Value != nil || s.HasField("int32_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int32_value") + if x.Int32Value == nil { + s.WriteNil() + } else { + s.WriteInt32(x.Int32Value.Value) + } + } + if len(x.Int32Values) > 0 || s.HasField("int32_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int32_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Int32Values { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteInt32(element.Value) + } + } + s.WriteArrayEnd() + } + if x.Int64Value != nil || s.HasField("int64_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int64_value") + if x.Int64Value == nil { + s.WriteNil() + } else { + s.WriteInt64(x.Int64Value.Value) + } + } + if len(x.Int64Values) > 0 || s.HasField("int64_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int64_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Int64Values { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteInt64(element.Value) + } + } + s.WriteArrayEnd() + } + if x.Uint32Value != nil || s.HasField("uint32_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint32_value") + if x.Uint32Value == nil { + s.WriteNil() + } else { + s.WriteUint32(x.Uint32Value.Value) + } + } + if len(x.Uint32Values) > 0 || s.HasField("uint32_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint32_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Uint32Values { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteUint32(element.Value) + } + } + s.WriteArrayEnd() + } + if x.Uint64Value != nil || s.HasField("uint64_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint64_value") + if x.Uint64Value == nil { + s.WriteNil() + } else { + s.WriteUint64(x.Uint64Value.Value) + } + } + if len(x.Uint64Values) > 0 || s.HasField("uint64_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint64_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Uint64Values { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteUint64(element.Value) + } + } + s.WriteArrayEnd() + } + if x.BoolValue != nil || s.HasField("bool_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bool_value") + if x.BoolValue == nil { + s.WriteNil() + } else { + s.WriteBool(x.BoolValue.Value) + } + } + if len(x.BoolValues) > 0 || s.HasField("bool_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bool_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.BoolValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteBool(element.Value) + } + } + s.WriteArrayEnd() + } + if x.StringValue != nil || s.HasField("string_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_value") + if x.StringValue == nil { + s.WriteNil() + } else { + s.WriteString(x.StringValue.Value) + } + } + if len(x.StringValues) > 0 || s.HasField("string_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.StringValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteString(element.Value) + } + } + s.WriteArrayEnd() + } + if x.BytesValue != nil || s.HasField("bytes_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bytes_value") + if x.BytesValue == nil { + s.WriteNil() + } else { + s.WriteBytes(x.BytesValue.Value) + } + } + if len(x.BytesValues) > 0 || s.HasField("bytes_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bytes_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.BytesValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteBytes(element.Value) + } + } + s.WriteArrayEnd() + } + if x.EmptyValue != nil || s.HasField("empty_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("empty_value") + if x.EmptyValue == nil { + s.WriteNil() + } else { + gogo.MarshalEmpty(s, x.EmptyValue) + } + } + if len(x.EmptyValues) > 0 || s.HasField("empty_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("empty_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.EmptyValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + gogo.MarshalEmpty(s, element) + } + } + s.WriteArrayEnd() + } + if x.TimestampValue != nil || s.HasField("timestamp_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("timestamp_value") + if x.TimestampValue == nil { + s.WriteNil() + } else { + gogo.MarshalTimestamp(s, x.TimestampValue) + } + } + if len(x.TimestampValues) > 0 || s.HasField("timestamp_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("timestamp_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.TimestampValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + gogo.MarshalTimestamp(s, element) + } + } + s.WriteArrayEnd() + } + if x.DurationValue != nil || s.HasField("duration_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("duration_value") + if x.DurationValue == nil { + s.WriteNil() + } else { + gogo.MarshalDuration(s, x.DurationValue) + } + } + if len(x.DurationValues) > 0 || s.HasField("duration_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("duration_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.DurationValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + gogo.MarshalDuration(s, element) + } + } + s.WriteArrayEnd() + } + if x.FieldMaskValue != nil || s.HasField("field_mask_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("field_mask_value") + if x.FieldMaskValue == nil { + s.WriteNil() + } else { + gogo.MarshalFieldMask(s, x.FieldMaskValue) + } + } + if len(x.FieldMaskValues) > 0 || s.HasField("field_mask_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("field_mask_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.FieldMaskValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + gogo.MarshalFieldMask(s, element) + } + } + s.WriteArrayEnd() + } + if x.ValueValue != nil || s.HasField("value_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("value_value") + if x.ValueValue == nil { + s.WriteNil() + } else { + gogo.MarshalValue(s, x.ValueValue) + } + } + if len(x.ValueValues) > 0 || s.HasField("value_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("value_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.ValueValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + gogo.MarshalValue(s, element) + } + } + s.WriteArrayEnd() + } + if x.ListValueValue != nil || s.HasField("list_value_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("list_value_value") + if x.ListValueValue == nil { + s.WriteNil() + } else { + gogo.MarshalListValue(s, x.ListValueValue) + } + } + if len(x.ListValueValues) > 0 || s.HasField("list_value_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("list_value_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.ListValueValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + gogo.MarshalListValue(s, element) + } + } + s.WriteArrayEnd() + } + if x.StructValue != nil || s.HasField("struct_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("struct_value") + if x.StructValue == nil { + s.WriteNil() + } else { + gogo.MarshalStruct(s, x.StructValue) + } + } + if len(x.StructValues) > 0 || s.HasField("struct_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("struct_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.StructValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + gogo.MarshalStruct(s, element) + } + } + s.WriteArrayEnd() + } + if x.AnyValue != nil || s.HasField("any_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("any_value") + if x.AnyValue == nil { + s.WriteNil() + } else { + gogo.MarshalAny(s, x.AnyValue) + } + } + if len(x.AnyValues) > 0 || s.HasField("any_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("any_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.AnyValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + gogo.MarshalAny(s, element) + } + } + s.WriteArrayEnd() + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithWKTs message from JSON. +func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "double_value", "doubleValue": + s.AddField("double_value") + if !s.ReadNil() { + v := s.ReadFloat64() + if s.Err() != nil { + return + } + x.DoubleValue = &types.DoubleValue{Value: v} + } + case "double_values", "doubleValues": + s.AddField("double_values") + s.ReadArray(func() { + if s.ReadNil() { + x.DoubleValues = append(x.DoubleValues, nil) + return + } + v := s.ReadFloat64() + if s.Err() != nil { + return + } + x.DoubleValues = append(x.DoubleValues, &types.DoubleValue{Value: v}) + }) + case "float_value", "floatValue": + s.AddField("float_value") + if !s.ReadNil() { + v := s.ReadFloat32() + if s.Err() != nil { + return + } + x.FloatValue = &types.FloatValue{Value: v} + } + case "float_values", "floatValues": + s.AddField("float_values") + s.ReadArray(func() { + if s.ReadNil() { + x.FloatValues = append(x.FloatValues, nil) + return + } + v := s.ReadFloat32() + if s.Err() != nil { + return + } + x.FloatValues = append(x.FloatValues, &types.FloatValue{Value: v}) + }) + case "int32_value", "int32Value": + s.AddField("int32_value") + if !s.ReadNil() { + v := s.ReadInt32() + if s.Err() != nil { + return + } + x.Int32Value = &types.Int32Value{Value: v} + } + case "int32_values", "int32Values": + s.AddField("int32_values") + s.ReadArray(func() { + if s.ReadNil() { + x.Int32Values = append(x.Int32Values, nil) + return + } + v := s.ReadInt32() + if s.Err() != nil { + return + } + x.Int32Values = append(x.Int32Values, &types.Int32Value{Value: v}) + }) + case "int64_value", "int64Value": + s.AddField("int64_value") + if !s.ReadNil() { + v := s.ReadInt64() + if s.Err() != nil { + return + } + x.Int64Value = &types.Int64Value{Value: v} + } + case "int64_values", "int64Values": + s.AddField("int64_values") + s.ReadArray(func() { + if s.ReadNil() { + x.Int64Values = append(x.Int64Values, nil) + return + } + v := s.ReadInt64() + if s.Err() != nil { + return + } + x.Int64Values = append(x.Int64Values, &types.Int64Value{Value: v}) + }) + case "uint32_value", "uint32Value": + s.AddField("uint32_value") + if !s.ReadNil() { + v := s.ReadUint32() + if s.Err() != nil { + return + } + x.Uint32Value = &types.UInt32Value{Value: v} + } + case "uint32_values", "uint32Values": + s.AddField("uint32_values") + s.ReadArray(func() { + if s.ReadNil() { + x.Uint32Values = append(x.Uint32Values, nil) + return + } + v := s.ReadUint32() + if s.Err() != nil { + return + } + x.Uint32Values = append(x.Uint32Values, &types.UInt32Value{Value: v}) + }) + case "uint64_value", "uint64Value": + s.AddField("uint64_value") + if !s.ReadNil() { + v := s.ReadUint64() + if s.Err() != nil { + return + } + x.Uint64Value = &types.UInt64Value{Value: v} + } + case "uint64_values", "uint64Values": + s.AddField("uint64_values") + s.ReadArray(func() { + if s.ReadNil() { + x.Uint64Values = append(x.Uint64Values, nil) + return + } + v := s.ReadUint64() + if s.Err() != nil { + return + } + x.Uint64Values = append(x.Uint64Values, &types.UInt64Value{Value: v}) + }) + case "bool_value", "boolValue": + s.AddField("bool_value") + if !s.ReadNil() { + v := s.ReadBool() + if s.Err() != nil { + return + } + x.BoolValue = &types.BoolValue{Value: v} + } + case "bool_values", "boolValues": + s.AddField("bool_values") + s.ReadArray(func() { + if s.ReadNil() { + x.BoolValues = append(x.BoolValues, nil) + return + } + v := s.ReadBool() + if s.Err() != nil { + return + } + x.BoolValues = append(x.BoolValues, &types.BoolValue{Value: v}) + }) + case "string_value", "stringValue": + s.AddField("string_value") + if !s.ReadNil() { + v := s.ReadString() + if s.Err() != nil { + return + } + x.StringValue = &types.StringValue{Value: v} + } + case "string_values", "stringValues": + s.AddField("string_values") + s.ReadArray(func() { + if s.ReadNil() { + x.StringValues = append(x.StringValues, nil) + return + } + v := s.ReadString() + if s.Err() != nil { + return + } + x.StringValues = append(x.StringValues, &types.StringValue{Value: v}) + }) + case "bytes_value", "bytesValue": + s.AddField("bytes_value") + if !s.ReadNil() { + v := s.ReadBytes() + if s.Err() != nil { + return + } + x.BytesValue = &types.BytesValue{Value: v} + } + case "bytes_values", "bytesValues": + s.AddField("bytes_values") + s.ReadArray(func() { + if s.ReadNil() { + x.BytesValues = append(x.BytesValues, nil) + return + } + v := s.ReadBytes() + if s.Err() != nil { + return + } + x.BytesValues = append(x.BytesValues, &types.BytesValue{Value: v}) + }) + case "empty_value", "emptyValue": + s.AddField("empty_value") + v := gogo.UnmarshalEmpty(s) + if s.Err() != nil { + return + } + x.EmptyValue = v + case "empty_values", "emptyValues": + s.AddField("empty_values") + s.ReadArray(func() { + v := gogo.UnmarshalEmpty(s) + if s.Err() != nil { + return + } + x.EmptyValues = append(x.EmptyValues, v) + }) + case "timestamp_value", "timestampValue": + s.AddField("timestamp_value") + v := gogo.UnmarshalTimestamp(s) + if s.Err() != nil { + return + } + x.TimestampValue = v + case "timestamp_values", "timestampValues": + s.AddField("timestamp_values") + s.ReadArray(func() { + v := gogo.UnmarshalTimestamp(s) + if s.Err() != nil { + return + } + x.TimestampValues = append(x.TimestampValues, v) + }) + case "duration_value", "durationValue": + s.AddField("duration_value") + v := gogo.UnmarshalDuration(s) + if s.Err() != nil { + return + } + x.DurationValue = v + case "duration_values", "durationValues": + s.AddField("duration_values") + s.ReadArray(func() { + v := gogo.UnmarshalDuration(s) + if s.Err() != nil { + return + } + x.DurationValues = append(x.DurationValues, v) + }) + case "field_mask_value", "fieldMaskValue": + s.AddField("field_mask_value") + v := gogo.UnmarshalFieldMask(s) + if s.Err() != nil { + return + } + x.FieldMaskValue = v + case "field_mask_values", "fieldMaskValues": + s.AddField("field_mask_values") + s.ReadArray(func() { + v := gogo.UnmarshalFieldMask(s) + if s.Err() != nil { + return + } + x.FieldMaskValues = append(x.FieldMaskValues, v) + }) + case "value_value", "valueValue": + s.AddField("value_value") + v := gogo.UnmarshalValue(s) + if s.Err() != nil { + return + } + x.ValueValue = v + case "value_values", "valueValues": + s.AddField("value_values") + s.ReadArray(func() { + v := gogo.UnmarshalValue(s) + if s.Err() != nil { + return + } + x.ValueValues = append(x.ValueValues, v) + }) + case "list_value_value", "listValueValue": + s.AddField("list_value_value") + v := gogo.UnmarshalListValue(s) + if s.Err() != nil { + return + } + x.ListValueValue = v + case "list_value_values", "listValueValues": + s.AddField("list_value_values") + s.ReadArray(func() { + v := gogo.UnmarshalListValue(s) + if s.Err() != nil { + return + } + x.ListValueValues = append(x.ListValueValues, v) + }) + case "struct_value", "structValue": + s.AddField("struct_value") + v := gogo.UnmarshalStruct(s) + if s.Err() != nil { + return + } + x.StructValue = v + case "struct_values", "structValues": + s.AddField("struct_values") + s.ReadArray(func() { + v := gogo.UnmarshalStruct(s) + if s.Err() != nil { + return + } + x.StructValues = append(x.StructValues, v) + }) + case "any_value", "anyValue": + s.AddField("any_value") + v := gogo.UnmarshalAny(s) + if s.Err() != nil { + return + } + x.AnyValue = v + case "any_values", "anyValues": + s.AddField("any_values") + s.ReadArray(func() { + v := gogo.UnmarshalAny(s) + if s.Err() != nil { + return + } + x.AnyValues = append(x.AnyValues, v) + }) + } + }) +} + +// MarshalProtoJSON marshals the MessageWithOneofWKTs message to JSON. +func (x *MessageWithOneofWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Value != nil { + switch ov := x.Value.(type) { + case *MessageWithOneofWKTs_DoubleValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("double_value") + if ov.DoubleValue == nil { + s.WriteNil() + } else { + s.WriteFloat64(ov.DoubleValue.Value) + } + case *MessageWithOneofWKTs_FloatValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("float_value") + if ov.FloatValue == nil { + s.WriteNil() + } else { + s.WriteFloat32(ov.FloatValue.Value) + } + case *MessageWithOneofWKTs_Int32Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int32_value") + if ov.Int32Value == nil { + s.WriteNil() + } else { + s.WriteInt32(ov.Int32Value.Value) + } + case *MessageWithOneofWKTs_Int64Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int64_value") + if ov.Int64Value == nil { + s.WriteNil() + } else { + s.WriteInt64(ov.Int64Value.Value) + } + case *MessageWithOneofWKTs_Uint32Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint32_value") + if ov.Uint32Value == nil { + s.WriteNil() + } else { + s.WriteUint32(ov.Uint32Value.Value) + } + case *MessageWithOneofWKTs_Uint64Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint64_value") + if ov.Uint64Value == nil { + s.WriteNil() + } else { + s.WriteUint64(ov.Uint64Value.Value) + } + case *MessageWithOneofWKTs_BoolValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bool_value") + if ov.BoolValue == nil { + s.WriteNil() + } else { + s.WriteBool(ov.BoolValue.Value) + } + case *MessageWithOneofWKTs_StringValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_value") + if ov.StringValue == nil { + s.WriteNil() + } else { + s.WriteString(ov.StringValue.Value) + } + case *MessageWithOneofWKTs_BytesValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bytes_value") + if ov.BytesValue == nil { + s.WriteNil() + } else { + s.WriteBytes(ov.BytesValue.Value) + } + case *MessageWithOneofWKTs_EmptyValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("empty_value") + if ov.EmptyValue == nil { + s.WriteNil() + } else { + gogo.MarshalEmpty(s, ov.EmptyValue) + } + case *MessageWithOneofWKTs_TimestampValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("timestamp_value") + if ov.TimestampValue == nil { + s.WriteNil() + } else { + gogo.MarshalTimestamp(s, ov.TimestampValue) + } + case *MessageWithOneofWKTs_DurationValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("duration_value") + if ov.DurationValue == nil { + s.WriteNil() + } else { + gogo.MarshalDuration(s, ov.DurationValue) + } + case *MessageWithOneofWKTs_FieldMaskValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("field_mask_value") + if ov.FieldMaskValue == nil { + s.WriteNil() + } else { + gogo.MarshalFieldMask(s, ov.FieldMaskValue) + } + case *MessageWithOneofWKTs_ValueValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("value_value") + if ov.ValueValue == nil { + s.WriteNil() + } else { + gogo.MarshalValue(s, ov.ValueValue) + } + case *MessageWithOneofWKTs_ListValueValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("list_value_value") + if ov.ListValueValue == nil { + s.WriteNil() + } else { + gogo.MarshalListValue(s, ov.ListValueValue) + } + case *MessageWithOneofWKTs_StructValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("struct_value") + if ov.StructValue == nil { + s.WriteNil() + } else { + gogo.MarshalStruct(s, ov.StructValue) + } + case *MessageWithOneofWKTs_AnyValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("any_value") + if ov.AnyValue == nil { + s.WriteNil() + } else { + gogo.MarshalAny(s, ov.AnyValue) + } + } + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithOneofWKTs message from JSON. +func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "double_value", "doubleValue": + s.AddField("double_value") + ov := &MessageWithOneofWKTs_DoubleValue{} + if !s.ReadNil() { + v := s.ReadFloat64() + if s.Err() != nil { + return + } + ov.DoubleValue = &types.DoubleValue{Value: v} + } + x.Value = ov + case "float_value", "floatValue": + s.AddField("float_value") + ov := &MessageWithOneofWKTs_FloatValue{} + if !s.ReadNil() { + v := s.ReadFloat32() + if s.Err() != nil { + return + } + ov.FloatValue = &types.FloatValue{Value: v} + } + x.Value = ov + case "int32_value", "int32Value": + s.AddField("int32_value") + ov := &MessageWithOneofWKTs_Int32Value{} + if !s.ReadNil() { + v := s.ReadInt32() + if s.Err() != nil { + return + } + ov.Int32Value = &types.Int32Value{Value: v} + } + x.Value = ov + case "int64_value", "int64Value": + s.AddField("int64_value") + ov := &MessageWithOneofWKTs_Int64Value{} + if !s.ReadNil() { + v := s.ReadInt64() + if s.Err() != nil { + return + } + ov.Int64Value = &types.Int64Value{Value: v} + } + x.Value = ov + case "uint32_value", "uint32Value": + s.AddField("uint32_value") + ov := &MessageWithOneofWKTs_Uint32Value{} + if !s.ReadNil() { + v := s.ReadUint32() + if s.Err() != nil { + return + } + ov.Uint32Value = &types.UInt32Value{Value: v} + } + x.Value = ov + case "uint64_value", "uint64Value": + s.AddField("uint64_value") + ov := &MessageWithOneofWKTs_Uint64Value{} + if !s.ReadNil() { + v := s.ReadUint64() + if s.Err() != nil { + return + } + ov.Uint64Value = &types.UInt64Value{Value: v} + } + x.Value = ov + case "bool_value", "boolValue": + s.AddField("bool_value") + ov := &MessageWithOneofWKTs_BoolValue{} + if !s.ReadNil() { + v := s.ReadBool() + if s.Err() != nil { + return + } + ov.BoolValue = &types.BoolValue{Value: v} + } + x.Value = ov + case "string_value", "stringValue": + s.AddField("string_value") + ov := &MessageWithOneofWKTs_StringValue{} + if !s.ReadNil() { + v := s.ReadString() + if s.Err() != nil { + return + } + ov.StringValue = &types.StringValue{Value: v} + } + x.Value = ov + case "bytes_value", "bytesValue": + s.AddField("bytes_value") + ov := &MessageWithOneofWKTs_BytesValue{} + if !s.ReadNil() { + v := s.ReadBytes() + if s.Err() != nil { + return + } + ov.BytesValue = &types.BytesValue{Value: v} + } + x.Value = ov + case "empty_value", "emptyValue": + s.AddField("empty_value") + ov := &MessageWithOneofWKTs_EmptyValue{} + v := gogo.UnmarshalEmpty(s) + if s.Err() != nil { + return + } + ov.EmptyValue = v + x.Value = ov + case "timestamp_value", "timestampValue": + s.AddField("timestamp_value") + ov := &MessageWithOneofWKTs_TimestampValue{} + v := gogo.UnmarshalTimestamp(s) + if s.Err() != nil { + return + } + ov.TimestampValue = v + x.Value = ov + case "duration_value", "durationValue": + s.AddField("duration_value") + ov := &MessageWithOneofWKTs_DurationValue{} + v := gogo.UnmarshalDuration(s) + if s.Err() != nil { + return + } + ov.DurationValue = v + x.Value = ov + case "field_mask_value", "fieldMaskValue": + s.AddField("field_mask_value") + ov := &MessageWithOneofWKTs_FieldMaskValue{} + v := gogo.UnmarshalFieldMask(s) + if s.Err() != nil { + return + } + ov.FieldMaskValue = v + x.Value = ov + case "value_value", "valueValue": + s.AddField("value_value") + ov := &MessageWithOneofWKTs_ValueValue{} + v := gogo.UnmarshalValue(s) + if s.Err() != nil { + return + } + ov.ValueValue = v + x.Value = ov + case "list_value_value", "listValueValue": + s.AddField("list_value_value") + ov := &MessageWithOneofWKTs_ListValueValue{} + v := gogo.UnmarshalListValue(s) + if s.Err() != nil { + return + } + ov.ListValueValue = v + x.Value = ov + case "struct_value", "structValue": + s.AddField("struct_value") + ov := &MessageWithOneofWKTs_StructValue{} + v := gogo.UnmarshalStruct(s) + if s.Err() != nil { + return + } + ov.StructValue = v + x.Value = ov + case "any_value", "anyValue": + s.AddField("any_value") + ov := &MessageWithOneofWKTs_AnyValue{} + v := gogo.UnmarshalAny(s) + if s.Err() != nil { + return + } + ov.AnyValue = v + x.Value = ov + } + }) +} + +// MarshalProtoJSON marshals the MessageWithWKTMaps message to JSON. +func (x *MessageWithWKTMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.StringDoubleMap != nil || s.HasField("string_double_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_double_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringDoubleMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteFloat64(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringFloatMap != nil || s.HasField("string_float_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_float_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringFloatMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteFloat32(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringInt32Map != nil || s.HasField("string_int32_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_int32_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringInt32Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteInt32(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringInt64Map != nil || s.HasField("string_int64_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_int64_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringInt64Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteInt64(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringUint32Map != nil || s.HasField("string_uint32_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_uint32_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringUint32Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteUint32(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringUint64Map != nil || s.HasField("string_uint64_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_uint64_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringUint64Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteUint64(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringBoolMap != nil || s.HasField("string_bool_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_bool_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringBoolMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteBool(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringStringMap != nil || s.HasField("string_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringStringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteString(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringBytesMap != nil || s.HasField("string_bytes_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_bytes_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringBytesMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteBytes(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringEmptyMap != nil || s.HasField("string_empty_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_empty_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringEmptyMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + gogo.MarshalEmpty(s, v) + } + } + s.WriteObjectEnd() + } + if x.StringTimestampMap != nil || s.HasField("string_timestamp_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_timestamp_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringTimestampMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + gogo.MarshalTimestamp(s, v) + } + } + s.WriteObjectEnd() + } + if x.StringDurationMap != nil || s.HasField("string_duration_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_duration_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringDurationMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + gogo.MarshalDuration(s, v) + } + } + s.WriteObjectEnd() + } + if x.StringFieldMaskMap != nil || s.HasField("string_field_mask_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_field_mask_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringFieldMaskMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + gogo.MarshalFieldMask(s, v) + } + } + s.WriteObjectEnd() + } + if x.StringValueMap != nil || s.HasField("string_value_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_value_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringValueMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + gogo.MarshalValue(s, v) + } + } + s.WriteObjectEnd() + } + if x.StringListValueMap != nil || s.HasField("string_list_value_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_list_value_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringListValueMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + gogo.MarshalListValue(s, v) + } + } + s.WriteObjectEnd() + } + if x.StringStructMap != nil || s.HasField("string_struct_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_struct_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringStructMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + gogo.MarshalStruct(s, v) + } + } + s.WriteObjectEnd() + } + if x.StringAnyMap != nil || s.HasField("string_any_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_any_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringAnyMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + gogo.MarshalAny(s, v) + } + } + s.WriteObjectEnd() + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithWKTMaps message from JSON. +func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "string_double_map", "stringDoubleMap": + s.AddField("string_double_map") + x.StringDoubleMap = make(map[string]*types.DoubleValue) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringDoubleMap[key] = nil + } else { + v := s.ReadFloat64() + if s.Err() != nil { + return + } + x.StringDoubleMap[key] = &types.DoubleValue{Value: v} + } + }) + case "string_float_map", "stringFloatMap": + s.AddField("string_float_map") + x.StringFloatMap = make(map[string]*types.FloatValue) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringFloatMap[key] = nil + } else { + v := s.ReadFloat32() + if s.Err() != nil { + return + } + x.StringFloatMap[key] = &types.FloatValue{Value: v} + } + }) + case "string_int32_map", "stringInt32Map": + s.AddField("string_int32_map") + x.StringInt32Map = make(map[string]*types.Int32Value) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringInt32Map[key] = nil + } else { + v := s.ReadInt32() + if s.Err() != nil { + return + } + x.StringInt32Map[key] = &types.Int32Value{Value: v} + } + }) + case "string_int64_map", "stringInt64Map": + s.AddField("string_int64_map") + x.StringInt64Map = make(map[string]*types.Int64Value) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringInt64Map[key] = nil + } else { + v := s.ReadInt64() + if s.Err() != nil { + return + } + x.StringInt64Map[key] = &types.Int64Value{Value: v} + } + }) + case "string_uint32_map", "stringUint32Map": + s.AddField("string_uint32_map") + x.StringUint32Map = make(map[string]*types.UInt32Value) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringUint32Map[key] = nil + } else { + v := s.ReadUint32() + if s.Err() != nil { + return + } + x.StringUint32Map[key] = &types.UInt32Value{Value: v} + } + }) + case "string_uint64_map", "stringUint64Map": + s.AddField("string_uint64_map") + x.StringUint64Map = make(map[string]*types.UInt64Value) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringUint64Map[key] = nil + } else { + v := s.ReadUint64() + if s.Err() != nil { + return + } + x.StringUint64Map[key] = &types.UInt64Value{Value: v} + } + }) + case "string_bool_map", "stringBoolMap": + s.AddField("string_bool_map") + x.StringBoolMap = make(map[string]*types.BoolValue) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringBoolMap[key] = nil + } else { + v := s.ReadBool() + if s.Err() != nil { + return + } + x.StringBoolMap[key] = &types.BoolValue{Value: v} + } + }) + case "string_string_map", "stringStringMap": + s.AddField("string_string_map") + x.StringStringMap = make(map[string]*types.StringValue) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringStringMap[key] = nil + } else { + v := s.ReadString() + if s.Err() != nil { + return + } + x.StringStringMap[key] = &types.StringValue{Value: v} + } + }) + case "string_bytes_map", "stringBytesMap": + s.AddField("string_bytes_map") + x.StringBytesMap = make(map[string]*types.BytesValue) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringBytesMap[key] = nil + } else { + v := s.ReadBytes() + if s.Err() != nil { + return + } + x.StringBytesMap[key] = &types.BytesValue{Value: v} + } + }) + case "string_empty_map", "stringEmptyMap": + s.AddField("string_empty_map") + x.StringEmptyMap = make(map[string]*types.Empty) + s.ReadStringMap(func(key string) { + v := gogo.UnmarshalEmpty(s) + if s.Err() != nil { + return + } + x.StringEmptyMap[key] = v + }) + case "string_timestamp_map", "stringTimestampMap": + s.AddField("string_timestamp_map") + x.StringTimestampMap = make(map[string]*types.Timestamp) + s.ReadStringMap(func(key string) { + v := gogo.UnmarshalTimestamp(s) + if s.Err() != nil { + return + } + x.StringTimestampMap[key] = v + }) + case "string_duration_map", "stringDurationMap": + s.AddField("string_duration_map") + x.StringDurationMap = make(map[string]*types.Duration) + s.ReadStringMap(func(key string) { + v := gogo.UnmarshalDuration(s) + if s.Err() != nil { + return + } + x.StringDurationMap[key] = v + }) + case "string_field_mask_map", "stringFieldMaskMap": + s.AddField("string_field_mask_map") + x.StringFieldMaskMap = make(map[string]*types.FieldMask) + s.ReadStringMap(func(key string) { + v := gogo.UnmarshalFieldMask(s) + if s.Err() != nil { + return + } + x.StringFieldMaskMap[key] = v + }) + case "string_value_map", "stringValueMap": + s.AddField("string_value_map") + x.StringValueMap = make(map[string]*types.Value) + s.ReadStringMap(func(key string) { + v := gogo.UnmarshalValue(s) + if s.Err() != nil { + return + } + x.StringValueMap[key] = v + }) + case "string_list_value_map", "stringListValueMap": + s.AddField("string_list_value_map") + x.StringListValueMap = make(map[string]*types.ListValue) + s.ReadStringMap(func(key string) { + v := gogo.UnmarshalListValue(s) + if s.Err() != nil { + return + } + x.StringListValueMap[key] = v + }) + case "string_struct_map", "stringStructMap": + s.AddField("string_struct_map") + x.StringStructMap = make(map[string]*types.Struct) + s.ReadStringMap(func(key string) { + v := gogo.UnmarshalStruct(s) + if s.Err() != nil { + return + } + x.StringStructMap[key] = v + }) + case "string_any_map", "stringAnyMap": + s.AddField("string_any_map") + x.StringAnyMap = make(map[string]*types.Any) + s.ReadStringMap(func(key string) { + v := gogo.UnmarshalAny(s) + if s.Err() != nil { + return + } + x.StringAnyMap[key] = v + }) + } + }) +} diff --git a/test/gogo/wkts_test.go b/test/gogo/wkts_test.go new file mode 100644 index 00000000..d6e848e8 --- /dev/null +++ b/test/gogo/wkts_test.go @@ -0,0 +1,828 @@ +package test_test + +import ( + "testing" + "time" + + . "github.com/TheThingsIndustries/protoc-gen-go-json/test/gogo" + "github.com/gogo/protobuf/proto" + "github.com/gogo/protobuf/types" +) + +var ( + testTime = time.Date(2006, time.January, 2, 15, 4, 5, 123456789, time.FixedZone("07:00", 7*3600)) + testDuration = time.Hour + 2*time.Minute + 3*time.Second + 123456789 +) + +func TestTimeDuration(t *testing.T) { + expectedTime := "2006-01-02T15:04:05.123456789+07:00" + if actualTime := testTime.Format(time.RFC3339Nano); actualTime != expectedTime { + t.Fatalf("expected timestamp %s, got %s", expectedTime, actualTime) + } + expectedDuration := "1h2m3.123456789s" + if actualDuration := testDuration.String(); actualDuration != expectedDuration { + t.Fatalf("expected timestamp %s, got %s", expectedDuration, actualDuration) + } +} + +func mustTimestamp(t time.Time) *types.Timestamp { + tmst, err := types.TimestampProto(t) + if err != nil { + panic(err) + } + return tmst +} + +func mustDuration(t time.Duration) *types.Duration { + return types.DurationProto(t) +} + +func mustAny(pb proto.Message) *types.Any { + any, err := types.MarshalAny(pb) + if err != nil { + panic(err) + } + return any +} + +var testMessagesWithWKTs = []struct { + name string + msg MessageWithWKTs + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithWKTs{}, + expected: `{}`, + }, + { + name: "zero", + msg: MessageWithWKTs{}, + expected: `{ + "double_value": null, + "double_values": [], + "float_value": null, + "float_values": [], + "int32_value": null, + "int32_values": [], + "int64_value": null, + "int64_values": [], + "uint32_value": null, + "uint32_values": [], + "uint64_value": null, + "uint64_values": [], + "bool_value": null, + "bool_values": [], + "string_value": null, + "string_values": [], + "bytes_value": null, + "bytes_values": [], + "empty_values": [], + "timestamp_value": null, + "timestamp_values": [], + "duration_value": null, + "duration_values": [], + "field_mask_value": null, + "field_mask_values": [], + "value_values": [], + "list_value_value": null, + "list_value_values": [], + "struct_value": null, + "struct_values": [], + "any_value": null, + "any_values": [] + }`, + expectedMask: []string{ + "double_value", + "double_values", + "float_value", + "float_values", + "int32_value", + "int32_values", + "int64_value", + "int64_values", + "uint32_value", + "uint32_values", + "uint64_value", + "uint64_values", + "bool_value", + "bool_values", + "string_value", + "string_values", + "bytes_value", + "bytes_values", + "empty_values", + "timestamp_value", + "timestamp_values", + "duration_value", + "duration_values", + "field_mask_value", + "field_mask_values", + "value_values", + "list_value_value", + "list_value_values", + "struct_value", + "struct_values", + "any_value", + "any_values", + }, + }, + { + name: "full", + msg: MessageWithWKTs{ + DoubleValue: &types.DoubleValue{Value: 12.34}, + DoubleValues: []*types.DoubleValue{ + {Value: 12.34}, + {Value: 56.78}, + }, + FloatValue: &types.FloatValue{Value: 12.34}, + FloatValues: []*types.FloatValue{ + {Value: 12.34}, + {Value: 56.78}, + }, + Int32Value: &types.Int32Value{Value: -42}, + Int32Values: []*types.Int32Value{ + {Value: 1}, + {Value: 2}, + {Value: -42}, + }, + Int64Value: &types.Int64Value{Value: -42}, + Int64Values: []*types.Int64Value{ + {Value: 1}, + {Value: 2}, + {Value: -42}, + }, + Uint32Value: &types.UInt32Value{Value: 42}, + Uint32Values: []*types.UInt32Value{ + {Value: 1}, + {Value: 2}, + {Value: 42}, + }, + Uint64Value: &types.UInt64Value{Value: 42}, + Uint64Values: []*types.UInt64Value{ + {Value: 1}, + {Value: 2}, + {Value: 42}, + }, + BoolValue: &types.BoolValue{Value: true}, + BoolValues: []*types.BoolValue{ + {Value: true}, + {Value: false}, + }, + StringValue: &types.StringValue{Value: "foo"}, + StringValues: []*types.StringValue{ + {Value: "foo"}, + {Value: "bar"}, + }, + BytesValue: &types.BytesValue{Value: []byte("foo")}, + BytesValues: []*types.BytesValue{ + {Value: []byte("foo")}, + {Value: []byte("bar")}, + }, + EmptyValue: &types.Empty{}, + EmptyValues: []*types.Empty{{}, {}}, + TimestampValue: mustTimestamp(testTime), + TimestampValues: []*types.Timestamp{ + mustTimestamp(testTime), + mustTimestamp(testTime.Truncate(10)), + mustTimestamp(testTime.Truncate(100)), + mustTimestamp(testTime.Truncate(1000)), + mustTimestamp(testTime.Truncate(10000)), + mustTimestamp(testTime.Truncate(100000)), + mustTimestamp(testTime.Truncate(1000000)), + mustTimestamp(testTime.Truncate(10000000)), + mustTimestamp(testTime.Truncate(100000000)), + mustTimestamp(testTime.Truncate(1000000000)), + }, + DurationValue: mustDuration(testDuration), + DurationValues: []*types.Duration{ + mustDuration(testDuration), + mustDuration(testDuration.Truncate(10)), + mustDuration(testDuration.Truncate(100)), + mustDuration(testDuration.Truncate(1000)), + mustDuration(testDuration.Truncate(10000)), + mustDuration(testDuration.Truncate(100000)), + mustDuration(testDuration.Truncate(1000000)), + mustDuration(testDuration.Truncate(10000000)), + mustDuration(testDuration.Truncate(100000000)), + mustDuration(testDuration.Truncate(1000000000)), + }, + FieldMaskValue: &types.FieldMask{Paths: []string{"foo.bar", "bar", "baz.qux"}}, + FieldMaskValues: []*types.FieldMask{ + {Paths: []string{"foo.bar", "bar", "baz.qux"}}, + }, + ValueValue: &types.Value{Kind: &types.Value_StringValue{StringValue: "foo"}}, + ValueValues: []*types.Value{ + {Kind: &types.Value_NullValue{}}, + {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, + {Kind: &types.Value_StringValue{StringValue: "foo"}}, + {Kind: &types.Value_BoolValue{BoolValue: true}}, + }, + ListValueValue: &types.ListValue{ + Values: []*types.Value{ + {Kind: &types.Value_NullValue{}}, + {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, + {Kind: &types.Value_StringValue{StringValue: "foo"}}, + {Kind: &types.Value_BoolValue{BoolValue: true}}, + }, + }, + ListValueValues: []*types.ListValue{ + { + Values: []*types.Value{ + {Kind: &types.Value_NullValue{}}, + {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, + {Kind: &types.Value_StringValue{StringValue: "foo"}}, + {Kind: &types.Value_BoolValue{BoolValue: true}}, + }, + }, + }, + StructValue: &types.Struct{ + Fields: map[string]*types.Value{ + "null": {Kind: &types.Value_NullValue{}}, + "number": {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, + "string": {Kind: &types.Value_StringValue{StringValue: "foo"}}, + "bool": {Kind: &types.Value_BoolValue{BoolValue: true}}, + }, + }, + StructValues: []*types.Struct{ + {Fields: map[string]*types.Value{"null": {Kind: &types.Value_NullValue{}}}}, + {Fields: map[string]*types.Value{"number": {Kind: &types.Value_NumberValue{NumberValue: 12.34}}}}, + {Fields: map[string]*types.Value{"string": {Kind: &types.Value_StringValue{StringValue: "foo"}}}}, + {Fields: map[string]*types.Value{"bool": {Kind: &types.Value_BoolValue{BoolValue: true}}}}, + }, + AnyValue: mustAny(&MessageWithMarshaler{Message: "hello"}), + AnyValues: []*types.Any{ + mustAny(&MessageWithMarshaler{Message: "hello"}), + mustAny(&MessageWithoutMarshaler{Message: "hello"}), + }, + }, + expected: `{ + "double_value": 12.34, + "double_values": [12.34, 56.78], + "float_value": 12.34, + "float_values": [12.34, 56.78], + "int32_value": -42, + "int32_values": [1, 2, -42], + "int64_value": "-42", + "int64_values": ["1", "2", "-42"], + "uint32_value": 42, + "uint32_values": [1, 2, 42], + "uint64_value": "42", + "uint64_values": ["1", "2", "42"], + "bool_value": true, + "bool_values": [true, false], + "string_value": "foo", + "string_values": ["foo", "bar"], + "bytes_value": "Zm9v", + "bytes_values": ["Zm9v", "YmFy"], + "empty_value": {}, + "empty_values": [{}, {}], + "timestamp_value": "2006-01-02T08:04:05.123456789Z", + "timestamp_values": [ + "2006-01-02T08:04:05.123456789Z", + "2006-01-02T08:04:05.123456780Z", + "2006-01-02T08:04:05.123456700Z", + "2006-01-02T08:04:05.123456Z", + "2006-01-02T08:04:05.123450Z", + "2006-01-02T08:04:05.123400Z", + "2006-01-02T08:04:05.123Z", + "2006-01-02T08:04:05.120Z", + "2006-01-02T08:04:05.100Z", + "2006-01-02T08:04:05Z" + ], + "duration_value": "3723.123456789s", + "duration_values": [ + "3723.123456789s", + "3723.123456780s", + "3723.123456700s", + "3723.123456s", + "3723.123450s", + "3723.123400s", + "3723.123s", + "3723.120s", + "3723.100s", + "3723s" + ], + "field_mask_value": "foo.bar,bar,baz.qux", + "field_mask_values": ["foo.bar,bar,baz.qux"], + "value_value": "foo", + "value_values": [null, 12.34, "foo", true], + "list_value_value": [null, 12.34, "foo", true], + "list_value_values": [[null, 12.34, "foo", true]], + "struct_value": { + "bool": true, + "null": null, + "number": 12.34, + "string": "foo" + }, + "struct_values": [ + {"null": null}, + {"number": 12.34}, + {"string": "foo"}, + {"bool": true} + ], + "any_value": { + "@type": "type.googleapis.com/thethings.json.test.MessageWithMarshaler", + "message": "hello" + }, + "any_values": [ + { + "@type": "type.googleapis.com/thethings.json.test.MessageWithMarshaler", + "message": "hello" + }, + { + "@type": "type.googleapis.com/thethings.json.test.MessageWithoutMarshaler", + "message": "hello" + } + ] + }`, + expectedMask: []string{ + "double_value", + "double_values", + "float_value", + "float_values", + "int32_value", + "int32_values", + "int64_value", + "int64_values", + "uint32_value", + "uint32_values", + "uint64_value", + "uint64_values", + "bool_value", + "bool_values", + "string_value", + "string_values", + "bytes_value", + "bytes_values", + "empty_value", + "empty_values", + "timestamp_value", + "timestamp_values", + "duration_value", + "duration_values", + "field_mask_value", + "field_mask_values", + "value_value", + "value_values", + "list_value_value", + "list_value_values", + "struct_value", + "struct_values", + "any_value", + "any_values", + }, + }, +} + +func TestMarshalMessageWithWKTs(t *testing.T) { + for _, tt := range testMessagesWithWKTs { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithWKTs(t *testing.T) { + for _, tt := range testMessagesWithWKTs { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithOneofWKTs = []struct { + name string + msg MessageWithOneofWKTs + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithOneofWKTs{}, + expected: `{}`, + }, + { + name: "double_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_DoubleValue{}, + }, + expected: `{"double_value": null}`, + expectedMask: []string{"double_value"}, + }, + { + name: "double_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_DoubleValue{DoubleValue: &types.DoubleValue{Value: 12.34}}, + }, + expected: `{"double_value": 12.34}`, + expectedMask: []string{"double_value"}, + }, + { + name: "float_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_FloatValue{}, + }, + expected: `{"float_value": null}`, + expectedMask: []string{"float_value"}, + }, + { + name: "float_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_FloatValue{FloatValue: &types.FloatValue{Value: 12.34}}, + }, + expected: `{"float_value": 12.34}`, + expectedMask: []string{"float_value"}, + }, + { + name: "int32_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Int32Value{}, + }, + expected: `{"int32_value": null}`, + expectedMask: []string{"int32_value"}, + }, + { + name: "int32_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Int32Value{Int32Value: &types.Int32Value{Value: -42}}, + }, + expected: `{"int32_value": -42}`, + expectedMask: []string{"int32_value"}, + }, + { + name: "int64_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Int64Value{}, + }, + expected: `{"int64_value": null}`, + expectedMask: []string{"int64_value"}, + }, + { + name: "int64_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Int64Value{Int64Value: &types.Int64Value{Value: -42}}, + }, + expected: `{"int64_value": "-42"}`, + expectedMask: []string{"int64_value"}, + }, + { + name: "uint32_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Uint32Value{}, + }, + expected: `{"uint32_value": null}`, + expectedMask: []string{"uint32_value"}, + }, + { + name: "uint32_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Uint32Value{Uint32Value: &types.UInt32Value{Value: 42}}, + }, + expected: `{"uint32_value": 42}`, + expectedMask: []string{"uint32_value"}, + }, + { + name: "uint64_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Uint64Value{}, + }, + expected: `{"uint64_value": null}`, + expectedMask: []string{"uint64_value"}, + }, + { + name: "uint64_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Uint64Value{Uint64Value: &types.UInt64Value{Value: 42}}, + }, + expected: `{"uint64_value": "42"}`, + expectedMask: []string{"uint64_value"}, + }, + { + name: "bool_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_BoolValue{}, + }, + expected: `{"bool_value": null}`, + expectedMask: []string{"bool_value"}, + }, + { + name: "bool_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_BoolValue{BoolValue: &types.BoolValue{Value: true}}, + }, + expected: `{"bool_value": true}`, + expectedMask: []string{"bool_value"}, + }, + { + name: "string_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_StringValue{}, + }, + expected: `{"string_value": null}`, + expectedMask: []string{"string_value"}, + }, + { + name: "string_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_StringValue{StringValue: &types.StringValue{Value: "foo"}}, + }, + expected: `{"string_value": "foo"}`, + expectedMask: []string{"string_value"}, + }, + { + name: "bytes_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_BytesValue{}, + }, + expected: `{"bytes_value": null}`, + expectedMask: []string{"bytes_value"}, + }, + { + name: "bytes_zero", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_BytesValue{BytesValue: &types.BytesValue{Value: []byte{}}}, + }, + expected: `{"bytes_value": ""}`, + expectedMask: []string{"bytes_value"}, + }, + { + name: "bytes_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_BytesValue{BytesValue: &types.BytesValue{Value: []byte("foo")}}, + }, + expected: `{"bytes_value": "Zm9v"}`, + expectedMask: []string{"bytes_value"}, + }, + { + name: "empty_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_EmptyValue{}, + }, + expected: `{"empty_value": null}`, + expectedMask: []string{"empty_value"}, + }, + { + name: "empty_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_EmptyValue{EmptyValue: &types.Empty{}}, + }, + expected: `{"empty_value": {}}`, + expectedMask: []string{"empty_value"}, + }, + { + name: "timestamp_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_TimestampValue{}, + }, + expected: `{"timestamp_value": null}`, + expectedMask: []string{"timestamp_value"}, + }, + { + name: "timestamp_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_TimestampValue{TimestampValue: mustTimestamp(testTime)}, + }, + expected: `{"timestamp_value": "2006-01-02T08:04:05.123456789Z"}`, + expectedMask: []string{"timestamp_value"}, + }, + { + name: "duration_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_DurationValue{}, + }, + expected: `{"duration_value": null}`, + expectedMask: []string{"duration_value"}, + }, + { + name: "duration_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_DurationValue{DurationValue: mustDuration(testDuration)}, + }, + expected: `{"duration_value": "3723.123456789s"}`, + expectedMask: []string{"duration_value"}, + }, + { + name: "field_mask_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_FieldMaskValue{}, + }, + expected: `{"field_mask_value": null}`, + expectedMask: []string{"field_mask_value"}, + }, + { + name: "field_mask_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_FieldMaskValue{FieldMaskValue: &types.FieldMask{Paths: []string{"foo.bar", "bar", "baz.qux"}}}, + }, + expected: `{"field_mask_value": "foo.bar,bar,baz.qux"}`, + expectedMask: []string{"field_mask_value"}, + }, + { + name: "value_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_ValueValue{ValueValue: &types.Value{Kind: &types.Value_NullValue{}}}, + }, + expected: `{"value_value": null}`, + expectedMask: []string{"value_value"}, + }, + { + name: "value_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_ValueValue{ValueValue: &types.Value{Kind: &types.Value_StringValue{StringValue: "foo"}}}, + }, + expected: `{"value_value": "foo"}`, + expectedMask: []string{"value_value"}, + }, + { + name: "list_value_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_ListValueValue{}, + }, + expected: `{"list_value_value": null}`, + expectedMask: []string{"list_value_value"}, + }, + { + name: "list_value_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_ListValueValue{ + ListValueValue: &types.ListValue{ + Values: []*types.Value{ + {Kind: &types.Value_NullValue{}}, + {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, + {Kind: &types.Value_StringValue{StringValue: "foo"}}, + {Kind: &types.Value_BoolValue{BoolValue: true}}, + }, + }, + }, + }, + expected: `{"list_value_value": [null, 12.34, "foo", true]}`, + expectedMask: []string{"list_value_value"}, + }, + { + name: "struct_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_StructValue{}, + }, + expected: `{"struct_value": null}`, + expectedMask: []string{"struct_value"}, + }, + { + name: "struct_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_StructValue{ + StructValue: &types.Struct{ + Fields: map[string]*types.Value{ + "null": {Kind: &types.Value_NullValue{}}, + "number": {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, + "string": {Kind: &types.Value_StringValue{StringValue: "foo"}}, + "bool": {Kind: &types.Value_BoolValue{BoolValue: true}}, + }, + }, + }, + }, + expected: `{"struct_value": {"bool": true, "null": null, "number": 12.34, "string": "foo"}}`, + expectedMask: []string{"struct_value"}, + }, + { + name: "any_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_AnyValue{}, + }, + expected: `{"any_value": null}`, + expectedMask: []string{"any_value"}, + }, + { + name: "any_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_AnyValue{ + AnyValue: mustAny(&MessageWithMarshaler{Message: "hello"}), + }, + }, + expected: `{"any_value": { + "@type": "type.googleapis.com/thethings.json.test.MessageWithMarshaler", + "message": "hello" + }}`, + expectedMask: []string{"any_value"}, + }, +} + +func TestMarshalMessageWithOneofWKTs(t *testing.T) { + for _, tt := range testMessagesWithOneofWKTs { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithOneofWKTs(t *testing.T) { + for _, tt := range testMessagesWithOneofWKTs { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithWKTMaps = []struct { + name string + msg MessageWithWKTMaps + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithWKTMaps{}, + expected: `{}`, + }, + { + name: "full", + msg: MessageWithWKTMaps{ + StringDoubleMap: map[string]*types.DoubleValue{"value": {Value: 12.34}}, + StringFloatMap: map[string]*types.FloatValue{"value": {Value: 12.34}}, + StringInt32Map: map[string]*types.Int32Value{"value": {Value: -42}}, + StringInt64Map: map[string]*types.Int64Value{"value": {Value: -42}}, + StringUint32Map: map[string]*types.UInt32Value{"value": {Value: 42}}, + StringUint64Map: map[string]*types.UInt64Value{"value": {Value: 42}}, + StringBoolMap: map[string]*types.BoolValue{"yes": {Value: true}}, + StringStringMap: map[string]*types.StringValue{"value": {Value: "foo"}}, + StringBytesMap: map[string]*types.BytesValue{"value": {Value: []byte("foo")}}, + StringEmptyMap: map[string]*types.Empty{"value": {}}, + StringTimestampMap: map[string]*types.Timestamp{"value": mustTimestamp(testTime)}, + StringDurationMap: map[string]*types.Duration{"value": mustDuration(testDuration)}, + StringFieldMaskMap: map[string]*types.FieldMask{"value": {Paths: []string{"foo.bar", "bar", "baz.qux"}}}, + StringValueMap: map[string]*types.Value{"value": {Kind: &types.Value_StringValue{StringValue: "foo"}}}, + StringListValueMap: map[string]*types.ListValue{"value": {Values: []*types.Value{ + {Kind: &types.Value_NullValue{}}, + {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, + {Kind: &types.Value_StringValue{StringValue: "foo"}}, + {Kind: &types.Value_BoolValue{BoolValue: true}}, + }}}, + StringStructMap: map[string]*types.Struct{ + "value": {Fields: map[string]*types.Value{ + "null": {Kind: &types.Value_NullValue{}}, + "number": {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, + "string": {Kind: &types.Value_StringValue{StringValue: "foo"}}, + "bool": {Kind: &types.Value_BoolValue{BoolValue: true}}, + }}, + }, + StringAnyMap: map[string]*types.Any{ + "value": mustAny(&MessageWithMarshaler{Message: "hello"}), + }, + }, + expected: `{ + "string_double_map": {"value": 12.34}, + "string_float_map": {"value": 12.34}, + "string_int32_map": {"value": -42}, + "string_int64_map": {"value": "-42"}, + "string_uint32_map": {"value": 42}, + "string_uint64_map": {"value": "42"}, + "string_bool_map": {"yes": true}, + "string_string_map": {"value": "foo"}, + "string_bytes_map": {"value": "Zm9v"}, + "string_empty_map": {"value": {}}, + "string_timestamp_map": {"value": "2006-01-02T08:04:05.123456789Z"}, + "string_duration_map": {"value": "3723.123456789s"}, + "string_field_mask_map": {"value": "foo.bar,bar,baz.qux"}, + "string_value_map": {"value": "foo"}, + "string_list_value_map": {"value": [null, 12.34, "foo", true]}, + "string_struct_map": {"value": {"bool": true, "null": null, "number": 12.34, "string": "foo"}}, + "string_any_map": {"value": {"@type": "type.googleapis.com/thethings.json.test.MessageWithMarshaler", "message": "hello"}} + }`, + expectedMask: []string{ + "string_double_map", + "string_float_map", + "string_int32_map", + "string_int64_map", + "string_uint32_map", + "string_uint64_map", + "string_bool_map", + "string_string_map", + "string_bytes_map", + "string_empty_map", + "string_timestamp_map", + "string_duration_map", + "string_field_mask_map", + "string_value_map", + "string_list_value_map", + "string_struct_map", + "string_any_map", + }, + }, +} + +func TestMarshalMessageWithWKTMaps(t *testing.T) { + for _, tt := range testMessagesWithWKTMaps { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithWKTMaps(t *testing.T) { + for _, tt := range testMessagesWithWKTMaps { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} diff --git a/test/golang/api.pb.go b/test/golang/api.pb.go new file mode 100644 index 00000000..374befb4 --- /dev/null +++ b/test/golang/api.pb.go @@ -0,0 +1,68 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.17.3 +// source: api.proto + +package test + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_api_proto protoreflect.FileDescriptor + +var file_api_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, + 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, + 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var file_api_proto_goTypes = []interface{}{} +var file_api_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_api_proto_init() } +func file_api_proto_init() { + if File_api_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_api_proto_goTypes, + DependencyIndexes: file_api_proto_depIdxs, + }.Build() + File_api_proto = out.File + file_api_proto_rawDesc = nil + file_api_proto_goTypes = nil + file_api_proto_depIdxs = nil +} diff --git a/test/golang/enums.pb.go b/test/golang/enums.pb.go new file mode 100644 index 00000000..f8ee4e50 --- /dev/null +++ b/test/golang/enums.pb.go @@ -0,0 +1,534 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.17.3 +// source: enums.proto + +package test + +import ( + _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + _ "github.com/gogo/protobuf/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type RegularEnum int32 + +const ( + RegularEnum_REGULAR_UNKNOWN RegularEnum = 0 + RegularEnum_REGULAR_A RegularEnum = 1 + RegularEnum_REGULAR_B RegularEnum = 2 +) + +// Enum value maps for RegularEnum. +var ( + RegularEnum_name = map[int32]string{ + 0: "REGULAR_UNKNOWN", + 1: "REGULAR_A", + 2: "REGULAR_B", + } + RegularEnum_value = map[string]int32{ + "REGULAR_UNKNOWN": 0, + "REGULAR_A": 1, + "REGULAR_B": 2, + } +) + +func (x RegularEnum) Enum() *RegularEnum { + p := new(RegularEnum) + *p = x + return p +} + +func (x RegularEnum) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RegularEnum) Descriptor() protoreflect.EnumDescriptor { + return file_enums_proto_enumTypes[0].Descriptor() +} + +func (RegularEnum) Type() protoreflect.EnumType { + return &file_enums_proto_enumTypes[0] +} + +func (x RegularEnum) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RegularEnum.Descriptor instead. +func (RegularEnum) EnumDescriptor() ([]byte, []int) { + return file_enums_proto_rawDescGZIP(), []int{0} +} + +type CustomEnum int32 + +const ( + CustomEnum_CUSTOM_UNKNOWN CustomEnum = 0 + CustomEnum_CUSTOM_V1_0 CustomEnum = 1 + CustomEnum_CUSTOM_V1_0_1 CustomEnum = 2 +) + +// Enum value maps for CustomEnum. +var ( + CustomEnum_name = map[int32]string{ + 0: "CUSTOM_UNKNOWN", + 1: "CUSTOM_V1_0", + 2: "CUSTOM_V1_0_1", + } + CustomEnum_value = map[string]int32{ + "CUSTOM_UNKNOWN": 0, + "CUSTOM_V1_0": 1, + "CUSTOM_V1_0_1": 2, + } +) + +func (x CustomEnum) Enum() *CustomEnum { + p := new(CustomEnum) + *p = x + return p +} + +func (x CustomEnum) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CustomEnum) Descriptor() protoreflect.EnumDescriptor { + return file_enums_proto_enumTypes[1].Descriptor() +} + +func (CustomEnum) Type() protoreflect.EnumType { + return &file_enums_proto_enumTypes[1] +} + +func (x CustomEnum) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CustomEnum.Descriptor instead. +func (CustomEnum) EnumDescriptor() ([]byte, []int) { + return file_enums_proto_rawDescGZIP(), []int{1} +} + +type CustomEnumValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value CustomEnum `protobuf:"varint,1,opt,name=value,proto3,enum=thethings.json.test.CustomEnum" json:"value,omitempty"` +} + +func (x *CustomEnumValue) Reset() { + *x = CustomEnumValue{} + if protoimpl.UnsafeEnabled { + mi := &file_enums_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CustomEnumValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CustomEnumValue) ProtoMessage() {} + +func (x *CustomEnumValue) ProtoReflect() protoreflect.Message { + mi := &file_enums_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CustomEnumValue.ProtoReflect.Descriptor instead. +func (*CustomEnumValue) Descriptor() ([]byte, []int) { + return file_enums_proto_rawDescGZIP(), []int{0} +} + +func (x *CustomEnumValue) GetValue() CustomEnum { + if x != nil { + return x.Value + } + return CustomEnum_CUSTOM_UNKNOWN +} + +type MessageWithEnums struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Regular RegularEnum `protobuf:"varint,1,opt,name=regular,proto3,enum=thethings.json.test.RegularEnum" json:"regular,omitempty"` + Regulars []RegularEnum `protobuf:"varint,2,rep,packed,name=regulars,proto3,enum=thethings.json.test.RegularEnum" json:"regulars,omitempty"` + Custom CustomEnum `protobuf:"varint,3,opt,name=custom,proto3,enum=thethings.json.test.CustomEnum" json:"custom,omitempty"` + Customs []CustomEnum `protobuf:"varint,4,rep,packed,name=customs,proto3,enum=thethings.json.test.CustomEnum" json:"customs,omitempty"` + WrappedCustom *CustomEnumValue `protobuf:"bytes,5,opt,name=wrapped_custom,json=wrappedCustom,proto3" json:"wrapped_custom,omitempty"` + WrappedCustoms []*CustomEnumValue `protobuf:"bytes,6,rep,name=wrapped_customs,json=wrappedCustoms,proto3" json:"wrapped_customs,omitempty"` +} + +func (x *MessageWithEnums) Reset() { + *x = MessageWithEnums{} + if protoimpl.UnsafeEnabled { + mi := &file_enums_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithEnums) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithEnums) ProtoMessage() {} + +func (x *MessageWithEnums) ProtoReflect() protoreflect.Message { + mi := &file_enums_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithEnums.ProtoReflect.Descriptor instead. +func (*MessageWithEnums) Descriptor() ([]byte, []int) { + return file_enums_proto_rawDescGZIP(), []int{1} +} + +func (x *MessageWithEnums) GetRegular() RegularEnum { + if x != nil { + return x.Regular + } + return RegularEnum_REGULAR_UNKNOWN +} + +func (x *MessageWithEnums) GetRegulars() []RegularEnum { + if x != nil { + return x.Regulars + } + return nil +} + +func (x *MessageWithEnums) GetCustom() CustomEnum { + if x != nil { + return x.Custom + } + return CustomEnum_CUSTOM_UNKNOWN +} + +func (x *MessageWithEnums) GetCustoms() []CustomEnum { + if x != nil { + return x.Customs + } + return nil +} + +func (x *MessageWithEnums) GetWrappedCustom() *CustomEnumValue { + if x != nil { + return x.WrappedCustom + } + return nil +} + +func (x *MessageWithEnums) GetWrappedCustoms() []*CustomEnumValue { + if x != nil { + return x.WrappedCustoms + } + return nil +} + +type MessageWithOneofEnums struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Value: + // *MessageWithOneofEnums_Regular + // *MessageWithOneofEnums_Custom + // *MessageWithOneofEnums_WrappedCustom + Value isMessageWithOneofEnums_Value `protobuf_oneof:"value"` +} + +func (x *MessageWithOneofEnums) Reset() { + *x = MessageWithOneofEnums{} + if protoimpl.UnsafeEnabled { + mi := &file_enums_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithOneofEnums) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithOneofEnums) ProtoMessage() {} + +func (x *MessageWithOneofEnums) ProtoReflect() protoreflect.Message { + mi := &file_enums_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithOneofEnums.ProtoReflect.Descriptor instead. +func (*MessageWithOneofEnums) Descriptor() ([]byte, []int) { + return file_enums_proto_rawDescGZIP(), []int{2} +} + +func (m *MessageWithOneofEnums) GetValue() isMessageWithOneofEnums_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *MessageWithOneofEnums) GetRegular() RegularEnum { + if x, ok := x.GetValue().(*MessageWithOneofEnums_Regular); ok { + return x.Regular + } + return RegularEnum_REGULAR_UNKNOWN +} + +func (x *MessageWithOneofEnums) GetCustom() CustomEnum { + if x, ok := x.GetValue().(*MessageWithOneofEnums_Custom); ok { + return x.Custom + } + return CustomEnum_CUSTOM_UNKNOWN +} + +func (x *MessageWithOneofEnums) GetWrappedCustom() *CustomEnumValue { + if x, ok := x.GetValue().(*MessageWithOneofEnums_WrappedCustom); ok { + return x.WrappedCustom + } + return nil +} + +type isMessageWithOneofEnums_Value interface { + isMessageWithOneofEnums_Value() +} + +type MessageWithOneofEnums_Regular struct { + Regular RegularEnum `protobuf:"varint,1,opt,name=regular,proto3,enum=thethings.json.test.RegularEnum,oneof"` +} + +type MessageWithOneofEnums_Custom struct { + Custom CustomEnum `protobuf:"varint,2,opt,name=custom,proto3,enum=thethings.json.test.CustomEnum,oneof"` +} + +type MessageWithOneofEnums_WrappedCustom struct { + WrappedCustom *CustomEnumValue `protobuf:"bytes,3,opt,name=wrapped_custom,json=wrappedCustom,proto3,oneof"` +} + +func (*MessageWithOneofEnums_Regular) isMessageWithOneofEnums_Value() {} + +func (*MessageWithOneofEnums_Custom) isMessageWithOneofEnums_Value() {} + +func (*MessageWithOneofEnums_WrappedCustom) isMessageWithOneofEnums_Value() {} + +var File_enums_proto protoreflect.FileDescriptor + +var file_enums_proto_rawDesc = []byte{ + 0x0a, 0x0b, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x74, + 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4f, 0x0a, 0x0f, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, + 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x05, + 0xea, 0x75, 0x02, 0x18, 0x01, 0x22, 0x9c, 0x03, 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x3a, 0x0a, 0x07, 0x72, 0x65, + 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, + 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x07, 0x72, + 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x3c, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, + 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, + 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x08, 0x72, 0x65, 0x67, 0x75, + 0x6c, 0x61, 0x72, 0x73, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x39, 0x0a, + 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1f, + 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, + 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x77, 0x72, 0x61, 0x70, + 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, + 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x4d, 0x0a, 0x0f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, + 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x43, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x73, 0x22, 0xe8, 0x01, 0x0a, 0x15, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x3c, + 0x0a, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, + 0x6d, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x39, 0x0a, 0x06, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, + 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x48, 0x00, 0x52, + 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x4d, 0x0a, 0x0e, 0x77, 0x72, 0x61, 0x70, 0x70, + 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, + 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, + 0x51, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x13, + 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x41, + 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x42, 0x10, + 0x02, 0x1a, 0x0f, 0xea, 0x75, 0x04, 0x08, 0x00, 0x20, 0x00, 0x88, 0xa3, 0x1e, 0x00, 0xb0, 0xa4, + 0x1e, 0x00, 0x2a, 0x70, 0x0a, 0x0a, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, + 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, + 0x57, 0x4e, 0x10, 0x00, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x56, + 0x31, 0x5f, 0x30, 0x10, 0x01, 0x1a, 0x0f, 0xea, 0x75, 0x0c, 0x0a, 0x03, 0x31, 0x2e, 0x30, 0x12, + 0x05, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x12, 0x1d, 0x0a, 0x0d, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, + 0x5f, 0x56, 0x31, 0x5f, 0x30, 0x5f, 0x31, 0x10, 0x02, 0x1a, 0x0a, 0xea, 0x75, 0x07, 0x0a, 0x05, + 0x31, 0x2e, 0x30, 0x2e, 0x31, 0x1a, 0x0d, 0xea, 0x75, 0x0a, 0x18, 0x01, 0x2a, 0x06, 0x43, 0x55, + 0x53, 0x54, 0x4f, 0x4d, 0x42, 0x47, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, + 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, + 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0xf0, 0xe2, + 0x1e, 0x01, 0xe8, 0xe2, 0x1e, 0x00, 0xea, 0x75, 0x04, 0x08, 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_enums_proto_rawDescOnce sync.Once + file_enums_proto_rawDescData = file_enums_proto_rawDesc +) + +func file_enums_proto_rawDescGZIP() []byte { + file_enums_proto_rawDescOnce.Do(func() { + file_enums_proto_rawDescData = protoimpl.X.CompressGZIP(file_enums_proto_rawDescData) + }) + return file_enums_proto_rawDescData +} + +var file_enums_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_enums_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_enums_proto_goTypes = []interface{}{ + (RegularEnum)(0), // 0: thethings.json.test.RegularEnum + (CustomEnum)(0), // 1: thethings.json.test.CustomEnum + (*CustomEnumValue)(nil), // 2: thethings.json.test.CustomEnumValue + (*MessageWithEnums)(nil), // 3: thethings.json.test.MessageWithEnums + (*MessageWithOneofEnums)(nil), // 4: thethings.json.test.MessageWithOneofEnums +} +var file_enums_proto_depIdxs = []int32{ + 1, // 0: thethings.json.test.CustomEnumValue.value:type_name -> thethings.json.test.CustomEnum + 0, // 1: thethings.json.test.MessageWithEnums.regular:type_name -> thethings.json.test.RegularEnum + 0, // 2: thethings.json.test.MessageWithEnums.regulars:type_name -> thethings.json.test.RegularEnum + 1, // 3: thethings.json.test.MessageWithEnums.custom:type_name -> thethings.json.test.CustomEnum + 1, // 4: thethings.json.test.MessageWithEnums.customs:type_name -> thethings.json.test.CustomEnum + 2, // 5: thethings.json.test.MessageWithEnums.wrapped_custom:type_name -> thethings.json.test.CustomEnumValue + 2, // 6: thethings.json.test.MessageWithEnums.wrapped_customs:type_name -> thethings.json.test.CustomEnumValue + 0, // 7: thethings.json.test.MessageWithOneofEnums.regular:type_name -> thethings.json.test.RegularEnum + 1, // 8: thethings.json.test.MessageWithOneofEnums.custom:type_name -> thethings.json.test.CustomEnum + 2, // 9: thethings.json.test.MessageWithOneofEnums.wrapped_custom:type_name -> thethings.json.test.CustomEnumValue + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_enums_proto_init() } +func file_enums_proto_init() { + if File_enums_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_enums_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CustomEnumValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_enums_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithEnums); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_enums_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithOneofEnums); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_enums_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*MessageWithOneofEnums_Regular)(nil), + (*MessageWithOneofEnums_Custom)(nil), + (*MessageWithOneofEnums_WrappedCustom)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_enums_proto_rawDesc, + NumEnums: 2, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_enums_proto_goTypes, + DependencyIndexes: file_enums_proto_depIdxs, + EnumInfos: file_enums_proto_enumTypes, + MessageInfos: file_enums_proto_msgTypes, + }.Build() + File_enums_proto = out.File + file_enums_proto_rawDesc = nil + file_enums_proto_goTypes = nil + file_enums_proto_depIdxs = nil +} diff --git a/test/golang/enums_json.pb.go b/test/golang/enums_json.pb.go new file mode 100644 index 00000000..de19104e --- /dev/null +++ b/test/golang/enums_json.pb.go @@ -0,0 +1,229 @@ +// Code generated by protoc-gen-go-json. DO NOT EDIT. +// versions: +// - protoc-gen-go-json v0.0.0-dev +// - protoc v3.17.3 +// source: enums.proto + +package test + +import ( + jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" +) + +// CustomEnum_customname contains custom string values that override CustomEnum_name. +var CustomEnum_customname = map[int32]string{ + 1: "1.0", + 2: "1.0.1", +} + +// MarshalProtoJSON marshals the CustomEnum to JSON. +func (x CustomEnum) MarshalProtoJSON(s *jsonplugin.MarshalState) { + s.WriteEnumString(int32(x), CustomEnum_customname, CustomEnum_name) +} + +// CustomEnum_customvalue contains custom string values that extend CustomEnum_value. +var CustomEnum_customvalue = map[string]int32{ + "UNKNOWN": 0, + "V1_0": 1, + "1.0": 1, + "1.0.0": 1, + "V1_0_1": 2, + "1.0.1": 2, +} + +// UnmarshalProtoJSON unmarshals the CustomEnum from JSON. +func (x *CustomEnum) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + v := s.ReadEnum(CustomEnum_value, CustomEnum_customvalue) + if err := s.Err(); err != nil { + s.SetErrorf("could not read CustomEnum enum: %v", err) + return + } + *x = CustomEnum(v) +} + +// MarshalProtoJSON marshals the CustomEnumValue message to JSON. +func (x *CustomEnumValue) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + x.Value.MarshalProtoJSON(s) + return +} + +// UnmarshalProtoJSON unmarshals the CustomEnumValue message from JSON. +func (x *CustomEnumValue) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + x.Value.UnmarshalProtoJSON(s) + return +} + +// MarshalProtoJSON marshals the MessageWithEnums message to JSON. +func (x *MessageWithEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Regular != 0 || s.HasField("regular") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("regular") + s.WriteEnum(int32(x.Regular), RegularEnum_name) + } + if len(x.Regulars) > 0 || s.HasField("regulars") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("regulars") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Regulars { + s.WriteMoreIf(&wroteElement) + s.WriteEnum(int32(element), RegularEnum_name) + } + s.WriteArrayEnd() + } + if x.Custom != 0 || s.HasField("custom") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("custom") + x.Custom.MarshalProtoJSON(s) + } + if len(x.Customs) > 0 || s.HasField("customs") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("customs") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Customs { + s.WriteMoreIf(&wroteElement) + element.MarshalProtoJSON(s) + } + s.WriteArrayEnd() + } + if x.WrappedCustom != nil || s.HasField("wrapped_custom") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("wrapped_custom") + x.WrappedCustom.MarshalProtoJSON(s.WithField("wrapped_custom")) + } + if len(x.WrappedCustoms) > 0 || s.HasField("wrapped_customs") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("wrapped_customs") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.WrappedCustoms { + s.WriteMoreIf(&wroteElement) + element.MarshalProtoJSON(s.WithField("wrapped_customs")) + } + s.WriteArrayEnd() + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithEnums message from JSON. +func (x *MessageWithEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "regular": + s.AddField("regular") + x.Regular = RegularEnum(s.ReadEnum(RegularEnum_value)) + case "regulars": + s.AddField("regulars") + s.ReadArray(func() { + x.Regulars = append(x.Regulars, RegularEnum(s.ReadEnum(RegularEnum_value))) + }) + case "custom": + s.AddField("custom") + x.Custom.UnmarshalProtoJSON(s) + case "customs": + s.AddField("customs") + s.ReadArray(func() { + var v CustomEnum + v.UnmarshalProtoJSON(s) + x.Customs = append(x.Customs, v) + }) + case "wrapped_custom", "wrappedCustom": + s.AddField("wrapped_custom") + if !s.ReadNil() { + x.WrappedCustom = &CustomEnumValue{} + x.WrappedCustom.UnmarshalProtoJSON(s.WithField("wrapped_custom", false)) + } + case "wrapped_customs", "wrappedCustoms": + s.AddField("wrapped_customs") + s.ReadArray(func() { + if s.ReadNil() { + x.WrappedCustoms = append(x.WrappedCustoms, nil) + return + } + v := &CustomEnumValue{} + v.UnmarshalProtoJSON(s.WithField("wrapped_customs", false)) + if s.Err() != nil { + return + } + x.WrappedCustoms = append(x.WrappedCustoms, v) + }) + } + }) +} + +// MarshalProtoJSON marshals the MessageWithOneofEnums message to JSON. +func (x *MessageWithOneofEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Value != nil { + switch ov := x.Value.(type) { + case *MessageWithOneofEnums_Regular: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("regular") + s.WriteEnum(int32(ov.Regular), RegularEnum_name) + case *MessageWithOneofEnums_Custom: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("custom") + ov.Custom.MarshalProtoJSON(s) + case *MessageWithOneofEnums_WrappedCustom: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("wrapped_custom") + ov.WrappedCustom.MarshalProtoJSON(s.WithField("wrapped_custom")) + } + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithOneofEnums message from JSON. +func (x *MessageWithOneofEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "regular": + s.AddField("regular") + ov := &MessageWithOneofEnums_Regular{} + ov.Regular = RegularEnum(s.ReadEnum(RegularEnum_value)) + x.Value = ov + case "custom": + s.AddField("custom") + ov := &MessageWithOneofEnums_Custom{} + ov.Custom.UnmarshalProtoJSON(s) + x.Value = ov + case "wrapped_custom", "wrappedCustom": + s.AddField("wrapped_custom") + ov := &MessageWithOneofEnums_WrappedCustom{} + if !s.ReadNil() { + ov.WrappedCustom = &CustomEnumValue{} + ov.WrappedCustom.UnmarshalProtoJSON(s.WithField("wrapped_custom", false)) + } + x.Value = ov + } + }) +} diff --git a/test/golang/enums_test.go b/test/golang/enums_test.go new file mode 100644 index 00000000..82206e68 --- /dev/null +++ b/test/golang/enums_test.go @@ -0,0 +1,172 @@ +package test_test + +import ( + "testing" + + . "github.com/TheThingsIndustries/protoc-gen-go-json/test/golang" +) + +var testMessagesWithWithEnums = []struct { + name string + msg MessageWithEnums + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithEnums{}, + expected: `{}`, + }, + { + name: "zero", + msg: MessageWithEnums{}, + expected: `{ + "regular": 0, + "regulars": [], + "custom": "CUSTOM_UNKNOWN", + "customs": [], + "wrapped_custom": null, + "wrapped_customs": [] + }`, + expectedMask: []string{ + "regular", + "regulars", + "custom", + "customs", + "wrapped_custom", + "wrapped_customs", + }, + }, + { + name: "full", + msg: MessageWithEnums{ + Regular: RegularEnum_REGULAR_A, + Regulars: []RegularEnum{RegularEnum_REGULAR_A, RegularEnum_REGULAR_B}, + Custom: CustomEnum_CUSTOM_V1_0, + Customs: []CustomEnum{ + CustomEnum_CUSTOM_V1_0, + CustomEnum_CUSTOM_V1_0_1, + }, + WrappedCustom: &CustomEnumValue{ + Value: CustomEnum_CUSTOM_V1_0, + }, + WrappedCustoms: []*CustomEnumValue{ + {Value: CustomEnum_CUSTOM_V1_0}, + {Value: CustomEnum_CUSTOM_V1_0_1}, + }, + }, + expected: `{ + "regular": 1, + "regulars": [1, 2], + "custom": "1.0", + "customs": ["1.0", "1.0.1"], + "wrapped_custom": "1.0", + "wrapped_customs": ["1.0", "1.0.1"] + }`, + expectedMask: []string{ + "regular", + "regulars", + "custom", + "customs", + "wrapped_custom", + "wrapped_customs", + }, + }, +} + +func TestMarshalMessageWithEnums(t *testing.T) { + for _, tt := range testMessagesWithWithEnums { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithEnums(t *testing.T) { + for _, tt := range testMessagesWithWithEnums { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithWithOneofEnums = []struct { + name string + msg MessageWithOneofEnums + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithOneofEnums{}, + expected: `{}`, + }, + { + name: "regular_zero", + msg: MessageWithOneofEnums{ + Value: &MessageWithOneofEnums_Regular{Regular: RegularEnum_REGULAR_UNKNOWN}, + }, + expected: `{"regular": 0}`, + expectedMask: []string{"regular"}, + }, + { + name: "regular", + msg: MessageWithOneofEnums{ + Value: &MessageWithOneofEnums_Regular{Regular: RegularEnum_REGULAR_A}, + }, + expected: `{"regular": 1}`, + expectedMask: []string{"regular"}, + }, + { + name: "custom_zero", + msg: MessageWithOneofEnums{ + Value: &MessageWithOneofEnums_Custom{Custom: CustomEnum_CUSTOM_UNKNOWN}, + }, + expected: `{"custom": "CUSTOM_UNKNOWN"}`, + expectedMask: []string{"custom"}, + }, + { + name: "custom", + msg: MessageWithOneofEnums{ + Value: &MessageWithOneofEnums_Custom{Custom: CustomEnum_CUSTOM_V1_0}, + }, + expected: `{"custom": "1.0"}`, + expectedMask: []string{"custom"}, + }, + { + name: "wrapped_zero", + msg: MessageWithOneofEnums{ + Value: &MessageWithOneofEnums_WrappedCustom{WrappedCustom: &CustomEnumValue{ + Value: CustomEnum_CUSTOM_UNKNOWN, + }}, + }, + expected: `{"wrapped_custom": "CUSTOM_UNKNOWN"}`, + expectedMask: []string{"wrapped_custom"}, + }, + { + name: "wrapped", + msg: MessageWithOneofEnums{ + Value: &MessageWithOneofEnums_WrappedCustom{WrappedCustom: &CustomEnumValue{ + Value: CustomEnum_CUSTOM_V1_0, + }}, + }, + expected: `{"wrapped_custom": "1.0"}`, + expectedMask: []string{"wrapped_custom"}, + }, +} + +func TestMarshalMessageWithOneofEnums(t *testing.T) { + for _, tt := range testMessagesWithWithOneofEnums { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithOneofEnums(t *testing.T) { + for _, tt := range testMessagesWithWithOneofEnums { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} diff --git a/test/golang/gogo.pb.go b/test/golang/gogo.pb.go new file mode 100644 index 00000000..2f7922ef --- /dev/null +++ b/test/golang/gogo.pb.go @@ -0,0 +1,704 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.17.3 +// source: gogo.proto + +package test + +import ( + _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + _ "github.com/gogo/protobuf/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MessageWithGoGoOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EuiWithCustomName []byte `protobuf:"bytes,1,opt,name=eui_with_custom_name,json=euiWithCustomName,proto3" json:"eui_with_custom_name,omitempty"` + EuiWithCustomNameAndType []byte `protobuf:"bytes,2,opt,name=eui_with_custom_name_and_type,json=euiWithCustomNameAndType,proto3" json:"eui_with_custom_name_and_type,omitempty"` + NonNullableEuiWithCustomNameAndType []byte `protobuf:"bytes,3,opt,name=non_nullable_eui_with_custom_name_and_type,json=nonNullableEuiWithCustomNameAndType,proto3" json:"non_nullable_eui_with_custom_name_and_type,omitempty"` + EuisWithCustomNameAndType [][]byte `protobuf:"bytes,4,rep,name=euis_with_custom_name_and_type,json=euisWithCustomNameAndType,proto3" json:"euis_with_custom_name_and_type,omitempty"` + Duration *durationpb.Duration `protobuf:"bytes,5,opt,name=duration,proto3" json:"duration,omitempty"` + NonNullableDuration *durationpb.Duration `protobuf:"bytes,6,opt,name=non_nullable_duration,json=nonNullableDuration,proto3" json:"non_nullable_duration,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + NonNullableTimestamp *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=non_nullable_timestamp,json=nonNullableTimestamp,proto3" json:"non_nullable_timestamp,omitempty"` +} + +func (x *MessageWithGoGoOptions) Reset() { + *x = MessageWithGoGoOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_gogo_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithGoGoOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithGoGoOptions) ProtoMessage() {} + +func (x *MessageWithGoGoOptions) ProtoReflect() protoreflect.Message { + mi := &file_gogo_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithGoGoOptions.ProtoReflect.Descriptor instead. +func (*MessageWithGoGoOptions) Descriptor() ([]byte, []int) { + return file_gogo_proto_rawDescGZIP(), []int{0} +} + +func (x *MessageWithGoGoOptions) GetEuiWithCustomName() []byte { + if x != nil { + return x.EuiWithCustomName + } + return nil +} + +func (x *MessageWithGoGoOptions) GetEuiWithCustomNameAndType() []byte { + if x != nil { + return x.EuiWithCustomNameAndType + } + return nil +} + +func (x *MessageWithGoGoOptions) GetNonNullableEuiWithCustomNameAndType() []byte { + if x != nil { + return x.NonNullableEuiWithCustomNameAndType + } + return nil +} + +func (x *MessageWithGoGoOptions) GetEuisWithCustomNameAndType() [][]byte { + if x != nil { + return x.EuisWithCustomNameAndType + } + return nil +} + +func (x *MessageWithGoGoOptions) GetDuration() *durationpb.Duration { + if x != nil { + return x.Duration + } + return nil +} + +func (x *MessageWithGoGoOptions) GetNonNullableDuration() *durationpb.Duration { + if x != nil { + return x.NonNullableDuration + } + return nil +} + +func (x *MessageWithGoGoOptions) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *MessageWithGoGoOptions) GetNonNullableTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.NonNullableTimestamp + } + return nil +} + +type SubMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` +} + +func (x *SubMessage) Reset() { + *x = SubMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_gogo_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubMessage) ProtoMessage() {} + +func (x *SubMessage) ProtoReflect() protoreflect.Message { + mi := &file_gogo_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubMessage.ProtoReflect.Descriptor instead. +func (*SubMessage) Descriptor() ([]byte, []int) { + return file_gogo_proto_rawDescGZIP(), []int{1} +} + +func (x *SubMessage) GetField() string { + if x != nil { + return x.Field + } + return "" +} + +type SubMessageWithoutMarshalers struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OtherField string `protobuf:"bytes,1,opt,name=other_field,json=otherField,proto3" json:"other_field,omitempty"` +} + +func (x *SubMessageWithoutMarshalers) Reset() { + *x = SubMessageWithoutMarshalers{} + if protoimpl.UnsafeEnabled { + mi := &file_gogo_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubMessageWithoutMarshalers) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubMessageWithoutMarshalers) ProtoMessage() {} + +func (x *SubMessageWithoutMarshalers) ProtoReflect() protoreflect.Message { + mi := &file_gogo_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubMessageWithoutMarshalers.ProtoReflect.Descriptor instead. +func (*SubMessageWithoutMarshalers) Descriptor() ([]byte, []int) { + return file_gogo_proto_rawDescGZIP(), []int{2} +} + +func (x *SubMessageWithoutMarshalers) GetOtherField() string { + if x != nil { + return x.OtherField + } + return "" +} + +type MessageWithNullable struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sub *SubMessage `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"` + Subs []*SubMessage `protobuf:"bytes,2,rep,name=subs,proto3" json:"subs,omitempty"` + OtherSub *SubMessageWithoutMarshalers `protobuf:"bytes,3,opt,name=other_sub,json=otherSub,proto3" json:"other_sub,omitempty"` + OtherSubs []*SubMessageWithoutMarshalers `protobuf:"bytes,4,rep,name=other_subs,json=otherSubs,proto3" json:"other_subs,omitempty"` +} + +func (x *MessageWithNullable) Reset() { + *x = MessageWithNullable{} + if protoimpl.UnsafeEnabled { + mi := &file_gogo_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithNullable) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithNullable) ProtoMessage() {} + +func (x *MessageWithNullable) ProtoReflect() protoreflect.Message { + mi := &file_gogo_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithNullable.ProtoReflect.Descriptor instead. +func (*MessageWithNullable) Descriptor() ([]byte, []int) { + return file_gogo_proto_rawDescGZIP(), []int{3} +} + +func (x *MessageWithNullable) GetSub() *SubMessage { + if x != nil { + return x.Sub + } + return nil +} + +func (x *MessageWithNullable) GetSubs() []*SubMessage { + if x != nil { + return x.Subs + } + return nil +} + +func (x *MessageWithNullable) GetOtherSub() *SubMessageWithoutMarshalers { + if x != nil { + return x.OtherSub + } + return nil +} + +func (x *MessageWithNullable) GetOtherSubs() []*SubMessageWithoutMarshalers { + if x != nil { + return x.OtherSubs + } + return nil +} + +type MessageWithEmbedded struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sub *SubMessage `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"` + OtherSub *SubMessageWithoutMarshalers `protobuf:"bytes,2,opt,name=other_sub,json=otherSub,proto3" json:"other_sub,omitempty"` +} + +func (x *MessageWithEmbedded) Reset() { + *x = MessageWithEmbedded{} + if protoimpl.UnsafeEnabled { + mi := &file_gogo_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithEmbedded) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithEmbedded) ProtoMessage() {} + +func (x *MessageWithEmbedded) ProtoReflect() protoreflect.Message { + mi := &file_gogo_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithEmbedded.ProtoReflect.Descriptor instead. +func (*MessageWithEmbedded) Descriptor() ([]byte, []int) { + return file_gogo_proto_rawDescGZIP(), []int{4} +} + +func (x *MessageWithEmbedded) GetSub() *SubMessage { + if x != nil { + return x.Sub + } + return nil +} + +func (x *MessageWithEmbedded) GetOtherSub() *SubMessageWithoutMarshalers { + if x != nil { + return x.OtherSub + } + return nil +} + +type MessageWithNullableEmbedded struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sub *SubMessage `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"` + OtherSub *SubMessageWithoutMarshalers `protobuf:"bytes,2,opt,name=other_sub,json=otherSub,proto3" json:"other_sub,omitempty"` +} + +func (x *MessageWithNullableEmbedded) Reset() { + *x = MessageWithNullableEmbedded{} + if protoimpl.UnsafeEnabled { + mi := &file_gogo_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithNullableEmbedded) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithNullableEmbedded) ProtoMessage() {} + +func (x *MessageWithNullableEmbedded) ProtoReflect() protoreflect.Message { + mi := &file_gogo_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithNullableEmbedded.ProtoReflect.Descriptor instead. +func (*MessageWithNullableEmbedded) Descriptor() ([]byte, []int) { + return file_gogo_proto_rawDescGZIP(), []int{5} +} + +func (x *MessageWithNullableEmbedded) GetSub() *SubMessage { + if x != nil { + return x.Sub + } + return nil +} + +func (x *MessageWithNullableEmbedded) GetOtherSub() *SubMessageWithoutMarshalers { + if x != nil { + return x.OtherSub + } + return nil +} + +var File_gogo_proto protoreflect.FileDescriptor + +var file_gogo_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x74, 0x68, + 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, + 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x0b, 0x0a, 0x16, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x57, 0x69, 0x74, 0x68, 0x47, 0x6f, 0x47, 0x6f, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x46, 0x0a, 0x14, 0x65, 0x75, 0x69, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x15, 0xe2, + 0xde, 0x1f, 0x11, 0x45, 0x55, 0x49, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x11, 0x65, 0x75, 0x69, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0xbc, 0x02, 0x0a, 0x1d, 0x65, 0x75, 0x69, 0x5f, + 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0xfa, 0x01, 0xe2, 0xde, 0x1f, 0x18, 0x45, 0x55, 0x49, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0xda, 0xde, + 0x1f, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, + 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, + 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, + 0x55, 0x49, 0x36, 0x34, 0xea, 0x75, 0x94, 0x01, 0x0a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, + 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, + 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, + 0x58, 0x12, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, + 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, + 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x52, 0x18, 0x65, 0x75, + 0x69, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, + 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0xe3, 0x02, 0x0a, 0x2a, 0x6e, 0x6f, 0x6e, 0x5f, 0x6e, + 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x75, 0x69, 0x5f, 0x77, 0x69, 0x74, 0x68, + 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x6e, 0x64, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x89, 0x02, 0xe2, 0xde, + 0x1f, 0x23, 0x4e, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x55, 0x49, + 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, + 0x64, 0x54, 0x79, 0x70, 0x65, 0xda, 0xde, 0x1f, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, + 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, + 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x55, 0x49, 0x36, 0x34, 0xc8, 0xde, 0x1f, 0x00, 0xea, + 0x75, 0x94, 0x01, 0x0a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, + 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, + 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x12, 0x49, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, + 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6d, 0x61, 0x72, + 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x52, 0x23, 0x6e, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, + 0x61, 0x62, 0x6c, 0x65, 0x45, 0x75, 0x69, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0xc9, 0x02, 0x0a, + 0x1e, 0x65, 0x75, 0x69, 0x73, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x85, 0x02, 0xe2, 0xde, 0x1f, 0x19, 0x45, 0x55, 0x49, 0x73, + 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, + 0x64, 0x54, 0x79, 0x70, 0x65, 0xda, 0xde, 0x1f, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, + 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, + 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x55, 0x49, 0x36, 0x34, 0xea, 0x75, 0x9e, 0x01, 0x0a, + 0x4c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, + 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, + 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x4e, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, + 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6d, 0x61, + 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x19, 0x65, + 0x75, 0x69, 0x73, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, + 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x08, 0x64, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x57, 0x0a, 0x15, 0x6e, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6c, + 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x13, 0x6e, 0x6f, 0x6e, 0x4e, 0x75, + 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, + 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, + 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x5a, + 0x0a, 0x16, 0x6e, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, + 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x14, 0x6e, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x22, 0x0a, 0x0a, 0x53, 0x75, + 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x22, 0x47, + 0x0a, 0x1b, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, + 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x0a, + 0x0b, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x3a, 0x07, + 0xea, 0x75, 0x04, 0x08, 0x00, 0x10, 0x00, 0x22, 0xb5, 0x02, 0x0a, 0x13, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, + 0x37, 0x0a, 0x03, 0x73, 0x75, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, + 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x03, 0x73, 0x75, 0x62, 0x12, 0x39, 0x0a, 0x04, 0x73, 0x75, 0x62, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x04, 0x73, + 0x75, 0x62, 0x73, 0x12, 0x53, 0x0a, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, + 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, + 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x75, 0x62, 0x12, 0x55, 0x0a, 0x0a, 0x6f, 0x74, 0x68, 0x65, + 0x72, 0x5f, 0x73, 0x75, 0x62, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, + 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, + 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x75, 0x62, 0x73, 0x22, + 0xa3, 0x01, 0x0a, 0x13, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, + 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x03, 0x73, 0x75, 0x62, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x04, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x03, 0x73, 0x75, 0x62, + 0x12, 0x53, 0x0a, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, + 0x61, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x04, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x08, 0x6f, 0x74, 0x68, + 0x65, 0x72, 0x53, 0x75, 0x62, 0x22, 0xb3, 0x01, 0x0a, 0x1b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x6d, 0x62, + 0x65, 0x64, 0x64, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x03, 0x73, 0x75, 0x62, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, + 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x03, 0x73, + 0x75, 0x62, 0x12, 0x57, 0x0a, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, + 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0xd0, 0xde, 0x1f, + 0x01, 0x52, 0x08, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x75, 0x62, 0x42, 0x3f, 0x5a, 0x36, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, + 0x2f, 0x74, 0x65, 0x73, 0x74, 0xea, 0x75, 0x04, 0x08, 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_gogo_proto_rawDescOnce sync.Once + file_gogo_proto_rawDescData = file_gogo_proto_rawDesc +) + +func file_gogo_proto_rawDescGZIP() []byte { + file_gogo_proto_rawDescOnce.Do(func() { + file_gogo_proto_rawDescData = protoimpl.X.CompressGZIP(file_gogo_proto_rawDescData) + }) + return file_gogo_proto_rawDescData +} + +var file_gogo_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_gogo_proto_goTypes = []interface{}{ + (*MessageWithGoGoOptions)(nil), // 0: thethings.json.test.MessageWithGoGoOptions + (*SubMessage)(nil), // 1: thethings.json.test.SubMessage + (*SubMessageWithoutMarshalers)(nil), // 2: thethings.json.test.SubMessageWithoutMarshalers + (*MessageWithNullable)(nil), // 3: thethings.json.test.MessageWithNullable + (*MessageWithEmbedded)(nil), // 4: thethings.json.test.MessageWithEmbedded + (*MessageWithNullableEmbedded)(nil), // 5: thethings.json.test.MessageWithNullableEmbedded + (*durationpb.Duration)(nil), // 6: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp +} +var file_gogo_proto_depIdxs = []int32{ + 6, // 0: thethings.json.test.MessageWithGoGoOptions.duration:type_name -> google.protobuf.Duration + 6, // 1: thethings.json.test.MessageWithGoGoOptions.non_nullable_duration:type_name -> google.protobuf.Duration + 7, // 2: thethings.json.test.MessageWithGoGoOptions.timestamp:type_name -> google.protobuf.Timestamp + 7, // 3: thethings.json.test.MessageWithGoGoOptions.non_nullable_timestamp:type_name -> google.protobuf.Timestamp + 1, // 4: thethings.json.test.MessageWithNullable.sub:type_name -> thethings.json.test.SubMessage + 1, // 5: thethings.json.test.MessageWithNullable.subs:type_name -> thethings.json.test.SubMessage + 2, // 6: thethings.json.test.MessageWithNullable.other_sub:type_name -> thethings.json.test.SubMessageWithoutMarshalers + 2, // 7: thethings.json.test.MessageWithNullable.other_subs:type_name -> thethings.json.test.SubMessageWithoutMarshalers + 1, // 8: thethings.json.test.MessageWithEmbedded.sub:type_name -> thethings.json.test.SubMessage + 2, // 9: thethings.json.test.MessageWithEmbedded.other_sub:type_name -> thethings.json.test.SubMessageWithoutMarshalers + 1, // 10: thethings.json.test.MessageWithNullableEmbedded.sub:type_name -> thethings.json.test.SubMessage + 2, // 11: thethings.json.test.MessageWithNullableEmbedded.other_sub:type_name -> thethings.json.test.SubMessageWithoutMarshalers + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_gogo_proto_init() } +func file_gogo_proto_init() { + if File_gogo_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_gogo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithGoGoOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gogo_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gogo_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubMessageWithoutMarshalers); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gogo_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithNullable); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gogo_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithEmbedded); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gogo_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithNullableEmbedded); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_gogo_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_gogo_proto_goTypes, + DependencyIndexes: file_gogo_proto_depIdxs, + MessageInfos: file_gogo_proto_msgTypes, + }.Build() + File_gogo_proto = out.File + file_gogo_proto_rawDesc = nil + file_gogo_proto_goTypes = nil + file_gogo_proto_depIdxs = nil +} diff --git a/test/golang/gogo_json.pb.go b/test/golang/gogo_json.pb.go new file mode 100644 index 00000000..cf2be3e2 --- /dev/null +++ b/test/golang/gogo_json.pb.go @@ -0,0 +1,348 @@ +// Code generated by protoc-gen-go-json. DO NOT EDIT. +// versions: +// - protoc-gen-go-json v0.0.0-dev +// - protoc v3.17.3 +// source: gogo.proto + +package test + +import ( + golang "github.com/TheThingsIndustries/protoc-gen-go-json/golang" + jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" + types "github.com/TheThingsIndustries/protoc-gen-go-json/test/types" +) + +// MarshalProtoJSON marshals the MessageWithGoGoOptions message to JSON. +func (x *MessageWithGoGoOptions) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if len(x.EuiWithCustomName) > 0 || s.HasField("eui_with_custom_name") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("eui_with_custom_name") + s.WriteBytes(x.EuiWithCustomName) + } + if len(x.EuiWithCustomNameAndType) > 0 || s.HasField("eui_with_custom_name_and_type") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("eui_with_custom_name_and_type") + types.MarshalHEX(s.WithField("eui_with_custom_name_and_type"), x.EuiWithCustomNameAndType) + } + if len(x.NonNullableEuiWithCustomNameAndType) > 0 || s.HasField("non_nullable_eui_with_custom_name_and_type") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("non_nullable_eui_with_custom_name_and_type") + types.MarshalHEX(s.WithField("non_nullable_eui_with_custom_name_and_type"), x.NonNullableEuiWithCustomNameAndType) + } + if len(x.EuisWithCustomNameAndType) > 0 || s.HasField("euis_with_custom_name_and_type") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("euis_with_custom_name_and_type") + types.MarshalHEXArray(s.WithField("euis_with_custom_name_and_type"), x.EuisWithCustomNameAndType) + } + if x.Duration != nil || s.HasField("duration") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("duration") + if x.Duration == nil { + s.WriteNil() + } else { + golang.MarshalDuration(s, x.Duration) + } + } + if x.NonNullableDuration != nil || s.HasField("non_nullable_duration") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("non_nullable_duration") + if x.NonNullableDuration == nil { + s.WriteNil() + } else { + golang.MarshalDuration(s, x.NonNullableDuration) + } + } + if x.Timestamp != nil || s.HasField("timestamp") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("timestamp") + if x.Timestamp == nil { + s.WriteNil() + } else { + golang.MarshalTimestamp(s, x.Timestamp) + } + } + if x.NonNullableTimestamp != nil || s.HasField("non_nullable_timestamp") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("non_nullable_timestamp") + if x.NonNullableTimestamp == nil { + s.WriteNil() + } else { + golang.MarshalTimestamp(s, x.NonNullableTimestamp) + } + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithGoGoOptions message from JSON. +func (x *MessageWithGoGoOptions) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "eui_with_custom_name", "euiWithCustomName": + s.AddField("eui_with_custom_name") + x.EuiWithCustomName = s.ReadBytes() + case "eui_with_custom_name_and_type", "euiWithCustomNameAndType": + s.AddField("eui_with_custom_name_and_type") + x.EuiWithCustomNameAndType = types.UnmarshalHEX(s.WithField("eui_with_custom_name_and_type", false)) + case "non_nullable_eui_with_custom_name_and_type", "nonNullableEuiWithCustomNameAndType": + s.AddField("non_nullable_eui_with_custom_name_and_type") + x.NonNullableEuiWithCustomNameAndType = types.UnmarshalHEX(s.WithField("non_nullable_eui_with_custom_name_and_type", false)) + case "euis_with_custom_name_and_type", "euisWithCustomNameAndType": + s.AddField("euis_with_custom_name_and_type") + x.EuisWithCustomNameAndType = types.UnmarshalHEXArray(s.WithField("euis_with_custom_name_and_type", false)) + case "duration": + s.AddField("duration") + v := golang.UnmarshalDuration(s) + if s.Err() != nil { + return + } + x.Duration = v + case "non_nullable_duration", "nonNullableDuration": + s.AddField("non_nullable_duration") + v := golang.UnmarshalDuration(s) + if s.Err() != nil { + return + } + x.NonNullableDuration = v + case "timestamp": + s.AddField("timestamp") + v := golang.UnmarshalTimestamp(s) + if s.Err() != nil { + return + } + x.Timestamp = v + case "non_nullable_timestamp", "nonNullableTimestamp": + s.AddField("non_nullable_timestamp") + v := golang.UnmarshalTimestamp(s) + if s.Err() != nil { + return + } + x.NonNullableTimestamp = v + } + }) +} + +// MarshalProtoJSON marshals the SubMessage message to JSON. +func (x *SubMessage) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Field != "" || s.HasField("field") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("field") + s.WriteString(x.Field) + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the SubMessage message from JSON. +func (x *SubMessage) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "field": + s.AddField("field") + x.Field = s.ReadString() + } + }) +} + +// MarshalProtoJSON marshals the MessageWithNullable message to JSON. +func (x *MessageWithNullable) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Sub != nil || s.HasField("sub") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sub") + x.Sub.MarshalProtoJSON(s.WithField("sub")) + } + if len(x.Subs) > 0 || s.HasField("subs") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("subs") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Subs { + s.WriteMoreIf(&wroteElement) + element.MarshalProtoJSON(s.WithField("subs")) + } + s.WriteArrayEnd() + } + if x.OtherSub != nil || s.HasField("other_sub") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("other_sub") + // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. + golang.MarshalMessage(s, x.OtherSub) + } + if len(x.OtherSubs) > 0 || s.HasField("other_subs") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("other_subs") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.OtherSubs { + s.WriteMoreIf(&wroteElement) + // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. + golang.MarshalMessage(s, element) + } + s.WriteArrayEnd() + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithNullable message from JSON. +func (x *MessageWithNullable) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "sub": + if !s.ReadNil() { + x.Sub = &SubMessage{} + x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) + } + case "subs": + s.AddField("subs") + s.ReadArray(func() { + if s.ReadNil() { + x.Subs = append(x.Subs, nil) + return + } + v := &SubMessage{} + v.UnmarshalProtoJSON(s.WithField("subs", false)) + if s.Err() != nil { + return + } + x.Subs = append(x.Subs, v) + }) + case "other_sub", "otherSub": + s.AddField("other_sub") + // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. + var v SubMessageWithoutMarshalers + golang.UnmarshalMessage(s, &v) + x.OtherSub = &v + case "other_subs", "otherSubs": + s.AddField("other_subs") + s.ReadArray(func() { + // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. + var v SubMessageWithoutMarshalers + golang.UnmarshalMessage(s, &v) + x.OtherSubs = append(x.OtherSubs, &v) + }) + } + }) +} + +// MarshalProtoJSON marshals the MessageWithEmbedded message to JSON. +func (x *MessageWithEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Sub != nil || s.HasField("sub") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sub") + x.Sub.MarshalProtoJSON(s.WithField("sub")) + } + if x.OtherSub != nil || s.HasField("other_sub") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("other_sub") + // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. + golang.MarshalMessage(s, x.OtherSub) + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithEmbedded message from JSON. +func (x *MessageWithEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "sub": + if !s.ReadNil() { + x.Sub = &SubMessage{} + x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) + } + case "other_sub", "otherSub": + s.AddField("other_sub") + // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. + var v SubMessageWithoutMarshalers + golang.UnmarshalMessage(s, &v) + x.OtherSub = &v + } + }) +} + +// MarshalProtoJSON marshals the MessageWithNullableEmbedded message to JSON. +func (x *MessageWithNullableEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Sub != nil || s.HasField("sub") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sub") + x.Sub.MarshalProtoJSON(s.WithField("sub")) + } + if x.OtherSub != nil || s.HasField("other_sub") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("other_sub") + // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. + golang.MarshalMessage(s, x.OtherSub) + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithNullableEmbedded message from JSON. +func (x *MessageWithNullableEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "sub": + if !s.ReadNil() { + x.Sub = &SubMessage{} + x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) + } + case "other_sub", "otherSub": + s.AddField("other_sub") + // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. + var v SubMessageWithoutMarshalers + golang.UnmarshalMessage(s, &v) + x.OtherSub = &v + } + }) +} diff --git a/test/golang/gogo_test.go b/test/golang/gogo_test.go new file mode 100644 index 00000000..17042ceb --- /dev/null +++ b/test/golang/gogo_test.go @@ -0,0 +1,262 @@ +package test_test + +import ( + "testing" + + . "github.com/TheThingsIndustries/protoc-gen-go-json/test/golang" +) + +var testMessagesWithGoGoOptions = []struct { + name string + msg MessageWithGoGoOptions + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithGoGoOptions{}, + expected: `{}`, + }, + { + name: "zero", + msg: MessageWithGoGoOptions{}, + expected: `{ + "eui_with_custom_name": null, + "eui_with_custom_name_and_type": null, + "non_nullable_eui_with_custom_name_and_type": null, + "euis_with_custom_name_and_type": [], + "duration": null, + "non_nullable_duration": null, + "timestamp": null, + "non_nullable_timestamp": null + }`, + expectedMask: []string{ + "eui_with_custom_name", + "eui_with_custom_name_and_type", + "non_nullable_eui_with_custom_name_and_type", + "euis_with_custom_name_and_type", + "duration", + "non_nullable_duration", + "timestamp", + "non_nullable_timestamp", + }, + }, + { + name: "full", + msg: MessageWithGoGoOptions{ + EuiWithCustomName: []byte{1, 2, 3, 4, 5, 6, 7, 8}, + EuiWithCustomNameAndType: []byte{1, 2, 3, 4, 5, 6, 7, 8}, + NonNullableEuiWithCustomNameAndType: []byte{1, 2, 3, 4, 5, 6, 7, 8}, + EuisWithCustomNameAndType: [][]byte{ + {1, 2, 3, 4, 5, 6, 7, 8}, + }, + Duration: mustDuration(testDuration), + NonNullableDuration: mustDuration(testDuration), + Timestamp: mustTimestamp(testTime), + NonNullableTimestamp: mustTimestamp(testTime), + }, + expected: `{ + "eui_with_custom_name": "AQIDBAUGBwg=", + "eui_with_custom_name_and_type": "0102030405060708", + "non_nullable_eui_with_custom_name_and_type": "0102030405060708", + "euis_with_custom_name_and_type": ["0102030405060708"], + "duration": "3723.123456789s", + "non_nullable_duration": "3723.123456789s", + "timestamp": "2006-01-02T08:04:05.123456789Z", + "non_nullable_timestamp": "2006-01-02T08:04:05.123456789Z" + }`, + expectedMask: []string{ + "eui_with_custom_name", + "eui_with_custom_name_and_type", + "non_nullable_eui_with_custom_name_and_type", + "euis_with_custom_name_and_type", + "duration", + "non_nullable_duration", + "timestamp", + "non_nullable_timestamp", + }, + }, +} + +func TestMarshalMessageWithGoGoOptions(t *testing.T) { + for _, tt := range testMessagesWithGoGoOptions { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithGoGoOptions(t *testing.T) { + for _, tt := range testMessagesWithGoGoOptions { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithNullable = []struct { + name string + msg MessageWithNullable + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithNullable{ + Sub: &SubMessage{Field: "foo"}, + OtherSub: &SubMessageWithoutMarshalers{OtherField: "foo"}, + }, + expected: `{ + "sub": {"field": "foo"}, + "other_sub": {"other_field": "foo"} + }`, + expectedMask: []string{ + "sub.field", + "other_sub", // NOTE: no marshaler. + }, + }, + { + name: "full", + msg: MessageWithNullable{ + Sub: &SubMessage{Field: "foo"}, + Subs: []*SubMessage{ + {Field: "foo"}, + {Field: "bar"}, + }, + OtherSub: &SubMessageWithoutMarshalers{OtherField: "foo"}, + OtherSubs: []*SubMessageWithoutMarshalers{ + {OtherField: "foo"}, + {OtherField: "bar"}, + }, + }, + expected: `{ + "sub": {"field": "foo"}, + "subs": [ + {"field": "foo"}, + {"field": "bar"} + ], + "other_sub": {"other_field": "foo"}, + "other_subs": [ + {"other_field": "foo"}, + {"other_field": "bar"} + ] + }`, + expectedMask: []string{ + "sub.field", + "subs", + "other_sub", // NOTE: no marshaler. + "other_subs", + }, + }, +} + +func TestMarshalMessageWithNullable(t *testing.T) { + for _, tt := range testMessagesWithNullable { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithNullable(t *testing.T) { + for _, tt := range testMessagesWithNullable { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithEmbedded = []struct { + name string + msg MessageWithEmbedded + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithEmbedded{}, + expected: `{}`, + }, + { + name: "zero", + msg: MessageWithEmbedded{ + Sub: &SubMessage{}, + }, + expected: `{ + "sub": {"field": ""} + }`, + expectedMask: []string{ + "sub.field", + }, + }, + { + name: "full", + msg: MessageWithEmbedded{ + Sub: &SubMessage{Field: "foo"}, + OtherSub: &SubMessageWithoutMarshalers{OtherField: "foo"}, + }, + expected: `{ + "sub": {"field": "foo"}, + "other_sub": {"other_field": "foo"} + }`, + expectedMask: []string{ + "sub.field", + "other_sub", // NOTE: no marshaler. + }, + }, +} + +func TestMarshalMessageWithEmbedded(t *testing.T) { + for _, tt := range testMessagesWithEmbedded { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithEmbedded(t *testing.T) { + for _, tt := range testMessagesWithEmbedded { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithNullableEmbedded = []struct { + name string + msg MessageWithNullableEmbedded + expected string + expectedMask []string +}{ + { + name: "full", + msg: MessageWithNullableEmbedded{ + Sub: &SubMessage{Field: "foo"}, + OtherSub: &SubMessageWithoutMarshalers{OtherField: "foo"}, + }, + expected: `{ + "sub": {"field": "foo"}, + "other_sub": {"other_field": "foo"} + }`, + expectedMask: []string{ + "sub.field", + "other_sub", // NOTE: no marshaler. + }, + }, +} + +func TestMarshalMessageWithNullableEmbedded(t *testing.T) { + for _, tt := range testMessagesWithNullableEmbedded { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithNullableEmbedded(t *testing.T) { + for _, tt := range testMessagesWithNullableEmbedded { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} diff --git a/test/golang/scalars.pb.go b/test/golang/scalars.pb.go new file mode 100644 index 00000000..6d851640 --- /dev/null +++ b/test/golang/scalars.pb.go @@ -0,0 +1,1380 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.17.3 +// source: scalars.proto + +package test + +import ( + _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MessageWithScalars struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3" json:"double_value,omitempty"` + DoubleValues []float64 `protobuf:"fixed64,2,rep,packed,name=double_values,json=doubleValues,proto3" json:"double_values,omitempty"` + FloatValue float32 `protobuf:"fixed32,3,opt,name=float_value,json=floatValue,proto3" json:"float_value,omitempty"` + FloatValues []float32 `protobuf:"fixed32,4,rep,packed,name=float_values,json=floatValues,proto3" json:"float_values,omitempty"` + Int32Value int32 `protobuf:"varint,5,opt,name=int32_value,json=int32Value,proto3" json:"int32_value,omitempty"` + Int32Values []int32 `protobuf:"varint,6,rep,packed,name=int32_values,json=int32Values,proto3" json:"int32_values,omitempty"` + Int64Value int64 `protobuf:"varint,7,opt,name=int64_value,json=int64Value,proto3" json:"int64_value,omitempty"` + Int64Values []int64 `protobuf:"varint,8,rep,packed,name=int64_values,json=int64Values,proto3" json:"int64_values,omitempty"` + Uint32Value uint32 `protobuf:"varint,9,opt,name=uint32_value,json=uint32Value,proto3" json:"uint32_value,omitempty"` + Uint32Values []uint32 `protobuf:"varint,10,rep,packed,name=uint32_values,json=uint32Values,proto3" json:"uint32_values,omitempty"` + Uint64Value uint64 `protobuf:"varint,11,opt,name=uint64_value,json=uint64Value,proto3" json:"uint64_value,omitempty"` + Uint64Values []uint64 `protobuf:"varint,12,rep,packed,name=uint64_values,json=uint64Values,proto3" json:"uint64_values,omitempty"` + Sint32Value int32 `protobuf:"zigzag32,13,opt,name=sint32_value,json=sint32Value,proto3" json:"sint32_value,omitempty"` + Sint32Values []int32 `protobuf:"zigzag32,14,rep,packed,name=sint32_values,json=sint32Values,proto3" json:"sint32_values,omitempty"` + Sint64Value int64 `protobuf:"zigzag64,15,opt,name=sint64_value,json=sint64Value,proto3" json:"sint64_value,omitempty"` + Sint64Values []int64 `protobuf:"zigzag64,16,rep,packed,name=sint64_values,json=sint64Values,proto3" json:"sint64_values,omitempty"` + Fixed32Value uint32 `protobuf:"fixed32,17,opt,name=fixed32_value,json=fixed32Value,proto3" json:"fixed32_value,omitempty"` + Fixed32Values []uint32 `protobuf:"fixed32,18,rep,packed,name=fixed32_values,json=fixed32Values,proto3" json:"fixed32_values,omitempty"` + Fixed64Value uint64 `protobuf:"fixed64,19,opt,name=fixed64_value,json=fixed64Value,proto3" json:"fixed64_value,omitempty"` + Fixed64Values []uint64 `protobuf:"fixed64,20,rep,packed,name=fixed64_values,json=fixed64Values,proto3" json:"fixed64_values,omitempty"` + Sfixed32Value int32 `protobuf:"fixed32,21,opt,name=sfixed32_value,json=sfixed32Value,proto3" json:"sfixed32_value,omitempty"` + Sfixed32Values []int32 `protobuf:"fixed32,22,rep,packed,name=sfixed32_values,json=sfixed32Values,proto3" json:"sfixed32_values,omitempty"` + Sfixed64Value int64 `protobuf:"fixed64,23,opt,name=sfixed64_value,json=sfixed64Value,proto3" json:"sfixed64_value,omitempty"` + Sfixed64Values []int64 `protobuf:"fixed64,24,rep,packed,name=sfixed64_values,json=sfixed64Values,proto3" json:"sfixed64_values,omitempty"` + BoolValue bool `protobuf:"varint,25,opt,name=bool_value,json=boolValue,proto3" json:"bool_value,omitempty"` + BoolValues []bool `protobuf:"varint,26,rep,packed,name=bool_values,json=boolValues,proto3" json:"bool_values,omitempty"` + StringValue string `protobuf:"bytes,27,opt,name=string_value,json=stringValue,proto3" json:"string_value,omitempty"` + StringValues []string `protobuf:"bytes,28,rep,name=string_values,json=stringValues,proto3" json:"string_values,omitempty"` + BytesValue []byte `protobuf:"bytes,29,opt,name=bytes_value,json=bytesValue,proto3" json:"bytes_value,omitempty"` + BytesValues [][]byte `protobuf:"bytes,30,rep,name=bytes_values,json=bytesValues,proto3" json:"bytes_values,omitempty"` +} + +func (x *MessageWithScalars) Reset() { + *x = MessageWithScalars{} + if protoimpl.UnsafeEnabled { + mi := &file_scalars_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithScalars) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithScalars) ProtoMessage() {} + +func (x *MessageWithScalars) ProtoReflect() protoreflect.Message { + mi := &file_scalars_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithScalars.ProtoReflect.Descriptor instead. +func (*MessageWithScalars) Descriptor() ([]byte, []int) { + return file_scalars_proto_rawDescGZIP(), []int{0} +} + +func (x *MessageWithScalars) GetDoubleValue() float64 { + if x != nil { + return x.DoubleValue + } + return 0 +} + +func (x *MessageWithScalars) GetDoubleValues() []float64 { + if x != nil { + return x.DoubleValues + } + return nil +} + +func (x *MessageWithScalars) GetFloatValue() float32 { + if x != nil { + return x.FloatValue + } + return 0 +} + +func (x *MessageWithScalars) GetFloatValues() []float32 { + if x != nil { + return x.FloatValues + } + return nil +} + +func (x *MessageWithScalars) GetInt32Value() int32 { + if x != nil { + return x.Int32Value + } + return 0 +} + +func (x *MessageWithScalars) GetInt32Values() []int32 { + if x != nil { + return x.Int32Values + } + return nil +} + +func (x *MessageWithScalars) GetInt64Value() int64 { + if x != nil { + return x.Int64Value + } + return 0 +} + +func (x *MessageWithScalars) GetInt64Values() []int64 { + if x != nil { + return x.Int64Values + } + return nil +} + +func (x *MessageWithScalars) GetUint32Value() uint32 { + if x != nil { + return x.Uint32Value + } + return 0 +} + +func (x *MessageWithScalars) GetUint32Values() []uint32 { + if x != nil { + return x.Uint32Values + } + return nil +} + +func (x *MessageWithScalars) GetUint64Value() uint64 { + if x != nil { + return x.Uint64Value + } + return 0 +} + +func (x *MessageWithScalars) GetUint64Values() []uint64 { + if x != nil { + return x.Uint64Values + } + return nil +} + +func (x *MessageWithScalars) GetSint32Value() int32 { + if x != nil { + return x.Sint32Value + } + return 0 +} + +func (x *MessageWithScalars) GetSint32Values() []int32 { + if x != nil { + return x.Sint32Values + } + return nil +} + +func (x *MessageWithScalars) GetSint64Value() int64 { + if x != nil { + return x.Sint64Value + } + return 0 +} + +func (x *MessageWithScalars) GetSint64Values() []int64 { + if x != nil { + return x.Sint64Values + } + return nil +} + +func (x *MessageWithScalars) GetFixed32Value() uint32 { + if x != nil { + return x.Fixed32Value + } + return 0 +} + +func (x *MessageWithScalars) GetFixed32Values() []uint32 { + if x != nil { + return x.Fixed32Values + } + return nil +} + +func (x *MessageWithScalars) GetFixed64Value() uint64 { + if x != nil { + return x.Fixed64Value + } + return 0 +} + +func (x *MessageWithScalars) GetFixed64Values() []uint64 { + if x != nil { + return x.Fixed64Values + } + return nil +} + +func (x *MessageWithScalars) GetSfixed32Value() int32 { + if x != nil { + return x.Sfixed32Value + } + return 0 +} + +func (x *MessageWithScalars) GetSfixed32Values() []int32 { + if x != nil { + return x.Sfixed32Values + } + return nil +} + +func (x *MessageWithScalars) GetSfixed64Value() int64 { + if x != nil { + return x.Sfixed64Value + } + return 0 +} + +func (x *MessageWithScalars) GetSfixed64Values() []int64 { + if x != nil { + return x.Sfixed64Values + } + return nil +} + +func (x *MessageWithScalars) GetBoolValue() bool { + if x != nil { + return x.BoolValue + } + return false +} + +func (x *MessageWithScalars) GetBoolValues() []bool { + if x != nil { + return x.BoolValues + } + return nil +} + +func (x *MessageWithScalars) GetStringValue() string { + if x != nil { + return x.StringValue + } + return "" +} + +func (x *MessageWithScalars) GetStringValues() []string { + if x != nil { + return x.StringValues + } + return nil +} + +func (x *MessageWithScalars) GetBytesValue() []byte { + if x != nil { + return x.BytesValue + } + return nil +} + +func (x *MessageWithScalars) GetBytesValues() [][]byte { + if x != nil { + return x.BytesValues + } + return nil +} + +type MessageWithOneofScalars struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Value: + // *MessageWithOneofScalars_DoubleValue + // *MessageWithOneofScalars_FloatValue + // *MessageWithOneofScalars_Int32Value + // *MessageWithOneofScalars_Int64Value + // *MessageWithOneofScalars_Uint32Value + // *MessageWithOneofScalars_Uint64Value + // *MessageWithOneofScalars_Sint32Value + // *MessageWithOneofScalars_Sint64Value + // *MessageWithOneofScalars_Fixed32Value + // *MessageWithOneofScalars_Fixed64Value + // *MessageWithOneofScalars_Sfixed32Value + // *MessageWithOneofScalars_Sfixed64Value + // *MessageWithOneofScalars_BoolValue + // *MessageWithOneofScalars_StringValue + // *MessageWithOneofScalars_BytesValue + Value isMessageWithOneofScalars_Value `protobuf_oneof:"value"` +} + +func (x *MessageWithOneofScalars) Reset() { + *x = MessageWithOneofScalars{} + if protoimpl.UnsafeEnabled { + mi := &file_scalars_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithOneofScalars) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithOneofScalars) ProtoMessage() {} + +func (x *MessageWithOneofScalars) ProtoReflect() protoreflect.Message { + mi := &file_scalars_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithOneofScalars.ProtoReflect.Descriptor instead. +func (*MessageWithOneofScalars) Descriptor() ([]byte, []int) { + return file_scalars_proto_rawDescGZIP(), []int{1} +} + +func (m *MessageWithOneofScalars) GetValue() isMessageWithOneofScalars_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *MessageWithOneofScalars) GetDoubleValue() float64 { + if x, ok := x.GetValue().(*MessageWithOneofScalars_DoubleValue); ok { + return x.DoubleValue + } + return 0 +} + +func (x *MessageWithOneofScalars) GetFloatValue() float32 { + if x, ok := x.GetValue().(*MessageWithOneofScalars_FloatValue); ok { + return x.FloatValue + } + return 0 +} + +func (x *MessageWithOneofScalars) GetInt32Value() int32 { + if x, ok := x.GetValue().(*MessageWithOneofScalars_Int32Value); ok { + return x.Int32Value + } + return 0 +} + +func (x *MessageWithOneofScalars) GetInt64Value() int64 { + if x, ok := x.GetValue().(*MessageWithOneofScalars_Int64Value); ok { + return x.Int64Value + } + return 0 +} + +func (x *MessageWithOneofScalars) GetUint32Value() uint32 { + if x, ok := x.GetValue().(*MessageWithOneofScalars_Uint32Value); ok { + return x.Uint32Value + } + return 0 +} + +func (x *MessageWithOneofScalars) GetUint64Value() uint64 { + if x, ok := x.GetValue().(*MessageWithOneofScalars_Uint64Value); ok { + return x.Uint64Value + } + return 0 +} + +func (x *MessageWithOneofScalars) GetSint32Value() int32 { + if x, ok := x.GetValue().(*MessageWithOneofScalars_Sint32Value); ok { + return x.Sint32Value + } + return 0 +} + +func (x *MessageWithOneofScalars) GetSint64Value() int64 { + if x, ok := x.GetValue().(*MessageWithOneofScalars_Sint64Value); ok { + return x.Sint64Value + } + return 0 +} + +func (x *MessageWithOneofScalars) GetFixed32Value() uint32 { + if x, ok := x.GetValue().(*MessageWithOneofScalars_Fixed32Value); ok { + return x.Fixed32Value + } + return 0 +} + +func (x *MessageWithOneofScalars) GetFixed64Value() uint64 { + if x, ok := x.GetValue().(*MessageWithOneofScalars_Fixed64Value); ok { + return x.Fixed64Value + } + return 0 +} + +func (x *MessageWithOneofScalars) GetSfixed32Value() int32 { + if x, ok := x.GetValue().(*MessageWithOneofScalars_Sfixed32Value); ok { + return x.Sfixed32Value + } + return 0 +} + +func (x *MessageWithOneofScalars) GetSfixed64Value() int64 { + if x, ok := x.GetValue().(*MessageWithOneofScalars_Sfixed64Value); ok { + return x.Sfixed64Value + } + return 0 +} + +func (x *MessageWithOneofScalars) GetBoolValue() bool { + if x, ok := x.GetValue().(*MessageWithOneofScalars_BoolValue); ok { + return x.BoolValue + } + return false +} + +func (x *MessageWithOneofScalars) GetStringValue() string { + if x, ok := x.GetValue().(*MessageWithOneofScalars_StringValue); ok { + return x.StringValue + } + return "" +} + +func (x *MessageWithOneofScalars) GetBytesValue() []byte { + if x, ok := x.GetValue().(*MessageWithOneofScalars_BytesValue); ok { + return x.BytesValue + } + return nil +} + +type isMessageWithOneofScalars_Value interface { + isMessageWithOneofScalars_Value() +} + +type MessageWithOneofScalars_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"` +} + +type MessageWithOneofScalars_FloatValue struct { + FloatValue float32 `protobuf:"fixed32,2,opt,name=float_value,json=floatValue,proto3,oneof"` +} + +type MessageWithOneofScalars_Int32Value struct { + Int32Value int32 `protobuf:"varint,3,opt,name=int32_value,json=int32Value,proto3,oneof"` +} + +type MessageWithOneofScalars_Int64Value struct { + Int64Value int64 `protobuf:"varint,4,opt,name=int64_value,json=int64Value,proto3,oneof"` +} + +type MessageWithOneofScalars_Uint32Value struct { + Uint32Value uint32 `protobuf:"varint,5,opt,name=uint32_value,json=uint32Value,proto3,oneof"` +} + +type MessageWithOneofScalars_Uint64Value struct { + Uint64Value uint64 `protobuf:"varint,6,opt,name=uint64_value,json=uint64Value,proto3,oneof"` +} + +type MessageWithOneofScalars_Sint32Value struct { + Sint32Value int32 `protobuf:"zigzag32,7,opt,name=sint32_value,json=sint32Value,proto3,oneof"` +} + +type MessageWithOneofScalars_Sint64Value struct { + Sint64Value int64 `protobuf:"zigzag64,8,opt,name=sint64_value,json=sint64Value,proto3,oneof"` +} + +type MessageWithOneofScalars_Fixed32Value struct { + Fixed32Value uint32 `protobuf:"fixed32,9,opt,name=fixed32_value,json=fixed32Value,proto3,oneof"` +} + +type MessageWithOneofScalars_Fixed64Value struct { + Fixed64Value uint64 `protobuf:"fixed64,10,opt,name=fixed64_value,json=fixed64Value,proto3,oneof"` +} + +type MessageWithOneofScalars_Sfixed32Value struct { + Sfixed32Value int32 `protobuf:"fixed32,11,opt,name=sfixed32_value,json=sfixed32Value,proto3,oneof"` +} + +type MessageWithOneofScalars_Sfixed64Value struct { + Sfixed64Value int64 `protobuf:"fixed64,12,opt,name=sfixed64_value,json=sfixed64Value,proto3,oneof"` +} + +type MessageWithOneofScalars_BoolValue struct { + BoolValue bool `protobuf:"varint,13,opt,name=bool_value,json=boolValue,proto3,oneof"` +} + +type MessageWithOneofScalars_StringValue struct { + StringValue string `protobuf:"bytes,14,opt,name=string_value,json=stringValue,proto3,oneof"` +} + +type MessageWithOneofScalars_BytesValue struct { + BytesValue []byte `protobuf:"bytes,15,opt,name=bytes_value,json=bytesValue,proto3,oneof"` +} + +func (*MessageWithOneofScalars_DoubleValue) isMessageWithOneofScalars_Value() {} + +func (*MessageWithOneofScalars_FloatValue) isMessageWithOneofScalars_Value() {} + +func (*MessageWithOneofScalars_Int32Value) isMessageWithOneofScalars_Value() {} + +func (*MessageWithOneofScalars_Int64Value) isMessageWithOneofScalars_Value() {} + +func (*MessageWithOneofScalars_Uint32Value) isMessageWithOneofScalars_Value() {} + +func (*MessageWithOneofScalars_Uint64Value) isMessageWithOneofScalars_Value() {} + +func (*MessageWithOneofScalars_Sint32Value) isMessageWithOneofScalars_Value() {} + +func (*MessageWithOneofScalars_Sint64Value) isMessageWithOneofScalars_Value() {} + +func (*MessageWithOneofScalars_Fixed32Value) isMessageWithOneofScalars_Value() {} + +func (*MessageWithOneofScalars_Fixed64Value) isMessageWithOneofScalars_Value() {} + +func (*MessageWithOneofScalars_Sfixed32Value) isMessageWithOneofScalars_Value() {} + +func (*MessageWithOneofScalars_Sfixed64Value) isMessageWithOneofScalars_Value() {} + +func (*MessageWithOneofScalars_BoolValue) isMessageWithOneofScalars_Value() {} + +func (*MessageWithOneofScalars_StringValue) isMessageWithOneofScalars_Value() {} + +func (*MessageWithOneofScalars_BytesValue) isMessageWithOneofScalars_Value() {} + +type MessageWithScalarMaps struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StringDoubleMap map[string]float64 `protobuf:"bytes,1,rep,name=string_double_map,json=stringDoubleMap,proto3" json:"string_double_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` // map is impossible. + StringFloatMap map[string]float32 `protobuf:"bytes,3,rep,name=string_float_map,json=stringFloatMap,proto3" json:"string_float_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` // map is impossible. + StringInt32Map map[string]int32 `protobuf:"bytes,5,rep,name=string_int32_map,json=stringInt32Map,proto3" json:"string_int32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Int32StringMap map[int32]string `protobuf:"bytes,6,rep,name=int32_string_map,json=int32StringMap,proto3" json:"int32_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringInt64Map map[string]int64 `protobuf:"bytes,7,rep,name=string_int64_map,json=stringInt64Map,proto3" json:"string_int64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Int64StringMap map[int64]string `protobuf:"bytes,8,rep,name=int64_string_map,json=int64StringMap,proto3" json:"int64_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringUint32Map map[string]uint32 `protobuf:"bytes,9,rep,name=string_uint32_map,json=stringUint32Map,proto3" json:"string_uint32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Uint32StringMap map[uint32]string `protobuf:"bytes,10,rep,name=uint32_string_map,json=uint32StringMap,proto3" json:"uint32_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringUint64Map map[string]uint64 `protobuf:"bytes,11,rep,name=string_uint64_map,json=stringUint64Map,proto3" json:"string_uint64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Uint64StringMap map[uint64]string `protobuf:"bytes,12,rep,name=uint64_string_map,json=uint64StringMap,proto3" json:"uint64_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringSint32Map map[string]int32 `protobuf:"bytes,13,rep,name=string_sint32_map,json=stringSint32Map,proto3" json:"string_sint32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"zigzag32,2,opt,name=value,proto3"` + Sint32StringMap map[int32]string `protobuf:"bytes,14,rep,name=sint32_string_map,json=sint32StringMap,proto3" json:"sint32_string_map,omitempty" protobuf_key:"zigzag32,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringSint64Map map[string]int64 `protobuf:"bytes,15,rep,name=string_sint64_map,json=stringSint64Map,proto3" json:"string_sint64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"zigzag64,2,opt,name=value,proto3"` + Sint64StringMap map[int64]string `protobuf:"bytes,16,rep,name=sint64_string_map,json=sint64StringMap,proto3" json:"sint64_string_map,omitempty" protobuf_key:"zigzag64,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringFixed32Map map[string]uint32 `protobuf:"bytes,17,rep,name=string_fixed32_map,json=stringFixed32Map,proto3" json:"string_fixed32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` + Fixed32StringMap map[uint32]string `protobuf:"bytes,18,rep,name=fixed32_string_map,json=fixed32StringMap,proto3" json:"fixed32_string_map,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringFixed64Map map[string]uint64 `protobuf:"bytes,19,rep,name=string_fixed64_map,json=stringFixed64Map,proto3" json:"string_fixed64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` + Fixed64StringMap map[uint64]string `protobuf:"bytes,20,rep,name=fixed64_string_map,json=fixed64StringMap,proto3" json:"fixed64_string_map,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringSfixed32Map map[string]int32 `protobuf:"bytes,21,rep,name=string_sfixed32_map,json=stringSfixed32Map,proto3" json:"string_sfixed32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` + Sfixed32StringMap map[int32]string `protobuf:"bytes,22,rep,name=sfixed32_string_map,json=sfixed32StringMap,proto3" json:"sfixed32_string_map,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringSfixed64Map map[string]int64 `protobuf:"bytes,23,rep,name=string_sfixed64_map,json=stringSfixed64Map,proto3" json:"string_sfixed64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` + Sfixed64StringMap map[int64]string `protobuf:"bytes,24,rep,name=sfixed64_string_map,json=sfixed64StringMap,proto3" json:"sfixed64_string_map,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringBoolMap map[string]bool `protobuf:"bytes,25,rep,name=string_bool_map,json=stringBoolMap,proto3" json:"string_bool_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + BoolStringMap map[bool]string `protobuf:"bytes,26,rep,name=bool_string_map,json=boolStringMap,proto3" json:"bool_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringStringMap map[string]string `protobuf:"bytes,27,rep,name=string_string_map,json=stringStringMap,proto3" json:"string_string_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // map is above. + StringBytesMap map[string][]byte `protobuf:"bytes,29,rep,name=string_bytes_map,json=stringBytesMap,proto3" json:"string_bytes_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // map is impossible. +} + +func (x *MessageWithScalarMaps) Reset() { + *x = MessageWithScalarMaps{} + if protoimpl.UnsafeEnabled { + mi := &file_scalars_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithScalarMaps) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithScalarMaps) ProtoMessage() {} + +func (x *MessageWithScalarMaps) ProtoReflect() protoreflect.Message { + mi := &file_scalars_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithScalarMaps.ProtoReflect.Descriptor instead. +func (*MessageWithScalarMaps) Descriptor() ([]byte, []int) { + return file_scalars_proto_rawDescGZIP(), []int{2} +} + +func (x *MessageWithScalarMaps) GetStringDoubleMap() map[string]float64 { + if x != nil { + return x.StringDoubleMap + } + return nil +} + +func (x *MessageWithScalarMaps) GetStringFloatMap() map[string]float32 { + if x != nil { + return x.StringFloatMap + } + return nil +} + +func (x *MessageWithScalarMaps) GetStringInt32Map() map[string]int32 { + if x != nil { + return x.StringInt32Map + } + return nil +} + +func (x *MessageWithScalarMaps) GetInt32StringMap() map[int32]string { + if x != nil { + return x.Int32StringMap + } + return nil +} + +func (x *MessageWithScalarMaps) GetStringInt64Map() map[string]int64 { + if x != nil { + return x.StringInt64Map + } + return nil +} + +func (x *MessageWithScalarMaps) GetInt64StringMap() map[int64]string { + if x != nil { + return x.Int64StringMap + } + return nil +} + +func (x *MessageWithScalarMaps) GetStringUint32Map() map[string]uint32 { + if x != nil { + return x.StringUint32Map + } + return nil +} + +func (x *MessageWithScalarMaps) GetUint32StringMap() map[uint32]string { + if x != nil { + return x.Uint32StringMap + } + return nil +} + +func (x *MessageWithScalarMaps) GetStringUint64Map() map[string]uint64 { + if x != nil { + return x.StringUint64Map + } + return nil +} + +func (x *MessageWithScalarMaps) GetUint64StringMap() map[uint64]string { + if x != nil { + return x.Uint64StringMap + } + return nil +} + +func (x *MessageWithScalarMaps) GetStringSint32Map() map[string]int32 { + if x != nil { + return x.StringSint32Map + } + return nil +} + +func (x *MessageWithScalarMaps) GetSint32StringMap() map[int32]string { + if x != nil { + return x.Sint32StringMap + } + return nil +} + +func (x *MessageWithScalarMaps) GetStringSint64Map() map[string]int64 { + if x != nil { + return x.StringSint64Map + } + return nil +} + +func (x *MessageWithScalarMaps) GetSint64StringMap() map[int64]string { + if x != nil { + return x.Sint64StringMap + } + return nil +} + +func (x *MessageWithScalarMaps) GetStringFixed32Map() map[string]uint32 { + if x != nil { + return x.StringFixed32Map + } + return nil +} + +func (x *MessageWithScalarMaps) GetFixed32StringMap() map[uint32]string { + if x != nil { + return x.Fixed32StringMap + } + return nil +} + +func (x *MessageWithScalarMaps) GetStringFixed64Map() map[string]uint64 { + if x != nil { + return x.StringFixed64Map + } + return nil +} + +func (x *MessageWithScalarMaps) GetFixed64StringMap() map[uint64]string { + if x != nil { + return x.Fixed64StringMap + } + return nil +} + +func (x *MessageWithScalarMaps) GetStringSfixed32Map() map[string]int32 { + if x != nil { + return x.StringSfixed32Map + } + return nil +} + +func (x *MessageWithScalarMaps) GetSfixed32StringMap() map[int32]string { + if x != nil { + return x.Sfixed32StringMap + } + return nil +} + +func (x *MessageWithScalarMaps) GetStringSfixed64Map() map[string]int64 { + if x != nil { + return x.StringSfixed64Map + } + return nil +} + +func (x *MessageWithScalarMaps) GetSfixed64StringMap() map[int64]string { + if x != nil { + return x.Sfixed64StringMap + } + return nil +} + +func (x *MessageWithScalarMaps) GetStringBoolMap() map[string]bool { + if x != nil { + return x.StringBoolMap + } + return nil +} + +func (x *MessageWithScalarMaps) GetBoolStringMap() map[bool]string { + if x != nil { + return x.BoolStringMap + } + return nil +} + +func (x *MessageWithScalarMaps) GetStringStringMap() map[string]string { + if x != nil { + return x.StringStringMap + } + return nil +} + +func (x *MessageWithScalarMaps) GetStringBytesMap() map[string][]byte { + if x != nil { + return x.StringBytesMap + } + return nil +} + +var File_scalars_proto protoreflect.FileDescriptor + +var file_scalars_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x73, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x13, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcc, 0x08, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x21, + 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x66, 0x6c, 0x6f, + 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x6c, 0x6f, 0x61, 0x74, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x02, 0x52, 0x0b, 0x66, + 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x69, + 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x05, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1f, + 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0c, 0x75, 0x69, + 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, + 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0c, + 0x20, 0x03, 0x28, 0x04, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x11, 0x52, 0x0b, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x11, 0x52, 0x0c, 0x73, 0x69, + 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x12, + 0x52, 0x0b, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, + 0x0d, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x10, + 0x20, 0x03, 0x28, 0x12, 0x52, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x07, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x07, 0x52, + 0x0d, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x23, + 0x0a, 0x0d, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x13, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x06, 0x52, 0x0d, 0x66, 0x69, 0x78, + 0x65, 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x66, + 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x15, 0x20, 0x01, + 0x28, 0x0f, 0x52, 0x0d, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0f, 0x52, 0x0e, 0x73, 0x66, 0x69, 0x78, + 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x66, + 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x17, 0x20, 0x01, + 0x28, 0x10, 0x52, 0x0d, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x18, 0x20, 0x03, 0x28, 0x10, 0x52, 0x0e, 0x73, 0x66, 0x69, 0x78, + 0x65, 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, + 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, + 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x6f, 0x6f, + 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x08, 0x52, 0x0a, + 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, + 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1c, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x1e, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xcd, 0x04, 0x0a, 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x53, 0x63, 0x61, 0x6c, 0x61, + 0x72, 0x73, 0x12, 0x23, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, + 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x48, 0x00, 0x52, 0x0a, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x48, + 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, + 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x03, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x23, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b, 0x75, + 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x69, + 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x11, + 0x48, 0x00, 0x52, 0x0b, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x23, 0x0a, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x12, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x07, 0x48, 0x00, 0x52, 0x0c, 0x66, + 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x66, + 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x06, 0x48, 0x00, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0f, 0x48, 0x00, 0x52, 0x0d, 0x73, 0x66, + 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x73, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x10, 0x48, 0x00, 0x52, 0x0d, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x48, + 0x00, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x99, 0x24, 0x0a, 0x15, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, + 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, + 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, + 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, + 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, + 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, + 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x6d, 0x61, + 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, + 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, + 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, + 0x70, 0x12, 0x68, 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, + 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, + 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x69, 0x6e, 0x74, + 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, + 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, + 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, + 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x36, + 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0e, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, + 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, + 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, + 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, + 0x70, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, + 0x61, 0x70, 0x73, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0b, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, + 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0c, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x55, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x69, + 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, + 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, + 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, + 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, + 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, + 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x69, + 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, + 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, + 0x61, 0x70, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, 0x74, 0x36, + 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, + 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, + 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, + 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x11, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, + 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x12, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, + 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x13, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, + 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x14, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, + 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, 0x13, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x15, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, 0x13, 0x73, 0x66, + 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, + 0x70, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, + 0x61, 0x70, 0x73, 0x2e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x66, 0x69, 0x78, + 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, + 0x13, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, + 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, + 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, + 0x12, 0x71, 0x0a, 0x13, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, + 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, + 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x11, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x6f, + 0x6f, 0x6c, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x19, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x74, + 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, + 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, + 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x0f, 0x62, 0x6f, + 0x6f, 0x6c, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x1a, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, + 0x42, 0x6f, 0x6f, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0d, 0x62, 0x6f, 0x6f, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, + 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x1b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, + 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, + 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x68, + 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x6d, + 0x61, 0x70, 0x18, 0x1d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x41, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, + 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, + 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x49, 0x6e, 0x74, 0x36, + 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x42, 0x0a, 0x14, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, + 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x55, 0x69, 0x6e, 0x74, 0x36, + 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x11, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x42, 0x0a, 0x14, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x11, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, + 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x12, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x69, 0x6e, 0x74, 0x36, + 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x12, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x07, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x43, 0x0a, 0x15, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x07, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, + 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x06, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, 0x46, 0x69, + 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x06, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x44, 0x0a, 0x16, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, + 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x44, 0x0a, 0x16, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, + 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x44, 0x0a, 0x16, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x10, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x44, 0x0a, 0x16, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x10, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, 0x42, 0x6f, 0x6f, + 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x41, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, + 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x42, 0x3f, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, + 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, + 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0xea, 0x75, 0x04, 0x08, + 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_scalars_proto_rawDescOnce sync.Once + file_scalars_proto_rawDescData = file_scalars_proto_rawDesc +) + +func file_scalars_proto_rawDescGZIP() []byte { + file_scalars_proto_rawDescOnce.Do(func() { + file_scalars_proto_rawDescData = protoimpl.X.CompressGZIP(file_scalars_proto_rawDescData) + }) + return file_scalars_proto_rawDescData +} + +var file_scalars_proto_msgTypes = make([]protoimpl.MessageInfo, 29) +var file_scalars_proto_goTypes = []interface{}{ + (*MessageWithScalars)(nil), // 0: thethings.json.test.MessageWithScalars + (*MessageWithOneofScalars)(nil), // 1: thethings.json.test.MessageWithOneofScalars + (*MessageWithScalarMaps)(nil), // 2: thethings.json.test.MessageWithScalarMaps + nil, // 3: thethings.json.test.MessageWithScalarMaps.StringDoubleMapEntry + nil, // 4: thethings.json.test.MessageWithScalarMaps.StringFloatMapEntry + nil, // 5: thethings.json.test.MessageWithScalarMaps.StringInt32MapEntry + nil, // 6: thethings.json.test.MessageWithScalarMaps.Int32StringMapEntry + nil, // 7: thethings.json.test.MessageWithScalarMaps.StringInt64MapEntry + nil, // 8: thethings.json.test.MessageWithScalarMaps.Int64StringMapEntry + nil, // 9: thethings.json.test.MessageWithScalarMaps.StringUint32MapEntry + nil, // 10: thethings.json.test.MessageWithScalarMaps.Uint32StringMapEntry + nil, // 11: thethings.json.test.MessageWithScalarMaps.StringUint64MapEntry + nil, // 12: thethings.json.test.MessageWithScalarMaps.Uint64StringMapEntry + nil, // 13: thethings.json.test.MessageWithScalarMaps.StringSint32MapEntry + nil, // 14: thethings.json.test.MessageWithScalarMaps.Sint32StringMapEntry + nil, // 15: thethings.json.test.MessageWithScalarMaps.StringSint64MapEntry + nil, // 16: thethings.json.test.MessageWithScalarMaps.Sint64StringMapEntry + nil, // 17: thethings.json.test.MessageWithScalarMaps.StringFixed32MapEntry + nil, // 18: thethings.json.test.MessageWithScalarMaps.Fixed32StringMapEntry + nil, // 19: thethings.json.test.MessageWithScalarMaps.StringFixed64MapEntry + nil, // 20: thethings.json.test.MessageWithScalarMaps.Fixed64StringMapEntry + nil, // 21: thethings.json.test.MessageWithScalarMaps.StringSfixed32MapEntry + nil, // 22: thethings.json.test.MessageWithScalarMaps.Sfixed32StringMapEntry + nil, // 23: thethings.json.test.MessageWithScalarMaps.StringSfixed64MapEntry + nil, // 24: thethings.json.test.MessageWithScalarMaps.Sfixed64StringMapEntry + nil, // 25: thethings.json.test.MessageWithScalarMaps.StringBoolMapEntry + nil, // 26: thethings.json.test.MessageWithScalarMaps.BoolStringMapEntry + nil, // 27: thethings.json.test.MessageWithScalarMaps.StringStringMapEntry + nil, // 28: thethings.json.test.MessageWithScalarMaps.StringBytesMapEntry +} +var file_scalars_proto_depIdxs = []int32{ + 3, // 0: thethings.json.test.MessageWithScalarMaps.string_double_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringDoubleMapEntry + 4, // 1: thethings.json.test.MessageWithScalarMaps.string_float_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringFloatMapEntry + 5, // 2: thethings.json.test.MessageWithScalarMaps.string_int32_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringInt32MapEntry + 6, // 3: thethings.json.test.MessageWithScalarMaps.int32_string_map:type_name -> thethings.json.test.MessageWithScalarMaps.Int32StringMapEntry + 7, // 4: thethings.json.test.MessageWithScalarMaps.string_int64_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringInt64MapEntry + 8, // 5: thethings.json.test.MessageWithScalarMaps.int64_string_map:type_name -> thethings.json.test.MessageWithScalarMaps.Int64StringMapEntry + 9, // 6: thethings.json.test.MessageWithScalarMaps.string_uint32_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringUint32MapEntry + 10, // 7: thethings.json.test.MessageWithScalarMaps.uint32_string_map:type_name -> thethings.json.test.MessageWithScalarMaps.Uint32StringMapEntry + 11, // 8: thethings.json.test.MessageWithScalarMaps.string_uint64_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringUint64MapEntry + 12, // 9: thethings.json.test.MessageWithScalarMaps.uint64_string_map:type_name -> thethings.json.test.MessageWithScalarMaps.Uint64StringMapEntry + 13, // 10: thethings.json.test.MessageWithScalarMaps.string_sint32_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringSint32MapEntry + 14, // 11: thethings.json.test.MessageWithScalarMaps.sint32_string_map:type_name -> thethings.json.test.MessageWithScalarMaps.Sint32StringMapEntry + 15, // 12: thethings.json.test.MessageWithScalarMaps.string_sint64_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringSint64MapEntry + 16, // 13: thethings.json.test.MessageWithScalarMaps.sint64_string_map:type_name -> thethings.json.test.MessageWithScalarMaps.Sint64StringMapEntry + 17, // 14: thethings.json.test.MessageWithScalarMaps.string_fixed32_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringFixed32MapEntry + 18, // 15: thethings.json.test.MessageWithScalarMaps.fixed32_string_map:type_name -> thethings.json.test.MessageWithScalarMaps.Fixed32StringMapEntry + 19, // 16: thethings.json.test.MessageWithScalarMaps.string_fixed64_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringFixed64MapEntry + 20, // 17: thethings.json.test.MessageWithScalarMaps.fixed64_string_map:type_name -> thethings.json.test.MessageWithScalarMaps.Fixed64StringMapEntry + 21, // 18: thethings.json.test.MessageWithScalarMaps.string_sfixed32_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringSfixed32MapEntry + 22, // 19: thethings.json.test.MessageWithScalarMaps.sfixed32_string_map:type_name -> thethings.json.test.MessageWithScalarMaps.Sfixed32StringMapEntry + 23, // 20: thethings.json.test.MessageWithScalarMaps.string_sfixed64_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringSfixed64MapEntry + 24, // 21: thethings.json.test.MessageWithScalarMaps.sfixed64_string_map:type_name -> thethings.json.test.MessageWithScalarMaps.Sfixed64StringMapEntry + 25, // 22: thethings.json.test.MessageWithScalarMaps.string_bool_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringBoolMapEntry + 26, // 23: thethings.json.test.MessageWithScalarMaps.bool_string_map:type_name -> thethings.json.test.MessageWithScalarMaps.BoolStringMapEntry + 27, // 24: thethings.json.test.MessageWithScalarMaps.string_string_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringStringMapEntry + 28, // 25: thethings.json.test.MessageWithScalarMaps.string_bytes_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringBytesMapEntry + 26, // [26:26] is the sub-list for method output_type + 26, // [26:26] is the sub-list for method input_type + 26, // [26:26] is the sub-list for extension type_name + 26, // [26:26] is the sub-list for extension extendee + 0, // [0:26] is the sub-list for field type_name +} + +func init() { file_scalars_proto_init() } +func file_scalars_proto_init() { + if File_scalars_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_scalars_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithScalars); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_scalars_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithOneofScalars); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_scalars_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithScalarMaps); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_scalars_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*MessageWithOneofScalars_DoubleValue)(nil), + (*MessageWithOneofScalars_FloatValue)(nil), + (*MessageWithOneofScalars_Int32Value)(nil), + (*MessageWithOneofScalars_Int64Value)(nil), + (*MessageWithOneofScalars_Uint32Value)(nil), + (*MessageWithOneofScalars_Uint64Value)(nil), + (*MessageWithOneofScalars_Sint32Value)(nil), + (*MessageWithOneofScalars_Sint64Value)(nil), + (*MessageWithOneofScalars_Fixed32Value)(nil), + (*MessageWithOneofScalars_Fixed64Value)(nil), + (*MessageWithOneofScalars_Sfixed32Value)(nil), + (*MessageWithOneofScalars_Sfixed64Value)(nil), + (*MessageWithOneofScalars_BoolValue)(nil), + (*MessageWithOneofScalars_StringValue)(nil), + (*MessageWithOneofScalars_BytesValue)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_scalars_proto_rawDesc, + NumEnums: 0, + NumMessages: 29, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_scalars_proto_goTypes, + DependencyIndexes: file_scalars_proto_depIdxs, + MessageInfos: file_scalars_proto_msgTypes, + }.Build() + File_scalars_proto = out.File + file_scalars_proto_rawDesc = nil + file_scalars_proto_goTypes = nil + file_scalars_proto_depIdxs = nil +} diff --git a/test/golang/scalars_json.pb.go b/test/golang/scalars_json.pb.go new file mode 100644 index 00000000..749594c8 --- /dev/null +++ b/test/golang/scalars_json.pb.go @@ -0,0 +1,930 @@ +// Code generated by protoc-gen-go-json. DO NOT EDIT. +// versions: +// - protoc-gen-go-json v0.0.0-dev +// - protoc v3.17.3 +// source: scalars.proto + +package test + +import ( + jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" +) + +// MarshalProtoJSON marshals the MessageWithScalars message to JSON. +func (x *MessageWithScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.DoubleValue != 0 || s.HasField("double_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("double_value") + s.WriteFloat64(x.DoubleValue) + } + if len(x.DoubleValues) > 0 || s.HasField("double_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("double_values") + s.WriteFloat64Array(x.DoubleValues) + } + if x.FloatValue != 0 || s.HasField("float_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("float_value") + s.WriteFloat32(x.FloatValue) + } + if len(x.FloatValues) > 0 || s.HasField("float_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("float_values") + s.WriteFloat32Array(x.FloatValues) + } + if x.Int32Value != 0 || s.HasField("int32_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int32_value") + s.WriteInt32(x.Int32Value) + } + if len(x.Int32Values) > 0 || s.HasField("int32_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int32_values") + s.WriteInt32Array(x.Int32Values) + } + if x.Int64Value != 0 || s.HasField("int64_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int64_value") + s.WriteInt64(x.Int64Value) + } + if len(x.Int64Values) > 0 || s.HasField("int64_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int64_values") + s.WriteInt64Array(x.Int64Values) + } + if x.Uint32Value != 0 || s.HasField("uint32_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint32_value") + s.WriteUint32(x.Uint32Value) + } + if len(x.Uint32Values) > 0 || s.HasField("uint32_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint32_values") + s.WriteUint32Array(x.Uint32Values) + } + if x.Uint64Value != 0 || s.HasField("uint64_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint64_value") + s.WriteUint64(x.Uint64Value) + } + if len(x.Uint64Values) > 0 || s.HasField("uint64_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint64_values") + s.WriteUint64Array(x.Uint64Values) + } + if x.Sint32Value != 0 || s.HasField("sint32_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint32_value") + s.WriteInt32(x.Sint32Value) + } + if len(x.Sint32Values) > 0 || s.HasField("sint32_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint32_values") + s.WriteInt32Array(x.Sint32Values) + } + if x.Sint64Value != 0 || s.HasField("sint64_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint64_value") + s.WriteInt64(x.Sint64Value) + } + if len(x.Sint64Values) > 0 || s.HasField("sint64_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint64_values") + s.WriteInt64Array(x.Sint64Values) + } + if x.Fixed32Value != 0 || s.HasField("fixed32_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed32_value") + s.WriteUint32(x.Fixed32Value) + } + if len(x.Fixed32Values) > 0 || s.HasField("fixed32_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed32_values") + s.WriteUint32Array(x.Fixed32Values) + } + if x.Fixed64Value != 0 || s.HasField("fixed64_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed64_value") + s.WriteUint64(x.Fixed64Value) + } + if len(x.Fixed64Values) > 0 || s.HasField("fixed64_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed64_values") + s.WriteUint64Array(x.Fixed64Values) + } + if x.Sfixed32Value != 0 || s.HasField("sfixed32_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed32_value") + s.WriteInt32(x.Sfixed32Value) + } + if len(x.Sfixed32Values) > 0 || s.HasField("sfixed32_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed32_values") + s.WriteInt32Array(x.Sfixed32Values) + } + if x.Sfixed64Value != 0 || s.HasField("sfixed64_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed64_value") + s.WriteInt64(x.Sfixed64Value) + } + if len(x.Sfixed64Values) > 0 || s.HasField("sfixed64_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed64_values") + s.WriteInt64Array(x.Sfixed64Values) + } + if x.BoolValue || s.HasField("bool_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bool_value") + s.WriteBool(x.BoolValue) + } + if len(x.BoolValues) > 0 || s.HasField("bool_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bool_values") + s.WriteBoolArray(x.BoolValues) + } + if x.StringValue != "" || s.HasField("string_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_value") + s.WriteString(x.StringValue) + } + if len(x.StringValues) > 0 || s.HasField("string_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_values") + s.WriteStringArray(x.StringValues) + } + if len(x.BytesValue) > 0 || s.HasField("bytes_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bytes_value") + s.WriteBytes(x.BytesValue) + } + if len(x.BytesValues) > 0 || s.HasField("bytes_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bytes_values") + s.WriteBytesArray(x.BytesValues) + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithScalars message from JSON. +func (x *MessageWithScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "double_value", "doubleValue": + s.AddField("double_value") + x.DoubleValue = s.ReadFloat64() + case "double_values", "doubleValues": + s.AddField("double_values") + x.DoubleValues = s.ReadFloat64Array() + case "float_value", "floatValue": + s.AddField("float_value") + x.FloatValue = s.ReadFloat32() + case "float_values", "floatValues": + s.AddField("float_values") + x.FloatValues = s.ReadFloat32Array() + case "int32_value", "int32Value": + s.AddField("int32_value") + x.Int32Value = s.ReadInt32() + case "int32_values", "int32Values": + s.AddField("int32_values") + x.Int32Values = s.ReadInt32Array() + case "int64_value", "int64Value": + s.AddField("int64_value") + x.Int64Value = s.ReadInt64() + case "int64_values", "int64Values": + s.AddField("int64_values") + x.Int64Values = s.ReadInt64Array() + case "uint32_value", "uint32Value": + s.AddField("uint32_value") + x.Uint32Value = s.ReadUint32() + case "uint32_values", "uint32Values": + s.AddField("uint32_values") + x.Uint32Values = s.ReadUint32Array() + case "uint64_value", "uint64Value": + s.AddField("uint64_value") + x.Uint64Value = s.ReadUint64() + case "uint64_values", "uint64Values": + s.AddField("uint64_values") + x.Uint64Values = s.ReadUint64Array() + case "sint32_value", "sint32Value": + s.AddField("sint32_value") + x.Sint32Value = s.ReadInt32() + case "sint32_values", "sint32Values": + s.AddField("sint32_values") + x.Sint32Values = s.ReadInt32Array() + case "sint64_value", "sint64Value": + s.AddField("sint64_value") + x.Sint64Value = s.ReadInt64() + case "sint64_values", "sint64Values": + s.AddField("sint64_values") + x.Sint64Values = s.ReadInt64Array() + case "fixed32_value", "fixed32Value": + s.AddField("fixed32_value") + x.Fixed32Value = s.ReadUint32() + case "fixed32_values", "fixed32Values": + s.AddField("fixed32_values") + x.Fixed32Values = s.ReadUint32Array() + case "fixed64_value", "fixed64Value": + s.AddField("fixed64_value") + x.Fixed64Value = s.ReadUint64() + case "fixed64_values", "fixed64Values": + s.AddField("fixed64_values") + x.Fixed64Values = s.ReadUint64Array() + case "sfixed32_value", "sfixed32Value": + s.AddField("sfixed32_value") + x.Sfixed32Value = s.ReadInt32() + case "sfixed32_values", "sfixed32Values": + s.AddField("sfixed32_values") + x.Sfixed32Values = s.ReadInt32Array() + case "sfixed64_value", "sfixed64Value": + s.AddField("sfixed64_value") + x.Sfixed64Value = s.ReadInt64() + case "sfixed64_values", "sfixed64Values": + s.AddField("sfixed64_values") + x.Sfixed64Values = s.ReadInt64Array() + case "bool_value", "boolValue": + s.AddField("bool_value") + x.BoolValue = s.ReadBool() + case "bool_values", "boolValues": + s.AddField("bool_values") + x.BoolValues = s.ReadBoolArray() + case "string_value", "stringValue": + s.AddField("string_value") + x.StringValue = s.ReadString() + case "string_values", "stringValues": + s.AddField("string_values") + x.StringValues = s.ReadStringArray() + case "bytes_value", "bytesValue": + s.AddField("bytes_value") + x.BytesValue = s.ReadBytes() + case "bytes_values", "bytesValues": + s.AddField("bytes_values") + x.BytesValues = s.ReadBytesArray() + } + }) +} + +// MarshalProtoJSON marshals the MessageWithOneofScalars message to JSON. +func (x *MessageWithOneofScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Value != nil { + switch ov := x.Value.(type) { + case *MessageWithOneofScalars_DoubleValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("double_value") + s.WriteFloat64(ov.DoubleValue) + case *MessageWithOneofScalars_FloatValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("float_value") + s.WriteFloat32(ov.FloatValue) + case *MessageWithOneofScalars_Int32Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int32_value") + s.WriteInt32(ov.Int32Value) + case *MessageWithOneofScalars_Int64Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int64_value") + s.WriteInt64(ov.Int64Value) + case *MessageWithOneofScalars_Uint32Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint32_value") + s.WriteUint32(ov.Uint32Value) + case *MessageWithOneofScalars_Uint64Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint64_value") + s.WriteUint64(ov.Uint64Value) + case *MessageWithOneofScalars_Sint32Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint32_value") + s.WriteInt32(ov.Sint32Value) + case *MessageWithOneofScalars_Sint64Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint64_value") + s.WriteInt64(ov.Sint64Value) + case *MessageWithOneofScalars_Fixed32Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed32_value") + s.WriteUint32(ov.Fixed32Value) + case *MessageWithOneofScalars_Fixed64Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed64_value") + s.WriteUint64(ov.Fixed64Value) + case *MessageWithOneofScalars_Sfixed32Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed32_value") + s.WriteInt32(ov.Sfixed32Value) + case *MessageWithOneofScalars_Sfixed64Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed64_value") + s.WriteInt64(ov.Sfixed64Value) + case *MessageWithOneofScalars_BoolValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bool_value") + s.WriteBool(ov.BoolValue) + case *MessageWithOneofScalars_StringValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_value") + s.WriteString(ov.StringValue) + case *MessageWithOneofScalars_BytesValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bytes_value") + s.WriteBytes(ov.BytesValue) + } + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithOneofScalars message from JSON. +func (x *MessageWithOneofScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "double_value", "doubleValue": + s.AddField("double_value") + ov := &MessageWithOneofScalars_DoubleValue{} + ov.DoubleValue = s.ReadFloat64() + x.Value = ov + case "float_value", "floatValue": + s.AddField("float_value") + ov := &MessageWithOneofScalars_FloatValue{} + ov.FloatValue = s.ReadFloat32() + x.Value = ov + case "int32_value", "int32Value": + s.AddField("int32_value") + ov := &MessageWithOneofScalars_Int32Value{} + ov.Int32Value = s.ReadInt32() + x.Value = ov + case "int64_value", "int64Value": + s.AddField("int64_value") + ov := &MessageWithOneofScalars_Int64Value{} + ov.Int64Value = s.ReadInt64() + x.Value = ov + case "uint32_value", "uint32Value": + s.AddField("uint32_value") + ov := &MessageWithOneofScalars_Uint32Value{} + ov.Uint32Value = s.ReadUint32() + x.Value = ov + case "uint64_value", "uint64Value": + s.AddField("uint64_value") + ov := &MessageWithOneofScalars_Uint64Value{} + ov.Uint64Value = s.ReadUint64() + x.Value = ov + case "sint32_value", "sint32Value": + s.AddField("sint32_value") + ov := &MessageWithOneofScalars_Sint32Value{} + ov.Sint32Value = s.ReadInt32() + x.Value = ov + case "sint64_value", "sint64Value": + s.AddField("sint64_value") + ov := &MessageWithOneofScalars_Sint64Value{} + ov.Sint64Value = s.ReadInt64() + x.Value = ov + case "fixed32_value", "fixed32Value": + s.AddField("fixed32_value") + ov := &MessageWithOneofScalars_Fixed32Value{} + ov.Fixed32Value = s.ReadUint32() + x.Value = ov + case "fixed64_value", "fixed64Value": + s.AddField("fixed64_value") + ov := &MessageWithOneofScalars_Fixed64Value{} + ov.Fixed64Value = s.ReadUint64() + x.Value = ov + case "sfixed32_value", "sfixed32Value": + s.AddField("sfixed32_value") + ov := &MessageWithOneofScalars_Sfixed32Value{} + ov.Sfixed32Value = s.ReadInt32() + x.Value = ov + case "sfixed64_value", "sfixed64Value": + s.AddField("sfixed64_value") + ov := &MessageWithOneofScalars_Sfixed64Value{} + ov.Sfixed64Value = s.ReadInt64() + x.Value = ov + case "bool_value", "boolValue": + s.AddField("bool_value") + ov := &MessageWithOneofScalars_BoolValue{} + ov.BoolValue = s.ReadBool() + x.Value = ov + case "string_value", "stringValue": + s.AddField("string_value") + ov := &MessageWithOneofScalars_StringValue{} + ov.StringValue = s.ReadString() + x.Value = ov + case "bytes_value", "bytesValue": + s.AddField("bytes_value") + ov := &MessageWithOneofScalars_BytesValue{} + ov.BytesValue = s.ReadBytes() + x.Value = ov + } + }) +} + +// MarshalProtoJSON marshals the MessageWithScalarMaps message to JSON. +func (x *MessageWithScalarMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.StringDoubleMap != nil || s.HasField("string_double_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_double_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringDoubleMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteFloat64(v) + } + s.WriteObjectEnd() + } + if x.StringFloatMap != nil || s.HasField("string_float_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_float_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringFloatMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteFloat32(v) + } + s.WriteObjectEnd() + } + if x.StringInt32Map != nil || s.HasField("string_int32_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_int32_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringInt32Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteInt32(v) + } + s.WriteObjectEnd() + } + if x.Int32StringMap != nil || s.HasField("int32_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int32_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Int32StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectInt32Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringInt64Map != nil || s.HasField("string_int64_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_int64_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringInt64Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteInt64(v) + } + s.WriteObjectEnd() + } + if x.Int64StringMap != nil || s.HasField("int64_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int64_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Int64StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectInt64Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringUint32Map != nil || s.HasField("string_uint32_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_uint32_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringUint32Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteUint32(v) + } + s.WriteObjectEnd() + } + if x.Uint32StringMap != nil || s.HasField("uint32_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint32_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Uint32StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectUint32Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringUint64Map != nil || s.HasField("string_uint64_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_uint64_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringUint64Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteUint64(v) + } + s.WriteObjectEnd() + } + if x.Uint64StringMap != nil || s.HasField("uint64_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint64_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Uint64StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectUint64Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringSint32Map != nil || s.HasField("string_sint32_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_sint32_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringSint32Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteInt32(v) + } + s.WriteObjectEnd() + } + if x.Sint32StringMap != nil || s.HasField("sint32_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint32_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Sint32StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectInt32Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringSint64Map != nil || s.HasField("string_sint64_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_sint64_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringSint64Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteInt64(v) + } + s.WriteObjectEnd() + } + if x.Sint64StringMap != nil || s.HasField("sint64_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sint64_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Sint64StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectInt64Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringFixed32Map != nil || s.HasField("string_fixed32_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_fixed32_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringFixed32Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteUint32(v) + } + s.WriteObjectEnd() + } + if x.Fixed32StringMap != nil || s.HasField("fixed32_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed32_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Fixed32StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectUint32Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringFixed64Map != nil || s.HasField("string_fixed64_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_fixed64_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringFixed64Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteUint64(v) + } + s.WriteObjectEnd() + } + if x.Fixed64StringMap != nil || s.HasField("fixed64_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixed64_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Fixed64StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectUint64Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringSfixed32Map != nil || s.HasField("string_sfixed32_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_sfixed32_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringSfixed32Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteInt32(v) + } + s.WriteObjectEnd() + } + if x.Sfixed32StringMap != nil || s.HasField("sfixed32_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed32_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Sfixed32StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectInt32Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringSfixed64Map != nil || s.HasField("string_sfixed64_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_sfixed64_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringSfixed64Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteInt64(v) + } + s.WriteObjectEnd() + } + if x.Sfixed64StringMap != nil || s.HasField("sfixed64_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("sfixed64_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.Sfixed64StringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectInt64Field(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringBoolMap != nil || s.HasField("string_bool_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_bool_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringBoolMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteBool(v) + } + s.WriteObjectEnd() + } + if x.BoolStringMap != nil || s.HasField("bool_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bool_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.BoolStringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectBoolField(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringStringMap != nil || s.HasField("string_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringStringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteString(v) + } + s.WriteObjectEnd() + } + if x.StringBytesMap != nil || s.HasField("string_bytes_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_bytes_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringBytesMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + s.WriteBytes(v) + } + s.WriteObjectEnd() + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithScalarMaps message from JSON. +func (x *MessageWithScalarMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "string_double_map", "stringDoubleMap": + s.AddField("string_double_map") + x.StringDoubleMap = make(map[string]float64) + s.ReadStringMap(func(key string) { + x.StringDoubleMap[key] = s.ReadFloat64() + }) + case "string_float_map", "stringFloatMap": + s.AddField("string_float_map") + x.StringFloatMap = make(map[string]float32) + s.ReadStringMap(func(key string) { + x.StringFloatMap[key] = s.ReadFloat32() + }) + case "string_int32_map", "stringInt32Map": + s.AddField("string_int32_map") + x.StringInt32Map = make(map[string]int32) + s.ReadStringMap(func(key string) { + x.StringInt32Map[key] = s.ReadInt32() + }) + case "int32_string_map", "int32StringMap": + s.AddField("int32_string_map") + x.Int32StringMap = make(map[int32]string) + s.ReadInt32Map(func(key int32) { + x.Int32StringMap[key] = s.ReadString() + }) + case "string_int64_map", "stringInt64Map": + s.AddField("string_int64_map") + x.StringInt64Map = make(map[string]int64) + s.ReadStringMap(func(key string) { + x.StringInt64Map[key] = s.ReadInt64() + }) + case "int64_string_map", "int64StringMap": + s.AddField("int64_string_map") + x.Int64StringMap = make(map[int64]string) + s.ReadInt64Map(func(key int64) { + x.Int64StringMap[key] = s.ReadString() + }) + case "string_uint32_map", "stringUint32Map": + s.AddField("string_uint32_map") + x.StringUint32Map = make(map[string]uint32) + s.ReadStringMap(func(key string) { + x.StringUint32Map[key] = s.ReadUint32() + }) + case "uint32_string_map", "uint32StringMap": + s.AddField("uint32_string_map") + x.Uint32StringMap = make(map[uint32]string) + s.ReadUint32Map(func(key uint32) { + x.Uint32StringMap[key] = s.ReadString() + }) + case "string_uint64_map", "stringUint64Map": + s.AddField("string_uint64_map") + x.StringUint64Map = make(map[string]uint64) + s.ReadStringMap(func(key string) { + x.StringUint64Map[key] = s.ReadUint64() + }) + case "uint64_string_map", "uint64StringMap": + s.AddField("uint64_string_map") + x.Uint64StringMap = make(map[uint64]string) + s.ReadUint64Map(func(key uint64) { + x.Uint64StringMap[key] = s.ReadString() + }) + case "string_sint32_map", "stringSint32Map": + s.AddField("string_sint32_map") + x.StringSint32Map = make(map[string]int32) + s.ReadStringMap(func(key string) { + x.StringSint32Map[key] = s.ReadInt32() + }) + case "sint32_string_map", "sint32StringMap": + s.AddField("sint32_string_map") + x.Sint32StringMap = make(map[int32]string) + s.ReadInt32Map(func(key int32) { + x.Sint32StringMap[key] = s.ReadString() + }) + case "string_sint64_map", "stringSint64Map": + s.AddField("string_sint64_map") + x.StringSint64Map = make(map[string]int64) + s.ReadStringMap(func(key string) { + x.StringSint64Map[key] = s.ReadInt64() + }) + case "sint64_string_map", "sint64StringMap": + s.AddField("sint64_string_map") + x.Sint64StringMap = make(map[int64]string) + s.ReadInt64Map(func(key int64) { + x.Sint64StringMap[key] = s.ReadString() + }) + case "string_fixed32_map", "stringFixed32Map": + s.AddField("string_fixed32_map") + x.StringFixed32Map = make(map[string]uint32) + s.ReadStringMap(func(key string) { + x.StringFixed32Map[key] = s.ReadUint32() + }) + case "fixed32_string_map", "fixed32StringMap": + s.AddField("fixed32_string_map") + x.Fixed32StringMap = make(map[uint32]string) + s.ReadUint32Map(func(key uint32) { + x.Fixed32StringMap[key] = s.ReadString() + }) + case "string_fixed64_map", "stringFixed64Map": + s.AddField("string_fixed64_map") + x.StringFixed64Map = make(map[string]uint64) + s.ReadStringMap(func(key string) { + x.StringFixed64Map[key] = s.ReadUint64() + }) + case "fixed64_string_map", "fixed64StringMap": + s.AddField("fixed64_string_map") + x.Fixed64StringMap = make(map[uint64]string) + s.ReadUint64Map(func(key uint64) { + x.Fixed64StringMap[key] = s.ReadString() + }) + case "string_sfixed32_map", "stringSfixed32Map": + s.AddField("string_sfixed32_map") + x.StringSfixed32Map = make(map[string]int32) + s.ReadStringMap(func(key string) { + x.StringSfixed32Map[key] = s.ReadInt32() + }) + case "sfixed32_string_map", "sfixed32StringMap": + s.AddField("sfixed32_string_map") + x.Sfixed32StringMap = make(map[int32]string) + s.ReadInt32Map(func(key int32) { + x.Sfixed32StringMap[key] = s.ReadString() + }) + case "string_sfixed64_map", "stringSfixed64Map": + s.AddField("string_sfixed64_map") + x.StringSfixed64Map = make(map[string]int64) + s.ReadStringMap(func(key string) { + x.StringSfixed64Map[key] = s.ReadInt64() + }) + case "sfixed64_string_map", "sfixed64StringMap": + s.AddField("sfixed64_string_map") + x.Sfixed64StringMap = make(map[int64]string) + s.ReadInt64Map(func(key int64) { + x.Sfixed64StringMap[key] = s.ReadString() + }) + case "string_bool_map", "stringBoolMap": + s.AddField("string_bool_map") + x.StringBoolMap = make(map[string]bool) + s.ReadStringMap(func(key string) { + x.StringBoolMap[key] = s.ReadBool() + }) + case "bool_string_map", "boolStringMap": + s.AddField("bool_string_map") + x.BoolStringMap = make(map[bool]string) + s.ReadBoolMap(func(key bool) { + x.BoolStringMap[key] = s.ReadString() + }) + case "string_string_map", "stringStringMap": + s.AddField("string_string_map") + x.StringStringMap = make(map[string]string) + s.ReadStringMap(func(key string) { + x.StringStringMap[key] = s.ReadString() + }) + case "string_bytes_map", "stringBytesMap": + s.AddField("string_bytes_map") + x.StringBytesMap = make(map[string][]byte) + s.ReadStringMap(func(key string) { + x.StringBytesMap[key] = s.ReadBytes() + }) + } + }) +} diff --git a/test/golang/scalars_test.go b/test/golang/scalars_test.go new file mode 100644 index 00000000..84615ce6 --- /dev/null +++ b/test/golang/scalars_test.go @@ -0,0 +1,598 @@ +package test_test + +import ( + "testing" + + . "github.com/TheThingsIndustries/protoc-gen-go-json/test/golang" +) + +var testMessagesWithScalars = []struct { + name string + msg MessageWithScalars + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithScalars{}, + expected: `{}`, + }, + { + name: "zero", + msg: MessageWithScalars{}, + expected: `{ + "double_value": 0, + "double_values": [], + "float_value": 0, + "float_values": [], + "int32_value": 0, + "int32_values": [], + "int64_value": "0", + "int64_values": [], + "uint32_value": 0, + "uint32_values": [], + "uint64_value": "0", + "uint64_values": [], + "sint32_value": 0, + "sint32_values": [], + "sint64_value": "0", + "sint64_values": [], + "fixed32_value": 0, + "fixed32_values": [], + "fixed64_value": "0", + "fixed64_values": [], + "sfixed32_value": 0, + "sfixed32_values": [], + "sfixed64_value": "0", + "sfixed64_values": [], + "bool_value": false, + "bool_values": [], + "string_value": "", + "string_values": [], + "bytes_value": null, + "bytes_values": [] + }`, + expectedMask: []string{ + "double_value", + "double_values", + "float_value", + "float_values", + "int32_value", + "int32_values", + "int64_value", + "int64_values", + "uint32_value", + "uint32_values", + "uint64_value", + "uint64_values", + "sint32_value", + "sint32_values", + "sint64_value", + "sint64_values", + "fixed32_value", + "fixed32_values", + "fixed64_value", + "fixed64_values", + "sfixed32_value", + "sfixed32_values", + "sfixed64_value", + "sfixed64_values", + "bool_value", + "bool_values", + "string_value", + "string_values", + "bytes_value", + "bytes_values", + }, + }, + { + name: "full", + msg: MessageWithScalars{ + DoubleValue: 12.34, + DoubleValues: []float64{12.34, 56.78}, + FloatValue: 12.34, + FloatValues: []float32{12.34, 56.78}, + Int32Value: -42, + Int32Values: []int32{1, 2, -42}, + Int64Value: -42, + Int64Values: []int64{1, 2, -42}, + Uint32Value: 42, + Uint32Values: []uint32{1, 2, 42}, + Uint64Value: 42, + Uint64Values: []uint64{1, 2, 42}, + Sint32Value: -42, + Sint32Values: []int32{1, 2, -42}, + Sint64Value: -42, + Sint64Values: []int64{1, 2, -42}, + Fixed32Value: 42, + Fixed32Values: []uint32{1, 2, 42}, + Fixed64Value: 42, + Fixed64Values: []uint64{1, 2, 42}, + Sfixed32Value: -42, + Sfixed32Values: []int32{1, 2, -42}, + Sfixed64Value: -42, + Sfixed64Values: []int64{1, 2, -42}, + BoolValue: true, + BoolValues: []bool{true, false}, + StringValue: "foo", + StringValues: []string{"foo", "bar"}, + BytesValue: []byte("foo"), + BytesValues: [][]byte{[]byte("foo"), []byte("bar")}, + }, + expected: `{ + "double_value": 12.34, + "double_values": [12.34, 56.78], + "float_value": 12.34, + "float_values": [12.34, 56.78], + "int32_value": -42, + "int32_values": [1, 2, -42], + "int64_value": "-42", + "int64_values": ["1", "2", "-42"], + "uint32_value": 42, + "uint32_values": [1, 2, 42], + "uint64_value": "42", + "uint64_values": ["1", "2", "42"], + "sint32_value": -42, + "sint32_values": [1, 2, -42], + "sint64_value": "-42", + "sint64_values": ["1", "2", "-42"], + "fixed32_value": 42, + "fixed32_values": [1, 2, 42], + "fixed64_value": "42", + "fixed64_values": ["1", "2", "42"], + "sfixed32_value": -42, + "sfixed32_values": [1, 2, -42], + "sfixed64_value": "-42", + "sfixed64_values": ["1", "2", "-42"], + "bool_value": true, + "bool_values": [true, false], + "string_value": "foo", + "string_values": ["foo", "bar"], + "bytes_value": "Zm9v", + "bytes_values": ["Zm9v", "YmFy"] + }`, + expectedMask: []string{ + "double_value", + "double_values", + "float_value", + "float_values", + "int32_value", + "int32_values", + "int64_value", + "int64_values", + "uint32_value", + "uint32_values", + "uint64_value", + "uint64_values", + "sint32_value", + "sint32_values", + "sint64_value", + "sint64_values", + "fixed32_value", + "fixed32_values", + "fixed64_value", + "fixed64_values", + "sfixed32_value", + "sfixed32_values", + "sfixed64_value", + "sfixed64_values", + "bool_value", + "bool_values", + "string_value", + "string_values", + "bytes_value", + "bytes_values", + }, + }, +} + +func TestMarshalMessageWithScalars(t *testing.T) { + for _, tt := range testMessagesWithScalars { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithScalars(t *testing.T) { + for _, tt := range testMessagesWithScalars { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithOneofScalars = []struct { + name string + msg MessageWithOneofScalars + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithOneofScalars{}, + expected: `{}`, + }, + { + name: "double_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_DoubleValue{}, + }, + expected: `{"double_value": 0}`, + expectedMask: []string{"double_value"}, + }, + { + name: "double_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_DoubleValue{DoubleValue: 12.34}, + }, + expected: `{"double_value": 12.34}`, + expectedMask: []string{"double_value"}, + }, + { + name: "float_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_FloatValue{}, + }, + expected: `{"float_value": 0}`, + expectedMask: []string{"float_value"}, + }, + { + name: "float_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_FloatValue{FloatValue: 12.34}, + }, + expected: `{"float_value": 12.34}`, + expectedMask: []string{"float_value"}, + }, + { + name: "int32_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Int32Value{}, + }, + expected: `{"int32_value": 0}`, + expectedMask: []string{"int32_value"}, + }, + { + name: "int32_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Int32Value{Int32Value: -42}, + }, + expected: `{"int32_value": -42}`, + expectedMask: []string{"int32_value"}, + }, + { + name: "int64_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Int64Value{}, + }, + expected: `{"int64_value": "0"}`, + expectedMask: []string{"int64_value"}, + }, + { + name: "int64_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Int64Value{Int64Value: -42}, + }, + expected: `{"int64_value": "-42"}`, + expectedMask: []string{"int64_value"}, + }, + { + name: "uint32_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Uint32Value{}, + }, + expected: `{"uint32_value": 0}`, + expectedMask: []string{"uint32_value"}, + }, + { + name: "uint32_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Uint32Value{Uint32Value: 42}, + }, + expected: `{"uint32_value": 42}`, + expectedMask: []string{"uint32_value"}, + }, + { + name: "uint64_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Uint64Value{}, + }, + expected: `{"uint64_value": "0"}`, + expectedMask: []string{"uint64_value"}, + }, + { + name: "uint64_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Uint64Value{Uint64Value: 42}, + }, + expected: `{"uint64_value": "42"}`, + expectedMask: []string{"uint64_value"}, + }, + { + name: "sint32_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sint32Value{}, + }, + expected: `{"sint32_value": 0}`, + expectedMask: []string{"sint32_value"}, + }, + { + name: "sint32_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sint32Value{Sint32Value: -42}, + }, + expected: `{"sint32_value": -42}`, + expectedMask: []string{"sint32_value"}, + }, + { + name: "sint64_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sint64Value{}, + }, + expected: `{"sint64_value": "0"}`, + expectedMask: []string{"sint64_value"}, + }, + { + name: "sint64_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sint64Value{Sint64Value: -42}, + }, + expected: `{"sint64_value": "-42"}`, + expectedMask: []string{"sint64_value"}, + }, + { + name: "fixed32_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Fixed32Value{}, + }, + expected: `{"fixed32_value": 0}`, + expectedMask: []string{"fixed32_value"}, + }, + { + name: "fixed32_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Fixed32Value{Fixed32Value: 42}, + }, + expected: `{"fixed32_value": 42}`, + expectedMask: []string{"fixed32_value"}, + }, + { + name: "fixed64_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Fixed64Value{}, + }, + expected: `{"fixed64_value": "0"}`, + expectedMask: []string{"fixed64_value"}, + }, + { + name: "fixed64_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Fixed64Value{Fixed64Value: 42}, + }, + expected: `{"fixed64_value": "42"}`, + expectedMask: []string{"fixed64_value"}, + }, + + { + name: "sfixed32_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sfixed32Value{}, + }, + expected: `{"sfixed32_value": 0}`, + expectedMask: []string{"sfixed32_value"}, + }, + { + name: "sfixed32_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sfixed32Value{Sfixed32Value: -42}, + }, + expected: `{"sfixed32_value": -42}`, + expectedMask: []string{"sfixed32_value"}, + }, + { + name: "sfixed64_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sfixed64Value{}, + }, + expected: `{"sfixed64_value": "0"}`, + expectedMask: []string{"sfixed64_value"}, + }, + { + name: "sfixed64_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_Sfixed64Value{Sfixed64Value: -42}, + }, + expected: `{"sfixed64_value": "-42"}`, + expectedMask: []string{"sfixed64_value"}, + }, + + { + name: "bool_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_BoolValue{}, + }, + expected: `{"bool_value": false}`, + expectedMask: []string{"bool_value"}, + }, + { + name: "bool_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_BoolValue{BoolValue: true}, + }, + expected: `{"bool_value": true}`, + expectedMask: []string{"bool_value"}, + }, + { + name: "string_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_StringValue{}, + }, + expected: `{"string_value": ""}`, + expectedMask: []string{"string_value"}, + }, + { + name: "string_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_StringValue{StringValue: "foo"}, + }, + expected: `{"string_value": "foo"}`, + expectedMask: []string{"string_value"}, + }, + { + name: "bytes_null", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_BytesValue{}, + }, + expected: `{"bytes_value": null}`, + expectedMask: []string{"bytes_value"}, + }, + { + name: "bytes_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_BytesValue{BytesValue: []byte{}}, + }, + expected: `{"bytes_value": ""}`, + expectedMask: []string{"bytes_value"}, + }, + { + name: "bytes_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_BytesValue{BytesValue: []byte("foo")}, + }, + expected: `{"bytes_value": "Zm9v"}`, + expectedMask: []string{"bytes_value"}, + }, +} + +func TestMarshalMessageWithOneofScalars(t *testing.T) { + for _, tt := range testMessagesWithOneofScalars { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithOneofScalars(t *testing.T) { + for _, tt := range testMessagesWithOneofScalars { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithScalarMaps = []struct { + name string + msg MessageWithScalarMaps + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithScalarMaps{}, + expected: `{}`, + }, + { + name: "full", + msg: MessageWithScalarMaps{ + StringDoubleMap: map[string]float64{"value": -42}, + StringFloatMap: map[string]float32{"value": -42}, + StringInt32Map: map[string]int32{"value": -42}, + Int32StringMap: map[int32]string{-42: "answer"}, + StringInt64Map: map[string]int64{"value": -42}, + Int64StringMap: map[int64]string{-42: "answer"}, + StringUint32Map: map[string]uint32{"value": 42}, + Uint32StringMap: map[uint32]string{42: "answer"}, + StringUint64Map: map[string]uint64{"value": 42}, + Uint64StringMap: map[uint64]string{42: "answer"}, + StringSint32Map: map[string]int32{"value": -42}, + Sint32StringMap: map[int32]string{-42: "answer"}, + StringSint64Map: map[string]int64{"value": -42}, + Sint64StringMap: map[int64]string{-42: "answer"}, + StringFixed32Map: map[string]uint32{"value": 42}, + Fixed32StringMap: map[uint32]string{42: "answer"}, + StringFixed64Map: map[string]uint64{"value": 42}, + Fixed64StringMap: map[uint64]string{42: "answer"}, + StringSfixed32Map: map[string]int32{"value": -42}, + Sfixed32StringMap: map[int32]string{-42: "answer"}, + StringSfixed64Map: map[string]int64{"value": -42}, + Sfixed64StringMap: map[int64]string{-42: "answer"}, + StringBoolMap: map[string]bool{"yes": true}, + BoolStringMap: map[bool]string{true: "yes"}, + StringStringMap: map[string]string{"value": "foo"}, + StringBytesMap: map[string][]byte{"value": []byte("foo")}, + }, + expected: `{ + "string_double_map": {"value": -42}, + "string_float_map": {"value": -42}, + "string_int32_map": {"value": -42}, + "int32_string_map": {"-42": "answer"}, + "string_int64_map": {"value": "-42"}, + "int64_string_map": {"-42": "answer"}, + "string_uint32_map": {"value": 42}, + "uint32_string_map": {"42": "answer"}, + "string_uint64_map": {"value": "42"}, + "uint64_string_map": {"42": "answer"}, + "string_sint32_map": {"value": -42}, + "sint32_string_map": {"-42": "answer"}, + "string_sint64_map": {"value": "-42"}, + "sint64_string_map": {"-42": "answer"}, + "string_fixed32_map": {"value": 42}, + "fixed32_string_map": {"42": "answer"}, + "string_fixed64_map": {"value": "42"}, + "fixed64_string_map": {"42": "answer"}, + "string_sfixed32_map": {"value": -42}, + "sfixed32_string_map": {"-42": "answer"}, + "string_sfixed64_map": {"value": "-42"}, + "sfixed64_string_map": {"-42": "answer"}, + "string_bool_map": {"yes": true}, + "bool_string_map": {"true": "yes"}, + "string_string_map": {"value": "foo"}, + "string_bytes_map": {"value": "Zm9v"} + }`, + expectedMask: []string{ + "string_double_map", + "string_float_map", + "string_int32_map", + "int32_string_map", + "string_int64_map", + "int64_string_map", + "string_uint32_map", + "uint32_string_map", + "string_uint64_map", + "uint64_string_map", + "string_sint32_map", + "sint32_string_map", + "string_sint64_map", + "sint64_string_map", + "string_fixed32_map", + "fixed32_string_map", + "string_fixed64_map", + "fixed64_string_map", + "string_sfixed32_map", + "sfixed32_string_map", + "string_sfixed64_map", + "sfixed64_string_map", + "string_bool_map", + "bool_string_map", + "string_string_map", + "string_bytes_map", + }, + }, +} + +func TestMarshalMessageWithScalarMaps(t *testing.T) { + for _, tt := range testMessagesWithScalarMaps { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithScalarMaps(t *testing.T) { + for _, tt := range testMessagesWithScalarMaps { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} diff --git a/test/golang/utils_test.go b/test/golang/utils_test.go new file mode 100644 index 00000000..cc23fbe1 --- /dev/null +++ b/test/golang/utils_test.go @@ -0,0 +1,104 @@ +package test_test + +import ( + "bytes" + "encoding/json" + "reflect" + "testing" + + "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" + "github.com/google/go-cmp/cmp" + "google.golang.org/protobuf/encoding/prototext" + proto "google.golang.org/protobuf/proto" +) + +var pluginMarshaler = jsonplugin.MarshalerConfig{ + EnumsAsInts: true, +} + +func generatedMarshal(t *testing.T, msg proto.Message, mask []string) []byte { + t.Helper() + m, ok := msg.(jsonplugin.Marshaler) + if !ok { + t.Fatalf("message %T does not implement the jsonplugin.Marshaler", msg) + } + s := jsonplugin.NewMarshalState(pluginMarshaler).WithFieldMask(mask...) + m.MarshalProtoJSON(s) + b, err := s.Bytes() + if err != nil { + t.Fatalf("generated failed to marshal: %v", err) + } + return b +} + +func generatedUnmarshal(t *testing.T, msg proto.Message, data []byte) []string { + t.Helper() + unmarshaler, ok := msg.(jsonplugin.Unmarshaler) + if !ok { + t.Fatalf("message %T does not implement the jsonplugin.Unmarshaler", msg) + } + s := jsonplugin.NewUnmarshalState(data, jsonplugin.UnmarshalerConfig{}) + unmarshaler.UnmarshalProtoJSON(s) + if err := s.Err(); err != nil { + t.Fatalf("generated failed to unmarshal: %v", err) + } + paths := s.FieldMask().GetPaths() + if len(paths) == 0 { + return nil + } + return paths +} + +func indent(t *testing.T, data []byte) string { + t.Helper() + var buf bytes.Buffer + if err := json.Indent(&buf, data, "", " "); err != nil { + t.Fatalf("failed to indent %s: %v", string(data), err) + } + return buf.String() +} + +func expectMarshalEqual(t *testing.T, msg proto.Message, mask []string, expected []byte) { + t.Helper() + + expectedFormatted := indent(t, expected) + + generatedMarshaled := generatedMarshal(t, msg, mask) + generatedFormatted := indent(t, generatedMarshaled) + generatedDiff := cmp.Diff(expectedFormatted, generatedFormatted) + + if generatedDiff != "" { + t.Errorf("expected : %s", string(expected)) + t.Errorf("generated: %s", string(generatedMarshaled)) + if generatedDiff != "" { + t.Errorf(" diff : %s", generatedDiff) + } + } +} + +func expectUnmarshalEqual(t *testing.T, msg proto.Message, expected []byte, expectedMask []string) { + t.Helper() + if msg == nil { + return + } + + expectedMsgText := prototext.Format(msg) + + generatedUnmarshaled := reflect.New(reflect.ValueOf(msg).Elem().Type()).Interface().(proto.Message) + mask := generatedUnmarshal(t, generatedUnmarshaled, expected) + generatedMsgText := prototext.Format(generatedUnmarshaled) + generatedDiff := cmp.Diff(expectedMsgText, generatedMsgText) + maskDiff := cmp.Diff(expectedMask, mask) + + if generatedDiff != "" { + t.Errorf("expected : %s", string(expectedMsgText)) + t.Errorf("generated: %s", string(generatedMsgText)) + if generatedDiff != "" { + t.Errorf(" diff : %s", generatedDiff) + } + } + + if maskDiff != "" { + t.Errorf("mask diff: %s", maskDiff) + } +} diff --git a/test/golang/wkts.pb.go b/test/golang/wkts.pb.go new file mode 100644 index 00000000..eef9b059 --- /dev/null +++ b/test/golang/wkts.pb.go @@ -0,0 +1,1612 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.17.3 +// source: wkts.proto + +package test + +import ( + _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + durationpb "google.golang.org/protobuf/types/known/durationpb" + emptypb "google.golang.org/protobuf/types/known/emptypb" + fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + structpb "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MessageWithMarshaler struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *MessageWithMarshaler) Reset() { + *x = MessageWithMarshaler{} + if protoimpl.UnsafeEnabled { + mi := &file_wkts_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithMarshaler) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithMarshaler) ProtoMessage() {} + +func (x *MessageWithMarshaler) ProtoReflect() protoreflect.Message { + mi := &file_wkts_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithMarshaler.ProtoReflect.Descriptor instead. +func (*MessageWithMarshaler) Descriptor() ([]byte, []int) { + return file_wkts_proto_rawDescGZIP(), []int{0} +} + +func (x *MessageWithMarshaler) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type MessageWithoutMarshaler struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *MessageWithoutMarshaler) Reset() { + *x = MessageWithoutMarshaler{} + if protoimpl.UnsafeEnabled { + mi := &file_wkts_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithoutMarshaler) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithoutMarshaler) ProtoMessage() {} + +func (x *MessageWithoutMarshaler) ProtoReflect() protoreflect.Message { + mi := &file_wkts_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithoutMarshaler.ProtoReflect.Descriptor instead. +func (*MessageWithoutMarshaler) Descriptor() ([]byte, []int) { + return file_wkts_proto_rawDescGZIP(), []int{1} +} + +func (x *MessageWithoutMarshaler) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type MessageWithWKTs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DoubleValue *wrapperspb.DoubleValue `protobuf:"bytes,1,opt,name=double_value,json=doubleValue,proto3" json:"double_value,omitempty"` + DoubleValues []*wrapperspb.DoubleValue `protobuf:"bytes,2,rep,name=double_values,json=doubleValues,proto3" json:"double_values,omitempty"` + FloatValue *wrapperspb.FloatValue `protobuf:"bytes,3,opt,name=float_value,json=floatValue,proto3" json:"float_value,omitempty"` + FloatValues []*wrapperspb.FloatValue `protobuf:"bytes,4,rep,name=float_values,json=floatValues,proto3" json:"float_values,omitempty"` + Int32Value *wrapperspb.Int32Value `protobuf:"bytes,5,opt,name=int32_value,json=int32Value,proto3" json:"int32_value,omitempty"` + Int32Values []*wrapperspb.Int32Value `protobuf:"bytes,6,rep,name=int32_values,json=int32Values,proto3" json:"int32_values,omitempty"` + Int64Value *wrapperspb.Int64Value `protobuf:"bytes,7,opt,name=int64_value,json=int64Value,proto3" json:"int64_value,omitempty"` + Int64Values []*wrapperspb.Int64Value `protobuf:"bytes,8,rep,name=int64_values,json=int64Values,proto3" json:"int64_values,omitempty"` + Uint32Value *wrapperspb.UInt32Value `protobuf:"bytes,9,opt,name=uint32_value,json=uint32Value,proto3" json:"uint32_value,omitempty"` + Uint32Values []*wrapperspb.UInt32Value `protobuf:"bytes,10,rep,name=uint32_values,json=uint32Values,proto3" json:"uint32_values,omitempty"` + Uint64Value *wrapperspb.UInt64Value `protobuf:"bytes,11,opt,name=uint64_value,json=uint64Value,proto3" json:"uint64_value,omitempty"` + Uint64Values []*wrapperspb.UInt64Value `protobuf:"bytes,12,rep,name=uint64_values,json=uint64Values,proto3" json:"uint64_values,omitempty"` + BoolValue *wrapperspb.BoolValue `protobuf:"bytes,13,opt,name=bool_value,json=boolValue,proto3" json:"bool_value,omitempty"` + BoolValues []*wrapperspb.BoolValue `protobuf:"bytes,14,rep,name=bool_values,json=boolValues,proto3" json:"bool_values,omitempty"` + StringValue *wrapperspb.StringValue `protobuf:"bytes,15,opt,name=string_value,json=stringValue,proto3" json:"string_value,omitempty"` + StringValues []*wrapperspb.StringValue `protobuf:"bytes,16,rep,name=string_values,json=stringValues,proto3" json:"string_values,omitempty"` + BytesValue *wrapperspb.BytesValue `protobuf:"bytes,17,opt,name=bytes_value,json=bytesValue,proto3" json:"bytes_value,omitempty"` + BytesValues []*wrapperspb.BytesValue `protobuf:"bytes,18,rep,name=bytes_values,json=bytesValues,proto3" json:"bytes_values,omitempty"` + EmptyValue *emptypb.Empty `protobuf:"bytes,19,opt,name=empty_value,json=emptyValue,proto3" json:"empty_value,omitempty"` + EmptyValues []*emptypb.Empty `protobuf:"bytes,20,rep,name=empty_values,json=emptyValues,proto3" json:"empty_values,omitempty"` + TimestampValue *timestamppb.Timestamp `protobuf:"bytes,21,opt,name=timestamp_value,json=timestampValue,proto3" json:"timestamp_value,omitempty"` + TimestampValues []*timestamppb.Timestamp `protobuf:"bytes,22,rep,name=timestamp_values,json=timestampValues,proto3" json:"timestamp_values,omitempty"` + DurationValue *durationpb.Duration `protobuf:"bytes,23,opt,name=duration_value,json=durationValue,proto3" json:"duration_value,omitempty"` + DurationValues []*durationpb.Duration `protobuf:"bytes,24,rep,name=duration_values,json=durationValues,proto3" json:"duration_values,omitempty"` + FieldMaskValue *fieldmaskpb.FieldMask `protobuf:"bytes,25,opt,name=field_mask_value,json=fieldMaskValue,proto3" json:"field_mask_value,omitempty"` + FieldMaskValues []*fieldmaskpb.FieldMask `protobuf:"bytes,26,rep,name=field_mask_values,json=fieldMaskValues,proto3" json:"field_mask_values,omitempty"` + ValueValue *structpb.Value `protobuf:"bytes,27,opt,name=value_value,json=valueValue,proto3" json:"value_value,omitempty"` + ValueValues []*structpb.Value `protobuf:"bytes,28,rep,name=value_values,json=valueValues,proto3" json:"value_values,omitempty"` + ListValueValue *structpb.ListValue `protobuf:"bytes,29,opt,name=list_value_value,json=listValueValue,proto3" json:"list_value_value,omitempty"` + ListValueValues []*structpb.ListValue `protobuf:"bytes,30,rep,name=list_value_values,json=listValueValues,proto3" json:"list_value_values,omitempty"` + StructValue *structpb.Struct `protobuf:"bytes,31,opt,name=struct_value,json=structValue,proto3" json:"struct_value,omitempty"` + StructValues []*structpb.Struct `protobuf:"bytes,32,rep,name=struct_values,json=structValues,proto3" json:"struct_values,omitempty"` + AnyValue *anypb.Any `protobuf:"bytes,33,opt,name=any_value,json=anyValue,proto3" json:"any_value,omitempty"` + AnyValues []*anypb.Any `protobuf:"bytes,34,rep,name=any_values,json=anyValues,proto3" json:"any_values,omitempty"` +} + +func (x *MessageWithWKTs) Reset() { + *x = MessageWithWKTs{} + if protoimpl.UnsafeEnabled { + mi := &file_wkts_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithWKTs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithWKTs) ProtoMessage() {} + +func (x *MessageWithWKTs) ProtoReflect() protoreflect.Message { + mi := &file_wkts_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithWKTs.ProtoReflect.Descriptor instead. +func (*MessageWithWKTs) Descriptor() ([]byte, []int) { + return file_wkts_proto_rawDescGZIP(), []int{2} +} + +func (x *MessageWithWKTs) GetDoubleValue() *wrapperspb.DoubleValue { + if x != nil { + return x.DoubleValue + } + return nil +} + +func (x *MessageWithWKTs) GetDoubleValues() []*wrapperspb.DoubleValue { + if x != nil { + return x.DoubleValues + } + return nil +} + +func (x *MessageWithWKTs) GetFloatValue() *wrapperspb.FloatValue { + if x != nil { + return x.FloatValue + } + return nil +} + +func (x *MessageWithWKTs) GetFloatValues() []*wrapperspb.FloatValue { + if x != nil { + return x.FloatValues + } + return nil +} + +func (x *MessageWithWKTs) GetInt32Value() *wrapperspb.Int32Value { + if x != nil { + return x.Int32Value + } + return nil +} + +func (x *MessageWithWKTs) GetInt32Values() []*wrapperspb.Int32Value { + if x != nil { + return x.Int32Values + } + return nil +} + +func (x *MessageWithWKTs) GetInt64Value() *wrapperspb.Int64Value { + if x != nil { + return x.Int64Value + } + return nil +} + +func (x *MessageWithWKTs) GetInt64Values() []*wrapperspb.Int64Value { + if x != nil { + return x.Int64Values + } + return nil +} + +func (x *MessageWithWKTs) GetUint32Value() *wrapperspb.UInt32Value { + if x != nil { + return x.Uint32Value + } + return nil +} + +func (x *MessageWithWKTs) GetUint32Values() []*wrapperspb.UInt32Value { + if x != nil { + return x.Uint32Values + } + return nil +} + +func (x *MessageWithWKTs) GetUint64Value() *wrapperspb.UInt64Value { + if x != nil { + return x.Uint64Value + } + return nil +} + +func (x *MessageWithWKTs) GetUint64Values() []*wrapperspb.UInt64Value { + if x != nil { + return x.Uint64Values + } + return nil +} + +func (x *MessageWithWKTs) GetBoolValue() *wrapperspb.BoolValue { + if x != nil { + return x.BoolValue + } + return nil +} + +func (x *MessageWithWKTs) GetBoolValues() []*wrapperspb.BoolValue { + if x != nil { + return x.BoolValues + } + return nil +} + +func (x *MessageWithWKTs) GetStringValue() *wrapperspb.StringValue { + if x != nil { + return x.StringValue + } + return nil +} + +func (x *MessageWithWKTs) GetStringValues() []*wrapperspb.StringValue { + if x != nil { + return x.StringValues + } + return nil +} + +func (x *MessageWithWKTs) GetBytesValue() *wrapperspb.BytesValue { + if x != nil { + return x.BytesValue + } + return nil +} + +func (x *MessageWithWKTs) GetBytesValues() []*wrapperspb.BytesValue { + if x != nil { + return x.BytesValues + } + return nil +} + +func (x *MessageWithWKTs) GetEmptyValue() *emptypb.Empty { + if x != nil { + return x.EmptyValue + } + return nil +} + +func (x *MessageWithWKTs) GetEmptyValues() []*emptypb.Empty { + if x != nil { + return x.EmptyValues + } + return nil +} + +func (x *MessageWithWKTs) GetTimestampValue() *timestamppb.Timestamp { + if x != nil { + return x.TimestampValue + } + return nil +} + +func (x *MessageWithWKTs) GetTimestampValues() []*timestamppb.Timestamp { + if x != nil { + return x.TimestampValues + } + return nil +} + +func (x *MessageWithWKTs) GetDurationValue() *durationpb.Duration { + if x != nil { + return x.DurationValue + } + return nil +} + +func (x *MessageWithWKTs) GetDurationValues() []*durationpb.Duration { + if x != nil { + return x.DurationValues + } + return nil +} + +func (x *MessageWithWKTs) GetFieldMaskValue() *fieldmaskpb.FieldMask { + if x != nil { + return x.FieldMaskValue + } + return nil +} + +func (x *MessageWithWKTs) GetFieldMaskValues() []*fieldmaskpb.FieldMask { + if x != nil { + return x.FieldMaskValues + } + return nil +} + +func (x *MessageWithWKTs) GetValueValue() *structpb.Value { + if x != nil { + return x.ValueValue + } + return nil +} + +func (x *MessageWithWKTs) GetValueValues() []*structpb.Value { + if x != nil { + return x.ValueValues + } + return nil +} + +func (x *MessageWithWKTs) GetListValueValue() *structpb.ListValue { + if x != nil { + return x.ListValueValue + } + return nil +} + +func (x *MessageWithWKTs) GetListValueValues() []*structpb.ListValue { + if x != nil { + return x.ListValueValues + } + return nil +} + +func (x *MessageWithWKTs) GetStructValue() *structpb.Struct { + if x != nil { + return x.StructValue + } + return nil +} + +func (x *MessageWithWKTs) GetStructValues() []*structpb.Struct { + if x != nil { + return x.StructValues + } + return nil +} + +func (x *MessageWithWKTs) GetAnyValue() *anypb.Any { + if x != nil { + return x.AnyValue + } + return nil +} + +func (x *MessageWithWKTs) GetAnyValues() []*anypb.Any { + if x != nil { + return x.AnyValues + } + return nil +} + +type MessageWithOneofWKTs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Value: + // *MessageWithOneofWKTs_DoubleValue + // *MessageWithOneofWKTs_FloatValue + // *MessageWithOneofWKTs_Int32Value + // *MessageWithOneofWKTs_Int64Value + // *MessageWithOneofWKTs_Uint32Value + // *MessageWithOneofWKTs_Uint64Value + // *MessageWithOneofWKTs_BoolValue + // *MessageWithOneofWKTs_StringValue + // *MessageWithOneofWKTs_BytesValue + // *MessageWithOneofWKTs_EmptyValue + // *MessageWithOneofWKTs_TimestampValue + // *MessageWithOneofWKTs_DurationValue + // *MessageWithOneofWKTs_FieldMaskValue + // *MessageWithOneofWKTs_ValueValue + // *MessageWithOneofWKTs_ListValueValue + // *MessageWithOneofWKTs_StructValue + // *MessageWithOneofWKTs_AnyValue + Value isMessageWithOneofWKTs_Value `protobuf_oneof:"value"` +} + +func (x *MessageWithOneofWKTs) Reset() { + *x = MessageWithOneofWKTs{} + if protoimpl.UnsafeEnabled { + mi := &file_wkts_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithOneofWKTs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithOneofWKTs) ProtoMessage() {} + +func (x *MessageWithOneofWKTs) ProtoReflect() protoreflect.Message { + mi := &file_wkts_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithOneofWKTs.ProtoReflect.Descriptor instead. +func (*MessageWithOneofWKTs) Descriptor() ([]byte, []int) { + return file_wkts_proto_rawDescGZIP(), []int{3} +} + +func (m *MessageWithOneofWKTs) GetValue() isMessageWithOneofWKTs_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *MessageWithOneofWKTs) GetDoubleValue() *wrapperspb.DoubleValue { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_DoubleValue); ok { + return x.DoubleValue + } + return nil +} + +func (x *MessageWithOneofWKTs) GetFloatValue() *wrapperspb.FloatValue { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_FloatValue); ok { + return x.FloatValue + } + return nil +} + +func (x *MessageWithOneofWKTs) GetInt32Value() *wrapperspb.Int32Value { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_Int32Value); ok { + return x.Int32Value + } + return nil +} + +func (x *MessageWithOneofWKTs) GetInt64Value() *wrapperspb.Int64Value { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_Int64Value); ok { + return x.Int64Value + } + return nil +} + +func (x *MessageWithOneofWKTs) GetUint32Value() *wrapperspb.UInt32Value { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_Uint32Value); ok { + return x.Uint32Value + } + return nil +} + +func (x *MessageWithOneofWKTs) GetUint64Value() *wrapperspb.UInt64Value { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_Uint64Value); ok { + return x.Uint64Value + } + return nil +} + +func (x *MessageWithOneofWKTs) GetBoolValue() *wrapperspb.BoolValue { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_BoolValue); ok { + return x.BoolValue + } + return nil +} + +func (x *MessageWithOneofWKTs) GetStringValue() *wrapperspb.StringValue { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_StringValue); ok { + return x.StringValue + } + return nil +} + +func (x *MessageWithOneofWKTs) GetBytesValue() *wrapperspb.BytesValue { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_BytesValue); ok { + return x.BytesValue + } + return nil +} + +func (x *MessageWithOneofWKTs) GetEmptyValue() *emptypb.Empty { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_EmptyValue); ok { + return x.EmptyValue + } + return nil +} + +func (x *MessageWithOneofWKTs) GetTimestampValue() *timestamppb.Timestamp { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_TimestampValue); ok { + return x.TimestampValue + } + return nil +} + +func (x *MessageWithOneofWKTs) GetDurationValue() *durationpb.Duration { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_DurationValue); ok { + return x.DurationValue + } + return nil +} + +func (x *MessageWithOneofWKTs) GetFieldMaskValue() *fieldmaskpb.FieldMask { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_FieldMaskValue); ok { + return x.FieldMaskValue + } + return nil +} + +func (x *MessageWithOneofWKTs) GetValueValue() *structpb.Value { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_ValueValue); ok { + return x.ValueValue + } + return nil +} + +func (x *MessageWithOneofWKTs) GetListValueValue() *structpb.ListValue { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_ListValueValue); ok { + return x.ListValueValue + } + return nil +} + +func (x *MessageWithOneofWKTs) GetStructValue() *structpb.Struct { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_StructValue); ok { + return x.StructValue + } + return nil +} + +func (x *MessageWithOneofWKTs) GetAnyValue() *anypb.Any { + if x, ok := x.GetValue().(*MessageWithOneofWKTs_AnyValue); ok { + return x.AnyValue + } + return nil +} + +type isMessageWithOneofWKTs_Value interface { + isMessageWithOneofWKTs_Value() +} + +type MessageWithOneofWKTs_DoubleValue struct { + DoubleValue *wrapperspb.DoubleValue `protobuf:"bytes,1,opt,name=double_value,json=doubleValue,proto3,oneof"` +} + +type MessageWithOneofWKTs_FloatValue struct { + FloatValue *wrapperspb.FloatValue `protobuf:"bytes,2,opt,name=float_value,json=floatValue,proto3,oneof"` +} + +type MessageWithOneofWKTs_Int32Value struct { + Int32Value *wrapperspb.Int32Value `protobuf:"bytes,3,opt,name=int32_value,json=int32Value,proto3,oneof"` +} + +type MessageWithOneofWKTs_Int64Value struct { + Int64Value *wrapperspb.Int64Value `protobuf:"bytes,4,opt,name=int64_value,json=int64Value,proto3,oneof"` +} + +type MessageWithOneofWKTs_Uint32Value struct { + Uint32Value *wrapperspb.UInt32Value `protobuf:"bytes,5,opt,name=uint32_value,json=uint32Value,proto3,oneof"` +} + +type MessageWithOneofWKTs_Uint64Value struct { + Uint64Value *wrapperspb.UInt64Value `protobuf:"bytes,6,opt,name=uint64_value,json=uint64Value,proto3,oneof"` +} + +type MessageWithOneofWKTs_BoolValue struct { + BoolValue *wrapperspb.BoolValue `protobuf:"bytes,7,opt,name=bool_value,json=boolValue,proto3,oneof"` +} + +type MessageWithOneofWKTs_StringValue struct { + StringValue *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=string_value,json=stringValue,proto3,oneof"` +} + +type MessageWithOneofWKTs_BytesValue struct { + BytesValue *wrapperspb.BytesValue `protobuf:"bytes,9,opt,name=bytes_value,json=bytesValue,proto3,oneof"` +} + +type MessageWithOneofWKTs_EmptyValue struct { + EmptyValue *emptypb.Empty `protobuf:"bytes,10,opt,name=empty_value,json=emptyValue,proto3,oneof"` +} + +type MessageWithOneofWKTs_TimestampValue struct { + TimestampValue *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=timestamp_value,json=timestampValue,proto3,oneof"` +} + +type MessageWithOneofWKTs_DurationValue struct { + DurationValue *durationpb.Duration `protobuf:"bytes,12,opt,name=duration_value,json=durationValue,proto3,oneof"` +} + +type MessageWithOneofWKTs_FieldMaskValue struct { + FieldMaskValue *fieldmaskpb.FieldMask `protobuf:"bytes,13,opt,name=field_mask_value,json=fieldMaskValue,proto3,oneof"` +} + +type MessageWithOneofWKTs_ValueValue struct { + ValueValue *structpb.Value `protobuf:"bytes,14,opt,name=value_value,json=valueValue,proto3,oneof"` +} + +type MessageWithOneofWKTs_ListValueValue struct { + ListValueValue *structpb.ListValue `protobuf:"bytes,15,opt,name=list_value_value,json=listValueValue,proto3,oneof"` +} + +type MessageWithOneofWKTs_StructValue struct { + StructValue *structpb.Struct `protobuf:"bytes,16,opt,name=struct_value,json=structValue,proto3,oneof"` +} + +type MessageWithOneofWKTs_AnyValue struct { + AnyValue *anypb.Any `protobuf:"bytes,17,opt,name=any_value,json=anyValue,proto3,oneof"` +} + +func (*MessageWithOneofWKTs_DoubleValue) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_FloatValue) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_Int32Value) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_Int64Value) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_Uint32Value) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_Uint64Value) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_BoolValue) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_StringValue) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_BytesValue) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_EmptyValue) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_TimestampValue) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_DurationValue) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_FieldMaskValue) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_ValueValue) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_ListValueValue) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_StructValue) isMessageWithOneofWKTs_Value() {} + +func (*MessageWithOneofWKTs_AnyValue) isMessageWithOneofWKTs_Value() {} + +type MessageWithWKTMaps struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StringDoubleMap map[string]*wrapperspb.DoubleValue `protobuf:"bytes,1,rep,name=string_double_map,json=stringDoubleMap,proto3" json:"string_double_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringFloatMap map[string]*wrapperspb.FloatValue `protobuf:"bytes,2,rep,name=string_float_map,json=stringFloatMap,proto3" json:"string_float_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringInt32Map map[string]*wrapperspb.Int32Value `protobuf:"bytes,3,rep,name=string_int32_map,json=stringInt32Map,proto3" json:"string_int32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringInt64Map map[string]*wrapperspb.Int64Value `protobuf:"bytes,4,rep,name=string_int64_map,json=stringInt64Map,proto3" json:"string_int64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringUint32Map map[string]*wrapperspb.UInt32Value `protobuf:"bytes,5,rep,name=string_uint32_map,json=stringUint32Map,proto3" json:"string_uint32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringUint64Map map[string]*wrapperspb.UInt64Value `protobuf:"bytes,6,rep,name=string_uint64_map,json=stringUint64Map,proto3" json:"string_uint64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringBoolMap map[string]*wrapperspb.BoolValue `protobuf:"bytes,7,rep,name=string_bool_map,json=stringBoolMap,proto3" json:"string_bool_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringStringMap map[string]*wrapperspb.StringValue `protobuf:"bytes,8,rep,name=string_string_map,json=stringStringMap,proto3" json:"string_string_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringBytesMap map[string]*wrapperspb.BytesValue `protobuf:"bytes,9,rep,name=string_bytes_map,json=stringBytesMap,proto3" json:"string_bytes_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringEmptyMap map[string]*emptypb.Empty `protobuf:"bytes,10,rep,name=string_empty_map,json=stringEmptyMap,proto3" json:"string_empty_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringTimestampMap map[string]*timestamppb.Timestamp `protobuf:"bytes,11,rep,name=string_timestamp_map,json=stringTimestampMap,proto3" json:"string_timestamp_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringDurationMap map[string]*durationpb.Duration `protobuf:"bytes,12,rep,name=string_duration_map,json=stringDurationMap,proto3" json:"string_duration_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringFieldMaskMap map[string]*fieldmaskpb.FieldMask `protobuf:"bytes,13,rep,name=string_field_mask_map,json=stringFieldMaskMap,proto3" json:"string_field_mask_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringValueMap map[string]*structpb.Value `protobuf:"bytes,14,rep,name=string_value_map,json=stringValueMap,proto3" json:"string_value_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringListValueMap map[string]*structpb.ListValue `protobuf:"bytes,15,rep,name=string_list_value_map,json=stringListValueMap,proto3" json:"string_list_value_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringStructMap map[string]*structpb.Struct `protobuf:"bytes,16,rep,name=string_struct_map,json=stringStructMap,proto3" json:"string_struct_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringAnyMap map[string]*anypb.Any `protobuf:"bytes,17,rep,name=string_any_map,json=stringAnyMap,proto3" json:"string_any_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *MessageWithWKTMaps) Reset() { + *x = MessageWithWKTMaps{} + if protoimpl.UnsafeEnabled { + mi := &file_wkts_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithWKTMaps) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithWKTMaps) ProtoMessage() {} + +func (x *MessageWithWKTMaps) ProtoReflect() protoreflect.Message { + mi := &file_wkts_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithWKTMaps.ProtoReflect.Descriptor instead. +func (*MessageWithWKTMaps) Descriptor() ([]byte, []int) { + return file_wkts_proto_rawDescGZIP(), []int{4} +} + +func (x *MessageWithWKTMaps) GetStringDoubleMap() map[string]*wrapperspb.DoubleValue { + if x != nil { + return x.StringDoubleMap + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringFloatMap() map[string]*wrapperspb.FloatValue { + if x != nil { + return x.StringFloatMap + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringInt32Map() map[string]*wrapperspb.Int32Value { + if x != nil { + return x.StringInt32Map + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringInt64Map() map[string]*wrapperspb.Int64Value { + if x != nil { + return x.StringInt64Map + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringUint32Map() map[string]*wrapperspb.UInt32Value { + if x != nil { + return x.StringUint32Map + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringUint64Map() map[string]*wrapperspb.UInt64Value { + if x != nil { + return x.StringUint64Map + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringBoolMap() map[string]*wrapperspb.BoolValue { + if x != nil { + return x.StringBoolMap + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringStringMap() map[string]*wrapperspb.StringValue { + if x != nil { + return x.StringStringMap + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringBytesMap() map[string]*wrapperspb.BytesValue { + if x != nil { + return x.StringBytesMap + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringEmptyMap() map[string]*emptypb.Empty { + if x != nil { + return x.StringEmptyMap + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringTimestampMap() map[string]*timestamppb.Timestamp { + if x != nil { + return x.StringTimestampMap + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringDurationMap() map[string]*durationpb.Duration { + if x != nil { + return x.StringDurationMap + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringFieldMaskMap() map[string]*fieldmaskpb.FieldMask { + if x != nil { + return x.StringFieldMaskMap + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringValueMap() map[string]*structpb.Value { + if x != nil { + return x.StringValueMap + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringListValueMap() map[string]*structpb.ListValue { + if x != nil { + return x.StringListValueMap + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringStructMap() map[string]*structpb.Struct { + if x != nil { + return x.StringStructMap + } + return nil +} + +func (x *MessageWithWKTMaps) GetStringAnyMap() map[string]*anypb.Any { + if x != nil { + return x.StringAnyMap + } + return nil +} + +var File_wkts_proto protoreflect.FileDescriptor + +var file_wkts_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x77, 0x6b, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x74, 0x68, + 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, + 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x30, 0x0a, + 0x14, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x61, 0x72, 0x73, + 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, + 0x3c, 0x0a, 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, + 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x3a, 0x07, 0xea, 0x75, 0x04, 0x08, 0x00, 0x10, 0x00, 0x22, 0x89, 0x11, + 0x0a, 0x0f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, + 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, + 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, + 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, + 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x3e, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, + 0x3f, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x41, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, + 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, + 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, + 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, + 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, + 0x3f, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x41, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0a, + 0x65, 0x6d, 0x70, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x65, 0x6d, + 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x10, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x16, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x10, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x19, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0e, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, + 0x11, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, + 0x0a, 0x0c, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1c, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x10, 0x6c, 0x69, 0x73, + 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1d, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x0e, 0x6c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x46, 0x0a, 0x11, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x6c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x20, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, + 0x75, 0x63, 0x74, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x31, 0x0a, 0x09, 0x61, 0x6e, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x21, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x61, 0x6e, 0x79, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x61, 0x6e, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x22, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, + 0x61, 0x6e, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xec, 0x08, 0x0a, 0x14, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x57, 0x4b, + 0x54, 0x73, 0x12, 0x41, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, + 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, 0x74, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, + 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, + 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, + 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x75, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, + 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, + 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x62, + 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x62, + 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, + 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x6d, 0x70, 0x74, + 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x0e, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, + 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x48, 0x00, 0x52, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x46, 0x0a, 0x10, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x0e, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x4d, 0x61, 0x73, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x6c, 0x69, + 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, 0x0c, + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x73, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x6e, + 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x41, 0x6e, 0x79, 0x48, 0x00, 0x52, 0x08, 0x61, 0x6e, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, + 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xfa, 0x1a, 0x0a, 0x12, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x12, + 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, + 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, + 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, + 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, + 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, + 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x68, + 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, + 0x6d, 0x61, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, 0x74, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, + 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, + 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, + 0x61, 0x70, 0x12, 0x62, 0x0a, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x6f, 0x6f, + 0x6c, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x74, 0x68, + 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, + 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, + 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, + 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0a, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x61, 0x70, 0x12, 0x71, + 0x0a, 0x14, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, + 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, + 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x61, + 0x70, 0x12, 0x6e, 0x0a, 0x13, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, + 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, + 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, + 0x70, 0x12, 0x72, 0x0a, 0x15, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, + 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x12, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, + 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, + 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x72, 0x0a, 0x15, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, + 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, + 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, + 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x5f, 0x0a, 0x0e, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x6e, 0x79, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x11, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, + 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x41, 0x6e, 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x79, 0x4d, 0x61, 0x70, 0x1a, 0x60, 0x0a, 0x14, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, 0x0a, + 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, 0x0a, + 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, 0x0a, + 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x60, 0x0a, + 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x60, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, + 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x5c, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x60, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x5e, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x59, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x61, 0x0a, 0x17, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x5f, 0x0a, 0x16, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x61, 0x0a, 0x17, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, + 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0x59, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x61, + 0x0a, 0x17, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x5b, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, + 0x75, 0x63, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x55, + 0x0a, 0x11, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x3f, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, + 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, + 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0xea, + 0x75, 0x04, 0x08, 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_wkts_proto_rawDescOnce sync.Once + file_wkts_proto_rawDescData = file_wkts_proto_rawDesc +) + +func file_wkts_proto_rawDescGZIP() []byte { + file_wkts_proto_rawDescOnce.Do(func() { + file_wkts_proto_rawDescData = protoimpl.X.CompressGZIP(file_wkts_proto_rawDescData) + }) + return file_wkts_proto_rawDescData +} + +var file_wkts_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_wkts_proto_goTypes = []interface{}{ + (*MessageWithMarshaler)(nil), // 0: thethings.json.test.MessageWithMarshaler + (*MessageWithoutMarshaler)(nil), // 1: thethings.json.test.MessageWithoutMarshaler + (*MessageWithWKTs)(nil), // 2: thethings.json.test.MessageWithWKTs + (*MessageWithOneofWKTs)(nil), // 3: thethings.json.test.MessageWithOneofWKTs + (*MessageWithWKTMaps)(nil), // 4: thethings.json.test.MessageWithWKTMaps + nil, // 5: thethings.json.test.MessageWithWKTMaps.StringDoubleMapEntry + nil, // 6: thethings.json.test.MessageWithWKTMaps.StringFloatMapEntry + nil, // 7: thethings.json.test.MessageWithWKTMaps.StringInt32MapEntry + nil, // 8: thethings.json.test.MessageWithWKTMaps.StringInt64MapEntry + nil, // 9: thethings.json.test.MessageWithWKTMaps.StringUint32MapEntry + nil, // 10: thethings.json.test.MessageWithWKTMaps.StringUint64MapEntry + nil, // 11: thethings.json.test.MessageWithWKTMaps.StringBoolMapEntry + nil, // 12: thethings.json.test.MessageWithWKTMaps.StringStringMapEntry + nil, // 13: thethings.json.test.MessageWithWKTMaps.StringBytesMapEntry + nil, // 14: thethings.json.test.MessageWithWKTMaps.StringEmptyMapEntry + nil, // 15: thethings.json.test.MessageWithWKTMaps.StringTimestampMapEntry + nil, // 16: thethings.json.test.MessageWithWKTMaps.StringDurationMapEntry + nil, // 17: thethings.json.test.MessageWithWKTMaps.StringFieldMaskMapEntry + nil, // 18: thethings.json.test.MessageWithWKTMaps.StringValueMapEntry + nil, // 19: thethings.json.test.MessageWithWKTMaps.StringListValueMapEntry + nil, // 20: thethings.json.test.MessageWithWKTMaps.StringStructMapEntry + nil, // 21: thethings.json.test.MessageWithWKTMaps.StringAnyMapEntry + (*wrapperspb.DoubleValue)(nil), // 22: google.protobuf.DoubleValue + (*wrapperspb.FloatValue)(nil), // 23: google.protobuf.FloatValue + (*wrapperspb.Int32Value)(nil), // 24: google.protobuf.Int32Value + (*wrapperspb.Int64Value)(nil), // 25: google.protobuf.Int64Value + (*wrapperspb.UInt32Value)(nil), // 26: google.protobuf.UInt32Value + (*wrapperspb.UInt64Value)(nil), // 27: google.protobuf.UInt64Value + (*wrapperspb.BoolValue)(nil), // 28: google.protobuf.BoolValue + (*wrapperspb.StringValue)(nil), // 29: google.protobuf.StringValue + (*wrapperspb.BytesValue)(nil), // 30: google.protobuf.BytesValue + (*emptypb.Empty)(nil), // 31: google.protobuf.Empty + (*timestamppb.Timestamp)(nil), // 32: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 33: google.protobuf.Duration + (*fieldmaskpb.FieldMask)(nil), // 34: google.protobuf.FieldMask + (*structpb.Value)(nil), // 35: google.protobuf.Value + (*structpb.ListValue)(nil), // 36: google.protobuf.ListValue + (*structpb.Struct)(nil), // 37: google.protobuf.Struct + (*anypb.Any)(nil), // 38: google.protobuf.Any +} +var file_wkts_proto_depIdxs = []int32{ + 22, // 0: thethings.json.test.MessageWithWKTs.double_value:type_name -> google.protobuf.DoubleValue + 22, // 1: thethings.json.test.MessageWithWKTs.double_values:type_name -> google.protobuf.DoubleValue + 23, // 2: thethings.json.test.MessageWithWKTs.float_value:type_name -> google.protobuf.FloatValue + 23, // 3: thethings.json.test.MessageWithWKTs.float_values:type_name -> google.protobuf.FloatValue + 24, // 4: thethings.json.test.MessageWithWKTs.int32_value:type_name -> google.protobuf.Int32Value + 24, // 5: thethings.json.test.MessageWithWKTs.int32_values:type_name -> google.protobuf.Int32Value + 25, // 6: thethings.json.test.MessageWithWKTs.int64_value:type_name -> google.protobuf.Int64Value + 25, // 7: thethings.json.test.MessageWithWKTs.int64_values:type_name -> google.protobuf.Int64Value + 26, // 8: thethings.json.test.MessageWithWKTs.uint32_value:type_name -> google.protobuf.UInt32Value + 26, // 9: thethings.json.test.MessageWithWKTs.uint32_values:type_name -> google.protobuf.UInt32Value + 27, // 10: thethings.json.test.MessageWithWKTs.uint64_value:type_name -> google.protobuf.UInt64Value + 27, // 11: thethings.json.test.MessageWithWKTs.uint64_values:type_name -> google.protobuf.UInt64Value + 28, // 12: thethings.json.test.MessageWithWKTs.bool_value:type_name -> google.protobuf.BoolValue + 28, // 13: thethings.json.test.MessageWithWKTs.bool_values:type_name -> google.protobuf.BoolValue + 29, // 14: thethings.json.test.MessageWithWKTs.string_value:type_name -> google.protobuf.StringValue + 29, // 15: thethings.json.test.MessageWithWKTs.string_values:type_name -> google.protobuf.StringValue + 30, // 16: thethings.json.test.MessageWithWKTs.bytes_value:type_name -> google.protobuf.BytesValue + 30, // 17: thethings.json.test.MessageWithWKTs.bytes_values:type_name -> google.protobuf.BytesValue + 31, // 18: thethings.json.test.MessageWithWKTs.empty_value:type_name -> google.protobuf.Empty + 31, // 19: thethings.json.test.MessageWithWKTs.empty_values:type_name -> google.protobuf.Empty + 32, // 20: thethings.json.test.MessageWithWKTs.timestamp_value:type_name -> google.protobuf.Timestamp + 32, // 21: thethings.json.test.MessageWithWKTs.timestamp_values:type_name -> google.protobuf.Timestamp + 33, // 22: thethings.json.test.MessageWithWKTs.duration_value:type_name -> google.protobuf.Duration + 33, // 23: thethings.json.test.MessageWithWKTs.duration_values:type_name -> google.protobuf.Duration + 34, // 24: thethings.json.test.MessageWithWKTs.field_mask_value:type_name -> google.protobuf.FieldMask + 34, // 25: thethings.json.test.MessageWithWKTs.field_mask_values:type_name -> google.protobuf.FieldMask + 35, // 26: thethings.json.test.MessageWithWKTs.value_value:type_name -> google.protobuf.Value + 35, // 27: thethings.json.test.MessageWithWKTs.value_values:type_name -> google.protobuf.Value + 36, // 28: thethings.json.test.MessageWithWKTs.list_value_value:type_name -> google.protobuf.ListValue + 36, // 29: thethings.json.test.MessageWithWKTs.list_value_values:type_name -> google.protobuf.ListValue + 37, // 30: thethings.json.test.MessageWithWKTs.struct_value:type_name -> google.protobuf.Struct + 37, // 31: thethings.json.test.MessageWithWKTs.struct_values:type_name -> google.protobuf.Struct + 38, // 32: thethings.json.test.MessageWithWKTs.any_value:type_name -> google.protobuf.Any + 38, // 33: thethings.json.test.MessageWithWKTs.any_values:type_name -> google.protobuf.Any + 22, // 34: thethings.json.test.MessageWithOneofWKTs.double_value:type_name -> google.protobuf.DoubleValue + 23, // 35: thethings.json.test.MessageWithOneofWKTs.float_value:type_name -> google.protobuf.FloatValue + 24, // 36: thethings.json.test.MessageWithOneofWKTs.int32_value:type_name -> google.protobuf.Int32Value + 25, // 37: thethings.json.test.MessageWithOneofWKTs.int64_value:type_name -> google.protobuf.Int64Value + 26, // 38: thethings.json.test.MessageWithOneofWKTs.uint32_value:type_name -> google.protobuf.UInt32Value + 27, // 39: thethings.json.test.MessageWithOneofWKTs.uint64_value:type_name -> google.protobuf.UInt64Value + 28, // 40: thethings.json.test.MessageWithOneofWKTs.bool_value:type_name -> google.protobuf.BoolValue + 29, // 41: thethings.json.test.MessageWithOneofWKTs.string_value:type_name -> google.protobuf.StringValue + 30, // 42: thethings.json.test.MessageWithOneofWKTs.bytes_value:type_name -> google.protobuf.BytesValue + 31, // 43: thethings.json.test.MessageWithOneofWKTs.empty_value:type_name -> google.protobuf.Empty + 32, // 44: thethings.json.test.MessageWithOneofWKTs.timestamp_value:type_name -> google.protobuf.Timestamp + 33, // 45: thethings.json.test.MessageWithOneofWKTs.duration_value:type_name -> google.protobuf.Duration + 34, // 46: thethings.json.test.MessageWithOneofWKTs.field_mask_value:type_name -> google.protobuf.FieldMask + 35, // 47: thethings.json.test.MessageWithOneofWKTs.value_value:type_name -> google.protobuf.Value + 36, // 48: thethings.json.test.MessageWithOneofWKTs.list_value_value:type_name -> google.protobuf.ListValue + 37, // 49: thethings.json.test.MessageWithOneofWKTs.struct_value:type_name -> google.protobuf.Struct + 38, // 50: thethings.json.test.MessageWithOneofWKTs.any_value:type_name -> google.protobuf.Any + 5, // 51: thethings.json.test.MessageWithWKTMaps.string_double_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringDoubleMapEntry + 6, // 52: thethings.json.test.MessageWithWKTMaps.string_float_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringFloatMapEntry + 7, // 53: thethings.json.test.MessageWithWKTMaps.string_int32_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringInt32MapEntry + 8, // 54: thethings.json.test.MessageWithWKTMaps.string_int64_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringInt64MapEntry + 9, // 55: thethings.json.test.MessageWithWKTMaps.string_uint32_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringUint32MapEntry + 10, // 56: thethings.json.test.MessageWithWKTMaps.string_uint64_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringUint64MapEntry + 11, // 57: thethings.json.test.MessageWithWKTMaps.string_bool_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringBoolMapEntry + 12, // 58: thethings.json.test.MessageWithWKTMaps.string_string_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringStringMapEntry + 13, // 59: thethings.json.test.MessageWithWKTMaps.string_bytes_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringBytesMapEntry + 14, // 60: thethings.json.test.MessageWithWKTMaps.string_empty_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringEmptyMapEntry + 15, // 61: thethings.json.test.MessageWithWKTMaps.string_timestamp_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringTimestampMapEntry + 16, // 62: thethings.json.test.MessageWithWKTMaps.string_duration_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringDurationMapEntry + 17, // 63: thethings.json.test.MessageWithWKTMaps.string_field_mask_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringFieldMaskMapEntry + 18, // 64: thethings.json.test.MessageWithWKTMaps.string_value_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringValueMapEntry + 19, // 65: thethings.json.test.MessageWithWKTMaps.string_list_value_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringListValueMapEntry + 20, // 66: thethings.json.test.MessageWithWKTMaps.string_struct_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringStructMapEntry + 21, // 67: thethings.json.test.MessageWithWKTMaps.string_any_map:type_name -> thethings.json.test.MessageWithWKTMaps.StringAnyMapEntry + 22, // 68: thethings.json.test.MessageWithWKTMaps.StringDoubleMapEntry.value:type_name -> google.protobuf.DoubleValue + 23, // 69: thethings.json.test.MessageWithWKTMaps.StringFloatMapEntry.value:type_name -> google.protobuf.FloatValue + 24, // 70: thethings.json.test.MessageWithWKTMaps.StringInt32MapEntry.value:type_name -> google.protobuf.Int32Value + 25, // 71: thethings.json.test.MessageWithWKTMaps.StringInt64MapEntry.value:type_name -> google.protobuf.Int64Value + 26, // 72: thethings.json.test.MessageWithWKTMaps.StringUint32MapEntry.value:type_name -> google.protobuf.UInt32Value + 27, // 73: thethings.json.test.MessageWithWKTMaps.StringUint64MapEntry.value:type_name -> google.protobuf.UInt64Value + 28, // 74: thethings.json.test.MessageWithWKTMaps.StringBoolMapEntry.value:type_name -> google.protobuf.BoolValue + 29, // 75: thethings.json.test.MessageWithWKTMaps.StringStringMapEntry.value:type_name -> google.protobuf.StringValue + 30, // 76: thethings.json.test.MessageWithWKTMaps.StringBytesMapEntry.value:type_name -> google.protobuf.BytesValue + 31, // 77: thethings.json.test.MessageWithWKTMaps.StringEmptyMapEntry.value:type_name -> google.protobuf.Empty + 32, // 78: thethings.json.test.MessageWithWKTMaps.StringTimestampMapEntry.value:type_name -> google.protobuf.Timestamp + 33, // 79: thethings.json.test.MessageWithWKTMaps.StringDurationMapEntry.value:type_name -> google.protobuf.Duration + 34, // 80: thethings.json.test.MessageWithWKTMaps.StringFieldMaskMapEntry.value:type_name -> google.protobuf.FieldMask + 35, // 81: thethings.json.test.MessageWithWKTMaps.StringValueMapEntry.value:type_name -> google.protobuf.Value + 36, // 82: thethings.json.test.MessageWithWKTMaps.StringListValueMapEntry.value:type_name -> google.protobuf.ListValue + 37, // 83: thethings.json.test.MessageWithWKTMaps.StringStructMapEntry.value:type_name -> google.protobuf.Struct + 38, // 84: thethings.json.test.MessageWithWKTMaps.StringAnyMapEntry.value:type_name -> google.protobuf.Any + 85, // [85:85] is the sub-list for method output_type + 85, // [85:85] is the sub-list for method input_type + 85, // [85:85] is the sub-list for extension type_name + 85, // [85:85] is the sub-list for extension extendee + 0, // [0:85] is the sub-list for field type_name +} + +func init() { file_wkts_proto_init() } +func file_wkts_proto_init() { + if File_wkts_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_wkts_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithMarshaler); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wkts_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithoutMarshaler); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wkts_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithWKTs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wkts_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithOneofWKTs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wkts_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithWKTMaps); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_wkts_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*MessageWithOneofWKTs_DoubleValue)(nil), + (*MessageWithOneofWKTs_FloatValue)(nil), + (*MessageWithOneofWKTs_Int32Value)(nil), + (*MessageWithOneofWKTs_Int64Value)(nil), + (*MessageWithOneofWKTs_Uint32Value)(nil), + (*MessageWithOneofWKTs_Uint64Value)(nil), + (*MessageWithOneofWKTs_BoolValue)(nil), + (*MessageWithOneofWKTs_StringValue)(nil), + (*MessageWithOneofWKTs_BytesValue)(nil), + (*MessageWithOneofWKTs_EmptyValue)(nil), + (*MessageWithOneofWKTs_TimestampValue)(nil), + (*MessageWithOneofWKTs_DurationValue)(nil), + (*MessageWithOneofWKTs_FieldMaskValue)(nil), + (*MessageWithOneofWKTs_ValueValue)(nil), + (*MessageWithOneofWKTs_ListValueValue)(nil), + (*MessageWithOneofWKTs_StructValue)(nil), + (*MessageWithOneofWKTs_AnyValue)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_wkts_proto_rawDesc, + NumEnums: 0, + NumMessages: 22, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_wkts_proto_goTypes, + DependencyIndexes: file_wkts_proto_depIdxs, + MessageInfos: file_wkts_proto_msgTypes, + }.Build() + File_wkts_proto = out.File + file_wkts_proto_rawDesc = nil + file_wkts_proto_goTypes = nil + file_wkts_proto_depIdxs = nil +} diff --git a/test/golang/wkts_json.pb.go b/test/golang/wkts_json.pb.go new file mode 100644 index 00000000..f80d7d18 --- /dev/null +++ b/test/golang/wkts_json.pb.go @@ -0,0 +1,1646 @@ +// Code generated by protoc-gen-go-json. DO NOT EDIT. +// versions: +// - protoc-gen-go-json v0.0.0-dev +// - protoc v3.17.3 +// source: wkts.proto + +package test + +import ( + golang "github.com/TheThingsIndustries/protoc-gen-go-json/golang" + jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" + anypb "google.golang.org/protobuf/types/known/anypb" + durationpb "google.golang.org/protobuf/types/known/durationpb" + emptypb "google.golang.org/protobuf/types/known/emptypb" + fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + structpb "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" +) + +// MarshalProtoJSON marshals the MessageWithMarshaler message to JSON. +func (x *MessageWithMarshaler) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Message != "" || s.HasField("message") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("message") + s.WriteString(x.Message) + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithMarshaler message from JSON. +func (x *MessageWithMarshaler) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "message": + s.AddField("message") + x.Message = s.ReadString() + } + }) +} + +// MarshalProtoJSON marshals the MessageWithWKTs message to JSON. +func (x *MessageWithWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.DoubleValue != nil || s.HasField("double_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("double_value") + if x.DoubleValue == nil { + s.WriteNil() + } else { + s.WriteFloat64(x.DoubleValue.Value) + } + } + if len(x.DoubleValues) > 0 || s.HasField("double_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("double_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.DoubleValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteFloat64(element.Value) + } + } + s.WriteArrayEnd() + } + if x.FloatValue != nil || s.HasField("float_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("float_value") + if x.FloatValue == nil { + s.WriteNil() + } else { + s.WriteFloat32(x.FloatValue.Value) + } + } + if len(x.FloatValues) > 0 || s.HasField("float_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("float_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.FloatValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteFloat32(element.Value) + } + } + s.WriteArrayEnd() + } + if x.Int32Value != nil || s.HasField("int32_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int32_value") + if x.Int32Value == nil { + s.WriteNil() + } else { + s.WriteInt32(x.Int32Value.Value) + } + } + if len(x.Int32Values) > 0 || s.HasField("int32_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int32_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Int32Values { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteInt32(element.Value) + } + } + s.WriteArrayEnd() + } + if x.Int64Value != nil || s.HasField("int64_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int64_value") + if x.Int64Value == nil { + s.WriteNil() + } else { + s.WriteInt64(x.Int64Value.Value) + } + } + if len(x.Int64Values) > 0 || s.HasField("int64_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int64_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Int64Values { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteInt64(element.Value) + } + } + s.WriteArrayEnd() + } + if x.Uint32Value != nil || s.HasField("uint32_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint32_value") + if x.Uint32Value == nil { + s.WriteNil() + } else { + s.WriteUint32(x.Uint32Value.Value) + } + } + if len(x.Uint32Values) > 0 || s.HasField("uint32_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint32_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Uint32Values { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteUint32(element.Value) + } + } + s.WriteArrayEnd() + } + if x.Uint64Value != nil || s.HasField("uint64_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint64_value") + if x.Uint64Value == nil { + s.WriteNil() + } else { + s.WriteUint64(x.Uint64Value.Value) + } + } + if len(x.Uint64Values) > 0 || s.HasField("uint64_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint64_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Uint64Values { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteUint64(element.Value) + } + } + s.WriteArrayEnd() + } + if x.BoolValue != nil || s.HasField("bool_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bool_value") + if x.BoolValue == nil { + s.WriteNil() + } else { + s.WriteBool(x.BoolValue.Value) + } + } + if len(x.BoolValues) > 0 || s.HasField("bool_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bool_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.BoolValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteBool(element.Value) + } + } + s.WriteArrayEnd() + } + if x.StringValue != nil || s.HasField("string_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_value") + if x.StringValue == nil { + s.WriteNil() + } else { + s.WriteString(x.StringValue.Value) + } + } + if len(x.StringValues) > 0 || s.HasField("string_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.StringValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteString(element.Value) + } + } + s.WriteArrayEnd() + } + if x.BytesValue != nil || s.HasField("bytes_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bytes_value") + if x.BytesValue == nil { + s.WriteNil() + } else { + s.WriteBytes(x.BytesValue.Value) + } + } + if len(x.BytesValues) > 0 || s.HasField("bytes_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bytes_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.BytesValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + s.WriteBytes(element.Value) + } + } + s.WriteArrayEnd() + } + if x.EmptyValue != nil || s.HasField("empty_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("empty_value") + if x.EmptyValue == nil { + s.WriteNil() + } else { + golang.MarshalEmpty(s, x.EmptyValue) + } + } + if len(x.EmptyValues) > 0 || s.HasField("empty_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("empty_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.EmptyValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + golang.MarshalEmpty(s, element) + } + } + s.WriteArrayEnd() + } + if x.TimestampValue != nil || s.HasField("timestamp_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("timestamp_value") + if x.TimestampValue == nil { + s.WriteNil() + } else { + golang.MarshalTimestamp(s, x.TimestampValue) + } + } + if len(x.TimestampValues) > 0 || s.HasField("timestamp_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("timestamp_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.TimestampValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + golang.MarshalTimestamp(s, element) + } + } + s.WriteArrayEnd() + } + if x.DurationValue != nil || s.HasField("duration_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("duration_value") + if x.DurationValue == nil { + s.WriteNil() + } else { + golang.MarshalDuration(s, x.DurationValue) + } + } + if len(x.DurationValues) > 0 || s.HasField("duration_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("duration_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.DurationValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + golang.MarshalDuration(s, element) + } + } + s.WriteArrayEnd() + } + if x.FieldMaskValue != nil || s.HasField("field_mask_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("field_mask_value") + if x.FieldMaskValue == nil { + s.WriteNil() + } else { + golang.MarshalFieldMask(s, x.FieldMaskValue) + } + } + if len(x.FieldMaskValues) > 0 || s.HasField("field_mask_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("field_mask_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.FieldMaskValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + golang.MarshalFieldMask(s, element) + } + } + s.WriteArrayEnd() + } + if x.ValueValue != nil || s.HasField("value_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("value_value") + if x.ValueValue == nil { + s.WriteNil() + } else { + golang.MarshalValue(s, x.ValueValue) + } + } + if len(x.ValueValues) > 0 || s.HasField("value_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("value_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.ValueValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + golang.MarshalValue(s, element) + } + } + s.WriteArrayEnd() + } + if x.ListValueValue != nil || s.HasField("list_value_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("list_value_value") + if x.ListValueValue == nil { + s.WriteNil() + } else { + golang.MarshalListValue(s, x.ListValueValue) + } + } + if len(x.ListValueValues) > 0 || s.HasField("list_value_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("list_value_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.ListValueValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + golang.MarshalListValue(s, element) + } + } + s.WriteArrayEnd() + } + if x.StructValue != nil || s.HasField("struct_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("struct_value") + if x.StructValue == nil { + s.WriteNil() + } else { + golang.MarshalStruct(s, x.StructValue) + } + } + if len(x.StructValues) > 0 || s.HasField("struct_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("struct_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.StructValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + golang.MarshalStruct(s, element) + } + } + s.WriteArrayEnd() + } + if x.AnyValue != nil || s.HasField("any_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("any_value") + if x.AnyValue == nil { + s.WriteNil() + } else { + golang.MarshalAny(s, x.AnyValue) + } + } + if len(x.AnyValues) > 0 || s.HasField("any_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("any_values") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.AnyValues { + s.WriteMoreIf(&wroteElement) + if element == nil { + s.WriteNil() + } else { + golang.MarshalAny(s, element) + } + } + s.WriteArrayEnd() + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithWKTs message from JSON. +func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "double_value", "doubleValue": + s.AddField("double_value") + if !s.ReadNil() { + v := s.ReadFloat64() + if s.Err() != nil { + return + } + x.DoubleValue = &wrapperspb.DoubleValue{Value: v} + } + case "double_values", "doubleValues": + s.AddField("double_values") + s.ReadArray(func() { + if s.ReadNil() { + x.DoubleValues = append(x.DoubleValues, nil) + return + } + v := s.ReadFloat64() + if s.Err() != nil { + return + } + x.DoubleValues = append(x.DoubleValues, &wrapperspb.DoubleValue{Value: v}) + }) + case "float_value", "floatValue": + s.AddField("float_value") + if !s.ReadNil() { + v := s.ReadFloat32() + if s.Err() != nil { + return + } + x.FloatValue = &wrapperspb.FloatValue{Value: v} + } + case "float_values", "floatValues": + s.AddField("float_values") + s.ReadArray(func() { + if s.ReadNil() { + x.FloatValues = append(x.FloatValues, nil) + return + } + v := s.ReadFloat32() + if s.Err() != nil { + return + } + x.FloatValues = append(x.FloatValues, &wrapperspb.FloatValue{Value: v}) + }) + case "int32_value", "int32Value": + s.AddField("int32_value") + if !s.ReadNil() { + v := s.ReadInt32() + if s.Err() != nil { + return + } + x.Int32Value = &wrapperspb.Int32Value{Value: v} + } + case "int32_values", "int32Values": + s.AddField("int32_values") + s.ReadArray(func() { + if s.ReadNil() { + x.Int32Values = append(x.Int32Values, nil) + return + } + v := s.ReadInt32() + if s.Err() != nil { + return + } + x.Int32Values = append(x.Int32Values, &wrapperspb.Int32Value{Value: v}) + }) + case "int64_value", "int64Value": + s.AddField("int64_value") + if !s.ReadNil() { + v := s.ReadInt64() + if s.Err() != nil { + return + } + x.Int64Value = &wrapperspb.Int64Value{Value: v} + } + case "int64_values", "int64Values": + s.AddField("int64_values") + s.ReadArray(func() { + if s.ReadNil() { + x.Int64Values = append(x.Int64Values, nil) + return + } + v := s.ReadInt64() + if s.Err() != nil { + return + } + x.Int64Values = append(x.Int64Values, &wrapperspb.Int64Value{Value: v}) + }) + case "uint32_value", "uint32Value": + s.AddField("uint32_value") + if !s.ReadNil() { + v := s.ReadUint32() + if s.Err() != nil { + return + } + x.Uint32Value = &wrapperspb.UInt32Value{Value: v} + } + case "uint32_values", "uint32Values": + s.AddField("uint32_values") + s.ReadArray(func() { + if s.ReadNil() { + x.Uint32Values = append(x.Uint32Values, nil) + return + } + v := s.ReadUint32() + if s.Err() != nil { + return + } + x.Uint32Values = append(x.Uint32Values, &wrapperspb.UInt32Value{Value: v}) + }) + case "uint64_value", "uint64Value": + s.AddField("uint64_value") + if !s.ReadNil() { + v := s.ReadUint64() + if s.Err() != nil { + return + } + x.Uint64Value = &wrapperspb.UInt64Value{Value: v} + } + case "uint64_values", "uint64Values": + s.AddField("uint64_values") + s.ReadArray(func() { + if s.ReadNil() { + x.Uint64Values = append(x.Uint64Values, nil) + return + } + v := s.ReadUint64() + if s.Err() != nil { + return + } + x.Uint64Values = append(x.Uint64Values, &wrapperspb.UInt64Value{Value: v}) + }) + case "bool_value", "boolValue": + s.AddField("bool_value") + if !s.ReadNil() { + v := s.ReadBool() + if s.Err() != nil { + return + } + x.BoolValue = &wrapperspb.BoolValue{Value: v} + } + case "bool_values", "boolValues": + s.AddField("bool_values") + s.ReadArray(func() { + if s.ReadNil() { + x.BoolValues = append(x.BoolValues, nil) + return + } + v := s.ReadBool() + if s.Err() != nil { + return + } + x.BoolValues = append(x.BoolValues, &wrapperspb.BoolValue{Value: v}) + }) + case "string_value", "stringValue": + s.AddField("string_value") + if !s.ReadNil() { + v := s.ReadString() + if s.Err() != nil { + return + } + x.StringValue = &wrapperspb.StringValue{Value: v} + } + case "string_values", "stringValues": + s.AddField("string_values") + s.ReadArray(func() { + if s.ReadNil() { + x.StringValues = append(x.StringValues, nil) + return + } + v := s.ReadString() + if s.Err() != nil { + return + } + x.StringValues = append(x.StringValues, &wrapperspb.StringValue{Value: v}) + }) + case "bytes_value", "bytesValue": + s.AddField("bytes_value") + if !s.ReadNil() { + v := s.ReadBytes() + if s.Err() != nil { + return + } + x.BytesValue = &wrapperspb.BytesValue{Value: v} + } + case "bytes_values", "bytesValues": + s.AddField("bytes_values") + s.ReadArray(func() { + if s.ReadNil() { + x.BytesValues = append(x.BytesValues, nil) + return + } + v := s.ReadBytes() + if s.Err() != nil { + return + } + x.BytesValues = append(x.BytesValues, &wrapperspb.BytesValue{Value: v}) + }) + case "empty_value", "emptyValue": + s.AddField("empty_value") + v := golang.UnmarshalEmpty(s) + if s.Err() != nil { + return + } + x.EmptyValue = v + case "empty_values", "emptyValues": + s.AddField("empty_values") + s.ReadArray(func() { + v := golang.UnmarshalEmpty(s) + if s.Err() != nil { + return + } + x.EmptyValues = append(x.EmptyValues, v) + }) + case "timestamp_value", "timestampValue": + s.AddField("timestamp_value") + v := golang.UnmarshalTimestamp(s) + if s.Err() != nil { + return + } + x.TimestampValue = v + case "timestamp_values", "timestampValues": + s.AddField("timestamp_values") + s.ReadArray(func() { + v := golang.UnmarshalTimestamp(s) + if s.Err() != nil { + return + } + x.TimestampValues = append(x.TimestampValues, v) + }) + case "duration_value", "durationValue": + s.AddField("duration_value") + v := golang.UnmarshalDuration(s) + if s.Err() != nil { + return + } + x.DurationValue = v + case "duration_values", "durationValues": + s.AddField("duration_values") + s.ReadArray(func() { + v := golang.UnmarshalDuration(s) + if s.Err() != nil { + return + } + x.DurationValues = append(x.DurationValues, v) + }) + case "field_mask_value", "fieldMaskValue": + s.AddField("field_mask_value") + v := golang.UnmarshalFieldMask(s) + if s.Err() != nil { + return + } + x.FieldMaskValue = v + case "field_mask_values", "fieldMaskValues": + s.AddField("field_mask_values") + s.ReadArray(func() { + v := golang.UnmarshalFieldMask(s) + if s.Err() != nil { + return + } + x.FieldMaskValues = append(x.FieldMaskValues, v) + }) + case "value_value", "valueValue": + s.AddField("value_value") + v := golang.UnmarshalValue(s) + if s.Err() != nil { + return + } + x.ValueValue = v + case "value_values", "valueValues": + s.AddField("value_values") + s.ReadArray(func() { + v := golang.UnmarshalValue(s) + if s.Err() != nil { + return + } + x.ValueValues = append(x.ValueValues, v) + }) + case "list_value_value", "listValueValue": + s.AddField("list_value_value") + v := golang.UnmarshalListValue(s) + if s.Err() != nil { + return + } + x.ListValueValue = v + case "list_value_values", "listValueValues": + s.AddField("list_value_values") + s.ReadArray(func() { + v := golang.UnmarshalListValue(s) + if s.Err() != nil { + return + } + x.ListValueValues = append(x.ListValueValues, v) + }) + case "struct_value", "structValue": + s.AddField("struct_value") + v := golang.UnmarshalStruct(s) + if s.Err() != nil { + return + } + x.StructValue = v + case "struct_values", "structValues": + s.AddField("struct_values") + s.ReadArray(func() { + v := golang.UnmarshalStruct(s) + if s.Err() != nil { + return + } + x.StructValues = append(x.StructValues, v) + }) + case "any_value", "anyValue": + s.AddField("any_value") + v := golang.UnmarshalAny(s) + if s.Err() != nil { + return + } + x.AnyValue = v + case "any_values", "anyValues": + s.AddField("any_values") + s.ReadArray(func() { + v := golang.UnmarshalAny(s) + if s.Err() != nil { + return + } + x.AnyValues = append(x.AnyValues, v) + }) + } + }) +} + +// MarshalProtoJSON marshals the MessageWithOneofWKTs message to JSON. +func (x *MessageWithOneofWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Value != nil { + switch ov := x.Value.(type) { + case *MessageWithOneofWKTs_DoubleValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("double_value") + if ov.DoubleValue == nil { + s.WriteNil() + } else { + s.WriteFloat64(ov.DoubleValue.Value) + } + case *MessageWithOneofWKTs_FloatValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("float_value") + if ov.FloatValue == nil { + s.WriteNil() + } else { + s.WriteFloat32(ov.FloatValue.Value) + } + case *MessageWithOneofWKTs_Int32Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int32_value") + if ov.Int32Value == nil { + s.WriteNil() + } else { + s.WriteInt32(ov.Int32Value.Value) + } + case *MessageWithOneofWKTs_Int64Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("int64_value") + if ov.Int64Value == nil { + s.WriteNil() + } else { + s.WriteInt64(ov.Int64Value.Value) + } + case *MessageWithOneofWKTs_Uint32Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint32_value") + if ov.Uint32Value == nil { + s.WriteNil() + } else { + s.WriteUint32(ov.Uint32Value.Value) + } + case *MessageWithOneofWKTs_Uint64Value: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("uint64_value") + if ov.Uint64Value == nil { + s.WriteNil() + } else { + s.WriteUint64(ov.Uint64Value.Value) + } + case *MessageWithOneofWKTs_BoolValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bool_value") + if ov.BoolValue == nil { + s.WriteNil() + } else { + s.WriteBool(ov.BoolValue.Value) + } + case *MessageWithOneofWKTs_StringValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_value") + if ov.StringValue == nil { + s.WriteNil() + } else { + s.WriteString(ov.StringValue.Value) + } + case *MessageWithOneofWKTs_BytesValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("bytes_value") + if ov.BytesValue == nil { + s.WriteNil() + } else { + s.WriteBytes(ov.BytesValue.Value) + } + case *MessageWithOneofWKTs_EmptyValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("empty_value") + if ov.EmptyValue == nil { + s.WriteNil() + } else { + golang.MarshalEmpty(s, ov.EmptyValue) + } + case *MessageWithOneofWKTs_TimestampValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("timestamp_value") + if ov.TimestampValue == nil { + s.WriteNil() + } else { + golang.MarshalTimestamp(s, ov.TimestampValue) + } + case *MessageWithOneofWKTs_DurationValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("duration_value") + if ov.DurationValue == nil { + s.WriteNil() + } else { + golang.MarshalDuration(s, ov.DurationValue) + } + case *MessageWithOneofWKTs_FieldMaskValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("field_mask_value") + if ov.FieldMaskValue == nil { + s.WriteNil() + } else { + golang.MarshalFieldMask(s, ov.FieldMaskValue) + } + case *MessageWithOneofWKTs_ValueValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("value_value") + if ov.ValueValue == nil { + s.WriteNil() + } else { + golang.MarshalValue(s, ov.ValueValue) + } + case *MessageWithOneofWKTs_ListValueValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("list_value_value") + if ov.ListValueValue == nil { + s.WriteNil() + } else { + golang.MarshalListValue(s, ov.ListValueValue) + } + case *MessageWithOneofWKTs_StructValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("struct_value") + if ov.StructValue == nil { + s.WriteNil() + } else { + golang.MarshalStruct(s, ov.StructValue) + } + case *MessageWithOneofWKTs_AnyValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("any_value") + if ov.AnyValue == nil { + s.WriteNil() + } else { + golang.MarshalAny(s, ov.AnyValue) + } + } + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithOneofWKTs message from JSON. +func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "double_value", "doubleValue": + s.AddField("double_value") + ov := &MessageWithOneofWKTs_DoubleValue{} + if !s.ReadNil() { + v := s.ReadFloat64() + if s.Err() != nil { + return + } + ov.DoubleValue = &wrapperspb.DoubleValue{Value: v} + } + x.Value = ov + case "float_value", "floatValue": + s.AddField("float_value") + ov := &MessageWithOneofWKTs_FloatValue{} + if !s.ReadNil() { + v := s.ReadFloat32() + if s.Err() != nil { + return + } + ov.FloatValue = &wrapperspb.FloatValue{Value: v} + } + x.Value = ov + case "int32_value", "int32Value": + s.AddField("int32_value") + ov := &MessageWithOneofWKTs_Int32Value{} + if !s.ReadNil() { + v := s.ReadInt32() + if s.Err() != nil { + return + } + ov.Int32Value = &wrapperspb.Int32Value{Value: v} + } + x.Value = ov + case "int64_value", "int64Value": + s.AddField("int64_value") + ov := &MessageWithOneofWKTs_Int64Value{} + if !s.ReadNil() { + v := s.ReadInt64() + if s.Err() != nil { + return + } + ov.Int64Value = &wrapperspb.Int64Value{Value: v} + } + x.Value = ov + case "uint32_value", "uint32Value": + s.AddField("uint32_value") + ov := &MessageWithOneofWKTs_Uint32Value{} + if !s.ReadNil() { + v := s.ReadUint32() + if s.Err() != nil { + return + } + ov.Uint32Value = &wrapperspb.UInt32Value{Value: v} + } + x.Value = ov + case "uint64_value", "uint64Value": + s.AddField("uint64_value") + ov := &MessageWithOneofWKTs_Uint64Value{} + if !s.ReadNil() { + v := s.ReadUint64() + if s.Err() != nil { + return + } + ov.Uint64Value = &wrapperspb.UInt64Value{Value: v} + } + x.Value = ov + case "bool_value", "boolValue": + s.AddField("bool_value") + ov := &MessageWithOneofWKTs_BoolValue{} + if !s.ReadNil() { + v := s.ReadBool() + if s.Err() != nil { + return + } + ov.BoolValue = &wrapperspb.BoolValue{Value: v} + } + x.Value = ov + case "string_value", "stringValue": + s.AddField("string_value") + ov := &MessageWithOneofWKTs_StringValue{} + if !s.ReadNil() { + v := s.ReadString() + if s.Err() != nil { + return + } + ov.StringValue = &wrapperspb.StringValue{Value: v} + } + x.Value = ov + case "bytes_value", "bytesValue": + s.AddField("bytes_value") + ov := &MessageWithOneofWKTs_BytesValue{} + if !s.ReadNil() { + v := s.ReadBytes() + if s.Err() != nil { + return + } + ov.BytesValue = &wrapperspb.BytesValue{Value: v} + } + x.Value = ov + case "empty_value", "emptyValue": + s.AddField("empty_value") + ov := &MessageWithOneofWKTs_EmptyValue{} + v := golang.UnmarshalEmpty(s) + if s.Err() != nil { + return + } + ov.EmptyValue = v + x.Value = ov + case "timestamp_value", "timestampValue": + s.AddField("timestamp_value") + ov := &MessageWithOneofWKTs_TimestampValue{} + v := golang.UnmarshalTimestamp(s) + if s.Err() != nil { + return + } + ov.TimestampValue = v + x.Value = ov + case "duration_value", "durationValue": + s.AddField("duration_value") + ov := &MessageWithOneofWKTs_DurationValue{} + v := golang.UnmarshalDuration(s) + if s.Err() != nil { + return + } + ov.DurationValue = v + x.Value = ov + case "field_mask_value", "fieldMaskValue": + s.AddField("field_mask_value") + ov := &MessageWithOneofWKTs_FieldMaskValue{} + v := golang.UnmarshalFieldMask(s) + if s.Err() != nil { + return + } + ov.FieldMaskValue = v + x.Value = ov + case "value_value", "valueValue": + s.AddField("value_value") + ov := &MessageWithOneofWKTs_ValueValue{} + v := golang.UnmarshalValue(s) + if s.Err() != nil { + return + } + ov.ValueValue = v + x.Value = ov + case "list_value_value", "listValueValue": + s.AddField("list_value_value") + ov := &MessageWithOneofWKTs_ListValueValue{} + v := golang.UnmarshalListValue(s) + if s.Err() != nil { + return + } + ov.ListValueValue = v + x.Value = ov + case "struct_value", "structValue": + s.AddField("struct_value") + ov := &MessageWithOneofWKTs_StructValue{} + v := golang.UnmarshalStruct(s) + if s.Err() != nil { + return + } + ov.StructValue = v + x.Value = ov + case "any_value", "anyValue": + s.AddField("any_value") + ov := &MessageWithOneofWKTs_AnyValue{} + v := golang.UnmarshalAny(s) + if s.Err() != nil { + return + } + ov.AnyValue = v + x.Value = ov + } + }) +} + +// MarshalProtoJSON marshals the MessageWithWKTMaps message to JSON. +func (x *MessageWithWKTMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.StringDoubleMap != nil || s.HasField("string_double_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_double_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringDoubleMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteFloat64(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringFloatMap != nil || s.HasField("string_float_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_float_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringFloatMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteFloat32(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringInt32Map != nil || s.HasField("string_int32_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_int32_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringInt32Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteInt32(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringInt64Map != nil || s.HasField("string_int64_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_int64_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringInt64Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteInt64(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringUint32Map != nil || s.HasField("string_uint32_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_uint32_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringUint32Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteUint32(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringUint64Map != nil || s.HasField("string_uint64_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_uint64_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringUint64Map { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteUint64(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringBoolMap != nil || s.HasField("string_bool_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_bool_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringBoolMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteBool(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringStringMap != nil || s.HasField("string_string_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_string_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringStringMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteString(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringBytesMap != nil || s.HasField("string_bytes_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_bytes_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringBytesMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + s.WriteBytes(v.Value) + } + } + s.WriteObjectEnd() + } + if x.StringEmptyMap != nil || s.HasField("string_empty_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_empty_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringEmptyMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + golang.MarshalEmpty(s, v) + } + } + s.WriteObjectEnd() + } + if x.StringTimestampMap != nil || s.HasField("string_timestamp_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_timestamp_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringTimestampMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + golang.MarshalTimestamp(s, v) + } + } + s.WriteObjectEnd() + } + if x.StringDurationMap != nil || s.HasField("string_duration_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_duration_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringDurationMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + golang.MarshalDuration(s, v) + } + } + s.WriteObjectEnd() + } + if x.StringFieldMaskMap != nil || s.HasField("string_field_mask_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_field_mask_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringFieldMaskMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + golang.MarshalFieldMask(s, v) + } + } + s.WriteObjectEnd() + } + if x.StringValueMap != nil || s.HasField("string_value_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_value_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringValueMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + golang.MarshalValue(s, v) + } + } + s.WriteObjectEnd() + } + if x.StringListValueMap != nil || s.HasField("string_list_value_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_list_value_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringListValueMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + golang.MarshalListValue(s, v) + } + } + s.WriteObjectEnd() + } + if x.StringStructMap != nil || s.HasField("string_struct_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_struct_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringStructMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + golang.MarshalStruct(s, v) + } + } + s.WriteObjectEnd() + } + if x.StringAnyMap != nil || s.HasField("string_any_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_any_map") + s.WriteObjectStart() + var wroteElement bool + for k, v := range x.StringAnyMap { + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + if v == nil { + s.WriteNil() + } else { + golang.MarshalAny(s, v) + } + } + s.WriteObjectEnd() + } + s.WriteObjectEnd() +} + +// UnmarshalProtoJSON unmarshals the MessageWithWKTMaps message from JSON. +func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "string_double_map", "stringDoubleMap": + s.AddField("string_double_map") + x.StringDoubleMap = make(map[string]*wrapperspb.DoubleValue) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringDoubleMap[key] = nil + } else { + v := s.ReadFloat64() + if s.Err() != nil { + return + } + x.StringDoubleMap[key] = &wrapperspb.DoubleValue{Value: v} + } + }) + case "string_float_map", "stringFloatMap": + s.AddField("string_float_map") + x.StringFloatMap = make(map[string]*wrapperspb.FloatValue) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringFloatMap[key] = nil + } else { + v := s.ReadFloat32() + if s.Err() != nil { + return + } + x.StringFloatMap[key] = &wrapperspb.FloatValue{Value: v} + } + }) + case "string_int32_map", "stringInt32Map": + s.AddField("string_int32_map") + x.StringInt32Map = make(map[string]*wrapperspb.Int32Value) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringInt32Map[key] = nil + } else { + v := s.ReadInt32() + if s.Err() != nil { + return + } + x.StringInt32Map[key] = &wrapperspb.Int32Value{Value: v} + } + }) + case "string_int64_map", "stringInt64Map": + s.AddField("string_int64_map") + x.StringInt64Map = make(map[string]*wrapperspb.Int64Value) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringInt64Map[key] = nil + } else { + v := s.ReadInt64() + if s.Err() != nil { + return + } + x.StringInt64Map[key] = &wrapperspb.Int64Value{Value: v} + } + }) + case "string_uint32_map", "stringUint32Map": + s.AddField("string_uint32_map") + x.StringUint32Map = make(map[string]*wrapperspb.UInt32Value) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringUint32Map[key] = nil + } else { + v := s.ReadUint32() + if s.Err() != nil { + return + } + x.StringUint32Map[key] = &wrapperspb.UInt32Value{Value: v} + } + }) + case "string_uint64_map", "stringUint64Map": + s.AddField("string_uint64_map") + x.StringUint64Map = make(map[string]*wrapperspb.UInt64Value) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringUint64Map[key] = nil + } else { + v := s.ReadUint64() + if s.Err() != nil { + return + } + x.StringUint64Map[key] = &wrapperspb.UInt64Value{Value: v} + } + }) + case "string_bool_map", "stringBoolMap": + s.AddField("string_bool_map") + x.StringBoolMap = make(map[string]*wrapperspb.BoolValue) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringBoolMap[key] = nil + } else { + v := s.ReadBool() + if s.Err() != nil { + return + } + x.StringBoolMap[key] = &wrapperspb.BoolValue{Value: v} + } + }) + case "string_string_map", "stringStringMap": + s.AddField("string_string_map") + x.StringStringMap = make(map[string]*wrapperspb.StringValue) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringStringMap[key] = nil + } else { + v := s.ReadString() + if s.Err() != nil { + return + } + x.StringStringMap[key] = &wrapperspb.StringValue{Value: v} + } + }) + case "string_bytes_map", "stringBytesMap": + s.AddField("string_bytes_map") + x.StringBytesMap = make(map[string]*wrapperspb.BytesValue) + s.ReadStringMap(func(key string) { + if s.ReadNil() { + x.StringBytesMap[key] = nil + } else { + v := s.ReadBytes() + if s.Err() != nil { + return + } + x.StringBytesMap[key] = &wrapperspb.BytesValue{Value: v} + } + }) + case "string_empty_map", "stringEmptyMap": + s.AddField("string_empty_map") + x.StringEmptyMap = make(map[string]*emptypb.Empty) + s.ReadStringMap(func(key string) { + v := golang.UnmarshalEmpty(s) + if s.Err() != nil { + return + } + x.StringEmptyMap[key] = v + }) + case "string_timestamp_map", "stringTimestampMap": + s.AddField("string_timestamp_map") + x.StringTimestampMap = make(map[string]*timestamppb.Timestamp) + s.ReadStringMap(func(key string) { + v := golang.UnmarshalTimestamp(s) + if s.Err() != nil { + return + } + x.StringTimestampMap[key] = v + }) + case "string_duration_map", "stringDurationMap": + s.AddField("string_duration_map") + x.StringDurationMap = make(map[string]*durationpb.Duration) + s.ReadStringMap(func(key string) { + v := golang.UnmarshalDuration(s) + if s.Err() != nil { + return + } + x.StringDurationMap[key] = v + }) + case "string_field_mask_map", "stringFieldMaskMap": + s.AddField("string_field_mask_map") + x.StringFieldMaskMap = make(map[string]*fieldmaskpb.FieldMask) + s.ReadStringMap(func(key string) { + v := golang.UnmarshalFieldMask(s) + if s.Err() != nil { + return + } + x.StringFieldMaskMap[key] = v + }) + case "string_value_map", "stringValueMap": + s.AddField("string_value_map") + x.StringValueMap = make(map[string]*structpb.Value) + s.ReadStringMap(func(key string) { + v := golang.UnmarshalValue(s) + if s.Err() != nil { + return + } + x.StringValueMap[key] = v + }) + case "string_list_value_map", "stringListValueMap": + s.AddField("string_list_value_map") + x.StringListValueMap = make(map[string]*structpb.ListValue) + s.ReadStringMap(func(key string) { + v := golang.UnmarshalListValue(s) + if s.Err() != nil { + return + } + x.StringListValueMap[key] = v + }) + case "string_struct_map", "stringStructMap": + s.AddField("string_struct_map") + x.StringStructMap = make(map[string]*structpb.Struct) + s.ReadStringMap(func(key string) { + v := golang.UnmarshalStruct(s) + if s.Err() != nil { + return + } + x.StringStructMap[key] = v + }) + case "string_any_map", "stringAnyMap": + s.AddField("string_any_map") + x.StringAnyMap = make(map[string]*anypb.Any) + s.ReadStringMap(func(key string) { + v := golang.UnmarshalAny(s) + if s.Err() != nil { + return + } + x.StringAnyMap[key] = v + }) + } + }) +} diff --git a/test/golang/wkts_test.go b/test/golang/wkts_test.go new file mode 100644 index 00000000..b0a8193e --- /dev/null +++ b/test/golang/wkts_test.go @@ -0,0 +1,830 @@ +package test_test + +import ( + "testing" + "time" + + . "github.com/TheThingsIndustries/protoc-gen-go-json/test/golang" + "google.golang.org/protobuf/proto" + anypb "google.golang.org/protobuf/types/known/anypb" + durationpb "google.golang.org/protobuf/types/known/durationpb" + emptypb "google.golang.org/protobuf/types/known/emptypb" + fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + structpb "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" +) + +var ( + testTime = time.Date(2006, time.January, 2, 15, 4, 5, 123456789, time.FixedZone("07:00", 7*3600)) + testDuration = time.Hour + 2*time.Minute + 3*time.Second + 123456789 +) + +func TestTimeDuration(t *testing.T) { + expectedTime := "2006-01-02T15:04:05.123456789+07:00" + if actualTime := testTime.Format(time.RFC3339Nano); actualTime != expectedTime { + t.Fatalf("expected timestamp %s, got %s", expectedTime, actualTime) + } + expectedDuration := "1h2m3.123456789s" + if actualDuration := testDuration.String(); actualDuration != expectedDuration { + t.Fatalf("expected timestamp %s, got %s", expectedDuration, actualDuration) + } +} + +func mustTimestamp(t time.Time) *timestamppb.Timestamp { + return timestamppb.New(t) +} + +func mustDuration(t time.Duration) *durationpb.Duration { + return durationpb.New(t) +} + +func mustAny(pb proto.Message) *anypb.Any { + any, err := anypb.New(pb) + if err != nil { + panic(err) + } + return any +} + +var testMessagesWithWKTs = []struct { + name string + msg MessageWithWKTs + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithWKTs{}, + expected: `{}`, + }, + { + name: "zero", + msg: MessageWithWKTs{}, + expected: `{ + "double_value": null, + "double_values": [], + "float_value": null, + "float_values": [], + "int32_value": null, + "int32_values": [], + "int64_value": null, + "int64_values": [], + "uint32_value": null, + "uint32_values": [], + "uint64_value": null, + "uint64_values": [], + "bool_value": null, + "bool_values": [], + "string_value": null, + "string_values": [], + "bytes_value": null, + "bytes_values": [], + "empty_values": [], + "timestamp_value": null, + "timestamp_values": [], + "duration_value": null, + "duration_values": [], + "field_mask_value": null, + "field_mask_values": [], + "value_values": [], + "list_value_value": null, + "list_value_values": [], + "struct_value": null, + "struct_values": [], + "any_value": null, + "any_values": [] + }`, + expectedMask: []string{ + "double_value", + "double_values", + "float_value", + "float_values", + "int32_value", + "int32_values", + "int64_value", + "int64_values", + "uint32_value", + "uint32_values", + "uint64_value", + "uint64_values", + "bool_value", + "bool_values", + "string_value", + "string_values", + "bytes_value", + "bytes_values", + "empty_values", + "timestamp_value", + "timestamp_values", + "duration_value", + "duration_values", + "field_mask_value", + "field_mask_values", + "value_values", + "list_value_value", + "list_value_values", + "struct_value", + "struct_values", + "any_value", + "any_values", + }, + }, + { + name: "full", + msg: MessageWithWKTs{ + DoubleValue: &wrapperspb.DoubleValue{Value: 12.34}, + DoubleValues: []*wrapperspb.DoubleValue{ + {Value: 12.34}, + {Value: 56.78}, + }, + FloatValue: &wrapperspb.FloatValue{Value: 12.34}, + FloatValues: []*wrapperspb.FloatValue{ + {Value: 12.34}, + {Value: 56.78}, + }, + Int32Value: &wrapperspb.Int32Value{Value: -42}, + Int32Values: []*wrapperspb.Int32Value{ + {Value: 1}, + {Value: 2}, + {Value: -42}, + }, + Int64Value: &wrapperspb.Int64Value{Value: -42}, + Int64Values: []*wrapperspb.Int64Value{ + {Value: 1}, + {Value: 2}, + {Value: -42}, + }, + Uint32Value: &wrapperspb.UInt32Value{Value: 42}, + Uint32Values: []*wrapperspb.UInt32Value{ + {Value: 1}, + {Value: 2}, + {Value: 42}, + }, + Uint64Value: &wrapperspb.UInt64Value{Value: 42}, + Uint64Values: []*wrapperspb.UInt64Value{ + {Value: 1}, + {Value: 2}, + {Value: 42}, + }, + BoolValue: &wrapperspb.BoolValue{Value: true}, + BoolValues: []*wrapperspb.BoolValue{ + {Value: true}, + {Value: false}, + }, + StringValue: &wrapperspb.StringValue{Value: "foo"}, + StringValues: []*wrapperspb.StringValue{ + {Value: "foo"}, + {Value: "bar"}, + }, + BytesValue: &wrapperspb.BytesValue{Value: []byte("foo")}, + BytesValues: []*wrapperspb.BytesValue{ + {Value: []byte("foo")}, + {Value: []byte("bar")}, + }, + EmptyValue: &emptypb.Empty{}, + EmptyValues: []*emptypb.Empty{{}, {}}, + TimestampValue: mustTimestamp(testTime), + TimestampValues: []*timestamppb.Timestamp{ + mustTimestamp(testTime), + mustTimestamp(testTime.Truncate(10)), + mustTimestamp(testTime.Truncate(100)), + mustTimestamp(testTime.Truncate(1000)), + mustTimestamp(testTime.Truncate(10000)), + mustTimestamp(testTime.Truncate(100000)), + mustTimestamp(testTime.Truncate(1000000)), + mustTimestamp(testTime.Truncate(10000000)), + mustTimestamp(testTime.Truncate(100000000)), + mustTimestamp(testTime.Truncate(1000000000)), + }, + DurationValue: mustDuration(testDuration), + DurationValues: []*durationpb.Duration{ + mustDuration(testDuration), + mustDuration(testDuration.Truncate(10)), + mustDuration(testDuration.Truncate(100)), + mustDuration(testDuration.Truncate(1000)), + mustDuration(testDuration.Truncate(10000)), + mustDuration(testDuration.Truncate(100000)), + mustDuration(testDuration.Truncate(1000000)), + mustDuration(testDuration.Truncate(10000000)), + mustDuration(testDuration.Truncate(100000000)), + mustDuration(testDuration.Truncate(1000000000)), + }, + FieldMaskValue: &fieldmaskpb.FieldMask{Paths: []string{"foo.bar", "bar", "baz.qux"}}, + FieldMaskValues: []*fieldmaskpb.FieldMask{ + {Paths: []string{"foo.bar", "bar", "baz.qux"}}, + }, + ValueValue: &structpb.Value{Kind: &structpb.Value_StringValue{StringValue: "foo"}}, + ValueValues: []*structpb.Value{ + {Kind: &structpb.Value_NullValue{}}, + {Kind: &structpb.Value_NumberValue{NumberValue: 12.34}}, + {Kind: &structpb.Value_StringValue{StringValue: "foo"}}, + {Kind: &structpb.Value_BoolValue{BoolValue: true}}, + }, + ListValueValue: &structpb.ListValue{ + Values: []*structpb.Value{ + {Kind: &structpb.Value_NullValue{}}, + {Kind: &structpb.Value_NumberValue{NumberValue: 12.34}}, + {Kind: &structpb.Value_StringValue{StringValue: "foo"}}, + {Kind: &structpb.Value_BoolValue{BoolValue: true}}, + }, + }, + ListValueValues: []*structpb.ListValue{ + { + Values: []*structpb.Value{ + {Kind: &structpb.Value_NullValue{}}, + {Kind: &structpb.Value_NumberValue{NumberValue: 12.34}}, + {Kind: &structpb.Value_StringValue{StringValue: "foo"}}, + {Kind: &structpb.Value_BoolValue{BoolValue: true}}, + }, + }, + }, + StructValue: &structpb.Struct{ + Fields: map[string]*structpb.Value{ + "null": {Kind: &structpb.Value_NullValue{}}, + "number": {Kind: &structpb.Value_NumberValue{NumberValue: 12.34}}, + "string": {Kind: &structpb.Value_StringValue{StringValue: "foo"}}, + "bool": {Kind: &structpb.Value_BoolValue{BoolValue: true}}, + }, + }, + StructValues: []*structpb.Struct{ + {Fields: map[string]*structpb.Value{"null": {Kind: &structpb.Value_NullValue{}}}}, + {Fields: map[string]*structpb.Value{"number": {Kind: &structpb.Value_NumberValue{NumberValue: 12.34}}}}, + {Fields: map[string]*structpb.Value{"string": {Kind: &structpb.Value_StringValue{StringValue: "foo"}}}}, + {Fields: map[string]*structpb.Value{"bool": {Kind: &structpb.Value_BoolValue{BoolValue: true}}}}, + }, + AnyValue: mustAny(&MessageWithMarshaler{Message: "hello"}), + AnyValues: []*anypb.Any{ + mustAny(&MessageWithMarshaler{Message: "hello"}), + mustAny(&MessageWithoutMarshaler{Message: "hello"}), + }, + }, + expected: `{ + "double_value": 12.34, + "double_values": [12.34, 56.78], + "float_value": 12.34, + "float_values": [12.34, 56.78], + "int32_value": -42, + "int32_values": [1, 2, -42], + "int64_value": "-42", + "int64_values": ["1", "2", "-42"], + "uint32_value": 42, + "uint32_values": [1, 2, 42], + "uint64_value": "42", + "uint64_values": ["1", "2", "42"], + "bool_value": true, + "bool_values": [true, false], + "string_value": "foo", + "string_values": ["foo", "bar"], + "bytes_value": "Zm9v", + "bytes_values": ["Zm9v", "YmFy"], + "empty_value": {}, + "empty_values": [{}, {}], + "timestamp_value": "2006-01-02T08:04:05.123456789Z", + "timestamp_values": [ + "2006-01-02T08:04:05.123456789Z", + "2006-01-02T08:04:05.123456780Z", + "2006-01-02T08:04:05.123456700Z", + "2006-01-02T08:04:05.123456Z", + "2006-01-02T08:04:05.123450Z", + "2006-01-02T08:04:05.123400Z", + "2006-01-02T08:04:05.123Z", + "2006-01-02T08:04:05.120Z", + "2006-01-02T08:04:05.100Z", + "2006-01-02T08:04:05Z" + ], + "duration_value": "3723.123456789s", + "duration_values": [ + "3723.123456789s", + "3723.123456780s", + "3723.123456700s", + "3723.123456s", + "3723.123450s", + "3723.123400s", + "3723.123s", + "3723.120s", + "3723.100s", + "3723s" + ], + "field_mask_value": "foo.bar,bar,baz.qux", + "field_mask_values": ["foo.bar,bar,baz.qux"], + "value_value": "foo", + "value_values": [null, 12.34, "foo", true], + "list_value_value": [null, 12.34, "foo", true], + "list_value_values": [[null, 12.34, "foo", true]], + "struct_value": { + "bool": true, + "null": null, + "number": 12.34, + "string": "foo" + }, + "struct_values": [ + {"null": null}, + {"number": 12.34}, + {"string": "foo"}, + {"bool": true} + ], + "any_value": { + "@type": "type.googleapis.com/thethings.json.test.MessageWithMarshaler", + "message": "hello" + }, + "any_values": [ + { + "@type": "type.googleapis.com/thethings.json.test.MessageWithMarshaler", + "message": "hello" + }, + { + "@type": "type.googleapis.com/thethings.json.test.MessageWithoutMarshaler", + "message": "hello" + } + ] + }`, + expectedMask: []string{ + "double_value", + "double_values", + "float_value", + "float_values", + "int32_value", + "int32_values", + "int64_value", + "int64_values", + "uint32_value", + "uint32_values", + "uint64_value", + "uint64_values", + "bool_value", + "bool_values", + "string_value", + "string_values", + "bytes_value", + "bytes_values", + "empty_value", + "empty_values", + "timestamp_value", + "timestamp_values", + "duration_value", + "duration_values", + "field_mask_value", + "field_mask_values", + "value_value", + "value_values", + "list_value_value", + "list_value_values", + "struct_value", + "struct_values", + "any_value", + "any_values", + }, + }, +} + +func TestMarshalMessageWithWKTs(t *testing.T) { + for _, tt := range testMessagesWithWKTs { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithWKTs(t *testing.T) { + for _, tt := range testMessagesWithWKTs { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithOneofWKTs = []struct { + name string + msg MessageWithOneofWKTs + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithOneofWKTs{}, + expected: `{}`, + }, + { + name: "double_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_DoubleValue{}, + }, + expected: `{"double_value": null}`, + expectedMask: []string{"double_value"}, + }, + { + name: "double_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_DoubleValue{DoubleValue: &wrapperspb.DoubleValue{Value: 12.34}}, + }, + expected: `{"double_value": 12.34}`, + expectedMask: []string{"double_value"}, + }, + { + name: "float_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_FloatValue{}, + }, + expected: `{"float_value": null}`, + expectedMask: []string{"float_value"}, + }, + { + name: "float_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_FloatValue{FloatValue: &wrapperspb.FloatValue{Value: 12.34}}, + }, + expected: `{"float_value": 12.34}`, + expectedMask: []string{"float_value"}, + }, + { + name: "int32_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Int32Value{}, + }, + expected: `{"int32_value": null}`, + expectedMask: []string{"int32_value"}, + }, + { + name: "int32_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Int32Value{Int32Value: &wrapperspb.Int32Value{Value: -42}}, + }, + expected: `{"int32_value": -42}`, + expectedMask: []string{"int32_value"}, + }, + { + name: "int64_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Int64Value{}, + }, + expected: `{"int64_value": null}`, + expectedMask: []string{"int64_value"}, + }, + { + name: "int64_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Int64Value{Int64Value: &wrapperspb.Int64Value{Value: -42}}, + }, + expected: `{"int64_value": "-42"}`, + expectedMask: []string{"int64_value"}, + }, + { + name: "uint32_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Uint32Value{}, + }, + expected: `{"uint32_value": null}`, + expectedMask: []string{"uint32_value"}, + }, + { + name: "uint32_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Uint32Value{Uint32Value: &wrapperspb.UInt32Value{Value: 42}}, + }, + expected: `{"uint32_value": 42}`, + expectedMask: []string{"uint32_value"}, + }, + { + name: "uint64_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Uint64Value{}, + }, + expected: `{"uint64_value": null}`, + expectedMask: []string{"uint64_value"}, + }, + { + name: "uint64_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_Uint64Value{Uint64Value: &wrapperspb.UInt64Value{Value: 42}}, + }, + expected: `{"uint64_value": "42"}`, + expectedMask: []string{"uint64_value"}, + }, + { + name: "bool_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_BoolValue{}, + }, + expected: `{"bool_value": null}`, + expectedMask: []string{"bool_value"}, + }, + { + name: "bool_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_BoolValue{BoolValue: &wrapperspb.BoolValue{Value: true}}, + }, + expected: `{"bool_value": true}`, + expectedMask: []string{"bool_value"}, + }, + { + name: "string_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_StringValue{}, + }, + expected: `{"string_value": null}`, + expectedMask: []string{"string_value"}, + }, + { + name: "string_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_StringValue{StringValue: &wrapperspb.StringValue{Value: "foo"}}, + }, + expected: `{"string_value": "foo"}`, + expectedMask: []string{"string_value"}, + }, + { + name: "bytes_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_BytesValue{}, + }, + expected: `{"bytes_value": null}`, + expectedMask: []string{"bytes_value"}, + }, + { + name: "bytes_zero", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_BytesValue{BytesValue: &wrapperspb.BytesValue{Value: []byte{}}}, + }, + expected: `{"bytes_value": ""}`, + expectedMask: []string{"bytes_value"}, + }, + { + name: "bytes_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_BytesValue{BytesValue: &wrapperspb.BytesValue{Value: []byte("foo")}}, + }, + expected: `{"bytes_value": "Zm9v"}`, + expectedMask: []string{"bytes_value"}, + }, + { + name: "empty_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_EmptyValue{}, + }, + expected: `{"empty_value": null}`, + expectedMask: []string{"empty_value"}, + }, + { + name: "empty_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_EmptyValue{EmptyValue: &emptypb.Empty{}}, + }, + expected: `{"empty_value": {}}`, + expectedMask: []string{"empty_value"}, + }, + { + name: "timestamp_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_TimestampValue{}, + }, + expected: `{"timestamp_value": null}`, + expectedMask: []string{"timestamp_value"}, + }, + { + name: "timestamp_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_TimestampValue{TimestampValue: mustTimestamp(testTime)}, + }, + expected: `{"timestamp_value": "2006-01-02T08:04:05.123456789Z"}`, + expectedMask: []string{"timestamp_value"}, + }, + { + name: "duration_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_DurationValue{}, + }, + expected: `{"duration_value": null}`, + expectedMask: []string{"duration_value"}, + }, + { + name: "duration_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_DurationValue{DurationValue: mustDuration(testDuration)}, + }, + expected: `{"duration_value": "3723.123456789s"}`, + expectedMask: []string{"duration_value"}, + }, + { + name: "field_mask_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_FieldMaskValue{}, + }, + expected: `{"field_mask_value": null}`, + expectedMask: []string{"field_mask_value"}, + }, + { + name: "field_mask_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_FieldMaskValue{FieldMaskValue: &fieldmaskpb.FieldMask{Paths: []string{"foo.bar", "bar", "baz.qux"}}}, + }, + expected: `{"field_mask_value": "foo.bar,bar,baz.qux"}`, + expectedMask: []string{"field_mask_value"}, + }, + { + name: "value_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_ValueValue{ValueValue: &structpb.Value{Kind: &structpb.Value_NullValue{}}}, + }, + expected: `{"value_value": null}`, + expectedMask: []string{"value_value"}, + }, + { + name: "value_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_ValueValue{ValueValue: &structpb.Value{Kind: &structpb.Value_StringValue{StringValue: "foo"}}}, + }, + expected: `{"value_value": "foo"}`, + expectedMask: []string{"value_value"}, + }, + { + name: "list_value_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_ListValueValue{}, + }, + expected: `{"list_value_value": null}`, + expectedMask: []string{"list_value_value"}, + }, + { + name: "list_value_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_ListValueValue{ + ListValueValue: &structpb.ListValue{ + Values: []*structpb.Value{ + {Kind: &structpb.Value_NullValue{}}, + {Kind: &structpb.Value_NumberValue{NumberValue: 12.34}}, + {Kind: &structpb.Value_StringValue{StringValue: "foo"}}, + {Kind: &structpb.Value_BoolValue{BoolValue: true}}, + }, + }, + }, + }, + expected: `{"list_value_value": [null, 12.34, "foo", true]}`, + expectedMask: []string{"list_value_value"}, + }, + { + name: "struct_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_StructValue{}, + }, + expected: `{"struct_value": null}`, + expectedMask: []string{"struct_value"}, + }, + { + name: "struct_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_StructValue{ + StructValue: &structpb.Struct{ + Fields: map[string]*structpb.Value{ + "null": {Kind: &structpb.Value_NullValue{}}, + "number": {Kind: &structpb.Value_NumberValue{NumberValue: 12.34}}, + "string": {Kind: &structpb.Value_StringValue{StringValue: "foo"}}, + "bool": {Kind: &structpb.Value_BoolValue{BoolValue: true}}, + }, + }, + }, + }, + expected: `{"struct_value": {"bool": true, "null": null, "number": 12.34, "string": "foo"}}`, + expectedMask: []string{"struct_value"}, + }, + { + name: "any_null", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_AnyValue{}, + }, + expected: `{"any_value": null}`, + expectedMask: []string{"any_value"}, + }, + { + name: "any_value", + msg: MessageWithOneofWKTs{ + Value: &MessageWithOneofWKTs_AnyValue{ + AnyValue: mustAny(&MessageWithMarshaler{Message: "hello"}), + }, + }, + expected: `{"any_value": { + "@type": "type.googleapis.com/thethings.json.test.MessageWithMarshaler", + "message": "hello" + }}`, + expectedMask: []string{"any_value"}, + }, +} + +func TestMarshalMessageWithOneofWKTs(t *testing.T) { + for _, tt := range testMessagesWithOneofWKTs { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithOneofWKTs(t *testing.T) { + for _, tt := range testMessagesWithOneofWKTs { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} + +var testMessagesWithWKTMaps = []struct { + name string + msg MessageWithWKTMaps + expected string + expectedMask []string +}{ + { + name: "empty", + msg: MessageWithWKTMaps{}, + expected: `{}`, + }, + { + name: "full", + msg: MessageWithWKTMaps{ + StringDoubleMap: map[string]*wrapperspb.DoubleValue{"value": {Value: 12.34}}, + StringFloatMap: map[string]*wrapperspb.FloatValue{"value": {Value: 12.34}}, + StringInt32Map: map[string]*wrapperspb.Int32Value{"value": {Value: -42}}, + StringInt64Map: map[string]*wrapperspb.Int64Value{"value": {Value: -42}}, + StringUint32Map: map[string]*wrapperspb.UInt32Value{"value": {Value: 42}}, + StringUint64Map: map[string]*wrapperspb.UInt64Value{"value": {Value: 42}}, + StringBoolMap: map[string]*wrapperspb.BoolValue{"yes": {Value: true}}, + StringStringMap: map[string]*wrapperspb.StringValue{"value": {Value: "foo"}}, + StringBytesMap: map[string]*wrapperspb.BytesValue{"value": {Value: []byte("foo")}}, + StringEmptyMap: map[string]*emptypb.Empty{"value": {}}, + StringTimestampMap: map[string]*timestamppb.Timestamp{"value": mustTimestamp(testTime)}, + StringDurationMap: map[string]*durationpb.Duration{"value": mustDuration(testDuration)}, + StringFieldMaskMap: map[string]*fieldmaskpb.FieldMask{"value": {Paths: []string{"foo.bar", "bar", "baz.qux"}}}, + StringValueMap: map[string]*structpb.Value{"value": {Kind: &structpb.Value_StringValue{StringValue: "foo"}}}, + StringListValueMap: map[string]*structpb.ListValue{"value": {Values: []*structpb.Value{ + {Kind: &structpb.Value_NullValue{}}, + {Kind: &structpb.Value_NumberValue{NumberValue: 12.34}}, + {Kind: &structpb.Value_StringValue{StringValue: "foo"}}, + {Kind: &structpb.Value_BoolValue{BoolValue: true}}, + }}}, + StringStructMap: map[string]*structpb.Struct{ + "value": {Fields: map[string]*structpb.Value{ + "null": {Kind: &structpb.Value_NullValue{}}, + "number": {Kind: &structpb.Value_NumberValue{NumberValue: 12.34}}, + "string": {Kind: &structpb.Value_StringValue{StringValue: "foo"}}, + "bool": {Kind: &structpb.Value_BoolValue{BoolValue: true}}, + }}, + }, + StringAnyMap: map[string]*anypb.Any{ + "value": mustAny(&MessageWithMarshaler{Message: "hello"}), + }, + }, + expected: `{ + "string_double_map": {"value": 12.34}, + "string_float_map": {"value": 12.34}, + "string_int32_map": {"value": -42}, + "string_int64_map": {"value": "-42"}, + "string_uint32_map": {"value": 42}, + "string_uint64_map": {"value": "42"}, + "string_bool_map": {"yes": true}, + "string_string_map": {"value": "foo"}, + "string_bytes_map": {"value": "Zm9v"}, + "string_empty_map": {"value": {}}, + "string_timestamp_map": {"value": "2006-01-02T08:04:05.123456789Z"}, + "string_duration_map": {"value": "3723.123456789s"}, + "string_field_mask_map": {"value": "foo.bar,bar,baz.qux"}, + "string_value_map": {"value": "foo"}, + "string_list_value_map": {"value": [null, 12.34, "foo", true]}, + "string_struct_map": {"value": {"bool": true, "null": null, "number": 12.34, "string": "foo"}}, + "string_any_map": {"value": {"@type": "type.googleapis.com/thethings.json.test.MessageWithMarshaler", "message": "hello"}} + }`, + expectedMask: []string{ + "string_double_map", + "string_float_map", + "string_int32_map", + "string_int64_map", + "string_uint32_map", + "string_uint64_map", + "string_bool_map", + "string_string_map", + "string_bytes_map", + "string_empty_map", + "string_timestamp_map", + "string_duration_map", + "string_field_mask_map", + "string_value_map", + "string_list_value_map", + "string_struct_map", + "string_any_map", + }, + }, +} + +func TestMarshalMessageWithWKTMaps(t *testing.T) { + for _, tt := range testMessagesWithWKTMaps { + t.Run(tt.name, func(t *testing.T) { + expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) + }) + } +} + +func TestUnmarshalMessageWithWKTMaps(t *testing.T) { + for _, tt := range testMessagesWithWKTMaps { + t.Run(tt.name, func(t *testing.T) { + expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) + }) + } +} diff --git a/test/scalars.proto b/test/scalars.proto new file mode 100644 index 00000000..6b3f066b --- /dev/null +++ b/test/scalars.proto @@ -0,0 +1,126 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +syntax = "proto3"; + +import "annotations.proto"; + +package thethings.json.test; + +option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/test"; + +option (thethings.json.file) = { marshaler_all: true, unmarshaler_all: true }; + +message MessageWithScalars { + double double_value = 1; + repeated double double_values = 2; + + float float_value = 3; + repeated float float_values = 4; + + int32 int32_value = 5; + repeated int32 int32_values = 6; + + int64 int64_value = 7; + repeated int64 int64_values = 8; + + uint32 uint32_value = 9; + repeated uint32 uint32_values = 10; + + uint64 uint64_value = 11; + repeated uint64 uint64_values = 12; + + sint32 sint32_value = 13; + repeated sint32 sint32_values = 14; + + sint64 sint64_value = 15; + repeated sint64 sint64_values = 16; + + fixed32 fixed32_value = 17; + repeated fixed32 fixed32_values = 18; + + fixed64 fixed64_value = 19; + repeated fixed64 fixed64_values = 20; + + sfixed32 sfixed32_value = 21; + repeated sfixed32 sfixed32_values = 22; + + sfixed64 sfixed64_value = 23; + repeated sfixed64 sfixed64_values = 24; + + bool bool_value = 25; + repeated bool bool_values = 26; + + string string_value = 27; + repeated string string_values = 28; + + bytes bytes_value = 29; + repeated bytes bytes_values = 30; +} + +message MessageWithOneofScalars { + oneof value { + double double_value = 1; + float float_value = 2; + int32 int32_value = 3; + int64 int64_value = 4; + uint32 uint32_value = 5; + uint64 uint64_value = 6; + sint32 sint32_value = 7; + sint64 sint64_value = 8; + fixed32 fixed32_value = 9; + fixed64 fixed64_value = 10; + sfixed32 sfixed32_value = 11; + sfixed64 sfixed64_value = 12; + bool bool_value = 13; + string string_value = 14; + bytes bytes_value = 15; + } +} + +message MessageWithScalarMaps { + map string_double_map = 1; + // map is impossible. + + map string_float_map = 3; + // map is impossible. + + map string_int32_map = 5; + map int32_string_map = 6; + + map string_int64_map = 7; + map int64_string_map = 8; + + map string_uint32_map = 9; + map uint32_string_map = 10; + + map string_uint64_map = 11; + map uint64_string_map = 12; + + map string_sint32_map = 13; + map sint32_string_map = 14; + + map string_sint64_map = 15; + map sint64_string_map = 16; + + map string_fixed32_map = 17; + map fixed32_string_map = 18; + + map string_fixed64_map = 19; + map fixed64_string_map = 20; + + map string_sfixed32_map = 21; + map sfixed32_string_map = 22; + + map string_sfixed64_map = 23; + map sfixed64_string_map = 24; + + map string_bool_map = 25; + map bool_string_map = 26; + + map string_string_map = 27; + // map is above. + + map string_bytes_map = 29; + // map is impossible. +} diff --git a/test/types/eui.go b/test/types/eui.go new file mode 100644 index 00000000..ff048b5d --- /dev/null +++ b/test/types/eui.go @@ -0,0 +1,110 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +package types + +import ( + "encoding/hex" + "fmt" + "strconv" + + "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" +) + +type EUI64 [8]byte + +func (t EUI64) Marshal() ([]byte, error) { + return t[:], nil +} + +func (t *EUI64) MarshalTo(data []byte) (n int, err error) { + return copy(data, t[:]), nil +} + +func (t *EUI64) Unmarshal(data []byte) error { + if len(data) != 8 { + return fmt.Errorf("invalid data length: got %d, want 8", len(data)) + } + var dto EUI64 + copy(dto[:], data) + *t = dto + return nil +} + +func (t *EUI64) Size() int { return 8 } + +func MarshalHEX(s *jsonplugin.MarshalState, b []byte) { + if b == nil { + s.WriteNil() + return + } + s.WriteString(fmt.Sprintf("%X", b)) +} + +func UnmarshalHEX(s *jsonplugin.UnmarshalState) []byte { + str := s.ReadString() + if s.Err() != nil { + return nil + } + b, err := hex.DecodeString(str) + if err != nil { + s.SetError(err) + return nil + } + return b +} + +func MarshalHEXArray(s *jsonplugin.MarshalState, bs [][]byte) { + s.WriteArrayStart() + var wroteElement bool + for _, b := range bs { + s.WriteMoreIf(&wroteElement) + s.WriteString(fmt.Sprintf("%X", b)) + } + s.WriteArrayEnd() +} + +func UnmarshalHEXArray(s *jsonplugin.UnmarshalState) [][]byte { + var bs [][]byte + s.ReadArray(func() { + bs = append(bs, UnmarshalHEX(s)) + }) + if s.Err() != nil { + return nil + } + return bs +} + +func (t EUI64) MarshalJSON() ([]byte, error) { + return []byte(fmt.Sprintf(`"%X"`, t[:])), nil +} + +func (t *EUI64) UnmarshalJSON(data []byte) error { + hexStr, err := strconv.Unquote(string(data)) + if err != nil { + return err + } + b, err := hex.DecodeString(hexStr) + var dto EUI64 + copy(dto[:], b) + *t = dto + return nil +} + +func (t *EUI64) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if t == nil { + s.WriteNil() + return + } + s.WriteString(fmt.Sprintf("%X", t[:])) +} + +func (t *EUI64) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + b, err := hex.DecodeString(s.ReadString()) + if err != nil { + s.SetError(err) + } + var dto EUI64 + copy(dto[:], b) + *t = dto +} diff --git a/test/wkts.proto b/test/wkts.proto new file mode 100644 index 00000000..bd190de8 --- /dev/null +++ b/test/wkts.proto @@ -0,0 +1,125 @@ +// Copyright © 2021 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +syntax = "proto3"; + +import "annotations.proto"; + +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +package thethings.json.test; + +option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/test"; + +option (thethings.json.file) = { marshaler_all: true, unmarshaler_all: true }; + +message MessageWithMarshaler { + string message = 1; +} + +message MessageWithoutMarshaler { + option (thethings.json.message) = { marshaler: false, unmarshaler: false }; + + string message = 1; +} + +message MessageWithWKTs { + google.protobuf.DoubleValue double_value = 1; + repeated google.protobuf.DoubleValue double_values = 2; + + google.protobuf.FloatValue float_value = 3; + repeated google.protobuf.FloatValue float_values = 4; + + google.protobuf.Int32Value int32_value = 5; + repeated google.protobuf.Int32Value int32_values = 6; + + google.protobuf.Int64Value int64_value = 7; + repeated google.protobuf.Int64Value int64_values = 8; + + google.protobuf.UInt32Value uint32_value = 9; + repeated google.protobuf.UInt32Value uint32_values = 10; + + google.protobuf.UInt64Value uint64_value = 11; + repeated google.protobuf.UInt64Value uint64_values = 12; + + google.protobuf.BoolValue bool_value = 13; + repeated google.protobuf.BoolValue bool_values = 14; + + google.protobuf.StringValue string_value = 15; + repeated google.protobuf.StringValue string_values = 16; + + google.protobuf.BytesValue bytes_value = 17; + repeated google.protobuf.BytesValue bytes_values = 18; + + google.protobuf.Empty empty_value = 19; + repeated google.protobuf.Empty empty_values = 20; + + google.protobuf.Timestamp timestamp_value = 21; + repeated google.protobuf.Timestamp timestamp_values = 22; + + google.protobuf.Duration duration_value = 23; + repeated google.protobuf.Duration duration_values = 24; + + google.protobuf.FieldMask field_mask_value = 25; + repeated google.protobuf.FieldMask field_mask_values = 26; + + google.protobuf.Value value_value = 27; + repeated google.protobuf.Value value_values = 28; + + google.protobuf.ListValue list_value_value = 29; + repeated google.protobuf.ListValue list_value_values = 30; + + google.protobuf.Struct struct_value = 31; + repeated google.protobuf.Struct struct_values = 32; + + google.protobuf.Any any_value = 33; + repeated google.protobuf.Any any_values = 34; +} + +message MessageWithOneofWKTs { + oneof value { + google.protobuf.DoubleValue double_value = 1; + google.protobuf.FloatValue float_value = 2; + google.protobuf.Int32Value int32_value = 3; + google.protobuf.Int64Value int64_value = 4; + google.protobuf.UInt32Value uint32_value = 5; + google.protobuf.UInt64Value uint64_value = 6; + google.protobuf.BoolValue bool_value = 7; + google.protobuf.StringValue string_value = 8; + google.protobuf.BytesValue bytes_value = 9; + google.protobuf.Empty empty_value = 10; + google.protobuf.Timestamp timestamp_value = 11; + google.protobuf.Duration duration_value = 12; + google.protobuf.FieldMask field_mask_value = 13; + google.protobuf.Value value_value = 14; + google.protobuf.ListValue list_value_value = 15; + google.protobuf.Struct struct_value = 16; + google.protobuf.Any any_value = 17; + } +} + +message MessageWithWKTMaps { + map string_double_map = 1; + map string_float_map = 2; + map string_int32_map = 3; + map string_int64_map = 4; + map string_uint32_map = 5; + map string_uint64_map = 6; + map string_bool_map = 7; + map string_string_map = 8; + map string_bytes_map = 9; + map string_empty_map = 10; + map string_timestamp_map = 11; + map string_duration_map = 12; + map string_field_mask_map = 13; + map string_value_map = 14; + map string_list_value_map = 15; + map string_struct_map = 16; + map string_any_map = 17; +} From 739f3bc725aa4c844db53968e28b369e93b54462 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 28 Sep 2021 15:24:19 +0200 Subject: [PATCH 02/46] Use extension number 51885 --- annotations.proto | 22 +- annotations/annotations.pb.go | 144 +++--- test/gogo/enums.pb.go | 68 +-- test/gogo/gogo.pb.go | 94 ++-- test/gogo/scalars.pb.go | 176 ++++---- test/gogo/wkts.pb.go | 204 ++++----- test/golang/enums.pb.go | 116 ++--- test/golang/gogo.pb.go | 250 +++++------ test/golang/scalars.pb.go | 6 +- test/golang/wkts.pb.go | 814 +++++++++++++++++----------------- 10 files changed, 948 insertions(+), 946 deletions(-) diff --git a/annotations.proto b/annotations.proto index 1a59f4b3..0297dd9f 100644 --- a/annotations.proto +++ b/annotations.proto @@ -9,8 +9,10 @@ option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/annotatio import "google/protobuf/descriptor.proto"; -// TODO: The extension number 1885 is temporary. -// It will change after we register an extension number on +// NOTE: protoc-gen-go-json is primarily intended for internal use by +// The Things Industries. We have therefore chosen to use option number 51885, +// which is in the 50000-99999 range reserved for internal use within individual +// organizations. For this reason, the option number is not registered on // https://github.com/protocolbuffers/protobuf/blob/master/docs/options.md. message FileOptions { @@ -23,7 +25,7 @@ message FileOptions { } extend google.protobuf.FileOptions { - optional FileOptions file = 1885; + optional FileOptions file = 51885; } message MessageOptions { @@ -36,7 +38,7 @@ message MessageOptions { } extend google.protobuf.MessageOptions { - optional MessageOptions message = 1885; + optional MessageOptions message = 51885; } message FieldOptions { @@ -47,7 +49,7 @@ message FieldOptions { } extend google.protobuf.FieldOptions { - optional FieldOptions field = 1885; + optional FieldOptions field = 51885; } message OneofOptions { @@ -55,7 +57,7 @@ message OneofOptions { } extend google.protobuf.OneofOptions { - optional OneofOptions oneof = 1885; + optional OneofOptions oneof = 51885; } message EnumOptions { @@ -72,7 +74,7 @@ message EnumOptions { } extend google.protobuf.EnumOptions { - optional EnumOptions enum = 1885; + optional EnumOptions enum = 51885; } message EnumValueOptions { @@ -83,7 +85,7 @@ message EnumValueOptions { } extend google.protobuf.EnumValueOptions { - optional EnumValueOptions enum_value = 1885; + optional EnumValueOptions enum_value = 51885; } message ServiceOptions { @@ -91,7 +93,7 @@ message ServiceOptions { } extend google.protobuf.ServiceOptions { - optional ServiceOptions service = 1885; + optional ServiceOptions service = 51885; } message MethodOptions { @@ -99,5 +101,5 @@ message MethodOptions { } extend google.protobuf.MethodOptions { - optional MethodOptions method = 1885; + optional MethodOptions method = 51885; } diff --git a/annotations/annotations.pb.go b/annotations/annotations.pb.go index da2acc56..792d6503 100644 --- a/annotations/annotations.pb.go +++ b/annotations/annotations.pb.go @@ -465,114 +465,114 @@ var file_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.FileOptions)(nil), ExtensionType: (*FileOptions)(nil), - Field: 1885, + Field: 51885, Name: "thethings.json.file", - Tag: "bytes,1885,opt,name=file", + Tag: "bytes,51885,opt,name=file", Filename: "annotations.proto", }, { ExtendedType: (*descriptorpb.MessageOptions)(nil), ExtensionType: (*MessageOptions)(nil), - Field: 1885, + Field: 51885, Name: "thethings.json.message", - Tag: "bytes,1885,opt,name=message", + Tag: "bytes,51885,opt,name=message", Filename: "annotations.proto", }, { ExtendedType: (*descriptorpb.FieldOptions)(nil), ExtensionType: (*FieldOptions)(nil), - Field: 1885, + Field: 51885, Name: "thethings.json.field", - Tag: "bytes,1885,opt,name=field", + Tag: "bytes,51885,opt,name=field", Filename: "annotations.proto", }, { ExtendedType: (*descriptorpb.OneofOptions)(nil), ExtensionType: (*OneofOptions)(nil), - Field: 1885, + Field: 51885, Name: "thethings.json.oneof", - Tag: "bytes,1885,opt,name=oneof", + Tag: "bytes,51885,opt,name=oneof", Filename: "annotations.proto", }, { ExtendedType: (*descriptorpb.EnumOptions)(nil), ExtensionType: (*EnumOptions)(nil), - Field: 1885, + Field: 51885, Name: "thethings.json.enum", - Tag: "bytes,1885,opt,name=enum", + Tag: "bytes,51885,opt,name=enum", Filename: "annotations.proto", }, { ExtendedType: (*descriptorpb.EnumValueOptions)(nil), ExtensionType: (*EnumValueOptions)(nil), - Field: 1885, + Field: 51885, Name: "thethings.json.enum_value", - Tag: "bytes,1885,opt,name=enum_value", + Tag: "bytes,51885,opt,name=enum_value", Filename: "annotations.proto", }, { ExtendedType: (*descriptorpb.ServiceOptions)(nil), ExtensionType: (*ServiceOptions)(nil), - Field: 1885, + Field: 51885, Name: "thethings.json.service", - Tag: "bytes,1885,opt,name=service", + Tag: "bytes,51885,opt,name=service", Filename: "annotations.proto", }, { ExtendedType: (*descriptorpb.MethodOptions)(nil), ExtensionType: (*MethodOptions)(nil), - Field: 1885, + Field: 51885, Name: "thethings.json.method", - Tag: "bytes,1885,opt,name=method", + Tag: "bytes,51885,opt,name=method", Filename: "annotations.proto", }, } // Extension fields to descriptorpb.FileOptions. var ( - // optional thethings.json.FileOptions file = 1885; + // optional thethings.json.FileOptions file = 51885; E_File = &file_annotations_proto_extTypes[0] ) // Extension fields to descriptorpb.MessageOptions. var ( - // optional thethings.json.MessageOptions message = 1885; + // optional thethings.json.MessageOptions message = 51885; E_Message = &file_annotations_proto_extTypes[1] ) // Extension fields to descriptorpb.FieldOptions. var ( - // optional thethings.json.FieldOptions field = 1885; + // optional thethings.json.FieldOptions field = 51885; E_Field = &file_annotations_proto_extTypes[2] ) // Extension fields to descriptorpb.OneofOptions. var ( - // optional thethings.json.OneofOptions oneof = 1885; + // optional thethings.json.OneofOptions oneof = 51885; E_Oneof = &file_annotations_proto_extTypes[3] ) // Extension fields to descriptorpb.EnumOptions. var ( - // optional thethings.json.EnumOptions enum = 1885; + // optional thethings.json.EnumOptions enum = 51885; E_Enum = &file_annotations_proto_extTypes[4] ) // Extension fields to descriptorpb.EnumValueOptions. var ( - // optional thethings.json.EnumValueOptions enum_value = 1885; + // optional thethings.json.EnumValueOptions enum_value = 51885; E_EnumValue = &file_annotations_proto_extTypes[5] ) // Extension fields to descriptorpb.ServiceOptions. var ( - // optional thethings.json.ServiceOptions service = 1885; + // optional thethings.json.ServiceOptions service = 51885; E_Service = &file_annotations_proto_extTypes[6] ) // Extension fields to descriptorpb.MethodOptions. var ( - // optional thethings.json.MethodOptions method = 1885; + // optional thethings.json.MethodOptions method = 51885; E_Method = &file_annotations_proto_extTypes[7] ) @@ -621,55 +621,55 @@ var file_annotations_proto_rawDesc = []byte{ 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x0f, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x4e, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x4f, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xdd, 0x0e, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x3a, 0x5a, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0xdd, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x68, 0x65, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x3a, 0x52, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x1d, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xdd, 0x0e, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, - 0x73, 0x6f, 0x6e, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x3a, 0x52, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, - 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0xdd, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, - 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x3a, 0x4e, 0x0a, 0x04, 0x65, - 0x6e, 0x75, 0x6d, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0xdd, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x3a, 0x63, 0x0a, 0x0a, 0x65, - 0x6e, 0x75, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xdd, 0x0e, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x5a, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xdd, 0x0e, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x56, 0x0a, 0x06, - 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xdd, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, - 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x06, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x42, 0x3f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, - 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, - 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x3a, 0x5b, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, + 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x53, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x1d, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x3a, 0x53, 0x0a, 0x05, 0x6f, 0x6e, + 0x65, 0x6f, 0x66, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, + 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x3a, + 0x4f, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x45, + 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, + 0x3a, 0x64, 0x0a, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x09, 0x65, 0x6e, 0x75, + 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x5b, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x3a, 0x57, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1e, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x42, 0x3f, 0x5a, 0x3d, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, + 0x6e, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, } var ( diff --git a/test/gogo/enums.pb.go b/test/gogo/enums.pb.go index 58a81ac5..11cdbbf3 100644 --- a/test/gogo/enums.pb.go +++ b/test/gogo/enums.pb.go @@ -288,40 +288,40 @@ func init() { func init() { proto.RegisterFile("enums.proto", fileDescriptor_888b6bd9597961ff) } var fileDescriptor_888b6bd9597961ff = []byte{ - // 514 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x41, 0x6e, 0xda, 0x40, - 0x14, 0x86, 0x3d, 0x38, 0x40, 0xfa, 0x28, 0xe0, 0x4e, 0x54, 0xc9, 0x42, 0x0a, 0xb5, 0x50, 0x17, - 0x11, 0x12, 0x06, 0x52, 0xb5, 0x55, 0xa2, 0x6c, 0x42, 0x14, 0x85, 0x2a, 0x05, 0x54, 0x0a, 0x89, - 0xd4, 0x0d, 0x72, 0xc8, 0xd4, 0x76, 0x05, 0x33, 0xc8, 0x33, 0xd3, 0x5e, 0xa1, 0x87, 0xe8, 0xae, - 0x3d, 0x40, 0xcf, 0x94, 0x55, 0xc4, 0xaa, 0x47, 0xa8, 0x3c, 0x36, 0xe0, 0xb4, 0x91, 0xe2, 0xec, - 0x9e, 0xdf, 0xfc, 0xff, 0xff, 0xc6, 0xdf, 0xb3, 0xa1, 0x40, 0xa8, 0x9c, 0x73, 0x7b, 0x11, 0x30, - 0xc1, 0xf0, 0x8e, 0xf0, 0x88, 0xf0, 0x7c, 0xea, 0x72, 0xfb, 0x0b, 0x67, 0xd4, 0x16, 0x84, 0x8b, - 0xca, 0x33, 0x87, 0x52, 0x26, 0x1c, 0xe1, 0x33, 0x1a, 0xeb, 0x2a, 0xbb, 0x3e, 0x15, 0x24, 0xa0, - 0xce, 0xac, 0xe9, 0x32, 0x97, 0xa9, 0x9e, 0xaa, 0xa2, 0xe3, 0xda, 0x00, 0xca, 0x27, 0x92, 0x0b, - 0x36, 0x3f, 0xa5, 0x72, 0x7e, 0xe1, 0xcc, 0x24, 0xc1, 0xaf, 0x21, 0xfb, 0x35, 0x2c, 0x4c, 0x64, - 0xa1, 0xbd, 0xd2, 0xfe, 0x0b, 0xfb, 0x9e, 0x49, 0xf6, 0xc6, 0x34, 0x8c, 0xd4, 0x87, 0xd9, 0xa5, - 0xcc, 0x98, 0xa8, 0xf6, 0x43, 0x07, 0xa3, 0x47, 0x38, 0x77, 0x5c, 0x72, 0xe9, 0x0b, 0x2f, 0x54, - 0x70, 0x7c, 0x08, 0xf9, 0x80, 0xb8, 0x72, 0xe6, 0x04, 0x71, 0xa8, 0x75, 0x6f, 0xe8, 0x30, 0xd2, - 0xa8, 0xd4, 0x95, 0x01, 0x1f, 0xc1, 0x76, 0x5c, 0x72, 0x33, 0x63, 0xe9, 0xa9, 0xcc, 0x6b, 0x07, - 0x7e, 0x0b, 0xb9, 0xa9, 0xba, 0xaa, 0xa9, 0xa7, 0x7b, 0x9b, 0x58, 0x8e, 0x0f, 0x20, 0x1f, 0x55, - 0xdc, 0xdc, 0x52, 0x53, 0x1f, 0x74, 0xae, 0xf4, 0xf8, 0x1c, 0x4a, 0xdf, 0x02, 0x67, 0xb1, 0x20, - 0xd7, 0x93, 0x78, 0x76, 0xd6, 0x42, 0x7b, 0x85, 0xfd, 0x97, 0x0f, 0x24, 0x28, 0xfc, 0xc3, 0x62, - 0xec, 0x8d, 0xfa, 0xb8, 0x07, 0xe5, 0xbb, 0x61, 0xdc, 0xcc, 0x59, 0x7a, 0xea, 0xb4, 0xd2, 0x9d, - 0x34, 0x5e, 0xbb, 0x45, 0xf0, 0x3c, 0xb1, 0x9e, 0x01, 0x25, 0xec, 0x73, 0xb4, 0xa3, 0xa3, 0x47, - 0xef, 0xa8, 0xab, 0x6d, 0xb6, 0x74, 0xb0, 0xe6, 0x9c, 0x49, 0xc5, 0xb9, 0xab, 0xad, 0x49, 0xf7, - 0xfe, 0xc3, 0xa5, 0xa7, 0xc7, 0xd5, 0xd5, 0xfe, 0x01, 0xd6, 0xc9, 0xc7, 0x9f, 0x6f, 0xfd, 0x03, - 0x14, 0x12, 0x97, 0xc5, 0x3b, 0x50, 0x1e, 0x9e, 0x9e, 0x8d, 0xdf, 0x1f, 0x0f, 0x27, 0xe3, 0xfe, - 0x79, 0x7f, 0x70, 0xd9, 0x37, 0x34, 0x5c, 0x84, 0x27, 0xab, 0xe6, 0xb1, 0x81, 0x92, 0x8f, 0x1d, - 0x23, 0x53, 0x29, 0x2f, 0xe5, 0xd6, 0xb6, 0x66, 0x69, 0xdf, 0x7f, 0x56, 0xb5, 0xdf, 0xbf, 0xaa, - 0x5a, 0x7d, 0x01, 0xb0, 0x99, 0x8f, 0x31, 0x94, 0x4e, 0xc6, 0x1f, 0x47, 0x83, 0x5e, 0x22, 0xd0, - 0x82, 0x42, 0xdc, 0xbb, 0x68, 0x4f, 0x5a, 0x06, 0x0a, 0x33, 0x9e, 0x82, 0xde, 0xb6, 0x5b, 0x38, - 0xdb, 0xb6, 0x5b, 0x76, 0x0b, 0xef, 0x42, 0x31, 0xa1, 0x98, 0xb4, 0x8d, 0x4c, 0x05, 0x96, 0x32, - 0x0f, 0xea, 0xb8, 0x5d, 0x29, 0x2e, 0x25, 0x98, 0xa8, 0x9e, 0x8b, 0x34, 0x9d, 0xb3, 0xf0, 0x0a, - 0xc8, 0x40, 0xb7, 0x37, 0x55, 0xed, 0xcf, 0x4d, 0x15, 0x7d, 0x7a, 0xe3, 0xfa, 0xc2, 0x93, 0x57, - 0xf6, 0x94, 0xcd, 0x9b, 0x23, 0x8f, 0x8c, 0x14, 0x9f, 0x77, 0xf4, 0x5a, 0x72, 0x11, 0xf8, 0x84, - 0x37, 0xd5, 0x6f, 0x3d, 0x6d, 0xb8, 0x84, 0x36, 0x5c, 0xd6, 0x08, 0xb9, 0x35, 0x43, 0x6e, 0x57, - 0x39, 0x75, 0xf0, 0xea, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4f, 0x66, 0x55, 0x7e, 0x45, 0x04, - 0x00, 0x00, + // 519 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x51, 0x6f, 0xd2, 0x50, + 0x14, 0xc7, 0x7b, 0xe9, 0x06, 0xf3, 0x20, 0x50, 0xef, 0x62, 0x52, 0x48, 0xc4, 0x4a, 0x7c, 0x58, + 0x48, 0x28, 0x74, 0x46, 0xcd, 0x96, 0xbd, 0x8c, 0x65, 0x11, 0x33, 0x01, 0x53, 0x61, 0x4b, 0x7c, + 0x21, 0x1d, 0xbb, 0xb6, 0x35, 0x70, 0x2f, 0xe9, 0xbd, 0xd5, 0xaf, 0xe0, 0x87, 0xf0, 0x4d, 0x9f, + 0x78, 0xf2, 0x33, 0xed, 0x69, 0xe1, 0xc9, 0x8f, 0x60, 0xb8, 0x2d, 0xd0, 0xe9, 0x92, 0xd5, 0xb7, + 0xd3, 0x73, 0xff, 0xff, 0xff, 0x3d, 0xfd, 0x9d, 0x16, 0xf2, 0x84, 0x86, 0x53, 0x6e, 0xce, 0x02, + 0x26, 0x18, 0xde, 0x15, 0x1e, 0x11, 0x9e, 0x4f, 0x5d, 0x6e, 0x7e, 0xe6, 0x8c, 0x9a, 0x82, 0x70, + 0x51, 0x79, 0xe4, 0x50, 0xca, 0x84, 0x23, 0x7c, 0x46, 0x63, 0x5d, 0xe5, 0x89, 0x4f, 0x05, 0x09, + 0xa8, 0x33, 0x69, 0xba, 0xcc, 0x65, 0xb2, 0x27, 0xab, 0xe8, 0xb8, 0xf6, 0x1e, 0x4a, 0x27, 0x21, + 0x17, 0x6c, 0x7a, 0x4a, 0xc3, 0xe9, 0xb9, 0x33, 0x09, 0x09, 0x7e, 0x09, 0xdb, 0x5f, 0x96, 0x85, + 0x8e, 0x0c, 0xb4, 0x57, 0xdc, 0x7f, 0x6a, 0xde, 0x71, 0x93, 0xb9, 0x31, 0xd9, 0x91, 0xfa, 0x30, + 0xbb, 0x98, 0x97, 0x33, 0x3a, 0xaa, 0x7d, 0x57, 0x41, 0xeb, 0x12, 0xce, 0x1d, 0x97, 0x5c, 0xf8, + 0xc2, 0x5b, 0x4a, 0x38, 0x3e, 0x84, 0x5c, 0x40, 0xdc, 0x70, 0xe2, 0x04, 0x71, 0xaa, 0x71, 0x67, + 0xaa, 0x1d, 0x69, 0x64, 0xec, 0xca, 0x80, 0x8f, 0x60, 0x27, 0x2e, 0xb9, 0x9e, 0x31, 0xd4, 0x54, + 0xe6, 0xb5, 0x03, 0xbf, 0x86, 0xec, 0x58, 0xce, 0xaa, 0xab, 0xe9, 0x5e, 0x27, 0x96, 0xe3, 0x03, + 0xc8, 0x45, 0x15, 0xd7, 0xb7, 0xe4, 0xad, 0xf7, 0x3a, 0x57, 0x7a, 0x7c, 0x06, 0xc5, 0xaf, 0x81, + 0x33, 0x9b, 0x91, 0xab, 0x51, 0x7c, 0xf7, 0xb6, 0x81, 0xf6, 0xf2, 0xfb, 0xcf, 0xef, 0x49, 0x90, + 0xfc, 0xed, 0x42, 0xec, 0x8d, 0xfa, 0xb8, 0x0b, 0xa5, 0xdb, 0x61, 0x5c, 0xcf, 0x1a, 0x6a, 0xea, + 0xb4, 0xe2, 0xad, 0x34, 0x5e, 0xbb, 0x41, 0xf0, 0x38, 0xb1, 0x9e, 0x3e, 0x25, 0xec, 0x53, 0xb4, + 0xa3, 0xa3, 0xff, 0xde, 0x51, 0x47, 0xd9, 0x6c, 0xe9, 0x60, 0xcd, 0x39, 0x93, 0x8a, 0x73, 0x47, + 0x59, 0x93, 0xee, 0xfe, 0x83, 0x4b, 0x4d, 0x8f, 0xab, 0xa3, 0xfc, 0x05, 0xac, 0x9d, 0x8b, 0xbf, + 0xdf, 0xba, 0x0d, 0xf9, 0xc4, 0xb0, 0x78, 0x17, 0x4a, 0xf6, 0xe9, 0x9b, 0xe1, 0xbb, 0x63, 0x7b, + 0x34, 0xec, 0x9d, 0xf5, 0xfa, 0x17, 0x3d, 0x4d, 0xc1, 0x05, 0x78, 0xb0, 0x6a, 0x1e, 0x6b, 0x28, + 0xf9, 0xd8, 0xd6, 0x32, 0x15, 0x6d, 0x31, 0x2f, 0x6f, 0xed, 0x28, 0x86, 0xf2, 0xed, 0x47, 0x55, + 0xf9, 0xf5, 0xb3, 0xaa, 0xd4, 0x39, 0xc0, 0x66, 0x00, 0x8c, 0xa1, 0x78, 0x32, 0xfc, 0x30, 0xe8, + 0x77, 0x13, 0x89, 0xcf, 0x20, 0x1f, 0xf7, 0xce, 0xad, 0x51, 0x4b, 0x43, 0x32, 0xe4, 0x21, 0xa8, + 0x96, 0xd9, 0xc2, 0xdb, 0x96, 0xd9, 0x32, 0x5b, 0xb8, 0x0a, 0x85, 0x84, 0x64, 0x64, 0x69, 0x99, + 0x4a, 0x7e, 0x31, 0x2f, 0xe7, 0x40, 0x9e, 0x5b, 0x95, 0xe2, 0x62, 0x5e, 0x06, 0x1d, 0xd5, 0xb3, + 0x91, 0xaa, 0xdd, 0x91, 0x63, 0x20, 0x0d, 0xdd, 0x5c, 0x57, 0x95, 0xdf, 0xd7, 0x55, 0xf4, 0xf1, + 0x95, 0xeb, 0x0b, 0x2f, 0xbc, 0x34, 0xc7, 0x6c, 0xda, 0x1c, 0x78, 0x64, 0x20, 0x21, 0xbd, 0xa5, + 0x57, 0x21, 0x17, 0x81, 0x4f, 0x78, 0x53, 0xfe, 0xdc, 0xe3, 0x86, 0x4b, 0x68, 0xc3, 0x65, 0x8d, + 0x25, 0xbc, 0xe6, 0x12, 0xde, 0x65, 0x56, 0x1e, 0xbc, 0xf8, 0x13, 0x00, 0x00, 0xff, 0xff, 0x19, + 0x9f, 0x31, 0xfc, 0x4b, 0x04, 0x00, 0x00, } func (x CustomEnum) String() string { diff --git a/test/gogo/gogo.pb.go b/test/gogo/gogo.pb.go index 1fd18f1b..023cb821 100644 --- a/test/gogo/gogo.pb.go +++ b/test/gogo/gogo.pb.go @@ -314,51 +314,51 @@ func init() { proto.RegisterFile("gogo.proto", fileDescriptor_592445b5231bc2b9) var fileDescriptor_592445b5231bc2b9 = []byte{ // 749 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x95, 0x3f, 0x4f, 0xdb, 0x4c, - 0x1c, 0xc7, 0xb1, 0x13, 0x20, 0xb9, 0x30, 0xc0, 0xf1, 0x47, 0x21, 0x08, 0x1c, 0x85, 0x05, 0x3d, - 0x12, 0xce, 0x23, 0x9e, 0x47, 0x3c, 0x7a, 0x8a, 0xd4, 0x8a, 0xb4, 0x21, 0x8d, 0x54, 0x52, 0x29, - 0x24, 0xa2, 0x62, 0xb1, 0x6c, 0x7c, 0xd8, 0xae, 0xe2, 0xbb, 0xc8, 0x77, 0xa7, 0x8a, 0xb9, 0xea, - 0xd0, 0xad, 0x43, 0x87, 0x4e, 0x5d, 0xfa, 0x12, 0xaa, 0x6e, 0x7d, 0x01, 0xed, 0xd6, 0xb9, 0x43, - 0x2a, 0xd1, 0x8d, 0x97, 0xd0, 0xa9, 0xba, 0x8b, 0x63, 0x27, 0x4d, 0x80, 0x02, 0x19, 0x3a, 0xfa, - 0x7e, 0xf7, 0xfb, 0xf8, 0x7b, 0x1f, 0x5f, 0x7e, 0x01, 0xc0, 0x21, 0x0e, 0xd1, 0xdb, 0x01, 0x61, - 0x04, 0xce, 0x33, 0x17, 0x31, 0xd7, 0xc3, 0x0e, 0xd5, 0x9f, 0x52, 0x82, 0x75, 0x86, 0x28, 0xcb, - 0xcd, 0x99, 0x18, 0x13, 0x66, 0x32, 0x8f, 0x60, 0xda, 0xdd, 0x97, 0x5b, 0xf5, 0x30, 0x43, 0x01, - 0x36, 0x5b, 0x45, 0xd1, 0x2c, 0xd7, 0x8a, 0x31, 0x26, 0xb7, 0xe6, 0x10, 0xe2, 0xb4, 0x50, 0x51, - 0x3e, 0x59, 0xfc, 0xa4, 0x68, 0xf3, 0x40, 0xf6, 0x87, 0x75, 0xed, 0xd7, 0x3a, 0xf3, 0x7c, 0x44, - 0x99, 0xe9, 0xb7, 0xbb, 0x1b, 0x0a, 0xcf, 0x33, 0x60, 0x69, 0x1f, 0x51, 0x6a, 0x3a, 0xe8, 0xd0, - 0x63, 0x6e, 0x85, 0x54, 0xc8, 0xe3, 0xb6, 0x0c, 0x00, 0xf7, 0xc0, 0x02, 0xe2, 0x9e, 0xf1, 0xcc, - 0x63, 0xae, 0x71, 0xcc, 0x29, 0x23, 0xbe, 0x81, 0x4d, 0x1f, 0x65, 0x95, 0xbc, 0xb2, 0x31, 0x53, - 0x5a, 0x3c, 0xeb, 0x68, 0x73, 0xe5, 0x66, 0x55, 0x74, 0xdd, 0x97, 0xd5, 0x9a, 0xe9, 0xa3, 0xfa, - 0x1c, 0xe2, 0xde, 0xe0, 0x12, 0xfc, 0xa8, 0x82, 0xd5, 0x51, 0x20, 0xc3, 0xc4, 0xb6, 0xc1, 0x4e, - 0xdb, 0x28, 0xab, 0x4a, 0xe2, 0x0f, 0xe5, 0x9c, 0xbf, 0x56, 0x40, 0xc5, 0xf1, 0x98, 0xcb, 0x2d, - 0xfd, 0x98, 0xf8, 0xc5, 0x86, 0x8b, 0x1a, 0x52, 0x52, 0x15, 0xdb, 0x9c, 0xb2, 0xc0, 0x43, 0xb4, - 0x7b, 0x94, 0xe3, 0x4d, 0x07, 0xe1, 0x4d, 0x87, 0x6c, 0x0a, 0x79, 0x45, 0x21, 0xaf, 0x28, 0x48, - 0x54, 0xdf, 0x37, 0x03, 0xea, 0x9a, 0xad, 0x87, 0xe5, 0x27, 0xb0, 0x7a, 0x2b, 0x50, 0x13, 0xfb, - 0x11, 0xea, 0x6b, 0x47, 0x2b, 0xdd, 0x0a, 0x56, 0x6e, 0x56, 0xb7, 0xff, 0x3d, 0xeb, 0x68, 0xd9, - 0x21, 0x61, 0xbb, 0xd8, 0x6e, 0x9c, 0xb6, 0x51, 0x3d, 0x3b, 0xe4, 0x2d, 0xac, 0xc0, 0xef, 0x2a, - 0xf8, 0x0b, 0x13, 0x6c, 0x60, 0xde, 0x6a, 0x99, 0x56, 0x0b, 0x19, 0x97, 0xbb, 0x4c, 0x48, 0x97, - 0x2f, 0xd5, 0x3f, 0xd5, 0xe5, 0xa7, 0x8e, 0x36, 0x31, 0x36, 0x9f, 0xeb, 0x35, 0x82, 0x6b, 0xa1, - 0x97, 0x0b, 0xd5, 0xae, 0xe3, 0xbe, 0x4d, 0x17, 0x59, 0xfe, 0xac, 0x82, 0x35, 0xc4, 0x3d, 0x7a, - 0x89, 0xd9, 0x64, 0x3e, 0xb1, 0x31, 0x53, 0x7a, 0xa1, 0x9e, 0xf3, 0xb7, 0x0a, 0x78, 0x34, 0x26, - 0xb3, 0xbb, 0x41, 0x60, 0x9e, 0xc2, 0xda, 0xd8, 0xf4, 0x4a, 0xde, 0xd8, 0xfc, 0x2e, 0x97, 0x9b, - 0x55, 0x3a, 0xda, 0xea, 0xb2, 0xb0, 0x35, 0xda, 0xe5, 0x0e, 0x48, 0xf5, 0xc6, 0x50, 0x76, 0x32, - 0xaf, 0x6c, 0x64, 0xb6, 0x96, 0xf5, 0xee, 0x1c, 0xd2, 0x7b, 0x73, 0x48, 0x7f, 0x10, 0x6e, 0x28, - 0x25, 0xdf, 0x7c, 0xd3, 0x94, 0x7a, 0xd4, 0x00, 0x0f, 0xc1, 0xe2, 0xc0, 0x6d, 0x8f, 0x48, 0x53, - 0x57, 0x91, 0x52, 0xe2, 0x6a, 0x49, 0xda, 0x7c, 0xdf, 0x17, 0xef, 0x95, 0xe1, 0x5d, 0x90, 0x8e, - 0x86, 0x5f, 0x76, 0x5a, 0xc2, 0x72, 0x43, 0xb0, 0x46, 0x6f, 0x47, 0x29, 0xf9, 0x4a, 0x90, 0xe2, - 0x16, 0x78, 0x04, 0x96, 0x06, 0x82, 0xc5, 0xb0, 0xd4, 0x95, 0x30, 0x19, 0x4d, 0x02, 0x17, 0xfa, - 0xa2, 0x45, 0xf5, 0x42, 0x01, 0x80, 0x03, 0x6e, 0x85, 0x73, 0x18, 0x2e, 0x80, 0xc9, 0x13, 0x0f, - 0xb5, 0x6c, 0x39, 0x69, 0xd3, 0xf5, 0xee, 0x43, 0xa1, 0x02, 0x56, 0xe2, 0x3d, 0x42, 0x3c, 0xe1, - 0x2c, 0xbc, 0x47, 0x28, 0xa0, 0x50, 0x03, 0x19, 0xc2, 0x5c, 0x14, 0x18, 0xfd, 0xad, 0x40, 0x2e, - 0xed, 0x89, 0x95, 0x3b, 0xd3, 0xe7, 0x3c, 0x99, 0x9a, 0x98, 0x9d, 0x28, 0x7c, 0x50, 0xc1, 0x7c, - 0x1f, 0xa6, 0x97, 0x06, 0xfe, 0x07, 0x12, 0x94, 0x5b, 0xb2, 0x33, 0xb3, 0xa5, 0xe9, 0x23, 0xfe, - 0xa0, 0xf4, 0x38, 0x40, 0x29, 0x29, 0x8e, 0x54, 0x17, 0x1d, 0xf0, 0x7f, 0x90, 0xa4, 0xdc, 0xa2, - 0x59, 0x35, 0x9f, 0xf8, 0xfd, 0x4e, 0xd9, 0x02, 0x0f, 0x40, 0xba, 0x9b, 0x5a, 0xbc, 0x39, 0x21, - 0xdf, 0xfc, 0xf7, 0x15, 0xfd, 0x43, 0x47, 0x0f, 0x81, 0x29, 0x09, 0x3a, 0xe0, 0x16, 0x6c, 0x02, - 0x10, 0x41, 0xa9, 0xfc, 0xd9, 0xde, 0x9c, 0x9a, 0xee, 0x51, 0x69, 0xe1, 0x9d, 0x32, 0xe0, 0xad, - 0xec, 0x5b, 0xc8, 0xb6, 0x91, 0x7d, 0x5d, 0x6f, 0x5f, 0x3a, 0x9a, 0xd2, 0xf5, 0x36, 0x70, 0x78, - 0xf5, 0xa6, 0x87, 0x97, 0xbc, 0xe8, 0xf0, 0x85, 0xf7, 0x0a, 0x58, 0x19, 0xf1, 0x75, 0xa3, 0xb4, - 0x3b, 0xd7, 0x4a, 0x2b, 0x2f, 0x6e, 0x9c, 0xf8, 0x70, 0x1c, 0x89, 0x63, 0x66, 0x94, 0xba, 0x74, - 0x4f, 0x5c, 0x4e, 0x65, 0x56, 0x39, 0xda, 0xbe, 0xd9, 0xdc, 0xb2, 0xa6, 0x64, 0xe1, 0x9f, 0x9f, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x89, 0x8f, 0x06, 0x40, 0x64, 0x09, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x95, 0x3f, 0x4f, 0xdb, 0x4e, + 0x18, 0xc7, 0xb1, 0x13, 0xf8, 0x25, 0x17, 0x06, 0x38, 0xfe, 0x28, 0x09, 0x02, 0x47, 0x61, 0x41, + 0x3f, 0x09, 0xa7, 0xa2, 0x15, 0x55, 0x8b, 0x54, 0x95, 0xb4, 0x01, 0x22, 0x95, 0x54, 0x0a, 0x89, + 0xa8, 0x58, 0x2c, 0x1b, 0x1f, 0xb6, 0xab, 0xf8, 0x2e, 0xf2, 0xdd, 0xa9, 0xe2, 0x0d, 0x30, 0x74, + 0xea, 0xd0, 0xa1, 0x53, 0x97, 0x6e, 0xac, 0x55, 0xc7, 0xee, 0x55, 0xa7, 0xce, 0x1d, 0x52, 0x09, + 0x75, 0xe2, 0x2d, 0x74, 0xa9, 0xee, 0x92, 0xd8, 0x49, 0x13, 0xa0, 0x40, 0x86, 0x8e, 0xbe, 0xe7, + 0x9e, 0x8f, 0xbf, 0xf7, 0xf1, 0xe5, 0x09, 0x00, 0x0e, 0x71, 0x88, 0xde, 0x0c, 0x08, 0x23, 0x70, + 0x86, 0xb9, 0x88, 0xb9, 0x1e, 0x76, 0xa8, 0xfe, 0x92, 0x12, 0xac, 0x33, 0x44, 0x59, 0x76, 0xda, + 0xc4, 0x98, 0x30, 0x93, 0x79, 0x04, 0xd3, 0xf6, 0xbe, 0xec, 0xa2, 0x87, 0x19, 0x0a, 0xb0, 0xd9, + 0x28, 0x88, 0x66, 0xb9, 0x56, 0x88, 0x30, 0xd9, 0x25, 0x87, 0x10, 0xa7, 0x81, 0x0a, 0xf2, 0xc9, + 0xe2, 0x47, 0x05, 0x9b, 0x07, 0xb2, 0xbf, 0x53, 0xd7, 0xfe, 0xac, 0x33, 0xcf, 0x47, 0x94, 0x99, + 0x7e, 0xb3, 0xbd, 0x21, 0x7f, 0x92, 0x02, 0xf3, 0xbb, 0x88, 0x52, 0xd3, 0x41, 0xfb, 0x1e, 0x73, + 0xb7, 0xc9, 0x36, 0x79, 0xde, 0x94, 0x01, 0xe0, 0x16, 0x98, 0x45, 0xdc, 0x33, 0x5e, 0x79, 0xcc, + 0x35, 0x0e, 0x39, 0x65, 0xc4, 0x37, 0xb0, 0xe9, 0xa3, 0xb4, 0x92, 0x53, 0x56, 0x26, 0x8b, 0x73, + 0x67, 0x2d, 0x6d, 0xba, 0x54, 0x2f, 0x8b, 0xae, 0x27, 0xb2, 0x5a, 0x31, 0x7d, 0x54, 0x9d, 0x46, + 0xdc, 0xeb, 0x5f, 0x82, 0x9f, 0x55, 0xb0, 0x38, 0x0c, 0x64, 0x98, 0xd8, 0x36, 0xd8, 0x71, 0x13, + 0xa5, 0x55, 0x49, 0xfc, 0xa5, 0x9c, 0x9f, 0x66, 0xde, 0x2a, 0x60, 0xdb, 0xf1, 0x98, 0xcb, 0x2d, + 0xfd, 0x90, 0xf8, 0x85, 0x9a, 0x8b, 0x6a, 0xd2, 0x52, 0x19, 0xdb, 0x9c, 0xb2, 0xc0, 0x43, 0xb4, + 0x7d, 0x96, 0xc3, 0x55, 0x07, 0xe1, 0x55, 0x87, 0xac, 0x0a, 0x7b, 0x05, 0x61, 0xaf, 0x20, 0x50, + 0x54, 0xdf, 0x35, 0x03, 0xea, 0x9a, 0x8d, 0x9d, 0xd2, 0x0b, 0x58, 0xbe, 0x15, 0xa8, 0x8e, 0xfd, + 0x10, 0xf5, 0xbd, 0xa5, 0x15, 0x6f, 0x05, 0x2b, 0xd5, 0xcb, 0xeb, 0xf7, 0xce, 0x5a, 0x5a, 0x7a, + 0xc0, 0xd8, 0x26, 0xb6, 0x6b, 0xc7, 0x4d, 0x54, 0x4d, 0x0f, 0x88, 0xeb, 0x54, 0xe0, 0x4f, 0x15, + 0xfc, 0x8f, 0x09, 0x36, 0x30, 0x6f, 0x34, 0x4c, 0xab, 0x81, 0x8c, 0xcb, 0x65, 0xc6, 0xa4, 0xcc, + 0xd7, 0xea, 0x3f, 0x2b, 0xf3, 0x4b, 0x4b, 0x1b, 0x1b, 0x99, 0xd0, 0xe5, 0x0a, 0xc1, 0x95, 0x8e, + 0x98, 0x0b, 0xdd, 0x2e, 0xe3, 0x9e, 0x4d, 0x17, 0x69, 0xfe, 0xaa, 0x82, 0x25, 0xc4, 0x3d, 0x7a, + 0x89, 0xda, 0x78, 0x2e, 0xb6, 0x32, 0x59, 0x3c, 0x11, 0x6a, 0xdf, 0x2b, 0xe0, 0xd9, 0x88, 0xd4, + 0x6e, 0x06, 0x81, 0x79, 0x0c, 0x2b, 0x23, 0xf3, 0x2b, 0x79, 0x23, 0x13, 0x9c, 0x29, 0xd5, 0xcb, + 0x74, 0xb8, 0xd6, 0x8c, 0xd0, 0x35, 0x5c, 0xe6, 0x06, 0x48, 0x74, 0x27, 0x51, 0x7a, 0x3c, 0xa7, + 0xac, 0xa4, 0xd6, 0x32, 0x7a, 0x7b, 0x14, 0xe9, 0xdd, 0x51, 0xa4, 0x3f, 0xed, 0x6c, 0x28, 0xc6, + 0xdf, 0xfd, 0xd0, 0x94, 0x6a, 0xd8, 0x00, 0xf7, 0xc1, 0x5c, 0xdf, 0x7d, 0x0f, 0x49, 0x13, 0x57, + 0x91, 0x12, 0xe2, 0x6e, 0x49, 0xda, 0x4c, 0xcf, 0x27, 0xef, 0x96, 0xe1, 0x23, 0x90, 0x0c, 0xe7, + 0x5f, 0xfa, 0x3f, 0x09, 0xcb, 0x0e, 0xc0, 0x6a, 0xdd, 0x1d, 0xc5, 0xf8, 0x1b, 0x41, 0x8a, 0x5a, + 0xe0, 0x01, 0x98, 0xef, 0x0b, 0x16, 0xc1, 0x12, 0x57, 0xc2, 0x64, 0x34, 0x09, 0x9c, 0xed, 0x89, + 0x16, 0xd6, 0xf3, 0x79, 0x00, 0xf6, 0xb8, 0xd5, 0x19, 0xc5, 0x70, 0x16, 0x8c, 0x1f, 0x79, 0xa8, + 0x61, 0xcb, 0x61, 0x9b, 0xac, 0xb6, 0x1f, 0xf2, 0x3b, 0x60, 0x21, 0xda, 0x23, 0xc4, 0x13, 0xce, + 0x3a, 0xf7, 0x08, 0x05, 0x14, 0x6a, 0x20, 0x45, 0x98, 0x8b, 0x02, 0xa3, 0xb7, 0x15, 0xc8, 0xa5, + 0x2d, 0xb1, 0xf2, 0x30, 0x71, 0x7e, 0x9a, 0x89, 0x27, 0xc6, 0xa6, 0xc6, 0xf2, 0x9f, 0x54, 0x30, + 0xd3, 0xc3, 0xe9, 0xc6, 0x81, 0xf7, 0x41, 0x8c, 0x72, 0x4b, 0xb6, 0xa6, 0xd6, 0x34, 0x7d, 0xc8, + 0x9f, 0x94, 0x1e, 0x25, 0x28, 0xc6, 0xc5, 0x99, 0xaa, 0xa2, 0x03, 0x3e, 0x00, 0x71, 0xca, 0x2d, + 0x9a, 0x56, 0x73, 0xb1, 0xbf, 0xef, 0x94, 0x2d, 0x70, 0x0f, 0x24, 0xdb, 0xb1, 0xc5, 0x9b, 0x63, + 0xf2, 0xcd, 0x77, 0xae, 0xe8, 0x1f, 0x38, 0x7b, 0x07, 0x98, 0x90, 0xa0, 0x3d, 0x6e, 0xc1, 0x3a, + 0x00, 0x21, 0x94, 0xca, 0x1f, 0xee, 0xcd, 0xa9, 0xc9, 0x2e, 0x95, 0xe6, 0x3f, 0x28, 0x7d, 0xde, + 0x4a, 0xbe, 0x85, 0x6c, 0x1b, 0xd9, 0xd7, 0xf5, 0xf6, 0xad, 0xa5, 0x29, 0x6d, 0x6f, 0x7d, 0x87, + 0x57, 0x6f, 0x7a, 0x78, 0xc9, 0x0b, 0x0f, 0x9f, 0xff, 0xa8, 0x80, 0x85, 0x21, 0x5f, 0x37, 0x4c, + 0xbb, 0x71, 0xad, 0xb4, 0xf2, 0xe6, 0x46, 0x89, 0xf7, 0x47, 0x91, 0x38, 0x62, 0x86, 0xa9, 0x8b, + 0x8f, 0xe5, 0xed, 0x54, 0xa6, 0x94, 0x83, 0xf5, 0x9b, 0x4d, 0x2e, 0x6b, 0x42, 0x16, 0xee, 0xfe, + 0x0e, 0x00, 0x00, 0xff, 0xff, 0x09, 0xd2, 0xc6, 0xb8, 0x69, 0x09, 0x00, 0x00, } diff --git a/test/gogo/scalars.pb.go b/test/gogo/scalars.pb.go index 5e2f99ed..3e778236 100644 --- a/test/gogo/scalars.pb.go +++ b/test/gogo/scalars.pb.go @@ -810,94 +810,94 @@ func init() { func init() { proto.RegisterFile("scalars.proto", fileDescriptor_5d1bcd1a4bdfc194) } var fileDescriptor_5d1bcd1a4bdfc194 = []byte{ - // 1413 bytes of a gzipped FileDescriptorProto + // 1416 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x59, 0xed, 0x6e, 0xdb, 0x36, - 0x17, 0x8e, 0x2c, 0x7f, 0x52, 0x92, 0x3f, 0x94, 0xa4, 0x55, 0xd3, 0xb7, 0x6f, 0x99, 0x64, 0xc3, - 0xf8, 0x27, 0x0e, 0xd0, 0x1a, 0xc6, 0x30, 0x60, 0x6b, 0x9b, 0x75, 0x43, 0xfa, 0x23, 0x18, 0x40, + 0x17, 0x8e, 0x2c, 0x7f, 0x52, 0x92, 0x3f, 0x94, 0xa4, 0x55, 0xd3, 0xb7, 0x6f, 0x99, 0x66, 0xc3, + 0xf8, 0x27, 0x0e, 0xd0, 0x1a, 0xc6, 0x30, 0x60, 0x5b, 0x9a, 0x75, 0x43, 0xfa, 0x23, 0x18, 0x40, 0xb7, 0x1b, 0xb0, 0x3f, 0x85, 0x9d, 0xc8, 0x1f, 0xab, 0x2b, 0x65, 0xa1, 0x34, 0x2c, 0x97, 0xb2, - 0x7b, 0xda, 0x6e, 0x64, 0x57, 0x31, 0x90, 0xa2, 0x24, 0x92, 0x62, 0x22, 0xcb, 0xf9, 0xd7, 0x1e, - 0x1d, 0x3c, 0xcf, 0x73, 0xf8, 0x9c, 0x73, 0x48, 0x23, 0xc0, 0x21, 0x97, 0xd3, 0xf5, 0xf4, 0x86, - 0x0c, 0xaf, 0x6f, 0xc2, 0x28, 0x74, 0x77, 0xa3, 0xa5, 0x1f, 0x2d, 0x57, 0xc1, 0x82, 0x0c, 0x7f, - 0x23, 0x61, 0x30, 0x8c, 0x7c, 0x12, 0x1d, 0x0c, 0xa6, 0x41, 0x10, 0x46, 0xd3, 0x68, 0x15, 0x06, - 0x3c, 0xef, 0xe8, 0xef, 0x36, 0x70, 0x2f, 0x7c, 0x42, 0xa6, 0x0b, 0xff, 0x97, 0x55, 0xb4, 0x9c, - 0x24, 0x20, 0xee, 0x21, 0xb0, 0xaf, 0xc2, 0x78, 0xb6, 0xf6, 0x3f, 0xfe, 0x31, 0x5d, 0xc7, 0xbe, - 0x67, 0x40, 0x03, 0x19, 0xd8, 0x4a, 0x62, 0x3f, 0xd3, 0x90, 0x7b, 0x0c, 0x1c, 0x31, 0x85, 0x78, - 0x35, 0x68, 0x22, 0x03, 0xdb, 0x42, 0x0e, 0x71, 0x9f, 0x03, 0x6b, 0xbe, 0x0e, 0xa7, 0x11, 0x87, - 0x31, 0xa1, 0x81, 0x6a, 0x18, 0xb0, 0x50, 0x82, 0x72, 0x08, 0x6c, 0x21, 0x81, 0x78, 0x75, 0x68, - 0xa2, 0x1a, 0xb6, 0xf2, 0x0c, 0x86, 0xb1, 0x0a, 0xa2, 0x97, 0x2f, 0x38, 0x46, 0x03, 0x1a, 0xa8, - 0x81, 0x01, 0x0b, 0x65, 0x18, 0x42, 0x02, 0xf1, 0x9a, 0xd0, 0x44, 0x0d, 0x6c, 0xe5, 0x19, 0x29, - 0xc6, 0x78, 0xc4, 0x31, 0x5a, 0xd0, 0x40, 0x26, 0xc3, 0x18, 0x8f, 0x44, 0x8c, 0x34, 0x81, 0x78, - 0x6d, 0x68, 0x22, 0x13, 0x5b, 0x79, 0x06, 0x3b, 0x93, 0x58, 0x14, 0xd2, 0x81, 0x06, 0x72, 0xb0, - 0x15, 0x0b, 0x4a, 0x8e, 0x81, 0x13, 0x4b, 0x52, 0x00, 0x34, 0x91, 0x83, 0xed, 0x58, 0xd4, 0xc2, - 0x71, 0x32, 0x31, 0x16, 0x34, 0x50, 0x3d, 0xc1, 0x49, 0xd5, 0x70, 0x9c, 0x5c, 0x8e, 0x0d, 0x4d, - 0x54, 0xc7, 0x76, 0xac, 0xe8, 0x21, 0xa2, 0x1e, 0x07, 0x1a, 0x68, 0x80, 0x2d, 0x22, 0xeb, 0x21, - 0x92, 0x9e, 0x2e, 0x34, 0xd1, 0x00, 0xdb, 0x44, 0xd1, 0x43, 0x44, 0x3d, 0x3d, 0x68, 0x20, 0x37, - 0xc1, 0x11, 0xf4, 0x10, 0x49, 0x4f, 0x1f, 0x9a, 0xc8, 0xc5, 0x36, 0x11, 0xf5, 0x1c, 0x03, 0x67, - 0xbe, 0xfa, 0xd3, 0xbf, 0xca, 0x04, 0x0d, 0xa0, 0x81, 0x5a, 0xd8, 0xe6, 0xc1, 0x04, 0xe9, 0x4b, - 0xd0, 0x95, 0x92, 0x88, 0xe7, 0x42, 0x13, 0xb5, 0xb0, 0x23, 0x66, 0xe5, 0x58, 0x99, 0xa8, 0x5d, - 0x68, 0xa0, 0x26, 0xc7, 0x4a, 0x55, 0xa5, 0x58, 0xb9, 0xac, 0x3d, 0x68, 0xa2, 0x26, 0x76, 0xc4, - 0x2c, 0x42, 0xd3, 0x88, 0x2c, 0x6c, 0x1f, 0x1a, 0xa8, 0x87, 0x1d, 0x22, 0x29, 0xfb, 0x0a, 0xf4, - 0x88, 0x22, 0xed, 0x11, 0x34, 0x51, 0x0f, 0x77, 0x89, 0xac, 0x2d, 0xc3, 0xcb, 0xc4, 0x3d, 0x86, - 0x06, 0xea, 0xa7, 0x78, 0xa9, 0xba, 0x0c, 0x2f, 0x97, 0xe7, 0x41, 0x13, 0xf5, 0x71, 0x97, 0xc8, - 0xfa, 0x9e, 0x01, 0x30, 0x0b, 0xc3, 0x35, 0xc7, 0x7a, 0x02, 0x0d, 0xd4, 0xc6, 0x1d, 0x1a, 0x49, - 0x70, 0x9e, 0x03, 0x2b, 0xff, 0x4c, 0xbc, 0x03, 0x68, 0xa2, 0x36, 0x06, 0xd9, 0xf7, 0xc4, 0xbf, - 0xe8, 0x66, 0x15, 0x2c, 0x38, 0xc2, 0x53, 0x68, 0xa0, 0x0e, 0xb6, 0x92, 0x58, 0xee, 0x9f, 0x90, - 0x42, 0xbc, 0xff, 0x41, 0x13, 0x75, 0xb0, 0x2d, 0xe4, 0xb0, 0x19, 0x99, 0xdd, 0x46, 0x3e, 0xe1, - 0x30, 0xcf, 0xa0, 0x81, 0x6c, 0x0c, 0x58, 0x28, 0x9b, 0x11, 0x21, 0x81, 0x78, 0xff, 0x87, 0x26, - 0xb2, 0xb1, 0x95, 0x67, 0x90, 0xa3, 0x7f, 0xea, 0xe0, 0xb1, 0xb0, 0x4e, 0x7e, 0x0a, 0xfc, 0x70, - 0x9e, 0xee, 0x94, 0x63, 0xdd, 0x4e, 0x39, 0xdf, 0x91, 0xb7, 0xca, 0xa1, 0xbc, 0x30, 0x6a, 0x74, - 0x61, 0x9c, 0xef, 0x28, 0x2b, 0x43, 0xda, 0x07, 0x74, 0xa7, 0x34, 0x68, 0x8a, 0xb4, 0x11, 0xa4, - 0x71, 0xaf, 0xd3, 0x71, 0xe7, 0x29, 0x79, 0x4b, 0xcb, 0xd3, 0x4c, 0xd7, 0x8a, 0x43, 0xd5, 0xc8, - 0xf3, 0x2c, 0x8f, 0x6a, 0x93, 0x8e, 0x6a, 0x9a, 0x24, 0x20, 0x49, 0x73, 0x48, 0x97, 0xcb, 0x80, - 0x26, 0xc9, 0x93, 0x28, 0x0f, 0x59, 0x9b, 0x0e, 0x59, 0x9a, 0x94, 0x37, 0xb4, 0x32, 0x41, 0x74, - 0xc5, 0xb4, 0xce, 0x77, 0x0a, 0x33, 0xa4, 0x0c, 0x07, 0xa0, 0xc3, 0x91, 0xa5, 0xe5, 0x0d, 0xa8, - 0xf6, 0x3d, 0xdd, 0x34, 0xbd, 0xf3, 0x9d, 0x62, 0xe7, 0xab, 0x0d, 0x6d, 0xd3, 0x86, 0xce, 0x13, - 0x53, 0xc4, 0xe7, 0x52, 0xa7, 0xd2, 0x7d, 0xd3, 0x3e, 0xdf, 0x11, 0x7b, 0xf5, 0x58, 0x69, 0xc5, - 0x2e, 0x6d, 0x45, 0x56, 0xa5, 0xd0, 0x8c, 0x87, 0x72, 0x9f, 0xd1, 0x75, 0x63, 0x53, 0x73, 0xf2, - 0x3e, 0x3a, 0x6b, 0x81, 0x06, 0xfb, 0x78, 0xf4, 0xd7, 0x17, 0x60, 0xbf, 0x70, 0x3d, 0x5d, 0x4c, - 0xaf, 0x89, 0xfb, 0x09, 0x0c, 0x38, 0x15, 0x6f, 0xaa, 0xcf, 0xd3, 0x6b, 0xcf, 0x80, 0x26, 0xb2, - 0x5e, 0xbc, 0x1a, 0x6a, 0x2e, 0xbf, 0xa1, 0x16, 0x66, 0x38, 0x61, 0x18, 0x6f, 0x19, 0xc4, 0xc5, - 0xf4, 0xfa, 0x87, 0x20, 0xba, 0xb9, 0xc5, 0x3d, 0x22, 0x47, 0xdd, 0x25, 0xe8, 0x73, 0xb2, 0xa4, - 0x39, 0x29, 0x97, 0xc9, 0xb8, 0xbe, 0xab, 0xcc, 0xf5, 0x23, 0x45, 0xc8, 0xa8, 0xba, 0x44, 0x0a, - 0x0a, 0x4c, 0x49, 0x4b, 0x51, 0xa6, 0xc6, 0x96, 0x4c, 0xef, 0x28, 0x82, 0xca, 0x94, 0x06, 0x29, - 0x53, 0x42, 0xc1, 0xf9, 0x28, 0x53, 0xb3, 0x32, 0x13, 0x83, 0x4b, 0xe8, 0x72, 0xa6, 0x95, 0x14, - 0x94, 0x6b, 0x1a, 0x8f, 0x18, 0x53, 0x6b, 0xfb, 0x9a, 0xc6, 0x23, 0x4d, 0x4d, 0x2c, 0xc8, 0x6b, - 0x1a, 0x8f, 0xc4, 0x9a, 0xda, 0xdb, 0xd4, 0x34, 0x1e, 0x69, 0x6a, 0x12, 0x82, 0x42, 0xfb, 0xc5, - 0xb9, 0x51, 0x9d, 0x2d, 0xdb, 0xef, 0xc3, 0x4a, 0x72, 0x8a, 0xb7, 0x5f, 0x16, 0xa5, 0x64, 0x71, - 0xc1, 0x2b, 0x50, 0x99, 0xec, 0xc3, 0x4a, 0x63, 0x56, 0x2f, 0x56, 0xdc, 0x92, 0x2b, 0xe3, 0x76, - 0x59, 0x0f, 0xa8, 0x4c, 0xf0, 0x4b, 0xa8, 0x2c, 0x31, 0x8c, 0x57, 0x26, 0x3b, 0x66, 0x6f, 0x55, - 0x59, 0xc1, 0xb2, 0x5e, 0x7c, 0xa7, 0x67, 0x24, 0xf7, 0xcc, 0xd9, 0xb2, 0xb2, 0x89, 0xd6, 0xb3, - 0x89, 0xe8, 0x19, 0x29, 0x78, 0xd6, 0xad, 0x4e, 0xa6, 0xf5, 0x8c, 0xdc, 0xe9, 0x19, 0xc9, 0x3d, - 0xeb, 0x3d, 0xa0, 0xb2, 0xa2, 0x67, 0x13, 0xd1, 0x33, 0x52, 0xf0, 0xac, 0xbf, 0x55, 0x65, 0x45, - 0xcf, 0x88, 0xe2, 0x59, 0x00, 0xdc, 0x74, 0xf3, 0xf2, 0xab, 0x8c, 0xb2, 0x0d, 0x18, 0xdb, 0xeb, - 0xea, 0xbb, 0x37, 0xc1, 0xc8, 0xe8, 0xf8, 0x5e, 0xca, 0xc3, 0x94, 0x2f, 0x25, 0x12, 0xaa, 0x73, - 0x2b, 0xf3, 0x71, 0x48, 0xa5, 0xbc, 0xfe, 0x5c, 0x09, 0xab, 0xf5, 0x71, 0xeb, 0x76, 0x1f, 0x52, - 0x9f, 0xe0, 0x9d, 0x58, 0x5f, 0x62, 0x5e, 0x5a, 0x9f, 0xec, 0xde, 0xde, 0x76, 0xf5, 0x15, 0xec, - 0xeb, 0xcf, 0x95, 0xb0, 0xfb, 0x3b, 0xd8, 0x4d, 0x3b, 0x53, 0x34, 0x70, 0x9f, 0x11, 0xbe, 0xa9, - 0xde, 0x9b, 0x73, 0xc5, 0x41, 0xde, 0xf7, 0x42, 0x9c, 0x51, 0x6a, 0x3c, 0x7c, 0x54, 0x9d, 0x72, - 0xae, 0x35, 0x71, 0x40, 0x0a, 0x2e, 0xaa, 0x55, 0x72, 0x1b, 0x1f, 0x3f, 0xa8, 0x4a, 0xc1, 0x47, - 0xa9, 0xca, 0xc4, 0xc8, 0xac, 0x4a, 0xd9, 0x49, 0x6f, 0xcb, 0x2a, 0x0b, 0x56, 0x0e, 0x48, 0xc1, - 0x4b, 0x1f, 0xf0, 0x5d, 0xf0, 0x91, 0xbd, 0x02, 0x29, 0xdd, 0x13, 0x46, 0xf7, 0x6d, 0xe5, 0x0a, - 0xcf, 0xc2, 0x70, 0x9d, 0x51, 0xf1, 0xdf, 0x26, 0x3c, 0x46, 0x69, 0x18, 0xbe, 0x50, 0xd5, 0x41, - 0x65, 0x1a, 0x0a, 0xa6, 0x54, 0xe4, 0xcc, 0xc4, 0x98, 0xb8, 0x33, 0x73, 0xa2, 0xa7, 0xdb, 0xee, - 0x4c, 0x75, 0x8d, 0xc9, 0x51, 0xe1, 0x09, 0x94, 0x3c, 0x7d, 0x29, 0xd7, 0xb3, 0x2d, 0x9f, 0x40, - 0x67, 0x14, 0x41, 0x7d, 0x02, 0xa5, 0xc1, 0x83, 0x33, 0xb0, 0xa7, 0x7b, 0xd3, 0xba, 0x7d, 0x60, - 0x7e, 0xf2, 0x6f, 0xd9, 0x8f, 0xae, 0x0e, 0xa6, 0xff, 0x74, 0xf7, 0xf8, 0x23, 0x9b, 0xfd, 0xc8, - 0x32, 0x70, 0xf2, 0x9f, 0x6f, 0x6a, 0x5f, 0x1b, 0x07, 0x6f, 0xc0, 0xae, 0xe6, 0xad, 0x5a, 0x06, - 0x51, 0xd3, 0x42, 0x48, 0x8f, 0xd0, 0x32, 0x88, 0x86, 0x02, 0xa1, 0x79, 0x5d, 0x8a, 0x10, 0x0d, - 0x0d, 0x44, 0xe7, 0x2e, 0x15, 0xf9, 0x38, 0x95, 0xa9, 0x30, 0x8b, 0x2a, 0xd4, 0xf1, 0x10, 0x21, - 0xcc, 0x32, 0x15, 0x99, 0x25, 0xf2, 0x3b, 0xaf, 0x4c, 0x86, 0xa3, 0x60, 0xe8, 0x9e, 0x6f, 0x22, - 0x86, 0x53, 0x49, 0xc7, 0xe6, 0xc7, 0x51, 0xd7, 0xe8, 0xb8, 0xef, 0x3c, 0xea, 0x1b, 0xeb, 0x98, - 0x54, 0x3a, 0x8f, 0x81, 0x8a, 0x51, 0x72, 0x1e, 0x83, 0x4a, 0x3a, 0x36, 0x3f, 0x0f, 0x57, 0xa3, - 0xe3, 0xbe, 0xf3, 0x70, 0xcb, 0x74, 0x7c, 0x0f, 0xf6, 0xb5, 0xcf, 0x93, 0x32, 0x21, 0x2d, 0x05, - 0x44, 0xfb, 0xe6, 0x10, 0x41, 0x5a, 0xd5, 0x94, 0x6c, 0x7e, 0x24, 0x4d, 0x9d, 0x92, 0xfb, 0xce, - 0xa4, 0x59, 0xa6, 0xe4, 0x2d, 0x78, 0xa4, 0xbf, 0xf1, 0xcb, 0xa4, 0xf4, 0x54, 0x94, 0x79, 0xd9, - 0xa9, 0xf4, 0x2a, 0x6a, 0xd9, 0xfc, 0x58, 0xfa, 0x5a, 0x2d, 0xf7, 0x9d, 0x4b, 0xbf, 0x4c, 0xcb, - 0x6b, 0xe0, 0x16, 0x6f, 0xd0, 0x32, 0x1d, 0x6d, 0x05, 0xa1, 0x78, 0x39, 0x8a, 0x08, 0xed, 0xcd, - 0xe7, 0xe6, 0x4e, 0x8c, 0xce, 0xc6, 0x9b, 0x59, 0xba, 0xcd, 0xca, 0x20, 0x6c, 0x01, 0xe2, 0xec, - 0xd5, 0xbf, 0x71, 0xbd, 0x6d, 0xf4, 0x8d, 0x5f, 0xc7, 0x8b, 0x55, 0xb4, 0x8c, 0x67, 0xc3, 0xcb, - 0xf0, 0xf3, 0xe9, 0xfb, 0xa5, 0xff, 0x9e, 0x5d, 0xa6, 0xef, 0x82, 0xab, 0x98, 0x5e, 0x8d, 0x3e, - 0x39, 0x65, 0x7f, 0xe9, 0xb8, 0x3c, 0x59, 0xf8, 0xc1, 0xc9, 0x22, 0x3c, 0xa1, 0x97, 0xec, 0x29, - 0xbd, 0x64, 0x67, 0x4d, 0xf6, 0xe1, 0xe5, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe7, 0x32, 0x41, - 0x74, 0x3b, 0x19, 0x00, 0x00, + 0x5b, 0xd8, 0xb5, 0x6c, 0x37, 0xb2, 0xab, 0x18, 0x48, 0x51, 0x12, 0x49, 0x31, 0x91, 0xe5, 0xfc, + 0x6b, 0x8f, 0x0e, 0x9e, 0xe7, 0x39, 0x7c, 0xce, 0x39, 0xa4, 0x11, 0xe0, 0x90, 0xcb, 0xe9, 0x7a, + 0x7a, 0x43, 0x86, 0xd7, 0x37, 0x61, 0x14, 0xba, 0xbb, 0xd1, 0xd2, 0x8f, 0x96, 0xab, 0x60, 0x41, + 0x86, 0xbf, 0x92, 0x30, 0x18, 0x46, 0x3e, 0x89, 0x0e, 0x06, 0xd3, 0x20, 0x08, 0xa3, 0x69, 0xb4, + 0x0a, 0x03, 0x9e, 0xf7, 0xe2, 0xef, 0x36, 0x70, 0x2f, 0x7c, 0x42, 0xa6, 0x0b, 0xff, 0xe7, 0x55, + 0xb4, 0x9c, 0x24, 0x20, 0xee, 0x21, 0xb0, 0xaf, 0xc2, 0x78, 0xb6, 0xf6, 0x3f, 0xfc, 0x3e, 0x5d, + 0xc7, 0xbe, 0x67, 0x40, 0x03, 0x19, 0xd8, 0x4a, 0x62, 0x3f, 0xd1, 0x90, 0x7b, 0x04, 0x1c, 0x31, + 0x85, 0x78, 0x35, 0x68, 0x22, 0x03, 0xdb, 0x42, 0x0e, 0x71, 0x9f, 0x03, 0x6b, 0xbe, 0x0e, 0xa7, + 0x11, 0x87, 0x31, 0xa1, 0x81, 0x6a, 0x18, 0xb0, 0x50, 0x82, 0x72, 0x08, 0x6c, 0x21, 0x81, 0x78, + 0x75, 0x68, 0xa2, 0x1a, 0xb6, 0xf2, 0x0c, 0x86, 0xb1, 0x0a, 0xa2, 0x57, 0x2f, 0x39, 0x46, 0x03, + 0x1a, 0xa8, 0x81, 0x01, 0x0b, 0x65, 0x18, 0x42, 0x02, 0xf1, 0x9a, 0xd0, 0x44, 0x0d, 0x6c, 0xe5, + 0x19, 0x29, 0xc6, 0x78, 0xc4, 0x31, 0x5a, 0xd0, 0x40, 0x26, 0xc3, 0x18, 0x8f, 0x44, 0x8c, 0x34, + 0x81, 0x78, 0x6d, 0x68, 0x22, 0x13, 0x5b, 0x79, 0x06, 0x3b, 0x93, 0x58, 0x14, 0xd2, 0x81, 0x06, + 0x72, 0xb0, 0x15, 0x0b, 0x4a, 0x8e, 0x80, 0x13, 0x4b, 0x52, 0x00, 0x34, 0x91, 0x83, 0xed, 0x58, + 0xd4, 0xc2, 0x71, 0x32, 0x31, 0x16, 0x34, 0x50, 0x3d, 0xc1, 0x49, 0xd5, 0x70, 0x9c, 0x5c, 0x8e, + 0x0d, 0x4d, 0x54, 0xc7, 0x76, 0xac, 0xe8, 0x21, 0xa2, 0x1e, 0x07, 0x1a, 0x68, 0x80, 0x2d, 0x22, + 0xeb, 0x21, 0x92, 0x9e, 0x2e, 0x34, 0xd1, 0x00, 0xdb, 0x44, 0xd1, 0x43, 0x44, 0x3d, 0x3d, 0x68, + 0x20, 0x37, 0xc1, 0x11, 0xf4, 0x10, 0x49, 0x4f, 0x1f, 0x9a, 0xc8, 0xc5, 0x36, 0x11, 0xf5, 0x1c, + 0x01, 0x67, 0xbe, 0xfa, 0xc3, 0xbf, 0xca, 0x04, 0x0d, 0xa0, 0x81, 0x5a, 0xd8, 0xe6, 0xc1, 0x04, + 0xe9, 0x73, 0xd0, 0x95, 0x92, 0x88, 0xe7, 0x42, 0x13, 0xb5, 0xb0, 0x23, 0x66, 0xe5, 0x58, 0x99, + 0xa8, 0x5d, 0x68, 0xa0, 0x26, 0xc7, 0x4a, 0x55, 0xa5, 0x58, 0xb9, 0xac, 0x3d, 0x68, 0xa2, 0x26, + 0x76, 0xc4, 0x2c, 0x42, 0xd3, 0x88, 0x2c, 0x6c, 0x1f, 0x1a, 0xa8, 0x87, 0x1d, 0x22, 0x29, 0xfb, + 0x02, 0xf4, 0x88, 0x22, 0xed, 0x11, 0x34, 0x51, 0x0f, 0x77, 0x89, 0xac, 0x2d, 0xc3, 0xcb, 0xc4, + 0x3d, 0x86, 0x06, 0xea, 0xa7, 0x78, 0xa9, 0xba, 0x0c, 0x2f, 0x97, 0xe7, 0x41, 0x13, 0xf5, 0x71, + 0x97, 0xc8, 0xfa, 0x9e, 0x01, 0x30, 0x0b, 0xc3, 0x35, 0xc7, 0x7a, 0x02, 0x0d, 0xd4, 0xc6, 0x1d, + 0x1a, 0x49, 0x70, 0x9e, 0x03, 0x2b, 0xff, 0x4c, 0xbc, 0x03, 0x68, 0xa2, 0x36, 0x06, 0xd9, 0xf7, + 0xc4, 0xbf, 0xe8, 0x66, 0x15, 0x2c, 0x38, 0xc2, 0x53, 0x68, 0xa0, 0x0e, 0xb6, 0x92, 0x58, 0xee, + 0x9f, 0x90, 0x42, 0xbc, 0xff, 0x41, 0x13, 0x75, 0xb0, 0x2d, 0xe4, 0xb0, 0x19, 0x99, 0xdd, 0x46, + 0x3e, 0xe1, 0x30, 0xcf, 0xa0, 0x81, 0x6c, 0x0c, 0x58, 0x28, 0x9b, 0x11, 0x21, 0x81, 0x78, 0xff, + 0x87, 0x26, 0xb2, 0xb1, 0x95, 0x67, 0x90, 0x17, 0xff, 0xd4, 0xc1, 0x63, 0x61, 0x9d, 0xfc, 0x18, + 0xf8, 0xe1, 0x3c, 0xdd, 0x29, 0x47, 0xba, 0x9d, 0x72, 0xbe, 0x23, 0x6f, 0x95, 0x43, 0x79, 0x61, + 0xd4, 0xe8, 0xc2, 0x38, 0xdf, 0x51, 0x56, 0x86, 0xb4, 0x0f, 0xe8, 0x4e, 0x69, 0xd0, 0x14, 0x69, + 0x23, 0x48, 0xe3, 0x5e, 0xa7, 0xe3, 0xce, 0x53, 0xf2, 0x96, 0x96, 0xa7, 0x99, 0xae, 0x15, 0x87, + 0xaa, 0x91, 0xe7, 0x59, 0x1e, 0xd5, 0x26, 0x1d, 0xd5, 0x34, 0x49, 0x40, 0x92, 0xe6, 0x90, 0x2e, + 0x97, 0x01, 0x4d, 0x92, 0x27, 0x51, 0x1e, 0xb2, 0x36, 0x1d, 0xb2, 0x34, 0x29, 0x6f, 0x68, 0x65, + 0x82, 0xe8, 0x8a, 0x69, 0x9d, 0xef, 0x14, 0x66, 0x48, 0x19, 0x0e, 0x40, 0x87, 0x23, 0x4b, 0xcb, + 0x1b, 0x50, 0xed, 0x7b, 0xba, 0x69, 0x7a, 0xe7, 0x3b, 0xc5, 0xce, 0x57, 0x1b, 0xda, 0xa6, 0x0d, + 0x9d, 0x27, 0xa6, 0x88, 0xcf, 0xa5, 0x4e, 0xa5, 0xfb, 0xa6, 0x7d, 0xbe, 0x23, 0xf6, 0xea, 0x91, + 0xd2, 0x8a, 0x5d, 0xda, 0x8a, 0xac, 0x4a, 0xa1, 0x19, 0x0f, 0xe5, 0x3e, 0xa3, 0xeb, 0xc6, 0xa6, + 0xe6, 0xe4, 0x7d, 0x74, 0xd6, 0x02, 0x0d, 0xf6, 0xf1, 0xc5, 0x9f, 0x9f, 0x81, 0xfd, 0xc2, 0xf5, + 0x74, 0x31, 0xbd, 0x26, 0xee, 0x47, 0x30, 0xe0, 0x54, 0xbc, 0xa9, 0x3e, 0x4d, 0xaf, 0x3d, 0x03, + 0x9a, 0xc8, 0x7a, 0xf9, 0xed, 0x50, 0x73, 0xf9, 0x0d, 0xb5, 0x30, 0xc3, 0x09, 0xc3, 0x78, 0xc3, + 0x20, 0x2e, 0xa6, 0xd7, 0xdf, 0x07, 0xd1, 0xcd, 0x2d, 0xee, 0x11, 0x39, 0xea, 0x2e, 0x41, 0x9f, + 0x93, 0x25, 0xcd, 0x49, 0xb9, 0x4c, 0xc6, 0xf5, 0x4d, 0x65, 0xae, 0x1f, 0x28, 0x42, 0x46, 0xd5, + 0x25, 0x52, 0x50, 0x60, 0x4a, 0x5a, 0x8a, 0x32, 0x35, 0xb6, 0x64, 0x7a, 0x4b, 0x11, 0x54, 0xa6, + 0x34, 0x48, 0x99, 0x12, 0x0a, 0xce, 0x47, 0x99, 0x9a, 0x95, 0x99, 0x18, 0x5c, 0x42, 0x97, 0x33, + 0xad, 0xa4, 0xa0, 0x5c, 0xd3, 0x78, 0xc4, 0x98, 0x5a, 0xdb, 0xd7, 0x34, 0x1e, 0x69, 0x6a, 0x62, + 0x41, 0x5e, 0xd3, 0x78, 0x24, 0xd6, 0xd4, 0xde, 0xa6, 0xa6, 0xf1, 0x48, 0x53, 0x93, 0x10, 0x14, + 0xda, 0x2f, 0xce, 0x8d, 0xea, 0x6c, 0xd9, 0x7e, 0xef, 0x57, 0x92, 0x53, 0xbc, 0xfd, 0xb2, 0x28, + 0x25, 0x8b, 0x0b, 0x5e, 0x81, 0xca, 0x64, 0xef, 0x57, 0x1a, 0xb3, 0x7a, 0xb1, 0xe2, 0x96, 0x5c, + 0x19, 0xb7, 0xcb, 0x7a, 0x40, 0x65, 0x82, 0x5f, 0x42, 0x65, 0x89, 0x61, 0xbc, 0x32, 0xd9, 0x31, + 0x7b, 0xab, 0xca, 0x0a, 0x96, 0xf5, 0xe2, 0x3b, 0x3d, 0x23, 0xb9, 0x67, 0xce, 0x96, 0x95, 0x4d, + 0xb4, 0x9e, 0x4d, 0x44, 0xcf, 0x48, 0xc1, 0xb3, 0x6e, 0x75, 0x32, 0xad, 0x67, 0xe4, 0x4e, 0xcf, + 0x48, 0xee, 0x59, 0xef, 0x01, 0x95, 0x15, 0x3d, 0x9b, 0x88, 0x9e, 0x91, 0x82, 0x67, 0xfd, 0xad, + 0x2a, 0x2b, 0x7a, 0x46, 0x14, 0xcf, 0x02, 0xe0, 0xa6, 0x9b, 0x97, 0x5f, 0x65, 0x94, 0x6d, 0xc0, + 0xd8, 0x4e, 0xab, 0xef, 0xde, 0x04, 0x23, 0xa3, 0xe3, 0x7b, 0x29, 0x0f, 0x53, 0xbe, 0x94, 0x48, + 0xa8, 0xce, 0xad, 0xcc, 0xc7, 0x21, 0x95, 0xf2, 0xfa, 0x73, 0x25, 0xac, 0xd6, 0xc7, 0xad, 0xdb, + 0x7d, 0x48, 0x7d, 0x82, 0x77, 0x62, 0x7d, 0x89, 0x79, 0x69, 0x7d, 0xb2, 0x7b, 0x7b, 0xdb, 0xd5, + 0x57, 0xb0, 0xaf, 0x3f, 0x57, 0xc2, 0xee, 0x6f, 0x60, 0x37, 0xed, 0x4c, 0xd1, 0xc0, 0x7d, 0x46, + 0xf8, 0xba, 0x7a, 0x6f, 0xce, 0x15, 0x07, 0x79, 0xdf, 0x0b, 0x71, 0x46, 0xa9, 0xf1, 0xf0, 0x51, + 0x75, 0xca, 0xb9, 0xd6, 0xc4, 0x01, 0x29, 0xb8, 0xa8, 0x56, 0xc9, 0x6d, 0x7c, 0xfc, 0xa0, 0x2a, + 0x05, 0x1f, 0xa5, 0x2a, 0x13, 0x23, 0xb3, 0x2a, 0x65, 0x27, 0xbd, 0x2d, 0xab, 0x2c, 0x58, 0x39, + 0x20, 0x05, 0x2f, 0x7d, 0xc0, 0x77, 0xc1, 0x07, 0xf6, 0x0a, 0xa4, 0x74, 0x4f, 0x18, 0xdd, 0xd7, + 0x95, 0x2b, 0x3c, 0x0b, 0xc3, 0x75, 0x46, 0xc5, 0x7f, 0x9b, 0xf0, 0x18, 0xa5, 0x61, 0xf8, 0x42, + 0x55, 0x07, 0x95, 0x69, 0x28, 0x98, 0x52, 0x91, 0x33, 0x13, 0x63, 0xe2, 0xce, 0xcc, 0x89, 0x9e, + 0x6e, 0xbb, 0x33, 0xd5, 0x35, 0x26, 0x47, 0x85, 0x27, 0x50, 0xf2, 0xf4, 0xa5, 0x5c, 0xcf, 0xb6, + 0x7c, 0x02, 0x9d, 0x51, 0x04, 0xf5, 0x09, 0x94, 0x06, 0x0f, 0xce, 0xc0, 0x9e, 0xee, 0x4d, 0xeb, + 0xf6, 0x81, 0xf9, 0xd1, 0xbf, 0x65, 0x3f, 0xba, 0x3a, 0x98, 0xfe, 0xd3, 0xdd, 0xe3, 0x8f, 0x6c, + 0xf6, 0x23, 0xcb, 0xc0, 0xc9, 0x7f, 0xbe, 0xaa, 0x7d, 0x69, 0x1c, 0xbc, 0x06, 0xbb, 0x9a, 0xb7, + 0x6a, 0x19, 0x44, 0x4d, 0x0b, 0x21, 0x3d, 0x42, 0xcb, 0x20, 0x1a, 0x0a, 0x84, 0xe6, 0x75, 0x29, + 0x42, 0x34, 0x34, 0x10, 0x9d, 0xbb, 0x54, 0xe4, 0xe3, 0x54, 0xa6, 0xc2, 0x2c, 0xaa, 0x50, 0xc7, + 0x43, 0x84, 0x30, 0xcb, 0x54, 0x64, 0x96, 0xc8, 0xef, 0xbc, 0x32, 0x19, 0x8e, 0x82, 0xa1, 0x7b, + 0xbe, 0x89, 0x18, 0x4e, 0x25, 0x1d, 0x9b, 0x1f, 0x47, 0x5d, 0xa3, 0xe3, 0xbe, 0xf3, 0xa8, 0x6f, + 0xac, 0x63, 0x52, 0xe9, 0x3c, 0x06, 0x2a, 0x46, 0xc9, 0x79, 0x0c, 0x2a, 0xe9, 0xd8, 0xfc, 0x3c, + 0x5c, 0x8d, 0x8e, 0xfb, 0xce, 0xc3, 0x2d, 0xd3, 0xf1, 0x1d, 0xd8, 0xd7, 0x3e, 0x4f, 0xca, 0x84, + 0xb4, 0x14, 0x10, 0xed, 0x9b, 0x43, 0x04, 0x69, 0x55, 0x53, 0xb2, 0xf9, 0x91, 0x34, 0x75, 0x4a, + 0xee, 0x3b, 0x93, 0x66, 0x99, 0x92, 0x37, 0xe0, 0x91, 0xfe, 0xc6, 0x2f, 0x93, 0xd2, 0x53, 0x51, + 0xe6, 0x65, 0xa7, 0xd2, 0xab, 0xa8, 0x65, 0xf3, 0x63, 0xe9, 0x6b, 0xb5, 0xdc, 0x77, 0x2e, 0xfd, + 0x32, 0x2d, 0xa7, 0xc0, 0x2d, 0xde, 0xa0, 0x65, 0x3a, 0xda, 0x0a, 0x42, 0xf1, 0x72, 0x14, 0x11, + 0xda, 0x9b, 0xcf, 0xcd, 0x9d, 0x18, 0x9d, 0x8d, 0x37, 0xb3, 0x74, 0x9b, 0x95, 0x41, 0xd8, 0x02, + 0xc4, 0xd9, 0xe9, 0xbf, 0x7f, 0x3d, 0xa9, 0xb7, 0x8d, 0xbe, 0xf1, 0xcb, 0x78, 0xb1, 0x8a, 0x96, + 0xf1, 0x6c, 0x78, 0x19, 0x7e, 0x3a, 0x79, 0xb7, 0xf4, 0xdf, 0xb1, 0xdb, 0xf4, 0x6d, 0x70, 0x15, + 0xd3, 0xbb, 0xd1, 0x27, 0x27, 0xec, 0x4f, 0x1d, 0x97, 0xc7, 0x0b, 0x3f, 0x38, 0x5e, 0x84, 0xc7, + 0xf4, 0x96, 0x3d, 0xa1, 0xb7, 0xec, 0xac, 0xc9, 0x3e, 0xbc, 0xfa, 0x2f, 0x00, 0x00, 0xff, 0xff, + 0x6f, 0x91, 0x37, 0xde, 0x3c, 0x19, 0x00, 0x00, } diff --git a/test/gogo/wkts.pb.go b/test/gogo/wkts.pb.go index 4bdd4307..98b91aaf 100644 --- a/test/gogo/wkts.pb.go +++ b/test/gogo/wkts.pb.go @@ -866,107 +866,107 @@ func init() { func init() { proto.RegisterFile("wkts.proto", fileDescriptor_4f76f3479ade79d3) } var fileDescriptor_4f76f3479ade79d3 = []byte{ - // 1625 bytes of a gzipped FileDescriptorProto + // 1630 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x59, 0xed, 0x52, 0xdb, 0x46, - 0x14, 0x35, 0xe1, 0xcb, 0x5e, 0x19, 0x7f, 0x08, 0x12, 0x14, 0x27, 0x4d, 0x28, 0xbf, 0x3a, 0x9d, - 0x62, 0x92, 0xc0, 0xd0, 0x42, 0x18, 0x28, 0x34, 0x30, 0x64, 0x5a, 0xa6, 0x33, 0x2e, 0x34, 0xd3, - 0x8f, 0x29, 0x95, 0x8d, 0xb0, 0x5d, 0x6c, 0xc9, 0xf5, 0x4a, 0xc9, 0xf0, 0x08, 0x7d, 0xd5, 0x4c, - 0x9f, 0xa0, 0xbf, 0x3a, 0xbb, 0xba, 0xab, 0xbd, 0x2b, 0x69, 0xa5, 0xa0, 0x3f, 0x89, 0xbc, 0xbb, - 0xe7, 0x9e, 0x7b, 0x77, 0x57, 0xe7, 0xac, 0x16, 0x42, 0x3e, 0xdc, 0xfa, 0xb4, 0x3d, 0x99, 0x7a, - 0xbe, 0x67, 0x2e, 0xfb, 0x03, 0xc7, 0x1f, 0x0c, 0xdd, 0x3e, 0x6d, 0xff, 0x45, 0x3d, 0xb7, 0xed, - 0x3b, 0xd4, 0x6f, 0x35, 0x6d, 0xd7, 0xf5, 0x7c, 0xdb, 0x1f, 0x7a, 0x2e, 0x8c, 0x6b, 0x3d, 0xee, - 0x7b, 0x5e, 0x7f, 0xe4, 0x6c, 0xf2, 0x5f, 0xdd, 0xe0, 0x66, 0xd3, 0x76, 0xef, 0xa0, 0xeb, 0x59, - 0xbc, 0xeb, 0x3a, 0x98, 0x72, 0x2c, 0xf4, 0x3f, 0x89, 0xf7, 0x3b, 0xe3, 0x89, 0x2f, 0xc0, 0x6b, - 0xf1, 0xce, 0x9b, 0xa1, 0x33, 0xba, 0xbe, 0x1a, 0xdb, 0xf4, 0x16, 0x46, 0x3c, 0x8d, 0x8f, 0xa0, - 0xfe, 0x34, 0xe8, 0xf9, 0xd0, 0xfb, 0x3c, 0xde, 0xeb, 0x0f, 0xc7, 0x0e, 0xf5, 0xed, 0xf1, 0x44, - 0x97, 0xdd, 0x87, 0xa9, 0x3d, 0x99, 0x38, 0x53, 0x28, 0x6c, 0xfd, 0x05, 0x59, 0x39, 0x77, 0x28, - 0xb5, 0xfb, 0xce, 0xbb, 0xa1, 0x3f, 0x38, 0xb7, 0xa7, 0x74, 0x60, 0x8f, 0x9c, 0xa9, 0x69, 0x91, - 0xc5, 0x71, 0xd8, 0x6e, 0xcd, 0xac, 0xcd, 0x7c, 0x51, 0xe9, 0x88, 0x9f, 0xeb, 0xfb, 0x64, 0x15, - 0x21, 0xbc, 0xc0, 0xff, 0x04, 0xd0, 0xde, 0xe2, 0xc7, 0x60, 0xae, 0x5c, 0x6a, 0x94, 0xd6, 0xff, - 0x69, 0x92, 0x3a, 0x82, 0xbf, 0xfb, 0xfe, 0x82, 0x9a, 0x87, 0xa4, 0x7a, 0xed, 0x05, 0xdd, 0x91, - 0x73, 0xf5, 0xde, 0x1e, 0x05, 0x21, 0xd6, 0x78, 0xf5, 0xb4, 0x1d, 0xa6, 0xde, 0x16, 0xa9, 0xb7, - 0xdf, 0xf0, 0x41, 0x3f, 0xb3, 0x31, 0x1d, 0xe3, 0x5a, 0xfe, 0x30, 0x8f, 0xc8, 0x12, 0x0e, 0x40, - 0xad, 0x07, 0x6b, 0xb3, 0xb9, 0x11, 0xaa, 0x28, 0x02, 0x35, 0xf7, 0x89, 0x71, 0x33, 0xf2, 0x6c, - 0x1f, 0x52, 0x98, 0xe5, 0x29, 0x3c, 0x49, 0x04, 0x38, 0x65, 0x63, 0x42, 0x3c, 0xb9, 0x89, 0x9e, - 0xcd, 0x03, 0x52, 0x45, 0x68, 0x6a, 0xcd, 0x71, 0xfe, 0x4c, 0xb8, 0x21, 0xe1, 0x9c, 0x7d, 0xe8, - 0xfa, 0x5b, 0xaf, 0x80, 0x7d, 0x5e, 0xc3, 0xfe, 0x96, 0x8d, 0x01, 0xf6, 0x61, 0xf4, 0xcc, 0xd8, - 0x11, 0x9a, 0x5a, 0x0b, 0x1a, 0x76, 0x04, 0x37, 0x24, 0x5c, 0xb0, 0xef, 0x6c, 0x03, 0xfb, 0xa2, - 0x9e, 0x7d, 0x67, 0x5b, 0xb2, 0xc3, 0x33, 0xb0, 0x0b, 0x34, 0xb5, 0xca, 0x7a, 0x76, 0x01, 0x37, - 0x24, 0x9c, 0xaf, 0x7e, 0x80, 0x8b, 0xaf, 0x68, 0x56, 0xff, 0x12, 0xa7, 0x1f, 0xa0, 0xf2, 0x8f, - 0xc8, 0x52, 0xa0, 0xd4, 0x4f, 0x34, 0xab, 0x8f, 0x23, 0x54, 0x03, 0x3c, 0x03, 0x90, 0x43, 0x34, - 0x05, 0x46, 0x46, 0x0e, 0x51, 0x11, 0x01, 0x9a, 0x04, 0xc8, 0x41, 0xce, 0x42, 0x35, 0x23, 0x07, - 0x11, 0xa1, 0x1a, 0xe0, 0x79, 0xd8, 0x25, 0xa4, 0xeb, 0x79, 0x23, 0xc8, 0x60, 0x89, 0x67, 0xd0, - 0x4a, 0xe0, 0x8f, 0x3d, 0x6f, 0x14, 0xa2, 0x2b, 0x5d, 0xf1, 0x68, 0xbe, 0x26, 0x86, 0x84, 0x52, - 0xab, 0xc6, 0xb9, 0xb3, 0xb0, 0x24, 0xc2, 0xf2, 0xda, 0xa9, 0x3f, 0x1d, 0xba, 0x7d, 0x60, 0xae, - 0x6b, 0x6a, 0xff, 0x89, 0x0f, 0x82, 0xda, 0xa9, 0xfc, 0xc1, 0x6a, 0xc7, 0x01, 0xa8, 0xd5, 0xd0, - 0xd4, 0x8e, 0x23, 0x54, 0x51, 0x04, 0xbe, 0x03, 0xbb, 0x77, 0xbe, 0x43, 0x21, 0x85, 0xa6, 0x66, - 0x07, 0x1e, 0xb3, 0x31, 0xa2, 0x82, 0xe8, 0x99, 0xed, 0x40, 0x84, 0xa6, 0x96, 0xa9, 0xd9, 0x81, - 0x08, 0x6e, 0x48, 0x38, 0x35, 0xbf, 0x26, 0x06, 0xd7, 0x64, 0x60, 0x5f, 0xe6, 0xec, 0x8f, 0x12, - 0xf0, 0x13, 0x36, 0xa6, 0x43, 0xf8, 0xd0, 0x90, 0x78, 0x97, 0x54, 0x11, 0x90, 0x5a, 0x2b, 0x9c, - 0x58, 0x87, 0x34, 0x24, 0x92, 0x9a, 0xdf, 0x91, 0x7a, 0x24, 0xd5, 0xc0, 0xfb, 0x50, 0xb3, 0xe4, - 0x17, 0x62, 0x5c, 0xa7, 0x16, 0x41, 0x42, 0xfe, 0x13, 0xd2, 0x88, 0x05, 0xa1, 0xd6, 0x23, 0xcd, - 0xe2, 0xcb, 0x28, 0x75, 0x35, 0x0a, 0x35, 0xbf, 0x25, 0x35, 0xe1, 0x59, 0x90, 0xca, 0x2a, 0x4f, - 0xe5, 0x71, 0x52, 0x3f, 0x61, 0x58, 0x67, 0x49, 0x00, 0xc2, 0x44, 0x8e, 0x49, 0x5d, 0x8d, 0x40, - 0x2d, 0x8b, 0xe7, 0x91, 0x11, 0xa2, 0xa6, 0x84, 0xa0, 0xe6, 0x1b, 0xd2, 0x90, 0xe6, 0x07, 0x79, - 0x3c, 0xd6, 0x4c, 0xc9, 0x29, 0x1b, 0x78, 0x6e, 0xd3, 0xdb, 0x4e, 0xed, 0x46, 0x3c, 0x86, 0x99, - 0x9c, 0x92, 0x66, 0x3c, 0x0a, 0xb5, 0x5a, 0x9a, 0x39, 0x91, 0x61, 0xea, 0x6a, 0x18, 0xbe, 0x27, - 0x38, 0x18, 0x12, 0x79, 0xa2, 0xd9, 0x13, 0xb0, 0x19, 0xf9, 0xa0, 0x68, 0x4f, 0x20, 0x20, 0xb5, - 0x9e, 0x6a, 0xf6, 0x04, 0xec, 0x43, 0x89, 0xe4, 0x33, 0x30, 0x1a, 0x52, 0x30, 0x11, 0x20, 0xfe, - 0x4c, 0x33, 0x03, 0x3f, 0x0c, 0x29, 0x18, 0x49, 0x6d, 0x24, 0x1e, 0xa3, 0x19, 0x88, 0x47, 0xa1, - 0xd6, 0x33, 0xcd, 0x0c, 0xc8, 0x30, 0x75, 0x35, 0x0c, 0x35, 0xf7, 0xb8, 0x2e, 0x04, 0x3d, 0x61, - 0x89, 0xcf, 0x79, 0x26, 0xab, 0x69, 0x6f, 0x75, 0xd0, 0xf3, 0xb9, 0x24, 0x04, 0x3d, 0xf0, 0xc3, - 0x7d, 0x2e, 0x09, 0x11, 0x96, 0x5a, 0x6b, 0x9c, 0x5f, 0x0b, 0xae, 0x22, 0x30, 0x35, 0x5f, 0x92, - 0x8a, 0xed, 0x8a, 0xb7, 0xf1, 0x73, 0x4e, 0xbb, 0x92, 0x40, 0x1e, 0xb9, 0x77, 0x9d, 0xb2, 0xed, - 0xc2, 0x9b, 0xb8, 0x45, 0x48, 0x04, 0xa1, 0xd6, 0x3a, 0x67, 0x4b, 0xc7, 0x54, 0x04, 0x86, 0xae, - 0xff, 0x5b, 0x56, 0x0e, 0x3f, 0x3f, 0xba, 0x8e, 0x77, 0xc3, 0x0f, 0x24, 0x47, 0xf7, 0x3f, 0x90, - 0x9c, 0x95, 0xd4, 0x23, 0xc9, 0x81, 0x7a, 0x9e, 0x78, 0x90, 0x7b, 0x9e, 0x38, 0x2b, 0xc5, 0x4e, - 0x14, 0xca, 0x89, 0x60, 0x36, 0xf7, 0x44, 0xc0, 0xf0, 0xca, 0x99, 0x40, 0xf1, 0xf4, 0xb9, 0x5c, - 0x4f, 0x07, 0xbc, 0x34, 0x34, 0xd5, 0x95, 0xe7, 0xf3, 0x5d, 0x99, 0x4d, 0x81, 0xea, 0xcb, 0xaa, - 0xa9, 0x2e, 0xe4, 0x9b, 0xaa, 0x08, 0x21, 0xb2, 0x78, 0xad, 0x78, 0xe2, 0x62, 0x9e, 0x27, 0x9e, - 0x95, 0xb0, 0x2b, 0x1e, 0xc5, 0x8c, 0xad, 0x9c, 0x6f, 0x6c, 0x8c, 0x1f, 0x5b, 0xdb, 0x81, 0xea, - 0x4b, 0x95, 0x5c, 0x5f, 0x62, 0xb3, 0x88, 0x9c, 0x69, 0x57, 0x75, 0x16, 0x92, 0xe5, 0x2c, 0x0c, - 0x8a, 0xbc, 0xe5, 0x24, 0x69, 0x10, 0x46, 0x9e, 0x41, 0x9c, 0x95, 0x12, 0x16, 0x71, 0x9c, 0xd0, - 0xf6, 0x6a, 0x8e, 0xb6, 0x9f, 0x95, 0xe2, 0xea, 0x7e, 0x9a, 0xa2, 0xcc, 0x4b, 0x79, 0xca, 0xcc, - 0x72, 0x89, 0x69, 0xf3, 0xae, 0xaa, 0xa9, 0xb5, 0x2c, 0x4d, 0x65, 0xb3, 0xf1, 0x1e, 0x8b, 0x5a, - 0x52, 0x1a, 0xeb, 0x79, 0xd2, 0xc8, 0x52, 0x88, 0x89, 0xe3, 0x7e, 0x4c, 0xd4, 0x1a, 0x99, 0xa2, - 0x06, 0xdb, 0x21, 0x92, 0xb5, 0x2d, 0x2c, 0x4c, 0x4d, 0xbd, 0x30, 0x9d, 0x95, 0xa4, 0x34, 0x1d, - 0x2f, 0x92, 0x79, 0x0e, 0x58, 0xff, 0xaf, 0x45, 0x4c, 0xf5, 0xd3, 0xe7, 0xdc, 0x9e, 0x50, 0x73, - 0x40, 0x9a, 0xb0, 0x4d, 0x41, 0x73, 0xc6, 0xf6, 0xc4, 0x9a, 0xe1, 0x0a, 0xb6, 0xdf, 0x4e, 0xf9, - 0x3c, 0x6d, 0x27, 0x63, 0xc0, 0x16, 0x0e, 0xe5, 0xe8, 0xdc, 0x9e, 0x9c, 0xb8, 0xfe, 0xf4, 0xae, - 0x53, 0xa7, 0x6a, 0xab, 0xe9, 0x90, 0x06, 0x30, 0x85, 0xd2, 0xc4, 0x88, 0xc2, 0x2f, 0xa5, 0xd7, - 0xf7, 0x23, 0xe2, 0xaa, 0x15, 0xf1, 0xd4, 0xa8, 0xd2, 0x88, 0x68, 0x42, 0x01, 0x61, 0x34, 0xb3, - 0x45, 0x68, 0xb8, 0xb4, 0xc4, 0x69, 0x44, 0xa3, 0x4a, 0xb3, 0xb3, 0xcd, 0x69, 0xe6, 0x0a, 0xd2, - 0xec, 0x6c, 0xa7, 0xd0, 0xf0, 0x46, 0xb4, 0x3c, 0x81, 0x2c, 0x67, 0xbe, 0xc8, 0xf2, 0x5c, 0x0e, - 0x95, 0x7a, 0x60, 0x79, 0xa2, 0xd6, 0x18, 0x13, 0x54, 0xb4, 0x50, 0x94, 0x09, 0x95, 0x84, 0x98, - 0xc2, 0x9a, 0xba, 0x04, 0x9a, 0xae, 0xb8, 0xba, 0x32, 0x9e, 0x45, 0xce, 0xb3, 0x77, 0x3f, 0x1e, - 0x26, 0xbc, 0x11, 0x0b, 0x7c, 0x04, 0x40, 0x1b, 0xaa, 0x06, 0xfe, 0x63, 0x2c, 0xe5, 0x22, 0xd5, - 0x84, 0xff, 0xc6, 0xab, 0x89, 0x5a, 0xd1, 0x46, 0x08, 0xb5, 0x9a, 0x11, 0x55, 0x8a, 0x6c, 0x04, - 0x2e, 0xe3, 0xf1, 0x8d, 0x20, 0x1a, 0x11, 0x4d, 0x28, 0xe9, 0x8c, 0x86, 0x14, 0xa1, 0xe1, 0x6a, - 0x1f, 0xa7, 0x11, 0x8d, 0xe6, 0xdf, 0x64, 0x05, 0x68, 0xa4, 0xfc, 0x33, 0x2a, 0x83, 0x53, 0x1d, - 0xde, 0x8f, 0x2a, 0x72, 0x86, 0x88, 0xce, 0xa4, 0x89, 0x0e, 0xd3, 0x25, 0xcb, 0x42, 0x81, 0x84, - 0x55, 0x30, 0xc6, 0xf0, 0x13, 0xf6, 0xe0, 0x9e, 0x1a, 0x04, 0x11, 0x22, 0x42, 0xd8, 0x05, 0xa8, - 0xdd, 0x9c, 0x92, 0x87, 0x42, 0x87, 0xa4, 0xad, 0x30, 0xc6, 0xa5, 0x22, 0x35, 0x46, 0x8e, 0x13, - 0xaf, 0x11, 0x77, 0xa0, 0xd5, 0x0b, 0x2d, 0x84, 0xd1, 0xd5, 0x8a, 0xac, 0x1e, 0x17, 0xf5, 0xf8, - 0xea, 0x89, 0x46, 0x54, 0x1a, 0xb2, 0x2b, 0xc6, 0x55, 0x2f, 0x52, 0x5a, 0xe4, 0x64, 0xf1, 0xd2, - 0x70, 0x87, 0xfa, 0xa6, 0x31, 0x6b, 0x63, 0x7c, 0x8d, 0x82, 0x6f, 0x5a, 0xd0, 0xf3, 0x53, 0xde, - 0xb4, 0xb0, 0xd5, 0xbc, 0x22, 0x50, 0xef, 0x15, 0xb3, 0x41, 0x46, 0xd3, 0xe4, 0x34, 0xbb, 0xf7, - 0xa3, 0x39, 0x72, 0xe5, 0xf6, 0x87, 0x23, 0x5a, 0xd8, 0xd4, 0xfa, 0x93, 0xac, 0xa4, 0x59, 0x99, - 0xd9, 0x20, 0xb3, 0xb7, 0xce, 0x1d, 0x5c, 0x2a, 0xb2, 0x47, 0xf3, 0x15, 0xb8, 0x2a, 0x9c, 0xac, - 0xb3, 0xaf, 0xfa, 0xc2, 0xa1, 0x7b, 0x0f, 0xbe, 0x99, 0x69, 0xfd, 0x41, 0x96, 0x53, 0x3c, 0x2c, - 0x85, 0xe0, 0xa5, 0x4a, 0x90, 0x79, 0x97, 0x97, 0x16, 0x5f, 0x31, 0xaf, 0x22, 0xf1, 0xd1, 0x65, - 0x95, 0x26, 0xbe, 0x94, 0xf8, 0x82, 0xf1, 0xc5, 0x45, 0x14, 0x8a, 0x1f, 0xad, 0x80, 0xea, 0x56, - 0x45, 0x56, 0xe0, 0x32, 0xbd, 0x02, 0x85, 0x21, 0xb3, 0x84, 0x4f, 0x62, 0x48, 0xa9, 0xe1, 0x77, - 0x62, 0x26, 0xfd, 0x29, 0x25, 0xfe, 0x0b, 0x35, 0x7e, 0xd6, 0x85, 0x59, 0x5a, 0xfe, 0xaa, 0x2f, - 0x15, 0xc9, 0x1f, 0x5f, 0x88, 0xa5, 0xad, 0xb1, 0x62, 0x48, 0x45, 0xd6, 0x18, 0xdd, 0x78, 0xa1, - 0xf8, 0xbf, 0x88, 0xf8, 0x8a, 0x13, 0xa5, 0xc4, 0xff, 0x4a, 0x8d, 0xaf, 0xbb, 0xd8, 0x42, 0xa1, - 0x6d, 0xb2, 0xaa, 0x71, 0x9e, 0x22, 0xf3, 0x2f, 0xef, 0xac, 0x10, 0xc5, 0x15, 0x79, 0x94, 0x6e, - 0x35, 0x29, 0x0c, 0x9b, 0x2a, 0x43, 0xc6, 0x6d, 0x54, 0x5a, 0x0d, 0x09, 0x67, 0x29, 0x52, 0x83, - 0xbc, 0x63, 0x4a, 0x5b, 0x01, 0x45, 0xdd, 0x8b, 0xac, 0x40, 0x62, 0x71, 0xa3, 0xec, 0x13, 0xe6, - 0x51, 0x24, 0x7b, 0x79, 0x3f, 0x84, 0x28, 0x7e, 0x43, 0x6f, 0x00, 0xf2, 0x8b, 0x94, 0xf8, 0x1b, - 0x6a, 0x7c, 0xed, 0xfd, 0x0f, 0x0a, 0x7e, 0x49, 0x9a, 0x09, 0x97, 0x48, 0x89, 0xfc, 0xa5, 0x1a, - 0x39, 0xfd, 0xae, 0x47, 0x86, 0x3d, 0x3e, 0xfc, 0x18, 0xcc, 0x95, 0x67, 0x1a, 0x33, 0xbf, 0xee, - 0xf4, 0x87, 0xfe, 0x20, 0xe8, 0xb6, 0x7b, 0xde, 0x78, 0xf3, 0x62, 0xe0, 0x5c, 0x70, 0xd7, 0x7a, - 0xeb, 0x5e, 0x07, 0xcc, 0x88, 0x1c, 0x1a, 0xfe, 0xa1, 0xac, 0xb7, 0xd1, 0x77, 0xdc, 0x8d, 0xbe, - 0xb7, 0xc1, 0xdc, 0x6c, 0x93, 0xb9, 0x59, 0x77, 0x81, 0x77, 0x6c, 0xfd, 0x1f, 0x00, 0x00, 0xff, - 0xff, 0x05, 0xb4, 0xcc, 0x9f, 0x3e, 0x1c, 0x00, 0x00, + 0x17, 0x36, 0xe1, 0xcb, 0x5e, 0x19, 0x7f, 0x08, 0x12, 0x84, 0x93, 0x37, 0xe1, 0xe5, 0xd7, 0x3b, + 0xef, 0x14, 0x93, 0x04, 0x86, 0x16, 0x42, 0x49, 0xa0, 0x81, 0x21, 0xd3, 0x32, 0x9d, 0x71, 0xa1, + 0x99, 0x7e, 0x4c, 0xa9, 0x6c, 0x84, 0xed, 0x62, 0x4b, 0xae, 0x57, 0x4a, 0x86, 0x4b, 0xe8, 0xad, + 0xf4, 0xd2, 0x3a, 0xbd, 0x82, 0xfe, 0xea, 0xec, 0xea, 0xac, 0xf6, 0xac, 0xa4, 0x95, 0x82, 0xfe, + 0x24, 0xf2, 0xee, 0x3e, 0xe7, 0x39, 0x67, 0x77, 0xf5, 0x3c, 0xab, 0x85, 0x90, 0x8f, 0xb7, 0x3e, + 0x6d, 0x4f, 0xa6, 0x9e, 0xef, 0x99, 0xcb, 0xfe, 0xc0, 0xf1, 0x07, 0x43, 0xb7, 0x4f, 0xdb, 0xbf, + 0x51, 0xcf, 0x6d, 0xfb, 0x0e, 0xf5, 0x5b, 0x4d, 0xdb, 0x75, 0x3d, 0xdf, 0xf6, 0x87, 0x9e, 0x0b, + 0xe3, 0x5a, 0x6b, 0x7d, 0xcf, 0xeb, 0x8f, 0x9c, 0x2d, 0xfe, 0xab, 0x1b, 0xdc, 0x6c, 0xd9, 0xee, + 0x1d, 0x74, 0x3d, 0x8d, 0x77, 0x5d, 0x07, 0x53, 0x8e, 0x85, 0xfe, 0xc7, 0xf1, 0x7e, 0x67, 0x3c, + 0xf1, 0x05, 0x78, 0x3d, 0xde, 0x79, 0x33, 0x74, 0x46, 0xd7, 0x57, 0x63, 0x9b, 0xde, 0xc2, 0x88, + 0x27, 0xf1, 0x11, 0xd4, 0x9f, 0x06, 0x3d, 0x1f, 0x7a, 0x9f, 0xc5, 0x7b, 0xfd, 0xe1, 0xd8, 0xa1, + 0xbe, 0x3d, 0x9e, 0xe8, 0xb2, 0xfb, 0x38, 0xb5, 0x27, 0x13, 0x67, 0x0a, 0x85, 0x6d, 0x3c, 0x27, + 0x2b, 0xe7, 0x0e, 0xa5, 0x76, 0xdf, 0x79, 0x3f, 0xf4, 0x07, 0xe7, 0xf6, 0x94, 0x0e, 0xec, 0x91, + 0x33, 0x35, 0x2d, 0xb2, 0x38, 0x0e, 0xdb, 0xad, 0x99, 0xf5, 0x99, 0xff, 0x55, 0x3a, 0xe2, 0xe7, + 0xc6, 0x97, 0x64, 0x15, 0x21, 0xbc, 0xc0, 0xff, 0x04, 0xd0, 0x7e, 0xf9, 0xaf, 0x3f, 0xd7, 0xe6, + 0xca, 0xa5, 0x46, 0x69, 0xe3, 0x8f, 0x26, 0xa9, 0x23, 0xfc, 0xfb, 0xaf, 0x2f, 0xa8, 0xf9, 0x9a, + 0x54, 0xaf, 0xbd, 0xa0, 0x3b, 0x72, 0xae, 0x3e, 0xd8, 0xa3, 0x20, 0x04, 0x1b, 0x2f, 0x9f, 0xb4, + 0xc3, 0xdc, 0xdb, 0x22, 0xf7, 0xf6, 0x5b, 0x3e, 0xe8, 0x7b, 0x36, 0xa6, 0x63, 0x5c, 0xcb, 0x1f, + 0xe6, 0x11, 0x59, 0xc2, 0x01, 0xa8, 0xf5, 0x60, 0x7d, 0x36, 0x37, 0x42, 0x15, 0x45, 0xa0, 0xe6, + 0x01, 0x31, 0x6e, 0x46, 0x9e, 0xed, 0x43, 0x0a, 0xb3, 0x3c, 0x85, 0xc7, 0x89, 0x00, 0xa7, 0x6c, + 0x4c, 0x88, 0x27, 0x37, 0xd1, 0xb3, 0x79, 0x48, 0xaa, 0x08, 0x4d, 0xad, 0x39, 0xce, 0x9f, 0x09, + 0x37, 0x24, 0x9c, 0xb3, 0x0f, 0x5d, 0x7f, 0xfb, 0x25, 0xb0, 0xcf, 0x6b, 0xd8, 0xdf, 0xb1, 0x31, + 0xc0, 0x3e, 0x8c, 0x9e, 0x19, 0x3b, 0x42, 0x53, 0x6b, 0x41, 0xc3, 0x8e, 0xe0, 0x86, 0x84, 0x0b, + 0xf6, 0xdd, 0x1d, 0x60, 0x5f, 0xd4, 0xb3, 0xef, 0xee, 0x48, 0x76, 0x78, 0x06, 0x76, 0x81, 0xa6, + 0x56, 0x59, 0xcf, 0x2e, 0xe0, 0x86, 0x84, 0xf3, 0xd5, 0x0f, 0x70, 0xf1, 0x15, 0xcd, 0xea, 0x5f, + 0xe2, 0xf4, 0x03, 0x54, 0xfe, 0x11, 0x59, 0x0a, 0x94, 0xfa, 0x89, 0x66, 0xf5, 0x71, 0x84, 0x6a, + 0x80, 0x67, 0x00, 0x72, 0x88, 0xa6, 0xc0, 0xc8, 0xc8, 0x21, 0x2a, 0x22, 0x40, 0x93, 0x00, 0x39, + 0xc8, 0x59, 0xa8, 0x66, 0xe4, 0x20, 0x22, 0x54, 0x03, 0x3c, 0x0f, 0x7b, 0x84, 0x74, 0x3d, 0x6f, + 0x04, 0x19, 0x2c, 0xf1, 0x0c, 0x5a, 0x09, 0xfc, 0xb1, 0xe7, 0x8d, 0x42, 0x74, 0xa5, 0x2b, 0x1e, + 0xcd, 0x57, 0xc4, 0x90, 0x50, 0x6a, 0xd5, 0x38, 0x77, 0x16, 0x96, 0x44, 0x58, 0x5e, 0x3b, 0xf5, + 0xa7, 0x43, 0xb7, 0x0f, 0xcc, 0x75, 0x4d, 0xed, 0xdf, 0xf1, 0x41, 0x50, 0x3b, 0x95, 0x3f, 0x58, + 0xed, 0x38, 0x00, 0xb5, 0x1a, 0x9a, 0xda, 0x71, 0x84, 0x2a, 0x8a, 0xc0, 0x77, 0x60, 0xf7, 0xce, + 0x77, 0x28, 0xa4, 0xd0, 0xd4, 0xec, 0xc0, 0x63, 0x36, 0x46, 0x54, 0x10, 0x3d, 0xb3, 0x1d, 0x88, + 0xd0, 0xd4, 0x32, 0x35, 0x3b, 0x10, 0xc1, 0x0d, 0x09, 0xa7, 0xe6, 0xe7, 0xc4, 0xe0, 0xa2, 0x0c, + 0xec, 0xcb, 0x9c, 0xfd, 0x51, 0x02, 0x7e, 0xc2, 0xc6, 0x74, 0x08, 0x1f, 0x1a, 0x12, 0xef, 0x91, + 0x2a, 0x02, 0x52, 0x6b, 0x85, 0x13, 0xeb, 0x90, 0x86, 0x44, 0x52, 0xf3, 0x2b, 0x52, 0x8f, 0xb4, + 0x1a, 0x78, 0x1f, 0x6a, 0x96, 0xfc, 0x42, 0x8c, 0xeb, 0xd4, 0x22, 0x48, 0xc8, 0x7f, 0x42, 0x1a, + 0xb1, 0x20, 0xd4, 0x7a, 0xa4, 0x59, 0x7c, 0x19, 0xa5, 0xae, 0x46, 0xa1, 0xe6, 0x1b, 0x52, 0x13, + 0xa6, 0x05, 0xa9, 0xac, 0xf2, 0x54, 0xd6, 0x92, 0xfa, 0x09, 0xc3, 0x3a, 0x4b, 0x02, 0x10, 0x26, + 0x72, 0x4c, 0xea, 0x6a, 0x04, 0x6a, 0x59, 0x3c, 0x8f, 0x8c, 0x10, 0x35, 0x25, 0x04, 0x35, 0xdf, + 0x92, 0x86, 0x74, 0x3f, 0xc8, 0x63, 0x4d, 0x33, 0x25, 0xa7, 0x6c, 0xe0, 0xb9, 0x4d, 0x6f, 0x3b, + 0xb5, 0x1b, 0xf1, 0x18, 0x66, 0x72, 0x4a, 0x9a, 0xf1, 0x28, 0xd4, 0x6a, 0x69, 0xe6, 0x44, 0x86, + 0xa9, 0xab, 0x61, 0xf8, 0x9e, 0xe0, 0x60, 0x48, 0xe4, 0xb1, 0x66, 0x4f, 0xc0, 0x66, 0xe4, 0x83, + 0xa2, 0x3d, 0x81, 0x80, 0xd4, 0x7a, 0xa2, 0xd9, 0x13, 0xb0, 0x0f, 0x25, 0x92, 0xcf, 0xc0, 0x68, + 0x48, 0xc1, 0x44, 0x80, 0xf8, 0x3f, 0x9a, 0x19, 0xf8, 0x66, 0x48, 0xc1, 0x48, 0x6a, 0x23, 0xf1, + 0x18, 0xcd, 0x40, 0x3c, 0x0a, 0xb5, 0x9e, 0x6a, 0x66, 0x40, 0x86, 0xa9, 0xab, 0x61, 0xa8, 0xb9, + 0xcf, 0x75, 0x21, 0xe8, 0x09, 0x4b, 0x7c, 0xc6, 0x33, 0x59, 0x4d, 0x7b, 0xab, 0x83, 0x9e, 0xcf, + 0x25, 0x21, 0xe8, 0x81, 0x1f, 0x1e, 0x70, 0x49, 0x88, 0xb0, 0xd4, 0x5a, 0xe7, 0xfc, 0x5a, 0x70, + 0x15, 0x81, 0xa9, 0xf9, 0x82, 0x54, 0x6c, 0x57, 0xbc, 0x8d, 0xff, 0xe5, 0xb4, 0x2b, 0x09, 0xe4, + 0x91, 0x7b, 0xd7, 0x29, 0xdb, 0x2e, 0xbc, 0x89, 0xdb, 0x84, 0x44, 0x10, 0x6a, 0x6d, 0x70, 0xb6, + 0x74, 0x4c, 0x45, 0x60, 0xe8, 0xc6, 0xdf, 0x65, 0xe5, 0xf4, 0xf3, 0xad, 0xeb, 0x78, 0x37, 0xfc, + 0x40, 0x72, 0x74, 0xff, 0x03, 0xc9, 0x59, 0x49, 0x3d, 0x92, 0x1c, 0xaa, 0xe7, 0x89, 0x07, 0xb9, + 0xe7, 0x89, 0xb3, 0x52, 0xec, 0x44, 0xa1, 0x9c, 0x08, 0x66, 0x73, 0x4f, 0x04, 0x0c, 0xaf, 0x9c, + 0x09, 0x14, 0x4f, 0x9f, 0xcb, 0xf5, 0x74, 0xc0, 0x4b, 0x43, 0x53, 0x5d, 0x79, 0x3e, 0xdf, 0x95, + 0xd9, 0x14, 0xa8, 0xbe, 0xac, 0x9a, 0xea, 0x42, 0xbe, 0xa9, 0x8a, 0x10, 0x22, 0x8b, 0x57, 0x8a, + 0x27, 0x2e, 0xe6, 0x79, 0xe2, 0x59, 0x09, 0xbb, 0xe2, 0x51, 0xcc, 0xd8, 0xca, 0xf9, 0xc6, 0xc6, + 0xf8, 0xb1, 0xb5, 0x1d, 0xaa, 0xbe, 0x54, 0xc9, 0xf5, 0x25, 0x36, 0x8b, 0xc8, 0x99, 0xf6, 0x54, + 0x67, 0x21, 0x59, 0xce, 0xc2, 0xa0, 0xc8, 0x5b, 0x4e, 0x92, 0x06, 0x61, 0xe4, 0x19, 0xc4, 0x59, + 0x29, 0x61, 0x11, 0xc7, 0x09, 0x6d, 0xaf, 0xe6, 0x68, 0xfb, 0x59, 0x29, 0xae, 0xee, 0xa7, 0x29, + 0xca, 0xbc, 0x94, 0xa7, 0xcc, 0x2c, 0x97, 0x98, 0x36, 0xef, 0xa9, 0x9a, 0x5a, 0xcb, 0xd2, 0x54, + 0x36, 0x1b, 0x1f, 0xb0, 0xa8, 0x25, 0xa5, 0xb1, 0x9e, 0x27, 0x8d, 0x2c, 0x85, 0x98, 0x38, 0x1e, + 0xc4, 0x44, 0xad, 0x91, 0x29, 0x6a, 0xb0, 0x1d, 0x22, 0x59, 0xdb, 0xc6, 0xc2, 0xd4, 0xd4, 0x0b, + 0xd3, 0x59, 0x49, 0x4a, 0xd3, 0xf1, 0x22, 0x99, 0xe7, 0x80, 0x8d, 0x7f, 0x5a, 0xc4, 0x54, 0x3f, + 0x7d, 0xce, 0xed, 0x09, 0x35, 0x07, 0xa4, 0x09, 0xdb, 0x14, 0x34, 0x67, 0x6c, 0x4f, 0xac, 0x19, + 0xae, 0x60, 0x07, 0xed, 0x94, 0xef, 0xd3, 0x76, 0x32, 0x06, 0x6c, 0xe1, 0x50, 0x8e, 0xce, 0xed, + 0xc9, 0x89, 0xeb, 0x4f, 0xef, 0x3a, 0x75, 0xaa, 0xb6, 0x9a, 0x0e, 0x69, 0x00, 0x53, 0x28, 0x4d, + 0x8c, 0x28, 0xfc, 0x52, 0x7a, 0x75, 0x3f, 0x22, 0xae, 0x5a, 0x11, 0x4f, 0x8d, 0x2a, 0x8d, 0x88, + 0x26, 0x14, 0x10, 0x46, 0x33, 0x5b, 0x84, 0x86, 0x4b, 0x4b, 0x9c, 0x46, 0x34, 0xaa, 0x34, 0xbb, + 0x3b, 0x9c, 0x66, 0xae, 0x20, 0xcd, 0xee, 0x4e, 0x0a, 0x0d, 0x6f, 0x44, 0xcb, 0x13, 0xc8, 0x72, + 0xe6, 0x8b, 0x2c, 0xcf, 0xe5, 0x50, 0xa9, 0x07, 0x96, 0x27, 0x6a, 0x8d, 0x31, 0x41, 0x45, 0x0b, + 0x45, 0x99, 0x50, 0x49, 0x88, 0x29, 0xac, 0xa9, 0x4b, 0xa0, 0xe9, 0x8a, 0xab, 0x2b, 0xe3, 0x59, + 0xe4, 0x3c, 0xfb, 0xf7, 0xe3, 0x61, 0xc2, 0x1b, 0xb1, 0xc0, 0x47, 0x00, 0xb4, 0xa1, 0x6a, 0xe0, + 0x3f, 0xc6, 0x52, 0x2e, 0x52, 0x4d, 0xf8, 0x6f, 0xbc, 0x9a, 0xa8, 0x15, 0x6d, 0x84, 0x50, 0xab, + 0x19, 0x51, 0xa5, 0xc8, 0x46, 0xe0, 0x32, 0x1e, 0xdf, 0x08, 0xa2, 0x11, 0xd1, 0x84, 0x92, 0xce, + 0x68, 0x48, 0x11, 0x1a, 0xae, 0xf6, 0x71, 0x1a, 0xd1, 0x68, 0xfe, 0x4e, 0x56, 0x80, 0x46, 0xca, + 0x3f, 0xa3, 0x32, 0x38, 0xd5, 0xeb, 0xfb, 0x51, 0x45, 0xce, 0x10, 0xd1, 0x99, 0x34, 0xd1, 0x61, + 0xba, 0x64, 0x59, 0x28, 0x90, 0xb0, 0x0a, 0xc6, 0x18, 0x7e, 0xc2, 0x1e, 0xde, 0x53, 0x83, 0x20, + 0x42, 0x44, 0x08, 0xbb, 0x00, 0xb5, 0x9b, 0x53, 0xf2, 0x50, 0xe8, 0x90, 0xb4, 0x15, 0xc6, 0xb8, + 0x54, 0xa4, 0xc6, 0xc8, 0x71, 0xe2, 0x35, 0xe2, 0x0e, 0xb4, 0x7a, 0xa1, 0x85, 0x30, 0xba, 0x5a, + 0x91, 0xd5, 0xe3, 0xa2, 0x1e, 0x5f, 0x3d, 0xd1, 0x88, 0x4a, 0x43, 0x76, 0xc5, 0xb8, 0xea, 0x45, + 0x4a, 0x8b, 0x9c, 0x2c, 0x5e, 0x1a, 0xee, 0x50, 0xdf, 0x34, 0x66, 0x6d, 0x8c, 0xaf, 0x51, 0xf0, + 0x4d, 0x0b, 0x7a, 0x7e, 0xca, 0x9b, 0x16, 0xb6, 0x9a, 0x57, 0x04, 0xea, 0xbd, 0x62, 0x36, 0xc8, + 0x68, 0x9a, 0x9c, 0x66, 0xef, 0x7e, 0x34, 0x47, 0xae, 0xdc, 0xfe, 0x70, 0x44, 0x0b, 0x9b, 0x5a, + 0xbf, 0x92, 0x95, 0x34, 0x2b, 0x33, 0x1b, 0x64, 0xf6, 0xd6, 0xb9, 0x83, 0x5b, 0x45, 0xf6, 0x68, + 0xbe, 0x04, 0x57, 0x85, 0x93, 0x75, 0xf6, 0x55, 0x5f, 0x38, 0x74, 0xff, 0xc1, 0x17, 0x33, 0xad, + 0x5f, 0xc8, 0x72, 0x8a, 0x87, 0xa5, 0x10, 0xbc, 0x50, 0x09, 0x32, 0xef, 0xf2, 0xd2, 0xe2, 0x2b, + 0xe6, 0x55, 0x24, 0x3e, 0xba, 0xac, 0xd2, 0xc4, 0x97, 0x12, 0x5f, 0x30, 0xbe, 0xb8, 0x88, 0x42, + 0xf1, 0xa3, 0x15, 0x50, 0xdd, 0xaa, 0xc8, 0x0a, 0x5c, 0xa6, 0x57, 0xa0, 0x30, 0x64, 0x96, 0xf0, + 0x49, 0x0c, 0x29, 0x35, 0xfc, 0x4c, 0xcc, 0xa4, 0x3f, 0xa5, 0xc4, 0x7f, 0xae, 0xc6, 0xcf, 0xba, + 0x30, 0x4b, 0xcb, 0x5f, 0xf5, 0xa5, 0x22, 0xf9, 0xe3, 0x0b, 0xb1, 0xb4, 0x35, 0x56, 0x0c, 0xa9, + 0xc8, 0x1a, 0xa3, 0x1b, 0x2f, 0x14, 0xff, 0x07, 0x11, 0x5f, 0x71, 0xa2, 0x94, 0xf8, 0x9f, 0xa9, + 0xf1, 0x75, 0x17, 0x5b, 0x28, 0xb4, 0x4d, 0x56, 0x35, 0xce, 0x53, 0x64, 0xfe, 0xe5, 0x9d, 0x15, + 0xa2, 0xb8, 0x22, 0x8f, 0xd2, 0xad, 0x26, 0x85, 0x61, 0x4b, 0x65, 0xc8, 0xb8, 0x8d, 0x4a, 0xab, + 0x21, 0xe1, 0x2c, 0x45, 0x6a, 0x90, 0x77, 0x4c, 0x69, 0x2b, 0xa0, 0xa8, 0x7b, 0x91, 0x15, 0x48, + 0x2c, 0x6e, 0x94, 0x7d, 0xc2, 0x3c, 0x8a, 0x64, 0x2f, 0xef, 0x87, 0x10, 0xc5, 0x4f, 0xe8, 0x0d, + 0x40, 0x7e, 0x91, 0x12, 0x7f, 0x53, 0x8d, 0xaf, 0xbd, 0xff, 0x41, 0xc1, 0x2f, 0x49, 0x33, 0xe1, + 0x12, 0x29, 0x91, 0xff, 0xaf, 0x46, 0x4e, 0xbf, 0xeb, 0x91, 0x61, 0x8f, 0xdf, 0xf0, 0xbf, 0x40, + 0xcd, 0x34, 0x66, 0x7e, 0xdc, 0xed, 0x0f, 0xfd, 0x41, 0xd0, 0x6d, 0xf7, 0xbc, 0xf1, 0xd6, 0xc5, + 0xc0, 0xb9, 0xe0, 0xb6, 0xf5, 0xce, 0xbd, 0x0e, 0x98, 0x13, 0x39, 0x34, 0xfc, 0x53, 0x59, 0x6f, + 0xb3, 0xef, 0xb8, 0x9b, 0x7d, 0x6f, 0x93, 0xd9, 0xd9, 0x16, 0xb3, 0xb3, 0xee, 0x02, 0xef, 0xd8, + 0xfe, 0x37, 0x00, 0x00, 0xff, 0xff, 0x47, 0x96, 0x51, 0x92, 0x40, 0x1c, 0x00, 0x00, } diff --git a/test/golang/enums.pb.go b/test/golang/enums.pb.go index f8ee4e50..91631bf9 100644 --- a/test/golang/enums.pb.go +++ b/test/golang/enums.pb.go @@ -359,70 +359,70 @@ var file_enums_proto_rawDesc = []byte{ 0x73, 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4f, 0x0a, 0x0f, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, 0x0f, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x05, - 0xea, 0x75, 0x02, 0x18, 0x01, 0x22, 0x9c, 0x03, 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x3a, 0x0a, 0x07, 0x72, 0x65, - 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, - 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x07, 0x72, - 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x3c, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, - 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, - 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x08, 0x72, 0x65, 0x67, 0x75, - 0x6c, 0x61, 0x72, 0x73, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x39, 0x0a, - 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1f, - 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, - 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x77, 0x72, 0x61, 0x70, - 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, - 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, - 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x43, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x4d, 0x0a, 0x0f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, - 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x43, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x73, 0x22, 0xe8, 0x01, 0x0a, 0x15, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x3c, - 0x0a, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, - 0x6d, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x39, 0x0a, 0x06, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, + 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x06, + 0xea, 0xaa, 0x19, 0x02, 0x18, 0x01, 0x22, 0x9c, 0x03, 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x3a, 0x0a, 0x07, 0x72, + 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x48, 0x00, 0x52, - 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x4d, 0x0a, 0x0e, 0x77, 0x72, 0x61, 0x70, 0x70, - 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x07, + 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x3c, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x75, 0x6c, + 0x61, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, + 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x08, 0x72, 0x65, 0x67, + 0x75, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x39, + 0x0a, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, 0x32, + 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, + 0x52, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x77, 0x72, 0x61, + 0x70, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, + 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, + 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x4d, 0x0a, 0x0f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, + 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, - 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, - 0x51, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x13, - 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, - 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x41, - 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x42, 0x10, - 0x02, 0x1a, 0x0f, 0xea, 0x75, 0x04, 0x08, 0x00, 0x20, 0x00, 0x88, 0xa3, 0x1e, 0x00, 0xb0, 0xa4, - 0x1e, 0x00, 0x2a, 0x70, 0x0a, 0x0a, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, - 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, - 0x57, 0x4e, 0x10, 0x00, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x56, - 0x31, 0x5f, 0x30, 0x10, 0x01, 0x1a, 0x0f, 0xea, 0x75, 0x0c, 0x0a, 0x03, 0x31, 0x2e, 0x30, 0x12, - 0x05, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x12, 0x1d, 0x0a, 0x0d, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, - 0x5f, 0x56, 0x31, 0x5f, 0x30, 0x5f, 0x31, 0x10, 0x02, 0x1a, 0x0a, 0xea, 0x75, 0x07, 0x0a, 0x05, - 0x31, 0x2e, 0x30, 0x2e, 0x31, 0x1a, 0x0d, 0xea, 0x75, 0x0a, 0x18, 0x01, 0x2a, 0x06, 0x43, 0x55, - 0x53, 0x54, 0x4f, 0x4d, 0x42, 0x47, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, - 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, - 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0xf0, 0xe2, - 0x1e, 0x01, 0xe8, 0xe2, 0x1e, 0x00, 0xea, 0x75, 0x04, 0x08, 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x43, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x22, 0xe8, 0x01, 0x0a, 0x15, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, + 0x3c, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, + 0x75, 0x6d, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x39, 0x0a, + 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, + 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x48, 0x00, + 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x4d, 0x0a, 0x0e, 0x77, 0x72, 0x61, 0x70, + 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, + 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, + 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x2a, 0x52, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x12, + 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, + 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, + 0x41, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x42, + 0x10, 0x02, 0x1a, 0x10, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x00, 0x20, 0x00, 0x88, 0xa3, 0x1e, 0x00, + 0xb0, 0xa4, 0x1e, 0x00, 0x2a, 0x73, 0x0a, 0x0a, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, + 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x0b, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, + 0x5f, 0x56, 0x31, 0x5f, 0x30, 0x10, 0x01, 0x1a, 0x10, 0xea, 0xaa, 0x19, 0x0c, 0x0a, 0x03, 0x31, + 0x2e, 0x30, 0x12, 0x05, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x12, 0x1e, 0x0a, 0x0d, 0x43, 0x55, 0x53, + 0x54, 0x4f, 0x4d, 0x5f, 0x56, 0x31, 0x5f, 0x30, 0x5f, 0x31, 0x10, 0x02, 0x1a, 0x0b, 0xea, 0xaa, + 0x19, 0x07, 0x0a, 0x05, 0x31, 0x2e, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0xea, 0xaa, 0x19, 0x0a, 0x18, + 0x01, 0x2a, 0x06, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x42, 0x48, 0x5a, 0x36, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, + 0x65, 0x73, 0x74, 0xf0, 0xe2, 0x1e, 0x01, 0xe8, 0xe2, 0x1e, 0x00, 0xea, 0xaa, 0x19, 0x04, 0x08, + 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/test/golang/gogo.pb.go b/test/golang/gogo.pb.go index 2f7922ef..aa20c3f4 100644 --- a/test/golang/gogo.pb.go +++ b/test/golang/gogo.pb.go @@ -417,148 +417,148 @@ var file_gogo_proto_rawDesc = []byte{ 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x0b, 0x0a, 0x16, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x86, 0x0b, 0x0a, 0x16, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x47, 0x6f, 0x47, 0x6f, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x46, 0x0a, 0x14, 0x65, 0x75, 0x69, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x15, 0xe2, 0xde, 0x1f, 0x11, 0x45, 0x55, 0x49, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x11, 0x65, 0x75, 0x69, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0xbc, 0x02, 0x0a, 0x1d, 0x65, 0x75, 0x69, 0x5f, + 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0xbd, 0x02, 0x0a, 0x1d, 0x65, 0x75, 0x69, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0xfa, 0x01, 0xe2, 0xde, 0x1f, 0x18, 0x45, 0x55, 0x49, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, + 0xfb, 0x01, 0xe2, 0xde, 0x1f, 0x18, 0x45, 0x55, 0x49, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0xda, 0xde, 0x1f, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, - 0x55, 0x49, 0x36, 0x34, 0xea, 0x75, 0x94, 0x01, 0x0a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x55, 0x49, 0x36, 0x34, 0xea, 0xaa, 0x19, 0x94, 0x01, 0x0a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, + 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, + 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, + 0x45, 0x58, 0x12, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, + 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, + 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x52, 0x18, 0x65, + 0x75, 0x69, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, + 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0xe4, 0x02, 0x0a, 0x2a, 0x6e, 0x6f, 0x6e, 0x5f, + 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x75, 0x69, 0x5f, 0x77, 0x69, 0x74, + 0x68, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x6e, + 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x8a, 0x02, 0xe2, + 0xde, 0x1f, 0x23, 0x4e, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x55, + 0x49, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, + 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0xda, 0xde, 0x1f, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, - 0x58, 0x12, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, - 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, - 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x52, 0x18, 0x65, 0x75, - 0x69, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, - 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0xe3, 0x02, 0x0a, 0x2a, 0x6e, 0x6f, 0x6e, 0x5f, 0x6e, - 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x75, 0x69, 0x5f, 0x77, 0x69, 0x74, 0x68, - 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x6e, 0x64, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x89, 0x02, 0xe2, 0xde, - 0x1f, 0x23, 0x4e, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x55, 0x49, - 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, - 0x64, 0x54, 0x79, 0x70, 0x65, 0xda, 0xde, 0x1f, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, - 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, - 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x55, 0x49, 0x36, 0x34, 0xc8, 0xde, 0x1f, 0x00, 0xea, - 0x75, 0x94, 0x01, 0x0a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, - 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, - 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x12, 0x49, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, - 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, - 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6d, 0x61, 0x72, - 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x52, 0x23, 0x6e, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, - 0x61, 0x62, 0x6c, 0x65, 0x45, 0x75, 0x69, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0xc9, 0x02, 0x0a, - 0x1e, 0x65, 0x75, 0x69, 0x73, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x85, 0x02, 0xe2, 0xde, 0x1f, 0x19, 0x45, 0x55, 0x49, 0x73, - 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, - 0x64, 0x54, 0x79, 0x70, 0x65, 0xda, 0xde, 0x1f, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, - 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, - 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x55, 0x49, 0x36, 0x34, 0xea, 0x75, 0x9e, 0x01, 0x0a, - 0x4c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, - 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, - 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, - 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x4e, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, - 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, - 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6d, 0x61, - 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x19, 0x65, - 0x75, 0x69, 0x73, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, - 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x08, 0x64, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x57, 0x0a, 0x15, 0x6e, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6c, - 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x13, 0x6e, 0x6f, 0x6e, 0x4e, 0x75, - 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, - 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x55, 0x49, 0x36, 0x34, 0xc8, 0xde, 0x1f, 0x00, + 0xea, 0xaa, 0x19, 0x94, 0x01, 0x0a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, + 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, + 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x12, 0x49, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, + 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6d, + 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x52, 0x23, 0x6e, 0x6f, 0x6e, 0x4e, 0x75, + 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x75, 0x69, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0xca, + 0x02, 0x0a, 0x1e, 0x65, 0x75, 0x69, 0x73, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x86, 0x02, 0xe2, 0xde, 0x1f, 0x19, 0x45, 0x55, + 0x49, 0x73, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, + 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0xda, 0xde, 0x1f, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, + 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, + 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x55, 0x49, 0x36, 0x34, 0xea, 0xaa, 0x19, + 0x9e, 0x01, 0x0a, 0x4c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, + 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, + 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, + 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x41, 0x72, 0x72, 0x61, 0x79, + 0x12, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, + 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, + 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, + 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x41, 0x72, 0x72, 0x61, 0x79, + 0x52, 0x19, 0x65, 0x75, 0x69, 0x73, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x64, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x08, + 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x57, 0x0a, 0x15, 0x6e, 0x6f, 0x6e, 0x5f, + 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x13, 0x6e, 0x6f, + 0x6e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x3e, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x12, 0x5a, 0x0a, 0x16, 0x6e, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, + 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, - 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x5a, - 0x0a, 0x16, 0x6e, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, - 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x14, 0x6e, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x22, 0x0a, 0x0a, 0x53, 0x75, - 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x22, 0x47, - 0x0a, 0x1b, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, - 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x0a, - 0x0b, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x3a, 0x07, - 0xea, 0x75, 0x04, 0x08, 0x00, 0x10, 0x00, 0x22, 0xb5, 0x02, 0x0a, 0x13, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, - 0x37, 0x0a, 0x03, 0x73, 0x75, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, - 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x04, 0xc8, - 0xde, 0x1f, 0x00, 0x52, 0x03, 0x73, 0x75, 0x62, 0x12, 0x39, 0x0a, 0x04, 0x73, 0x75, 0x62, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, + 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x14, 0x6e, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, + 0x61, 0x62, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x22, 0x0a, + 0x0a, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x22, 0x48, 0x0a, 0x1b, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, + 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x3a, 0x08, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x00, 0x10, 0x00, 0x22, 0xb5, 0x02, 0x0a, 0x13, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x75, 0x6c, 0x6c, 0x61, + 0x62, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x03, 0x73, 0x75, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x03, 0x73, 0x75, 0x62, 0x12, 0x39, 0x0a, 0x04, + 0x73, 0x75, 0x62, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, + 0x00, 0x52, 0x04, 0x73, 0x75, 0x62, 0x73, 0x12, 0x53, 0x0a, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, + 0x5f, 0x73, 0x75, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, + 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x08, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x75, 0x62, 0x12, 0x55, 0x0a, 0x0a, + 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, + 0x72, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, + 0x75, 0x62, 0x73, 0x22, 0xa3, 0x01, 0x0a, 0x13, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x03, 0x73, + 0x75, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, + 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x04, 0xd0, 0xde, 0x1f, 0x01, 0x52, + 0x03, 0x73, 0x75, 0x62, 0x12, 0x53, 0x0a, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, + 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, + 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, + 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x04, 0xd0, 0xde, 0x1f, 0x01, 0x52, + 0x08, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x75, 0x62, 0x22, 0xb3, 0x01, 0x0a, 0x1b, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, + 0x65, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x03, 0x73, 0x75, 0x62, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x04, 0x73, - 0x75, 0x62, 0x73, 0x12, 0x53, 0x0a, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, - 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, - 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, - 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x75, 0x62, 0x12, 0x55, 0x0a, 0x0a, 0x6f, 0x74, 0x68, 0x65, - 0x72, 0x5f, 0x73, 0x75, 0x62, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, - 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, - 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x04, - 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x75, 0x62, 0x73, 0x22, - 0xa3, 0x01, 0x0a, 0x13, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, - 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x03, 0x73, 0x75, 0x62, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x04, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x03, 0x73, 0x75, 0x62, - 0x12, 0x53, 0x0a, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, - 0x61, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x04, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x08, 0x6f, 0x74, 0x68, - 0x65, 0x72, 0x53, 0x75, 0x62, 0x22, 0xb3, 0x01, 0x0a, 0x1b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x6d, 0x62, - 0x65, 0x64, 0x64, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x03, 0x73, 0x75, 0x62, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, - 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x03, 0x73, - 0x75, 0x62, 0x12, 0x57, 0x0a, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, - 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0xd0, 0xde, 0x1f, - 0x01, 0x52, 0x08, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x75, 0x62, 0x42, 0x3f, 0x5a, 0x36, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, - 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, - 0x2f, 0x74, 0x65, 0x73, 0x74, 0xea, 0x75, 0x04, 0x08, 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0xd0, 0xde, 0x1f, + 0x01, 0x52, 0x03, 0x73, 0x75, 0x62, 0x12, 0x57, 0x0a, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, + 0x73, 0x75, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, 0x74, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, + 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, + 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x08, 0xc8, 0xde, 0x1f, + 0x00, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x08, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x75, 0x62, 0x42, + 0x40, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, + 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, + 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, + 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/test/golang/scalars.pb.go b/test/golang/scalars.pb.go index 6d851640..7b81edbf 100644 --- a/test/golang/scalars.pb.go +++ b/test/golang/scalars.pb.go @@ -1214,11 +1214,11 @@ var file_scalars_proto_rawDesc = []byte{ 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x42, 0x3f, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x38, 0x01, 0x42, 0x40, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, - 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0xea, 0x75, 0x04, 0x08, - 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0xea, 0xaa, 0x19, 0x04, + 0x08, 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/test/golang/wkts.pb.go b/test/golang/wkts.pb.go index eef9b059..01bd1185 100644 --- a/test/golang/wkts.pb.go +++ b/test/golang/wkts.pb.go @@ -924,438 +924,438 @@ var file_wkts_proto_rawDesc = []byte{ 0x14, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, - 0x3c, 0x0a, 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, + 0x3d, 0x0a, 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x3a, 0x07, 0xea, 0x75, 0x04, 0x08, 0x00, 0x10, 0x00, 0x22, 0x89, 0x11, - 0x0a, 0x0f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, - 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, - 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, + 0x73, 0x61, 0x67, 0x65, 0x3a, 0x08, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x00, 0x10, 0x00, 0x22, 0x89, + 0x11, 0x0a, 0x0f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, + 0x54, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, + 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, + 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, - 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, - 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, + 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x3e, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x3e, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, - 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, - 0x3f, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x41, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, - 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, - 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, - 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, - 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, - 0x3f, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x41, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x12, 0x3f, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, + 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, + 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, + 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, + 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, + 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x12, 0x3f, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0a, - 0x65, 0x6d, 0x70, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x65, 0x6d, - 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x10, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x16, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x10, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x19, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0e, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, - 0x11, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, - 0x0a, 0x0c, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1c, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x10, 0x6c, 0x69, 0x73, - 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1d, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x0e, 0x6c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x46, 0x0a, 0x11, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x6c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x18, 0x20, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, - 0x75, 0x63, 0x74, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x12, 0x31, 0x0a, 0x09, 0x61, 0x6e, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x21, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x61, 0x6e, 0x79, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x61, 0x6e, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x22, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, - 0x61, 0x6e, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xec, 0x08, 0x0a, 0x14, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x57, 0x4b, - 0x54, 0x73, 0x12, 0x41, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, - 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, - 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, 0x74, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, - 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, - 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, - 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x75, 0x69, 0x6e, - 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, - 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, - 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x62, - 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, + 0x0a, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x62, - 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x10, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, + 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x10, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x19, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0e, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, + 0x0a, 0x11, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x39, 0x0a, 0x0c, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, + 0x1c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x10, 0x6c, 0x69, + 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1d, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x0e, 0x6c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x46, 0x0a, 0x11, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x6c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x75, + 0x63, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x62, - 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, - 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x65, - 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x6d, 0x70, 0x74, - 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x20, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x75, 0x63, 0x74, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x12, 0x31, 0x0a, 0x09, 0x61, 0x6e, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x61, 0x6e, 0x79, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x61, 0x6e, 0x79, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x22, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, + 0x09, 0x61, 0x6e, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xec, 0x08, 0x0a, 0x14, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x57, + 0x4b, 0x54, 0x73, 0x12, 0x41, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, + 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, + 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, + 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, + 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, + 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, + 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, + 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, + 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x75, 0x69, + 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x75, 0x69, 0x6e, + 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, + 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0a, + 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, + 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, + 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, + 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0b, + 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x0e, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, + 0x0a, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x46, 0x0a, 0x10, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x0e, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x0e, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, - 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x48, 0x00, 0x52, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x46, 0x0a, 0x10, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x0e, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x4d, 0x61, 0x73, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x6c, + 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, + 0x0c, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0b, + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x61, + 0x6e, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x6c, 0x69, - 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, 0x0c, - 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x10, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x73, - 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x6e, - 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x41, 0x6e, 0x79, 0x48, 0x00, 0x52, 0x08, 0x61, 0x6e, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, - 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xfa, 0x1a, 0x0a, 0x12, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x12, - 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, - 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, - 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, - 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, - 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32, - 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, - 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, - 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, - 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, - 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x68, - 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, - 0x6d, 0x61, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, 0x74, - 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, - 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, - 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x06, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, - 0x61, 0x70, 0x12, 0x62, 0x0a, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x6f, 0x6f, - 0x6c, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x74, 0x68, + 0x2e, 0x41, 0x6e, 0x79, 0x48, 0x00, 0x52, 0x08, 0x61, 0x6e, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xfa, 0x1a, 0x0a, 0x12, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, + 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, + 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, - 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, - 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x08, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, - 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, - 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, - 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, - 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, + 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, + 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x33, + 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, + 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, + 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, + 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, - 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, - 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0a, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, - 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, - 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x61, 0x70, 0x12, 0x71, - 0x0a, 0x14, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, + 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x4d, 0x61, 0x70, 0x12, 0x62, 0x0a, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x6f, + 0x6f, 0x6c, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, - 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x73, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x61, - 0x70, 0x12, 0x6e, 0x0a, 0x13, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, - 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, - 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, - 0x70, 0x12, 0x72, 0x0a, 0x15, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, - 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, - 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x12, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, - 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, - 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x72, 0x0a, 0x15, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, - 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, - 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, - 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, + 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x6c, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x08, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, + 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, + 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, - 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x5f, 0x0a, 0x0e, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x6e, 0x79, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x11, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0a, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x41, 0x6e, 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x73, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x79, 0x4d, 0x61, 0x70, 0x1a, 0x60, 0x0a, 0x14, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, 0x0a, - 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, 0x0a, - 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, 0x0a, - 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, + 0x6e, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x61, 0x70, 0x12, + 0x71, 0x0a, 0x14, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, + 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, + 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, + 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x13, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, + 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, + 0x61, 0x70, 0x12, 0x72, 0x0a, 0x15, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0d, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x12, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, + 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, + 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x72, 0x0a, + 0x15, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, + 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, + 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, + 0x70, 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x72, 0x75, + 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, + 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, + 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x75, + 0x63, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x5f, 0x0a, 0x0e, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x6e, 0x79, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x11, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x79, 0x4d, 0x61, 0x70, 0x1a, 0x60, 0x0a, 0x14, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x60, 0x0a, - 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, + 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x60, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, - 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x1a, 0x5c, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x60, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x1a, 0x5e, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, + 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, + 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x60, + 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, + 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x60, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x1a, 0x59, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, + 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x5c, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x61, 0x0a, 0x17, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x5f, 0x0a, 0x16, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x1a, 0x61, 0x0a, 0x17, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, - 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x1a, 0x59, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x60, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x5e, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x59, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x61, 0x0a, + 0x17, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x5f, 0x0a, 0x16, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x61, 0x0a, 0x17, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x4d, 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x59, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x61, 0x0a, 0x17, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x61, - 0x0a, 0x17, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x1a, 0x5b, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x75, 0x63, - 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, - 0x75, 0x63, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x55, - 0x0a, 0x11, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x3f, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, - 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, - 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0xea, - 0x75, 0x04, 0x08, 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x5b, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x75, + 0x63, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x75, 0x63, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x55, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x79, 0x4d, 0x61, 0x70, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x40, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, + 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, + 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, + 0xea, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( From 07d1f9fbd07059702117f8e3cfb99d7fb26477cb Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Thu, 4 Nov 2021 15:47:06 +0100 Subject: [PATCH 03/46] Write Infinity and NaN floats as strings --- jsonplugin/marshal.go | 23 +++++++++++++++++++++++ jsonplugin/marshal_test.go | 25 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/jsonplugin/marshal.go b/jsonplugin/marshal.go index ca43b360..dc4c19f3 100644 --- a/jsonplugin/marshal.go +++ b/jsonplugin/marshal.go @@ -6,6 +6,7 @@ package jsonplugin import ( "encoding/base64" "fmt" + "math" "strconv" "strings" "time" @@ -157,6 +158,17 @@ func (s *MarshalState) WriteFloat32(v float32) { if s.Err() != nil { return } + switch { + case math.IsInf(float64(v), 1): + s.inner.WriteString("Infinity") + return + case math.IsInf(float64(v), -1): + s.inner.WriteString("-Infinity") + return + case math.IsNaN(float64(v)): + s.inner.WriteString("NaN") + return + } s.inner.WriteFloat32(v) } @@ -165,6 +177,17 @@ func (s *MarshalState) WriteFloat64(v float64) { if s.Err() != nil { return } + switch { + case math.IsInf(v, 1): + s.inner.WriteString("Infinity") + return + case math.IsInf(v, -1): + s.inner.WriteString("-Infinity") + return + case math.IsNaN(v): + s.inner.WriteString("NaN") + return + } s.inner.WriteFloat64(v) } diff --git a/jsonplugin/marshal_test.go b/jsonplugin/marshal_test.go index 01e380f6..919a9e46 100644 --- a/jsonplugin/marshal_test.go +++ b/jsonplugin/marshal_test.go @@ -4,6 +4,7 @@ package jsonplugin_test import ( + "math" "testing" "time" @@ -49,6 +50,30 @@ func TestMarshaler(t *testing.T) { s.WriteFloat64Array([]float64{-12.34, 56.78}) }, `[-12.34,56.78]`) + testMarshal(t, func(s *MarshalState) { + s.WriteFloat32(float32(math.NaN())) + }, `"NaN"`) + + testMarshal(t, func(s *MarshalState) { + s.WriteFloat64(math.NaN()) + }, `"NaN"`) + + testMarshal(t, func(s *MarshalState) { + s.WriteFloat32(float32(math.Inf(-1))) + }, `"-Infinity"`) + + testMarshal(t, func(s *MarshalState) { + s.WriteFloat64(math.Inf(-1)) + }, `"-Infinity"`) + + testMarshal(t, func(s *MarshalState) { + s.WriteFloat32(float32(math.Inf(1))) + }, `"Infinity"`) + + testMarshal(t, func(s *MarshalState) { + s.WriteFloat64(math.Inf(1)) + }, `"Infinity"`) + // int testMarshal(t, func(s *MarshalState) { From 14b00c7aced157d96b465e404daff85b05aa07a6 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 23 Nov 2021 13:09:58 +0100 Subject: [PATCH 04/46] Fix marshaling of WKTs inside google.protobuf.Any --- gogo/gogo.go | 92 +++++++++++++++++++++++++++++++++------- golang/golang.go | 92 +++++++++++++++++++++++++++++++++------- test/gogo/wkts_test.go | 20 +++++++++ test/golang/wkts_test.go | 20 +++++++++ 4 files changed, 194 insertions(+), 30 deletions(-) diff --git a/gogo/gogo.go b/gogo/gogo.go index 9d06412c..60ef94c4 100644 --- a/gogo/gogo.go +++ b/gogo/gogo.go @@ -74,7 +74,11 @@ func MarshalAny(s *jsonplugin.MarshalState, v *types.Any) { s.SetErrorf("failed to unmarshal wrapped message from Any: %w", err) } - if marshaler, ok := msg.(jsonplugin.Marshaler); ok { + switch marshaler := msg.(type) { + default: + // If v doesn't implement jsonplugin.Marshaler, delegate to gogo jsonpb. + MarshalMessage(s, v) + case jsonplugin.Marshaler: // Instantiate a sub-marshaler with the same configuration and marshal the wrapped message to that. sub := s.Sub() marshaler.MarshalProtoJSON(sub) @@ -116,11 +120,41 @@ func MarshalAny(s *jsonplugin.MarshalState, v *types.Any) { // Write the rest of the buffer (the sub-object without the { character). s.Write(buf.Bytes()) - return - } + case *types.Duration, + *types.FieldMask, + *types.Struct, + *types.Value, + *types.ListValue, + *types.Timestamp: - // If v doesn't implement jsonplugin.Marshaler, delegate to gogo jsonpb. - MarshalMessage(s, v) + // Write the opening { and the type field to the main marshaler. + s.WriteObjectStart() + s.WriteObjectField("@type") + s.WriteString(v.GetTypeUrl()) + + // Write the comma, and the next field, which is always "value" for these types. + s.WriteMore() + s.WriteObjectField("value") + + // Write the value. + switch msg := msg.(type) { + case *types.Duration: + MarshalDuration(s, msg) + case *types.FieldMask: + MarshalFieldMask(s, msg) + case *types.Struct: + MarshalStruct(s, msg) + case *types.Value: + MarshalValue(s, msg) + case *types.ListValue: + MarshalListValue(s, msg) + case *types.Timestamp: + MarshalTimestamp(s, msg) + } + + // Write the closing }. + s.WriteObjectEnd() + } } // UnmarshalAny unmarshals an Any WKT. @@ -161,21 +195,49 @@ func UnmarshalAny(s *jsonplugin.UnmarshalState) *types.Any { // Allocate a new message of that type. msg := reflect.New(t.Elem()).Interface().(proto.Message) - if unmarshaler, ok := msg.(jsonplugin.Unmarshaler); ok { - // Create another sub-unmarshaler for the raw data and unmarshal the message. - sub := s.Sub(data) - unmarshaler.UnmarshalProtoJSON(sub) - if err := sub.Err(); err != nil { - return nil - } - } else { + switch unmarshaler := msg.(type) { + default: // Delegate unmarshaling to gogo jsonpb. + var any types.Any if err := (&jsonpb.Unmarshaler{ AllowUnknownFields: true, - }).Unmarshal(bytes.NewBuffer(data), msg); err != nil { - s.SetErrorf("failed to unmarshal Any to JSON: %w", err) + }).Unmarshal(bytes.NewBuffer(data), &any); err != nil { + s.SetErrorf("failed to unmarshal Any from JSON: %w", err) + return nil + } + return &any + case jsonplugin.Unmarshaler: + // Create another sub-unmarshaler for the raw data and unmarshal the message. + sub = s.Sub(data) + unmarshaler.UnmarshalProtoJSON(sub) + case *types.Duration, + *types.FieldMask, + *types.Struct, + *types.Value, + *types.ListValue, + *types.Timestamp: + if field := sub.ReadObjectField(); field != "value" { + s.SetErrorf("unexpected %q field in Any", field) return nil } + switch msg.(type) { + case *types.Duration: + msg = UnmarshalDuration(sub) + case *types.FieldMask: + msg = UnmarshalFieldMask(sub) + case *types.Struct: + msg = UnmarshalStruct(sub) + case *types.Value: + msg = UnmarshalValue(sub) + case *types.ListValue: + msg = UnmarshalListValue(sub) + case *types.Timestamp: + msg = UnmarshalTimestamp(sub) + } + } + + if err := sub.Err(); err != nil { + return nil } // Wrap the unmarshaled message in an Any and return that. diff --git a/golang/golang.go b/golang/golang.go index 45eaece9..4baf2086 100644 --- a/golang/golang.go +++ b/golang/golang.go @@ -75,7 +75,11 @@ func MarshalAny(s *jsonplugin.MarshalState, v *anypb.Any) { s.SetErrorf("failed to unmarshal wrapped message from Any: %w", err) } - if marshaler, ok := msg.(jsonplugin.Marshaler); ok { + switch marshaler := msg.(type) { + default: + // If v doesn't implement jsonplugin.Marshaler, delegate to protojson. + MarshalMessage(s, v) + case jsonplugin.Marshaler: // Instantiate a sub-marshaler with the same configuration and marshal the wrapped message to that. sub := s.Sub() marshaler.MarshalProtoJSON(sub) @@ -117,11 +121,41 @@ func MarshalAny(s *jsonplugin.MarshalState, v *anypb.Any) { // Write the rest of the buffer (the sub-object without the { character). s.Write(buf.Bytes()) - return - } + case *durationpb.Duration, + *fieldmaskpb.FieldMask, + *structpb.Struct, + *structpb.Value, + *structpb.ListValue, + *timestamppb.Timestamp: - // If v doesn't implement jsonplugin.Marshaler, delegate to protojson. - MarshalMessage(s, v) + // Write the opening { and the type field to the main marshaler. + s.WriteObjectStart() + s.WriteObjectField("@type") + s.WriteString(v.GetTypeUrl()) + + // Write the comma, and the next field, which is always "value" for these types. + s.WriteMore() + s.WriteObjectField("value") + + // Write the value. + switch msg := msg.(type) { + case *durationpb.Duration: + MarshalDuration(s, msg) + case *fieldmaskpb.FieldMask: + MarshalFieldMask(s, msg) + case *structpb.Struct: + MarshalStruct(s, msg) + case *structpb.Value: + MarshalValue(s, msg) + case *structpb.ListValue: + MarshalListValue(s, msg) + case *timestamppb.Timestamp: + MarshalTimestamp(s, msg) + } + + // Write the closing }. + s.WriteObjectEnd() + } } // UnmarshalAny unmarshals an Any WKT. @@ -157,21 +191,49 @@ func UnmarshalAny(s *jsonplugin.UnmarshalState) *anypb.Any { // Allocate a new message of that type. msg := t.New().Interface() - if unmarshaler, ok := msg.(jsonplugin.Unmarshaler); ok { - // Create another sub-unmarshaler for the raw data and unmarshal the message. - sub := s.Sub(data) - unmarshaler.UnmarshalProtoJSON(sub) - if err := sub.Err(); err != nil { - return nil - } - } else { + switch unmarshaler := msg.(type) { + default: // Delegate unmarshaling to protojson. + var any anypb.Any if err := (&protojson.UnmarshalOptions{ DiscardUnknown: true, - }).Unmarshal(data, msg); err != nil { - s.SetErrorf("failed to unmarshal Any to JSON: %w", err) + }).Unmarshal(data, &any); err != nil { + s.SetErrorf("failed to unmarshal Any from JSON: %w", err) + return nil + } + return &any + case jsonplugin.Unmarshaler: + // Create another sub-unmarshaler for the raw data and unmarshal the message. + sub = s.Sub(data) + unmarshaler.UnmarshalProtoJSON(sub) + case *durationpb.Duration, + *fieldmaskpb.FieldMask, + *structpb.Struct, + *structpb.Value, + *structpb.ListValue, + *timestamppb.Timestamp: + if field := sub.ReadObjectField(); field != "value" { + s.SetErrorf("unexpected %q field in Any", field) return nil } + switch msg.(type) { + case *durationpb.Duration: + msg = UnmarshalDuration(sub) + case *fieldmaskpb.FieldMask: + msg = UnmarshalFieldMask(sub) + case *structpb.Struct: + msg = UnmarshalStruct(sub) + case *structpb.Value: + msg = UnmarshalValue(sub) + case *structpb.ListValue: + msg = UnmarshalListValue(sub) + case *timestamppb.Timestamp: + msg = UnmarshalTimestamp(sub) + } + } + + if err := sub.Err(); err != nil { + return nil } // Wrap the unmarshaled message in an Any and return that. diff --git a/test/gogo/wkts_test.go b/test/gogo/wkts_test.go index d6e848e8..c3177d2b 100644 --- a/test/gogo/wkts_test.go +++ b/test/gogo/wkts_test.go @@ -255,6 +255,10 @@ var testMessagesWithWKTs = []struct { AnyValues: []*types.Any{ mustAny(&MessageWithMarshaler{Message: "hello"}), mustAny(&MessageWithoutMarshaler{Message: "hello"}), + mustAny(mustTimestamp(testTime)), + mustAny(mustDuration(testDuration)), + mustAny(&types.FieldMask{Paths: []string{"foo.bar", "bar", "baz.qux"}}), + mustAny(&types.Value{Kind: &types.Value_StringValue{StringValue: "foo"}}), }, }, expected: `{ @@ -334,6 +338,22 @@ var testMessagesWithWKTs = []struct { { "@type": "type.googleapis.com/thethings.json.test.MessageWithoutMarshaler", "message": "hello" + }, + { + "@type":"type.googleapis.com/google.protobuf.Timestamp", + "value":"2006-01-02T08:04:05.123456789Z" + }, + { + "@type":"type.googleapis.com/google.protobuf.Duration", + "value":"3723.123456789s" + }, + { + "@type":"type.googleapis.com/google.protobuf.FieldMask", + "value": "foo.bar,bar,baz.qux" + }, + { + "@type":"type.googleapis.com/google.protobuf.Value", + "value":"foo" } ] }`, diff --git a/test/golang/wkts_test.go b/test/golang/wkts_test.go index b0a8193e..c15f593e 100644 --- a/test/golang/wkts_test.go +++ b/test/golang/wkts_test.go @@ -257,6 +257,10 @@ var testMessagesWithWKTs = []struct { AnyValues: []*anypb.Any{ mustAny(&MessageWithMarshaler{Message: "hello"}), mustAny(&MessageWithoutMarshaler{Message: "hello"}), + mustAny(mustTimestamp(testTime)), + mustAny(mustDuration(testDuration)), + mustAny(&fieldmaskpb.FieldMask{Paths: []string{"foo.bar", "bar", "baz.qux"}}), + mustAny(&structpb.Value{Kind: &structpb.Value_StringValue{StringValue: "foo"}}), }, }, expected: `{ @@ -336,6 +340,22 @@ var testMessagesWithWKTs = []struct { { "@type": "type.googleapis.com/thethings.json.test.MessageWithoutMarshaler", "message": "hello" + }, + { + "@type":"type.googleapis.com/google.protobuf.Timestamp", + "value":"2006-01-02T08:04:05.123456789Z" + }, + { + "@type":"type.googleapis.com/google.protobuf.Duration", + "value":"3723.123456789s" + }, + { + "@type":"type.googleapis.com/google.protobuf.FieldMask", + "value": "foo.bar,bar,baz.qux" + }, + { + "@type":"type.googleapis.com/google.protobuf.Value", + "value":"foo" } ] }`, From 2b94174606c943fae2781bb64a11714fb83e79c9 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 23 Nov 2021 17:16:13 +0100 Subject: [PATCH 05/46] Assert object end on Any and FieldMask objects --- gogo/gogo.go | 5 +++++ golang/golang.go | 5 +++++ jsonplugin/unmarshal.go | 23 ++++++++++++++++++----- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/gogo/gogo.go b/gogo/gogo.go index 60ef94c4..fe57f30b 100644 --- a/gogo/gogo.go +++ b/gogo/gogo.go @@ -240,6 +240,11 @@ func UnmarshalAny(s *jsonplugin.UnmarshalState) *types.Any { return nil } + if field := sub.ReadObjectField(); field != "" { + s.SetErrorf("unexpected %q field in Any", field) + return nil + } + // Wrap the unmarshaled message in an Any and return that. v, err := types.MarshalAny(msg) if err != nil { diff --git a/golang/golang.go b/golang/golang.go index 4baf2086..87325a1d 100644 --- a/golang/golang.go +++ b/golang/golang.go @@ -236,6 +236,11 @@ func UnmarshalAny(s *jsonplugin.UnmarshalState) *anypb.Any { return nil } + if field := sub.ReadObjectField(); field != "" { + s.SetErrorf("unexpected %q field in Any", field) + return nil + } + // Wrap the unmarshaled message in an Any and return that. v, err := anypb.New(msg) if err != nil { diff --git a/jsonplugin/unmarshal.go b/jsonplugin/unmarshal.go index 3450ac76..9d27bc1f 100644 --- a/jsonplugin/unmarshal.go +++ b/jsonplugin/unmarshal.go @@ -452,6 +452,7 @@ func (s *UnmarshalState) ReadNil() bool { } // ReadObjectField reads a single object field. +// An empty string indicates the end of the object. func (s *UnmarshalState) ReadObjectField() string { if s.Err() != nil { return "" @@ -622,13 +623,25 @@ func (s *UnmarshalState) ReadFieldMask() FieldMask { next := s.inner.WhatIsNext() switch next { case jsoniter.StringValue: - return newPathSlice(strings.Split(s.ReadString(), ",")...) + mask := newPathSlice(strings.Split(s.ReadString(), ",")...) + if s.Err() != nil { + return nil + } + return mask case jsoniter.ObjectValue: - if s.ReadObjectField() != "paths" { - s.inner.ReadAny() - break + if field := s.ReadObjectField(); field != "paths" { + s.SetErrorf("unexpected %q field in FieldMask object", field) + return nil + } + mask := newPathSlice(s.ReadStringArray()...) + if s.Err() != nil { + return nil + } + if field := s.ReadObjectField(); field != "" { + s.SetErrorf("unexpected %q field in FieldMask object", field) + return nil } - return newPathSlice(s.ReadStringArray()...) + return mask } s.SetErrorf("invalid value type for field mask: %s", valueTypeString(next)) return nil From 0f333e1194a1dff9fc2e9f9e6bafeff22e78557a Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 23 Nov 2021 17:16:32 +0100 Subject: [PATCH 06/46] Add tests for field mask unmarshaling --- jsonplugin/unmarshal_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jsonplugin/unmarshal_test.go b/jsonplugin/unmarshal_test.go index 20176fb2..09d763cc 100644 --- a/jsonplugin/unmarshal_test.go +++ b/jsonplugin/unmarshal_test.go @@ -238,4 +238,14 @@ func TestUnmarshaler(t *testing.T) { testUnmarshal(t, func(s *UnmarshalState) interface{} { return s.ReadDuration() }, `"3723s"`, testDuration.Truncate(1000000000)) + + // field mask + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadFieldMask().GetPaths() + }, `"foo,bar,baz.qux"`, []string{"foo", "bar", "baz.qux"}) + + testUnmarshal(t, func(s *UnmarshalState) interface{} { + return s.ReadFieldMask().GetPaths() + }, `{"paths":["foo","bar","baz.qux"]}`, []string{"foo", "bar", "baz.qux"}) } From 578a2d743a031d79c26ec96fe64c65f99c07adae Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Mon, 27 Dec 2021 09:31:29 +0100 Subject: [PATCH 07/46] Install protoc-gen-gogo in development environment --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1b0fe560..d4facdf6 100644 --- a/Makefile +++ b/Makefile @@ -64,9 +64,12 @@ endif unzip -o .dev/gogoproto/gogoproto.zip protobuf-master/protobuf/google/protobuf/*.proto -d .dev/gogoproto mv .dev/gogoproto/protobuf-master/protobuf/google/protobuf/*.proto .dev/gogoproto/include/google/protobuf/ +.dev/gogoproto/bin/protoc-gen-gogo: + go build -o $@ github.com/gogo/protobuf/protoc-gen-gogo + .PHONY: testprotos -testprotos: build .dev/golangproto/bin/protoc .dev/gogoproto/bin/protoc +testprotos: build .dev/golangproto/bin/protoc .dev/gogoproto/bin/protoc .dev/gogoproto/bin/protoc-gen-gogo PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I ./test -I . \ --go_opt=paths=source_relative --go_out=./test/golang \ --go-json_opt=paths=source_relative --go-json_out=./test/golang \ From 50124dd21c4fd8a70fd8ef26c86efdcf210a8647 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 4 Jan 2022 13:52:20 +0100 Subject: [PATCH 08/46] Allow custom (un)marshaler funcs with lang=gogo --- internal/gen/messages_marshaler.go | 9 +- internal/gen/messages_unmarshaler.go | 153 ++++---- test/gogo/scalars.pb.go | 229 +++++++----- test/gogo/scalars_json.pb.go | 34 ++ test/gogo/scalars_test.go | 43 ++- test/golang/scalars.pb.go | 514 ++++++++++++++++----------- test/golang/scalars_json.pb.go | 34 ++ test/golang/scalars_test.go | 43 ++- test/scalars.proto | 26 ++ test/types/eui.go | 22 ++ 10 files changed, 729 insertions(+), 378 deletions(-) diff --git a/internal/gen/messages_marshaler.go b/internal/gen/messages_marshaler.go index 4da3cc19..0f8fe309 100644 --- a/internal/gen/messages_marshaler.go +++ b/internal/gen/messages_marshaler.go @@ -135,8 +135,9 @@ nextField: fieldOpts := field.Desc.Options() if Params.Lang == "gogo" { pluginPackage = gogoPluginPackage - } else { - if proto.HasExtension(fieldOpts, annotations.E_Field) { + } + if proto.HasExtension(fieldOpts, annotations.E_Field) { + if customtype == nil { marshalerFunc = parseGoIdent(proto.GetExtension(field.Desc.Options(), annotations.E_Field).(*annotations.FieldOptions).GetMarshalerFunc()) } } @@ -156,7 +157,7 @@ nextField: // Write the field name and a colon. g.P(`s.WriteObjectField("`, field.Desc.Name(), `")`) - // If the map value has a custom marshaler, call that and continue with the next field. + // If the field has a custom marshaler, call that and continue with the next field. if marshalerFunc != nil { g.P(*marshalerFunc, `(s.WithField("`, field.Desc.Name(), `"), x.`, fieldGoName, ")") g.P("}") // end if x.{fieldGoName} != nil { @@ -365,7 +366,7 @@ nextField: if marshalerFunc != nil { // If the field has a custom marshaler, call that. - g.P(*marshalerFunc, `(s.WithField("`, field.Desc.Name(), `"), x.`, fieldGoName, ")") + g.P(*marshalerFunc, `(s.WithField("`, field.Desc.Name(), `"), `, messageOrOneofIdent, `.`, fieldGoName, ")") } else if customtype != nil { // If the field has a custom type, call MarshalProtoJSON for it. g.P(messageOrOneofIdent, ".", fieldGoName, `.MarshalProtoJSON(s.WithField("`, field.Desc.Name(), `"))`) diff --git a/internal/gen/messages_unmarshaler.go b/internal/gen/messages_unmarshaler.go index bf3f08b1..2bef032e 100644 --- a/internal/gen/messages_unmarshaler.go +++ b/internal/gen/messages_unmarshaler.go @@ -134,8 +134,9 @@ nextField: fieldOpts := field.Desc.Options() if Params.Lang == "gogo" { pluginPackage = gogoPluginPackage - } else { - if proto.HasExtension(fieldOpts, annotations.E_Field) { + } + if proto.HasExtension(fieldOpts, annotations.E_Field) { + if customtype == nil { unmarshalerFunc = parseGoIdent(proto.GetExtension(field.Desc.Options(), annotations.E_Field).(*annotations.FieldOptions).GetUnmarshalerFunc()) } } @@ -156,13 +157,13 @@ nextField: g.P(`s.AddField("`, field.Desc.Name(), `")`) } - // If the field has a custom unmarshaler, call that and continue with the next field. - if unmarshalerFunc != nil { - g.P("x.", fieldGoName, " = ", *unmarshalerFunc, `(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) - continue nextField - } - if field.Desc.IsMap() { + // If the field has a custom unmarshaler, call that and continue with the next field. + if unmarshalerFunc != nil { + g.P("x.", fieldGoName, " = ", *unmarshalerFunc, `(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) + continue nextField + } + // If the field is a map, the field type is a MapEntry message. // In the MapEntry message, the first field is the key, and the second field is the value. key := field.Message.Fields[0] @@ -230,6 +231,11 @@ nextField: } if field.Desc.IsList() { + // If the field has a custom unmarshaler, call that and continue with the next field. + if unmarshalerFunc != nil { + g.P("x.", fieldGoName, " = ", *unmarshalerFunc, `(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) + continue nextField + } if customtype != nil { // If the field has a custom type, for each element, we will // allocate a zero value, call the unmarshaler and append the value to the list. @@ -238,73 +244,73 @@ nextField: g.P(`v.UnmarshalProtoJSON(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", v)") g.P("})") - } else { - switch field.Desc.Kind() { - default: - // Lists of scalar types can be read by the library. - g.P("x.", fieldGoName, " = s.Read", g.libNameForField(field), "Array()") - case protoreflect.EnumKind: - g.P("s.ReadArray(func() {") - if g.enumHasUnmarshaler(field.Enum) { - // If the list value is of type enum, and the enum has an unmarshaler, - // allocate a zero enum, call the unmarshaler, and append the enum to the list. - g.P("var v ", field.Enum.GoIdent) - g.P(`v.UnmarshalProtoJSON(s)`) - g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", v)") - } else { - // Otherwise we let the library read the enum. - g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", ", field.Enum.GoIdent, "(s.ReadEnum(", field.Enum.GoIdent, "_value)))") - } - g.P("})") // end s.ReadArray() - case protoreflect.MessageKind: - g.P("s.ReadArray(func() {") - switch { - case g.messageHasUnmarshaler(field.Message): - if nullable { - // If we read nil, append nil and return so that we can continue with the next key. - g.P("if s.ReadNil() {") - g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", nil)") - g.P("return") - g.P("}") // end if s.ReadNil() { - } - // Allocate a zero message, call the unmarshaler and append the message to the list. - g.P("v := ", ifThenElse(nullable, "&", ""), field.Message.GoIdent, "{}") - g.P(`v.UnmarshalProtoJSON(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) - g.P("if s.Err() != nil {") - g.P("return") - g.P("}") - g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", v)") - case messageIsWrapper(field.Message): - if nullable { - // If we read nil, append nil and return so that we can continue with the next key. - g.P("if s.ReadNil() {") - g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", nil)") - g.P("return") - g.P("}") // end if s.ReadNil() { - } - // Read the wrapped value, and if successful, append the wrapped value to the list. - g.P("v := ", g.readWrapperValue(field.Message)) - g.P("if s.Err() != nil {") + continue nextField + } + switch field.Desc.Kind() { + default: + // Lists of scalar types can be read by the library. + g.P("x.", fieldGoName, " = s.Read", g.libNameForField(field), "Array()") + case protoreflect.EnumKind: + g.P("s.ReadArray(func() {") + if g.enumHasUnmarshaler(field.Enum) { + // If the list value is of type enum, and the enum has an unmarshaler, + // allocate a zero enum, call the unmarshaler, and append the enum to the list. + g.P("var v ", field.Enum.GoIdent) + g.P(`v.UnmarshalProtoJSON(s)`) + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", v)") + } else { + // Otherwise we let the library read the enum. + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", ", field.Enum.GoIdent, "(s.ReadEnum(", field.Enum.GoIdent, "_value)))") + } + g.P("})") // end s.ReadArray() + case protoreflect.MessageKind: + g.P("s.ReadArray(func() {") + switch { + case g.messageHasUnmarshaler(field.Message): + if nullable { + // If we read nil, append nil and return so that we can continue with the next key. + g.P("if s.ReadNil() {") + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", nil)") g.P("return") - g.P("}") - g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", &", field.Message.GoIdent, "{Value: v})") - case messageIsWKT(field.Message): - // If the list value is a WKT, read the WKT, and if successful, append it to the list. - g.P("v := ", g.readWKTValue(field, field.Message)) - g.P("if s.Err() != nil {") + g.P("}") // end if s.ReadNil() { + } + // Allocate a zero message, call the unmarshaler and append the message to the list. + g.P("v := ", ifThenElse(nullable, "&", ""), field.Message.GoIdent, "{}") + g.P(`v.UnmarshalProtoJSON(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) + g.P("if s.Err() != nil {") + g.P("return") + g.P("}") + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", v)") + case messageIsWrapper(field.Message): + if nullable { + // If we read nil, append nil and return so that we can continue with the next key. + g.P("if s.ReadNil() {") + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", nil)") g.P("return") - g.P("}") - g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", ", ifThenElse(nullable, "", "*"), "v)") - default: - // Otherwise, delegate to the library. - g.P("// NOTE: ", field.Message.GoIdent.GoName, " does not seem to implement UnmarshalProtoJSON.") - g.P("var v ", field.Message.GoIdent) - g.P(pluginPackage.Ident("UnmarshalMessage"), "(s, &v)") - g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", ", ifThenElse(nullable, "&", ""), "v)") + g.P("}") // end if s.ReadNil() { } - - g.P("})") // end s.ReadArray() + // Read the wrapped value, and if successful, append the wrapped value to the list. + g.P("v := ", g.readWrapperValue(field.Message)) + g.P("if s.Err() != nil {") + g.P("return") + g.P("}") + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", &", field.Message.GoIdent, "{Value: v})") + case messageIsWKT(field.Message): + // If the list value is a WKT, read the WKT, and if successful, append it to the list. + g.P("v := ", g.readWKTValue(field, field.Message)) + g.P("if s.Err() != nil {") + g.P("return") + g.P("}") + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", ", ifThenElse(nullable, "", "*"), "v)") + default: + // Otherwise, delegate to the library. + g.P("// NOTE: ", field.Message.GoIdent.GoName, " does not seem to implement UnmarshalProtoJSON.") + g.P("var v ", field.Message.GoIdent) + g.P(pluginPackage.Ident("UnmarshalMessage"), "(s, &v)") + g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", ", ifThenElse(nullable, "&", ""), "v)") } + + g.P("})") // end s.ReadArray() } continue nextField @@ -319,7 +325,10 @@ nextField: messageOrOneofIdent = "ov" } - if customtype != nil { + // If the field has a custom unmarshaler, call that + if unmarshalerFunc != nil { + g.P(messageOrOneofIdent, ".", fieldGoName, " = ", *unmarshalerFunc, `(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) + } else if customtype != nil { if nullable { g.P("if !s.ReadNil() {") // Set the field to a newly allocated custom type. diff --git a/test/gogo/scalars.pb.go b/test/gogo/scalars.pb.go index 3e778236..4cd1d36f 100644 --- a/test/gogo/scalars.pb.go +++ b/test/gogo/scalars.pb.go @@ -52,6 +52,8 @@ type MessageWithScalars struct { StringValues []string `protobuf:"bytes,28,rep,name=string_values,json=stringValues,proto3" json:"string_values,omitempty"` BytesValue []byte `protobuf:"bytes,29,opt,name=bytes_value,json=bytesValue,proto3" json:"bytes_value,omitempty"` BytesValues [][]byte `protobuf:"bytes,30,rep,name=bytes_values,json=bytesValues,proto3" json:"bytes_values,omitempty"` + HexBytesValue []byte `protobuf:"bytes,31,opt,name=hex_bytes_value,json=hexBytesValue,proto3" json:"hex_bytes_value,omitempty"` + HexBytesValues [][]byte `protobuf:"bytes,32,rep,name=hex_bytes_values,json=hexBytesValues,proto3" json:"hex_bytes_values,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -291,6 +293,20 @@ func (m *MessageWithScalars) GetBytesValues() [][]byte { return nil } +func (m *MessageWithScalars) GetHexBytesValue() []byte { + if m != nil { + return m.HexBytesValue + } + return nil +} + +func (m *MessageWithScalars) GetHexBytesValues() [][]byte { + if m != nil { + return m.HexBytesValues + } + return nil +} + type MessageWithOneofScalars struct { // Types that are valid to be assigned to Value: // *MessageWithOneofScalars_DoubleValue @@ -308,6 +324,7 @@ type MessageWithOneofScalars struct { // *MessageWithOneofScalars_BoolValue // *MessageWithOneofScalars_StringValue // *MessageWithOneofScalars_BytesValue + // *MessageWithOneofScalars_HexBytesValue Value isMessageWithOneofScalars_Value `protobuf_oneof:"value"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -387,6 +404,9 @@ type MessageWithOneofScalars_StringValue struct { type MessageWithOneofScalars_BytesValue struct { BytesValue []byte `protobuf:"bytes,15,opt,name=bytes_value,json=bytesValue,proto3,oneof" json:"bytes_value,omitempty"` } +type MessageWithOneofScalars_HexBytesValue struct { + HexBytesValue []byte `protobuf:"bytes,16,opt,name=hex_bytes_value,json=hexBytesValue,proto3,oneof" json:"hex_bytes_value,omitempty"` +} func (*MessageWithOneofScalars_DoubleValue) isMessageWithOneofScalars_Value() {} func (*MessageWithOneofScalars_FloatValue) isMessageWithOneofScalars_Value() {} @@ -403,6 +423,7 @@ func (*MessageWithOneofScalars_Sfixed64Value) isMessageWithOneofScalars_Value() func (*MessageWithOneofScalars_BoolValue) isMessageWithOneofScalars_Value() {} func (*MessageWithOneofScalars_StringValue) isMessageWithOneofScalars_Value() {} func (*MessageWithOneofScalars_BytesValue) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_HexBytesValue) isMessageWithOneofScalars_Value() {} func (m *MessageWithOneofScalars) GetValue() isMessageWithOneofScalars_Value { if m != nil { @@ -516,6 +537,13 @@ func (m *MessageWithOneofScalars) GetBytesValue() []byte { return nil } +func (m *MessageWithOneofScalars) GetHexBytesValue() []byte { + if x, ok := m.GetValue().(*MessageWithOneofScalars_HexBytesValue); ok { + return x.HexBytesValue + } + return nil +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*MessageWithOneofScalars) XXX_OneofWrappers() []interface{} { return []interface{}{ @@ -534,6 +562,7 @@ func (*MessageWithOneofScalars) XXX_OneofWrappers() []interface{} { (*MessageWithOneofScalars_BoolValue)(nil), (*MessageWithOneofScalars_StringValue)(nil), (*MessageWithOneofScalars_BytesValue)(nil), + (*MessageWithOneofScalars_HexBytesValue)(nil), } } @@ -564,6 +593,7 @@ type MessageWithScalarMaps struct { BoolStringMap map[bool]string `protobuf:"bytes,26,rep,name=bool_string_map,json=boolStringMap,proto3" json:"bool_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` StringStringMap map[string]string `protobuf:"bytes,27,rep,name=string_string_map,json=stringStringMap,proto3" json:"string_string_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` StringBytesMap map[string][]byte `protobuf:"bytes,29,rep,name=string_bytes_map,json=stringBytesMap,proto3" json:"string_bytes_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringHexBytesMap map[string][]byte `protobuf:"bytes,30,rep,name=string_hex_bytes_map,json=stringHexBytesMap,proto3" json:"string_hex_bytes_map,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:"-"` @@ -775,6 +805,13 @@ func (m *MessageWithScalarMaps) GetStringBytesMap() map[string][]byte { return nil } +func (m *MessageWithScalarMaps) GetStringHexBytesMap() map[string][]byte { + if m != nil { + return m.StringHexBytesMap + } + return nil +} + func init() { proto.RegisterType((*MessageWithScalars)(nil), "thethings.json.test.MessageWithScalars") proto.RegisterType((*MessageWithOneofScalars)(nil), "thethings.json.test.MessageWithOneofScalars") @@ -794,6 +831,7 @@ func init() { proto.RegisterMapType((map[string]uint32)(nil), "thethings.json.test.MessageWithScalarMaps.StringFixed32MapEntry") proto.RegisterMapType((map[string]uint64)(nil), "thethings.json.test.MessageWithScalarMaps.StringFixed64MapEntry") proto.RegisterMapType((map[string]float32)(nil), "thethings.json.test.MessageWithScalarMaps.StringFloatMapEntry") + proto.RegisterMapType((map[string][]byte)(nil), "thethings.json.test.MessageWithScalarMaps.StringHexBytesMapEntry") proto.RegisterMapType((map[string]int32)(nil), "thethings.json.test.MessageWithScalarMaps.StringInt32MapEntry") proto.RegisterMapType((map[string]int64)(nil), "thethings.json.test.MessageWithScalarMaps.StringInt64MapEntry") proto.RegisterMapType((map[string]int32)(nil), "thethings.json.test.MessageWithScalarMaps.StringSfixed32MapEntry") @@ -810,94 +848,105 @@ func init() { func init() { proto.RegisterFile("scalars.proto", fileDescriptor_5d1bcd1a4bdfc194) } var fileDescriptor_5d1bcd1a4bdfc194 = []byte{ - // 1416 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x59, 0xed, 0x6e, 0xdb, 0x36, - 0x17, 0x8e, 0x2c, 0x7f, 0x52, 0x92, 0x3f, 0x94, 0xa4, 0x55, 0xd3, 0xb7, 0x6f, 0x99, 0x66, 0xc3, - 0xf8, 0x27, 0x0e, 0xd0, 0x1a, 0xc6, 0x30, 0x60, 0x5b, 0x9a, 0x75, 0x43, 0xfa, 0x23, 0x18, 0x40, - 0xb7, 0x1b, 0xb0, 0x3f, 0x85, 0x9d, 0xc8, 0x1f, 0xab, 0x2b, 0x65, 0xa1, 0x34, 0x2c, 0x97, 0xb2, - 0x5b, 0xd8, 0xb5, 0x6c, 0x37, 0xb2, 0xab, 0x18, 0x48, 0x51, 0x12, 0x49, 0x31, 0x91, 0xe5, 0xfc, - 0x6b, 0x8f, 0x0e, 0x9e, 0xe7, 0x39, 0x7c, 0xce, 0x39, 0xa4, 0x11, 0xe0, 0x90, 0xcb, 0xe9, 0x7a, - 0x7a, 0x43, 0x86, 0xd7, 0x37, 0x61, 0x14, 0xba, 0xbb, 0xd1, 0xd2, 0x8f, 0x96, 0xab, 0x60, 0x41, - 0x86, 0xbf, 0x92, 0x30, 0x18, 0x46, 0x3e, 0x89, 0x0e, 0x06, 0xd3, 0x20, 0x08, 0xa3, 0x69, 0xb4, - 0x0a, 0x03, 0x9e, 0xf7, 0xe2, 0xef, 0x36, 0x70, 0x2f, 0x7c, 0x42, 0xa6, 0x0b, 0xff, 0xe7, 0x55, - 0xb4, 0x9c, 0x24, 0x20, 0xee, 0x21, 0xb0, 0xaf, 0xc2, 0x78, 0xb6, 0xf6, 0x3f, 0xfc, 0x3e, 0x5d, - 0xc7, 0xbe, 0x67, 0x40, 0x03, 0x19, 0xd8, 0x4a, 0x62, 0x3f, 0xd1, 0x90, 0x7b, 0x04, 0x1c, 0x31, - 0x85, 0x78, 0x35, 0x68, 0x22, 0x03, 0xdb, 0x42, 0x0e, 0x71, 0x9f, 0x03, 0x6b, 0xbe, 0x0e, 0xa7, - 0x11, 0x87, 0x31, 0xa1, 0x81, 0x6a, 0x18, 0xb0, 0x50, 0x82, 0x72, 0x08, 0x6c, 0x21, 0x81, 0x78, - 0x75, 0x68, 0xa2, 0x1a, 0xb6, 0xf2, 0x0c, 0x86, 0xb1, 0x0a, 0xa2, 0x57, 0x2f, 0x39, 0x46, 0x03, - 0x1a, 0xa8, 0x81, 0x01, 0x0b, 0x65, 0x18, 0x42, 0x02, 0xf1, 0x9a, 0xd0, 0x44, 0x0d, 0x6c, 0xe5, - 0x19, 0x29, 0xc6, 0x78, 0xc4, 0x31, 0x5a, 0xd0, 0x40, 0x26, 0xc3, 0x18, 0x8f, 0x44, 0x8c, 0x34, - 0x81, 0x78, 0x6d, 0x68, 0x22, 0x13, 0x5b, 0x79, 0x06, 0x3b, 0x93, 0x58, 0x14, 0xd2, 0x81, 0x06, - 0x72, 0xb0, 0x15, 0x0b, 0x4a, 0x8e, 0x80, 0x13, 0x4b, 0x52, 0x00, 0x34, 0x91, 0x83, 0xed, 0x58, - 0xd4, 0xc2, 0x71, 0x32, 0x31, 0x16, 0x34, 0x50, 0x3d, 0xc1, 0x49, 0xd5, 0x70, 0x9c, 0x5c, 0x8e, - 0x0d, 0x4d, 0x54, 0xc7, 0x76, 0xac, 0xe8, 0x21, 0xa2, 0x1e, 0x07, 0x1a, 0x68, 0x80, 0x2d, 0x22, - 0xeb, 0x21, 0x92, 0x9e, 0x2e, 0x34, 0xd1, 0x00, 0xdb, 0x44, 0xd1, 0x43, 0x44, 0x3d, 0x3d, 0x68, - 0x20, 0x37, 0xc1, 0x11, 0xf4, 0x10, 0x49, 0x4f, 0x1f, 0x9a, 0xc8, 0xc5, 0x36, 0x11, 0xf5, 0x1c, - 0x01, 0x67, 0xbe, 0xfa, 0xc3, 0xbf, 0xca, 0x04, 0x0d, 0xa0, 0x81, 0x5a, 0xd8, 0xe6, 0xc1, 0x04, - 0xe9, 0x73, 0xd0, 0x95, 0x92, 0x88, 0xe7, 0x42, 0x13, 0xb5, 0xb0, 0x23, 0x66, 0xe5, 0x58, 0x99, - 0xa8, 0x5d, 0x68, 0xa0, 0x26, 0xc7, 0x4a, 0x55, 0xa5, 0x58, 0xb9, 0xac, 0x3d, 0x68, 0xa2, 0x26, - 0x76, 0xc4, 0x2c, 0x42, 0xd3, 0x88, 0x2c, 0x6c, 0x1f, 0x1a, 0xa8, 0x87, 0x1d, 0x22, 0x29, 0xfb, - 0x02, 0xf4, 0x88, 0x22, 0xed, 0x11, 0x34, 0x51, 0x0f, 0x77, 0x89, 0xac, 0x2d, 0xc3, 0xcb, 0xc4, - 0x3d, 0x86, 0x06, 0xea, 0xa7, 0x78, 0xa9, 0xba, 0x0c, 0x2f, 0x97, 0xe7, 0x41, 0x13, 0xf5, 0x71, - 0x97, 0xc8, 0xfa, 0x9e, 0x01, 0x30, 0x0b, 0xc3, 0x35, 0xc7, 0x7a, 0x02, 0x0d, 0xd4, 0xc6, 0x1d, - 0x1a, 0x49, 0x70, 0x9e, 0x03, 0x2b, 0xff, 0x4c, 0xbc, 0x03, 0x68, 0xa2, 0x36, 0x06, 0xd9, 0xf7, - 0xc4, 0xbf, 0xe8, 0x66, 0x15, 0x2c, 0x38, 0xc2, 0x53, 0x68, 0xa0, 0x0e, 0xb6, 0x92, 0x58, 0xee, - 0x9f, 0x90, 0x42, 0xbc, 0xff, 0x41, 0x13, 0x75, 0xb0, 0x2d, 0xe4, 0xb0, 0x19, 0x99, 0xdd, 0x46, - 0x3e, 0xe1, 0x30, 0xcf, 0xa0, 0x81, 0x6c, 0x0c, 0x58, 0x28, 0x9b, 0x11, 0x21, 0x81, 0x78, 0xff, - 0x87, 0x26, 0xb2, 0xb1, 0x95, 0x67, 0x90, 0x17, 0xff, 0xd4, 0xc1, 0x63, 0x61, 0x9d, 0xfc, 0x18, - 0xf8, 0xe1, 0x3c, 0xdd, 0x29, 0x47, 0xba, 0x9d, 0x72, 0xbe, 0x23, 0x6f, 0x95, 0x43, 0x79, 0x61, - 0xd4, 0xe8, 0xc2, 0x38, 0xdf, 0x51, 0x56, 0x86, 0xb4, 0x0f, 0xe8, 0x4e, 0x69, 0xd0, 0x14, 0x69, - 0x23, 0x48, 0xe3, 0x5e, 0xa7, 0xe3, 0xce, 0x53, 0xf2, 0x96, 0x96, 0xa7, 0x99, 0xae, 0x15, 0x87, - 0xaa, 0x91, 0xe7, 0x59, 0x1e, 0xd5, 0x26, 0x1d, 0xd5, 0x34, 0x49, 0x40, 0x92, 0xe6, 0x90, 0x2e, - 0x97, 0x01, 0x4d, 0x92, 0x27, 0x51, 0x1e, 0xb2, 0x36, 0x1d, 0xb2, 0x34, 0x29, 0x6f, 0x68, 0x65, - 0x82, 0xe8, 0x8a, 0x69, 0x9d, 0xef, 0x14, 0x66, 0x48, 0x19, 0x0e, 0x40, 0x87, 0x23, 0x4b, 0xcb, - 0x1b, 0x50, 0xed, 0x7b, 0xba, 0x69, 0x7a, 0xe7, 0x3b, 0xc5, 0xce, 0x57, 0x1b, 0xda, 0xa6, 0x0d, - 0x9d, 0x27, 0xa6, 0x88, 0xcf, 0xa5, 0x4e, 0xa5, 0xfb, 0xa6, 0x7d, 0xbe, 0x23, 0xf6, 0xea, 0x91, - 0xd2, 0x8a, 0x5d, 0xda, 0x8a, 0xac, 0x4a, 0xa1, 0x19, 0x0f, 0xe5, 0x3e, 0xa3, 0xeb, 0xc6, 0xa6, - 0xe6, 0xe4, 0x7d, 0x74, 0xd6, 0x02, 0x0d, 0xf6, 0xf1, 0xc5, 0x9f, 0x9f, 0x81, 0xfd, 0xc2, 0xf5, - 0x74, 0x31, 0xbd, 0x26, 0xee, 0x47, 0x30, 0xe0, 0x54, 0xbc, 0xa9, 0x3e, 0x4d, 0xaf, 0x3d, 0x03, - 0x9a, 0xc8, 0x7a, 0xf9, 0xed, 0x50, 0x73, 0xf9, 0x0d, 0xb5, 0x30, 0xc3, 0x09, 0xc3, 0x78, 0xc3, - 0x20, 0x2e, 0xa6, 0xd7, 0xdf, 0x07, 0xd1, 0xcd, 0x2d, 0xee, 0x11, 0x39, 0xea, 0x2e, 0x41, 0x9f, - 0x93, 0x25, 0xcd, 0x49, 0xb9, 0x4c, 0xc6, 0xf5, 0x4d, 0x65, 0xae, 0x1f, 0x28, 0x42, 0x46, 0xd5, - 0x25, 0x52, 0x50, 0x60, 0x4a, 0x5a, 0x8a, 0x32, 0x35, 0xb6, 0x64, 0x7a, 0x4b, 0x11, 0x54, 0xa6, - 0x34, 0x48, 0x99, 0x12, 0x0a, 0xce, 0x47, 0x99, 0x9a, 0x95, 0x99, 0x18, 0x5c, 0x42, 0x97, 0x33, - 0xad, 0xa4, 0xa0, 0x5c, 0xd3, 0x78, 0xc4, 0x98, 0x5a, 0xdb, 0xd7, 0x34, 0x1e, 0x69, 0x6a, 0x62, - 0x41, 0x5e, 0xd3, 0x78, 0x24, 0xd6, 0xd4, 0xde, 0xa6, 0xa6, 0xf1, 0x48, 0x53, 0x93, 0x10, 0x14, - 0xda, 0x2f, 0xce, 0x8d, 0xea, 0x6c, 0xd9, 0x7e, 0xef, 0x57, 0x92, 0x53, 0xbc, 0xfd, 0xb2, 0x28, - 0x25, 0x8b, 0x0b, 0x5e, 0x81, 0xca, 0x64, 0xef, 0x57, 0x1a, 0xb3, 0x7a, 0xb1, 0xe2, 0x96, 0x5c, - 0x19, 0xb7, 0xcb, 0x7a, 0x40, 0x65, 0x82, 0x5f, 0x42, 0x65, 0x89, 0x61, 0xbc, 0x32, 0xd9, 0x31, - 0x7b, 0xab, 0xca, 0x0a, 0x96, 0xf5, 0xe2, 0x3b, 0x3d, 0x23, 0xb9, 0x67, 0xce, 0x96, 0x95, 0x4d, - 0xb4, 0x9e, 0x4d, 0x44, 0xcf, 0x48, 0xc1, 0xb3, 0x6e, 0x75, 0x32, 0xad, 0x67, 0xe4, 0x4e, 0xcf, - 0x48, 0xee, 0x59, 0xef, 0x01, 0x95, 0x15, 0x3d, 0x9b, 0x88, 0x9e, 0x91, 0x82, 0x67, 0xfd, 0xad, - 0x2a, 0x2b, 0x7a, 0x46, 0x14, 0xcf, 0x02, 0xe0, 0xa6, 0x9b, 0x97, 0x5f, 0x65, 0x94, 0x6d, 0xc0, - 0xd8, 0x4e, 0xab, 0xef, 0xde, 0x04, 0x23, 0xa3, 0xe3, 0x7b, 0x29, 0x0f, 0x53, 0xbe, 0x94, 0x48, - 0xa8, 0xce, 0xad, 0xcc, 0xc7, 0x21, 0x95, 0xf2, 0xfa, 0x73, 0x25, 0xac, 0xd6, 0xc7, 0xad, 0xdb, - 0x7d, 0x48, 0x7d, 0x82, 0x77, 0x62, 0x7d, 0x89, 0x79, 0x69, 0x7d, 0xb2, 0x7b, 0x7b, 0xdb, 0xd5, - 0x57, 0xb0, 0xaf, 0x3f, 0x57, 0xc2, 0xee, 0x6f, 0x60, 0x37, 0xed, 0x4c, 0xd1, 0xc0, 0x7d, 0x46, - 0xf8, 0xba, 0x7a, 0x6f, 0xce, 0x15, 0x07, 0x79, 0xdf, 0x0b, 0x71, 0x46, 0xa9, 0xf1, 0xf0, 0x51, - 0x75, 0xca, 0xb9, 0xd6, 0xc4, 0x01, 0x29, 0xb8, 0xa8, 0x56, 0xc9, 0x6d, 0x7c, 0xfc, 0xa0, 0x2a, - 0x05, 0x1f, 0xa5, 0x2a, 0x13, 0x23, 0xb3, 0x2a, 0x65, 0x27, 0xbd, 0x2d, 0xab, 0x2c, 0x58, 0x39, - 0x20, 0x05, 0x2f, 0x7d, 0xc0, 0x77, 0xc1, 0x07, 0xf6, 0x0a, 0xa4, 0x74, 0x4f, 0x18, 0xdd, 0xd7, - 0x95, 0x2b, 0x3c, 0x0b, 0xc3, 0x75, 0x46, 0xc5, 0x7f, 0x9b, 0xf0, 0x18, 0xa5, 0x61, 0xf8, 0x42, - 0x55, 0x07, 0x95, 0x69, 0x28, 0x98, 0x52, 0x91, 0x33, 0x13, 0x63, 0xe2, 0xce, 0xcc, 0x89, 0x9e, - 0x6e, 0xbb, 0x33, 0xd5, 0x35, 0x26, 0x47, 0x85, 0x27, 0x50, 0xf2, 0xf4, 0xa5, 0x5c, 0xcf, 0xb6, - 0x7c, 0x02, 0x9d, 0x51, 0x04, 0xf5, 0x09, 0x94, 0x06, 0x0f, 0xce, 0xc0, 0x9e, 0xee, 0x4d, 0xeb, - 0xf6, 0x81, 0xf9, 0xd1, 0xbf, 0x65, 0x3f, 0xba, 0x3a, 0x98, 0xfe, 0xd3, 0xdd, 0xe3, 0x8f, 0x6c, - 0xf6, 0x23, 0xcb, 0xc0, 0xc9, 0x7f, 0xbe, 0xaa, 0x7d, 0x69, 0x1c, 0xbc, 0x06, 0xbb, 0x9a, 0xb7, - 0x6a, 0x19, 0x44, 0x4d, 0x0b, 0x21, 0x3d, 0x42, 0xcb, 0x20, 0x1a, 0x0a, 0x84, 0xe6, 0x75, 0x29, - 0x42, 0x34, 0x34, 0x10, 0x9d, 0xbb, 0x54, 0xe4, 0xe3, 0x54, 0xa6, 0xc2, 0x2c, 0xaa, 0x50, 0xc7, - 0x43, 0x84, 0x30, 0xcb, 0x54, 0x64, 0x96, 0xc8, 0xef, 0xbc, 0x32, 0x19, 0x8e, 0x82, 0xa1, 0x7b, - 0xbe, 0x89, 0x18, 0x4e, 0x25, 0x1d, 0x9b, 0x1f, 0x47, 0x5d, 0xa3, 0xe3, 0xbe, 0xf3, 0xa8, 0x6f, - 0xac, 0x63, 0x52, 0xe9, 0x3c, 0x06, 0x2a, 0x46, 0xc9, 0x79, 0x0c, 0x2a, 0xe9, 0xd8, 0xfc, 0x3c, - 0x5c, 0x8d, 0x8e, 0xfb, 0xce, 0xc3, 0x2d, 0xd3, 0xf1, 0x1d, 0xd8, 0xd7, 0x3e, 0x4f, 0xca, 0x84, - 0xb4, 0x14, 0x10, 0xed, 0x9b, 0x43, 0x04, 0x69, 0x55, 0x53, 0xb2, 0xf9, 0x91, 0x34, 0x75, 0x4a, - 0xee, 0x3b, 0x93, 0x66, 0x99, 0x92, 0x37, 0xe0, 0x91, 0xfe, 0xc6, 0x2f, 0x93, 0xd2, 0x53, 0x51, - 0xe6, 0x65, 0xa7, 0xd2, 0xab, 0xa8, 0x65, 0xf3, 0x63, 0xe9, 0x6b, 0xb5, 0xdc, 0x77, 0x2e, 0xfd, - 0x32, 0x2d, 0xa7, 0xc0, 0x2d, 0xde, 0xa0, 0x65, 0x3a, 0xda, 0x0a, 0x42, 0xf1, 0x72, 0x14, 0x11, - 0xda, 0x9b, 0xcf, 0xcd, 0x9d, 0x18, 0x9d, 0x8d, 0x37, 0xb3, 0x74, 0x9b, 0x95, 0x41, 0xd8, 0x02, - 0xc4, 0xd9, 0xe9, 0xbf, 0x7f, 0x3d, 0xa9, 0xb7, 0x8d, 0xbe, 0xf1, 0xcb, 0x78, 0xb1, 0x8a, 0x96, - 0xf1, 0x6c, 0x78, 0x19, 0x7e, 0x3a, 0x79, 0xb7, 0xf4, 0xdf, 0xb1, 0xdb, 0xf4, 0x6d, 0x70, 0x15, - 0xd3, 0xbb, 0xd1, 0x27, 0x27, 0xec, 0x4f, 0x1d, 0x97, 0xc7, 0x0b, 0x3f, 0x38, 0x5e, 0x84, 0xc7, - 0xf4, 0x96, 0x3d, 0xa1, 0xb7, 0xec, 0xac, 0xc9, 0x3e, 0xbc, 0xfa, 0x2f, 0x00, 0x00, 0xff, 0xff, - 0x6f, 0x91, 0x37, 0xde, 0x3c, 0x19, 0x00, 0x00, + // 1587 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcd, 0x6e, 0xdb, 0xc6, + 0x1a, 0xf5, 0x88, 0xfa, 0x1d, 0x92, 0xfa, 0xa1, 0xed, 0x44, 0x76, 0x6e, 0xe2, 0x71, 0x8c, 0x8b, + 0xcc, 0x26, 0x32, 0x90, 0x18, 0xc2, 0xc5, 0x05, 0xee, 0x6d, 0xa2, 0x26, 0xad, 0x02, 0xd4, 0x6d, + 0x31, 0x4e, 0xda, 0xa0, 0x9b, 0x40, 0x4e, 0x28, 0x4b, 0x8d, 0x22, 0xba, 0x1a, 0xaa, 0x88, 0xb7, + 0x7d, 0x86, 0x6c, 0xba, 0x29, 0x0a, 0x14, 0xe8, 0x22, 0x7d, 0x8b, 0xa2, 0xeb, 0x3e, 0x44, 0x97, + 0x79, 0x8a, 0x62, 0x86, 0x43, 0x72, 0x66, 0x48, 0x9b, 0x22, 0xed, 0x45, 0x77, 0xf6, 0xa7, 0x0f, + 0xe7, 0x9c, 0x6f, 0x0e, 0xe7, 0xf0, 0x23, 0xb4, 0xe9, 0xcb, 0xd1, 0x6c, 0xb4, 0xa0, 0xbd, 0xd3, + 0x85, 0xe7, 0x7b, 0xce, 0xba, 0x3f, 0x71, 0xfd, 0xc9, 0x74, 0x7e, 0x42, 0x7b, 0xdf, 0x52, 0x6f, + 0xde, 0xf3, 0x5d, 0xea, 0x6f, 0x77, 0x46, 0xf3, 0xb9, 0xe7, 0x8f, 0xfc, 0xa9, 0x37, 0x17, 0x7d, + 0xb7, 0xff, 0x32, 0xa1, 0x73, 0xe8, 0x52, 0x3a, 0x3a, 0x71, 0xbf, 0x9e, 0xfa, 0x93, 0xa3, 0x00, + 0xc4, 0xd9, 0x85, 0xd6, 0x2b, 0x6f, 0x79, 0x3c, 0x73, 0x5f, 0x7c, 0x3f, 0x9a, 0x2d, 0xdd, 0x2e, + 0x40, 0x00, 0x03, 0x62, 0x06, 0xb5, 0xaf, 0x58, 0xc9, 0xd9, 0x83, 0xb6, 0xdc, 0x42, 0xbb, 0x25, + 0x64, 0x60, 0x40, 0x2c, 0xa9, 0x87, 0x3a, 0x3b, 0xd0, 0x1c, 0xcf, 0xbc, 0x91, 0x2f, 0x60, 0x0c, + 0x04, 0x70, 0x89, 0x40, 0x5e, 0x0a, 0x50, 0x76, 0xa1, 0x25, 0x35, 0xd0, 0x6e, 0x19, 0x19, 0xb8, + 0x44, 0xcc, 0xb8, 0x83, 0x63, 0x4c, 0xe7, 0xfe, 0xfd, 0x7b, 0x02, 0xa3, 0x82, 0x00, 0xae, 0x10, + 0xc8, 0x4b, 0x11, 0x86, 0xd4, 0x40, 0xbb, 0x55, 0x64, 0xe0, 0x0a, 0x31, 0xe3, 0x8e, 0x10, 0xa3, + 0x7f, 0x20, 0x30, 0x6a, 0x08, 0x60, 0x83, 0x63, 0xf4, 0x0f, 0x64, 0x8c, 0xb0, 0x81, 0x76, 0xeb, + 0xc8, 0xc0, 0x06, 0x31, 0xe3, 0x0e, 0x7e, 0x26, 0x4b, 0x59, 0x48, 0x03, 0x01, 0x6c, 0x13, 0x73, + 0x29, 0x29, 0xd9, 0x83, 0xf6, 0x52, 0x91, 0x02, 0x91, 0x81, 0x6d, 0x62, 0x2d, 0x65, 0x2d, 0x02, + 0x27, 0x12, 0x63, 0x22, 0x80, 0xcb, 0x01, 0x4e, 0xa8, 0x46, 0xe0, 0xc4, 0x72, 0x2c, 0x64, 0xe0, + 0x32, 0xb1, 0x96, 0x9a, 0x1e, 0x2a, 0xeb, 0xb1, 0x11, 0xc0, 0x1d, 0x62, 0x52, 0x55, 0x0f, 0x55, + 0xf4, 0x34, 0x91, 0x81, 0x3b, 0xc4, 0xa2, 0x9a, 0x1e, 0x2a, 0xeb, 0x69, 0x21, 0x80, 0x9d, 0x00, + 0x47, 0xd2, 0x43, 0x15, 0x3d, 0x6d, 0x64, 0x60, 0x87, 0x58, 0x54, 0xd6, 0xb3, 0x07, 0xed, 0xf1, + 0xf4, 0xad, 0xfb, 0x2a, 0x12, 0xd4, 0x41, 0x00, 0xd7, 0x88, 0x25, 0x8a, 0x01, 0xd2, 0xbf, 0x61, + 0x53, 0x69, 0xa2, 0x5d, 0x07, 0x19, 0xb8, 0x46, 0x6c, 0xb9, 0x2b, 0xc6, 0x8a, 0x44, 0xad, 0x23, + 0x80, 0xab, 0x02, 0x2b, 0x54, 0x15, 0x62, 0xc5, 0xb2, 0x36, 0x90, 0x81, 0xab, 0xc4, 0x96, 0xbb, + 0x28, 0x6b, 0xa3, 0xaa, 0xb0, 0x4d, 0x04, 0x70, 0x8b, 0xd8, 0x54, 0x51, 0x76, 0x07, 0xb6, 0xa8, + 0x26, 0xed, 0x1a, 0x32, 0x70, 0x8b, 0x34, 0xa9, 0xaa, 0x2d, 0xc2, 0x8b, 0xc4, 0x5d, 0x47, 0x00, + 0xb7, 0x43, 0xbc, 0x50, 0x5d, 0x84, 0x17, 0xcb, 0xeb, 0x22, 0x03, 0xb7, 0x49, 0x93, 0xaa, 0xfa, + 0x6e, 0x42, 0x78, 0xec, 0x79, 0x33, 0x81, 0xb5, 0x85, 0x00, 0xae, 0x93, 0x06, 0xab, 0x04, 0x38, + 0x3b, 0xd0, 0x8c, 0x7f, 0xa6, 0xdd, 0x6d, 0x64, 0xe0, 0x3a, 0x81, 0xd1, 0xef, 0x81, 0x7f, 0xfe, + 0x62, 0x3a, 0x3f, 0x11, 0x08, 0x37, 0x10, 0xc0, 0x0d, 0x62, 0x06, 0xb5, 0xd8, 0x3f, 0xa9, 0x85, + 0x76, 0xff, 0x85, 0x0c, 0xdc, 0x20, 0x96, 0xd4, 0xc3, 0xef, 0xc8, 0xf1, 0x99, 0xef, 0x52, 0x01, + 0x73, 0x13, 0x01, 0x6c, 0x11, 0xc8, 0x4b, 0xd1, 0x1d, 0x91, 0x1a, 0x68, 0xf7, 0x16, 0x32, 0xb0, + 0x45, 0xcc, 0xb8, 0x83, 0x3a, 0xbf, 0x03, 0xd8, 0x9a, 0xb8, 0x6f, 0x5f, 0xc8, 0x40, 0x3b, 0x0c, + 0x68, 0xf0, 0x23, 0xf8, 0xf0, 0x7e, 0xeb, 0x1d, 0x80, 0x9f, 0x9e, 0x4c, 0xfd, 0xc9, 0xf2, 0xb8, + 0xf7, 0xd2, 0x7b, 0xb3, 0xff, 0x74, 0xe2, 0x3e, 0xe5, 0x19, 0xf5, 0x64, 0xfe, 0x6a, 0xc9, 0xb4, + 0xb8, 0x74, 0x9f, 0xc7, 0xd2, 0xcb, 0xbb, 0x27, 0xee, 0xfc, 0xee, 0x89, 0x77, 0x97, 0x65, 0xd7, + 0x3e, 0xcb, 0xae, 0x7d, 0xff, 0xec, 0xd4, 0xa5, 0xbd, 0xc3, 0xd1, 0x82, 0x4e, 0x46, 0xb3, 0xe1, + 0xe3, 0xe7, 0xce, 0x93, 0x4b, 0x01, 0x3d, 0x9b, 0xbf, 0x89, 0xa0, 0x88, 0x3d, 0x71, 0xdf, 0x0e, + 0xe2, 0x39, 0xff, 0x04, 0xb0, 0xad, 0x0d, 0x41, 0xbb, 0x88, 0x0d, 0x3b, 0xf8, 0x85, 0x4d, 0xf1, + 0x13, 0x80, 0x9f, 0x5d, 0xd1, 0x14, 0x0f, 0x17, 0x8b, 0xd1, 0x99, 0xf3, 0xf9, 0x95, 0x8d, 0xc2, + 0xf1, 0x48, 0x53, 0x99, 0x87, 0xde, 0x7e, 0x57, 0x85, 0xd7, 0xa5, 0x90, 0xff, 0x62, 0xee, 0x7a, + 0xe3, 0x30, 0xe9, 0xf7, 0xd2, 0x92, 0x7e, 0xb8, 0xa6, 0x66, 0xfd, 0xae, 0x1a, 0xe3, 0x25, 0x16, + 0xe3, 0xc3, 0x35, 0x2d, 0xc8, 0x95, 0x94, 0x66, 0x49, 0x5f, 0x61, 0x2d, 0x4a, 0x4e, 0x2b, 0x21, + 0x5c, 0x66, 0x21, 0x2c, 0x5a, 0xe2, 0xa0, 0x51, 0x33, 0x96, 0x85, 0xbd, 0xcd, 0xd4, 0xa8, 0x29, + 0xab, 0x06, 0x68, 0x95, 0x05, 0x68, 0xd8, 0x24, 0x21, 0x29, 0xe9, 0xc8, 0x22, 0xbf, 0xc3, 0x9a, + 0xd4, 0x7c, 0x54, 0xa3, 0xaf, 0xce, 0xa2, 0x2f, 0x6c, 0x8a, 0x63, 0x46, 0xcb, 0x35, 0x16, 0xfc, + 0xb5, 0xe1, 0x5a, 0x22, 0xd9, 0xb4, 0xc8, 0x82, 0x2c, 0xb2, 0xa2, 0xb6, 0x38, 0x16, 0xf4, 0x34, + 0x62, 0xf9, 0xdf, 0x1a, 0xae, 0x25, 0xf3, 0x48, 0x8f, 0x19, 0x8b, 0xc5, 0x4c, 0xdc, 0x18, 0x22, + 0xee, 0x28, 0xf9, 0xc1, 0xde, 0x02, 0xf5, 0xe1, 0x9a, 0x9c, 0x20, 0x7b, 0x5a, 0x40, 0x34, 0x59, + 0x40, 0xf0, 0x29, 0xa5, 0x88, 0xd8, 0x55, 0x6f, 0x3f, 0x7b, 0x09, 0x58, 0xcc, 0x1c, 0xe9, 0xfe, + 0xff, 0x91, 0x72, 0xb9, 0xdb, 0xff, 0xf4, 0xcb, 0xcd, 0xce, 0x4b, 0xb9, 0x0e, 0x83, 0x1a, 0xac, + 0x70, 0xed, 0xb7, 0x7f, 0xb8, 0x03, 0x37, 0x13, 0xbb, 0xcf, 0xe1, 0xe8, 0x94, 0x3a, 0xaf, 0x61, + 0x47, 0x9c, 0x98, 0xb8, 0x1b, 0x6f, 0x46, 0xa7, 0x5d, 0x80, 0x0c, 0x6c, 0xde, 0xfb, 0xa8, 0x97, + 0xb2, 0x59, 0xf5, 0x52, 0x61, 0x7a, 0x47, 0x1c, 0xe3, 0x11, 0x87, 0x38, 0x1c, 0x9d, 0x3e, 0x9e, + 0xfb, 0x8b, 0x33, 0xd2, 0xa2, 0x6a, 0xd5, 0x99, 0xc0, 0xb6, 0x20, 0x0b, 0xee, 0x18, 0xe3, 0x32, + 0x38, 0xd7, 0xff, 0x73, 0x73, 0x7d, 0xc2, 0x10, 0x22, 0xaa, 0x26, 0x55, 0x8a, 0x12, 0x53, 0x70, + 0x33, 0x18, 0x53, 0xa5, 0x20, 0xd3, 0x13, 0x86, 0xa0, 0x33, 0x85, 0x45, 0xc6, 0x14, 0x50, 0x08, + 0x3e, 0xc6, 0x54, 0xcd, 0xcd, 0xc4, 0xe1, 0x02, 0xba, 0x98, 0x69, 0xaa, 0x14, 0xd5, 0x99, 0xfa, + 0x07, 0x9c, 0xa9, 0x56, 0x7c, 0xa6, 0xfe, 0x41, 0xca, 0x4c, 0xbc, 0x28, 0x66, 0xea, 0x1f, 0xc8, + 0x33, 0xd5, 0x8b, 0xcc, 0xd4, 0x3f, 0x48, 0x99, 0x49, 0x2a, 0x4a, 0x8f, 0xdf, 0x32, 0x36, 0xaa, + 0x51, 0xf0, 0xf1, 0x7b, 0x36, 0x55, 0x9c, 0x12, 0x8f, 0x5f, 0x54, 0x65, 0x64, 0xcb, 0x84, 0x57, + 0x30, 0x37, 0xd9, 0xb3, 0x69, 0x8a, 0x59, 0xad, 0xa5, 0xe6, 0x96, 0x3a, 0x99, 0xb0, 0xcb, 0xbc, + 0xc4, 0x64, 0x92, 0x5f, 0xd2, 0x64, 0x81, 0x61, 0x62, 0x32, 0xd5, 0x31, 0xab, 0xd0, 0x64, 0x09, + 0xcb, 0x5a, 0xcb, 0x73, 0x3d, 0xa3, 0xb1, 0x67, 0x76, 0xc1, 0xc9, 0x8e, 0x52, 0x3d, 0x3b, 0x92, + 0x3d, 0xa3, 0x09, 0xcf, 0x9a, 0xf9, 0xc9, 0x52, 0x3d, 0xa3, 0xe7, 0x7a, 0x46, 0x63, 0xcf, 0x5a, + 0x97, 0x98, 0x2c, 0xe9, 0xd9, 0x91, 0xec, 0x19, 0x4d, 0x78, 0xd6, 0x2e, 0x34, 0x59, 0xd2, 0x33, + 0xaa, 0x79, 0x36, 0x87, 0x4e, 0x98, 0xbc, 0xe2, 0x8d, 0xcc, 0xd8, 0x3a, 0x9c, 0xed, 0x41, 0xfe, + 0xec, 0x0d, 0x30, 0x22, 0x3a, 0x91, 0x4b, 0x71, 0x99, 0xf1, 0x85, 0x44, 0xd2, 0x74, 0x4e, 0x6e, + 0x3e, 0x01, 0xa9, 0x8d, 0xd7, 0x1e, 0x6b, 0x65, 0x7d, 0x3e, 0x61, 0xdd, 0xfa, 0x65, 0xe6, 0x93, + 0xbc, 0x93, 0xe7, 0x0b, 0xcc, 0x0b, 0xe7, 0x53, 0xdd, 0xdb, 0x28, 0x36, 0x5f, 0xc2, 0xbe, 0xf6, + 0x58, 0x2b, 0x3b, 0xdf, 0xc1, 0xf5, 0xf0, 0xc9, 0x94, 0x0d, 0xdc, 0xe4, 0x84, 0x0f, 0xf3, 0x3f, + 0x9b, 0x63, 0xcd, 0x41, 0xf1, 0xdc, 0x4b, 0x75, 0x4e, 0x99, 0xe2, 0xe1, 0xb5, 0xfc, 0x94, 0xe3, + 0x54, 0x13, 0x3b, 0x34, 0xe1, 0xa2, 0x3e, 0xa5, 0xb0, 0xf1, 0xfa, 0xa5, 0xa6, 0x94, 0x7c, 0x54, + 0xa6, 0x0c, 0x8c, 0x8c, 0xa6, 0x54, 0x9d, 0xec, 0x16, 0x9c, 0x32, 0x61, 0x65, 0x87, 0x26, 0xbc, + 0x74, 0xa1, 0xc8, 0x82, 0x17, 0x7c, 0x99, 0x65, 0x74, 0x5b, 0x9c, 0xee, 0x7f, 0xb9, 0x27, 0x1c, + 0x78, 0xde, 0x2c, 0xa2, 0x12, 0x1f, 0xbe, 0xa2, 0xc6, 0x68, 0x38, 0xbe, 0x34, 0xd5, 0x76, 0x6e, + 0x1a, 0x06, 0xa6, 0x4d, 0x64, 0x1f, 0xcb, 0x35, 0x39, 0x33, 0x63, 0xa2, 0x1b, 0x45, 0x33, 0x53, + 0x8f, 0x31, 0xb5, 0x2a, 0xad, 0x40, 0xc1, 0x66, 0xce, 0xb8, 0x6e, 0x16, 0x5c, 0x81, 0xf8, 0x9e, + 0xac, 0xaf, 0x40, 0x61, 0xd1, 0xf9, 0xb9, 0x04, 0x37, 0x04, 0x55, 0xfc, 0x21, 0xc0, 0xe8, 0x6e, + 0x15, 0x7c, 0x18, 0x87, 0x62, 0x33, 0x0f, 0x19, 0x07, 0xbf, 0xb1, 0x2f, 0x89, 0x5f, 0x01, 0xfc, + 0xf2, 0x2a, 0xbe, 0x24, 0x04, 0xc7, 0xe3, 0xe7, 0x4c, 0x3b, 0xb9, 0x9a, 0x4f, 0x0a, 0x19, 0x33, + 0xbc, 0x3a, 0xd2, 0x14, 0xdb, 0x03, 0xb8, 0x91, 0xb6, 0xf6, 0x3b, 0x6d, 0x68, 0xbc, 0x76, 0xcf, + 0xf8, 0xe7, 0x75, 0x83, 0xb0, 0x3f, 0x9d, 0x0d, 0xf1, 0x1d, 0xc2, 0x3f, 0xa7, 0x01, 0x09, 0xfe, + 0xf9, 0x6f, 0xe9, 0x3f, 0x60, 0xfb, 0x21, 0x5c, 0x4f, 0x59, 0xe7, 0xb3, 0x20, 0x4a, 0xa9, 0x10, + 0xca, 0x9e, 0x9e, 0x05, 0x51, 0xd1, 0x20, 0x52, 0x16, 0x70, 0x19, 0xa2, 0x92, 0x02, 0xd1, 0x38, + 0x4f, 0x45, 0x9c, 0x38, 0x59, 0x2a, 0x8c, 0xa4, 0x0a, 0x3d, 0x41, 0x64, 0x08, 0x23, 0x4b, 0x45, + 0x64, 0x89, 0xba, 0x0a, 0x67, 0xc9, 0xb0, 0x35, 0x8c, 0xb4, 0x0d, 0x57, 0xc6, 0xb0, 0x73, 0xe9, + 0x58, 0xfd, 0x38, 0xca, 0x29, 0x3a, 0x2e, 0x3a, 0x8f, 0xf2, 0xca, 0x3a, 0x8e, 0x72, 0x9d, 0x47, + 0x47, 0xc7, 0xc8, 0x38, 0x8f, 0x4e, 0x2e, 0x1d, 0xab, 0x9f, 0x87, 0x93, 0xa2, 0xe3, 0xa2, 0xf3, + 0x70, 0xb2, 0x74, 0x7c, 0x0c, 0x37, 0x53, 0x37, 0xb8, 0x2c, 0x21, 0x35, 0x0d, 0x24, 0x75, 0x2d, + 0x93, 0x41, 0x6a, 0xf9, 0x94, 0xac, 0x7e, 0x24, 0xd5, 0x34, 0x25, 0x17, 0x9d, 0x49, 0x35, 0x4b, + 0xc9, 0x23, 0x78, 0x2d, 0x7d, 0x29, 0xca, 0x92, 0xd2, 0xd2, 0x51, 0xc6, 0x59, 0xa7, 0xd2, 0xca, + 0xa9, 0x65, 0xf5, 0x63, 0x69, 0xa7, 0x6a, 0xb9, 0xe8, 0x5c, 0xda, 0x59, 0x5a, 0x1e, 0x40, 0x27, + 0xb9, 0x64, 0x64, 0xe9, 0xa8, 0x6b, 0x08, 0xc9, 0xfd, 0x41, 0x46, 0xa8, 0xaf, 0x7e, 0x6f, 0xce, + 0xc5, 0x68, 0xac, 0x9c, 0xcc, 0xca, 0xeb, 0x37, 0x0b, 0xc2, 0x4a, 0xb5, 0x45, 0x7f, 0x89, 0xe7, + 0x41, 0x19, 0x3c, 0xf8, 0xf0, 0x7e, 0xab, 0x5c, 0x07, 0x6d, 0xf0, 0x4d, 0xbf, 0xd8, 0x0b, 0xfa, + 0xb8, 0xca, 0x7f, 0xb8, 0xff, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc5, 0x44, 0x4a, 0xf2, 0x02, + 0x1d, 0x00, 0x00, } diff --git a/test/gogo/scalars_json.pb.go b/test/gogo/scalars_json.pb.go index c885ca22..f5c297ee 100644 --- a/test/gogo/scalars_json.pb.go +++ b/test/gogo/scalars_json.pb.go @@ -8,6 +8,7 @@ package test import ( jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" + types "github.com/TheThingsIndustries/protoc-gen-go-json/test/types" ) // MarshalProtoJSON marshals the MessageWithScalars message to JSON. @@ -168,6 +169,16 @@ func (x *MessageWithScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectField("bytes_values") s.WriteBytesArray(x.BytesValues) } + if len(x.HexBytesValue) > 0 || s.HasField("hex_bytes_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("hex_bytes_value") + types.MarshalHEX(s.WithField("hex_bytes_value"), x.HexBytesValue) + } + if len(x.HexBytesValues) > 0 || s.HasField("hex_bytes_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("hex_bytes_values") + types.MarshalHEXArray(s.WithField("hex_bytes_values"), x.HexBytesValues) + } s.WriteObjectEnd() } @@ -270,6 +281,12 @@ func (x *MessageWithScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { case "bytes_values", "bytesValues": s.AddField("bytes_values") x.BytesValues = s.ReadBytesArray() + case "hex_bytes_value", "hexBytesValue": + s.AddField("hex_bytes_value") + x.HexBytesValue = types.UnmarshalHEX(s.WithField("hex_bytes_value", false)) + case "hex_bytes_values", "hexBytesValues": + s.AddField("hex_bytes_values") + x.HexBytesValues = types.UnmarshalHEXArray(s.WithField("hex_bytes_values", false)) } }) } @@ -344,6 +361,10 @@ func (x *MessageWithOneofScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteMoreIf(&wroteField) s.WriteObjectField("bytes_value") s.WriteBytes(ov.BytesValue) + case *MessageWithOneofScalars_HexBytesValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("hex_bytes_value") + types.MarshalHEX(s.WithField("hex_bytes_value"), ov.HexBytesValue) } } s.WriteObjectEnd() @@ -433,6 +454,11 @@ func (x *MessageWithOneofScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalStat ov := &MessageWithOneofScalars_BytesValue{} ov.BytesValue = s.ReadBytes() x.Value = ov + case "hex_bytes_value", "hexBytesValue": + s.AddField("hex_bytes_value") + ov := &MessageWithOneofScalars_HexBytesValue{} + ov.HexBytesValue = types.UnmarshalHEX(s.WithField("hex_bytes_value", false)) + x.Value = ov } }) } @@ -757,6 +783,11 @@ func (x *MessageWithScalarMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { } s.WriteObjectEnd() } + if x.StringHexBytesMap != nil || s.HasField("string_hex_bytes_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_hex_bytes_map") + types.MarshalStringHEXMap(s.WithField("string_hex_bytes_map"), x.StringHexBytesMap) + } s.WriteObjectEnd() } @@ -925,6 +956,9 @@ func (x *MessageWithScalarMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) s.ReadStringMap(func(key string) { x.StringBytesMap[key] = s.ReadBytes() }) + case "string_hex_bytes_map", "stringHexBytesMap": + s.AddField("string_hex_bytes_map") + x.StringHexBytesMap = types.UnmarshalStringHEXMap(s.WithField("string_hex_bytes_map", false)) } }) } diff --git a/test/gogo/scalars_test.go b/test/gogo/scalars_test.go index b71c6dc0..1ac06025 100644 --- a/test/gogo/scalars_test.go +++ b/test/gogo/scalars_test.go @@ -50,7 +50,9 @@ var testMessagesWithScalars = []struct { "string_value": "", "string_values": [], "bytes_value": null, - "bytes_values": [] + "bytes_values": [], + "hex_bytes_value": null, + "hex_bytes_values": [] }`, expectedMask: []string{ "double_value", @@ -83,6 +85,8 @@ var testMessagesWithScalars = []struct { "string_values", "bytes_value", "bytes_values", + "hex_bytes_value", + "hex_bytes_values", }, }, { @@ -118,6 +122,8 @@ var testMessagesWithScalars = []struct { StringValues: []string{"foo", "bar"}, BytesValue: []byte("foo"), BytesValues: [][]byte{[]byte("foo"), []byte("bar")}, + HexBytesValue: []byte("foo"), + HexBytesValues: [][]byte{[]byte("foo"), []byte("bar")}, }, expected: `{ "double_value": 12.34, @@ -149,7 +155,9 @@ var testMessagesWithScalars = []struct { "string_value": "foo", "string_values": ["foo", "bar"], "bytes_value": "Zm9v", - "bytes_values": ["Zm9v", "YmFy"] + "bytes_values": ["Zm9v", "YmFy"], + "hex_bytes_value": "666F6F", + "hex_bytes_values": ["666F6F", "626172"] }`, expectedMask: []string{ "double_value", @@ -182,6 +190,8 @@ var testMessagesWithScalars = []struct { "string_values", "bytes_value", "bytes_values", + "hex_bytes_value", + "hex_bytes_values", }, }, } @@ -463,6 +473,30 @@ var testMessagesWithOneofScalars = []struct { expected: `{"bytes_value": "Zm9v"}`, expectedMask: []string{"bytes_value"}, }, + { + name: "hex_bytes_null", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_HexBytesValue{}, + }, + expected: `{"hex_bytes_value": null}`, + expectedMask: []string{"hex_bytes_value"}, + }, + { + name: "hex_bytes_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_HexBytesValue{HexBytesValue: []byte{}}, + }, + expected: `{"hex_bytes_value": ""}`, + expectedMask: []string{"hex_bytes_value"}, + }, + { + name: "hex_bytes_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_HexBytesValue{HexBytesValue: []byte("foo")}, + }, + expected: `{"hex_bytes_value": "666F6F"}`, + expectedMask: []string{"hex_bytes_value"}, + }, } func TestMarshalMessageWithOneofScalars(t *testing.T) { @@ -521,6 +555,7 @@ var testMessagesWithScalarMaps = []struct { BoolStringMap: map[bool]string{true: "yes"}, StringStringMap: map[string]string{"value": "foo"}, StringBytesMap: map[string][]byte{"value": []byte("foo")}, + StringHexBytesMap: map[string][]byte{"value": []byte("foo")}, }, expected: `{ "string_double_map": {"value": -42}, @@ -548,7 +583,8 @@ var testMessagesWithScalarMaps = []struct { "string_bool_map": {"yes": true}, "bool_string_map": {"true": "yes"}, "string_string_map": {"value": "foo"}, - "string_bytes_map": {"value": "Zm9v"} + "string_bytes_map": {"value": "Zm9v"}, + "string_hex_bytes_map": {"value": "666F6F"} }`, expectedMask: []string{ "string_double_map", @@ -577,6 +613,7 @@ var testMessagesWithScalarMaps = []struct { "bool_string_map", "string_string_map", "string_bytes_map", + "string_hex_bytes_map", }, }, } diff --git a/test/golang/scalars.pb.go b/test/golang/scalars.pb.go index 7b81edbf..6b84c286 100644 --- a/test/golang/scalars.pb.go +++ b/test/golang/scalars.pb.go @@ -59,6 +59,8 @@ type MessageWithScalars struct { StringValues []string `protobuf:"bytes,28,rep,name=string_values,json=stringValues,proto3" json:"string_values,omitempty"` BytesValue []byte `protobuf:"bytes,29,opt,name=bytes_value,json=bytesValue,proto3" json:"bytes_value,omitempty"` BytesValues [][]byte `protobuf:"bytes,30,rep,name=bytes_values,json=bytesValues,proto3" json:"bytes_values,omitempty"` + HexBytesValue []byte `protobuf:"bytes,31,opt,name=hex_bytes_value,json=hexBytesValue,proto3" json:"hex_bytes_value,omitempty"` + HexBytesValues [][]byte `protobuf:"bytes,32,rep,name=hex_bytes_values,json=hexBytesValues,proto3" json:"hex_bytes_values,omitempty"` } func (x *MessageWithScalars) Reset() { @@ -303,6 +305,20 @@ func (x *MessageWithScalars) GetBytesValues() [][]byte { return nil } +func (x *MessageWithScalars) GetHexBytesValue() []byte { + if x != nil { + return x.HexBytesValue + } + return nil +} + +func (x *MessageWithScalars) GetHexBytesValues() [][]byte { + if x != nil { + return x.HexBytesValues + } + return nil +} + type MessageWithOneofScalars struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -324,6 +340,7 @@ type MessageWithOneofScalars struct { // *MessageWithOneofScalars_BoolValue // *MessageWithOneofScalars_StringValue // *MessageWithOneofScalars_BytesValue + // *MessageWithOneofScalars_HexBytesValue Value isMessageWithOneofScalars_Value `protobuf_oneof:"value"` } @@ -471,6 +488,13 @@ func (x *MessageWithOneofScalars) GetBytesValue() []byte { return nil } +func (x *MessageWithOneofScalars) GetHexBytesValue() []byte { + if x, ok := x.GetValue().(*MessageWithOneofScalars_HexBytesValue); ok { + return x.HexBytesValue + } + return nil +} + type isMessageWithOneofScalars_Value interface { isMessageWithOneofScalars_Value() } @@ -535,6 +559,10 @@ type MessageWithOneofScalars_BytesValue struct { BytesValue []byte `protobuf:"bytes,15,opt,name=bytes_value,json=bytesValue,proto3,oneof"` } +type MessageWithOneofScalars_HexBytesValue struct { + HexBytesValue []byte `protobuf:"bytes,16,opt,name=hex_bytes_value,json=hexBytesValue,proto3,oneof"` +} + func (*MessageWithOneofScalars_DoubleValue) isMessageWithOneofScalars_Value() {} func (*MessageWithOneofScalars_FloatValue) isMessageWithOneofScalars_Value() {} @@ -565,6 +593,8 @@ func (*MessageWithOneofScalars_StringValue) isMessageWithOneofScalars_Value() {} func (*MessageWithOneofScalars_BytesValue) isMessageWithOneofScalars_Value() {} +func (*MessageWithOneofScalars_HexBytesValue) isMessageWithOneofScalars_Value() {} + type MessageWithScalarMaps struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -596,6 +626,7 @@ type MessageWithScalarMaps struct { BoolStringMap map[bool]string `protobuf:"bytes,26,rep,name=bool_string_map,json=boolStringMap,proto3" json:"bool_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` StringStringMap map[string]string `protobuf:"bytes,27,rep,name=string_string_map,json=stringStringMap,proto3" json:"string_string_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // map is above. StringBytesMap map[string][]byte `protobuf:"bytes,29,rep,name=string_bytes_map,json=stringBytesMap,proto3" json:"string_bytes_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // map is impossible. + StringHexBytesMap map[string][]byte `protobuf:"bytes,30,rep,name=string_hex_bytes_map,json=stringHexBytesMap,proto3" json:"string_hex_bytes_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *MessageWithScalarMaps) Reset() { @@ -812,13 +843,20 @@ func (x *MessageWithScalarMaps) GetStringBytesMap() map[string][]byte { return nil } +func (x *MessageWithScalarMaps) GetStringHexBytesMap() map[string][]byte { + if x != nil { + return x.StringHexBytesMap + } + return nil +} + var File_scalars_proto protoreflect.FileDescriptor var file_scalars_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x73, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcc, 0x08, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe2, 0x0b, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, @@ -887,222 +925,278 @@ var file_scalars_proto_rawDesc = []byte{ 0x65, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1e, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xcd, 0x04, 0x0a, 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x53, 0x63, 0x61, 0x6c, 0x61, - 0x72, 0x73, 0x12, 0x23, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, - 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x48, 0x00, 0x52, 0x0a, - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, - 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x48, - 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, - 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x03, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x23, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b, 0x75, - 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x69, - 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x11, - 0x48, 0x00, 0x52, 0x0b, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x23, 0x0a, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x12, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x07, 0x48, 0x00, 0x52, 0x0c, 0x66, - 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x66, - 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x06, 0x48, 0x00, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0f, 0x48, 0x00, 0x52, 0x0d, 0x73, 0x66, - 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x73, - 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x10, 0x48, 0x00, 0x52, 0x0d, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x48, - 0x00, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x99, 0x24, 0x0a, 0x15, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0xc2, 0x01, 0x0a, 0x0f, 0x68, 0x65, 0x78, 0x5f, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x99, 0x01, 0xea, 0xaa, 0x19, 0x94, 0x01, 0x0a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, + 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, + 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, + 0x58, 0x12, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, + 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, + 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x52, 0x0d, 0x68, 0x65, + 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0xce, 0x01, 0x0a, 0x10, + 0x68, 0x65, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x18, 0x20, 0x20, 0x03, 0x28, 0x0c, 0x42, 0xa3, 0x01, 0xea, 0xaa, 0x19, 0x9e, 0x01, 0x0a, 0x4c, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, + 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, + 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x4e, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, + 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6d, 0x61, 0x72, + 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x0e, 0x68, 0x65, + 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x94, 0x06, 0x0a, + 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, + 0x66, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x23, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, + 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, + 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, + 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x02, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, + 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0b, + 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75, + 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x04, 0x48, 0x00, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x11, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x12, 0x48, 0x00, 0x52, 0x0b, 0x73, + 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x07, 0x48, 0x00, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x06, 0x48, 0x00, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x73, 0x66, 0x69, 0x78, + 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0f, + 0x48, 0x00, 0x52, 0x0d, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x10, 0x48, 0x00, 0x52, 0x0d, 0x73, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, + 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, + 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x21, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0xc4, 0x01, 0x0a, 0x0f, 0x68, 0x65, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x99, 0x01, + 0xea, 0xaa, 0x19, 0x94, 0x01, 0x0a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, + 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, + 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x12, 0x49, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, + 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6d, + 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x48, 0x00, 0x52, 0x0d, 0x68, 0x65, 0x78, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x22, 0x82, 0x27, 0x0a, 0x15, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x12, 0x6b, 0x0a, + 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x6d, + 0x61, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, + 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, - 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, - 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, - 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, - 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, - 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, - 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x6d, 0x61, - 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, - 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, - 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, - 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, - 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, - 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, - 0x70, 0x12, 0x68, 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, - 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, - 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x69, 0x6e, 0x74, - 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, - 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, - 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x73, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, - 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x36, - 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x0e, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, - 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, - 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, - 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, - 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, - 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, - 0x70, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, + 0x74, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, + 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, + 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, + 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x68, + 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, + 0x61, 0x70, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x07, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, + 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, + 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, + 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, + 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x69, 0x6e, + 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x6d, 0x61, + 0x70, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, - 0x61, 0x70, 0x73, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0b, + 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x75, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, - 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, - 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, - 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0c, 0x20, 0x03, 0x28, + 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, - 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x55, 0x69, - 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x0f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x69, - 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, + 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, - 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, - 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, + 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x36, + 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, + 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x33, + 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, - 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x69, - 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, - 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, - 0x61, 0x70, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, + 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, + 0x11, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, + 0x61, 0x70, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, - 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, 0x74, 0x36, - 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x69, - 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, - 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x69, 0x6e, 0x74, 0x33, + 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, + 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, - 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, - 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x11, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, - 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x66, 0x69, 0x78, 0x65, 0x64, - 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x12, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, - 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x13, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, - 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x66, 0x69, 0x78, 0x65, 0x64, - 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x14, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, - 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, 0x13, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x15, + 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, + 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x69, 0x6e, 0x74, 0x36, + 0x34, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x10, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, + 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, + 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, + 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, + 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, + 0x32, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, + 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x46, 0x69, 0x78, + 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x10, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, + 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, + 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, + 0x34, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, + 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x46, 0x69, 0x78, + 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x10, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, 0x13, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x15, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, + 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, 0x13, 0x73, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, - 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, - 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, 0x13, 0x73, 0x66, - 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, - 0x70, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, + 0x2e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, + 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, 0x13, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x6d, 0x61, + 0x70, 0x18, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, - 0x61, 0x70, 0x73, 0x2e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x66, 0x69, 0x78, - 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, - 0x13, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, - 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, + 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, + 0x13, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, - 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, - 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, - 0x12, 0x71, 0x0a, 0x13, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, - 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, - 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, - 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x11, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x6f, - 0x6f, 0x6c, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x19, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x74, - 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, - 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, - 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x0f, 0x62, 0x6f, - 0x6f, 0x6c, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x1a, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, - 0x42, 0x6f, 0x6f, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x0d, 0x62, 0x6f, 0x6f, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, - 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x1b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, - 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, - 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x68, - 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x6d, - 0x61, 0x70, 0x18, 0x1d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, - 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, + 0x12, 0x65, 0x0a, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, + 0x6d, 0x61, 0x70, 0x18, 0x19, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x74, 0x68, 0x65, 0x74, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, + 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x6c, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x0f, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x3d, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, + 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x42, 0x6f, 0x6f, + 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0d, 0x62, 0x6f, 0x6f, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, + 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, + 0x6d, 0x61, 0x70, 0x18, 0x1b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, + 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x6d, 0x61, 0x70, 0x18, + 0x1d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, + 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x4d, 0x61, 0x70, 0x12, 0xa0, 0x02, 0x0a, 0x14, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x5f, 0x68, 0x65, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x1e, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0xab, 0x01, 0xea, 0xaa, 0x19, 0xa6, 0x01, 0x0a, + 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, + 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, + 0x72, 0x73, 0x68, 0x61, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x45, 0x58, 0x4d, 0x61, + 0x70, 0x12, 0x52, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, + 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, + 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, + 0x45, 0x58, 0x4d, 0x61, 0x70, 0x52, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, @@ -1214,11 +1308,16 @@ var file_scalars_proto_rawDesc = []byte{ 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x42, 0x40, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, - 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, - 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0xea, 0xaa, 0x19, 0x04, - 0x08, 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x38, 0x01, 0x1a, 0x44, 0x0a, 0x16, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x78, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x40, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, + 0x73, 0x74, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -1233,7 +1332,7 @@ func file_scalars_proto_rawDescGZIP() []byte { return file_scalars_proto_rawDescData } -var file_scalars_proto_msgTypes = make([]protoimpl.MessageInfo, 29) +var file_scalars_proto_msgTypes = make([]protoimpl.MessageInfo, 30) var file_scalars_proto_goTypes = []interface{}{ (*MessageWithScalars)(nil), // 0: thethings.json.test.MessageWithScalars (*MessageWithOneofScalars)(nil), // 1: thethings.json.test.MessageWithOneofScalars @@ -1264,6 +1363,7 @@ var file_scalars_proto_goTypes = []interface{}{ nil, // 26: thethings.json.test.MessageWithScalarMaps.BoolStringMapEntry nil, // 27: thethings.json.test.MessageWithScalarMaps.StringStringMapEntry nil, // 28: thethings.json.test.MessageWithScalarMaps.StringBytesMapEntry + nil, // 29: thethings.json.test.MessageWithScalarMaps.StringHexBytesMapEntry } var file_scalars_proto_depIdxs = []int32{ 3, // 0: thethings.json.test.MessageWithScalarMaps.string_double_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringDoubleMapEntry @@ -1292,11 +1392,12 @@ var file_scalars_proto_depIdxs = []int32{ 26, // 23: thethings.json.test.MessageWithScalarMaps.bool_string_map:type_name -> thethings.json.test.MessageWithScalarMaps.BoolStringMapEntry 27, // 24: thethings.json.test.MessageWithScalarMaps.string_string_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringStringMapEntry 28, // 25: thethings.json.test.MessageWithScalarMaps.string_bytes_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringBytesMapEntry - 26, // [26:26] is the sub-list for method output_type - 26, // [26:26] is the sub-list for method input_type - 26, // [26:26] is the sub-list for extension type_name - 26, // [26:26] is the sub-list for extension extendee - 0, // [0:26] is the sub-list for field type_name + 29, // 26: thethings.json.test.MessageWithScalarMaps.string_hex_bytes_map:type_name -> thethings.json.test.MessageWithScalarMaps.StringHexBytesMapEntry + 27, // [27:27] is the sub-list for method output_type + 27, // [27:27] is the sub-list for method input_type + 27, // [27:27] is the sub-list for extension type_name + 27, // [27:27] is the sub-list for extension extendee + 0, // [0:27] is the sub-list for field type_name } func init() { file_scalars_proto_init() } @@ -1358,6 +1459,7 @@ func file_scalars_proto_init() { (*MessageWithOneofScalars_BoolValue)(nil), (*MessageWithOneofScalars_StringValue)(nil), (*MessageWithOneofScalars_BytesValue)(nil), + (*MessageWithOneofScalars_HexBytesValue)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -1365,7 +1467,7 @@ func file_scalars_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_scalars_proto_rawDesc, NumEnums: 0, - NumMessages: 29, + NumMessages: 30, NumExtensions: 0, NumServices: 0, }, diff --git a/test/golang/scalars_json.pb.go b/test/golang/scalars_json.pb.go index 749594c8..d8111bcd 100644 --- a/test/golang/scalars_json.pb.go +++ b/test/golang/scalars_json.pb.go @@ -8,6 +8,7 @@ package test import ( jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" + types "github.com/TheThingsIndustries/protoc-gen-go-json/test/types" ) // MarshalProtoJSON marshals the MessageWithScalars message to JSON. @@ -168,6 +169,16 @@ func (x *MessageWithScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectField("bytes_values") s.WriteBytesArray(x.BytesValues) } + if len(x.HexBytesValue) > 0 || s.HasField("hex_bytes_value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("hex_bytes_value") + types.MarshalHEX(s.WithField("hex_bytes_value"), x.HexBytesValue) + } + if len(x.HexBytesValues) > 0 || s.HasField("hex_bytes_values") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("hex_bytes_values") + types.MarshalHEXArray(s.WithField("hex_bytes_values"), x.HexBytesValues) + } s.WriteObjectEnd() } @@ -270,6 +281,12 @@ func (x *MessageWithScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { case "bytes_values", "bytesValues": s.AddField("bytes_values") x.BytesValues = s.ReadBytesArray() + case "hex_bytes_value", "hexBytesValue": + s.AddField("hex_bytes_value") + x.HexBytesValue = types.UnmarshalHEX(s.WithField("hex_bytes_value", false)) + case "hex_bytes_values", "hexBytesValues": + s.AddField("hex_bytes_values") + x.HexBytesValues = types.UnmarshalHEXArray(s.WithField("hex_bytes_values", false)) } }) } @@ -344,6 +361,10 @@ func (x *MessageWithOneofScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteMoreIf(&wroteField) s.WriteObjectField("bytes_value") s.WriteBytes(ov.BytesValue) + case *MessageWithOneofScalars_HexBytesValue: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("hex_bytes_value") + types.MarshalHEX(s.WithField("hex_bytes_value"), ov.HexBytesValue) } } s.WriteObjectEnd() @@ -433,6 +454,11 @@ func (x *MessageWithOneofScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalStat ov := &MessageWithOneofScalars_BytesValue{} ov.BytesValue = s.ReadBytes() x.Value = ov + case "hex_bytes_value", "hexBytesValue": + s.AddField("hex_bytes_value") + ov := &MessageWithOneofScalars_HexBytesValue{} + ov.HexBytesValue = types.UnmarshalHEX(s.WithField("hex_bytes_value", false)) + x.Value = ov } }) } @@ -757,6 +783,11 @@ func (x *MessageWithScalarMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { } s.WriteObjectEnd() } + if x.StringHexBytesMap != nil || s.HasField("string_hex_bytes_map") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("string_hex_bytes_map") + types.MarshalStringHEXMap(s.WithField("string_hex_bytes_map"), x.StringHexBytesMap) + } s.WriteObjectEnd() } @@ -925,6 +956,9 @@ func (x *MessageWithScalarMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) s.ReadStringMap(func(key string) { x.StringBytesMap[key] = s.ReadBytes() }) + case "string_hex_bytes_map", "stringHexBytesMap": + s.AddField("string_hex_bytes_map") + x.StringHexBytesMap = types.UnmarshalStringHEXMap(s.WithField("string_hex_bytes_map", false)) } }) } diff --git a/test/golang/scalars_test.go b/test/golang/scalars_test.go index 84615ce6..e903835a 100644 --- a/test/golang/scalars_test.go +++ b/test/golang/scalars_test.go @@ -50,7 +50,9 @@ var testMessagesWithScalars = []struct { "string_value": "", "string_values": [], "bytes_value": null, - "bytes_values": [] + "bytes_values": [], + "hex_bytes_value": null, + "hex_bytes_values": [] }`, expectedMask: []string{ "double_value", @@ -83,6 +85,8 @@ var testMessagesWithScalars = []struct { "string_values", "bytes_value", "bytes_values", + "hex_bytes_value", + "hex_bytes_values", }, }, { @@ -118,6 +122,8 @@ var testMessagesWithScalars = []struct { StringValues: []string{"foo", "bar"}, BytesValue: []byte("foo"), BytesValues: [][]byte{[]byte("foo"), []byte("bar")}, + HexBytesValue: []byte("foo"), + HexBytesValues: [][]byte{[]byte("foo"), []byte("bar")}, }, expected: `{ "double_value": 12.34, @@ -149,7 +155,9 @@ var testMessagesWithScalars = []struct { "string_value": "foo", "string_values": ["foo", "bar"], "bytes_value": "Zm9v", - "bytes_values": ["Zm9v", "YmFy"] + "bytes_values": ["Zm9v", "YmFy"], + "hex_bytes_value": "666F6F", + "hex_bytes_values": ["666F6F", "626172"] }`, expectedMask: []string{ "double_value", @@ -182,6 +190,8 @@ var testMessagesWithScalars = []struct { "string_values", "bytes_value", "bytes_values", + "hex_bytes_value", + "hex_bytes_values", }, }, } @@ -463,6 +473,30 @@ var testMessagesWithOneofScalars = []struct { expected: `{"bytes_value": "Zm9v"}`, expectedMask: []string{"bytes_value"}, }, + { + name: "hex_bytes_null", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_HexBytesValue{}, + }, + expected: `{"hex_bytes_value": null}`, + expectedMask: []string{"hex_bytes_value"}, + }, + { + name: "hex_bytes_zero", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_HexBytesValue{HexBytesValue: []byte{}}, + }, + expected: `{"hex_bytes_value": ""}`, + expectedMask: []string{"hex_bytes_value"}, + }, + { + name: "hex_bytes_value", + msg: MessageWithOneofScalars{ + Value: &MessageWithOneofScalars_HexBytesValue{HexBytesValue: []byte("foo")}, + }, + expected: `{"hex_bytes_value": "666F6F"}`, + expectedMask: []string{"hex_bytes_value"}, + }, } func TestMarshalMessageWithOneofScalars(t *testing.T) { @@ -521,6 +555,7 @@ var testMessagesWithScalarMaps = []struct { BoolStringMap: map[bool]string{true: "yes"}, StringStringMap: map[string]string{"value": "foo"}, StringBytesMap: map[string][]byte{"value": []byte("foo")}, + StringHexBytesMap: map[string][]byte{"value": []byte("foo")}, }, expected: `{ "string_double_map": {"value": -42}, @@ -548,7 +583,8 @@ var testMessagesWithScalarMaps = []struct { "string_bool_map": {"yes": true}, "bool_string_map": {"true": "yes"}, "string_string_map": {"value": "foo"}, - "string_bytes_map": {"value": "Zm9v"} + "string_bytes_map": {"value": "Zm9v"}, + "string_hex_bytes_map": {"value": "666F6F"} }`, expectedMask: []string{ "string_double_map", @@ -577,6 +613,7 @@ var testMessagesWithScalarMaps = []struct { "bool_string_map", "string_string_map", "string_bytes_map", + "string_hex_bytes_map", }, }, } diff --git a/test/scalars.proto b/test/scalars.proto index 6b3f066b..e76b5c3a 100644 --- a/test/scalars.proto +++ b/test/scalars.proto @@ -56,6 +56,19 @@ message MessageWithScalars { bytes bytes_value = 29; repeated bytes bytes_values = 30; + + bytes hex_bytes_value = 31 [ + (thethings.json.field) = { + marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEX", + unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEX" + } + ]; + repeated bytes hex_bytes_values = 32 [ + (thethings.json.field) = { + marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEXArray", + unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEXArray" + } + ]; } message MessageWithOneofScalars { @@ -75,6 +88,12 @@ message MessageWithOneofScalars { bool bool_value = 13; string string_value = 14; bytes bytes_value = 15; + bytes hex_bytes_value = 16 [ + (thethings.json.field) = { + marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEX", + unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEX" + } + ]; } } @@ -123,4 +142,11 @@ message MessageWithScalarMaps { map string_bytes_map = 29; // map is impossible. + + map string_hex_bytes_map = 30 [ + (thethings.json.field) = { + marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalStringHEXMap", + unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalStringHEXMap" + } + ]; } diff --git a/test/types/eui.go b/test/types/eui.go index ff048b5d..0a7b9fd2 100644 --- a/test/types/eui.go +++ b/test/types/eui.go @@ -75,6 +75,28 @@ func UnmarshalHEXArray(s *jsonplugin.UnmarshalState) [][]byte { return bs } +func MarshalStringHEXMap(s *jsonplugin.MarshalState, bs map[string][]byte) { + s.WriteObjectStart() + var wroteElement bool + for k, b := range bs { + s.WriteMoreIf(&wroteElement) + s.WriteObjectField(k) + s.WriteString(fmt.Sprintf("%X", b)) + } + s.WriteObjectEnd() +} + +func UnmarshalStringHEXMap(s *jsonplugin.UnmarshalState) map[string][]byte { + bs := make(map[string][]byte) + s.ReadObject(func(key string) { + bs[key] = UnmarshalHEX(s) + }) + if s.Err() != nil { + return nil + } + return bs +} + func (t EUI64) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%X"`, t[:])), nil } From b3d9b41e85070bc003c83577d82ced8a074f8a00 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 18 Jan 2022 14:31:39 +0100 Subject: [PATCH 09/46] Add default configurations for (un)marshalers --- jsonplugin/marshal.go | 5 +++++ jsonplugin/marshal_test.go | 2 +- jsonplugin/unmarshal.go | 3 +++ jsonplugin/unmarshal_test.go | 2 +- test/gogo/utils_test.go | 8 ++------ test/golang/utils_test.go | 8 ++------ 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/jsonplugin/marshal.go b/jsonplugin/marshal.go index dc4c19f3..1c11623e 100644 --- a/jsonplugin/marshal.go +++ b/jsonplugin/marshal.go @@ -36,6 +36,11 @@ type MarshalerConfig struct { EnumsAsInts bool } +// DefaultMarshalerConfig is the default configuration for the Marshaler. +var DefaultMarshalerConfig = MarshalerConfig{ + EnumsAsInts: true, +} + // Marshal marshals a message. func (c MarshalerConfig) Marshal(m Marshaler) ([]byte, error) { s := NewMarshalState(c) diff --git a/jsonplugin/marshal_test.go b/jsonplugin/marshal_test.go index 919a9e46..74b94dca 100644 --- a/jsonplugin/marshal_test.go +++ b/jsonplugin/marshal_test.go @@ -20,7 +20,7 @@ var ( func testMarshal(t *testing.T, f func(s *MarshalState), expected string) { t.Helper() - s := NewMarshalState(MarshalerConfig{}) + s := NewMarshalState(DefaultMarshalerConfig) f(s) data, err := s.Bytes() if err != nil { diff --git a/jsonplugin/unmarshal.go b/jsonplugin/unmarshal.go index 9d27bc1f..52818d75 100644 --- a/jsonplugin/unmarshal.go +++ b/jsonplugin/unmarshal.go @@ -35,6 +35,9 @@ func (e *unmarshalError) Error() string { // UnmarshalerConfig is the configuration for the Unmarshaler. type UnmarshalerConfig struct{} +// DefaultUnmarshalerConfig is the default configuration for the Unmarshaler. +var DefaultUnmarshalerConfig = UnmarshalerConfig{} + // Unmarshal unmarshals a message. func (c UnmarshalerConfig) Unmarshal(data []byte, m Unmarshaler) error { s := NewUnmarshalState(data, c) diff --git a/jsonplugin/unmarshal_test.go b/jsonplugin/unmarshal_test.go index 09d763cc..cf622637 100644 --- a/jsonplugin/unmarshal_test.go +++ b/jsonplugin/unmarshal_test.go @@ -17,7 +17,7 @@ func testUnmarshal(t *testing.T, f func(s *UnmarshalState) interface{}, data str if expectedValue := reflect.ValueOf(expected); expectedValue.Type().Kind() == reflect.Ptr { expected = expectedValue.Elem().Interface() } - s := NewUnmarshalState([]byte(data), UnmarshalerConfig{}) + s := NewUnmarshalState([]byte(data), DefaultUnmarshalerConfig) actual := f(s) if actualValue := reflect.ValueOf(actual); actualValue.Type().Kind() == reflect.Ptr { actual = actualValue.Elem().Interface() diff --git a/test/gogo/utils_test.go b/test/gogo/utils_test.go index d88c144f..4098998e 100644 --- a/test/gogo/utils_test.go +++ b/test/gogo/utils_test.go @@ -36,17 +36,13 @@ func gogoUnmarshal(t *testing.T, msg proto.Message, data []byte) { } } -var pluginMarshaler = jsonplugin.MarshalerConfig{ - EnumsAsInts: true, -} - func generatedMarshal(t *testing.T, msg proto.Message, mask []string) []byte { t.Helper() m, ok := msg.(jsonplugin.Marshaler) if !ok { t.Fatalf("message %T does not implement the jsonplugin.Marshaler", msg) } - s := jsonplugin.NewMarshalState(pluginMarshaler).WithFieldMask(mask...) + s := jsonplugin.NewMarshalState(jsonplugin.DefaultMarshalerConfig).WithFieldMask(mask...) m.MarshalProtoJSON(s) b, err := s.Bytes() if err != nil { @@ -61,7 +57,7 @@ func generatedUnmarshal(t *testing.T, msg proto.Message, data []byte) []string { if !ok { t.Fatalf("message %T does not implement the jsonplugin.Unmarshaler", msg) } - s := jsonplugin.NewUnmarshalState(data, jsonplugin.UnmarshalerConfig{}) + s := jsonplugin.NewUnmarshalState(data, jsonplugin.DefaultUnmarshalerConfig) unmarshaler.UnmarshalProtoJSON(s) if err := s.Err(); err != nil { t.Fatalf("generated failed to unmarshal: %v", err) diff --git a/test/golang/utils_test.go b/test/golang/utils_test.go index cc23fbe1..5a03cc0c 100644 --- a/test/golang/utils_test.go +++ b/test/golang/utils_test.go @@ -12,17 +12,13 @@ import ( proto "google.golang.org/protobuf/proto" ) -var pluginMarshaler = jsonplugin.MarshalerConfig{ - EnumsAsInts: true, -} - func generatedMarshal(t *testing.T, msg proto.Message, mask []string) []byte { t.Helper() m, ok := msg.(jsonplugin.Marshaler) if !ok { t.Fatalf("message %T does not implement the jsonplugin.Marshaler", msg) } - s := jsonplugin.NewMarshalState(pluginMarshaler).WithFieldMask(mask...) + s := jsonplugin.NewMarshalState(jsonplugin.DefaultMarshalerConfig).WithFieldMask(mask...) m.MarshalProtoJSON(s) b, err := s.Bytes() if err != nil { @@ -37,7 +33,7 @@ func generatedUnmarshal(t *testing.T, msg proto.Message, data []byte) []string { if !ok { t.Fatalf("message %T does not implement the jsonplugin.Unmarshaler", msg) } - s := jsonplugin.NewUnmarshalState(data, jsonplugin.UnmarshalerConfig{}) + s := jsonplugin.NewUnmarshalState(data, jsonplugin.DefaultUnmarshalerConfig) unmarshaler.UnmarshalProtoJSON(s) if err := s.Err(); err != nil { t.Fatalf("generated failed to unmarshal: %v", err) From 5ce77aa9b444dae4229fbd4f9966cafc21a98c1c Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 18 Jan 2022 14:32:28 +0100 Subject: [PATCH 10/46] Remove unnecessary encoding/json code --- internal/gen/gen.go | 1 - jsonplugin/unmarshal.go | 5 +-- test/gogo/enums.gogo_overrides.go | 65 ------------------------------- 3 files changed, 2 insertions(+), 69 deletions(-) delete mode 100644 test/gogo/enums.gogo_overrides.go diff --git a/internal/gen/gen.go b/internal/gen/gen.go index 555e8889..4dc0f3e2 100644 --- a/internal/gen/gen.go +++ b/internal/gen/gen.go @@ -20,7 +20,6 @@ var Params struct { const ( bytesPackage = protogen.GoImportPath("bytes") fmtPackage = protogen.GoImportPath("fmt") - jsonPackage = protogen.GoImportPath("encoding/json") strconvPackage = protogen.GoImportPath("strconv") gogoProtoTypesPackage = protogen.GoImportPath("github.com/gogo/protobuf/types") diff --git a/jsonplugin/unmarshal.go b/jsonplugin/unmarshal.go index 52818d75..1fbe9b1c 100644 --- a/jsonplugin/unmarshal.go +++ b/jsonplugin/unmarshal.go @@ -5,7 +5,6 @@ package jsonplugin import ( "encoding/base64" - "encoding/json" "fmt" "io" "strconv" @@ -651,8 +650,8 @@ func (s *UnmarshalState) ReadFieldMask() FieldMask { } // ReadRawMessage reads a raw JSON message. -func (s *UnmarshalState) ReadRawMessage() json.RawMessage { - var msg json.RawMessage +func (s *UnmarshalState) ReadRawMessage() jsoniter.RawMessage { + var msg jsoniter.RawMessage s.inner.ReadVal(&msg) if s.Err() != nil { return nil diff --git a/test/gogo/enums.gogo_overrides.go b/test/gogo/enums.gogo_overrides.go deleted file mode 100644 index 2d2c5a01..00000000 --- a/test/gogo/enums.gogo_overrides.go +++ /dev/null @@ -1,65 +0,0 @@ -package test - -import ( - "fmt" - "strconv" -) - -// MarshalJSON implements json.Marshaler interface. -func (v CustomEnum) MarshalJSON() ([]byte, error) { - switch v { - case CustomEnum_CUSTOM_UNKNOWN: - return []byte(strconv.Quote("CUSTOM_UNKNOWN")), nil - case CustomEnum_CUSTOM_V1_0: - return []byte(strconv.Quote("1.0")), nil - case CustomEnum_CUSTOM_V1_0_1: - return []byte(strconv.Quote("1.0.1")), nil - } - return []byte(strconv.Itoa(int(v))), nil -} - -func init() { - for k, v := range CustomEnum_customvalue { - CustomEnum_value[k] = v - } -} - -// UnmarshalJSON implements json.Marshaler interface. -func (v *CustomEnum) UnmarshalJSON(b []byte) error { - if unquoted, err := strconv.Unquote(string(b)); err == nil { - switch unquoted { - case "0", "CUSTOM_UNKNOWN", "UNKNOWN": - *v = CustomEnum_CUSTOM_UNKNOWN - case "1.0", "1.0.0", "CUSTOM_V1_0", "V1_0": - *v = CustomEnum_CUSTOM_V1_0 - case "1.0.1", "CUSTOM_V1_0_1", "V1_0_1": - *v = CustomEnum_CUSTOM_V1_0 - default: - return fmt.Errorf("invalid value: %q", unquoted) - } - return nil - } - n, err := strconv.Atoi(string(b)) - if err != nil { - return err - } - *v = CustomEnum(n) - return nil -} - -// MarshalJSON implements json.Marshaler interface. -func (v CustomEnumValue) MarshalJSON() ([]byte, error) { - return v.Value.MarshalJSON() -} - -// UnmarshalJSON implements json.Unmarshaler interface. -func (v *CustomEnumValue) UnmarshalJSON(b []byte) error { - var vv CustomEnum - if err := vv.UnmarshalJSON(b); err != nil { - return err - } - *v = CustomEnumValue{ - Value: vv, - } - return nil -} From a0a6880e78c7ef402bbb908e1e968abab47596ca Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 18 Jan 2022 14:33:02 +0100 Subject: [PATCH 11/46] Add std parameter to generate encoding/json (un)marshalers --- cmd/protoc-gen-go-json/main.go | 1 + internal/gen/enums_marshaler.go | 12 ++++++++++++ internal/gen/enums_unmarshaler.go | 12 ++++++++++++ internal/gen/gen.go | 1 + internal/gen/messages_marshaler.go | 12 ++++++++++++ internal/gen/messages_unmarshaler.go | 12 ++++++++++++ 6 files changed, 50 insertions(+) diff --git a/cmd/protoc-gen-go-json/main.go b/cmd/protoc-gen-go-json/main.go index f5a0398d..85b8df62 100644 --- a/cmd/protoc-gen-go-json/main.go +++ b/cmd/protoc-gen-go-json/main.go @@ -21,6 +21,7 @@ func main() { } var flags flag.FlagSet + flags.BoolVar(&plugin.Params.Std, "std", false, "generate standard library (un)marshalers") flags.StringVar(&plugin.Params.Lang, "lang", "go", "language (go or gogo)") protogen.Options{ diff --git a/internal/gen/enums_marshaler.go b/internal/gen/enums_marshaler.go index 0aa7e86a..167a8278 100644 --- a/internal/gen/enums_marshaler.go +++ b/internal/gen/enums_marshaler.go @@ -90,4 +90,16 @@ func (g *generator) genEnumMarshaler(enum *protogen.Enum) { } g.P("}") g.P() + + if Params.Std { + g.genStdEnumMarshaler(enum) + } +} + +func (g *generator) genStdEnumMarshaler(enum *protogen.Enum) { + g.P("// MarshalJSON marshals the ", enum.GoIdent, " to JSON.") + g.P("func (x ", enum.GoIdent, ") MarshalJSON() ([]byte, error) {") + g.P("return ", jsonPluginPackage.Ident("DefaultMarshalerConfig"), ".Marshal(x)") + g.P("}") + g.P() } diff --git a/internal/gen/enums_unmarshaler.go b/internal/gen/enums_unmarshaler.go index 58b9306c..b117f12d 100644 --- a/internal/gen/enums_unmarshaler.go +++ b/internal/gen/enums_unmarshaler.go @@ -85,4 +85,16 @@ func (g *generator) genEnumUnmarshaler(enum *protogen.Enum) { g.P("*x = ", enum.GoIdent, "(v)") g.P("}") g.P() + + if Params.Std { + g.genStdEnumUnmarshaler(enum) + } +} + +func (g *generator) genStdEnumUnmarshaler(enum *protogen.Enum) { + g.P("// UnmarshalJSON unmarshals the ", enum.GoIdent, " from JSON.") + g.P("func (x *", enum.GoIdent, ") UnmarshalJSON(b []byte) error {") + g.P("return ", jsonPluginPackage.Ident("DefaultUnmarshalerConfig"), ".Unmarshal(b, x)") + g.P("}") + g.P() } diff --git a/internal/gen/gen.go b/internal/gen/gen.go index 4dc0f3e2..f9ee99ee 100644 --- a/internal/gen/gen.go +++ b/internal/gen/gen.go @@ -15,6 +15,7 @@ var Version = "0.0.0-dev" // Params are the parameters for the generator. var Params struct { Lang string + Std bool } const ( diff --git a/internal/gen/messages_marshaler.go b/internal/gen/messages_marshaler.go index 0f8fe309..06230679 100644 --- a/internal/gen/messages_marshaler.go +++ b/internal/gen/messages_marshaler.go @@ -418,6 +418,18 @@ nextField: g.P("}") // end func (x *{message.GoIdent}) MarshalProtoJSON() g.P() + + if Params.Std { + g.genStdMessageMarshaler(message) + } +} + +func (g *generator) genStdMessageMarshaler(message *protogen.Message) { + g.P("// MarshalJSON marshals the ", message.GoIdent, " to JSON.") + g.P("func (x ", message.GoIdent, ") MarshalJSON() ([]byte, error) {") + g.P("return ", jsonPluginPackage.Ident("DefaultMarshalerConfig"), ".Marshal(&x)") + g.P("}") + g.P() } func (g *generator) writeWrapperValue(message *protogen.Message, ident string) { diff --git a/internal/gen/messages_unmarshaler.go b/internal/gen/messages_unmarshaler.go index 2bef032e..6863892e 100644 --- a/internal/gen/messages_unmarshaler.go +++ b/internal/gen/messages_unmarshaler.go @@ -401,6 +401,18 @@ nextField: g.P("})") // end s.ReadObject() g.P("}") // end func (x *{message.GoIdent}) MarshalProtoJSON() g.P() + + if Params.Std { + g.genStdMessageUnmarshaler(message) + } +} + +func (g *generator) genStdMessageUnmarshaler(message *protogen.Message) { + g.P("// UnmarshalJSON unmarshals the ", message.GoIdent, " from JSON.") + g.P("func (x *", message.GoIdent, ") UnmarshalJSON(b []byte) error {") + g.P("return ", jsonPluginPackage.Ident("DefaultUnmarshalerConfig"), ".Unmarshal(b, x)") + g.P("}") + g.P() } func (g *generator) readWrapperValue(message *protogen.Message) string { From 99a2aaa620e0885b093da0b997333f4a8dfb68a6 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 18 Jan 2022 14:33:40 +0100 Subject: [PATCH 12/46] Generate encoding/json (un)marshalers in test packages --- Makefile | 4 +-- test/gogo/enums_json.pb.go | 30 ++++++++++++++++++++ test/gogo/gogo_json.pb.go | 50 ++++++++++++++++++++++++++++++++++ test/gogo/scalars_json.pb.go | 30 ++++++++++++++++++++ test/gogo/wkts_json.pb.go | 40 +++++++++++++++++++++++++++ test/golang/enums_json.pb.go | 30 ++++++++++++++++++++ test/golang/gogo_json.pb.go | 50 ++++++++++++++++++++++++++++++++++ test/golang/scalars_json.pb.go | 30 ++++++++++++++++++++ test/golang/wkts_json.pb.go | 40 +++++++++++++++++++++++++++ 9 files changed, 302 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d4facdf6..599c08ae 100644 --- a/Makefile +++ b/Makefile @@ -72,11 +72,11 @@ endif testprotos: build .dev/golangproto/bin/protoc .dev/gogoproto/bin/protoc .dev/gogoproto/bin/protoc-gen-gogo PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I ./test -I . \ --go_opt=paths=source_relative --go_out=./test/golang \ - --go-json_opt=paths=source_relative --go-json_out=./test/golang \ + --go-json_opt=paths=source_relative --go-json_opt=std=true --go-json_out=./test/golang \ ./test/*.proto PATH="$$PWD/.bin:$$PWD/.dev/gogoproto/bin:$$PATH" protoc -I ./test -I . \ --gogo_opt=paths=source_relative --gogo_opt=$(REPLACES) --gogo_out=./test/gogo \ - --go-json_opt=paths=source_relative --go-json_opt=$(REPLACES) --go-json_opt=lang=gogo --go-json_out=./test/gogo \ + --go-json_opt=paths=source_relative --go-json_opt=$(REPLACES) --go-json_opt=lang=gogo --go-json_opt=std=true --go-json_out=./test/gogo \ ./test/*.proto .PHONY: test diff --git a/test/gogo/enums_json.pb.go b/test/gogo/enums_json.pb.go index 4fdf88e5..d3233795 100644 --- a/test/gogo/enums_json.pb.go +++ b/test/gogo/enums_json.pb.go @@ -21,6 +21,11 @@ func (x CustomEnum) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteEnumString(int32(x), CustomEnum_customname, CustomEnum_name) } +// MarshalJSON marshals the CustomEnum to JSON. +func (x CustomEnum) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) +} + // CustomEnum_customvalue contains custom string values that extend CustomEnum_value. var CustomEnum_customvalue = map[string]int32{ "UNKNOWN": 0, @@ -41,6 +46,11 @@ func (x *CustomEnum) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { *x = CustomEnum(v) } +// UnmarshalJSON unmarshals the CustomEnum from JSON. +func (x *CustomEnum) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the CustomEnumValue message to JSON. func (x *CustomEnumValue) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -119,6 +129,11 @@ func (x *MessageWithEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithEnums to JSON. +func (x MessageWithEnums) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithEnums message from JSON. func (x *MessageWithEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -170,6 +185,11 @@ func (x *MessageWithEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) } +// UnmarshalJSON unmarshals the MessageWithEnums from JSON. +func (x *MessageWithEnums) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithOneofEnums message to JSON. func (x *MessageWithOneofEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -197,6 +217,11 @@ func (x *MessageWithOneofEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithOneofEnums to JSON. +func (x MessageWithOneofEnums) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithOneofEnums message from JSON. func (x *MessageWithOneofEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -227,3 +252,8 @@ func (x *MessageWithOneofEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) } }) } + +// UnmarshalJSON unmarshals the MessageWithOneofEnums from JSON. +func (x *MessageWithOneofEnums) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} diff --git a/test/gogo/gogo_json.pb.go b/test/gogo/gogo_json.pb.go index a14052c7..8c09de6f 100644 --- a/test/gogo/gogo_json.pb.go +++ b/test/gogo/gogo_json.pb.go @@ -77,6 +77,11 @@ func (x *MessageWithGoGoOptions) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithGoGoOptions to JSON. +func (x MessageWithGoGoOptions) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithGoGoOptions message from JSON. func (x *MessageWithGoGoOptions) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -137,6 +142,11 @@ func (x *MessageWithGoGoOptions) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState }) } +// UnmarshalJSON unmarshals the MessageWithGoGoOptions from JSON. +func (x *MessageWithGoGoOptions) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the SubMessage message to JSON. func (x *SubMessage) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -153,6 +163,11 @@ func (x *SubMessage) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the SubMessage to JSON. +func (x SubMessage) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the SubMessage message from JSON. func (x *SubMessage) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -169,6 +184,11 @@ func (x *SubMessage) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) } +// UnmarshalJSON unmarshals the SubMessage from JSON. +func (x *SubMessage) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithNullable message to JSON. func (x *MessageWithNullable) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -214,6 +234,11 @@ func (x *MessageWithNullable) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithNullable to JSON. +func (x MessageWithNullable) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithNullable message from JSON. func (x *MessageWithNullable) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -255,6 +280,11 @@ func (x *MessageWithNullable) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) } +// UnmarshalJSON unmarshals the MessageWithNullable from JSON. +func (x *MessageWithNullable) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithEmbedded message to JSON. func (x *MessageWithEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -277,6 +307,11 @@ func (x *MessageWithEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithEmbedded to JSON. +func (x MessageWithEmbedded) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithEmbedded message from JSON. func (x *MessageWithEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -301,6 +336,11 @@ func (x *MessageWithEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) } +// UnmarshalJSON unmarshals the MessageWithEmbedded from JSON. +func (x *MessageWithEmbedded) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithNullableEmbedded message to JSON. func (x *MessageWithNullableEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -323,6 +363,11 @@ func (x *MessageWithNullableEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalStat s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithNullableEmbedded to JSON. +func (x MessageWithNullableEmbedded) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithNullableEmbedded message from JSON. func (x *MessageWithNullableEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -345,3 +390,8 @@ func (x *MessageWithNullableEmbedded) UnmarshalProtoJSON(s *jsonplugin.Unmarshal } }) } + +// UnmarshalJSON unmarshals the MessageWithNullableEmbedded from JSON. +func (x *MessageWithNullableEmbedded) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} diff --git a/test/gogo/scalars_json.pb.go b/test/gogo/scalars_json.pb.go index f5c297ee..34118b77 100644 --- a/test/gogo/scalars_json.pb.go +++ b/test/gogo/scalars_json.pb.go @@ -182,6 +182,11 @@ func (x *MessageWithScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithScalars to JSON. +func (x MessageWithScalars) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithScalars message from JSON. func (x *MessageWithScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -291,6 +296,11 @@ func (x *MessageWithScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) } +// UnmarshalJSON unmarshals the MessageWithScalars from JSON. +func (x *MessageWithScalars) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithOneofScalars message to JSON. func (x *MessageWithOneofScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -370,6 +380,11 @@ func (x *MessageWithOneofScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithOneofScalars to JSON. +func (x MessageWithOneofScalars) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithOneofScalars message from JSON. func (x *MessageWithOneofScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -463,6 +478,11 @@ func (x *MessageWithOneofScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalStat }) } +// UnmarshalJSON unmarshals the MessageWithOneofScalars from JSON. +func (x *MessageWithOneofScalars) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithScalarMaps message to JSON. func (x *MessageWithScalarMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -791,6 +811,11 @@ func (x *MessageWithScalarMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithScalarMaps to JSON. +func (x MessageWithScalarMaps) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithScalarMaps message from JSON. func (x *MessageWithScalarMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -962,3 +987,8 @@ func (x *MessageWithScalarMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) } }) } + +// UnmarshalJSON unmarshals the MessageWithScalarMaps from JSON. +func (x *MessageWithScalarMaps) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} diff --git a/test/gogo/wkts_json.pb.go b/test/gogo/wkts_json.pb.go index 0905fe21..77362b03 100644 --- a/test/gogo/wkts_json.pb.go +++ b/test/gogo/wkts_json.pb.go @@ -28,6 +28,11 @@ func (x *MessageWithMarshaler) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithMarshaler to JSON. +func (x MessageWithMarshaler) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithMarshaler message from JSON. func (x *MessageWithMarshaler) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -44,6 +49,11 @@ func (x *MessageWithMarshaler) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) }) } +// UnmarshalJSON unmarshals the MessageWithMarshaler from JSON. +func (x *MessageWithMarshaler) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithWKTs message to JSON. func (x *MessageWithWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -463,6 +473,11 @@ func (x *MessageWithWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithWKTs to JSON. +func (x MessageWithWKTs) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithWKTs message from JSON. func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -802,6 +817,11 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) } +// UnmarshalJSON unmarshals the MessageWithWKTs from JSON. +func (x *MessageWithWKTs) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithOneofWKTs message to JSON. func (x *MessageWithOneofWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -953,6 +973,11 @@ func (x *MessageWithOneofWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithOneofWKTs to JSON. +func (x MessageWithOneofWKTs) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithOneofWKTs message from JSON. func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -1137,6 +1162,11 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) }) } +// UnmarshalJSON unmarshals the MessageWithOneofWKTs from JSON. +func (x *MessageWithOneofWKTs) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithWKTMaps message to JSON. func (x *MessageWithWKTMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -1420,6 +1450,11 @@ func (x *MessageWithWKTMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithWKTMaps to JSON. +func (x MessageWithWKTMaps) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithWKTMaps message from JSON. func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -1638,3 +1673,8 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { } }) } + +// UnmarshalJSON unmarshals the MessageWithWKTMaps from JSON. +func (x *MessageWithWKTMaps) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} diff --git a/test/golang/enums_json.pb.go b/test/golang/enums_json.pb.go index de19104e..0da653ca 100644 --- a/test/golang/enums_json.pb.go +++ b/test/golang/enums_json.pb.go @@ -21,6 +21,11 @@ func (x CustomEnum) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteEnumString(int32(x), CustomEnum_customname, CustomEnum_name) } +// MarshalJSON marshals the CustomEnum to JSON. +func (x CustomEnum) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) +} + // CustomEnum_customvalue contains custom string values that extend CustomEnum_value. var CustomEnum_customvalue = map[string]int32{ "UNKNOWN": 0, @@ -41,6 +46,11 @@ func (x *CustomEnum) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { *x = CustomEnum(v) } +// UnmarshalJSON unmarshals the CustomEnum from JSON. +func (x *CustomEnum) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the CustomEnumValue message to JSON. func (x *CustomEnumValue) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -119,6 +129,11 @@ func (x *MessageWithEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithEnums to JSON. +func (x MessageWithEnums) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithEnums message from JSON. func (x *MessageWithEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -170,6 +185,11 @@ func (x *MessageWithEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) } +// UnmarshalJSON unmarshals the MessageWithEnums from JSON. +func (x *MessageWithEnums) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithOneofEnums message to JSON. func (x *MessageWithOneofEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -197,6 +217,11 @@ func (x *MessageWithOneofEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithOneofEnums to JSON. +func (x MessageWithOneofEnums) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithOneofEnums message from JSON. func (x *MessageWithOneofEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -227,3 +252,8 @@ func (x *MessageWithOneofEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) } }) } + +// UnmarshalJSON unmarshals the MessageWithOneofEnums from JSON. +func (x *MessageWithOneofEnums) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} diff --git a/test/golang/gogo_json.pb.go b/test/golang/gogo_json.pb.go index cf2be3e2..9f0b3771 100644 --- a/test/golang/gogo_json.pb.go +++ b/test/golang/gogo_json.pb.go @@ -79,6 +79,11 @@ func (x *MessageWithGoGoOptions) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithGoGoOptions to JSON. +func (x MessageWithGoGoOptions) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithGoGoOptions message from JSON. func (x *MessageWithGoGoOptions) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -132,6 +137,11 @@ func (x *MessageWithGoGoOptions) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState }) } +// UnmarshalJSON unmarshals the MessageWithGoGoOptions from JSON. +func (x *MessageWithGoGoOptions) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the SubMessage message to JSON. func (x *SubMessage) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -148,6 +158,11 @@ func (x *SubMessage) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the SubMessage to JSON. +func (x SubMessage) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the SubMessage message from JSON. func (x *SubMessage) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -164,6 +179,11 @@ func (x *SubMessage) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) } +// UnmarshalJSON unmarshals the SubMessage from JSON. +func (x *SubMessage) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithNullable message to JSON. func (x *MessageWithNullable) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -209,6 +229,11 @@ func (x *MessageWithNullable) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithNullable to JSON. +func (x MessageWithNullable) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithNullable message from JSON. func (x *MessageWithNullable) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -255,6 +280,11 @@ func (x *MessageWithNullable) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) } +// UnmarshalJSON unmarshals the MessageWithNullable from JSON. +func (x *MessageWithNullable) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithEmbedded message to JSON. func (x *MessageWithEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -277,6 +307,11 @@ func (x *MessageWithEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithEmbedded to JSON. +func (x MessageWithEmbedded) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithEmbedded message from JSON. func (x *MessageWithEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -301,6 +336,11 @@ func (x *MessageWithEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) } +// UnmarshalJSON unmarshals the MessageWithEmbedded from JSON. +func (x *MessageWithEmbedded) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithNullableEmbedded message to JSON. func (x *MessageWithNullableEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -323,6 +363,11 @@ func (x *MessageWithNullableEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalStat s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithNullableEmbedded to JSON. +func (x MessageWithNullableEmbedded) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithNullableEmbedded message from JSON. func (x *MessageWithNullableEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -346,3 +391,8 @@ func (x *MessageWithNullableEmbedded) UnmarshalProtoJSON(s *jsonplugin.Unmarshal } }) } + +// UnmarshalJSON unmarshals the MessageWithNullableEmbedded from JSON. +func (x *MessageWithNullableEmbedded) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} diff --git a/test/golang/scalars_json.pb.go b/test/golang/scalars_json.pb.go index d8111bcd..c9a4521b 100644 --- a/test/golang/scalars_json.pb.go +++ b/test/golang/scalars_json.pb.go @@ -182,6 +182,11 @@ func (x *MessageWithScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithScalars to JSON. +func (x MessageWithScalars) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithScalars message from JSON. func (x *MessageWithScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -291,6 +296,11 @@ func (x *MessageWithScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) } +// UnmarshalJSON unmarshals the MessageWithScalars from JSON. +func (x *MessageWithScalars) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithOneofScalars message to JSON. func (x *MessageWithOneofScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -370,6 +380,11 @@ func (x *MessageWithOneofScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithOneofScalars to JSON. +func (x MessageWithOneofScalars) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithOneofScalars message from JSON. func (x *MessageWithOneofScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -463,6 +478,11 @@ func (x *MessageWithOneofScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalStat }) } +// UnmarshalJSON unmarshals the MessageWithOneofScalars from JSON. +func (x *MessageWithOneofScalars) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithScalarMaps message to JSON. func (x *MessageWithScalarMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -791,6 +811,11 @@ func (x *MessageWithScalarMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithScalarMaps to JSON. +func (x MessageWithScalarMaps) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithScalarMaps message from JSON. func (x *MessageWithScalarMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -962,3 +987,8 @@ func (x *MessageWithScalarMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) } }) } + +// UnmarshalJSON unmarshals the MessageWithScalarMaps from JSON. +func (x *MessageWithScalarMaps) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} diff --git a/test/golang/wkts_json.pb.go b/test/golang/wkts_json.pb.go index f80d7d18..fd5df086 100644 --- a/test/golang/wkts_json.pb.go +++ b/test/golang/wkts_json.pb.go @@ -34,6 +34,11 @@ func (x *MessageWithMarshaler) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithMarshaler to JSON. +func (x MessageWithMarshaler) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithMarshaler message from JSON. func (x *MessageWithMarshaler) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -50,6 +55,11 @@ func (x *MessageWithMarshaler) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) }) } +// UnmarshalJSON unmarshals the MessageWithMarshaler from JSON. +func (x *MessageWithMarshaler) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithWKTs message to JSON. func (x *MessageWithWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -469,6 +479,11 @@ func (x *MessageWithWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithWKTs to JSON. +func (x MessageWithWKTs) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithWKTs message from JSON. func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -808,6 +823,11 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) } +// UnmarshalJSON unmarshals the MessageWithWKTs from JSON. +func (x *MessageWithWKTs) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithOneofWKTs message to JSON. func (x *MessageWithOneofWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -959,6 +979,11 @@ func (x *MessageWithOneofWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithOneofWKTs to JSON. +func (x MessageWithOneofWKTs) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithOneofWKTs message from JSON. func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -1143,6 +1168,11 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) }) } +// UnmarshalJSON unmarshals the MessageWithOneofWKTs from JSON. +func (x *MessageWithOneofWKTs) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithWKTMaps message to JSON. func (x *MessageWithWKTMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { @@ -1426,6 +1456,11 @@ func (x *MessageWithWKTMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteObjectEnd() } +// MarshalJSON marshals the MessageWithWKTMaps to JSON. +func (x MessageWithWKTMaps) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the MessageWithWKTMaps message from JSON. func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -1644,3 +1679,8 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { } }) } + +// UnmarshalJSON unmarshals the MessageWithWKTMaps from JSON. +func (x *MessageWithWKTMaps) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} From 687c7777617fe27ef20338872c3ba8de6fe19e9a Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 18 Jan 2022 15:00:10 +0100 Subject: [PATCH 13/46] Fix missing std marshalers for wrappers --- internal/gen/enums.go | 6 ++++++ internal/gen/enums_marshaler.go | 4 ---- internal/gen/enums_unmarshaler.go | 4 ---- internal/gen/messages.go | 6 ++++++ internal/gen/messages_marshaler.go | 4 ---- internal/gen/messages_unmarshaler.go | 4 ---- test/gogo/enums_json.pb.go | 10 ++++++++++ test/golang/enums_json.pb.go | 10 ++++++++++ 8 files changed, 32 insertions(+), 16 deletions(-) diff --git a/internal/gen/enums.go b/internal/gen/enums.go index e2bdb29d..029f84bd 100644 --- a/internal/gen/enums.go +++ b/internal/gen/enums.go @@ -17,10 +17,16 @@ func (g *generator) enumHasAnyMarshaler(enum *protogen.Enum) bool { func (g *generator) genEnum(enum *protogen.Enum) { if g.enumHasMarshaler(enum) { g.genEnumMarshaler(enum) + if Params.Std { + g.genStdEnumMarshaler(enum) + } } if g.enumHasUnmarshaler(enum) { g.genEnumUnmarshaler(enum) + if Params.Std { + g.genStdEnumUnmarshaler(enum) + } } } diff --git a/internal/gen/enums_marshaler.go b/internal/gen/enums_marshaler.go index 167a8278..544fa9c0 100644 --- a/internal/gen/enums_marshaler.go +++ b/internal/gen/enums_marshaler.go @@ -90,10 +90,6 @@ func (g *generator) genEnumMarshaler(enum *protogen.Enum) { } g.P("}") g.P() - - if Params.Std { - g.genStdEnumMarshaler(enum) - } } func (g *generator) genStdEnumMarshaler(enum *protogen.Enum) { diff --git a/internal/gen/enums_unmarshaler.go b/internal/gen/enums_unmarshaler.go index b117f12d..cac13415 100644 --- a/internal/gen/enums_unmarshaler.go +++ b/internal/gen/enums_unmarshaler.go @@ -85,10 +85,6 @@ func (g *generator) genEnumUnmarshaler(enum *protogen.Enum) { g.P("*x = ", enum.GoIdent, "(v)") g.P("}") g.P() - - if Params.Std { - g.genStdEnumUnmarshaler(enum) - } } func (g *generator) genStdEnumUnmarshaler(enum *protogen.Enum) { diff --git a/internal/gen/messages.go b/internal/gen/messages.go index 07e67edc..a06e4143 100644 --- a/internal/gen/messages.go +++ b/internal/gen/messages.go @@ -52,11 +52,17 @@ func (g *generator) genMessage(message *protogen.Message) { // Generate marshaler for the message itself, if it has one. if g.messageHasMarshaler(message) { g.genMessageMarshaler(message) + if Params.Std { + g.genStdMessageMarshaler(message) + } } // Generate unmarshaler for the message itself, if it has one. if g.messageHasUnmarshaler(message) { g.genMessageUnmarshaler(message) + if Params.Std { + g.genStdMessageUnmarshaler(message) + } } } diff --git a/internal/gen/messages_marshaler.go b/internal/gen/messages_marshaler.go index 06230679..b5fc5ed6 100644 --- a/internal/gen/messages_marshaler.go +++ b/internal/gen/messages_marshaler.go @@ -418,10 +418,6 @@ nextField: g.P("}") // end func (x *{message.GoIdent}) MarshalProtoJSON() g.P() - - if Params.Std { - g.genStdMessageMarshaler(message) - } } func (g *generator) genStdMessageMarshaler(message *protogen.Message) { diff --git a/internal/gen/messages_unmarshaler.go b/internal/gen/messages_unmarshaler.go index 6863892e..9acbabde 100644 --- a/internal/gen/messages_unmarshaler.go +++ b/internal/gen/messages_unmarshaler.go @@ -401,10 +401,6 @@ nextField: g.P("})") // end s.ReadObject() g.P("}") // end func (x *{message.GoIdent}) MarshalProtoJSON() g.P() - - if Params.Std { - g.genStdMessageUnmarshaler(message) - } } func (g *generator) genStdMessageUnmarshaler(message *protogen.Message) { diff --git a/test/gogo/enums_json.pb.go b/test/gogo/enums_json.pb.go index d3233795..525fb9f3 100644 --- a/test/gogo/enums_json.pb.go +++ b/test/gogo/enums_json.pb.go @@ -61,6 +61,11 @@ func (x *CustomEnumValue) MarshalProtoJSON(s *jsonplugin.MarshalState) { return } +// MarshalJSON marshals the CustomEnumValue to JSON. +func (x CustomEnumValue) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the CustomEnumValue message from JSON. func (x *CustomEnumValue) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -70,6 +75,11 @@ func (x *CustomEnumValue) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { return } +// UnmarshalJSON unmarshals the CustomEnumValue from JSON. +func (x *CustomEnumValue) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithEnums message to JSON. func (x *MessageWithEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { diff --git a/test/golang/enums_json.pb.go b/test/golang/enums_json.pb.go index 0da653ca..79ce7f87 100644 --- a/test/golang/enums_json.pb.go +++ b/test/golang/enums_json.pb.go @@ -61,6 +61,11 @@ func (x *CustomEnumValue) MarshalProtoJSON(s *jsonplugin.MarshalState) { return } +// MarshalJSON marshals the CustomEnumValue to JSON. +func (x CustomEnumValue) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +} + // UnmarshalProtoJSON unmarshals the CustomEnumValue message from JSON. func (x *CustomEnumValue) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { @@ -70,6 +75,11 @@ func (x *CustomEnumValue) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { return } +// UnmarshalJSON unmarshals the CustomEnumValue from JSON. +func (x *CustomEnumValue) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the MessageWithEnums message to JSON. func (x *MessageWithEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x == nil { From ff4140a5656581e2a9725730f46073053e9c7acc Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Wed, 19 Jan 2022 09:59:41 +0100 Subject: [PATCH 14/46] Add TextMarshalers and TextUnmarshalers to enums --- internal/gen/enums_marshaler.go | 10 ++++++++++ internal/gen/enums_unmarshaler.go | 15 +++++++++++++++ jsonplugin/marshal.go | 20 +++++++++++++------- jsonplugin/unmarshal.go | 27 +++++++++++++++++++++------ test/gogo/enums_json.pb.go | 15 +++++++++++++++ test/golang/enums_json.pb.go | 15 +++++++++++++++ 6 files changed, 89 insertions(+), 13 deletions(-) diff --git a/internal/gen/enums_marshaler.go b/internal/gen/enums_marshaler.go index 544fa9c0..750a71fb 100644 --- a/internal/gen/enums_marshaler.go +++ b/internal/gen/enums_marshaler.go @@ -93,6 +93,16 @@ func (g *generator) genEnumMarshaler(enum *protogen.Enum) { } func (g *generator) genStdEnumMarshaler(enum *protogen.Enum) { + g.P("// MarshalText marshals the ", enum.GoIdent, " to text.") + g.P("func (x ", enum.GoIdent, ") MarshalText() ([]byte, error) {") + if g.enumHasCustomValues(enum) { + g.P("return []byte(", jsonPluginPackage.Ident("GetEnumString"), "(int32(x), ", enum.GoIdent, "_customname, ", enum.GoIdent, "_name)), nil") + } else { + g.P("return []byte(", jsonPluginPackage.Ident("GetEnumString"), "(int32(x), ", enum.GoIdent, "_name)), nil") + } + g.P("}") + g.P() + g.P("// MarshalJSON marshals the ", enum.GoIdent, " to JSON.") g.P("func (x ", enum.GoIdent, ") MarshalJSON() ([]byte, error) {") g.P("return ", jsonPluginPackage.Ident("DefaultMarshalerConfig"), ".Marshal(x)") diff --git a/internal/gen/enums_unmarshaler.go b/internal/gen/enums_unmarshaler.go index cac13415..dce545bd 100644 --- a/internal/gen/enums_unmarshaler.go +++ b/internal/gen/enums_unmarshaler.go @@ -88,6 +88,21 @@ func (g *generator) genEnumUnmarshaler(enum *protogen.Enum) { } func (g *generator) genStdEnumUnmarshaler(enum *protogen.Enum) { + g.P("// UnmarshalText unmarshals the ", enum.GoIdent, " from text.") + g.P("func (x *", enum.GoIdent, ") UnmarshalText(b []byte) error {") + if g.enumHasCustomAliases(enum) { + g.P("i, err := ", jsonPluginPackage.Ident("ParseEnumString"), "(string(b), ", enum.GoIdent, "_customvalue, ", enum.GoIdent, "_value)") + } else { + g.P("i, err := ", jsonPluginPackage.Ident("ParseEnumString"), "(string(b), ", enum.GoIdent, "_value)") + } + g.P("if err != nil {") + g.P("return err") + g.P("}") + g.P("*x = ", enum.GoIdent, "(i)") + g.P("return nil") + g.P("}") + g.P() + g.P("// UnmarshalJSON unmarshals the ", enum.GoIdent, " from JSON.") g.P("func (x *", enum.GoIdent, ") UnmarshalJSON(b []byte) error {") g.P("return ", jsonPluginPackage.Ident("DefaultUnmarshalerConfig"), ".Unmarshal(b, x)") diff --git a/jsonplugin/marshal.go b/jsonplugin/marshal.go index 1c11623e..02348358 100644 --- a/jsonplugin/marshal.go +++ b/jsonplugin/marshal.go @@ -519,18 +519,24 @@ func (s *MarshalState) WriteEnum(x int32, valueMaps ...map[int32]string) { } } +// GetEnumString gets the string representation of the enum using the value maps. +// If none of the value maps contains a mapping for the enum value, +// it returns the numeric value as a string. +func GetEnumString(x int32, valueMaps ...map[int32]string) string { + for _, valueMap := range valueMaps { + if v, ok := valueMap[x]; ok { + return v + } + } + return strconv.FormatInt(int64(x), 10) +} + // WriteEnumString writes an enum value as a string. func (s *MarshalState) WriteEnumString(x int32, valueMaps ...map[int32]string) { if s.Err() != nil { return } - for _, valueMap := range valueMaps { - if v, ok := valueMap[x]; ok { - s.WriteString(v) - return - } - } - s.WriteEnumNumber(x) + s.WriteString(GetEnumString(x, valueMaps...)) } // WriteEnumNumber writes an enum value as a number. diff --git a/jsonplugin/unmarshal.go b/jsonplugin/unmarshal.go index 1fbe9b1c..2319c589 100644 --- a/jsonplugin/unmarshal.go +++ b/jsonplugin/unmarshal.go @@ -563,6 +563,22 @@ func (s *UnmarshalState) ReadArray(cb func()) { }) } +// ParseEnumString parses an enum from its string representation using the value maps. +// If none of the value maps contains a mapping for the string value, +// it attempts to parse the string as a numeric value. +func ParseEnumString(v string, valueMaps ...map[string]int32) (int32, error) { + for _, valueMap := range valueMaps { + if x, ok := valueMap[v]; ok { + return x, nil + } + } + x, err := strconv.ParseInt(v, 10, 32) + if err != nil { + return 0, err + } + return int32(x), nil +} + // ReadEnum reads an enum. It supports numeric values and string values. func (s *UnmarshalState) ReadEnum(valueMaps ...map[string]int32) int32 { if s.Err() != nil { @@ -573,13 +589,12 @@ func (s *UnmarshalState) ReadEnum(valueMaps ...map[string]int32) int32 { return any.ToInt32() case jsoniter.StringValue: v := any.ToString() - for _, valueMap := range valueMaps { - if v, ok := valueMap[v]; ok { - return v - } + x, err := ParseEnumString(v, valueMaps...) + if err != nil { + s.SetErrorf("unknown value for enum: %q", v) + return 0 } - s.SetErrorf("unknown value for enum: %q", v) - return 0 + return x default: s.SetErrorf("invalid value type for enum: %s", valueTypeString(any.ValueType())) return 0 diff --git a/test/gogo/enums_json.pb.go b/test/gogo/enums_json.pb.go index 525fb9f3..793a1bd1 100644 --- a/test/gogo/enums_json.pb.go +++ b/test/gogo/enums_json.pb.go @@ -21,6 +21,11 @@ func (x CustomEnum) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteEnumString(int32(x), CustomEnum_customname, CustomEnum_name) } +// MarshalText marshals the CustomEnum to text. +func (x CustomEnum) MarshalText() ([]byte, error) { + return []byte(jsonplugin.GetEnumString(int32(x), CustomEnum_customname, CustomEnum_name)), nil +} + // MarshalJSON marshals the CustomEnum to JSON. func (x CustomEnum) MarshalJSON() ([]byte, error) { return jsonplugin.DefaultMarshalerConfig.Marshal(x) @@ -46,6 +51,16 @@ func (x *CustomEnum) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { *x = CustomEnum(v) } +// UnmarshalText unmarshals the CustomEnum from text. +func (x *CustomEnum) UnmarshalText(b []byte) error { + i, err := jsonplugin.ParseEnumString(string(b), CustomEnum_customvalue, CustomEnum_value) + if err != nil { + return err + } + *x = CustomEnum(i) + return nil +} + // UnmarshalJSON unmarshals the CustomEnum from JSON. func (x *CustomEnum) UnmarshalJSON(b []byte) error { return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) diff --git a/test/golang/enums_json.pb.go b/test/golang/enums_json.pb.go index 79ce7f87..e85dc97f 100644 --- a/test/golang/enums_json.pb.go +++ b/test/golang/enums_json.pb.go @@ -21,6 +21,11 @@ func (x CustomEnum) MarshalProtoJSON(s *jsonplugin.MarshalState) { s.WriteEnumString(int32(x), CustomEnum_customname, CustomEnum_name) } +// MarshalText marshals the CustomEnum to text. +func (x CustomEnum) MarshalText() ([]byte, error) { + return []byte(jsonplugin.GetEnumString(int32(x), CustomEnum_customname, CustomEnum_name)), nil +} + // MarshalJSON marshals the CustomEnum to JSON. func (x CustomEnum) MarshalJSON() ([]byte, error) { return jsonplugin.DefaultMarshalerConfig.Marshal(x) @@ -46,6 +51,16 @@ func (x *CustomEnum) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { *x = CustomEnum(v) } +// UnmarshalText unmarshals the CustomEnum from text. +func (x *CustomEnum) UnmarshalText(b []byte) error { + i, err := jsonplugin.ParseEnumString(string(b), CustomEnum_customvalue, CustomEnum_value) + if err != nil { + return err + } + *x = CustomEnum(i) + return nil +} + // UnmarshalJSON unmarshals the CustomEnum from JSON. func (x *CustomEnum) UnmarshalJSON(b []byte) error { return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) From 5b82793340577b6c4c4cf781bbd792ee5f628cea Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Wed, 19 Jan 2022 11:51:26 +0100 Subject: [PATCH 15/46] Respect marshal_as_number in enum TextMarshaler --- internal/gen/enums_marshaler.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/gen/enums_marshaler.go b/internal/gen/enums_marshaler.go index 750a71fb..c911a575 100644 --- a/internal/gen/enums_marshaler.go +++ b/internal/gen/enums_marshaler.go @@ -93,12 +93,18 @@ func (g *generator) genEnumMarshaler(enum *protogen.Enum) { } func (g *generator) genStdEnumMarshaler(enum *protogen.Enum) { + ext, _ := proto.GetExtension(enum.Desc.Options().(*descriptorpb.EnumOptions), annotations.E_Enum).(*annotations.EnumOptions) + g.P("// MarshalText marshals the ", enum.GoIdent, " to text.") g.P("func (x ", enum.GoIdent, ") MarshalText() ([]byte, error) {") - if g.enumHasCustomValues(enum) { - g.P("return []byte(", jsonPluginPackage.Ident("GetEnumString"), "(int32(x), ", enum.GoIdent, "_customname, ", enum.GoIdent, "_name)), nil") + if ext.GetMarshalAsNumber() { + g.P("return []byte(", strconvPackage.Ident("FormatInt"), "(int64(x), 10)), nil") } else { - g.P("return []byte(", jsonPluginPackage.Ident("GetEnumString"), "(int32(x), ", enum.GoIdent, "_name)), nil") + if g.enumHasCustomValues(enum) { + g.P("return []byte(", jsonPluginPackage.Ident("GetEnumString"), "(int32(x), ", enum.GoIdent, "_customname, ", enum.GoIdent, "_name)), nil") + } else { + g.P("return []byte(", jsonPluginPackage.Ident("GetEnumString"), "(int32(x), ", enum.GoIdent, "_name)), nil") + } } g.P("}") g.P() From 5bb0c20af3918f9f0083f41066f1fe9e8ea292d8 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Fri, 21 Jan 2022 15:26:19 +0100 Subject: [PATCH 16/46] Fix unmarshaling of explicit null maps, slices and messages --- internal/gen/messages_unmarshaler.go | 39 ++- test/gogo/enums_json.pb.go | 34 +- test/gogo/gogo_json.pb.go | 48 ++- test/gogo/scalars_json.pb.go | 204 ++++++++++- test/gogo/wkts_json.pb.go | 486 ++++++++++++++++++++------- test/golang/enums_json.pb.go | 34 +- test/golang/gogo_json.pb.go | 64 +++- test/golang/scalars_json.pb.go | 204 ++++++++++- test/golang/wkts_json.pb.go | 486 ++++++++++++++++++++------- 9 files changed, 1270 insertions(+), 329 deletions(-) diff --git a/internal/gen/messages_unmarshaler.go b/internal/gen/messages_unmarshaler.go index 9acbabde..4bae1546 100644 --- a/internal/gen/messages_unmarshaler.go +++ b/internal/gen/messages_unmarshaler.go @@ -158,6 +158,12 @@ nextField: } if field.Desc.IsMap() { + // If we read null, set the field to nil. + g.P("if s.ReadNil() {") + g.P("x.", fieldGoName, " = nil") + g.P("return") + g.P("}") + // If the field has a custom unmarshaler, call that and continue with the next field. if unmarshalerFunc != nil { g.P("x.", fieldGoName, " = ", *unmarshalerFunc, `(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) @@ -231,6 +237,12 @@ nextField: } if field.Desc.IsList() { + // If we read null, set the field to nil. + g.P("if s.ReadNil() {") + g.P("x.", fieldGoName, " = nil") + g.P("return") + g.P("}") + // If the field has a custom unmarshaler, call that and continue with the next field. if unmarshalerFunc != nil { g.P("x.", fieldGoName, " = ", *unmarshalerFunc, `(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) @@ -322,20 +334,37 @@ nextField: // If this field is in a oneof, allocate a new oneof value wrapper. if field.Oneof != nil { g.P("ov := &", field.GoIdent.GoName, "{}") + g.P("x.", field.Oneof.GoName, " = ov") messageOrOneofIdent = "ov" } + // If the field is nullable (it's a message, or bytes with custom type) + // and we read null, set the field to nil. + if nullable { + g.P("if s.ReadNil() {") + // If the field is a google.protobuf.Value, instead of nil, we write a google.protobuf.NullValue. + if field.Message != nil && field.Message.Desc.FullName() == "google.protobuf.Value" { + g.P( + messageOrOneofIdent, ".", fieldGoName, " = &", field.Message.GoIdent, "{", + "Kind: &", field.Message.GoIdent.GoImportPath.Ident("Value_NullValue"), "{},", + "}", + ) + } else { + g.P(messageOrOneofIdent, ".", fieldGoName, " = nil") + } + g.P("return") + g.P("}") + } + // If the field has a custom unmarshaler, call that if unmarshalerFunc != nil { g.P(messageOrOneofIdent, ".", fieldGoName, " = ", *unmarshalerFunc, `(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) } else if customtype != nil { if nullable { - g.P("if !s.ReadNil() {") // Set the field to a newly allocated custom type. g.P(messageOrOneofIdent, ".", fieldGoName, " = &", *customtype, "{}") // Call UnmarshalProtoJSON on the field. g.P(messageOrOneofIdent, ".", fieldGoName, `.UnmarshalProtoJSON(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) - g.P("}") } else { // Call UnmarshalProtoJSON on the field. g.P(messageOrOneofIdent, ".", fieldGoName, `.UnmarshalProtoJSON(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) @@ -356,23 +385,19 @@ nextField: case protoreflect.MessageKind: switch { case g.messageHasUnmarshaler(field.Message): - g.P("if !s.ReadNil() {") if nullable { // Set the field (or enum wrapper) to a newly allocated custom type. g.P(messageOrOneofIdent, ".", fieldGoName, " = &", field.Message.GoIdent, "{}") } // Call UnmarshalProtoJSON on the field. g.P(messageOrOneofIdent, ".", fieldGoName, `.UnmarshalProtoJSON(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) - g.P("}") // end if !s.ReadNil() { case messageIsWrapper(field.Message): - g.P("if !s.ReadNil() {") // Read the wrapped value, and if successful, set the wrapped value in the field. g.P("v := ", g.readWrapperValue(field.Message)) g.P("if s.Err() != nil {") g.P("return") g.P("}") g.P(messageOrOneofIdent, ".", fieldGoName, " = &", field.Message.GoIdent, "{Value: v}") - g.P("}") // end if !s.ReadNil() { case messageIsWKT(field.Message): // Read the WKT, and if successful, set it in the field. g.P("v := ", g.readWKTValue(field, field.Message)) @@ -391,8 +416,6 @@ nextField: } if field.Oneof != nil { - // Set the message field to the oneof wrapper. - g.P("x.", field.Oneof.GoName, " = ov") continue nextField } } diff --git a/test/gogo/enums_json.pb.go b/test/gogo/enums_json.pb.go index 793a1bd1..ac673652 100644 --- a/test/gogo/enums_json.pb.go +++ b/test/gogo/enums_json.pb.go @@ -173,6 +173,10 @@ func (x *MessageWithEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Regular = RegularEnum(s.ReadEnum(RegularEnum_value)) case "regulars": s.AddField("regulars") + if s.ReadNil() { + x.Regulars = nil + return + } s.ReadArray(func() { x.Regulars = append(x.Regulars, RegularEnum(s.ReadEnum(RegularEnum_value))) }) @@ -181,6 +185,10 @@ func (x *MessageWithEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Custom.UnmarshalProtoJSON(s) case "customs": s.AddField("customs") + if s.ReadNil() { + x.Customs = nil + return + } s.ReadArray(func() { var v CustomEnum v.UnmarshalProtoJSON(s) @@ -188,12 +196,18 @@ func (x *MessageWithEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "wrapped_custom", "wrappedCustom": s.AddField("wrapped_custom") - if !s.ReadNil() { - x.WrappedCustom = &CustomEnumValue{} - x.WrappedCustom.UnmarshalProtoJSON(s.WithField("wrapped_custom", false)) + if s.ReadNil() { + x.WrappedCustom = nil + return } + x.WrappedCustom = &CustomEnumValue{} + x.WrappedCustom.UnmarshalProtoJSON(s.WithField("wrapped_custom", false)) case "wrapped_customs", "wrappedCustoms": s.AddField("wrapped_customs") + if s.ReadNil() { + x.WrappedCustoms = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.WrappedCustoms = append(x.WrappedCustoms, nil) @@ -259,21 +273,23 @@ func (x *MessageWithOneofEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) case "regular": s.AddField("regular") ov := &MessageWithOneofEnums_Regular{} - ov.Regular = RegularEnum(s.ReadEnum(RegularEnum_value)) x.Value = ov + ov.Regular = RegularEnum(s.ReadEnum(RegularEnum_value)) case "custom": s.AddField("custom") ov := &MessageWithOneofEnums_Custom{} - ov.Custom.UnmarshalProtoJSON(s) x.Value = ov + ov.Custom.UnmarshalProtoJSON(s) case "wrapped_custom", "wrappedCustom": s.AddField("wrapped_custom") ov := &MessageWithOneofEnums_WrappedCustom{} - if !s.ReadNil() { - ov.WrappedCustom = &CustomEnumValue{} - ov.WrappedCustom.UnmarshalProtoJSON(s.WithField("wrapped_custom", false)) - } x.Value = ov + if s.ReadNil() { + ov.WrappedCustom = nil + return + } + ov.WrappedCustom = &CustomEnumValue{} + ov.WrappedCustom.UnmarshalProtoJSON(s.WithField("wrapped_custom", false)) } }) } diff --git a/test/gogo/gogo_json.pb.go b/test/gogo/gogo_json.pb.go index 8c09de6f..c5b033bb 100644 --- a/test/gogo/gogo_json.pb.go +++ b/test/gogo/gogo_json.pb.go @@ -96,15 +96,21 @@ func (x *MessageWithGoGoOptions) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState x.EUIWithCustomName = s.ReadBytes() case "eui_with_custom_name_and_type", "euiWithCustomNameAndType": s.AddField("eui_with_custom_name_and_type") - if !s.ReadNil() { - x.EUIWithCustomNameAndType = &types.EUI64{} - x.EUIWithCustomNameAndType.UnmarshalProtoJSON(s.WithField("eui_with_custom_name_and_type", false)) + if s.ReadNil() { + x.EUIWithCustomNameAndType = nil + return } + x.EUIWithCustomNameAndType = &types.EUI64{} + x.EUIWithCustomNameAndType.UnmarshalProtoJSON(s.WithField("eui_with_custom_name_and_type", false)) case "non_nullable_eui_with_custom_name_and_type", "nonNullableEuiWithCustomNameAndType": s.AddField("non_nullable_eui_with_custom_name_and_type") x.NonNullableEUIWithCustomNameAndType.UnmarshalProtoJSON(s.WithField("non_nullable_eui_with_custom_name_and_type", false)) case "euis_with_custom_name_and_type", "euisWithCustomNameAndType": s.AddField("euis_with_custom_name_and_type") + if s.ReadNil() { + x.EUIsWithCustomNameAndType = nil + return + } s.ReadArray(func() { var v types.EUI64 v.UnmarshalProtoJSON(s.WithField("euis_with_custom_name_and_type", false)) @@ -112,6 +118,10 @@ func (x *MessageWithGoGoOptions) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState }) case "duration": s.AddField("duration") + if s.ReadNil() { + x.Duration = nil + return + } v := s.ReadDuration() if s.Err() != nil { return @@ -126,6 +136,10 @@ func (x *MessageWithGoGoOptions) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState x.NonNullableDuration = *v case "timestamp": s.AddField("timestamp") + if s.ReadNil() { + x.Timestamp = nil + return + } v := s.ReadTime() if s.Err() != nil { return @@ -249,11 +263,13 @@ func (x *MessageWithNullable) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { default: s.ReadAny() // ignore unknown field case "sub": - if !s.ReadNil() { - x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) - } + x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) case "subs": s.AddField("subs") + if s.ReadNil() { + x.Subs = nil + return + } s.ReadArray(func() { v := SubMessage{} v.UnmarshalProtoJSON(s.WithField("subs", false)) @@ -270,6 +286,10 @@ func (x *MessageWithNullable) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.OtherSub = v case "other_subs", "otherSubs": s.AddField("other_subs") + if s.ReadNil() { + x.OtherSubs = nil + return + } s.ReadArray(func() { // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. var v SubMessageWithoutMarshalers @@ -322,12 +342,18 @@ func (x *MessageWithEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { default: s.ReadAny() // ignore unknown field case "sub": - if !s.ReadNil() { - x.SubMessage = &SubMessage{} - x.SubMessage.UnmarshalProtoJSON(s.WithField("sub", true)) + if s.ReadNil() { + x.SubMessage = nil + return } + x.SubMessage = &SubMessage{} + x.SubMessage.UnmarshalProtoJSON(s.WithField("sub", true)) case "other_sub", "otherSub": s.AddField("other_sub") + if s.ReadNil() { + x.SubMessageWithoutMarshalers = nil + return + } // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. var v SubMessageWithoutMarshalers gogo.UnmarshalMessage(s, &v) @@ -378,9 +404,7 @@ func (x *MessageWithNullableEmbedded) UnmarshalProtoJSON(s *jsonplugin.Unmarshal default: s.ReadAny() // ignore unknown field case "sub": - if !s.ReadNil() { - x.SubMessage.UnmarshalProtoJSON(s.WithField("sub", true)) - } + x.SubMessage.UnmarshalProtoJSON(s.WithField("sub", true)) case "other_sub", "otherSub": s.AddField("other_sub") // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. diff --git a/test/gogo/scalars_json.pb.go b/test/gogo/scalars_json.pb.go index 34118b77..deb8d8aa 100644 --- a/test/gogo/scalars_json.pb.go +++ b/test/gogo/scalars_json.pb.go @@ -201,96 +201,160 @@ func (x *MessageWithScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.DoubleValue = s.ReadFloat64() case "double_values", "doubleValues": s.AddField("double_values") + if s.ReadNil() { + x.DoubleValues = nil + return + } x.DoubleValues = s.ReadFloat64Array() case "float_value", "floatValue": s.AddField("float_value") x.FloatValue = s.ReadFloat32() case "float_values", "floatValues": s.AddField("float_values") + if s.ReadNil() { + x.FloatValues = nil + return + } x.FloatValues = s.ReadFloat32Array() case "int32_value", "int32Value": s.AddField("int32_value") x.Int32Value = s.ReadInt32() case "int32_values", "int32Values": s.AddField("int32_values") + if s.ReadNil() { + x.Int32Values = nil + return + } x.Int32Values = s.ReadInt32Array() case "int64_value", "int64Value": s.AddField("int64_value") x.Int64Value = s.ReadInt64() case "int64_values", "int64Values": s.AddField("int64_values") + if s.ReadNil() { + x.Int64Values = nil + return + } x.Int64Values = s.ReadInt64Array() case "uint32_value", "uint32Value": s.AddField("uint32_value") x.Uint32Value = s.ReadUint32() case "uint32_values", "uint32Values": s.AddField("uint32_values") + if s.ReadNil() { + x.Uint32Values = nil + return + } x.Uint32Values = s.ReadUint32Array() case "uint64_value", "uint64Value": s.AddField("uint64_value") x.Uint64Value = s.ReadUint64() case "uint64_values", "uint64Values": s.AddField("uint64_values") + if s.ReadNil() { + x.Uint64Values = nil + return + } x.Uint64Values = s.ReadUint64Array() case "sint32_value", "sint32Value": s.AddField("sint32_value") x.Sint32Value = s.ReadInt32() case "sint32_values", "sint32Values": s.AddField("sint32_values") + if s.ReadNil() { + x.Sint32Values = nil + return + } x.Sint32Values = s.ReadInt32Array() case "sint64_value", "sint64Value": s.AddField("sint64_value") x.Sint64Value = s.ReadInt64() case "sint64_values", "sint64Values": s.AddField("sint64_values") + if s.ReadNil() { + x.Sint64Values = nil + return + } x.Sint64Values = s.ReadInt64Array() case "fixed32_value", "fixed32Value": s.AddField("fixed32_value") x.Fixed32Value = s.ReadUint32() case "fixed32_values", "fixed32Values": s.AddField("fixed32_values") + if s.ReadNil() { + x.Fixed32Values = nil + return + } x.Fixed32Values = s.ReadUint32Array() case "fixed64_value", "fixed64Value": s.AddField("fixed64_value") x.Fixed64Value = s.ReadUint64() case "fixed64_values", "fixed64Values": s.AddField("fixed64_values") + if s.ReadNil() { + x.Fixed64Values = nil + return + } x.Fixed64Values = s.ReadUint64Array() case "sfixed32_value", "sfixed32Value": s.AddField("sfixed32_value") x.Sfixed32Value = s.ReadInt32() case "sfixed32_values", "sfixed32Values": s.AddField("sfixed32_values") + if s.ReadNil() { + x.Sfixed32Values = nil + return + } x.Sfixed32Values = s.ReadInt32Array() case "sfixed64_value", "sfixed64Value": s.AddField("sfixed64_value") x.Sfixed64Value = s.ReadInt64() case "sfixed64_values", "sfixed64Values": s.AddField("sfixed64_values") + if s.ReadNil() { + x.Sfixed64Values = nil + return + } x.Sfixed64Values = s.ReadInt64Array() case "bool_value", "boolValue": s.AddField("bool_value") x.BoolValue = s.ReadBool() case "bool_values", "boolValues": s.AddField("bool_values") + if s.ReadNil() { + x.BoolValues = nil + return + } x.BoolValues = s.ReadBoolArray() case "string_value", "stringValue": s.AddField("string_value") x.StringValue = s.ReadString() case "string_values", "stringValues": s.AddField("string_values") + if s.ReadNil() { + x.StringValues = nil + return + } x.StringValues = s.ReadStringArray() case "bytes_value", "bytesValue": s.AddField("bytes_value") x.BytesValue = s.ReadBytes() case "bytes_values", "bytesValues": s.AddField("bytes_values") + if s.ReadNil() { + x.BytesValues = nil + return + } x.BytesValues = s.ReadBytesArray() case "hex_bytes_value", "hexBytesValue": s.AddField("hex_bytes_value") x.HexBytesValue = types.UnmarshalHEX(s.WithField("hex_bytes_value", false)) case "hex_bytes_values", "hexBytesValues": s.AddField("hex_bytes_values") + if s.ReadNil() { + x.HexBytesValues = nil + return + } x.HexBytesValues = types.UnmarshalHEXArray(s.WithField("hex_bytes_values", false)) } }) @@ -397,83 +461,83 @@ func (x *MessageWithOneofScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalStat case "double_value", "doubleValue": s.AddField("double_value") ov := &MessageWithOneofScalars_DoubleValue{} - ov.DoubleValue = s.ReadFloat64() x.Value = ov + ov.DoubleValue = s.ReadFloat64() case "float_value", "floatValue": s.AddField("float_value") ov := &MessageWithOneofScalars_FloatValue{} - ov.FloatValue = s.ReadFloat32() x.Value = ov + ov.FloatValue = s.ReadFloat32() case "int32_value", "int32Value": s.AddField("int32_value") ov := &MessageWithOneofScalars_Int32Value{} - ov.Int32Value = s.ReadInt32() x.Value = ov + ov.Int32Value = s.ReadInt32() case "int64_value", "int64Value": s.AddField("int64_value") ov := &MessageWithOneofScalars_Int64Value{} - ov.Int64Value = s.ReadInt64() x.Value = ov + ov.Int64Value = s.ReadInt64() case "uint32_value", "uint32Value": s.AddField("uint32_value") ov := &MessageWithOneofScalars_Uint32Value{} - ov.Uint32Value = s.ReadUint32() x.Value = ov + ov.Uint32Value = s.ReadUint32() case "uint64_value", "uint64Value": s.AddField("uint64_value") ov := &MessageWithOneofScalars_Uint64Value{} - ov.Uint64Value = s.ReadUint64() x.Value = ov + ov.Uint64Value = s.ReadUint64() case "sint32_value", "sint32Value": s.AddField("sint32_value") ov := &MessageWithOneofScalars_Sint32Value{} - ov.Sint32Value = s.ReadInt32() x.Value = ov + ov.Sint32Value = s.ReadInt32() case "sint64_value", "sint64Value": s.AddField("sint64_value") ov := &MessageWithOneofScalars_Sint64Value{} - ov.Sint64Value = s.ReadInt64() x.Value = ov + ov.Sint64Value = s.ReadInt64() case "fixed32_value", "fixed32Value": s.AddField("fixed32_value") ov := &MessageWithOneofScalars_Fixed32Value{} - ov.Fixed32Value = s.ReadUint32() x.Value = ov + ov.Fixed32Value = s.ReadUint32() case "fixed64_value", "fixed64Value": s.AddField("fixed64_value") ov := &MessageWithOneofScalars_Fixed64Value{} - ov.Fixed64Value = s.ReadUint64() x.Value = ov + ov.Fixed64Value = s.ReadUint64() case "sfixed32_value", "sfixed32Value": s.AddField("sfixed32_value") ov := &MessageWithOneofScalars_Sfixed32Value{} - ov.Sfixed32Value = s.ReadInt32() x.Value = ov + ov.Sfixed32Value = s.ReadInt32() case "sfixed64_value", "sfixed64Value": s.AddField("sfixed64_value") ov := &MessageWithOneofScalars_Sfixed64Value{} - ov.Sfixed64Value = s.ReadInt64() x.Value = ov + ov.Sfixed64Value = s.ReadInt64() case "bool_value", "boolValue": s.AddField("bool_value") ov := &MessageWithOneofScalars_BoolValue{} - ov.BoolValue = s.ReadBool() x.Value = ov + ov.BoolValue = s.ReadBool() case "string_value", "stringValue": s.AddField("string_value") ov := &MessageWithOneofScalars_StringValue{} - ov.StringValue = s.ReadString() x.Value = ov + ov.StringValue = s.ReadString() case "bytes_value", "bytesValue": s.AddField("bytes_value") ov := &MessageWithOneofScalars_BytesValue{} - ov.BytesValue = s.ReadBytes() x.Value = ov + ov.BytesValue = s.ReadBytes() case "hex_bytes_value", "hexBytesValue": s.AddField("hex_bytes_value") ov := &MessageWithOneofScalars_HexBytesValue{} - ov.HexBytesValue = types.UnmarshalHEX(s.WithField("hex_bytes_value", false)) x.Value = ov + ov.HexBytesValue = types.UnmarshalHEX(s.WithField("hex_bytes_value", false)) } }) } @@ -827,162 +891,270 @@ func (x *MessageWithScalarMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) s.ReadAny() // ignore unknown field case "string_double_map", "stringDoubleMap": s.AddField("string_double_map") + if s.ReadNil() { + x.StringDoubleMap = nil + return + } x.StringDoubleMap = make(map[string]float64) s.ReadStringMap(func(key string) { x.StringDoubleMap[key] = s.ReadFloat64() }) case "string_float_map", "stringFloatMap": s.AddField("string_float_map") + if s.ReadNil() { + x.StringFloatMap = nil + return + } x.StringFloatMap = make(map[string]float32) s.ReadStringMap(func(key string) { x.StringFloatMap[key] = s.ReadFloat32() }) case "string_int32_map", "stringInt32Map": s.AddField("string_int32_map") + if s.ReadNil() { + x.StringInt32Map = nil + return + } x.StringInt32Map = make(map[string]int32) s.ReadStringMap(func(key string) { x.StringInt32Map[key] = s.ReadInt32() }) case "int32_string_map", "int32StringMap": s.AddField("int32_string_map") + if s.ReadNil() { + x.Int32StringMap = nil + return + } x.Int32StringMap = make(map[int32]string) s.ReadInt32Map(func(key int32) { x.Int32StringMap[key] = s.ReadString() }) case "string_int64_map", "stringInt64Map": s.AddField("string_int64_map") + if s.ReadNil() { + x.StringInt64Map = nil + return + } x.StringInt64Map = make(map[string]int64) s.ReadStringMap(func(key string) { x.StringInt64Map[key] = s.ReadInt64() }) case "int64_string_map", "int64StringMap": s.AddField("int64_string_map") + if s.ReadNil() { + x.Int64StringMap = nil + return + } x.Int64StringMap = make(map[int64]string) s.ReadInt64Map(func(key int64) { x.Int64StringMap[key] = s.ReadString() }) case "string_uint32_map", "stringUint32Map": s.AddField("string_uint32_map") + if s.ReadNil() { + x.StringUint32Map = nil + return + } x.StringUint32Map = make(map[string]uint32) s.ReadStringMap(func(key string) { x.StringUint32Map[key] = s.ReadUint32() }) case "uint32_string_map", "uint32StringMap": s.AddField("uint32_string_map") + if s.ReadNil() { + x.Uint32StringMap = nil + return + } x.Uint32StringMap = make(map[uint32]string) s.ReadUint32Map(func(key uint32) { x.Uint32StringMap[key] = s.ReadString() }) case "string_uint64_map", "stringUint64Map": s.AddField("string_uint64_map") + if s.ReadNil() { + x.StringUint64Map = nil + return + } x.StringUint64Map = make(map[string]uint64) s.ReadStringMap(func(key string) { x.StringUint64Map[key] = s.ReadUint64() }) case "uint64_string_map", "uint64StringMap": s.AddField("uint64_string_map") + if s.ReadNil() { + x.Uint64StringMap = nil + return + } x.Uint64StringMap = make(map[uint64]string) s.ReadUint64Map(func(key uint64) { x.Uint64StringMap[key] = s.ReadString() }) case "string_sint32_map", "stringSint32Map": s.AddField("string_sint32_map") + if s.ReadNil() { + x.StringSint32Map = nil + return + } x.StringSint32Map = make(map[string]int32) s.ReadStringMap(func(key string) { x.StringSint32Map[key] = s.ReadInt32() }) case "sint32_string_map", "sint32StringMap": s.AddField("sint32_string_map") + if s.ReadNil() { + x.Sint32StringMap = nil + return + } x.Sint32StringMap = make(map[int32]string) s.ReadInt32Map(func(key int32) { x.Sint32StringMap[key] = s.ReadString() }) case "string_sint64_map", "stringSint64Map": s.AddField("string_sint64_map") + if s.ReadNil() { + x.StringSint64Map = nil + return + } x.StringSint64Map = make(map[string]int64) s.ReadStringMap(func(key string) { x.StringSint64Map[key] = s.ReadInt64() }) case "sint64_string_map", "sint64StringMap": s.AddField("sint64_string_map") + if s.ReadNil() { + x.Sint64StringMap = nil + return + } x.Sint64StringMap = make(map[int64]string) s.ReadInt64Map(func(key int64) { x.Sint64StringMap[key] = s.ReadString() }) case "string_fixed32_map", "stringFixed32Map": s.AddField("string_fixed32_map") + if s.ReadNil() { + x.StringFixed32Map = nil + return + } x.StringFixed32Map = make(map[string]uint32) s.ReadStringMap(func(key string) { x.StringFixed32Map[key] = s.ReadUint32() }) case "fixed32_string_map", "fixed32StringMap": s.AddField("fixed32_string_map") + if s.ReadNil() { + x.Fixed32StringMap = nil + return + } x.Fixed32StringMap = make(map[uint32]string) s.ReadUint32Map(func(key uint32) { x.Fixed32StringMap[key] = s.ReadString() }) case "string_fixed64_map", "stringFixed64Map": s.AddField("string_fixed64_map") + if s.ReadNil() { + x.StringFixed64Map = nil + return + } x.StringFixed64Map = make(map[string]uint64) s.ReadStringMap(func(key string) { x.StringFixed64Map[key] = s.ReadUint64() }) case "fixed64_string_map", "fixed64StringMap": s.AddField("fixed64_string_map") + if s.ReadNil() { + x.Fixed64StringMap = nil + return + } x.Fixed64StringMap = make(map[uint64]string) s.ReadUint64Map(func(key uint64) { x.Fixed64StringMap[key] = s.ReadString() }) case "string_sfixed32_map", "stringSfixed32Map": s.AddField("string_sfixed32_map") + if s.ReadNil() { + x.StringSfixed32Map = nil + return + } x.StringSfixed32Map = make(map[string]int32) s.ReadStringMap(func(key string) { x.StringSfixed32Map[key] = s.ReadInt32() }) case "sfixed32_string_map", "sfixed32StringMap": s.AddField("sfixed32_string_map") + if s.ReadNil() { + x.Sfixed32StringMap = nil + return + } x.Sfixed32StringMap = make(map[int32]string) s.ReadInt32Map(func(key int32) { x.Sfixed32StringMap[key] = s.ReadString() }) case "string_sfixed64_map", "stringSfixed64Map": s.AddField("string_sfixed64_map") + if s.ReadNil() { + x.StringSfixed64Map = nil + return + } x.StringSfixed64Map = make(map[string]int64) s.ReadStringMap(func(key string) { x.StringSfixed64Map[key] = s.ReadInt64() }) case "sfixed64_string_map", "sfixed64StringMap": s.AddField("sfixed64_string_map") + if s.ReadNil() { + x.Sfixed64StringMap = nil + return + } x.Sfixed64StringMap = make(map[int64]string) s.ReadInt64Map(func(key int64) { x.Sfixed64StringMap[key] = s.ReadString() }) case "string_bool_map", "stringBoolMap": s.AddField("string_bool_map") + if s.ReadNil() { + x.StringBoolMap = nil + return + } x.StringBoolMap = make(map[string]bool) s.ReadStringMap(func(key string) { x.StringBoolMap[key] = s.ReadBool() }) case "bool_string_map", "boolStringMap": s.AddField("bool_string_map") + if s.ReadNil() { + x.BoolStringMap = nil + return + } x.BoolStringMap = make(map[bool]string) s.ReadBoolMap(func(key bool) { x.BoolStringMap[key] = s.ReadString() }) case "string_string_map", "stringStringMap": s.AddField("string_string_map") + if s.ReadNil() { + x.StringStringMap = nil + return + } x.StringStringMap = make(map[string]string) s.ReadStringMap(func(key string) { x.StringStringMap[key] = s.ReadString() }) case "string_bytes_map", "stringBytesMap": s.AddField("string_bytes_map") + if s.ReadNil() { + x.StringBytesMap = nil + return + } x.StringBytesMap = make(map[string][]byte) s.ReadStringMap(func(key string) { x.StringBytesMap[key] = s.ReadBytes() }) case "string_hex_bytes_map", "stringHexBytesMap": s.AddField("string_hex_bytes_map") + if s.ReadNil() { + x.StringHexBytesMap = nil + return + } x.StringHexBytesMap = types.UnmarshalStringHEXMap(s.WithField("string_hex_bytes_map", false)) } }) diff --git a/test/gogo/wkts_json.pb.go b/test/gogo/wkts_json.pb.go index 77362b03..55ab4d4b 100644 --- a/test/gogo/wkts_json.pb.go +++ b/test/gogo/wkts_json.pb.go @@ -489,15 +489,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { s.ReadAny() // ignore unknown field case "double_value", "doubleValue": s.AddField("double_value") - if !s.ReadNil() { - v := s.ReadFloat64() - if s.Err() != nil { - return - } - x.DoubleValue = &types.DoubleValue{Value: v} + if s.ReadNil() { + x.DoubleValue = nil + return } + v := s.ReadFloat64() + if s.Err() != nil { + return + } + x.DoubleValue = &types.DoubleValue{Value: v} case "double_values", "doubleValues": s.AddField("double_values") + if s.ReadNil() { + x.DoubleValues = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.DoubleValues = append(x.DoubleValues, nil) @@ -511,15 +517,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "float_value", "floatValue": s.AddField("float_value") - if !s.ReadNil() { - v := s.ReadFloat32() - if s.Err() != nil { - return - } - x.FloatValue = &types.FloatValue{Value: v} + if s.ReadNil() { + x.FloatValue = nil + return + } + v := s.ReadFloat32() + if s.Err() != nil { + return } + x.FloatValue = &types.FloatValue{Value: v} case "float_values", "floatValues": s.AddField("float_values") + if s.ReadNil() { + x.FloatValues = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.FloatValues = append(x.FloatValues, nil) @@ -533,15 +545,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "int32_value", "int32Value": s.AddField("int32_value") - if !s.ReadNil() { - v := s.ReadInt32() - if s.Err() != nil { - return - } - x.Int32Value = &types.Int32Value{Value: v} + if s.ReadNil() { + x.Int32Value = nil + return } + v := s.ReadInt32() + if s.Err() != nil { + return + } + x.Int32Value = &types.Int32Value{Value: v} case "int32_values", "int32Values": s.AddField("int32_values") + if s.ReadNil() { + x.Int32Values = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.Int32Values = append(x.Int32Values, nil) @@ -555,15 +573,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "int64_value", "int64Value": s.AddField("int64_value") - if !s.ReadNil() { - v := s.ReadInt64() - if s.Err() != nil { - return - } - x.Int64Value = &types.Int64Value{Value: v} + if s.ReadNil() { + x.Int64Value = nil + return } + v := s.ReadInt64() + if s.Err() != nil { + return + } + x.Int64Value = &types.Int64Value{Value: v} case "int64_values", "int64Values": s.AddField("int64_values") + if s.ReadNil() { + x.Int64Values = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.Int64Values = append(x.Int64Values, nil) @@ -577,15 +601,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "uint32_value", "uint32Value": s.AddField("uint32_value") - if !s.ReadNil() { - v := s.ReadUint32() - if s.Err() != nil { - return - } - x.Uint32Value = &types.UInt32Value{Value: v} + if s.ReadNil() { + x.Uint32Value = nil + return } + v := s.ReadUint32() + if s.Err() != nil { + return + } + x.Uint32Value = &types.UInt32Value{Value: v} case "uint32_values", "uint32Values": s.AddField("uint32_values") + if s.ReadNil() { + x.Uint32Values = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.Uint32Values = append(x.Uint32Values, nil) @@ -599,15 +629,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "uint64_value", "uint64Value": s.AddField("uint64_value") - if !s.ReadNil() { - v := s.ReadUint64() - if s.Err() != nil { - return - } - x.Uint64Value = &types.UInt64Value{Value: v} + if s.ReadNil() { + x.Uint64Value = nil + return + } + v := s.ReadUint64() + if s.Err() != nil { + return } + x.Uint64Value = &types.UInt64Value{Value: v} case "uint64_values", "uint64Values": s.AddField("uint64_values") + if s.ReadNil() { + x.Uint64Values = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.Uint64Values = append(x.Uint64Values, nil) @@ -621,15 +657,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "bool_value", "boolValue": s.AddField("bool_value") - if !s.ReadNil() { - v := s.ReadBool() - if s.Err() != nil { - return - } - x.BoolValue = &types.BoolValue{Value: v} + if s.ReadNil() { + x.BoolValue = nil + return + } + v := s.ReadBool() + if s.Err() != nil { + return } + x.BoolValue = &types.BoolValue{Value: v} case "bool_values", "boolValues": s.AddField("bool_values") + if s.ReadNil() { + x.BoolValues = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.BoolValues = append(x.BoolValues, nil) @@ -643,15 +685,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_value", "stringValue": s.AddField("string_value") - if !s.ReadNil() { - v := s.ReadString() - if s.Err() != nil { - return - } - x.StringValue = &types.StringValue{Value: v} + if s.ReadNil() { + x.StringValue = nil + return } + v := s.ReadString() + if s.Err() != nil { + return + } + x.StringValue = &types.StringValue{Value: v} case "string_values", "stringValues": s.AddField("string_values") + if s.ReadNil() { + x.StringValues = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.StringValues = append(x.StringValues, nil) @@ -665,15 +713,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "bytes_value", "bytesValue": s.AddField("bytes_value") - if !s.ReadNil() { - v := s.ReadBytes() - if s.Err() != nil { - return - } - x.BytesValue = &types.BytesValue{Value: v} + if s.ReadNil() { + x.BytesValue = nil + return + } + v := s.ReadBytes() + if s.Err() != nil { + return } + x.BytesValue = &types.BytesValue{Value: v} case "bytes_values", "bytesValues": s.AddField("bytes_values") + if s.ReadNil() { + x.BytesValues = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.BytesValues = append(x.BytesValues, nil) @@ -687,6 +741,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "empty_value", "emptyValue": s.AddField("empty_value") + if s.ReadNil() { + x.EmptyValue = nil + return + } v := gogo.UnmarshalEmpty(s) if s.Err() != nil { return @@ -694,6 +752,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.EmptyValue = v case "empty_values", "emptyValues": s.AddField("empty_values") + if s.ReadNil() { + x.EmptyValues = nil + return + } s.ReadArray(func() { v := gogo.UnmarshalEmpty(s) if s.Err() != nil { @@ -703,6 +765,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "timestamp_value", "timestampValue": s.AddField("timestamp_value") + if s.ReadNil() { + x.TimestampValue = nil + return + } v := gogo.UnmarshalTimestamp(s) if s.Err() != nil { return @@ -710,6 +776,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.TimestampValue = v case "timestamp_values", "timestampValues": s.AddField("timestamp_values") + if s.ReadNil() { + x.TimestampValues = nil + return + } s.ReadArray(func() { v := gogo.UnmarshalTimestamp(s) if s.Err() != nil { @@ -719,6 +789,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "duration_value", "durationValue": s.AddField("duration_value") + if s.ReadNil() { + x.DurationValue = nil + return + } v := gogo.UnmarshalDuration(s) if s.Err() != nil { return @@ -726,6 +800,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.DurationValue = v case "duration_values", "durationValues": s.AddField("duration_values") + if s.ReadNil() { + x.DurationValues = nil + return + } s.ReadArray(func() { v := gogo.UnmarshalDuration(s) if s.Err() != nil { @@ -735,6 +813,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "field_mask_value", "fieldMaskValue": s.AddField("field_mask_value") + if s.ReadNil() { + x.FieldMaskValue = nil + return + } v := gogo.UnmarshalFieldMask(s) if s.Err() != nil { return @@ -742,6 +824,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.FieldMaskValue = v case "field_mask_values", "fieldMaskValues": s.AddField("field_mask_values") + if s.ReadNil() { + x.FieldMaskValues = nil + return + } s.ReadArray(func() { v := gogo.UnmarshalFieldMask(s) if s.Err() != nil { @@ -751,6 +837,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "value_value", "valueValue": s.AddField("value_value") + if s.ReadNil() { + x.ValueValue = &types.Value{Kind: &types.Value_NullValue{}} + return + } v := gogo.UnmarshalValue(s) if s.Err() != nil { return @@ -758,6 +848,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.ValueValue = v case "value_values", "valueValues": s.AddField("value_values") + if s.ReadNil() { + x.ValueValues = nil + return + } s.ReadArray(func() { v := gogo.UnmarshalValue(s) if s.Err() != nil { @@ -767,6 +861,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "list_value_value", "listValueValue": s.AddField("list_value_value") + if s.ReadNil() { + x.ListValueValue = nil + return + } v := gogo.UnmarshalListValue(s) if s.Err() != nil { return @@ -774,6 +872,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.ListValueValue = v case "list_value_values", "listValueValues": s.AddField("list_value_values") + if s.ReadNil() { + x.ListValueValues = nil + return + } s.ReadArray(func() { v := gogo.UnmarshalListValue(s) if s.Err() != nil { @@ -783,6 +885,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "struct_value", "structValue": s.AddField("struct_value") + if s.ReadNil() { + x.StructValue = nil + return + } v := gogo.UnmarshalStruct(s) if s.Err() != nil { return @@ -790,6 +896,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.StructValue = v case "struct_values", "structValues": s.AddField("struct_values") + if s.ReadNil() { + x.StructValues = nil + return + } s.ReadArray(func() { v := gogo.UnmarshalStruct(s) if s.Err() != nil { @@ -799,6 +909,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "any_value", "anyValue": s.AddField("any_value") + if s.ReadNil() { + x.AnyValue = nil + return + } v := gogo.UnmarshalAny(s) if s.Err() != nil { return @@ -806,6 +920,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.AnyValue = v case "any_values", "anyValues": s.AddField("any_values") + if s.ReadNil() { + x.AnyValues = nil + return + } s.ReadArray(func() { v := gogo.UnmarshalAny(s) if s.Err() != nil { @@ -990,174 +1108,224 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) case "double_value", "doubleValue": s.AddField("double_value") ov := &MessageWithOneofWKTs_DoubleValue{} - if !s.ReadNil() { - v := s.ReadFloat64() - if s.Err() != nil { - return - } - ov.DoubleValue = &types.DoubleValue{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.DoubleValue = nil + return + } + v := s.ReadFloat64() + if s.Err() != nil { + return + } + ov.DoubleValue = &types.DoubleValue{Value: v} case "float_value", "floatValue": s.AddField("float_value") ov := &MessageWithOneofWKTs_FloatValue{} - if !s.ReadNil() { - v := s.ReadFloat32() - if s.Err() != nil { - return - } - ov.FloatValue = &types.FloatValue{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.FloatValue = nil + return + } + v := s.ReadFloat32() + if s.Err() != nil { + return + } + ov.FloatValue = &types.FloatValue{Value: v} case "int32_value", "int32Value": s.AddField("int32_value") ov := &MessageWithOneofWKTs_Int32Value{} - if !s.ReadNil() { - v := s.ReadInt32() - if s.Err() != nil { - return - } - ov.Int32Value = &types.Int32Value{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.Int32Value = nil + return + } + v := s.ReadInt32() + if s.Err() != nil { + return + } + ov.Int32Value = &types.Int32Value{Value: v} case "int64_value", "int64Value": s.AddField("int64_value") ov := &MessageWithOneofWKTs_Int64Value{} - if !s.ReadNil() { - v := s.ReadInt64() - if s.Err() != nil { - return - } - ov.Int64Value = &types.Int64Value{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.Int64Value = nil + return + } + v := s.ReadInt64() + if s.Err() != nil { + return + } + ov.Int64Value = &types.Int64Value{Value: v} case "uint32_value", "uint32Value": s.AddField("uint32_value") ov := &MessageWithOneofWKTs_Uint32Value{} - if !s.ReadNil() { - v := s.ReadUint32() - if s.Err() != nil { - return - } - ov.Uint32Value = &types.UInt32Value{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.Uint32Value = nil + return + } + v := s.ReadUint32() + if s.Err() != nil { + return + } + ov.Uint32Value = &types.UInt32Value{Value: v} case "uint64_value", "uint64Value": s.AddField("uint64_value") ov := &MessageWithOneofWKTs_Uint64Value{} - if !s.ReadNil() { - v := s.ReadUint64() - if s.Err() != nil { - return - } - ov.Uint64Value = &types.UInt64Value{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.Uint64Value = nil + return + } + v := s.ReadUint64() + if s.Err() != nil { + return + } + ov.Uint64Value = &types.UInt64Value{Value: v} case "bool_value", "boolValue": s.AddField("bool_value") ov := &MessageWithOneofWKTs_BoolValue{} - if !s.ReadNil() { - v := s.ReadBool() - if s.Err() != nil { - return - } - ov.BoolValue = &types.BoolValue{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.BoolValue = nil + return + } + v := s.ReadBool() + if s.Err() != nil { + return + } + ov.BoolValue = &types.BoolValue{Value: v} case "string_value", "stringValue": s.AddField("string_value") ov := &MessageWithOneofWKTs_StringValue{} - if !s.ReadNil() { - v := s.ReadString() - if s.Err() != nil { - return - } - ov.StringValue = &types.StringValue{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.StringValue = nil + return + } + v := s.ReadString() + if s.Err() != nil { + return + } + ov.StringValue = &types.StringValue{Value: v} case "bytes_value", "bytesValue": s.AddField("bytes_value") ov := &MessageWithOneofWKTs_BytesValue{} - if !s.ReadNil() { - v := s.ReadBytes() - if s.Err() != nil { - return - } - ov.BytesValue = &types.BytesValue{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.BytesValue = nil + return + } + v := s.ReadBytes() + if s.Err() != nil { + return + } + ov.BytesValue = &types.BytesValue{Value: v} case "empty_value", "emptyValue": s.AddField("empty_value") ov := &MessageWithOneofWKTs_EmptyValue{} + x.Value = ov + if s.ReadNil() { + ov.EmptyValue = nil + return + } v := gogo.UnmarshalEmpty(s) if s.Err() != nil { return } ov.EmptyValue = v - x.Value = ov case "timestamp_value", "timestampValue": s.AddField("timestamp_value") ov := &MessageWithOneofWKTs_TimestampValue{} + x.Value = ov + if s.ReadNil() { + ov.TimestampValue = nil + return + } v := gogo.UnmarshalTimestamp(s) if s.Err() != nil { return } ov.TimestampValue = v - x.Value = ov case "duration_value", "durationValue": s.AddField("duration_value") ov := &MessageWithOneofWKTs_DurationValue{} + x.Value = ov + if s.ReadNil() { + ov.DurationValue = nil + return + } v := gogo.UnmarshalDuration(s) if s.Err() != nil { return } ov.DurationValue = v - x.Value = ov case "field_mask_value", "fieldMaskValue": s.AddField("field_mask_value") ov := &MessageWithOneofWKTs_FieldMaskValue{} + x.Value = ov + if s.ReadNil() { + ov.FieldMaskValue = nil + return + } v := gogo.UnmarshalFieldMask(s) if s.Err() != nil { return } ov.FieldMaskValue = v - x.Value = ov case "value_value", "valueValue": s.AddField("value_value") ov := &MessageWithOneofWKTs_ValueValue{} + x.Value = ov + if s.ReadNil() { + ov.ValueValue = &types.Value{Kind: &types.Value_NullValue{}} + return + } v := gogo.UnmarshalValue(s) if s.Err() != nil { return } ov.ValueValue = v - x.Value = ov case "list_value_value", "listValueValue": s.AddField("list_value_value") ov := &MessageWithOneofWKTs_ListValueValue{} + x.Value = ov + if s.ReadNil() { + ov.ListValueValue = nil + return + } v := gogo.UnmarshalListValue(s) if s.Err() != nil { return } ov.ListValueValue = v - x.Value = ov case "struct_value", "structValue": s.AddField("struct_value") ov := &MessageWithOneofWKTs_StructValue{} + x.Value = ov + if s.ReadNil() { + ov.StructValue = nil + return + } v := gogo.UnmarshalStruct(s) if s.Err() != nil { return } ov.StructValue = v - x.Value = ov case "any_value", "anyValue": s.AddField("any_value") ov := &MessageWithOneofWKTs_AnyValue{} + x.Value = ov + if s.ReadNil() { + ov.AnyValue = nil + return + } v := gogo.UnmarshalAny(s) if s.Err() != nil { return } ov.AnyValue = v - x.Value = ov } }) } @@ -1466,6 +1634,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { s.ReadAny() // ignore unknown field case "string_double_map", "stringDoubleMap": s.AddField("string_double_map") + if s.ReadNil() { + x.StringDoubleMap = nil + return + } x.StringDoubleMap = make(map[string]*types.DoubleValue) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1480,6 +1652,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_float_map", "stringFloatMap": s.AddField("string_float_map") + if s.ReadNil() { + x.StringFloatMap = nil + return + } x.StringFloatMap = make(map[string]*types.FloatValue) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1494,6 +1670,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_int32_map", "stringInt32Map": s.AddField("string_int32_map") + if s.ReadNil() { + x.StringInt32Map = nil + return + } x.StringInt32Map = make(map[string]*types.Int32Value) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1508,6 +1688,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_int64_map", "stringInt64Map": s.AddField("string_int64_map") + if s.ReadNil() { + x.StringInt64Map = nil + return + } x.StringInt64Map = make(map[string]*types.Int64Value) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1522,6 +1706,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_uint32_map", "stringUint32Map": s.AddField("string_uint32_map") + if s.ReadNil() { + x.StringUint32Map = nil + return + } x.StringUint32Map = make(map[string]*types.UInt32Value) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1536,6 +1724,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_uint64_map", "stringUint64Map": s.AddField("string_uint64_map") + if s.ReadNil() { + x.StringUint64Map = nil + return + } x.StringUint64Map = make(map[string]*types.UInt64Value) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1550,6 +1742,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_bool_map", "stringBoolMap": s.AddField("string_bool_map") + if s.ReadNil() { + x.StringBoolMap = nil + return + } x.StringBoolMap = make(map[string]*types.BoolValue) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1564,6 +1760,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_string_map", "stringStringMap": s.AddField("string_string_map") + if s.ReadNil() { + x.StringStringMap = nil + return + } x.StringStringMap = make(map[string]*types.StringValue) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1578,6 +1778,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_bytes_map", "stringBytesMap": s.AddField("string_bytes_map") + if s.ReadNil() { + x.StringBytesMap = nil + return + } x.StringBytesMap = make(map[string]*types.BytesValue) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1592,6 +1796,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_empty_map", "stringEmptyMap": s.AddField("string_empty_map") + if s.ReadNil() { + x.StringEmptyMap = nil + return + } x.StringEmptyMap = make(map[string]*types.Empty) s.ReadStringMap(func(key string) { v := gogo.UnmarshalEmpty(s) @@ -1602,6 +1810,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_timestamp_map", "stringTimestampMap": s.AddField("string_timestamp_map") + if s.ReadNil() { + x.StringTimestampMap = nil + return + } x.StringTimestampMap = make(map[string]*types.Timestamp) s.ReadStringMap(func(key string) { v := gogo.UnmarshalTimestamp(s) @@ -1612,6 +1824,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_duration_map", "stringDurationMap": s.AddField("string_duration_map") + if s.ReadNil() { + x.StringDurationMap = nil + return + } x.StringDurationMap = make(map[string]*types.Duration) s.ReadStringMap(func(key string) { v := gogo.UnmarshalDuration(s) @@ -1622,6 +1838,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_field_mask_map", "stringFieldMaskMap": s.AddField("string_field_mask_map") + if s.ReadNil() { + x.StringFieldMaskMap = nil + return + } x.StringFieldMaskMap = make(map[string]*types.FieldMask) s.ReadStringMap(func(key string) { v := gogo.UnmarshalFieldMask(s) @@ -1632,6 +1852,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_value_map", "stringValueMap": s.AddField("string_value_map") + if s.ReadNil() { + x.StringValueMap = nil + return + } x.StringValueMap = make(map[string]*types.Value) s.ReadStringMap(func(key string) { v := gogo.UnmarshalValue(s) @@ -1642,6 +1866,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_list_value_map", "stringListValueMap": s.AddField("string_list_value_map") + if s.ReadNil() { + x.StringListValueMap = nil + return + } x.StringListValueMap = make(map[string]*types.ListValue) s.ReadStringMap(func(key string) { v := gogo.UnmarshalListValue(s) @@ -1652,6 +1880,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_struct_map", "stringStructMap": s.AddField("string_struct_map") + if s.ReadNil() { + x.StringStructMap = nil + return + } x.StringStructMap = make(map[string]*types.Struct) s.ReadStringMap(func(key string) { v := gogo.UnmarshalStruct(s) @@ -1662,6 +1894,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_any_map", "stringAnyMap": s.AddField("string_any_map") + if s.ReadNil() { + x.StringAnyMap = nil + return + } x.StringAnyMap = make(map[string]*types.Any) s.ReadStringMap(func(key string) { v := gogo.UnmarshalAny(s) diff --git a/test/golang/enums_json.pb.go b/test/golang/enums_json.pb.go index e85dc97f..3a33f595 100644 --- a/test/golang/enums_json.pb.go +++ b/test/golang/enums_json.pb.go @@ -173,6 +173,10 @@ func (x *MessageWithEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Regular = RegularEnum(s.ReadEnum(RegularEnum_value)) case "regulars": s.AddField("regulars") + if s.ReadNil() { + x.Regulars = nil + return + } s.ReadArray(func() { x.Regulars = append(x.Regulars, RegularEnum(s.ReadEnum(RegularEnum_value))) }) @@ -181,6 +185,10 @@ func (x *MessageWithEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Custom.UnmarshalProtoJSON(s) case "customs": s.AddField("customs") + if s.ReadNil() { + x.Customs = nil + return + } s.ReadArray(func() { var v CustomEnum v.UnmarshalProtoJSON(s) @@ -188,12 +196,18 @@ func (x *MessageWithEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "wrapped_custom", "wrappedCustom": s.AddField("wrapped_custom") - if !s.ReadNil() { - x.WrappedCustom = &CustomEnumValue{} - x.WrappedCustom.UnmarshalProtoJSON(s.WithField("wrapped_custom", false)) + if s.ReadNil() { + x.WrappedCustom = nil + return } + x.WrappedCustom = &CustomEnumValue{} + x.WrappedCustom.UnmarshalProtoJSON(s.WithField("wrapped_custom", false)) case "wrapped_customs", "wrappedCustoms": s.AddField("wrapped_customs") + if s.ReadNil() { + x.WrappedCustoms = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.WrappedCustoms = append(x.WrappedCustoms, nil) @@ -259,21 +273,23 @@ func (x *MessageWithOneofEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) case "regular": s.AddField("regular") ov := &MessageWithOneofEnums_Regular{} - ov.Regular = RegularEnum(s.ReadEnum(RegularEnum_value)) x.Value = ov + ov.Regular = RegularEnum(s.ReadEnum(RegularEnum_value)) case "custom": s.AddField("custom") ov := &MessageWithOneofEnums_Custom{} - ov.Custom.UnmarshalProtoJSON(s) x.Value = ov + ov.Custom.UnmarshalProtoJSON(s) case "wrapped_custom", "wrappedCustom": s.AddField("wrapped_custom") ov := &MessageWithOneofEnums_WrappedCustom{} - if !s.ReadNil() { - ov.WrappedCustom = &CustomEnumValue{} - ov.WrappedCustom.UnmarshalProtoJSON(s.WithField("wrapped_custom", false)) - } x.Value = ov + if s.ReadNil() { + ov.WrappedCustom = nil + return + } + ov.WrappedCustom = &CustomEnumValue{} + ov.WrappedCustom.UnmarshalProtoJSON(s.WithField("wrapped_custom", false)) } }) } diff --git a/test/golang/gogo_json.pb.go b/test/golang/gogo_json.pb.go index 9f0b3771..7419e3c6 100644 --- a/test/golang/gogo_json.pb.go +++ b/test/golang/gogo_json.pb.go @@ -104,9 +104,17 @@ func (x *MessageWithGoGoOptions) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState x.NonNullableEuiWithCustomNameAndType = types.UnmarshalHEX(s.WithField("non_nullable_eui_with_custom_name_and_type", false)) case "euis_with_custom_name_and_type", "euisWithCustomNameAndType": s.AddField("euis_with_custom_name_and_type") + if s.ReadNil() { + x.EuisWithCustomNameAndType = nil + return + } x.EuisWithCustomNameAndType = types.UnmarshalHEXArray(s.WithField("euis_with_custom_name_and_type", false)) case "duration": s.AddField("duration") + if s.ReadNil() { + x.Duration = nil + return + } v := golang.UnmarshalDuration(s) if s.Err() != nil { return @@ -114,6 +122,10 @@ func (x *MessageWithGoGoOptions) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState x.Duration = v case "non_nullable_duration", "nonNullableDuration": s.AddField("non_nullable_duration") + if s.ReadNil() { + x.NonNullableDuration = nil + return + } v := golang.UnmarshalDuration(s) if s.Err() != nil { return @@ -121,6 +133,10 @@ func (x *MessageWithGoGoOptions) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState x.NonNullableDuration = v case "timestamp": s.AddField("timestamp") + if s.ReadNil() { + x.Timestamp = nil + return + } v := golang.UnmarshalTimestamp(s) if s.Err() != nil { return @@ -128,6 +144,10 @@ func (x *MessageWithGoGoOptions) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState x.Timestamp = v case "non_nullable_timestamp", "nonNullableTimestamp": s.AddField("non_nullable_timestamp") + if s.ReadNil() { + x.NonNullableTimestamp = nil + return + } v := golang.UnmarshalTimestamp(s) if s.Err() != nil { return @@ -244,12 +264,18 @@ func (x *MessageWithNullable) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { default: s.ReadAny() // ignore unknown field case "sub": - if !s.ReadNil() { - x.Sub = &SubMessage{} - x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) + if s.ReadNil() { + x.Sub = nil + return } + x.Sub = &SubMessage{} + x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) case "subs": s.AddField("subs") + if s.ReadNil() { + x.Subs = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.Subs = append(x.Subs, nil) @@ -264,12 +290,20 @@ func (x *MessageWithNullable) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "other_sub", "otherSub": s.AddField("other_sub") + if s.ReadNil() { + x.OtherSub = nil + return + } // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. var v SubMessageWithoutMarshalers golang.UnmarshalMessage(s, &v) x.OtherSub = &v case "other_subs", "otherSubs": s.AddField("other_subs") + if s.ReadNil() { + x.OtherSubs = nil + return + } s.ReadArray(func() { // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. var v SubMessageWithoutMarshalers @@ -322,12 +356,18 @@ func (x *MessageWithEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { default: s.ReadAny() // ignore unknown field case "sub": - if !s.ReadNil() { - x.Sub = &SubMessage{} - x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) + if s.ReadNil() { + x.Sub = nil + return } + x.Sub = &SubMessage{} + x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) case "other_sub", "otherSub": s.AddField("other_sub") + if s.ReadNil() { + x.OtherSub = nil + return + } // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. var v SubMessageWithoutMarshalers golang.UnmarshalMessage(s, &v) @@ -378,12 +418,18 @@ func (x *MessageWithNullableEmbedded) UnmarshalProtoJSON(s *jsonplugin.Unmarshal default: s.ReadAny() // ignore unknown field case "sub": - if !s.ReadNil() { - x.Sub = &SubMessage{} - x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) + if s.ReadNil() { + x.Sub = nil + return } + x.Sub = &SubMessage{} + x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) case "other_sub", "otherSub": s.AddField("other_sub") + if s.ReadNil() { + x.OtherSub = nil + return + } // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. var v SubMessageWithoutMarshalers golang.UnmarshalMessage(s, &v) diff --git a/test/golang/scalars_json.pb.go b/test/golang/scalars_json.pb.go index c9a4521b..5b57f707 100644 --- a/test/golang/scalars_json.pb.go +++ b/test/golang/scalars_json.pb.go @@ -201,96 +201,160 @@ func (x *MessageWithScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.DoubleValue = s.ReadFloat64() case "double_values", "doubleValues": s.AddField("double_values") + if s.ReadNil() { + x.DoubleValues = nil + return + } x.DoubleValues = s.ReadFloat64Array() case "float_value", "floatValue": s.AddField("float_value") x.FloatValue = s.ReadFloat32() case "float_values", "floatValues": s.AddField("float_values") + if s.ReadNil() { + x.FloatValues = nil + return + } x.FloatValues = s.ReadFloat32Array() case "int32_value", "int32Value": s.AddField("int32_value") x.Int32Value = s.ReadInt32() case "int32_values", "int32Values": s.AddField("int32_values") + if s.ReadNil() { + x.Int32Values = nil + return + } x.Int32Values = s.ReadInt32Array() case "int64_value", "int64Value": s.AddField("int64_value") x.Int64Value = s.ReadInt64() case "int64_values", "int64Values": s.AddField("int64_values") + if s.ReadNil() { + x.Int64Values = nil + return + } x.Int64Values = s.ReadInt64Array() case "uint32_value", "uint32Value": s.AddField("uint32_value") x.Uint32Value = s.ReadUint32() case "uint32_values", "uint32Values": s.AddField("uint32_values") + if s.ReadNil() { + x.Uint32Values = nil + return + } x.Uint32Values = s.ReadUint32Array() case "uint64_value", "uint64Value": s.AddField("uint64_value") x.Uint64Value = s.ReadUint64() case "uint64_values", "uint64Values": s.AddField("uint64_values") + if s.ReadNil() { + x.Uint64Values = nil + return + } x.Uint64Values = s.ReadUint64Array() case "sint32_value", "sint32Value": s.AddField("sint32_value") x.Sint32Value = s.ReadInt32() case "sint32_values", "sint32Values": s.AddField("sint32_values") + if s.ReadNil() { + x.Sint32Values = nil + return + } x.Sint32Values = s.ReadInt32Array() case "sint64_value", "sint64Value": s.AddField("sint64_value") x.Sint64Value = s.ReadInt64() case "sint64_values", "sint64Values": s.AddField("sint64_values") + if s.ReadNil() { + x.Sint64Values = nil + return + } x.Sint64Values = s.ReadInt64Array() case "fixed32_value", "fixed32Value": s.AddField("fixed32_value") x.Fixed32Value = s.ReadUint32() case "fixed32_values", "fixed32Values": s.AddField("fixed32_values") + if s.ReadNil() { + x.Fixed32Values = nil + return + } x.Fixed32Values = s.ReadUint32Array() case "fixed64_value", "fixed64Value": s.AddField("fixed64_value") x.Fixed64Value = s.ReadUint64() case "fixed64_values", "fixed64Values": s.AddField("fixed64_values") + if s.ReadNil() { + x.Fixed64Values = nil + return + } x.Fixed64Values = s.ReadUint64Array() case "sfixed32_value", "sfixed32Value": s.AddField("sfixed32_value") x.Sfixed32Value = s.ReadInt32() case "sfixed32_values", "sfixed32Values": s.AddField("sfixed32_values") + if s.ReadNil() { + x.Sfixed32Values = nil + return + } x.Sfixed32Values = s.ReadInt32Array() case "sfixed64_value", "sfixed64Value": s.AddField("sfixed64_value") x.Sfixed64Value = s.ReadInt64() case "sfixed64_values", "sfixed64Values": s.AddField("sfixed64_values") + if s.ReadNil() { + x.Sfixed64Values = nil + return + } x.Sfixed64Values = s.ReadInt64Array() case "bool_value", "boolValue": s.AddField("bool_value") x.BoolValue = s.ReadBool() case "bool_values", "boolValues": s.AddField("bool_values") + if s.ReadNil() { + x.BoolValues = nil + return + } x.BoolValues = s.ReadBoolArray() case "string_value", "stringValue": s.AddField("string_value") x.StringValue = s.ReadString() case "string_values", "stringValues": s.AddField("string_values") + if s.ReadNil() { + x.StringValues = nil + return + } x.StringValues = s.ReadStringArray() case "bytes_value", "bytesValue": s.AddField("bytes_value") x.BytesValue = s.ReadBytes() case "bytes_values", "bytesValues": s.AddField("bytes_values") + if s.ReadNil() { + x.BytesValues = nil + return + } x.BytesValues = s.ReadBytesArray() case "hex_bytes_value", "hexBytesValue": s.AddField("hex_bytes_value") x.HexBytesValue = types.UnmarshalHEX(s.WithField("hex_bytes_value", false)) case "hex_bytes_values", "hexBytesValues": s.AddField("hex_bytes_values") + if s.ReadNil() { + x.HexBytesValues = nil + return + } x.HexBytesValues = types.UnmarshalHEXArray(s.WithField("hex_bytes_values", false)) } }) @@ -397,83 +461,83 @@ func (x *MessageWithOneofScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalStat case "double_value", "doubleValue": s.AddField("double_value") ov := &MessageWithOneofScalars_DoubleValue{} - ov.DoubleValue = s.ReadFloat64() x.Value = ov + ov.DoubleValue = s.ReadFloat64() case "float_value", "floatValue": s.AddField("float_value") ov := &MessageWithOneofScalars_FloatValue{} - ov.FloatValue = s.ReadFloat32() x.Value = ov + ov.FloatValue = s.ReadFloat32() case "int32_value", "int32Value": s.AddField("int32_value") ov := &MessageWithOneofScalars_Int32Value{} - ov.Int32Value = s.ReadInt32() x.Value = ov + ov.Int32Value = s.ReadInt32() case "int64_value", "int64Value": s.AddField("int64_value") ov := &MessageWithOneofScalars_Int64Value{} - ov.Int64Value = s.ReadInt64() x.Value = ov + ov.Int64Value = s.ReadInt64() case "uint32_value", "uint32Value": s.AddField("uint32_value") ov := &MessageWithOneofScalars_Uint32Value{} - ov.Uint32Value = s.ReadUint32() x.Value = ov + ov.Uint32Value = s.ReadUint32() case "uint64_value", "uint64Value": s.AddField("uint64_value") ov := &MessageWithOneofScalars_Uint64Value{} - ov.Uint64Value = s.ReadUint64() x.Value = ov + ov.Uint64Value = s.ReadUint64() case "sint32_value", "sint32Value": s.AddField("sint32_value") ov := &MessageWithOneofScalars_Sint32Value{} - ov.Sint32Value = s.ReadInt32() x.Value = ov + ov.Sint32Value = s.ReadInt32() case "sint64_value", "sint64Value": s.AddField("sint64_value") ov := &MessageWithOneofScalars_Sint64Value{} - ov.Sint64Value = s.ReadInt64() x.Value = ov + ov.Sint64Value = s.ReadInt64() case "fixed32_value", "fixed32Value": s.AddField("fixed32_value") ov := &MessageWithOneofScalars_Fixed32Value{} - ov.Fixed32Value = s.ReadUint32() x.Value = ov + ov.Fixed32Value = s.ReadUint32() case "fixed64_value", "fixed64Value": s.AddField("fixed64_value") ov := &MessageWithOneofScalars_Fixed64Value{} - ov.Fixed64Value = s.ReadUint64() x.Value = ov + ov.Fixed64Value = s.ReadUint64() case "sfixed32_value", "sfixed32Value": s.AddField("sfixed32_value") ov := &MessageWithOneofScalars_Sfixed32Value{} - ov.Sfixed32Value = s.ReadInt32() x.Value = ov + ov.Sfixed32Value = s.ReadInt32() case "sfixed64_value", "sfixed64Value": s.AddField("sfixed64_value") ov := &MessageWithOneofScalars_Sfixed64Value{} - ov.Sfixed64Value = s.ReadInt64() x.Value = ov + ov.Sfixed64Value = s.ReadInt64() case "bool_value", "boolValue": s.AddField("bool_value") ov := &MessageWithOneofScalars_BoolValue{} - ov.BoolValue = s.ReadBool() x.Value = ov + ov.BoolValue = s.ReadBool() case "string_value", "stringValue": s.AddField("string_value") ov := &MessageWithOneofScalars_StringValue{} - ov.StringValue = s.ReadString() x.Value = ov + ov.StringValue = s.ReadString() case "bytes_value", "bytesValue": s.AddField("bytes_value") ov := &MessageWithOneofScalars_BytesValue{} - ov.BytesValue = s.ReadBytes() x.Value = ov + ov.BytesValue = s.ReadBytes() case "hex_bytes_value", "hexBytesValue": s.AddField("hex_bytes_value") ov := &MessageWithOneofScalars_HexBytesValue{} - ov.HexBytesValue = types.UnmarshalHEX(s.WithField("hex_bytes_value", false)) x.Value = ov + ov.HexBytesValue = types.UnmarshalHEX(s.WithField("hex_bytes_value", false)) } }) } @@ -827,162 +891,270 @@ func (x *MessageWithScalarMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) s.ReadAny() // ignore unknown field case "string_double_map", "stringDoubleMap": s.AddField("string_double_map") + if s.ReadNil() { + x.StringDoubleMap = nil + return + } x.StringDoubleMap = make(map[string]float64) s.ReadStringMap(func(key string) { x.StringDoubleMap[key] = s.ReadFloat64() }) case "string_float_map", "stringFloatMap": s.AddField("string_float_map") + if s.ReadNil() { + x.StringFloatMap = nil + return + } x.StringFloatMap = make(map[string]float32) s.ReadStringMap(func(key string) { x.StringFloatMap[key] = s.ReadFloat32() }) case "string_int32_map", "stringInt32Map": s.AddField("string_int32_map") + if s.ReadNil() { + x.StringInt32Map = nil + return + } x.StringInt32Map = make(map[string]int32) s.ReadStringMap(func(key string) { x.StringInt32Map[key] = s.ReadInt32() }) case "int32_string_map", "int32StringMap": s.AddField("int32_string_map") + if s.ReadNil() { + x.Int32StringMap = nil + return + } x.Int32StringMap = make(map[int32]string) s.ReadInt32Map(func(key int32) { x.Int32StringMap[key] = s.ReadString() }) case "string_int64_map", "stringInt64Map": s.AddField("string_int64_map") + if s.ReadNil() { + x.StringInt64Map = nil + return + } x.StringInt64Map = make(map[string]int64) s.ReadStringMap(func(key string) { x.StringInt64Map[key] = s.ReadInt64() }) case "int64_string_map", "int64StringMap": s.AddField("int64_string_map") + if s.ReadNil() { + x.Int64StringMap = nil + return + } x.Int64StringMap = make(map[int64]string) s.ReadInt64Map(func(key int64) { x.Int64StringMap[key] = s.ReadString() }) case "string_uint32_map", "stringUint32Map": s.AddField("string_uint32_map") + if s.ReadNil() { + x.StringUint32Map = nil + return + } x.StringUint32Map = make(map[string]uint32) s.ReadStringMap(func(key string) { x.StringUint32Map[key] = s.ReadUint32() }) case "uint32_string_map", "uint32StringMap": s.AddField("uint32_string_map") + if s.ReadNil() { + x.Uint32StringMap = nil + return + } x.Uint32StringMap = make(map[uint32]string) s.ReadUint32Map(func(key uint32) { x.Uint32StringMap[key] = s.ReadString() }) case "string_uint64_map", "stringUint64Map": s.AddField("string_uint64_map") + if s.ReadNil() { + x.StringUint64Map = nil + return + } x.StringUint64Map = make(map[string]uint64) s.ReadStringMap(func(key string) { x.StringUint64Map[key] = s.ReadUint64() }) case "uint64_string_map", "uint64StringMap": s.AddField("uint64_string_map") + if s.ReadNil() { + x.Uint64StringMap = nil + return + } x.Uint64StringMap = make(map[uint64]string) s.ReadUint64Map(func(key uint64) { x.Uint64StringMap[key] = s.ReadString() }) case "string_sint32_map", "stringSint32Map": s.AddField("string_sint32_map") + if s.ReadNil() { + x.StringSint32Map = nil + return + } x.StringSint32Map = make(map[string]int32) s.ReadStringMap(func(key string) { x.StringSint32Map[key] = s.ReadInt32() }) case "sint32_string_map", "sint32StringMap": s.AddField("sint32_string_map") + if s.ReadNil() { + x.Sint32StringMap = nil + return + } x.Sint32StringMap = make(map[int32]string) s.ReadInt32Map(func(key int32) { x.Sint32StringMap[key] = s.ReadString() }) case "string_sint64_map", "stringSint64Map": s.AddField("string_sint64_map") + if s.ReadNil() { + x.StringSint64Map = nil + return + } x.StringSint64Map = make(map[string]int64) s.ReadStringMap(func(key string) { x.StringSint64Map[key] = s.ReadInt64() }) case "sint64_string_map", "sint64StringMap": s.AddField("sint64_string_map") + if s.ReadNil() { + x.Sint64StringMap = nil + return + } x.Sint64StringMap = make(map[int64]string) s.ReadInt64Map(func(key int64) { x.Sint64StringMap[key] = s.ReadString() }) case "string_fixed32_map", "stringFixed32Map": s.AddField("string_fixed32_map") + if s.ReadNil() { + x.StringFixed32Map = nil + return + } x.StringFixed32Map = make(map[string]uint32) s.ReadStringMap(func(key string) { x.StringFixed32Map[key] = s.ReadUint32() }) case "fixed32_string_map", "fixed32StringMap": s.AddField("fixed32_string_map") + if s.ReadNil() { + x.Fixed32StringMap = nil + return + } x.Fixed32StringMap = make(map[uint32]string) s.ReadUint32Map(func(key uint32) { x.Fixed32StringMap[key] = s.ReadString() }) case "string_fixed64_map", "stringFixed64Map": s.AddField("string_fixed64_map") + if s.ReadNil() { + x.StringFixed64Map = nil + return + } x.StringFixed64Map = make(map[string]uint64) s.ReadStringMap(func(key string) { x.StringFixed64Map[key] = s.ReadUint64() }) case "fixed64_string_map", "fixed64StringMap": s.AddField("fixed64_string_map") + if s.ReadNil() { + x.Fixed64StringMap = nil + return + } x.Fixed64StringMap = make(map[uint64]string) s.ReadUint64Map(func(key uint64) { x.Fixed64StringMap[key] = s.ReadString() }) case "string_sfixed32_map", "stringSfixed32Map": s.AddField("string_sfixed32_map") + if s.ReadNil() { + x.StringSfixed32Map = nil + return + } x.StringSfixed32Map = make(map[string]int32) s.ReadStringMap(func(key string) { x.StringSfixed32Map[key] = s.ReadInt32() }) case "sfixed32_string_map", "sfixed32StringMap": s.AddField("sfixed32_string_map") + if s.ReadNil() { + x.Sfixed32StringMap = nil + return + } x.Sfixed32StringMap = make(map[int32]string) s.ReadInt32Map(func(key int32) { x.Sfixed32StringMap[key] = s.ReadString() }) case "string_sfixed64_map", "stringSfixed64Map": s.AddField("string_sfixed64_map") + if s.ReadNil() { + x.StringSfixed64Map = nil + return + } x.StringSfixed64Map = make(map[string]int64) s.ReadStringMap(func(key string) { x.StringSfixed64Map[key] = s.ReadInt64() }) case "sfixed64_string_map", "sfixed64StringMap": s.AddField("sfixed64_string_map") + if s.ReadNil() { + x.Sfixed64StringMap = nil + return + } x.Sfixed64StringMap = make(map[int64]string) s.ReadInt64Map(func(key int64) { x.Sfixed64StringMap[key] = s.ReadString() }) case "string_bool_map", "stringBoolMap": s.AddField("string_bool_map") + if s.ReadNil() { + x.StringBoolMap = nil + return + } x.StringBoolMap = make(map[string]bool) s.ReadStringMap(func(key string) { x.StringBoolMap[key] = s.ReadBool() }) case "bool_string_map", "boolStringMap": s.AddField("bool_string_map") + if s.ReadNil() { + x.BoolStringMap = nil + return + } x.BoolStringMap = make(map[bool]string) s.ReadBoolMap(func(key bool) { x.BoolStringMap[key] = s.ReadString() }) case "string_string_map", "stringStringMap": s.AddField("string_string_map") + if s.ReadNil() { + x.StringStringMap = nil + return + } x.StringStringMap = make(map[string]string) s.ReadStringMap(func(key string) { x.StringStringMap[key] = s.ReadString() }) case "string_bytes_map", "stringBytesMap": s.AddField("string_bytes_map") + if s.ReadNil() { + x.StringBytesMap = nil + return + } x.StringBytesMap = make(map[string][]byte) s.ReadStringMap(func(key string) { x.StringBytesMap[key] = s.ReadBytes() }) case "string_hex_bytes_map", "stringHexBytesMap": s.AddField("string_hex_bytes_map") + if s.ReadNil() { + x.StringHexBytesMap = nil + return + } x.StringHexBytesMap = types.UnmarshalStringHEXMap(s.WithField("string_hex_bytes_map", false)) } }) diff --git a/test/golang/wkts_json.pb.go b/test/golang/wkts_json.pb.go index fd5df086..f0d1ec09 100644 --- a/test/golang/wkts_json.pb.go +++ b/test/golang/wkts_json.pb.go @@ -495,15 +495,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { s.ReadAny() // ignore unknown field case "double_value", "doubleValue": s.AddField("double_value") - if !s.ReadNil() { - v := s.ReadFloat64() - if s.Err() != nil { - return - } - x.DoubleValue = &wrapperspb.DoubleValue{Value: v} + if s.ReadNil() { + x.DoubleValue = nil + return } + v := s.ReadFloat64() + if s.Err() != nil { + return + } + x.DoubleValue = &wrapperspb.DoubleValue{Value: v} case "double_values", "doubleValues": s.AddField("double_values") + if s.ReadNil() { + x.DoubleValues = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.DoubleValues = append(x.DoubleValues, nil) @@ -517,15 +523,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "float_value", "floatValue": s.AddField("float_value") - if !s.ReadNil() { - v := s.ReadFloat32() - if s.Err() != nil { - return - } - x.FloatValue = &wrapperspb.FloatValue{Value: v} + if s.ReadNil() { + x.FloatValue = nil + return + } + v := s.ReadFloat32() + if s.Err() != nil { + return } + x.FloatValue = &wrapperspb.FloatValue{Value: v} case "float_values", "floatValues": s.AddField("float_values") + if s.ReadNil() { + x.FloatValues = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.FloatValues = append(x.FloatValues, nil) @@ -539,15 +551,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "int32_value", "int32Value": s.AddField("int32_value") - if !s.ReadNil() { - v := s.ReadInt32() - if s.Err() != nil { - return - } - x.Int32Value = &wrapperspb.Int32Value{Value: v} + if s.ReadNil() { + x.Int32Value = nil + return } + v := s.ReadInt32() + if s.Err() != nil { + return + } + x.Int32Value = &wrapperspb.Int32Value{Value: v} case "int32_values", "int32Values": s.AddField("int32_values") + if s.ReadNil() { + x.Int32Values = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.Int32Values = append(x.Int32Values, nil) @@ -561,15 +579,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "int64_value", "int64Value": s.AddField("int64_value") - if !s.ReadNil() { - v := s.ReadInt64() - if s.Err() != nil { - return - } - x.Int64Value = &wrapperspb.Int64Value{Value: v} + if s.ReadNil() { + x.Int64Value = nil + return } + v := s.ReadInt64() + if s.Err() != nil { + return + } + x.Int64Value = &wrapperspb.Int64Value{Value: v} case "int64_values", "int64Values": s.AddField("int64_values") + if s.ReadNil() { + x.Int64Values = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.Int64Values = append(x.Int64Values, nil) @@ -583,15 +607,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "uint32_value", "uint32Value": s.AddField("uint32_value") - if !s.ReadNil() { - v := s.ReadUint32() - if s.Err() != nil { - return - } - x.Uint32Value = &wrapperspb.UInt32Value{Value: v} + if s.ReadNil() { + x.Uint32Value = nil + return } + v := s.ReadUint32() + if s.Err() != nil { + return + } + x.Uint32Value = &wrapperspb.UInt32Value{Value: v} case "uint32_values", "uint32Values": s.AddField("uint32_values") + if s.ReadNil() { + x.Uint32Values = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.Uint32Values = append(x.Uint32Values, nil) @@ -605,15 +635,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "uint64_value", "uint64Value": s.AddField("uint64_value") - if !s.ReadNil() { - v := s.ReadUint64() - if s.Err() != nil { - return - } - x.Uint64Value = &wrapperspb.UInt64Value{Value: v} + if s.ReadNil() { + x.Uint64Value = nil + return + } + v := s.ReadUint64() + if s.Err() != nil { + return } + x.Uint64Value = &wrapperspb.UInt64Value{Value: v} case "uint64_values", "uint64Values": s.AddField("uint64_values") + if s.ReadNil() { + x.Uint64Values = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.Uint64Values = append(x.Uint64Values, nil) @@ -627,15 +663,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "bool_value", "boolValue": s.AddField("bool_value") - if !s.ReadNil() { - v := s.ReadBool() - if s.Err() != nil { - return - } - x.BoolValue = &wrapperspb.BoolValue{Value: v} + if s.ReadNil() { + x.BoolValue = nil + return + } + v := s.ReadBool() + if s.Err() != nil { + return } + x.BoolValue = &wrapperspb.BoolValue{Value: v} case "bool_values", "boolValues": s.AddField("bool_values") + if s.ReadNil() { + x.BoolValues = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.BoolValues = append(x.BoolValues, nil) @@ -649,15 +691,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_value", "stringValue": s.AddField("string_value") - if !s.ReadNil() { - v := s.ReadString() - if s.Err() != nil { - return - } - x.StringValue = &wrapperspb.StringValue{Value: v} + if s.ReadNil() { + x.StringValue = nil + return } + v := s.ReadString() + if s.Err() != nil { + return + } + x.StringValue = &wrapperspb.StringValue{Value: v} case "string_values", "stringValues": s.AddField("string_values") + if s.ReadNil() { + x.StringValues = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.StringValues = append(x.StringValues, nil) @@ -671,15 +719,21 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "bytes_value", "bytesValue": s.AddField("bytes_value") - if !s.ReadNil() { - v := s.ReadBytes() - if s.Err() != nil { - return - } - x.BytesValue = &wrapperspb.BytesValue{Value: v} + if s.ReadNil() { + x.BytesValue = nil + return + } + v := s.ReadBytes() + if s.Err() != nil { + return } + x.BytesValue = &wrapperspb.BytesValue{Value: v} case "bytes_values", "bytesValues": s.AddField("bytes_values") + if s.ReadNil() { + x.BytesValues = nil + return + } s.ReadArray(func() { if s.ReadNil() { x.BytesValues = append(x.BytesValues, nil) @@ -693,6 +747,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "empty_value", "emptyValue": s.AddField("empty_value") + if s.ReadNil() { + x.EmptyValue = nil + return + } v := golang.UnmarshalEmpty(s) if s.Err() != nil { return @@ -700,6 +758,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.EmptyValue = v case "empty_values", "emptyValues": s.AddField("empty_values") + if s.ReadNil() { + x.EmptyValues = nil + return + } s.ReadArray(func() { v := golang.UnmarshalEmpty(s) if s.Err() != nil { @@ -709,6 +771,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "timestamp_value", "timestampValue": s.AddField("timestamp_value") + if s.ReadNil() { + x.TimestampValue = nil + return + } v := golang.UnmarshalTimestamp(s) if s.Err() != nil { return @@ -716,6 +782,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.TimestampValue = v case "timestamp_values", "timestampValues": s.AddField("timestamp_values") + if s.ReadNil() { + x.TimestampValues = nil + return + } s.ReadArray(func() { v := golang.UnmarshalTimestamp(s) if s.Err() != nil { @@ -725,6 +795,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "duration_value", "durationValue": s.AddField("duration_value") + if s.ReadNil() { + x.DurationValue = nil + return + } v := golang.UnmarshalDuration(s) if s.Err() != nil { return @@ -732,6 +806,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.DurationValue = v case "duration_values", "durationValues": s.AddField("duration_values") + if s.ReadNil() { + x.DurationValues = nil + return + } s.ReadArray(func() { v := golang.UnmarshalDuration(s) if s.Err() != nil { @@ -741,6 +819,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "field_mask_value", "fieldMaskValue": s.AddField("field_mask_value") + if s.ReadNil() { + x.FieldMaskValue = nil + return + } v := golang.UnmarshalFieldMask(s) if s.Err() != nil { return @@ -748,6 +830,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.FieldMaskValue = v case "field_mask_values", "fieldMaskValues": s.AddField("field_mask_values") + if s.ReadNil() { + x.FieldMaskValues = nil + return + } s.ReadArray(func() { v := golang.UnmarshalFieldMask(s) if s.Err() != nil { @@ -757,6 +843,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "value_value", "valueValue": s.AddField("value_value") + if s.ReadNil() { + x.ValueValue = &structpb.Value{Kind: &structpb.Value_NullValue{}} + return + } v := golang.UnmarshalValue(s) if s.Err() != nil { return @@ -764,6 +854,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.ValueValue = v case "value_values", "valueValues": s.AddField("value_values") + if s.ReadNil() { + x.ValueValues = nil + return + } s.ReadArray(func() { v := golang.UnmarshalValue(s) if s.Err() != nil { @@ -773,6 +867,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "list_value_value", "listValueValue": s.AddField("list_value_value") + if s.ReadNil() { + x.ListValueValue = nil + return + } v := golang.UnmarshalListValue(s) if s.Err() != nil { return @@ -780,6 +878,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.ListValueValue = v case "list_value_values", "listValueValues": s.AddField("list_value_values") + if s.ReadNil() { + x.ListValueValues = nil + return + } s.ReadArray(func() { v := golang.UnmarshalListValue(s) if s.Err() != nil { @@ -789,6 +891,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "struct_value", "structValue": s.AddField("struct_value") + if s.ReadNil() { + x.StructValue = nil + return + } v := golang.UnmarshalStruct(s) if s.Err() != nil { return @@ -796,6 +902,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.StructValue = v case "struct_values", "structValues": s.AddField("struct_values") + if s.ReadNil() { + x.StructValues = nil + return + } s.ReadArray(func() { v := golang.UnmarshalStruct(s) if s.Err() != nil { @@ -805,6 +915,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "any_value", "anyValue": s.AddField("any_value") + if s.ReadNil() { + x.AnyValue = nil + return + } v := golang.UnmarshalAny(s) if s.Err() != nil { return @@ -812,6 +926,10 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.AnyValue = v case "any_values", "anyValues": s.AddField("any_values") + if s.ReadNil() { + x.AnyValues = nil + return + } s.ReadArray(func() { v := golang.UnmarshalAny(s) if s.Err() != nil { @@ -996,174 +1114,224 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) case "double_value", "doubleValue": s.AddField("double_value") ov := &MessageWithOneofWKTs_DoubleValue{} - if !s.ReadNil() { - v := s.ReadFloat64() - if s.Err() != nil { - return - } - ov.DoubleValue = &wrapperspb.DoubleValue{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.DoubleValue = nil + return + } + v := s.ReadFloat64() + if s.Err() != nil { + return + } + ov.DoubleValue = &wrapperspb.DoubleValue{Value: v} case "float_value", "floatValue": s.AddField("float_value") ov := &MessageWithOneofWKTs_FloatValue{} - if !s.ReadNil() { - v := s.ReadFloat32() - if s.Err() != nil { - return - } - ov.FloatValue = &wrapperspb.FloatValue{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.FloatValue = nil + return + } + v := s.ReadFloat32() + if s.Err() != nil { + return + } + ov.FloatValue = &wrapperspb.FloatValue{Value: v} case "int32_value", "int32Value": s.AddField("int32_value") ov := &MessageWithOneofWKTs_Int32Value{} - if !s.ReadNil() { - v := s.ReadInt32() - if s.Err() != nil { - return - } - ov.Int32Value = &wrapperspb.Int32Value{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.Int32Value = nil + return + } + v := s.ReadInt32() + if s.Err() != nil { + return + } + ov.Int32Value = &wrapperspb.Int32Value{Value: v} case "int64_value", "int64Value": s.AddField("int64_value") ov := &MessageWithOneofWKTs_Int64Value{} - if !s.ReadNil() { - v := s.ReadInt64() - if s.Err() != nil { - return - } - ov.Int64Value = &wrapperspb.Int64Value{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.Int64Value = nil + return + } + v := s.ReadInt64() + if s.Err() != nil { + return + } + ov.Int64Value = &wrapperspb.Int64Value{Value: v} case "uint32_value", "uint32Value": s.AddField("uint32_value") ov := &MessageWithOneofWKTs_Uint32Value{} - if !s.ReadNil() { - v := s.ReadUint32() - if s.Err() != nil { - return - } - ov.Uint32Value = &wrapperspb.UInt32Value{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.Uint32Value = nil + return + } + v := s.ReadUint32() + if s.Err() != nil { + return + } + ov.Uint32Value = &wrapperspb.UInt32Value{Value: v} case "uint64_value", "uint64Value": s.AddField("uint64_value") ov := &MessageWithOneofWKTs_Uint64Value{} - if !s.ReadNil() { - v := s.ReadUint64() - if s.Err() != nil { - return - } - ov.Uint64Value = &wrapperspb.UInt64Value{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.Uint64Value = nil + return + } + v := s.ReadUint64() + if s.Err() != nil { + return + } + ov.Uint64Value = &wrapperspb.UInt64Value{Value: v} case "bool_value", "boolValue": s.AddField("bool_value") ov := &MessageWithOneofWKTs_BoolValue{} - if !s.ReadNil() { - v := s.ReadBool() - if s.Err() != nil { - return - } - ov.BoolValue = &wrapperspb.BoolValue{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.BoolValue = nil + return + } + v := s.ReadBool() + if s.Err() != nil { + return + } + ov.BoolValue = &wrapperspb.BoolValue{Value: v} case "string_value", "stringValue": s.AddField("string_value") ov := &MessageWithOneofWKTs_StringValue{} - if !s.ReadNil() { - v := s.ReadString() - if s.Err() != nil { - return - } - ov.StringValue = &wrapperspb.StringValue{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.StringValue = nil + return + } + v := s.ReadString() + if s.Err() != nil { + return + } + ov.StringValue = &wrapperspb.StringValue{Value: v} case "bytes_value", "bytesValue": s.AddField("bytes_value") ov := &MessageWithOneofWKTs_BytesValue{} - if !s.ReadNil() { - v := s.ReadBytes() - if s.Err() != nil { - return - } - ov.BytesValue = &wrapperspb.BytesValue{Value: v} - } x.Value = ov + if s.ReadNil() { + ov.BytesValue = nil + return + } + v := s.ReadBytes() + if s.Err() != nil { + return + } + ov.BytesValue = &wrapperspb.BytesValue{Value: v} case "empty_value", "emptyValue": s.AddField("empty_value") ov := &MessageWithOneofWKTs_EmptyValue{} + x.Value = ov + if s.ReadNil() { + ov.EmptyValue = nil + return + } v := golang.UnmarshalEmpty(s) if s.Err() != nil { return } ov.EmptyValue = v - x.Value = ov case "timestamp_value", "timestampValue": s.AddField("timestamp_value") ov := &MessageWithOneofWKTs_TimestampValue{} + x.Value = ov + if s.ReadNil() { + ov.TimestampValue = nil + return + } v := golang.UnmarshalTimestamp(s) if s.Err() != nil { return } ov.TimestampValue = v - x.Value = ov case "duration_value", "durationValue": s.AddField("duration_value") ov := &MessageWithOneofWKTs_DurationValue{} + x.Value = ov + if s.ReadNil() { + ov.DurationValue = nil + return + } v := golang.UnmarshalDuration(s) if s.Err() != nil { return } ov.DurationValue = v - x.Value = ov case "field_mask_value", "fieldMaskValue": s.AddField("field_mask_value") ov := &MessageWithOneofWKTs_FieldMaskValue{} + x.Value = ov + if s.ReadNil() { + ov.FieldMaskValue = nil + return + } v := golang.UnmarshalFieldMask(s) if s.Err() != nil { return } ov.FieldMaskValue = v - x.Value = ov case "value_value", "valueValue": s.AddField("value_value") ov := &MessageWithOneofWKTs_ValueValue{} + x.Value = ov + if s.ReadNil() { + ov.ValueValue = &structpb.Value{Kind: &structpb.Value_NullValue{}} + return + } v := golang.UnmarshalValue(s) if s.Err() != nil { return } ov.ValueValue = v - x.Value = ov case "list_value_value", "listValueValue": s.AddField("list_value_value") ov := &MessageWithOneofWKTs_ListValueValue{} + x.Value = ov + if s.ReadNil() { + ov.ListValueValue = nil + return + } v := golang.UnmarshalListValue(s) if s.Err() != nil { return } ov.ListValueValue = v - x.Value = ov case "struct_value", "structValue": s.AddField("struct_value") ov := &MessageWithOneofWKTs_StructValue{} + x.Value = ov + if s.ReadNil() { + ov.StructValue = nil + return + } v := golang.UnmarshalStruct(s) if s.Err() != nil { return } ov.StructValue = v - x.Value = ov case "any_value", "anyValue": s.AddField("any_value") ov := &MessageWithOneofWKTs_AnyValue{} + x.Value = ov + if s.ReadNil() { + ov.AnyValue = nil + return + } v := golang.UnmarshalAny(s) if s.Err() != nil { return } ov.AnyValue = v - x.Value = ov } }) } @@ -1472,6 +1640,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { s.ReadAny() // ignore unknown field case "string_double_map", "stringDoubleMap": s.AddField("string_double_map") + if s.ReadNil() { + x.StringDoubleMap = nil + return + } x.StringDoubleMap = make(map[string]*wrapperspb.DoubleValue) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1486,6 +1658,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_float_map", "stringFloatMap": s.AddField("string_float_map") + if s.ReadNil() { + x.StringFloatMap = nil + return + } x.StringFloatMap = make(map[string]*wrapperspb.FloatValue) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1500,6 +1676,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_int32_map", "stringInt32Map": s.AddField("string_int32_map") + if s.ReadNil() { + x.StringInt32Map = nil + return + } x.StringInt32Map = make(map[string]*wrapperspb.Int32Value) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1514,6 +1694,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_int64_map", "stringInt64Map": s.AddField("string_int64_map") + if s.ReadNil() { + x.StringInt64Map = nil + return + } x.StringInt64Map = make(map[string]*wrapperspb.Int64Value) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1528,6 +1712,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_uint32_map", "stringUint32Map": s.AddField("string_uint32_map") + if s.ReadNil() { + x.StringUint32Map = nil + return + } x.StringUint32Map = make(map[string]*wrapperspb.UInt32Value) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1542,6 +1730,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_uint64_map", "stringUint64Map": s.AddField("string_uint64_map") + if s.ReadNil() { + x.StringUint64Map = nil + return + } x.StringUint64Map = make(map[string]*wrapperspb.UInt64Value) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1556,6 +1748,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_bool_map", "stringBoolMap": s.AddField("string_bool_map") + if s.ReadNil() { + x.StringBoolMap = nil + return + } x.StringBoolMap = make(map[string]*wrapperspb.BoolValue) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1570,6 +1766,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_string_map", "stringStringMap": s.AddField("string_string_map") + if s.ReadNil() { + x.StringStringMap = nil + return + } x.StringStringMap = make(map[string]*wrapperspb.StringValue) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1584,6 +1784,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_bytes_map", "stringBytesMap": s.AddField("string_bytes_map") + if s.ReadNil() { + x.StringBytesMap = nil + return + } x.StringBytesMap = make(map[string]*wrapperspb.BytesValue) s.ReadStringMap(func(key string) { if s.ReadNil() { @@ -1598,6 +1802,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_empty_map", "stringEmptyMap": s.AddField("string_empty_map") + if s.ReadNil() { + x.StringEmptyMap = nil + return + } x.StringEmptyMap = make(map[string]*emptypb.Empty) s.ReadStringMap(func(key string) { v := golang.UnmarshalEmpty(s) @@ -1608,6 +1816,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_timestamp_map", "stringTimestampMap": s.AddField("string_timestamp_map") + if s.ReadNil() { + x.StringTimestampMap = nil + return + } x.StringTimestampMap = make(map[string]*timestamppb.Timestamp) s.ReadStringMap(func(key string) { v := golang.UnmarshalTimestamp(s) @@ -1618,6 +1830,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_duration_map", "stringDurationMap": s.AddField("string_duration_map") + if s.ReadNil() { + x.StringDurationMap = nil + return + } x.StringDurationMap = make(map[string]*durationpb.Duration) s.ReadStringMap(func(key string) { v := golang.UnmarshalDuration(s) @@ -1628,6 +1844,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_field_mask_map", "stringFieldMaskMap": s.AddField("string_field_mask_map") + if s.ReadNil() { + x.StringFieldMaskMap = nil + return + } x.StringFieldMaskMap = make(map[string]*fieldmaskpb.FieldMask) s.ReadStringMap(func(key string) { v := golang.UnmarshalFieldMask(s) @@ -1638,6 +1858,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_value_map", "stringValueMap": s.AddField("string_value_map") + if s.ReadNil() { + x.StringValueMap = nil + return + } x.StringValueMap = make(map[string]*structpb.Value) s.ReadStringMap(func(key string) { v := golang.UnmarshalValue(s) @@ -1648,6 +1872,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_list_value_map", "stringListValueMap": s.AddField("string_list_value_map") + if s.ReadNil() { + x.StringListValueMap = nil + return + } x.StringListValueMap = make(map[string]*structpb.ListValue) s.ReadStringMap(func(key string) { v := golang.UnmarshalListValue(s) @@ -1658,6 +1886,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_struct_map", "stringStructMap": s.AddField("string_struct_map") + if s.ReadNil() { + x.StringStructMap = nil + return + } x.StringStructMap = make(map[string]*structpb.Struct) s.ReadStringMap(func(key string) { v := golang.UnmarshalStruct(s) @@ -1668,6 +1900,10 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { }) case "string_any_map", "stringAnyMap": s.AddField("string_any_map") + if s.ReadNil() { + x.StringAnyMap = nil + return + } x.StringAnyMap = make(map[string]*anypb.Any) s.ReadStringMap(func(key string) { v := golang.UnmarshalAny(s) From 1779befd52ab61b87d6249c453afed9571d20346 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Wed, 26 Jan 2022 11:24:11 +0100 Subject: [PATCH 17/46] Fix generated filename in annotations.pb.go --- Makefile | 10 +- annotations/annotations.pb.go | 331 +++++++++++++++++----------------- 2 files changed, 173 insertions(+), 168 deletions(-) diff --git a/Makefile b/Makefile index 599c08ae..a1909461 100644 --- a/Makefile +++ b/Makefile @@ -11,11 +11,15 @@ clean: rm -f ./annotations/*.pb.go rm -f ./test/*/*.pb.go -annotations/annotations.pb.go: annotations.proto - protoc -I . --go_opt=paths=source_relative --go_out=./annotations ./annotations.proto +.dev/protoc-gen-go-json/annotations.proto: annotations.proto + mkdir -p $(shell dirname $@) + cp $< $@ + +annotations/annotations.pb.go: .dev/protoc-gen-go-json/annotations.proto + PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I .dev --go_opt=module=github.com/TheThingsIndustries/protoc-gen-go-json --go_out=./ $< internal/gogoproto/gogo.pb.go: internal/gogoproto/gogo.proto - protoc -I . --go_opt=paths=source_relative --go_out=./ ./internal/gogoproto/gogo.proto + PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I . --go_opt=paths=source_relative --go_out=./ ./internal/gogoproto/gogo.proto BINARY_DEPS = annotations/annotations.pb.go internal/gogoproto/gogo.pb.go $(wildcard cmd/protoc-gen-go-json/*.go) $(wildcard internal/gen/*.go) diff --git a/annotations/annotations.pb.go b/annotations/annotations.pb.go index 792d6503..287a4130 100644 --- a/annotations/annotations.pb.go +++ b/annotations/annotations.pb.go @@ -5,7 +5,7 @@ // versions: // protoc-gen-go v1.27.1 // protoc v3.17.3 -// source: annotations.proto +// source: protoc-gen-go-json/annotations.proto package annotations @@ -40,7 +40,7 @@ type FileOptions struct { func (x *FileOptions) Reset() { *x = FileOptions{} if protoimpl.UnsafeEnabled { - mi := &file_annotations_proto_msgTypes[0] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -53,7 +53,7 @@ func (x *FileOptions) String() string { func (*FileOptions) ProtoMessage() {} func (x *FileOptions) ProtoReflect() protoreflect.Message { - mi := &file_annotations_proto_msgTypes[0] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -66,7 +66,7 @@ func (x *FileOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use FileOptions.ProtoReflect.Descriptor instead. func (*FileOptions) Descriptor() ([]byte, []int) { - return file_annotations_proto_rawDescGZIP(), []int{0} + return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{0} } func (x *FileOptions) GetMarshalerAll() bool { @@ -99,7 +99,7 @@ type MessageOptions struct { func (x *MessageOptions) Reset() { *x = MessageOptions{} if protoimpl.UnsafeEnabled { - mi := &file_annotations_proto_msgTypes[1] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -112,7 +112,7 @@ func (x *MessageOptions) String() string { func (*MessageOptions) ProtoMessage() {} func (x *MessageOptions) ProtoReflect() protoreflect.Message { - mi := &file_annotations_proto_msgTypes[1] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -125,7 +125,7 @@ func (x *MessageOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageOptions.ProtoReflect.Descriptor instead. func (*MessageOptions) Descriptor() ([]byte, []int) { - return file_annotations_proto_rawDescGZIP(), []int{1} + return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{1} } func (x *MessageOptions) GetMarshaler() bool { @@ -163,7 +163,7 @@ type FieldOptions struct { func (x *FieldOptions) Reset() { *x = FieldOptions{} if protoimpl.UnsafeEnabled { - mi := &file_annotations_proto_msgTypes[2] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -176,7 +176,7 @@ func (x *FieldOptions) String() string { func (*FieldOptions) ProtoMessage() {} func (x *FieldOptions) ProtoReflect() protoreflect.Message { - mi := &file_annotations_proto_msgTypes[2] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -189,7 +189,7 @@ func (x *FieldOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use FieldOptions.ProtoReflect.Descriptor instead. func (*FieldOptions) Descriptor() ([]byte, []int) { - return file_annotations_proto_rawDescGZIP(), []int{2} + return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{2} } func (x *FieldOptions) GetMarshalerFunc() string { @@ -215,7 +215,7 @@ type OneofOptions struct { func (x *OneofOptions) Reset() { *x = OneofOptions{} if protoimpl.UnsafeEnabled { - mi := &file_annotations_proto_msgTypes[3] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -228,7 +228,7 @@ func (x *OneofOptions) String() string { func (*OneofOptions) ProtoMessage() {} func (x *OneofOptions) ProtoReflect() protoreflect.Message { - mi := &file_annotations_proto_msgTypes[3] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -241,7 +241,7 @@ func (x *OneofOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use OneofOptions.ProtoReflect.Descriptor instead. func (*OneofOptions) Descriptor() ([]byte, []int) { - return file_annotations_proto_rawDescGZIP(), []int{3} + return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{3} } type EnumOptions struct { @@ -264,7 +264,7 @@ type EnumOptions struct { func (x *EnumOptions) Reset() { *x = EnumOptions{} if protoimpl.UnsafeEnabled { - mi := &file_annotations_proto_msgTypes[4] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -277,7 +277,7 @@ func (x *EnumOptions) String() string { func (*EnumOptions) ProtoMessage() {} func (x *EnumOptions) ProtoReflect() protoreflect.Message { - mi := &file_annotations_proto_msgTypes[4] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -290,7 +290,7 @@ func (x *EnumOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use EnumOptions.ProtoReflect.Descriptor instead. func (*EnumOptions) Descriptor() ([]byte, []int) { - return file_annotations_proto_rawDescGZIP(), []int{4} + return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{4} } func (x *EnumOptions) GetMarshaler() bool { @@ -342,7 +342,7 @@ type EnumValueOptions struct { func (x *EnumValueOptions) Reset() { *x = EnumValueOptions{} if protoimpl.UnsafeEnabled { - mi := &file_annotations_proto_msgTypes[5] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -355,7 +355,7 @@ func (x *EnumValueOptions) String() string { func (*EnumValueOptions) ProtoMessage() {} func (x *EnumValueOptions) ProtoReflect() protoreflect.Message { - mi := &file_annotations_proto_msgTypes[5] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -368,7 +368,7 @@ func (x *EnumValueOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use EnumValueOptions.ProtoReflect.Descriptor instead. func (*EnumValueOptions) Descriptor() ([]byte, []int) { - return file_annotations_proto_rawDescGZIP(), []int{5} + return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{5} } func (x *EnumValueOptions) GetValue() string { @@ -394,7 +394,7 @@ type ServiceOptions struct { func (x *ServiceOptions) Reset() { *x = ServiceOptions{} if protoimpl.UnsafeEnabled { - mi := &file_annotations_proto_msgTypes[6] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -407,7 +407,7 @@ func (x *ServiceOptions) String() string { func (*ServiceOptions) ProtoMessage() {} func (x *ServiceOptions) ProtoReflect() protoreflect.Message { - mi := &file_annotations_proto_msgTypes[6] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -420,7 +420,7 @@ func (x *ServiceOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use ServiceOptions.ProtoReflect.Descriptor instead. func (*ServiceOptions) Descriptor() ([]byte, []int) { - return file_annotations_proto_rawDescGZIP(), []int{6} + return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{6} } type MethodOptions struct { @@ -432,7 +432,7 @@ type MethodOptions struct { func (x *MethodOptions) Reset() { *x = MethodOptions{} if protoimpl.UnsafeEnabled { - mi := &file_annotations_proto_msgTypes[7] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -445,7 +445,7 @@ func (x *MethodOptions) String() string { func (*MethodOptions) ProtoMessage() {} func (x *MethodOptions) ProtoReflect() protoreflect.Message { - mi := &file_annotations_proto_msgTypes[7] + mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -458,17 +458,17 @@ func (x *MethodOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use MethodOptions.ProtoReflect.Descriptor instead. func (*MethodOptions) Descriptor() ([]byte, []int) { - return file_annotations_proto_rawDescGZIP(), []int{7} + return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{7} } -var file_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ +var file_protoc_gen_go_json_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.FileOptions)(nil), ExtensionType: (*FileOptions)(nil), Field: 51885, Name: "thethings.json.file", Tag: "bytes,51885,opt,name=file", - Filename: "annotations.proto", + Filename: "protoc-gen-go-json/annotations.proto", }, { ExtendedType: (*descriptorpb.MessageOptions)(nil), @@ -476,7 +476,7 @@ var file_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ Field: 51885, Name: "thethings.json.message", Tag: "bytes,51885,opt,name=message", - Filename: "annotations.proto", + Filename: "protoc-gen-go-json/annotations.proto", }, { ExtendedType: (*descriptorpb.FieldOptions)(nil), @@ -484,7 +484,7 @@ var file_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ Field: 51885, Name: "thethings.json.field", Tag: "bytes,51885,opt,name=field", - Filename: "annotations.proto", + Filename: "protoc-gen-go-json/annotations.proto", }, { ExtendedType: (*descriptorpb.OneofOptions)(nil), @@ -492,7 +492,7 @@ var file_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ Field: 51885, Name: "thethings.json.oneof", Tag: "bytes,51885,opt,name=oneof", - Filename: "annotations.proto", + Filename: "protoc-gen-go-json/annotations.proto", }, { ExtendedType: (*descriptorpb.EnumOptions)(nil), @@ -500,7 +500,7 @@ var file_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ Field: 51885, Name: "thethings.json.enum", Tag: "bytes,51885,opt,name=enum", - Filename: "annotations.proto", + Filename: "protoc-gen-go-json/annotations.proto", }, { ExtendedType: (*descriptorpb.EnumValueOptions)(nil), @@ -508,7 +508,7 @@ var file_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ Field: 51885, Name: "thethings.json.enum_value", Tag: "bytes,51885,opt,name=enum_value", - Filename: "annotations.proto", + Filename: "protoc-gen-go-json/annotations.proto", }, { ExtendedType: (*descriptorpb.ServiceOptions)(nil), @@ -516,7 +516,7 @@ var file_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ Field: 51885, Name: "thethings.json.service", Tag: "bytes,51885,opt,name=service", - Filename: "annotations.proto", + Filename: "protoc-gen-go-json/annotations.proto", }, { ExtendedType: (*descriptorpb.MethodOptions)(nil), @@ -524,168 +524,169 @@ var file_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ Field: 51885, Name: "thethings.json.method", Tag: "bytes,51885,opt,name=method", - Filename: "annotations.proto", + Filename: "protoc-gen-go-json/annotations.proto", }, } // Extension fields to descriptorpb.FileOptions. var ( // optional thethings.json.FileOptions file = 51885; - E_File = &file_annotations_proto_extTypes[0] + E_File = &file_protoc_gen_go_json_annotations_proto_extTypes[0] ) // Extension fields to descriptorpb.MessageOptions. var ( // optional thethings.json.MessageOptions message = 51885; - E_Message = &file_annotations_proto_extTypes[1] + E_Message = &file_protoc_gen_go_json_annotations_proto_extTypes[1] ) // Extension fields to descriptorpb.FieldOptions. var ( // optional thethings.json.FieldOptions field = 51885; - E_Field = &file_annotations_proto_extTypes[2] + E_Field = &file_protoc_gen_go_json_annotations_proto_extTypes[2] ) // Extension fields to descriptorpb.OneofOptions. var ( // optional thethings.json.OneofOptions oneof = 51885; - E_Oneof = &file_annotations_proto_extTypes[3] + E_Oneof = &file_protoc_gen_go_json_annotations_proto_extTypes[3] ) // Extension fields to descriptorpb.EnumOptions. var ( // optional thethings.json.EnumOptions enum = 51885; - E_Enum = &file_annotations_proto_extTypes[4] + E_Enum = &file_protoc_gen_go_json_annotations_proto_extTypes[4] ) // Extension fields to descriptorpb.EnumValueOptions. var ( // optional thethings.json.EnumValueOptions enum_value = 51885; - E_EnumValue = &file_annotations_proto_extTypes[5] + E_EnumValue = &file_protoc_gen_go_json_annotations_proto_extTypes[5] ) // Extension fields to descriptorpb.ServiceOptions. var ( // optional thethings.json.ServiceOptions service = 51885; - E_Service = &file_annotations_proto_extTypes[6] + E_Service = &file_protoc_gen_go_json_annotations_proto_extTypes[6] ) // Extension fields to descriptorpb.MethodOptions. var ( // optional thethings.json.MethodOptions method = 51885; - E_Method = &file_annotations_proto_extTypes[7] + E_Method = &file_protoc_gen_go_json_annotations_proto_extTypes[7] ) -var File_annotations_proto protoreflect.FileDescriptor - -var file_annotations_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, - 0x73, 0x6f, 0x6e, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5b, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, - 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6d, 0x61, 0x72, - 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x75, 0x6e, 0x6d, - 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0e, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, - 0x6c, 0x6c, 0x22, 0x6a, 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, - 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, - 0x61, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x22, 0x60, - 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, - 0x0a, 0x0e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x66, 0x75, 0x6e, 0x63, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, - 0x72, 0x46, 0x75, 0x6e, 0x63, 0x12, 0x29, 0x0a, 0x10, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, - 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x46, 0x75, 0x6e, 0x63, - 0x22, 0x0e, 0x0a, 0x0c, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x22, 0xbd, 0x01, 0x0a, 0x0b, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x2a, - 0x0a, 0x11, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x5f, 0x61, 0x73, 0x5f, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6d, 0x61, 0x72, 0x73, 0x68, - 0x61, 0x6c, 0x41, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x61, - 0x72, 0x73, 0x68, 0x61, 0x6c, 0x5f, 0x61, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x41, 0x73, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, - 0x68, 0x61, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x6d, - 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, - 0x69, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, - 0x22, 0x42, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x6c, - 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61, 0x6c, 0x69, - 0x61, 0x73, 0x65, 0x73, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x0f, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x4f, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, - 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x3a, 0x5b, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, - 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x53, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x1d, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x3a, 0x53, 0x0a, 0x05, 0x6f, 0x6e, - 0x65, 0x6f, 0x66, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x68, 0x65, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, - 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x3a, - 0x4f, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x45, - 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, - 0x3a, 0x64, 0x0a, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, - 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x09, 0x65, 0x6e, 0x75, - 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x5b, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x68, 0x65, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x3a, 0x57, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1e, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x42, 0x3f, 0x5a, 0x3d, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, - 0x6e, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, +var File_protoc_gen_go_json_annotations_proto protoreflect.FileDescriptor + +var file_protoc_gen_go_json_annotations_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, + 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5b, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x72, 0x73, 0x68, + 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, + 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x12, 0x27, 0x0a, 0x0f, + 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, + 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x22, 0x6a, 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, + 0x61, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6d, 0x61, 0x72, 0x73, + 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, + 0x61, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x6d, 0x61, + 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, + 0x72, 0x22, 0x60, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x66, + 0x75, 0x6e, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x72, 0x73, 0x68, + 0x61, 0x6c, 0x65, 0x72, 0x46, 0x75, 0x6e, 0x63, 0x12, 0x29, 0x0a, 0x10, 0x75, 0x6e, 0x6d, 0x61, + 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x46, + 0x75, 0x6e, 0x63, 0x22, 0x0e, 0x0a, 0x0c, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x22, 0xbd, 0x01, 0x0a, 0x0b, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, + 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x5f, 0x61, 0x73, 0x5f, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6d, 0x61, + 0x72, 0x73, 0x68, 0x61, 0x6c, 0x41, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2a, 0x0a, + 0x11, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x5f, 0x61, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, + 0x6c, 0x41, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x6e, 0x6d, + 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, + 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x70, + 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, + 0x66, 0x69, 0x78, 0x22, 0x42, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x0f, 0x0a, 0x0d, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x4f, 0x0a, 0x04, 0x66, 0x69, + 0x6c, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x3a, 0x5b, 0x0a, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x53, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x3a, 0x53, 0x0a, + 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4f, + 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x6f, 0x6e, 0x65, + 0x6f, 0x66, 0x3a, 0x4f, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, + 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x04, 0x65, + 0x6e, 0x75, 0x6d, 0x3a, 0x64, 0x0a, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, + 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, + 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x09, + 0x65, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x5b, 0x0a, 0x07, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x57, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x42, + 0x3f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, + 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, + 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, } var ( - file_annotations_proto_rawDescOnce sync.Once - file_annotations_proto_rawDescData = file_annotations_proto_rawDesc + file_protoc_gen_go_json_annotations_proto_rawDescOnce sync.Once + file_protoc_gen_go_json_annotations_proto_rawDescData = file_protoc_gen_go_json_annotations_proto_rawDesc ) -func file_annotations_proto_rawDescGZIP() []byte { - file_annotations_proto_rawDescOnce.Do(func() { - file_annotations_proto_rawDescData = protoimpl.X.CompressGZIP(file_annotations_proto_rawDescData) +func file_protoc_gen_go_json_annotations_proto_rawDescGZIP() []byte { + file_protoc_gen_go_json_annotations_proto_rawDescOnce.Do(func() { + file_protoc_gen_go_json_annotations_proto_rawDescData = protoimpl.X.CompressGZIP(file_protoc_gen_go_json_annotations_proto_rawDescData) }) - return file_annotations_proto_rawDescData + return file_protoc_gen_go_json_annotations_proto_rawDescData } -var file_annotations_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_annotations_proto_goTypes = []interface{}{ +var file_protoc_gen_go_json_annotations_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_protoc_gen_go_json_annotations_proto_goTypes = []interface{}{ (*FileOptions)(nil), // 0: thethings.json.FileOptions (*MessageOptions)(nil), // 1: thethings.json.MessageOptions (*FieldOptions)(nil), // 2: thethings.json.FieldOptions @@ -703,7 +704,7 @@ var file_annotations_proto_goTypes = []interface{}{ (*descriptorpb.ServiceOptions)(nil), // 14: google.protobuf.ServiceOptions (*descriptorpb.MethodOptions)(nil), // 15: google.protobuf.MethodOptions } -var file_annotations_proto_depIdxs = []int32{ +var file_protoc_gen_go_json_annotations_proto_depIdxs = []int32{ 8, // 0: thethings.json.file:extendee -> google.protobuf.FileOptions 9, // 1: thethings.json.message:extendee -> google.protobuf.MessageOptions 10, // 2: thethings.json.field:extendee -> google.protobuf.FieldOptions @@ -727,13 +728,13 @@ var file_annotations_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_annotations_proto_init() } -func file_annotations_proto_init() { - if File_annotations_proto != nil { +func init() { file_protoc_gen_go_json_annotations_proto_init() } +func file_protoc_gen_go_json_annotations_proto_init() { + if File_protoc_gen_go_json_annotations_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_annotations_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_protoc_gen_go_json_annotations_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FileOptions); i { case 0: return &v.state @@ -745,7 +746,7 @@ func file_annotations_proto_init() { return nil } } - file_annotations_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_protoc_gen_go_json_annotations_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MessageOptions); i { case 0: return &v.state @@ -757,7 +758,7 @@ func file_annotations_proto_init() { return nil } } - file_annotations_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_protoc_gen_go_json_annotations_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FieldOptions); i { case 0: return &v.state @@ -769,7 +770,7 @@ func file_annotations_proto_init() { return nil } } - file_annotations_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_protoc_gen_go_json_annotations_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OneofOptions); i { case 0: return &v.state @@ -781,7 +782,7 @@ func file_annotations_proto_init() { return nil } } - file_annotations_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_protoc_gen_go_json_annotations_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumOptions); i { case 0: return &v.state @@ -793,7 +794,7 @@ func file_annotations_proto_init() { return nil } } - file_annotations_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_protoc_gen_go_json_annotations_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumValueOptions); i { case 0: return &v.state @@ -805,7 +806,7 @@ func file_annotations_proto_init() { return nil } } - file_annotations_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_protoc_gen_go_json_annotations_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServiceOptions); i { case 0: return &v.state @@ -817,7 +818,7 @@ func file_annotations_proto_init() { return nil } } - file_annotations_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_protoc_gen_go_json_annotations_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MethodOptions); i { case 0: return &v.state @@ -834,19 +835,19 @@ func file_annotations_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_annotations_proto_rawDesc, + RawDescriptor: file_protoc_gen_go_json_annotations_proto_rawDesc, NumEnums: 0, NumMessages: 8, NumExtensions: 8, NumServices: 0, }, - GoTypes: file_annotations_proto_goTypes, - DependencyIndexes: file_annotations_proto_depIdxs, - MessageInfos: file_annotations_proto_msgTypes, - ExtensionInfos: file_annotations_proto_extTypes, + GoTypes: file_protoc_gen_go_json_annotations_proto_goTypes, + DependencyIndexes: file_protoc_gen_go_json_annotations_proto_depIdxs, + MessageInfos: file_protoc_gen_go_json_annotations_proto_msgTypes, + ExtensionInfos: file_protoc_gen_go_json_annotations_proto_extTypes, }.Build() - File_annotations_proto = out.File - file_annotations_proto_rawDesc = nil - file_annotations_proto_goTypes = nil - file_annotations_proto_depIdxs = nil + File_protoc_gen_go_json_annotations_proto = out.File + file_protoc_gen_go_json_annotations_proto_rawDesc = nil + file_protoc_gen_go_json_annotations_proto_goTypes = nil + file_protoc_gen_go_json_annotations_proto_depIdxs = nil } From debd7a41778c3dd4fa46b2db84137df72d023153 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Mon, 7 Feb 2022 16:07:24 +0100 Subject: [PATCH 18/46] Treat enums with prefix option as having aliases --- internal/gen/enums.go | 10 ++++++++++ internal/gen/enums_unmarshaler.go | 13 ++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/internal/gen/enums.go b/internal/gen/enums.go index 029f84bd..e93f8b08 100644 --- a/internal/gen/enums.go +++ b/internal/gen/enums.go @@ -4,6 +4,8 @@ package gen import ( + "strings" + "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" "google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/proto" @@ -42,6 +44,14 @@ func (*generator) enumHasCustomValues(enum *protogen.Enum) bool { } func (*generator) enumHasCustomAliases(enum *protogen.Enum) bool { + ext, _ := proto.GetExtension(enum.Desc.Options().(*descriptorpb.EnumOptions), annotations.E_Enum).(*annotations.EnumOptions) + prefix := strings.TrimSuffix(ext.GetPrefix(), "_") + "_" + + // The enum has a prefix, so the aliases are the non-prefixed values. + if prefix != "_" { + return true + } + for _, value := range enum.Values { // If the file has the (thethings.json.enum_value) option, and a value is set, or aliases are set, we have custom aliases. opts := value.Desc.Options().(*descriptorpb.EnumValueOptions) diff --git a/internal/gen/enums_unmarshaler.go b/internal/gen/enums_unmarshaler.go index dce545bd..5c2fc79d 100644 --- a/internal/gen/enums_unmarshaler.go +++ b/internal/gen/enums_unmarshaler.go @@ -26,8 +26,7 @@ func (g *generator) enumHasUnmarshaler(enum *protogen.Enum) bool { } } - // NOTE: enumHasCustomAliases already checks if there are custom values, but just in case, we also check it. - if g.enumHasCustomValues(enum) || g.enumHasCustomAliases(enum) { + if g.enumHasCustomAliases(enum) { generateUnmarshaler = true } @@ -49,11 +48,11 @@ func (g *generator) enumHasUnmarshaler(enum *protogen.Enum) bool { func (g *generator) genEnumUnmarshaler(enum *protogen.Enum) { ext, _ := proto.GetExtension(enum.Desc.Options().(*descriptorpb.EnumOptions), annotations.E_Enum).(*annotations.EnumOptions) - - // If the enum has a prefix, or any aliases, we create a map[string]int32 that maps the non-prefixed values and aliases to the number. prefix := strings.TrimSuffix(ext.GetPrefix(), "_") + "_" - hasCustomAliases := g.enumHasCustomAliases(enum) || prefix != "_" - if hasCustomAliases { + + // If the enum has any custom aliases, custom values or a prefix, + // we create a map[string]int32 that maps the custom aliases, custom values and non-prefixed values to the number. + if g.enumHasCustomAliases(enum) { g.P("// ", enum.GoIdent, "_customvalue contains custom string values that extend ", enum.GoIdent, "_value.") g.P("var ", enum.GoIdent, "_customvalue = map[string]int32{") for _, value := range enum.Values { @@ -71,7 +70,7 @@ func (g *generator) genEnumUnmarshaler(enum *protogen.Enum) { g.P("// UnmarshalProtoJSON unmarshals the ", enum.GoIdent, " from JSON.") g.P("func (x *", enum.GoIdent, ") UnmarshalProtoJSON(s *", jsonPluginPackage.Ident("UnmarshalState"), ") {") - if hasCustomAliases { + if g.enumHasCustomAliases(enum) { // We read the enum, passing both the original mapping, and our custom mapping to the unmarshaler. g.P("v := s.ReadEnum(", enum.GoIdent, "_value, ", enum.GoIdent, "_customvalue)") } else { From a2c29094dea2497fdedb3951886537f445c219f7 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 15 Feb 2022 10:01:14 +0100 Subject: [PATCH 19/46] Remove -o from uname command --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a1909461..69b67882 100644 --- a/Makefile +++ b/Makefile @@ -48,10 +48,10 @@ watch: ls annotations.proto cmd/protoc-gen-go-json/*.go internal/gen/*.go test/*.proto | entr make build test OS := -ifeq ($(shell uname -o),Linux) +ifeq ($(shell uname),Linux) OS = linux endif -ifeq ($(shell uname -o),Darwin) +ifeq ($(shell uname),Darwin) OS = osx endif From 4f7c56a230bf9fa25a0423e15a02719e77d2f5d1 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 15 Feb 2022 11:06:19 +0100 Subject: [PATCH 20/46] Add unit tests for TextMarshalers --- test/gogo/enums_test.go | 34 ++++++++++++++++++++++++++++++++++ test/golang/enums_test.go | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/test/gogo/enums_test.go b/test/gogo/enums_test.go index 9dbf8b72..d31a1eb3 100644 --- a/test/gogo/enums_test.go +++ b/test/gogo/enums_test.go @@ -1,6 +1,7 @@ package test_test import ( + "fmt" "testing" . "github.com/TheThingsIndustries/protoc-gen-go-json/test/gogo" @@ -170,3 +171,36 @@ func TestUnmarshalMessageWithOneofEnums(t *testing.T) { }) } } + +func TestCustomEnum_TextMarshalers(t *testing.T) { + for _, tt := range []struct { + enum CustomEnum + values []string + }{ + {CustomEnum_CUSTOM_UNKNOWN, []string{"CUSTOM_UNKNOWN", "UNKNOWN", "0"}}, + {CustomEnum_CUSTOM_V1_0, []string{"1.0", "1.0.0", "CUSTOM_V1_0", "V1_0", "1"}}, + {CustomEnum_CUSTOM_V1_0_1, []string{"1.0.1", "CUSTOM_V1_0_1", "V1_0_1", "2"}}, + } { + t.Run(fmt.Sprintf("MarshalText_%s", tt.enum), func(t *testing.T) { + txt, err := tt.enum.MarshalText() + if err != nil { + t.Fatal(err) + } + if string(txt) != tt.values[0] { + t.Errorf("expected: %s, got: %s", tt.values[0], string(txt)) + } + }) + t.Run(fmt.Sprintf("UnmarshalText_%s", tt.enum), func(t *testing.T) { + for _, value := range tt.values { + var enum CustomEnum + err := enum.UnmarshalText([]byte(value)) + if err != nil { + t.Fatal(err) + } + if enum != tt.enum { + t.Errorf("expected %q to unmarshal as %s, got: %s", value, tt.enum, enum) + } + } + }) + } +} diff --git a/test/golang/enums_test.go b/test/golang/enums_test.go index 82206e68..5323f0af 100644 --- a/test/golang/enums_test.go +++ b/test/golang/enums_test.go @@ -1,6 +1,7 @@ package test_test import ( + "fmt" "testing" . "github.com/TheThingsIndustries/protoc-gen-go-json/test/golang" @@ -170,3 +171,36 @@ func TestUnmarshalMessageWithOneofEnums(t *testing.T) { }) } } + +func TestCustomEnum_TextMarshalers(t *testing.T) { + for _, tt := range []struct { + enum CustomEnum + values []string + }{ + {CustomEnum_CUSTOM_UNKNOWN, []string{"CUSTOM_UNKNOWN", "UNKNOWN", "0"}}, + {CustomEnum_CUSTOM_V1_0, []string{"1.0", "1.0.0", "CUSTOM_V1_0", "V1_0", "1"}}, + {CustomEnum_CUSTOM_V1_0_1, []string{"1.0.1", "CUSTOM_V1_0_1", "V1_0_1", "2"}}, + } { + t.Run(fmt.Sprintf("MarshalText_%s", tt.enum), func(t *testing.T) { + txt, err := tt.enum.MarshalText() + if err != nil { + t.Fatal(err) + } + if string(txt) != tt.values[0] { + t.Errorf("expected: %s, got: %s", tt.values[0], string(txt)) + } + }) + t.Run(fmt.Sprintf("UnmarshalText_%s", tt.enum), func(t *testing.T) { + for _, value := range tt.values { + var enum CustomEnum + err := enum.UnmarshalText([]byte(value)) + if err != nil { + t.Fatal(err) + } + if enum != tt.enum { + t.Errorf("expected %q to unmarshal as %s, got: %s", value, tt.enum, enum) + } + } + }) + } +} From c6fcf35415086f41384a7af7b18be5f21893216d Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 1 Mar 2022 12:46:21 +0100 Subject: [PATCH 21/46] Add issue triage workflow --- .github/workflows/issue-triage.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/issue-triage.yml diff --git a/.github/workflows/issue-triage.yml b/.github/workflows/issue-triage.yml new file mode 100644 index 00000000..a4b3ee78 --- /dev/null +++ b/.github/workflows/issue-triage.yml @@ -0,0 +1,24 @@ +name: Triage New Issues +on: + issues: + types: [opened] + pull_request_target: + types: [opened] + +jobs: + triage: + name: Triage New Issues + runs-on: ubuntu-20.04 + timeout-minutes: 5 + steps: + - name: Add "needs/triage" label + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: ['needs/triage'] + }) From a8618d8c71c5af6acf8e9593a75f5b8a1600b692 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 1 Mar 2022 12:47:01 +0100 Subject: [PATCH 22/46] Add Go code workflow --- .github/workflows/go-code.yml | 29 +++++++++++++++++++++++++++++ Makefile | 9 ++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/go-code.yml diff --git a/.github/workflows/go-code.yml b/.github/workflows/go-code.yml new file mode 100644 index 00000000..fa2487cb --- /dev/null +++ b/.github/workflows/go-code.yml @@ -0,0 +1,29 @@ +name: Go Code + +on: + - push + - pull_request + +jobs: + test: + name: Go Test + runs-on: ubuntu-20.04 + timeout-minutes: 10 + steps: + - name: Check out code + uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: "~1.17" + - name: Initialize Go module cache + uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: go-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + go-mod-${{ runner.os }}- + - name: Clean Build + run: make clean build + - name: Go Test + run: make test diff --git a/Makefile b/Makefile index 69b67882..7c683228 100644 --- a/Makefile +++ b/Makefile @@ -15,10 +15,10 @@ clean: mkdir -p $(shell dirname $@) cp $< $@ -annotations/annotations.pb.go: .dev/protoc-gen-go-json/annotations.proto +annotations/annotations.pb.go: .dev/protoc-gen-go-json/annotations.proto .dev/golangproto/bin/protoc .dev/golangproto/bin/protoc-gen-go PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I .dev --go_opt=module=github.com/TheThingsIndustries/protoc-gen-go-json --go_out=./ $< -internal/gogoproto/gogo.pb.go: internal/gogoproto/gogo.proto +internal/gogoproto/gogo.pb.go: internal/gogoproto/gogo.proto .dev/golangproto/bin/protoc .dev/golangproto/bin/protoc-gen-go PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I . --go_opt=paths=source_relative --go_out=./ ./internal/gogoproto/gogo.proto BINARY_DEPS = annotations/annotations.pb.go internal/gogoproto/gogo.pb.go $(wildcard cmd/protoc-gen-go-json/*.go) $(wildcard internal/gen/*.go) @@ -68,12 +68,15 @@ endif unzip -o .dev/gogoproto/gogoproto.zip protobuf-master/protobuf/google/protobuf/*.proto -d .dev/gogoproto mv .dev/gogoproto/protobuf-master/protobuf/google/protobuf/*.proto .dev/gogoproto/include/google/protobuf/ +.dev/golangproto/bin/protoc-gen-go: + go build -o $@ google.golang.org/protobuf/cmd/protoc-gen-go + .dev/gogoproto/bin/protoc-gen-gogo: go build -o $@ github.com/gogo/protobuf/protoc-gen-gogo .PHONY: testprotos -testprotos: build .dev/golangproto/bin/protoc .dev/gogoproto/bin/protoc .dev/gogoproto/bin/protoc-gen-gogo +testprotos: build .dev/golangproto/bin/protoc .dev/gogoproto/bin/protoc .dev/golangproto/bin/protoc-gen-go .dev/gogoproto/bin/protoc-gen-gogo PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I ./test -I . \ --go_opt=paths=source_relative --go_out=./test/golang \ --go-json_opt=paths=source_relative --go-json_opt=std=true --go-json_out=./test/golang \ From ffd641b58d9f8054606e61ad51dc1c08c74c9451 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 1 Mar 2022 13:03:26 +0100 Subject: [PATCH 23/46] Add dependabot configuration --- .github/dependabot.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..00fd7697 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: "/" + labels: [dependencies] + schedule: + interval: monthly + - package-ecosystem: gomod + directory: "/" + labels: [dependencies] + schedule: + interval: monthly From 0abce9d1f1efc5bf19266d9eddf11fa53017e567 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 1 Mar 2022 13:03:38 +0100 Subject: [PATCH 24/46] Upgrade Go dependencies --- go.mod | 9 +++++++-- go.sum | 11 ++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index db6e9ba6..4432fe95 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,15 @@ module github.com/TheThingsIndustries/protoc-gen-go-json -go 1.16 +go 1.17 require ( github.com/gogo/protobuf v1.3.2 github.com/google/go-cmp v0.5.6 - github.com/json-iterator/go v1.1.11 + github.com/json-iterator/go v1.1.12 google.golang.org/protobuf v1.27.1 ) + +require ( + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect +) diff --git a/go.sum b/go.sum index 23840b3a..f3ab0247 100644 --- a/go.sum +++ b/go.sum @@ -8,14 +8,15 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= From c39f7ddebace16409b8782625f9c1c92cdae5aa9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Mar 2022 13:10:35 +0100 Subject: [PATCH 25/46] Bump github.com/google/go-cmp from 0.5.6 to 0.5.7 (#9) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4432fe95..3e36eeb2 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( github.com/gogo/protobuf v1.3.2 - github.com/google/go-cmp v0.5.6 + github.com/google/go-cmp v0.5.7 github.com/json-iterator/go v1.1.12 google.golang.org/protobuf v1.27.1 ) diff --git a/go.sum b/go.sum index f3ab0247..8a629791 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= From 2bcc93409b7ef6a6feda41c46d419ed420114d03 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Tue, 3 May 2022 15:02:48 +0200 Subject: [PATCH 26/46] Generate pointer receiver for MarshalJSON --- internal/gen/messages_marshaler.go | 4 ++-- test/gogo/enums_json.pb.go | 12 ++++++------ test/gogo/gogo_json.pb.go | 20 ++++++++++---------- test/gogo/scalars_json.pb.go | 12 ++++++------ test/gogo/wkts_json.pb.go | 16 ++++++++-------- test/golang/enums_json.pb.go | 12 ++++++------ test/golang/gogo_json.pb.go | 20 ++++++++++---------- test/golang/scalars_json.pb.go | 12 ++++++------ test/golang/wkts_json.pb.go | 16 ++++++++-------- 9 files changed, 62 insertions(+), 62 deletions(-) diff --git a/internal/gen/messages_marshaler.go b/internal/gen/messages_marshaler.go index b5fc5ed6..de3d740e 100644 --- a/internal/gen/messages_marshaler.go +++ b/internal/gen/messages_marshaler.go @@ -422,8 +422,8 @@ nextField: func (g *generator) genStdMessageMarshaler(message *protogen.Message) { g.P("// MarshalJSON marshals the ", message.GoIdent, " to JSON.") - g.P("func (x ", message.GoIdent, ") MarshalJSON() ([]byte, error) {") - g.P("return ", jsonPluginPackage.Ident("DefaultMarshalerConfig"), ".Marshal(&x)") + g.P("func (x *", message.GoIdent, ") MarshalJSON() ([]byte, error) {") + g.P("return ", jsonPluginPackage.Ident("DefaultMarshalerConfig"), ".Marshal(x)") g.P("}") g.P() } diff --git a/test/gogo/enums_json.pb.go b/test/gogo/enums_json.pb.go index ac673652..f024d439 100644 --- a/test/gogo/enums_json.pb.go +++ b/test/gogo/enums_json.pb.go @@ -77,8 +77,8 @@ func (x *CustomEnumValue) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the CustomEnumValue to JSON. -func (x CustomEnumValue) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *CustomEnumValue) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the CustomEnumValue message from JSON. @@ -155,8 +155,8 @@ func (x *MessageWithEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithEnums to JSON. -func (x MessageWithEnums) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithEnums) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithEnums message from JSON. @@ -257,8 +257,8 @@ func (x *MessageWithOneofEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithOneofEnums to JSON. -func (x MessageWithOneofEnums) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithOneofEnums) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithOneofEnums message from JSON. diff --git a/test/gogo/gogo_json.pb.go b/test/gogo/gogo_json.pb.go index c5b033bb..425b2c73 100644 --- a/test/gogo/gogo_json.pb.go +++ b/test/gogo/gogo_json.pb.go @@ -78,8 +78,8 @@ func (x *MessageWithGoGoOptions) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithGoGoOptions to JSON. -func (x MessageWithGoGoOptions) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithGoGoOptions) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithGoGoOptions message from JSON. @@ -178,8 +178,8 @@ func (x *SubMessage) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the SubMessage to JSON. -func (x SubMessage) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *SubMessage) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the SubMessage message from JSON. @@ -249,8 +249,8 @@ func (x *MessageWithNullable) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithNullable to JSON. -func (x MessageWithNullable) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithNullable) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithNullable message from JSON. @@ -328,8 +328,8 @@ func (x *MessageWithEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithEmbedded to JSON. -func (x MessageWithEmbedded) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithEmbedded) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithEmbedded message from JSON. @@ -390,8 +390,8 @@ func (x *MessageWithNullableEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalStat } // MarshalJSON marshals the MessageWithNullableEmbedded to JSON. -func (x MessageWithNullableEmbedded) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithNullableEmbedded) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithNullableEmbedded message from JSON. diff --git a/test/gogo/scalars_json.pb.go b/test/gogo/scalars_json.pb.go index deb8d8aa..0556ba9e 100644 --- a/test/gogo/scalars_json.pb.go +++ b/test/gogo/scalars_json.pb.go @@ -183,8 +183,8 @@ func (x *MessageWithScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithScalars to JSON. -func (x MessageWithScalars) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithScalars) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithScalars message from JSON. @@ -445,8 +445,8 @@ func (x *MessageWithOneofScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithOneofScalars to JSON. -func (x MessageWithOneofScalars) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithOneofScalars) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithOneofScalars message from JSON. @@ -876,8 +876,8 @@ func (x *MessageWithScalarMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithScalarMaps to JSON. -func (x MessageWithScalarMaps) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithScalarMaps) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithScalarMaps message from JSON. diff --git a/test/gogo/wkts_json.pb.go b/test/gogo/wkts_json.pb.go index 55ab4d4b..ed80e4ee 100644 --- a/test/gogo/wkts_json.pb.go +++ b/test/gogo/wkts_json.pb.go @@ -29,8 +29,8 @@ func (x *MessageWithMarshaler) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithMarshaler to JSON. -func (x MessageWithMarshaler) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithMarshaler) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithMarshaler message from JSON. @@ -474,8 +474,8 @@ func (x *MessageWithWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithWKTs to JSON. -func (x MessageWithWKTs) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithWKTs) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithWKTs message from JSON. @@ -1092,8 +1092,8 @@ func (x *MessageWithOneofWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithOneofWKTs to JSON. -func (x MessageWithOneofWKTs) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithOneofWKTs) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithOneofWKTs message from JSON. @@ -1619,8 +1619,8 @@ func (x *MessageWithWKTMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithWKTMaps to JSON. -func (x MessageWithWKTMaps) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithWKTMaps) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithWKTMaps message from JSON. diff --git a/test/golang/enums_json.pb.go b/test/golang/enums_json.pb.go index 3a33f595..86c0712a 100644 --- a/test/golang/enums_json.pb.go +++ b/test/golang/enums_json.pb.go @@ -77,8 +77,8 @@ func (x *CustomEnumValue) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the CustomEnumValue to JSON. -func (x CustomEnumValue) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *CustomEnumValue) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the CustomEnumValue message from JSON. @@ -155,8 +155,8 @@ func (x *MessageWithEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithEnums to JSON. -func (x MessageWithEnums) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithEnums) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithEnums message from JSON. @@ -257,8 +257,8 @@ func (x *MessageWithOneofEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithOneofEnums to JSON. -func (x MessageWithOneofEnums) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithOneofEnums) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithOneofEnums message from JSON. diff --git a/test/golang/gogo_json.pb.go b/test/golang/gogo_json.pb.go index 7419e3c6..0fb76464 100644 --- a/test/golang/gogo_json.pb.go +++ b/test/golang/gogo_json.pb.go @@ -80,8 +80,8 @@ func (x *MessageWithGoGoOptions) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithGoGoOptions to JSON. -func (x MessageWithGoGoOptions) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithGoGoOptions) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithGoGoOptions message from JSON. @@ -179,8 +179,8 @@ func (x *SubMessage) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the SubMessage to JSON. -func (x SubMessage) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *SubMessage) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the SubMessage message from JSON. @@ -250,8 +250,8 @@ func (x *MessageWithNullable) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithNullable to JSON. -func (x MessageWithNullable) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithNullable) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithNullable message from JSON. @@ -342,8 +342,8 @@ func (x *MessageWithEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithEmbedded to JSON. -func (x MessageWithEmbedded) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithEmbedded) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithEmbedded message from JSON. @@ -404,8 +404,8 @@ func (x *MessageWithNullableEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalStat } // MarshalJSON marshals the MessageWithNullableEmbedded to JSON. -func (x MessageWithNullableEmbedded) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithNullableEmbedded) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithNullableEmbedded message from JSON. diff --git a/test/golang/scalars_json.pb.go b/test/golang/scalars_json.pb.go index 5b57f707..59f2bece 100644 --- a/test/golang/scalars_json.pb.go +++ b/test/golang/scalars_json.pb.go @@ -183,8 +183,8 @@ func (x *MessageWithScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithScalars to JSON. -func (x MessageWithScalars) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithScalars) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithScalars message from JSON. @@ -445,8 +445,8 @@ func (x *MessageWithOneofScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithOneofScalars to JSON. -func (x MessageWithOneofScalars) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithOneofScalars) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithOneofScalars message from JSON. @@ -876,8 +876,8 @@ func (x *MessageWithScalarMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithScalarMaps to JSON. -func (x MessageWithScalarMaps) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithScalarMaps) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithScalarMaps message from JSON. diff --git a/test/golang/wkts_json.pb.go b/test/golang/wkts_json.pb.go index f0d1ec09..c88a4224 100644 --- a/test/golang/wkts_json.pb.go +++ b/test/golang/wkts_json.pb.go @@ -35,8 +35,8 @@ func (x *MessageWithMarshaler) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithMarshaler to JSON. -func (x MessageWithMarshaler) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithMarshaler) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithMarshaler message from JSON. @@ -480,8 +480,8 @@ func (x *MessageWithWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithWKTs to JSON. -func (x MessageWithWKTs) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithWKTs) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithWKTs message from JSON. @@ -1098,8 +1098,8 @@ func (x *MessageWithOneofWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithOneofWKTs to JSON. -func (x MessageWithOneofWKTs) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithOneofWKTs) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithOneofWKTs message from JSON. @@ -1625,8 +1625,8 @@ func (x *MessageWithWKTMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { } // MarshalJSON marshals the MessageWithWKTMaps to JSON. -func (x MessageWithWKTMaps) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(&x) +func (x *MessageWithWKTMaps) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) } // UnmarshalProtoJSON unmarshals the MessageWithWKTMaps message from JSON. From 3e2bade60250df2d9900419844fc047373ccfa2e Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Fri, 6 May 2022 16:29:29 +0200 Subject: [PATCH 27/46] Add stack contributors as reviewers on dependency updates --- .github/dependabot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 00fd7697..c88d431f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,10 +3,12 @@ updates: - package-ecosystem: github-actions directory: "/" labels: [dependencies] + reviewers: [TheThingsIndustries/stack-contributors] schedule: interval: monthly - package-ecosystem: gomod directory: "/" labels: [dependencies] + reviewers: [TheThingsIndustries/stack-contributors] schedule: interval: monthly From a83588e4177369fac70ba0b068945df735a1a050 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Fri, 6 May 2022 16:29:30 +0200 Subject: [PATCH 28/46] Update Go dependencies --- go.mod | 4 ++-- go.sum | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 3e36eeb2..2fd205c9 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ go 1.17 require ( github.com/gogo/protobuf v1.3.2 - github.com/google/go-cmp v0.5.7 + github.com/google/go-cmp v0.5.8 github.com/json-iterator/go v1.1.12 - google.golang.org/protobuf v1.27.1 + google.golang.org/protobuf v1.28.0 ) require ( diff --git a/go.sum b/go.sum index 8a629791..c3bc659c 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= @@ -48,8 +48,7 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= From 8414e03eca1d48b2854934c059388ebe6c954862 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Fri, 6 May 2022 16:29:31 +0200 Subject: [PATCH 29/46] Update GitHub Actions dependencies --- .github/workflows/go-code.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go-code.yml b/.github/workflows/go-code.yml index fa2487cb..36c655e4 100644 --- a/.github/workflows/go-code.yml +++ b/.github/workflows/go-code.yml @@ -11,13 +11,13 @@ jobs: timeout-minutes: 10 steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Go uses: actions/setup-go@v3 with: go-version: "~1.17" - name: Initialize Go module cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/go/pkg/mod key: go-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }} From 397b2d662cf3cf90e5332e140f1a9c65d86ad198 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Fri, 6 May 2022 16:29:32 +0200 Subject: [PATCH 30/46] Upgrade protoc --- Makefile | 2 +- annotations/annotations.pb.go | 4 ++-- internal/gogoproto/gogo.pb.go | 4 ++-- test/golang/api.pb.go | 4 ++-- test/golang/enums.pb.go | 4 ++-- test/golang/enums_json.pb.go | 2 +- test/golang/gogo.pb.go | 4 ++-- test/golang/gogo_json.pb.go | 2 +- test/golang/scalars.pb.go | 4 ++-- test/golang/scalars_json.pb.go | 2 +- test/golang/wkts.pb.go | 4 ++-- test/golang/wkts_json.pb.go | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 7c683228..4318376e 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ endif .dev/golangproto/bin/protoc: mkdir -p .dev/golangproto/bin - curl -sSL -o .dev/golangproto/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protoc-3.17.3-$(OS)-x86_64.zip + curl -sSL -o .dev/golangproto/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.20.1/protoc-3.20.1-$(OS)-x86_64.zip unzip -o .dev/golangproto/protoc.zip -d .dev/golangproto/ .dev/gogoproto/bin/protoc: diff --git a/annotations/annotations.pb.go b/annotations/annotations.pb.go index 287a4130..90e09e67 100644 --- a/annotations/annotations.pb.go +++ b/annotations/annotations.pb.go @@ -3,8 +3,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v3.17.3 +// protoc-gen-go v1.28.0 +// protoc v3.20.1 // source: protoc-gen-go-json/annotations.proto package annotations diff --git a/internal/gogoproto/gogo.pb.go b/internal/gogoproto/gogo.pb.go index 6a013ef2..a1cb1981 100644 --- a/internal/gogoproto/gogo.pb.go +++ b/internal/gogoproto/gogo.pb.go @@ -28,8 +28,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v3.17.3 +// protoc-gen-go v1.28.0 +// protoc v3.20.1 // source: internal/gogoproto/gogo.proto package gogoproto diff --git a/test/golang/api.pb.go b/test/golang/api.pb.go index 374befb4..d467f927 100644 --- a/test/golang/api.pb.go +++ b/test/golang/api.pb.go @@ -3,8 +3,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v3.17.3 +// protoc-gen-go v1.28.0 +// protoc v3.20.1 // source: api.proto package test diff --git a/test/golang/enums.pb.go b/test/golang/enums.pb.go index 91631bf9..543b8386 100644 --- a/test/golang/enums.pb.go +++ b/test/golang/enums.pb.go @@ -3,8 +3,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v3.17.3 +// protoc-gen-go v1.28.0 +// protoc v3.20.1 // source: enums.proto package test diff --git a/test/golang/enums_json.pb.go b/test/golang/enums_json.pb.go index 86c0712a..9e3b80e0 100644 --- a/test/golang/enums_json.pb.go +++ b/test/golang/enums_json.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-json. DO NOT EDIT. // versions: // - protoc-gen-go-json v0.0.0-dev -// - protoc v3.17.3 +// - protoc v3.20.1 // source: enums.proto package test diff --git a/test/golang/gogo.pb.go b/test/golang/gogo.pb.go index aa20c3f4..b6e3c807 100644 --- a/test/golang/gogo.pb.go +++ b/test/golang/gogo.pb.go @@ -3,8 +3,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v3.17.3 +// protoc-gen-go v1.28.0 +// protoc v3.20.1 // source: gogo.proto package test diff --git a/test/golang/gogo_json.pb.go b/test/golang/gogo_json.pb.go index 0fb76464..ab10824f 100644 --- a/test/golang/gogo_json.pb.go +++ b/test/golang/gogo_json.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-json. DO NOT EDIT. // versions: // - protoc-gen-go-json v0.0.0-dev -// - protoc v3.17.3 +// - protoc v3.20.1 // source: gogo.proto package test diff --git a/test/golang/scalars.pb.go b/test/golang/scalars.pb.go index 6b84c286..d7280f5a 100644 --- a/test/golang/scalars.pb.go +++ b/test/golang/scalars.pb.go @@ -3,8 +3,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v3.17.3 +// protoc-gen-go v1.28.0 +// protoc v3.20.1 // source: scalars.proto package test diff --git a/test/golang/scalars_json.pb.go b/test/golang/scalars_json.pb.go index 59f2bece..b59509f2 100644 --- a/test/golang/scalars_json.pb.go +++ b/test/golang/scalars_json.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-json. DO NOT EDIT. // versions: // - protoc-gen-go-json v0.0.0-dev -// - protoc v3.17.3 +// - protoc v3.20.1 // source: scalars.proto package test diff --git a/test/golang/wkts.pb.go b/test/golang/wkts.pb.go index 01bd1185..210a8980 100644 --- a/test/golang/wkts.pb.go +++ b/test/golang/wkts.pb.go @@ -3,8 +3,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v3.17.3 +// protoc-gen-go v1.28.0 +// protoc v3.20.1 // source: wkts.proto package test diff --git a/test/golang/wkts_json.pb.go b/test/golang/wkts_json.pb.go index c88a4224..ef4b639e 100644 --- a/test/golang/wkts_json.pb.go +++ b/test/golang/wkts_json.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-json. DO NOT EDIT. // versions: // - protoc-gen-go-json v0.0.0-dev -// - protoc v3.17.3 +// - protoc v3.20.1 // source: wkts.proto package test From 168fc5db7f96b45ded12028bd8833af084b2b0e7 Mon Sep 17 00:00:00 2001 From: Hylke Visser Date: Wed, 13 Jul 2022 15:34:06 +0200 Subject: [PATCH 31/46] Support object notation for WKT wrappers (#15) --- internal/gen/messages_unmarshaler.go | 18 +-- jsonplugin/unmarshal.go | 180 +++++++++++++++++++++++++++ test/gogo/wkts_json.pb.go | 72 +++++------ test/gogo/wkts_test.go | 107 +++++++++++++++- test/golang/wkts_json.pb.go | 72 +++++------ test/golang/wkts_test.go | 107 +++++++++++++++- 6 files changed, 467 insertions(+), 89 deletions(-) diff --git a/internal/gen/messages_unmarshaler.go b/internal/gen/messages_unmarshaler.go index 4bae1546..7d5523bf 100644 --- a/internal/gen/messages_unmarshaler.go +++ b/internal/gen/messages_unmarshaler.go @@ -437,23 +437,23 @@ func (g *generator) genStdMessageUnmarshaler(message *protogen.Message) { func (g *generator) readWrapperValue(message *protogen.Message) string { switch message.Desc.FullName() { case "google.protobuf.DoubleValue": - return "s.ReadFloat64()" + return "s.ReadWrappedFloat64()" case "google.protobuf.FloatValue": - return "s.ReadFloat32()" + return "s.ReadWrappedFloat32()" case "google.protobuf.Int64Value": - return "s.ReadInt64()" + return "s.ReadWrappedInt64()" case "google.protobuf.UInt64Value": - return "s.ReadUint64()" + return "s.ReadWrappedUint64()" case "google.protobuf.Int32Value": - return "s.ReadInt32()" + return "s.ReadWrappedInt32()" case "google.protobuf.UInt32Value": - return "s.ReadUint32()" + return "s.ReadWrappedUint32()" case "google.protobuf.BoolValue": - return "s.ReadBool()" + return "s.ReadWrappedBool()" case "google.protobuf.StringValue": - return "s.ReadString()" + return "s.ReadWrappedString()" case "google.protobuf.BytesValue": - return "s.ReadBytes()" + return "s.ReadWrappedBytes()" default: g.gen.Error(fmt.Errorf("unsupported wrapper %q", message.Desc.FullName())) return "" diff --git a/jsonplugin/unmarshal.go b/jsonplugin/unmarshal.go index 2319c589..d0bd137d 100644 --- a/jsonplugin/unmarshal.go +++ b/jsonplugin/unmarshal.go @@ -156,6 +156,26 @@ func (s *UnmarshalState) ReadFloat32() float32 { } } +// ReadWrappedFloat32 reads a wrapped float32 value. This also supports string encoding as well as {"value": ...}. +func (s *UnmarshalState) ReadWrappedFloat32() float32 { + if s.Err() != nil { + return 0 + } + if s.inner.WhatIsNext() != jsoniter.ObjectValue { + return s.ReadFloat32() + } + if key := s.ReadObjectField(); key != "value" { + s.SetErrorf("first field in wrapped float32 is not value, but %q", key) + return 0 + } + v := s.ReadFloat32() + if field := s.ReadObjectField(); field != "" { + s.SetErrorf("unexpected %q field in wrapped float32", field) + return 0 + } + return v +} + // ReadFloat64 reads a float64 value. This also supports string encoding. func (s *UnmarshalState) ReadFloat64() float64 { if s.Err() != nil { @@ -177,6 +197,26 @@ func (s *UnmarshalState) ReadFloat64() float64 { } } +// ReadWrappedFloat64 reads a wrapped float64 value. This also supports string encoding as well as {"value": ...}. +func (s *UnmarshalState) ReadWrappedFloat64() float64 { + if s.Err() != nil { + return 0 + } + if s.inner.WhatIsNext() != jsoniter.ObjectValue { + return s.ReadFloat64() + } + if key := s.ReadObjectField(); key != "value" { + s.SetErrorf("first field in wrapped float64 is not value, but %q", key) + return 0 + } + v := s.ReadFloat64() + if field := s.ReadObjectField(); field != "" { + s.SetErrorf("unexpected %q field in wrapped float64", field) + return 0 + } + return v +} + // ReadFloat32Array reads an array of float32 values. func (s *UnmarshalState) ReadFloat32Array() []float32 { var arr []float32 @@ -230,6 +270,26 @@ func (s *UnmarshalState) ReadInt32() int32 { } } +// ReadWrappedInt32 reads a wrapped int32 value. This also supports string encoding as well as {"value": ...}. +func (s *UnmarshalState) ReadWrappedInt32() int32 { + if s.Err() != nil { + return 0 + } + if s.inner.WhatIsNext() != jsoniter.ObjectValue { + return s.ReadInt32() + } + if key := s.ReadObjectField(); key != "value" { + s.SetErrorf("first field in wrapped int32 is not value, but %q", key) + return 0 + } + v := s.ReadInt32() + if field := s.ReadObjectField(); field != "" { + s.SetErrorf("unexpected %q field in wrapped int32", field) + return 0 + } + return v +} + // ReadInt64 reads a int64 value. This also supports string encoding. func (s *UnmarshalState) ReadInt64() int64 { if s.Err() != nil { @@ -251,6 +311,26 @@ func (s *UnmarshalState) ReadInt64() int64 { } } +// ReadWrappedInt64 reads a wrapped int64 value. This also supports string encoding as well as {"value": ...}. +func (s *UnmarshalState) ReadWrappedInt64() int64 { + if s.Err() != nil { + return 0 + } + if s.inner.WhatIsNext() != jsoniter.ObjectValue { + return s.ReadInt64() + } + if key := s.ReadObjectField(); key != "value" { + s.SetErrorf("first field in wrapped int64 is not value, but %q", key) + return 0 + } + v := s.ReadInt64() + if field := s.ReadObjectField(); field != "" { + s.SetErrorf("unexpected %q field in wrapped int64", field) + return 0 + } + return v +} + // ReadInt32Array reads an array of int32 values. func (s *UnmarshalState) ReadInt32Array() []int32 { var arr []int32 @@ -304,6 +384,26 @@ func (s *UnmarshalState) ReadUint32() uint32 { } } +// ReadWrappedUint32 reads a wrapped uint32 value. This also supports string encoding as well as {"value": ...}. +func (s *UnmarshalState) ReadWrappedUint32() uint32 { + if s.Err() != nil { + return 0 + } + if s.inner.WhatIsNext() != jsoniter.ObjectValue { + return s.ReadUint32() + } + if key := s.ReadObjectField(); key != "value" { + s.SetErrorf("first field in wrapped uint32 is not value, but %q", key) + return 0 + } + v := s.ReadUint32() + if field := s.ReadObjectField(); field != "" { + s.SetErrorf("unexpected %q field in wrapped uint32", field) + return 0 + } + return v +} + // ReadUint64 reads a uint64 value. This also supports string encoding. func (s *UnmarshalState) ReadUint64() uint64 { if s.Err() != nil { @@ -325,6 +425,26 @@ func (s *UnmarshalState) ReadUint64() uint64 { } } +// ReadWrappedUint64 reads a wrapped uint64 value. This also supports string encoding as well as {"value": ...}. +func (s *UnmarshalState) ReadWrappedUint64() uint64 { + if s.Err() != nil { + return 0 + } + if s.inner.WhatIsNext() != jsoniter.ObjectValue { + return s.ReadUint64() + } + if key := s.ReadObjectField(); key != "value" { + s.SetErrorf("first field in wrapped uint64 is not value, but %q", key) + return 0 + } + v := s.ReadUint64() + if field := s.ReadObjectField(); field != "" { + s.SetErrorf("unexpected %q field in wrapped uint64", field) + return 0 + } + return v +} + // ReadUint32Array reads an array of uint32 values. func (s *UnmarshalState) ReadUint32Array() []uint32 { var arr []uint32 @@ -365,6 +485,26 @@ func (s *UnmarshalState) ReadBool() bool { return s.inner.ReadBool() } +// ReadWrappedBool reads a wrapped bool value. This also supports {"value": ...}. +func (s *UnmarshalState) ReadWrappedBool() bool { + if s.Err() != nil { + return false + } + if s.inner.WhatIsNext() != jsoniter.ObjectValue { + return s.ReadBool() + } + if key := s.ReadObjectField(); key != "value" { + s.SetErrorf("first field in wrapped bool is not value, but %q", key) + return false + } + v := s.ReadBool() + if field := s.ReadObjectField(); field != "" { + s.SetErrorf("unexpected %q field in wrapped bool", field) + return false + } + return v +} + // ReadBoolArray reads an array of bool values. func (s *UnmarshalState) ReadBoolArray() []bool { var arr []bool @@ -389,6 +529,26 @@ func (s *UnmarshalState) ReadString() string { return s.inner.ReadString() } +// ReadWrappedString reads a wrapped string value. This also supports {"value": ...}. +func (s *UnmarshalState) ReadWrappedString() string { + if s.Err() != nil { + return "" + } + if s.inner.WhatIsNext() != jsoniter.ObjectValue { + return s.ReadString() + } + if key := s.ReadObjectField(); key != "value" { + s.SetErrorf("first field in wrapped string is not value, but %q", key) + return "" + } + v := s.ReadString() + if field := s.ReadObjectField(); field != "" { + s.SetErrorf("unexpected %q field in wrapped string", field) + return "" + } + return v +} + // ReadStringArray reads an array of string values. func (s *UnmarshalState) ReadStringArray() []string { var arr []string @@ -429,6 +589,26 @@ func (s *UnmarshalState) ReadBytes() []byte { return v } +// ReadWrappedBytes reads a wrapped bytes value. This also supports {"value": ...}. +func (s *UnmarshalState) ReadWrappedBytes() []byte { + if s.Err() != nil { + return nil + } + if s.inner.WhatIsNext() != jsoniter.ObjectValue { + return s.ReadBytes() + } + if key := s.ReadObjectField(); key != "value" { + s.SetErrorf("first field in wrapped bytes is not value, but %q", key) + return nil + } + v := s.ReadBytes() + if field := s.ReadObjectField(); field != "" { + s.SetErrorf("unexpected %q field in wrapped bytes", field) + return nil + } + return v +} + // ReadBytesArray reads an array of []byte values. func (s *UnmarshalState) ReadBytesArray() [][]byte { if s.Err() != nil { diff --git a/test/gogo/wkts_json.pb.go b/test/gogo/wkts_json.pb.go index ed80e4ee..26361ed8 100644 --- a/test/gogo/wkts_json.pb.go +++ b/test/gogo/wkts_json.pb.go @@ -493,7 +493,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.DoubleValue = nil return } - v := s.ReadFloat64() + v := s.ReadWrappedFloat64() if s.Err() != nil { return } @@ -509,7 +509,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.DoubleValues = append(x.DoubleValues, nil) return } - v := s.ReadFloat64() + v := s.ReadWrappedFloat64() if s.Err() != nil { return } @@ -521,7 +521,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.FloatValue = nil return } - v := s.ReadFloat32() + v := s.ReadWrappedFloat32() if s.Err() != nil { return } @@ -537,7 +537,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.FloatValues = append(x.FloatValues, nil) return } - v := s.ReadFloat32() + v := s.ReadWrappedFloat32() if s.Err() != nil { return } @@ -549,7 +549,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Int32Value = nil return } - v := s.ReadInt32() + v := s.ReadWrappedInt32() if s.Err() != nil { return } @@ -565,7 +565,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Int32Values = append(x.Int32Values, nil) return } - v := s.ReadInt32() + v := s.ReadWrappedInt32() if s.Err() != nil { return } @@ -577,7 +577,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Int64Value = nil return } - v := s.ReadInt64() + v := s.ReadWrappedInt64() if s.Err() != nil { return } @@ -593,7 +593,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Int64Values = append(x.Int64Values, nil) return } - v := s.ReadInt64() + v := s.ReadWrappedInt64() if s.Err() != nil { return } @@ -605,7 +605,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Uint32Value = nil return } - v := s.ReadUint32() + v := s.ReadWrappedUint32() if s.Err() != nil { return } @@ -621,7 +621,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Uint32Values = append(x.Uint32Values, nil) return } - v := s.ReadUint32() + v := s.ReadWrappedUint32() if s.Err() != nil { return } @@ -633,7 +633,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Uint64Value = nil return } - v := s.ReadUint64() + v := s.ReadWrappedUint64() if s.Err() != nil { return } @@ -649,7 +649,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Uint64Values = append(x.Uint64Values, nil) return } - v := s.ReadUint64() + v := s.ReadWrappedUint64() if s.Err() != nil { return } @@ -661,7 +661,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.BoolValue = nil return } - v := s.ReadBool() + v := s.ReadWrappedBool() if s.Err() != nil { return } @@ -677,7 +677,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.BoolValues = append(x.BoolValues, nil) return } - v := s.ReadBool() + v := s.ReadWrappedBool() if s.Err() != nil { return } @@ -689,7 +689,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.StringValue = nil return } - v := s.ReadString() + v := s.ReadWrappedString() if s.Err() != nil { return } @@ -705,7 +705,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.StringValues = append(x.StringValues, nil) return } - v := s.ReadString() + v := s.ReadWrappedString() if s.Err() != nil { return } @@ -717,7 +717,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.BytesValue = nil return } - v := s.ReadBytes() + v := s.ReadWrappedBytes() if s.Err() != nil { return } @@ -733,7 +733,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.BytesValues = append(x.BytesValues, nil) return } - v := s.ReadBytes() + v := s.ReadWrappedBytes() if s.Err() != nil { return } @@ -1113,7 +1113,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.DoubleValue = nil return } - v := s.ReadFloat64() + v := s.ReadWrappedFloat64() if s.Err() != nil { return } @@ -1126,7 +1126,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.FloatValue = nil return } - v := s.ReadFloat32() + v := s.ReadWrappedFloat32() if s.Err() != nil { return } @@ -1139,7 +1139,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.Int32Value = nil return } - v := s.ReadInt32() + v := s.ReadWrappedInt32() if s.Err() != nil { return } @@ -1152,7 +1152,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.Int64Value = nil return } - v := s.ReadInt64() + v := s.ReadWrappedInt64() if s.Err() != nil { return } @@ -1165,7 +1165,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.Uint32Value = nil return } - v := s.ReadUint32() + v := s.ReadWrappedUint32() if s.Err() != nil { return } @@ -1178,7 +1178,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.Uint64Value = nil return } - v := s.ReadUint64() + v := s.ReadWrappedUint64() if s.Err() != nil { return } @@ -1191,7 +1191,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.BoolValue = nil return } - v := s.ReadBool() + v := s.ReadWrappedBool() if s.Err() != nil { return } @@ -1204,7 +1204,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.StringValue = nil return } - v := s.ReadString() + v := s.ReadWrappedString() if s.Err() != nil { return } @@ -1217,7 +1217,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.BytesValue = nil return } - v := s.ReadBytes() + v := s.ReadWrappedBytes() if s.Err() != nil { return } @@ -1643,7 +1643,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringDoubleMap[key] = nil } else { - v := s.ReadFloat64() + v := s.ReadWrappedFloat64() if s.Err() != nil { return } @@ -1661,7 +1661,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringFloatMap[key] = nil } else { - v := s.ReadFloat32() + v := s.ReadWrappedFloat32() if s.Err() != nil { return } @@ -1679,7 +1679,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringInt32Map[key] = nil } else { - v := s.ReadInt32() + v := s.ReadWrappedInt32() if s.Err() != nil { return } @@ -1697,7 +1697,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringInt64Map[key] = nil } else { - v := s.ReadInt64() + v := s.ReadWrappedInt64() if s.Err() != nil { return } @@ -1715,7 +1715,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringUint32Map[key] = nil } else { - v := s.ReadUint32() + v := s.ReadWrappedUint32() if s.Err() != nil { return } @@ -1733,7 +1733,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringUint64Map[key] = nil } else { - v := s.ReadUint64() + v := s.ReadWrappedUint64() if s.Err() != nil { return } @@ -1751,7 +1751,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringBoolMap[key] = nil } else { - v := s.ReadBool() + v := s.ReadWrappedBool() if s.Err() != nil { return } @@ -1769,7 +1769,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringStringMap[key] = nil } else { - v := s.ReadString() + v := s.ReadWrappedString() if s.Err() != nil { return } @@ -1787,7 +1787,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringBytesMap[key] = nil } else { - v := s.ReadBytes() + v := s.ReadWrappedBytes() if s.Err() != nil { return } diff --git a/test/gogo/wkts_test.go b/test/gogo/wkts_test.go index c3177d2b..f172b24b 100644 --- a/test/gogo/wkts_test.go +++ b/test/gogo/wkts_test.go @@ -46,10 +46,11 @@ func mustAny(pb proto.Message) *types.Any { } var testMessagesWithWKTs = []struct { - name string - msg MessageWithWKTs - expected string - expectedMask []string + name string + msg MessageWithWKTs + unmarshalOnly bool + expected string + expectedMask []string }{ { name: "empty", @@ -394,10 +395,108 @@ var testMessagesWithWKTs = []struct { "any_values", }, }, + { + name: "wrappers", + msg: MessageWithWKTs{ + DoubleValue: &types.DoubleValue{Value: 12.34}, + DoubleValues: []*types.DoubleValue{ + {Value: 12.34}, + {Value: 56.78}, + }, + FloatValue: &types.FloatValue{Value: 12.34}, + FloatValues: []*types.FloatValue{ + {Value: 12.34}, + {Value: 56.78}, + }, + Int32Value: &types.Int32Value{Value: -42}, + Int32Values: []*types.Int32Value{ + {Value: 1}, + {Value: 2}, + {Value: -42}, + }, + Int64Value: &types.Int64Value{Value: -42}, + Int64Values: []*types.Int64Value{ + {Value: 1}, + {Value: 2}, + {Value: -42}, + }, + Uint32Value: &types.UInt32Value{Value: 42}, + Uint32Values: []*types.UInt32Value{ + {Value: 1}, + {Value: 2}, + {Value: 42}, + }, + Uint64Value: &types.UInt64Value{Value: 42}, + Uint64Values: []*types.UInt64Value{ + {Value: 1}, + {Value: 2}, + {Value: 42}, + }, + BoolValue: &types.BoolValue{Value: true}, + BoolValues: []*types.BoolValue{ + {Value: true}, + {Value: false}, + }, + StringValue: &types.StringValue{Value: "foo"}, + StringValues: []*types.StringValue{ + {Value: "foo"}, + {Value: "bar"}, + }, + BytesValue: &types.BytesValue{Value: []byte("foo")}, + BytesValues: []*types.BytesValue{ + {Value: []byte("foo")}, + {Value: []byte("bar")}, + }, + }, + unmarshalOnly: true, + expected: `{ + "double_value": {"value": 12.34}, + "double_values": [{"value": 12.34}, {"value": 56.78}], + "float_value": {"value": 12.34}, + "float_values": [{"value": 12.34}, {"value": 56.78}], + "int32_value": {"value": -42}, + "int32_values": [{"value": 1}, {"value": 2}, {"value": -42}], + "int64_value": {"value": "-42"}, + "int64_values": [{"value": "1"}, {"value": "2"}, {"value": "-42"}], + "uint32_value": {"value": 42}, + "uint32_values": [{"value": 1}, {"value": 2}, {"value": 42}], + "uint64_value": {"value": "42"}, + "uint64_values": [{"value": "1"}, {"value": "2"}, {"value": "42"}], + "bool_value": {"value": true}, + "bool_values": [{"value": true}, {"value": false}], + "string_value": {"value": "foo"}, + "string_values": [{"value": "foo"}, {"value": "bar"}], + "bytes_value": {"value": "Zm9v"}, + "bytes_values": [{"value": "Zm9v"}, {"value": "YmFy"}] + }`, + expectedMask: []string{ + "double_value", + "double_values", + "float_value", + "float_values", + "int32_value", + "int32_values", + "int64_value", + "int64_values", + "uint32_value", + "uint32_values", + "uint64_value", + "uint64_values", + "bool_value", + "bool_values", + "string_value", + "string_values", + "bytes_value", + "bytes_values", + }, + }, } func TestMarshalMessageWithWKTs(t *testing.T) { for _, tt := range testMessagesWithWKTs { + if tt.unmarshalOnly { + continue + } t.Run(tt.name, func(t *testing.T) { expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) }) diff --git a/test/golang/wkts_json.pb.go b/test/golang/wkts_json.pb.go index ef4b639e..53b2c26e 100644 --- a/test/golang/wkts_json.pb.go +++ b/test/golang/wkts_json.pb.go @@ -499,7 +499,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.DoubleValue = nil return } - v := s.ReadFloat64() + v := s.ReadWrappedFloat64() if s.Err() != nil { return } @@ -515,7 +515,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.DoubleValues = append(x.DoubleValues, nil) return } - v := s.ReadFloat64() + v := s.ReadWrappedFloat64() if s.Err() != nil { return } @@ -527,7 +527,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.FloatValue = nil return } - v := s.ReadFloat32() + v := s.ReadWrappedFloat32() if s.Err() != nil { return } @@ -543,7 +543,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.FloatValues = append(x.FloatValues, nil) return } - v := s.ReadFloat32() + v := s.ReadWrappedFloat32() if s.Err() != nil { return } @@ -555,7 +555,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Int32Value = nil return } - v := s.ReadInt32() + v := s.ReadWrappedInt32() if s.Err() != nil { return } @@ -571,7 +571,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Int32Values = append(x.Int32Values, nil) return } - v := s.ReadInt32() + v := s.ReadWrappedInt32() if s.Err() != nil { return } @@ -583,7 +583,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Int64Value = nil return } - v := s.ReadInt64() + v := s.ReadWrappedInt64() if s.Err() != nil { return } @@ -599,7 +599,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Int64Values = append(x.Int64Values, nil) return } - v := s.ReadInt64() + v := s.ReadWrappedInt64() if s.Err() != nil { return } @@ -611,7 +611,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Uint32Value = nil return } - v := s.ReadUint32() + v := s.ReadWrappedUint32() if s.Err() != nil { return } @@ -627,7 +627,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Uint32Values = append(x.Uint32Values, nil) return } - v := s.ReadUint32() + v := s.ReadWrappedUint32() if s.Err() != nil { return } @@ -639,7 +639,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Uint64Value = nil return } - v := s.ReadUint64() + v := s.ReadWrappedUint64() if s.Err() != nil { return } @@ -655,7 +655,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.Uint64Values = append(x.Uint64Values, nil) return } - v := s.ReadUint64() + v := s.ReadWrappedUint64() if s.Err() != nil { return } @@ -667,7 +667,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.BoolValue = nil return } - v := s.ReadBool() + v := s.ReadWrappedBool() if s.Err() != nil { return } @@ -683,7 +683,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.BoolValues = append(x.BoolValues, nil) return } - v := s.ReadBool() + v := s.ReadWrappedBool() if s.Err() != nil { return } @@ -695,7 +695,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.StringValue = nil return } - v := s.ReadString() + v := s.ReadWrappedString() if s.Err() != nil { return } @@ -711,7 +711,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.StringValues = append(x.StringValues, nil) return } - v := s.ReadString() + v := s.ReadWrappedString() if s.Err() != nil { return } @@ -723,7 +723,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.BytesValue = nil return } - v := s.ReadBytes() + v := s.ReadWrappedBytes() if s.Err() != nil { return } @@ -739,7 +739,7 @@ func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { x.BytesValues = append(x.BytesValues, nil) return } - v := s.ReadBytes() + v := s.ReadWrappedBytes() if s.Err() != nil { return } @@ -1119,7 +1119,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.DoubleValue = nil return } - v := s.ReadFloat64() + v := s.ReadWrappedFloat64() if s.Err() != nil { return } @@ -1132,7 +1132,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.FloatValue = nil return } - v := s.ReadFloat32() + v := s.ReadWrappedFloat32() if s.Err() != nil { return } @@ -1145,7 +1145,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.Int32Value = nil return } - v := s.ReadInt32() + v := s.ReadWrappedInt32() if s.Err() != nil { return } @@ -1158,7 +1158,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.Int64Value = nil return } - v := s.ReadInt64() + v := s.ReadWrappedInt64() if s.Err() != nil { return } @@ -1171,7 +1171,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.Uint32Value = nil return } - v := s.ReadUint32() + v := s.ReadWrappedUint32() if s.Err() != nil { return } @@ -1184,7 +1184,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.Uint64Value = nil return } - v := s.ReadUint64() + v := s.ReadWrappedUint64() if s.Err() != nil { return } @@ -1197,7 +1197,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.BoolValue = nil return } - v := s.ReadBool() + v := s.ReadWrappedBool() if s.Err() != nil { return } @@ -1210,7 +1210,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.StringValue = nil return } - v := s.ReadString() + v := s.ReadWrappedString() if s.Err() != nil { return } @@ -1223,7 +1223,7 @@ func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) ov.BytesValue = nil return } - v := s.ReadBytes() + v := s.ReadWrappedBytes() if s.Err() != nil { return } @@ -1649,7 +1649,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringDoubleMap[key] = nil } else { - v := s.ReadFloat64() + v := s.ReadWrappedFloat64() if s.Err() != nil { return } @@ -1667,7 +1667,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringFloatMap[key] = nil } else { - v := s.ReadFloat32() + v := s.ReadWrappedFloat32() if s.Err() != nil { return } @@ -1685,7 +1685,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringInt32Map[key] = nil } else { - v := s.ReadInt32() + v := s.ReadWrappedInt32() if s.Err() != nil { return } @@ -1703,7 +1703,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringInt64Map[key] = nil } else { - v := s.ReadInt64() + v := s.ReadWrappedInt64() if s.Err() != nil { return } @@ -1721,7 +1721,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringUint32Map[key] = nil } else { - v := s.ReadUint32() + v := s.ReadWrappedUint32() if s.Err() != nil { return } @@ -1739,7 +1739,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringUint64Map[key] = nil } else { - v := s.ReadUint64() + v := s.ReadWrappedUint64() if s.Err() != nil { return } @@ -1757,7 +1757,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringBoolMap[key] = nil } else { - v := s.ReadBool() + v := s.ReadWrappedBool() if s.Err() != nil { return } @@ -1775,7 +1775,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringStringMap[key] = nil } else { - v := s.ReadString() + v := s.ReadWrappedString() if s.Err() != nil { return } @@ -1793,7 +1793,7 @@ func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { if s.ReadNil() { x.StringBytesMap[key] = nil } else { - v := s.ReadBytes() + v := s.ReadWrappedBytes() if s.Err() != nil { return } diff --git a/test/golang/wkts_test.go b/test/golang/wkts_test.go index c15f593e..974a14d0 100644 --- a/test/golang/wkts_test.go +++ b/test/golang/wkts_test.go @@ -48,10 +48,11 @@ func mustAny(pb proto.Message) *anypb.Any { } var testMessagesWithWKTs = []struct { - name string - msg MessageWithWKTs - expected string - expectedMask []string + name string + msg MessageWithWKTs + unmarshalOnly bool + expected string + expectedMask []string }{ { name: "empty", @@ -396,10 +397,108 @@ var testMessagesWithWKTs = []struct { "any_values", }, }, + { + name: "wrappers", + msg: MessageWithWKTs{ + DoubleValue: &wrapperspb.DoubleValue{Value: 12.34}, + DoubleValues: []*wrapperspb.DoubleValue{ + {Value: 12.34}, + {Value: 56.78}, + }, + FloatValue: &wrapperspb.FloatValue{Value: 12.34}, + FloatValues: []*wrapperspb.FloatValue{ + {Value: 12.34}, + {Value: 56.78}, + }, + Int32Value: &wrapperspb.Int32Value{Value: -42}, + Int32Values: []*wrapperspb.Int32Value{ + {Value: 1}, + {Value: 2}, + {Value: -42}, + }, + Int64Value: &wrapperspb.Int64Value{Value: -42}, + Int64Values: []*wrapperspb.Int64Value{ + {Value: 1}, + {Value: 2}, + {Value: -42}, + }, + Uint32Value: &wrapperspb.UInt32Value{Value: 42}, + Uint32Values: []*wrapperspb.UInt32Value{ + {Value: 1}, + {Value: 2}, + {Value: 42}, + }, + Uint64Value: &wrapperspb.UInt64Value{Value: 42}, + Uint64Values: []*wrapperspb.UInt64Value{ + {Value: 1}, + {Value: 2}, + {Value: 42}, + }, + BoolValue: &wrapperspb.BoolValue{Value: true}, + BoolValues: []*wrapperspb.BoolValue{ + {Value: true}, + {Value: false}, + }, + StringValue: &wrapperspb.StringValue{Value: "foo"}, + StringValues: []*wrapperspb.StringValue{ + {Value: "foo"}, + {Value: "bar"}, + }, + BytesValue: &wrapperspb.BytesValue{Value: []byte("foo")}, + BytesValues: []*wrapperspb.BytesValue{ + {Value: []byte("foo")}, + {Value: []byte("bar")}, + }, + }, + unmarshalOnly: true, + expected: `{ + "double_value": {"value": 12.34}, + "double_values": [{"value": 12.34}, {"value": 56.78}], + "float_value": {"value": 12.34}, + "float_values": [{"value": 12.34}, {"value": 56.78}], + "int32_value": {"value": -42}, + "int32_values": [{"value": 1}, {"value": 2}, {"value": -42}], + "int64_value": {"value": "-42"}, + "int64_values": [{"value": "1"}, {"value": "2"}, {"value": "-42"}], + "uint32_value": {"value": 42}, + "uint32_values": [{"value": 1}, {"value": 2}, {"value": 42}], + "uint64_value": {"value": "42"}, + "uint64_values": [{"value": "1"}, {"value": "2"}, {"value": "42"}], + "bool_value": {"value": true}, + "bool_values": [{"value": true}, {"value": false}], + "string_value": {"value": "foo"}, + "string_values": [{"value": "foo"}, {"value": "bar"}], + "bytes_value": {"value": "Zm9v"}, + "bytes_values": [{"value": "Zm9v"}, {"value": "YmFy"}] + }`, + expectedMask: []string{ + "double_value", + "double_values", + "float_value", + "float_values", + "int32_value", + "int32_values", + "int64_value", + "int64_values", + "uint32_value", + "uint32_values", + "uint64_value", + "uint64_values", + "bool_value", + "bool_values", + "string_value", + "string_values", + "bytes_value", + "bytes_values", + }, + }, } func TestMarshalMessageWithWKTs(t *testing.T) { for _, tt := range testMessagesWithWKTs { + if tt.unmarshalOnly { + continue + } t.Run(tt.name, func(t *testing.T) { expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) }) From 2cb99758debda43010ec1bc33ae9cd4059e53bff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 12:22:35 +0200 Subject: [PATCH 32/46] Bump google.golang.org/protobuf from 1.28.0 to 1.28.1 (#16) Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.28.0 to 1.28.1. - [Release notes](https://github.com/protocolbuffers/protobuf-go/releases) - [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash) - [Commits](https://github.com/protocolbuffers/protobuf-go/compare/v1.28.0...v1.28.1) --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2fd205c9..676937b3 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/gogo/protobuf v1.3.2 github.com/google/go-cmp v0.5.8 github.com/json-iterator/go v1.1.12 - google.golang.org/protobuf v1.28.0 + google.golang.org/protobuf v1.28.1 ) require ( diff --git a/go.sum b/go.sum index c3bc659c..59368608 100644 --- a/go.sum +++ b/go.sum @@ -50,5 +50,5 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= From 64ddcc452fb10b87d751ebc09dba066dc00d7735 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 14:09:04 +0100 Subject: [PATCH 33/46] Bump github.com/google/go-cmp from 0.5.8 to 0.5.9 (#17) Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.8 to 0.5.9. - [Release notes](https://github.com/google/go-cmp/releases) - [Commits](https://github.com/google/go-cmp/compare/v0.5.8...v0.5.9) --- updated-dependencies: - dependency-name: github.com/google/go-cmp dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 676937b3..09e886dc 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( github.com/gogo/protobuf v1.3.2 - github.com/google/go-cmp v0.5.8 + github.com/google/go-cmp v0.5.9 github.com/json-iterator/go v1.1.12 google.golang.org/protobuf v1.28.1 ) diff --git a/go.sum b/go.sum index 59368608..0e300fe0 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= From 32cc7f6b6f17dded2a0407db61af05f4eb7eaf10 Mon Sep 17 00:00:00 2001 From: Yorick Smilda Date: Thu, 17 Nov 2022 10:09:51 +0100 Subject: [PATCH 34/46] Implement fieldmask unmarshaller (#19) * Implement fieldmask unmarshaller * Implement fieldmask marshaller * Move duplicated generators to a function --- annotations/annotations.pb.go | 2 +- internal/gen/messages.go | 37 +- internal/gen/messages_marshaler.go | 35 +- internal/gen/messages_unmarshaler.go | 38 +- internal/gogoproto/gogo.pb.go | 2 +- jsonplugin/marshal.go | 2 +- test/fieldmask.proto | 45 ++ test/gogo/enums.pb.go | 1 + test/gogo/fieldmask.pb.go | 363 ++++++++++++++++ test/gogo/fieldmask_json.pb.go | 305 ++++++++++++++ test/gogo/scalars.pb.go | 1 + test/gogo/wkts.pb.go | 1 + test/golang/api.pb.go | 2 +- test/golang/enums.pb.go | 3 +- test/golang/fieldmask.pb.go | 600 +++++++++++++++++++++++++++ test/golang/fieldmask_json.pb.go | 305 ++++++++++++++ test/golang/gogo.pb.go | 2 +- test/golang/scalars.pb.go | 3 +- test/golang/wkts.pb.go | 3 +- 19 files changed, 1725 insertions(+), 25 deletions(-) create mode 100644 test/fieldmask.proto create mode 100644 test/gogo/fieldmask.pb.go create mode 100644 test/gogo/fieldmask_json.pb.go create mode 100644 test/golang/fieldmask.pb.go create mode 100644 test/golang/fieldmask_json.pb.go diff --git a/annotations/annotations.pb.go b/annotations/annotations.pb.go index 90e09e67..7fb689ae 100644 --- a/annotations/annotations.pb.go +++ b/annotations/annotations.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.20.1 // source: protoc-gen-go-json/annotations.proto diff --git a/internal/gen/messages.go b/internal/gen/messages.go index a06e4143..f4525589 100644 --- a/internal/gen/messages.go +++ b/internal/gen/messages.go @@ -15,9 +15,38 @@ import ( "google.golang.org/protobuf/types/descriptorpb" ) +func (g *generator) messageHasFieldMask(message *protogen.Message, visited ...*protogen.Message) bool { + // Since we're going to be looking at the fields of this message, it's possible that there will be cycles. + // If that's the case, we'll return false here so that the caller can continue with the next field. + for _, visited := range visited { + if message == visited { + return false + } + } + + // No code is generated for map entries, so we also don't need to generate marshalers. + if message.Desc.IsMapEntry() { + return false + } + + var generate bool + + for _, field := range message.Fields { + if strings.HasPrefix(string(field.Desc.FullName()), "google.protobuf.FieldMask") { + generate = true + } + + // If the field is a message, and that message has a field mask, we need to generate a marshaler. + if field.Message != nil && g.messageHasFieldMask(field.Message, append(visited, message)...) { + generate = true + } + } + return generate +} + func (g *generator) messageHasAnyMarshaler(message *protogen.Message) bool { // We have a marshaler if the message itself has a marshaler or unmarshaler. - if g.messageHasMarshaler(message) || g.messageHasUnmarshaler(message) { + if g.messageHasMarshaler(message) || g.messageHasUnmarshaler(message) || g.messageHasFieldMask(message) { return true } @@ -30,7 +59,7 @@ func (g *generator) messageHasAnyMarshaler(message *protogen.Message) bool { // We have a marshaler if any of the sub-messages defined in the message has any marshaler. for _, message := range message.Messages { - if g.messageHasAnyMarshaler(message) { + if g.messageHasAnyMarshaler(message) || g.messageHasFieldMask(message) { return true } } @@ -50,7 +79,7 @@ func (g *generator) genMessage(message *protogen.Message) { } // Generate marshaler for the message itself, if it has one. - if g.messageHasMarshaler(message) { + if g.messageHasMarshaler(message) || g.messageHasFieldMask(message) { g.genMessageMarshaler(message) if Params.Std { g.genStdMessageMarshaler(message) @@ -58,7 +87,7 @@ func (g *generator) genMessage(message *protogen.Message) { } // Generate unmarshaler for the message itself, if it has one. - if g.messageHasUnmarshaler(message) { + if g.messageHasUnmarshaler(message) || g.messageHasFieldMask(message) { g.genMessageUnmarshaler(message) if Params.Std { g.genStdMessageUnmarshaler(message) diff --git a/internal/gen/messages_marshaler.go b/internal/gen/messages_marshaler.go index de3d740e..269e9fc2 100644 --- a/internal/gen/messages_marshaler.go +++ b/internal/gen/messages_marshaler.go @@ -190,16 +190,24 @@ nextField: g.P("s.WriteEnum(int32(v), ", value.Enum.GoIdent, "_name)") } case protoreflect.MessageKind: - switch { - case g.messageHasMarshaler(value.Message): + gen := func() { // If the map value is of type message, and the message has a marshaler, use that. g.P(`v.MarshalProtoJSON(s.WithField("`, field.Desc.Name(), `"))`) + } + + switch { + case g.messageHasMarshaler(value.Message): + gen() case messageIsWrapper(value.Message): // If the map value is a wrapper, write the wrapped value. g.writeWrapperValue(value.Message, "v") case messageIsWKT(value.Message): // If the map value is a WKT, write the WKT. g.writeWKTValue(field, value.Message, "v") + + // Has the same behaviour as the g.messageHasMarshaler case but is a catch all for when the message has a fieldmask. + case g.messageHasFieldMask(value.Message): + gen() default: // Otherwise delegate to the library. g.P("// NOTE: ", value.Message.GoIdent.GoName, " does not seem to implement MarshalProtoJSON.") @@ -278,6 +286,10 @@ nextField: g.P("}") // end for _, element := range x.{fieldGoName} { g.P("s.WriteArrayEnd()") case protoreflect.MessageKind: + gen := func() { + // If the list element is of type message, and the message has a marshaler, use that. + g.P(`element.MarshalProtoJSON(s.WithField("`, field.Desc.Name(), `"))`) + } g.P("s.WriteArrayStart()") // wroteElement keeps track of whether we wrote an element of the list, so that we know when to add a comma before the next. @@ -290,14 +302,17 @@ nextField: switch { case g.messageHasMarshaler(field.Message): - // If the list element is of type message, and the message has a marshaler, use that. - g.P(`element.MarshalProtoJSON(s.WithField("`, field.Desc.Name(), `"))`) + gen() case messageIsWrapper(field.Message): // If the list element is a wrapper, write the wrapped value. g.writeWrapperValue(field.Message, "element") case messageIsWKT(field.Message): // If the list element is a WKT, write the WKT. g.writeWKTValue(field, field.Message, "element") + + // Has the same behaviour as the g.messageHasMarshaler case but is a catch all for when the message has a fieldmask. + case g.messageHasFieldMask(field.Message): + gen() default: // Otherwise delegate to the library. g.P("// NOTE: ", field.Message.GoIdent.GoName, " does not seem to implement MarshalProtoJSON.") @@ -384,16 +399,24 @@ nextField: g.P("s.WriteEnum(int32(", messageOrOneofIdent, ".", fieldGoName, "), ", field.Enum.GoIdent, "_name)") } case protoreflect.MessageKind: - switch { - case g.messageHasMarshaler(field.Message): + gen := func() { // If the field is of type message, and the message has a marshaler, use that. g.P(messageOrOneofIdent, ".", fieldGoName, `.MarshalProtoJSON(s.WithField("`, field.Desc.Name(), `"))`) + } + + switch { + case g.messageHasMarshaler(field.Message): + gen() case messageIsWrapper(field.Message): // If the field is a wrapper, write the wrapped value. g.writeWrapperValue(field.Message, fmt.Sprintf("%s.%s", messageOrOneofIdent, fieldGoName)) case messageIsWKT(field.Message): // If the field is a WKT, write the WKT. g.writeWKTValue(field, field.Message, fmt.Sprintf("%s.%s", messageOrOneofIdent, fieldGoName)) + + // Has the same behaviour as the g.messageHasMarshaler case but is a catch all for when the message has a fieldmask. + case g.messageHasFieldMask(field.Message): + gen() default: // Otherwise delegate to the library. g.P("// NOTE: ", field.Message.GoIdent.GoName, " does not seem to implement MarshalProtoJSON.") diff --git a/internal/gen/messages_unmarshaler.go b/internal/gen/messages_unmarshaler.go index 7d5523bf..c345c2bd 100644 --- a/internal/gen/messages_unmarshaler.go +++ b/internal/gen/messages_unmarshaler.go @@ -197,13 +197,17 @@ nextField: g.P("x.", fieldGoName, "[key] = ", value.Enum.GoIdent, "(s.ReadEnum(", value.Enum.GoIdent, "_value))") } case protoreflect.MessageKind: - switch { - case g.messageHasUnmarshaler(value.Message): + gen := func() { // If the map value is of type message, and the message has a marshaler, // allocate a zero message, call the unmarshaler and set the map value for the key to the message. g.P("var v ", value.Message.GoIdent) g.P(`v.UnmarshalProtoJSON(s)`) g.P("x.", fieldGoName, "[key] = &v") + } + + switch { + case g.messageHasUnmarshaler(value.Message): + gen() case messageIsWrapper(value.Message): // If the map value is a wrapper, and we read null, set the map value for the key to nil. // Otherwise read the wrapped value, and if successful, set the map value for the key to the wrapped value. @@ -223,6 +227,10 @@ nextField: g.P("return") g.P("}") g.P("x.", fieldGoName, "[key] = ", ifThenElse(nullable, "", "*"), "v") + + // Has the same behaviour as the g.messageHasUnmarshaler case but is a catch all for when the message has a fieldmask. + case g.messageHasFieldMask(field.Message): + gen() default: // Otherwise, delegate to the library. g.P("// NOTE: ", value.Message.GoIdent.GoName, " does not seem to implement UnmarshalProtoJSON.") @@ -276,9 +284,7 @@ nextField: } g.P("})") // end s.ReadArray() case protoreflect.MessageKind: - g.P("s.ReadArray(func() {") - switch { - case g.messageHasUnmarshaler(field.Message): + gen := func() { if nullable { // If we read nil, append nil and return so that we can continue with the next key. g.P("if s.ReadNil() {") @@ -293,6 +299,12 @@ nextField: g.P("return") g.P("}") g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", v)") + } + + g.P("s.ReadArray(func() {") + switch { + case g.messageHasUnmarshaler(field.Message): + gen() case messageIsWrapper(field.Message): if nullable { // If we read nil, append nil and return so that we can continue with the next key. @@ -314,6 +326,10 @@ nextField: g.P("return") g.P("}") g.P("x.", fieldGoName, " = append(x.", fieldGoName, ", ", ifThenElse(nullable, "", "*"), "v)") + + // Has the same behaviour as the g.messageHasUnmarshaler case but is a catch all for when the message has a fieldmask. + case g.messageHasFieldMask(field.Message): + gen() default: // Otherwise, delegate to the library. g.P("// NOTE: ", field.Message.GoIdent.GoName, " does not seem to implement UnmarshalProtoJSON.") @@ -383,14 +399,18 @@ nextField: g.P(messageOrOneofIdent, ".", fieldGoName, " = ", field.Enum.GoIdent, "(s.ReadEnum(", field.Enum.GoIdent, "_value))") } case protoreflect.MessageKind: - switch { - case g.messageHasUnmarshaler(field.Message): + gen := func() { if nullable { // Set the field (or enum wrapper) to a newly allocated custom type. g.P(messageOrOneofIdent, ".", fieldGoName, " = &", field.Message.GoIdent, "{}") } // Call UnmarshalProtoJSON on the field. g.P(messageOrOneofIdent, ".", fieldGoName, `.UnmarshalProtoJSON(s.WithField("`, field.Desc.Name(), `", `, delegateMask, `))`) + } + + switch { + case g.messageHasUnmarshaler(field.Message): + gen() case messageIsWrapper(field.Message): // Read the wrapped value, and if successful, set the wrapped value in the field. g.P("v := ", g.readWrapperValue(field.Message)) @@ -405,6 +425,10 @@ nextField: g.P("return") g.P("}") g.P(messageOrOneofIdent, ".", fieldGoName, " = ", ifThenElse(nullable, "", "*"), "v") + + // Has the same behaviour as the g.messageHasUnmarshaler case but is a catch all for when the message has a fieldmask. + case g.messageHasFieldMask(field.Message): + gen() default: // Otherwise, delegate to the library. g.P("// NOTE: ", field.Message.GoIdent.GoName, " does not seem to implement UnmarshalProtoJSON.") diff --git a/internal/gogoproto/gogo.pb.go b/internal/gogoproto/gogo.pb.go index a1cb1981..e5fbc035 100644 --- a/internal/gogoproto/gogo.pb.go +++ b/internal/gogoproto/gogo.pb.go @@ -28,7 +28,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.20.1 // source: internal/gogoproto/gogo.proto diff --git a/jsonplugin/marshal.go b/jsonplugin/marshal.go index 02348358..eceb21cc 100644 --- a/jsonplugin/marshal.go +++ b/jsonplugin/marshal.go @@ -479,7 +479,7 @@ func (s *MarshalState) WriteArrayStart() { s.inner.WriteArrayStart() } -// WriteArrayEnd writes the enting ] of an array. +// WriteArrayEnd writes the ending ] of an array. func (s *MarshalState) WriteArrayEnd() { if s.Err() != nil { return diff --git a/test/fieldmask.proto b/test/fieldmask.proto new file mode 100644 index 00000000..182044cf --- /dev/null +++ b/test/fieldmask.proto @@ -0,0 +1,45 @@ +// Copyright © 2022 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +syntax = "proto3"; + +import "annotations.proto"; + +import "google/protobuf/field_mask.proto"; + +package thethings.json.test; + +option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/test"; + +message MessageWithFieldMask { + google.protobuf.FieldMask field_mask = 1; + string name = 2; +} + +message MessageWithoutFieldMask { + string name = 1; +} + +message MessageWithSubmessageWithFieldmask { + MessageWithFieldMask submessage = 1; +} + +message MessageWithSubmessageWithoutFieldmask { + MessageWithoutFieldMask submessage = 1; +} + +message MessageWithFieldmaskAndSubmessageWithFieldmask { + google.protobuf.FieldMask field_mask = 1; + MessageWithoutFieldMask submessage = 2; +} + +message MessageWithFieldmaskAndSubmessageWithoutFieldmask { + google.protobuf.FieldMask field_mask = 1; + MessageWithFieldMask submessage = 2; +} + +message MessageWithSubmessageWithFieldmaskAndMarshaler { + option (thethings.json.message) = { marshaler: true}; + + MessageWithFieldMask submessage = 1; +} \ No newline at end of file diff --git a/test/gogo/enums.pb.go b/test/gogo/enums.pb.go index 11cdbbf3..e47b3b9b 100644 --- a/test/gogo/enums.pb.go +++ b/test/gogo/enums.pb.go @@ -189,6 +189,7 @@ func (m *MessageWithEnums) GetWrappedCustoms() []*CustomEnumValue { type MessageWithOneofEnums struct { // Types that are valid to be assigned to Value: + // // *MessageWithOneofEnums_Regular // *MessageWithOneofEnums_Custom // *MessageWithOneofEnums_WrappedCustom diff --git a/test/gogo/fieldmask.pb.go b/test/gogo/fieldmask.pb.go new file mode 100644 index 00000000..e9081a86 --- /dev/null +++ b/test/gogo/fieldmask.pb.go @@ -0,0 +1,363 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fieldmask.proto + +package test + +import ( + fmt "fmt" + _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + 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 + +type MessageWithFieldMask struct { + FieldMask *types.FieldMask `protobuf:"bytes,1,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithFieldMask) Reset() { *m = MessageWithFieldMask{} } +func (m *MessageWithFieldMask) String() string { return proto.CompactTextString(m) } +func (*MessageWithFieldMask) ProtoMessage() {} +func (*MessageWithFieldMask) Descriptor() ([]byte, []int) { + return fileDescriptor_13c7df288dcaeb9c, []int{0} +} +func (m *MessageWithFieldMask) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithFieldMask.Unmarshal(m, b) +} +func (m *MessageWithFieldMask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithFieldMask.Marshal(b, m, deterministic) +} +func (m *MessageWithFieldMask) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithFieldMask.Merge(m, src) +} +func (m *MessageWithFieldMask) XXX_Size() int { + return xxx_messageInfo_MessageWithFieldMask.Size(m) +} +func (m *MessageWithFieldMask) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithFieldMask.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithFieldMask proto.InternalMessageInfo + +func (m *MessageWithFieldMask) GetFieldMask() *types.FieldMask { + if m != nil { + return m.FieldMask + } + return nil +} + +func (m *MessageWithFieldMask) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type MessageWithoutFieldMask struct { + 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 *MessageWithoutFieldMask) Reset() { *m = MessageWithoutFieldMask{} } +func (m *MessageWithoutFieldMask) String() string { return proto.CompactTextString(m) } +func (*MessageWithoutFieldMask) ProtoMessage() {} +func (*MessageWithoutFieldMask) Descriptor() ([]byte, []int) { + return fileDescriptor_13c7df288dcaeb9c, []int{1} +} +func (m *MessageWithoutFieldMask) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithoutFieldMask.Unmarshal(m, b) +} +func (m *MessageWithoutFieldMask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithoutFieldMask.Marshal(b, m, deterministic) +} +func (m *MessageWithoutFieldMask) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithoutFieldMask.Merge(m, src) +} +func (m *MessageWithoutFieldMask) XXX_Size() int { + return xxx_messageInfo_MessageWithoutFieldMask.Size(m) +} +func (m *MessageWithoutFieldMask) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithoutFieldMask.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithoutFieldMask proto.InternalMessageInfo + +func (m *MessageWithoutFieldMask) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type MessageWithSubmessageWithFieldmask struct { + Submessage *MessageWithFieldMask `protobuf:"bytes,1,opt,name=submessage,proto3" json:"submessage,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithSubmessageWithFieldmask) Reset() { *m = MessageWithSubmessageWithFieldmask{} } +func (m *MessageWithSubmessageWithFieldmask) String() string { return proto.CompactTextString(m) } +func (*MessageWithSubmessageWithFieldmask) ProtoMessage() {} +func (*MessageWithSubmessageWithFieldmask) Descriptor() ([]byte, []int) { + return fileDescriptor_13c7df288dcaeb9c, []int{2} +} +func (m *MessageWithSubmessageWithFieldmask) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithSubmessageWithFieldmask.Unmarshal(m, b) +} +func (m *MessageWithSubmessageWithFieldmask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithSubmessageWithFieldmask.Marshal(b, m, deterministic) +} +func (m *MessageWithSubmessageWithFieldmask) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithSubmessageWithFieldmask.Merge(m, src) +} +func (m *MessageWithSubmessageWithFieldmask) XXX_Size() int { + return xxx_messageInfo_MessageWithSubmessageWithFieldmask.Size(m) +} +func (m *MessageWithSubmessageWithFieldmask) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithSubmessageWithFieldmask.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithSubmessageWithFieldmask proto.InternalMessageInfo + +func (m *MessageWithSubmessageWithFieldmask) GetSubmessage() *MessageWithFieldMask { + if m != nil { + return m.Submessage + } + return nil +} + +type MessageWithSubmessageWithoutFieldmask struct { + Submessage *MessageWithoutFieldMask `protobuf:"bytes,1,opt,name=submessage,proto3" json:"submessage,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithSubmessageWithoutFieldmask) Reset() { *m = MessageWithSubmessageWithoutFieldmask{} } +func (m *MessageWithSubmessageWithoutFieldmask) String() string { return proto.CompactTextString(m) } +func (*MessageWithSubmessageWithoutFieldmask) ProtoMessage() {} +func (*MessageWithSubmessageWithoutFieldmask) Descriptor() ([]byte, []int) { + return fileDescriptor_13c7df288dcaeb9c, []int{3} +} +func (m *MessageWithSubmessageWithoutFieldmask) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithSubmessageWithoutFieldmask.Unmarshal(m, b) +} +func (m *MessageWithSubmessageWithoutFieldmask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithSubmessageWithoutFieldmask.Marshal(b, m, deterministic) +} +func (m *MessageWithSubmessageWithoutFieldmask) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithSubmessageWithoutFieldmask.Merge(m, src) +} +func (m *MessageWithSubmessageWithoutFieldmask) XXX_Size() int { + return xxx_messageInfo_MessageWithSubmessageWithoutFieldmask.Size(m) +} +func (m *MessageWithSubmessageWithoutFieldmask) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithSubmessageWithoutFieldmask.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithSubmessageWithoutFieldmask proto.InternalMessageInfo + +func (m *MessageWithSubmessageWithoutFieldmask) GetSubmessage() *MessageWithoutFieldMask { + if m != nil { + return m.Submessage + } + return nil +} + +type MessageWithFieldmaskAndSubmessageWithFieldmask struct { + FieldMask *types.FieldMask `protobuf:"bytes,1,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"` + Submessage *MessageWithoutFieldMask `protobuf:"bytes,2,opt,name=submessage,proto3" json:"submessage,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) Reset() { + *m = MessageWithFieldmaskAndSubmessageWithFieldmask{} +} +func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) String() string { + return proto.CompactTextString(m) +} +func (*MessageWithFieldmaskAndSubmessageWithFieldmask) ProtoMessage() {} +func (*MessageWithFieldmaskAndSubmessageWithFieldmask) Descriptor() ([]byte, []int) { + return fileDescriptor_13c7df288dcaeb9c, []int{4} +} +func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithFieldmask.Unmarshal(m, b) +} +func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithFieldmask.Marshal(b, m, deterministic) +} +func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithFieldmask.Merge(m, src) +} +func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) XXX_Size() int { + return xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithFieldmask.Size(m) +} +func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithFieldmask.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithFieldmask proto.InternalMessageInfo + +func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) GetFieldMask() *types.FieldMask { + if m != nil { + return m.FieldMask + } + return nil +} + +func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) GetSubmessage() *MessageWithoutFieldMask { + if m != nil { + return m.Submessage + } + return nil +} + +type MessageWithFieldmaskAndSubmessageWithoutFieldmask struct { + FieldMask *types.FieldMask `protobuf:"bytes,1,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"` + Submessage *MessageWithFieldMask `protobuf:"bytes,2,opt,name=submessage,proto3" json:"submessage,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) Reset() { + *m = MessageWithFieldmaskAndSubmessageWithoutFieldmask{} +} +func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) String() string { + return proto.CompactTextString(m) +} +func (*MessageWithFieldmaskAndSubmessageWithoutFieldmask) ProtoMessage() {} +func (*MessageWithFieldmaskAndSubmessageWithoutFieldmask) Descriptor() ([]byte, []int) { + return fileDescriptor_13c7df288dcaeb9c, []int{5} +} +func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithoutFieldmask.Unmarshal(m, b) +} +func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithoutFieldmask.Marshal(b, m, deterministic) +} +func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithoutFieldmask.Merge(m, src) +} +func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) XXX_Size() int { + return xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithoutFieldmask.Size(m) +} +func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithoutFieldmask.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithoutFieldmask proto.InternalMessageInfo + +func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) GetFieldMask() *types.FieldMask { + if m != nil { + return m.FieldMask + } + return nil +} + +func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) GetSubmessage() *MessageWithFieldMask { + if m != nil { + return m.Submessage + } + return nil +} + +type MessageWithSubmessageWithFieldmaskAndMarshaler struct { + Submessage *MessageWithFieldMask `protobuf:"bytes,1,opt,name=submessage,proto3" json:"submessage,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) Reset() { + *m = MessageWithSubmessageWithFieldmaskAndMarshaler{} +} +func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) String() string { + return proto.CompactTextString(m) +} +func (*MessageWithSubmessageWithFieldmaskAndMarshaler) ProtoMessage() {} +func (*MessageWithSubmessageWithFieldmaskAndMarshaler) Descriptor() ([]byte, []int) { + return fileDescriptor_13c7df288dcaeb9c, []int{6} +} +func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageWithSubmessageWithFieldmaskAndMarshaler.Unmarshal(m, b) +} +func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageWithSubmessageWithFieldmaskAndMarshaler.Marshal(b, m, deterministic) +} +func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageWithSubmessageWithFieldmaskAndMarshaler.Merge(m, src) +} +func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) XXX_Size() int { + return xxx_messageInfo_MessageWithSubmessageWithFieldmaskAndMarshaler.Size(m) +} +func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) XXX_DiscardUnknown() { + xxx_messageInfo_MessageWithSubmessageWithFieldmaskAndMarshaler.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageWithSubmessageWithFieldmaskAndMarshaler proto.InternalMessageInfo + +func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) GetSubmessage() *MessageWithFieldMask { + if m != nil { + return m.Submessage + } + return nil +} + +func init() { + proto.RegisterType((*MessageWithFieldMask)(nil), "thethings.json.test.MessageWithFieldMask") + proto.RegisterType((*MessageWithoutFieldMask)(nil), "thethings.json.test.MessageWithoutFieldMask") + proto.RegisterType((*MessageWithSubmessageWithFieldmask)(nil), "thethings.json.test.MessageWithSubmessageWithFieldmask") + proto.RegisterType((*MessageWithSubmessageWithoutFieldmask)(nil), "thethings.json.test.MessageWithSubmessageWithoutFieldmask") + proto.RegisterType((*MessageWithFieldmaskAndSubmessageWithFieldmask)(nil), "thethings.json.test.MessageWithFieldmaskAndSubmessageWithFieldmask") + proto.RegisterType((*MessageWithFieldmaskAndSubmessageWithoutFieldmask)(nil), "thethings.json.test.MessageWithFieldmaskAndSubmessageWithoutFieldmask") + proto.RegisterType((*MessageWithSubmessageWithFieldmaskAndMarshaler)(nil), "thethings.json.test.MessageWithSubmessageWithFieldmaskAndMarshaler") +} + +func init() { proto.RegisterFile("fieldmask.proto", fileDescriptor_13c7df288dcaeb9c) } + +var fileDescriptor_13c7df288dcaeb9c = []byte{ + // 348 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xc1, 0x4a, 0xc3, 0x40, + 0x10, 0x86, 0x49, 0x91, 0x62, 0xd7, 0x83, 0x18, 0x05, 0x6b, 0x4f, 0x25, 0x20, 0x54, 0x30, 0x1b, + 0x54, 0x10, 0xf5, 0x56, 0x0f, 0x85, 0x82, 0xbd, 0xd4, 0x82, 0xe0, 0x45, 0x36, 0xcd, 0x74, 0xb3, + 0xb6, 0xd9, 0x95, 0xcc, 0xee, 0x13, 0xf8, 0x36, 0xbe, 0x81, 0xaf, 0xe4, 0x53, 0x48, 0xb6, 0xb6, + 0x4d, 0x6c, 0x8a, 0x62, 0xbc, 0x25, 0xcc, 0xbf, 0xf3, 0x7d, 0x33, 0x9b, 0x90, 0xdd, 0x89, 0x80, + 0x59, 0x94, 0x30, 0x9c, 0xd2, 0x97, 0x54, 0x69, 0xe5, 0xee, 0xeb, 0x18, 0x74, 0x2c, 0x24, 0x47, + 0xfa, 0x8c, 0x4a, 0x52, 0x0d, 0xa8, 0x5b, 0x7b, 0x4c, 0x4a, 0xa5, 0x99, 0x16, 0x4a, 0xe2, 0x3c, + 0xd7, 0x6a, 0x73, 0xa5, 0xf8, 0x0c, 0x02, 0xfb, 0x16, 0x9a, 0x49, 0x60, 0x1b, 0x3d, 0xad, 0x3a, + 0x79, 0x40, 0x0e, 0x06, 0x80, 0xc8, 0x38, 0x3c, 0x08, 0x1d, 0xf7, 0xb2, 0xf2, 0x80, 0xe1, 0xd4, + 0xbd, 0x26, 0x64, 0x95, 0x6d, 0x3a, 0x6d, 0xa7, 0xb3, 0x73, 0xde, 0xa2, 0xf3, 0x76, 0x74, 0xd1, + 0x8e, 0x2e, 0xf3, 0xc3, 0xc6, 0x64, 0x79, 0xd4, 0x25, 0x5b, 0x92, 0x25, 0xd0, 0xac, 0xb5, 0x9d, + 0x4e, 0x63, 0x68, 0x9f, 0x3d, 0x9f, 0x1c, 0xe6, 0x30, 0xca, 0xe8, 0xde, 0x5a, 0xdc, 0xc9, 0xc5, + 0x15, 0xf1, 0x72, 0xf1, 0x7b, 0x13, 0x26, 0xdf, 0x1c, 0x33, 0x2b, 0xb7, 0x4f, 0x08, 0x2e, 0x4b, + 0x5f, 0x8e, 0x27, 0xb4, 0x64, 0x35, 0xb4, 0x6c, 0xc4, 0x61, 0xee, 0xb0, 0x67, 0xc8, 0xf1, 0x46, + 0xe0, 0xc2, 0xd6, 0x32, 0xef, 0x4a, 0x98, 0xa7, 0x3f, 0x31, 0xf3, 0xf3, 0x16, 0xb0, 0xef, 0x0e, + 0x59, 0x73, 0xcb, 0x30, 0x5d, 0x19, 0x6d, 0x1a, 0xba, 0xc2, 0xc5, 0x14, 0xdd, 0x6b, 0xd5, 0xdd, + 0xcf, 0x7e, 0xe5, 0x5e, 0xd8, 0x5f, 0x05, 0xfd, 0x7e, 0x89, 0xfe, 0x1f, 0xaf, 0xfb, 0xb5, 0xb8, + 0xf7, 0x0d, 0xbb, 0xee, 0xca, 0x68, 0xc0, 0x52, 0x8c, 0xd9, 0x0c, 0xd2, 0x7f, 0xfc, 0xd8, 0x6e, + 0xea, 0x1f, 0x6f, 0x47, 0xb5, 0x6d, 0xe7, 0xf6, 0xea, 0xf1, 0x92, 0x0b, 0x1d, 0x9b, 0x90, 0x8e, + 0x55, 0x12, 0x8c, 0x62, 0x18, 0xd9, 0x56, 0x7d, 0x19, 0x19, 0xd4, 0xa9, 0x00, 0x9c, 0xff, 0xb7, + 0x63, 0x9f, 0x83, 0xf4, 0xb9, 0xf2, 0x33, 0x44, 0x90, 0x21, 0xc2, 0xba, 0x2d, 0x5c, 0x7c, 0x06, + 0x00, 0x00, 0xff, 0xff, 0x47, 0xec, 0x76, 0xa4, 0x19, 0x04, 0x00, 0x00, +} diff --git a/test/gogo/fieldmask_json.pb.go b/test/gogo/fieldmask_json.pb.go new file mode 100644 index 00000000..ad3c5977 --- /dev/null +++ b/test/gogo/fieldmask_json.pb.go @@ -0,0 +1,305 @@ +// Code generated by protoc-gen-go-json. DO NOT EDIT. +// versions: +// - protoc-gen-go-json v0.0.0-dev +// - protoc v3.9.1 +// source: fieldmask.proto + +package test + +import ( + gogo "github.com/TheThingsIndustries/protoc-gen-go-json/gogo" + jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" +) + +// MarshalProtoJSON marshals the MessageWithFieldMask message to JSON. +func (x *MessageWithFieldMask) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.FieldMask != nil || s.HasField("field_mask") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("field_mask") + if x.FieldMask == nil { + s.WriteNil() + } else { + gogo.MarshalFieldMask(s, x.FieldMask) + } + } + if x.Name != "" || s.HasField("name") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("name") + s.WriteString(x.Name) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the MessageWithFieldMask to JSON. +func (x *MessageWithFieldMask) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the MessageWithFieldMask message from JSON. +func (x *MessageWithFieldMask) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "field_mask", "fieldMask": + s.AddField("field_mask") + if s.ReadNil() { + x.FieldMask = nil + return + } + v := gogo.UnmarshalFieldMask(s) + if s.Err() != nil { + return + } + x.FieldMask = v + case "name": + s.AddField("name") + x.Name = s.ReadString() + } + }) +} + +// UnmarshalJSON unmarshals the MessageWithFieldMask from JSON. +func (x *MessageWithFieldMask) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the MessageWithSubmessageWithFieldmask message to JSON. +func (x *MessageWithSubmessageWithFieldmask) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Submessage != nil || s.HasField("submessage") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("submessage") + x.Submessage.MarshalProtoJSON(s.WithField("submessage")) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the MessageWithSubmessageWithFieldmask to JSON. +func (x *MessageWithSubmessageWithFieldmask) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the MessageWithSubmessageWithFieldmask message from JSON. +func (x *MessageWithSubmessageWithFieldmask) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "submessage": + s.AddField("submessage") + if s.ReadNil() { + x.Submessage = nil + return + } + x.Submessage = &MessageWithFieldMask{} + x.Submessage.UnmarshalProtoJSON(s.WithField("submessage", false)) + } + }) +} + +// UnmarshalJSON unmarshals the MessageWithSubmessageWithFieldmask from JSON. +func (x *MessageWithSubmessageWithFieldmask) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the MessageWithFieldmaskAndSubmessageWithFieldmask message to JSON. +func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.FieldMask != nil || s.HasField("field_mask") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("field_mask") + if x.FieldMask == nil { + s.WriteNil() + } else { + gogo.MarshalFieldMask(s, x.FieldMask) + } + } + if x.Submessage != nil || s.HasField("submessage") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("submessage") + // NOTE: MessageWithoutFieldMask does not seem to implement MarshalProtoJSON. + gogo.MarshalMessage(s, x.Submessage) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the MessageWithFieldmaskAndSubmessageWithFieldmask to JSON. +func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the MessageWithFieldmaskAndSubmessageWithFieldmask message from JSON. +func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "field_mask", "fieldMask": + s.AddField("field_mask") + if s.ReadNil() { + x.FieldMask = nil + return + } + v := gogo.UnmarshalFieldMask(s) + if s.Err() != nil { + return + } + x.FieldMask = v + case "submessage": + s.AddField("submessage") + if s.ReadNil() { + x.Submessage = nil + return + } + // NOTE: MessageWithoutFieldMask does not seem to implement UnmarshalProtoJSON. + var v MessageWithoutFieldMask + gogo.UnmarshalMessage(s, &v) + x.Submessage = &v + } + }) +} + +// UnmarshalJSON unmarshals the MessageWithFieldmaskAndSubmessageWithFieldmask from JSON. +func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the MessageWithFieldmaskAndSubmessageWithoutFieldmask message to JSON. +func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.FieldMask != nil || s.HasField("field_mask") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("field_mask") + if x.FieldMask == nil { + s.WriteNil() + } else { + gogo.MarshalFieldMask(s, x.FieldMask) + } + } + if x.Submessage != nil || s.HasField("submessage") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("submessage") + x.Submessage.MarshalProtoJSON(s.WithField("submessage")) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the MessageWithFieldmaskAndSubmessageWithoutFieldmask to JSON. +func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the MessageWithFieldmaskAndSubmessageWithoutFieldmask message from JSON. +func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "field_mask", "fieldMask": + s.AddField("field_mask") + if s.ReadNil() { + x.FieldMask = nil + return + } + v := gogo.UnmarshalFieldMask(s) + if s.Err() != nil { + return + } + x.FieldMask = v + case "submessage": + s.AddField("submessage") + if s.ReadNil() { + x.Submessage = nil + return + } + x.Submessage = &MessageWithFieldMask{} + x.Submessage.UnmarshalProtoJSON(s.WithField("submessage", false)) + } + }) +} + +// UnmarshalJSON unmarshals the MessageWithFieldmaskAndSubmessageWithoutFieldmask from JSON. +func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the MessageWithSubmessageWithFieldmaskAndMarshaler message to JSON. +func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Submessage != nil || s.HasField("submessage") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("submessage") + x.Submessage.MarshalProtoJSON(s.WithField("submessage")) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the MessageWithSubmessageWithFieldmaskAndMarshaler to JSON. +func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the MessageWithSubmessageWithFieldmaskAndMarshaler message from JSON. +func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "submessage": + s.AddField("submessage") + if s.ReadNil() { + x.Submessage = nil + return + } + x.Submessage = &MessageWithFieldMask{} + x.Submessage.UnmarshalProtoJSON(s.WithField("submessage", false)) + } + }) +} + +// UnmarshalJSON unmarshals the MessageWithSubmessageWithFieldmaskAndMarshaler from JSON. +func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} diff --git a/test/gogo/scalars.pb.go b/test/gogo/scalars.pb.go index 4cd1d36f..412877d0 100644 --- a/test/gogo/scalars.pb.go +++ b/test/gogo/scalars.pb.go @@ -309,6 +309,7 @@ func (m *MessageWithScalars) GetHexBytesValues() [][]byte { type MessageWithOneofScalars struct { // Types that are valid to be assigned to Value: + // // *MessageWithOneofScalars_DoubleValue // *MessageWithOneofScalars_FloatValue // *MessageWithOneofScalars_Int32Value diff --git a/test/gogo/wkts.pb.go b/test/gogo/wkts.pb.go index 98b91aaf..5d3cdd97 100644 --- a/test/gogo/wkts.pb.go +++ b/test/gogo/wkts.pb.go @@ -402,6 +402,7 @@ func (m *MessageWithWKTs) GetAnyValues() []*types.Any { type MessageWithOneofWKTs struct { // Types that are valid to be assigned to Value: + // // *MessageWithOneofWKTs_DoubleValue // *MessageWithOneofWKTs_FloatValue // *MessageWithOneofWKTs_Int32Value diff --git a/test/golang/api.pb.go b/test/golang/api.pb.go index d467f927..37657213 100644 --- a/test/golang/api.pb.go +++ b/test/golang/api.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.20.1 // source: api.proto diff --git a/test/golang/enums.pb.go b/test/golang/enums.pb.go index 543b8386..15b74a95 100644 --- a/test/golang/enums.pb.go +++ b/test/golang/enums.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.20.1 // source: enums.proto @@ -263,6 +263,7 @@ type MessageWithOneofEnums struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Value: + // // *MessageWithOneofEnums_Regular // *MessageWithOneofEnums_Custom // *MessageWithOneofEnums_WrappedCustom diff --git a/test/golang/fieldmask.pb.go b/test/golang/fieldmask.pb.go new file mode 100644 index 00000000..d8195e34 --- /dev/null +++ b/test/golang/fieldmask.pb.go @@ -0,0 +1,600 @@ +// Copyright © 2022 The Things Industries B.V. +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.20.1 +// source: fieldmask.proto + +package test + +import ( + _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MessageWithFieldMask struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FieldMask *fieldmaskpb.FieldMask `protobuf:"bytes,1,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *MessageWithFieldMask) Reset() { + *x = MessageWithFieldMask{} + if protoimpl.UnsafeEnabled { + mi := &file_fieldmask_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithFieldMask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithFieldMask) ProtoMessage() {} + +func (x *MessageWithFieldMask) ProtoReflect() protoreflect.Message { + mi := &file_fieldmask_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithFieldMask.ProtoReflect.Descriptor instead. +func (*MessageWithFieldMask) Descriptor() ([]byte, []int) { + return file_fieldmask_proto_rawDescGZIP(), []int{0} +} + +func (x *MessageWithFieldMask) GetFieldMask() *fieldmaskpb.FieldMask { + if x != nil { + return x.FieldMask + } + return nil +} + +func (x *MessageWithFieldMask) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type MessageWithoutFieldMask struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *MessageWithoutFieldMask) Reset() { + *x = MessageWithoutFieldMask{} + if protoimpl.UnsafeEnabled { + mi := &file_fieldmask_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithoutFieldMask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithoutFieldMask) ProtoMessage() {} + +func (x *MessageWithoutFieldMask) ProtoReflect() protoreflect.Message { + mi := &file_fieldmask_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithoutFieldMask.ProtoReflect.Descriptor instead. +func (*MessageWithoutFieldMask) Descriptor() ([]byte, []int) { + return file_fieldmask_proto_rawDescGZIP(), []int{1} +} + +func (x *MessageWithoutFieldMask) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type MessageWithSubmessageWithFieldmask struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Submessage *MessageWithFieldMask `protobuf:"bytes,1,opt,name=submessage,proto3" json:"submessage,omitempty"` +} + +func (x *MessageWithSubmessageWithFieldmask) Reset() { + *x = MessageWithSubmessageWithFieldmask{} + if protoimpl.UnsafeEnabled { + mi := &file_fieldmask_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithSubmessageWithFieldmask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithSubmessageWithFieldmask) ProtoMessage() {} + +func (x *MessageWithSubmessageWithFieldmask) ProtoReflect() protoreflect.Message { + mi := &file_fieldmask_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithSubmessageWithFieldmask.ProtoReflect.Descriptor instead. +func (*MessageWithSubmessageWithFieldmask) Descriptor() ([]byte, []int) { + return file_fieldmask_proto_rawDescGZIP(), []int{2} +} + +func (x *MessageWithSubmessageWithFieldmask) GetSubmessage() *MessageWithFieldMask { + if x != nil { + return x.Submessage + } + return nil +} + +type MessageWithSubmessageWithoutFieldmask struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Submessage *MessageWithoutFieldMask `protobuf:"bytes,1,opt,name=submessage,proto3" json:"submessage,omitempty"` +} + +func (x *MessageWithSubmessageWithoutFieldmask) Reset() { + *x = MessageWithSubmessageWithoutFieldmask{} + if protoimpl.UnsafeEnabled { + mi := &file_fieldmask_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithSubmessageWithoutFieldmask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithSubmessageWithoutFieldmask) ProtoMessage() {} + +func (x *MessageWithSubmessageWithoutFieldmask) ProtoReflect() protoreflect.Message { + mi := &file_fieldmask_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithSubmessageWithoutFieldmask.ProtoReflect.Descriptor instead. +func (*MessageWithSubmessageWithoutFieldmask) Descriptor() ([]byte, []int) { + return file_fieldmask_proto_rawDescGZIP(), []int{3} +} + +func (x *MessageWithSubmessageWithoutFieldmask) GetSubmessage() *MessageWithoutFieldMask { + if x != nil { + return x.Submessage + } + return nil +} + +type MessageWithFieldmaskAndSubmessageWithFieldmask struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FieldMask *fieldmaskpb.FieldMask `protobuf:"bytes,1,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"` + Submessage *MessageWithoutFieldMask `protobuf:"bytes,2,opt,name=submessage,proto3" json:"submessage,omitempty"` +} + +func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) Reset() { + *x = MessageWithFieldmaskAndSubmessageWithFieldmask{} + if protoimpl.UnsafeEnabled { + mi := &file_fieldmask_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithFieldmaskAndSubmessageWithFieldmask) ProtoMessage() {} + +func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) ProtoReflect() protoreflect.Message { + mi := &file_fieldmask_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithFieldmaskAndSubmessageWithFieldmask.ProtoReflect.Descriptor instead. +func (*MessageWithFieldmaskAndSubmessageWithFieldmask) Descriptor() ([]byte, []int) { + return file_fieldmask_proto_rawDescGZIP(), []int{4} +} + +func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) GetFieldMask() *fieldmaskpb.FieldMask { + if x != nil { + return x.FieldMask + } + return nil +} + +func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) GetSubmessage() *MessageWithoutFieldMask { + if x != nil { + return x.Submessage + } + return nil +} + +type MessageWithFieldmaskAndSubmessageWithoutFieldmask struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FieldMask *fieldmaskpb.FieldMask `protobuf:"bytes,1,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"` + Submessage *MessageWithFieldMask `protobuf:"bytes,2,opt,name=submessage,proto3" json:"submessage,omitempty"` +} + +func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) Reset() { + *x = MessageWithFieldmaskAndSubmessageWithoutFieldmask{} + if protoimpl.UnsafeEnabled { + mi := &file_fieldmask_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithFieldmaskAndSubmessageWithoutFieldmask) ProtoMessage() {} + +func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) ProtoReflect() protoreflect.Message { + mi := &file_fieldmask_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithFieldmaskAndSubmessageWithoutFieldmask.ProtoReflect.Descriptor instead. +func (*MessageWithFieldmaskAndSubmessageWithoutFieldmask) Descriptor() ([]byte, []int) { + return file_fieldmask_proto_rawDescGZIP(), []int{5} +} + +func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) GetFieldMask() *fieldmaskpb.FieldMask { + if x != nil { + return x.FieldMask + } + return nil +} + +func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) GetSubmessage() *MessageWithFieldMask { + if x != nil { + return x.Submessage + } + return nil +} + +type MessageWithSubmessageWithFieldmaskAndMarshaler struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Submessage *MessageWithFieldMask `protobuf:"bytes,1,opt,name=submessage,proto3" json:"submessage,omitempty"` +} + +func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) Reset() { + *x = MessageWithSubmessageWithFieldmaskAndMarshaler{} + if protoimpl.UnsafeEnabled { + mi := &file_fieldmask_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageWithSubmessageWithFieldmaskAndMarshaler) ProtoMessage() {} + +func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) ProtoReflect() protoreflect.Message { + mi := &file_fieldmask_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageWithSubmessageWithFieldmaskAndMarshaler.ProtoReflect.Descriptor instead. +func (*MessageWithSubmessageWithFieldmaskAndMarshaler) Descriptor() ([]byte, []int) { + return file_fieldmask_proto_rawDescGZIP(), []int{6} +} + +func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) GetSubmessage() *MessageWithFieldMask { + if x != nil { + return x.Submessage + } + return nil +} + +var File_fieldmask_proto protoreflect.FileDescriptor + +var file_fieldmask_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x13, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x65, 0x0a, 0x14, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, + 0x61, 0x73, 0x6b, 0x12, 0x39, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, + 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, + 0x61, 0x73, 0x6b, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x2d, 0x0a, 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, + 0x68, 0x6f, 0x75, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x6f, 0x0a, 0x22, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, + 0x53, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x49, 0x0a, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, 0x68, + 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x22, 0x75, 0x0a, 0x25, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, + 0x68, 0x53, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, + 0x75, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x4c, 0x0a, 0x0a, 0x73, + 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, + 0x68, 0x6f, 0x75, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x73, + 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xb9, 0x01, 0x0a, 0x2e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, + 0x73, 0x6b, 0x41, 0x6e, 0x64, 0x53, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x39, 0x0a, 0x0a, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x09, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x4c, 0x0a, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x74, 0x68, + 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xb9, 0x01, 0x0a, 0x31, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x41, 0x6e, + 0x64, 0x53, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, + 0x75, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x39, 0x0a, 0x0a, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x09, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x49, 0x0a, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x22, 0x83, 0x01, 0x0a, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, + 0x68, 0x53, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x41, 0x6e, 0x64, 0x4d, 0x61, 0x72, 0x73, 0x68, + 0x61, 0x6c, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, + 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, + 0x06, 0xea, 0xaa, 0x19, 0x02, 0x08, 0x01, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, + 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, + 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_fieldmask_proto_rawDescOnce sync.Once + file_fieldmask_proto_rawDescData = file_fieldmask_proto_rawDesc +) + +func file_fieldmask_proto_rawDescGZIP() []byte { + file_fieldmask_proto_rawDescOnce.Do(func() { + file_fieldmask_proto_rawDescData = protoimpl.X.CompressGZIP(file_fieldmask_proto_rawDescData) + }) + return file_fieldmask_proto_rawDescData +} + +var file_fieldmask_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_fieldmask_proto_goTypes = []interface{}{ + (*MessageWithFieldMask)(nil), // 0: thethings.json.test.MessageWithFieldMask + (*MessageWithoutFieldMask)(nil), // 1: thethings.json.test.MessageWithoutFieldMask + (*MessageWithSubmessageWithFieldmask)(nil), // 2: thethings.json.test.MessageWithSubmessageWithFieldmask + (*MessageWithSubmessageWithoutFieldmask)(nil), // 3: thethings.json.test.MessageWithSubmessageWithoutFieldmask + (*MessageWithFieldmaskAndSubmessageWithFieldmask)(nil), // 4: thethings.json.test.MessageWithFieldmaskAndSubmessageWithFieldmask + (*MessageWithFieldmaskAndSubmessageWithoutFieldmask)(nil), // 5: thethings.json.test.MessageWithFieldmaskAndSubmessageWithoutFieldmask + (*MessageWithSubmessageWithFieldmaskAndMarshaler)(nil), // 6: thethings.json.test.MessageWithSubmessageWithFieldmaskAndMarshaler + (*fieldmaskpb.FieldMask)(nil), // 7: google.protobuf.FieldMask +} +var file_fieldmask_proto_depIdxs = []int32{ + 7, // 0: thethings.json.test.MessageWithFieldMask.field_mask:type_name -> google.protobuf.FieldMask + 0, // 1: thethings.json.test.MessageWithSubmessageWithFieldmask.submessage:type_name -> thethings.json.test.MessageWithFieldMask + 1, // 2: thethings.json.test.MessageWithSubmessageWithoutFieldmask.submessage:type_name -> thethings.json.test.MessageWithoutFieldMask + 7, // 3: thethings.json.test.MessageWithFieldmaskAndSubmessageWithFieldmask.field_mask:type_name -> google.protobuf.FieldMask + 1, // 4: thethings.json.test.MessageWithFieldmaskAndSubmessageWithFieldmask.submessage:type_name -> thethings.json.test.MessageWithoutFieldMask + 7, // 5: thethings.json.test.MessageWithFieldmaskAndSubmessageWithoutFieldmask.field_mask:type_name -> google.protobuf.FieldMask + 0, // 6: thethings.json.test.MessageWithFieldmaskAndSubmessageWithoutFieldmask.submessage:type_name -> thethings.json.test.MessageWithFieldMask + 0, // 7: thethings.json.test.MessageWithSubmessageWithFieldmaskAndMarshaler.submessage:type_name -> thethings.json.test.MessageWithFieldMask + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_fieldmask_proto_init() } +func file_fieldmask_proto_init() { + if File_fieldmask_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_fieldmask_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithFieldMask); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fieldmask_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithoutFieldMask); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fieldmask_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithSubmessageWithFieldmask); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fieldmask_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithSubmessageWithoutFieldmask); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fieldmask_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithFieldmaskAndSubmessageWithFieldmask); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fieldmask_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithFieldmaskAndSubmessageWithoutFieldmask); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fieldmask_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageWithSubmessageWithFieldmaskAndMarshaler); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_fieldmask_proto_rawDesc, + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_fieldmask_proto_goTypes, + DependencyIndexes: file_fieldmask_proto_depIdxs, + MessageInfos: file_fieldmask_proto_msgTypes, + }.Build() + File_fieldmask_proto = out.File + file_fieldmask_proto_rawDesc = nil + file_fieldmask_proto_goTypes = nil + file_fieldmask_proto_depIdxs = nil +} diff --git a/test/golang/fieldmask_json.pb.go b/test/golang/fieldmask_json.pb.go new file mode 100644 index 00000000..30ac3b57 --- /dev/null +++ b/test/golang/fieldmask_json.pb.go @@ -0,0 +1,305 @@ +// Code generated by protoc-gen-go-json. DO NOT EDIT. +// versions: +// - protoc-gen-go-json v0.0.0-dev +// - protoc v3.20.1 +// source: fieldmask.proto + +package test + +import ( + golang "github.com/TheThingsIndustries/protoc-gen-go-json/golang" + jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" +) + +// MarshalProtoJSON marshals the MessageWithFieldMask message to JSON. +func (x *MessageWithFieldMask) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.FieldMask != nil || s.HasField("field_mask") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("field_mask") + if x.FieldMask == nil { + s.WriteNil() + } else { + golang.MarshalFieldMask(s, x.FieldMask) + } + } + if x.Name != "" || s.HasField("name") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("name") + s.WriteString(x.Name) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the MessageWithFieldMask to JSON. +func (x *MessageWithFieldMask) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the MessageWithFieldMask message from JSON. +func (x *MessageWithFieldMask) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "field_mask", "fieldMask": + s.AddField("field_mask") + if s.ReadNil() { + x.FieldMask = nil + return + } + v := golang.UnmarshalFieldMask(s) + if s.Err() != nil { + return + } + x.FieldMask = v + case "name": + s.AddField("name") + x.Name = s.ReadString() + } + }) +} + +// UnmarshalJSON unmarshals the MessageWithFieldMask from JSON. +func (x *MessageWithFieldMask) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the MessageWithSubmessageWithFieldmask message to JSON. +func (x *MessageWithSubmessageWithFieldmask) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Submessage != nil || s.HasField("submessage") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("submessage") + x.Submessage.MarshalProtoJSON(s.WithField("submessage")) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the MessageWithSubmessageWithFieldmask to JSON. +func (x *MessageWithSubmessageWithFieldmask) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the MessageWithSubmessageWithFieldmask message from JSON. +func (x *MessageWithSubmessageWithFieldmask) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "submessage": + s.AddField("submessage") + if s.ReadNil() { + x.Submessage = nil + return + } + x.Submessage = &MessageWithFieldMask{} + x.Submessage.UnmarshalProtoJSON(s.WithField("submessage", false)) + } + }) +} + +// UnmarshalJSON unmarshals the MessageWithSubmessageWithFieldmask from JSON. +func (x *MessageWithSubmessageWithFieldmask) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the MessageWithFieldmaskAndSubmessageWithFieldmask message to JSON. +func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.FieldMask != nil || s.HasField("field_mask") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("field_mask") + if x.FieldMask == nil { + s.WriteNil() + } else { + golang.MarshalFieldMask(s, x.FieldMask) + } + } + if x.Submessage != nil || s.HasField("submessage") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("submessage") + // NOTE: MessageWithoutFieldMask does not seem to implement MarshalProtoJSON. + golang.MarshalMessage(s, x.Submessage) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the MessageWithFieldmaskAndSubmessageWithFieldmask to JSON. +func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the MessageWithFieldmaskAndSubmessageWithFieldmask message from JSON. +func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "field_mask", "fieldMask": + s.AddField("field_mask") + if s.ReadNil() { + x.FieldMask = nil + return + } + v := golang.UnmarshalFieldMask(s) + if s.Err() != nil { + return + } + x.FieldMask = v + case "submessage": + s.AddField("submessage") + if s.ReadNil() { + x.Submessage = nil + return + } + // NOTE: MessageWithoutFieldMask does not seem to implement UnmarshalProtoJSON. + var v MessageWithoutFieldMask + golang.UnmarshalMessage(s, &v) + x.Submessage = &v + } + }) +} + +// UnmarshalJSON unmarshals the MessageWithFieldmaskAndSubmessageWithFieldmask from JSON. +func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the MessageWithFieldmaskAndSubmessageWithoutFieldmask message to JSON. +func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.FieldMask != nil || s.HasField("field_mask") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("field_mask") + if x.FieldMask == nil { + s.WriteNil() + } else { + golang.MarshalFieldMask(s, x.FieldMask) + } + } + if x.Submessage != nil || s.HasField("submessage") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("submessage") + x.Submessage.MarshalProtoJSON(s.WithField("submessage")) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the MessageWithFieldmaskAndSubmessageWithoutFieldmask to JSON. +func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the MessageWithFieldmaskAndSubmessageWithoutFieldmask message from JSON. +func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "field_mask", "fieldMask": + s.AddField("field_mask") + if s.ReadNil() { + x.FieldMask = nil + return + } + v := golang.UnmarshalFieldMask(s) + if s.Err() != nil { + return + } + x.FieldMask = v + case "submessage": + s.AddField("submessage") + if s.ReadNil() { + x.Submessage = nil + return + } + x.Submessage = &MessageWithFieldMask{} + x.Submessage.UnmarshalProtoJSON(s.WithField("submessage", false)) + } + }) +} + +// UnmarshalJSON unmarshals the MessageWithFieldmaskAndSubmessageWithoutFieldmask from JSON. +func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the MessageWithSubmessageWithFieldmaskAndMarshaler message to JSON. +func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) MarshalProtoJSON(s *jsonplugin.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Submessage != nil || s.HasField("submessage") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("submessage") + x.Submessage.MarshalProtoJSON(s.WithField("submessage")) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the MessageWithSubmessageWithFieldmaskAndMarshaler to JSON. +func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) MarshalJSON() ([]byte, error) { + return jsonplugin.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the MessageWithSubmessageWithFieldmaskAndMarshaler message from JSON. +func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.ReadAny() // ignore unknown field + case "submessage": + s.AddField("submessage") + if s.ReadNil() { + x.Submessage = nil + return + } + x.Submessage = &MessageWithFieldMask{} + x.Submessage.UnmarshalProtoJSON(s.WithField("submessage", false)) + } + }) +} + +// UnmarshalJSON unmarshals the MessageWithSubmessageWithFieldmaskAndMarshaler from JSON. +func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) UnmarshalJSON(b []byte) error { + return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) +} diff --git a/test/golang/gogo.pb.go b/test/golang/gogo.pb.go index b6e3c807..65f0584e 100644 --- a/test/golang/gogo.pb.go +++ b/test/golang/gogo.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.20.1 // source: gogo.proto diff --git a/test/golang/scalars.pb.go b/test/golang/scalars.pb.go index d7280f5a..4227ca75 100644 --- a/test/golang/scalars.pb.go +++ b/test/golang/scalars.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.20.1 // source: scalars.proto @@ -325,6 +325,7 @@ type MessageWithOneofScalars struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Value: + // // *MessageWithOneofScalars_DoubleValue // *MessageWithOneofScalars_FloatValue // *MessageWithOneofScalars_Int32Value diff --git a/test/golang/wkts.pb.go b/test/golang/wkts.pb.go index 210a8980..8674eec0 100644 --- a/test/golang/wkts.pb.go +++ b/test/golang/wkts.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.28.1 // protoc v3.20.1 // source: wkts.proto @@ -442,6 +442,7 @@ type MessageWithOneofWKTs struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Value: + // // *MessageWithOneofWKTs_DoubleValue // *MessageWithOneofWKTs_FloatValue // *MessageWithOneofWKTs_Int32Value From ee7254a33117cef1d01556371c29bf488a5e74db Mon Sep 17 00:00:00 2001 From: Yorick Smilda Date: Thu, 15 Dec 2022 16:08:01 +0100 Subject: [PATCH 35/46] Add `legacy_fieldmask_marshaling` option (#21) --- cmd/protoc-gen-go-json/main.go | 1 + gogo/gogo.go | 16 ++++++++++++++-- golang/golang.go | 16 ++++++++++++++-- internal/gen/gen.go | 5 +++-- internal/gen/messages_marshaler.go | 8 ++++++-- jsonplugin/marshal.go | 18 ++++++++++++++++++ test/gogo/wkts_json.pb.go | 8 ++++---- test/golang/wkts_json.pb.go | 8 ++++---- 8 files changed, 64 insertions(+), 16 deletions(-) diff --git a/cmd/protoc-gen-go-json/main.go b/cmd/protoc-gen-go-json/main.go index 85b8df62..bd3efa0d 100644 --- a/cmd/protoc-gen-go-json/main.go +++ b/cmd/protoc-gen-go-json/main.go @@ -22,6 +22,7 @@ func main() { var flags flag.FlagSet flags.BoolVar(&plugin.Params.Std, "std", false, "generate standard library (un)marshalers") + flags.BoolVar(&plugin.Params.LegacyFieldMaskMarshalling, "legacy_fieldmask_marshaling", false, "generate legacy fieldmask marshalers") flags.StringVar(&plugin.Params.Lang, "lang", "go", "language (go or gogo)") protogen.Options{ diff --git a/gogo/gogo.go b/gogo/gogo.go index fe57f30b..053d12af 100644 --- a/gogo/gogo.go +++ b/gogo/gogo.go @@ -57,7 +57,7 @@ func UnmarshalMessage(s *jsonplugin.UnmarshalState, v proto.Message) { } // MarshalAny marshals a Any WKT. -func MarshalAny(s *jsonplugin.MarshalState, v *types.Any) { +func MarshalAny(s *jsonplugin.MarshalState, v *types.Any, legacyFieldmask bool) { if v == nil { s.WriteNil() return @@ -141,7 +141,11 @@ func MarshalAny(s *jsonplugin.MarshalState, v *types.Any) { case *types.Duration: MarshalDuration(s, msg) case *types.FieldMask: - MarshalFieldMask(s, msg) + if legacyFieldmask { + MarshalLegacyFieldMask(s, msg) + } else { + MarshalFieldMask(s, msg) + } case *types.Struct: MarshalStruct(s, msg) case *types.Value: @@ -308,6 +312,14 @@ func MarshalFieldMask(s *jsonplugin.MarshalState, v *types.FieldMask) { s.WriteFieldMask(v) } +func MarshalLegacyFieldMask(s *jsonplugin.MarshalState, v *types.FieldMask) { + if v == nil { + s.WriteNil() + return + } + s.WriteLegacyFieldMask(v) +} + // UnmarshalFieldMask unmarshals a FieldMask WKT. func UnmarshalFieldMask(s *jsonplugin.UnmarshalState) *types.FieldMask { if s.ReadNil() { diff --git a/golang/golang.go b/golang/golang.go index 87325a1d..28c03e15 100644 --- a/golang/golang.go +++ b/golang/golang.go @@ -63,7 +63,7 @@ func UnmarshalMessage(s *jsonplugin.UnmarshalState, v proto.Message) { } // MarshalAny marshals an Any WKT. -func MarshalAny(s *jsonplugin.MarshalState, v *anypb.Any) { +func MarshalAny(s *jsonplugin.MarshalState, v *anypb.Any, legacyFieldmask bool) { if v == nil { s.WriteNil() return @@ -142,7 +142,11 @@ func MarshalAny(s *jsonplugin.MarshalState, v *anypb.Any) { case *durationpb.Duration: MarshalDuration(s, msg) case *fieldmaskpb.FieldMask: - MarshalFieldMask(s, msg) + if legacyFieldmask { + MarshalLegacyFieldMask(s, msg) + } else { + MarshalFieldMask(s, msg) + } case *structpb.Struct: MarshalStruct(s, msg) case *structpb.Value: @@ -300,6 +304,14 @@ func MarshalFieldMask(s *jsonplugin.MarshalState, v *fieldmaskpb.FieldMask) { s.WriteFieldMask(v) } +func MarshalLegacyFieldMask(s *jsonplugin.MarshalState, v *fieldmaskpb.FieldMask) { + if v == nil { + s.WriteNil() + return + } + s.WriteLegacyFieldMask(v) +} + // UnmarshalFieldMask unmarshals a FieldMask WKT. func UnmarshalFieldMask(s *jsonplugin.UnmarshalState) *fieldmaskpb.FieldMask { if s.ReadNil() { diff --git a/internal/gen/gen.go b/internal/gen/gen.go index f9ee99ee..72f40a79 100644 --- a/internal/gen/gen.go +++ b/internal/gen/gen.go @@ -14,8 +14,9 @@ var Version = "0.0.0-dev" // Params are the parameters for the generator. var Params struct { - Lang string - Std bool + Lang string + Std bool + LegacyFieldMaskMarshalling bool } const ( diff --git a/internal/gen/messages_marshaler.go b/internal/gen/messages_marshaler.go index 269e9fc2..57d7ce61 100644 --- a/internal/gen/messages_marshaler.go +++ b/internal/gen/messages_marshaler.go @@ -473,11 +473,15 @@ func (g *generator) writeWKTValue(field *protogen.Field, message *protogen.Messa } switch message.Desc.FullName() { case "google.protobuf.Any": - g.P(pluginPackage.Ident("MarshalAny"), "(s, ", ident, ")") + g.P(pluginPackage.Ident("MarshalAny"), "(s, ", ident, ", ", Params.LegacyFieldMaskMarshalling, ")") case "google.protobuf.Empty": g.P(pluginPackage.Ident("MarshalEmpty"), "(s, ", ident, ")") case "google.protobuf.FieldMask": - g.P(pluginPackage.Ident("MarshalFieldMask"), "(s, ", ident, ")") + if Params.LegacyFieldMaskMarshalling { + g.P(pluginPackage.Ident("MarshalLegacyFieldMask"), "(s, ", ident, ")") + } else { + g.P(pluginPackage.Ident("MarshalFieldMask"), "(s, ", ident, ")") + } case "google.protobuf.Struct": g.P(pluginPackage.Ident("MarshalStruct"), "(s, ", ident, ")") case "google.protobuf.Value": diff --git a/jsonplugin/marshal.go b/jsonplugin/marshal.go index eceb21cc..db2e8ef7 100644 --- a/jsonplugin/marshal.go +++ b/jsonplugin/marshal.go @@ -581,3 +581,21 @@ func (s *MarshalState) WriteFieldMask(x FieldMask) { paths := x.GetPaths() s.inner.WriteString(strings.Join(paths, ",")) } + +func (s *MarshalState) WriteLegacyFieldMask(x FieldMask) { + if s.Err() != nil { + return + } + paths := x.GetPaths() + s.inner.WriteObjectStart() + s.inner.WriteObjectField("paths") + s.inner.WriteArrayStart() + for i, path := range paths { + if i != 0 { + s.inner.WriteMore() + } + s.inner.WriteString(path) + } + s.inner.WriteArrayEnd() + s.inner.WriteObjectEnd() +} diff --git a/test/gogo/wkts_json.pb.go b/test/gogo/wkts_json.pb.go index 26361ed8..6f9461ff 100644 --- a/test/gogo/wkts_json.pb.go +++ b/test/gogo/wkts_json.pb.go @@ -452,7 +452,7 @@ func (x *MessageWithWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x.AnyValue == nil { s.WriteNil() } else { - gogo.MarshalAny(s, x.AnyValue) + gogo.MarshalAny(s, x.AnyValue, false) } } if len(x.AnyValues) > 0 || s.HasField("any_values") { @@ -465,7 +465,7 @@ func (x *MessageWithWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { if element == nil { s.WriteNil() } else { - gogo.MarshalAny(s, element) + gogo.MarshalAny(s, element, false) } } s.WriteArrayEnd() @@ -1084,7 +1084,7 @@ func (x *MessageWithOneofWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { if ov.AnyValue == nil { s.WriteNil() } else { - gogo.MarshalAny(s, ov.AnyValue) + gogo.MarshalAny(s, ov.AnyValue, false) } } } @@ -1610,7 +1610,7 @@ func (x *MessageWithWKTMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { if v == nil { s.WriteNil() } else { - gogo.MarshalAny(s, v) + gogo.MarshalAny(s, v, false) } } s.WriteObjectEnd() diff --git a/test/golang/wkts_json.pb.go b/test/golang/wkts_json.pb.go index 53b2c26e..7959dc18 100644 --- a/test/golang/wkts_json.pb.go +++ b/test/golang/wkts_json.pb.go @@ -458,7 +458,7 @@ func (x *MessageWithWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { if x.AnyValue == nil { s.WriteNil() } else { - golang.MarshalAny(s, x.AnyValue) + golang.MarshalAny(s, x.AnyValue, false) } } if len(x.AnyValues) > 0 || s.HasField("any_values") { @@ -471,7 +471,7 @@ func (x *MessageWithWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { if element == nil { s.WriteNil() } else { - golang.MarshalAny(s, element) + golang.MarshalAny(s, element, false) } } s.WriteArrayEnd() @@ -1090,7 +1090,7 @@ func (x *MessageWithOneofWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { if ov.AnyValue == nil { s.WriteNil() } else { - golang.MarshalAny(s, ov.AnyValue) + golang.MarshalAny(s, ov.AnyValue, false) } } } @@ -1616,7 +1616,7 @@ func (x *MessageWithWKTMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { if v == nil { s.WriteNil() } else { - golang.MarshalAny(s, v) + golang.MarshalAny(s, v, false) } } s.WriteObjectEnd() From f3414c2fc7f84b09e7e41901d7b298498aee56c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 10:13:49 +0200 Subject: [PATCH 36/46] Bump google.golang.org/protobuf from 1.28.1 to 1.30.0 (#23) Bumps google.golang.org/protobuf from 1.28.1 to 1.30.0. --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 09e886dc..861fec9f 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/gogo/protobuf v1.3.2 github.com/google/go-cmp v0.5.9 github.com/json-iterator/go v1.1.12 - google.golang.org/protobuf v1.28.1 + google.golang.org/protobuf v1.30.0 ) require ( diff --git a/go.sum b/go.sum index 0e300fe0..88ee016d 100644 --- a/go.sum +++ b/go.sum @@ -50,5 +50,5 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= From 43edfcbb131a40ec7ddb1e75d27ab4c80ac9aaf1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 18:14:43 +0200 Subject: [PATCH 37/46] Bump actions/setup-go from 3 to 4 (#22) * Bump actions/setup-go from 3 to 4 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Remove explicit build caching * Remove gogo references * Update dependencies --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Adrian-Stefan Mares --- .github/workflows/go-code.yml | 11 +- Makefile | 26 +- cmd/protoc-gen-go-json/main.go | 2 +- go.mod | 1 - go.sum | 30 - gogo/gogo.go | 429 ------ internal/gen/gen.go | 4 - internal/gen/messages.go | 30 - internal/gen/messages_marshaler.go | 25 +- internal/gen/messages_unmarshaler.go | 13 - internal/gogoproto/gogo.pb.go | 1299 ----------------- internal/gogoproto/gogo.proto | 143 -- test/enums.proto | 7 - test/gogo.proto | 102 -- test/gogo/api.pb.go | 34 - test/gogo/enums.pb.go | 334 ----- test/gogo/enums_json.pb.go | 300 ---- test/gogo/enums_test.go | 206 --- test/gogo/fieldmask.pb.go | 363 ----- test/gogo/fieldmask_json.pb.go | 305 ---- test/gogo/gogo.pb.go | 364 ----- test/gogo/gogo_json.pb.go | 421 ------ test/gogo/gogo_test.go | 280 ---- test/gogo/scalars.pb.go | 953 ------------- test/gogo/scalars_json.pb.go | 1166 ---------------- test/gogo/scalars_test.go | 635 --------- test/gogo/utils_test.go | 132 -- test/gogo/wkts.pb.go | 973 ------------- test/gogo/wkts_json.pb.go | 1916 -------------------------- test/gogo/wkts_test.go | 947 ------------- test/golang/enums.pb.go | 124 +- test/golang/gogo.pb.go | 704 ---------- test/golang/gogo_json.pb.go | 444 ------ test/golang/gogo_test.go | 262 ---- 34 files changed, 69 insertions(+), 12916 deletions(-) delete mode 100644 gogo/gogo.go delete mode 100644 internal/gogoproto/gogo.pb.go delete mode 100644 internal/gogoproto/gogo.proto delete mode 100644 test/gogo.proto delete mode 100644 test/gogo/api.pb.go delete mode 100644 test/gogo/enums.pb.go delete mode 100644 test/gogo/enums_json.pb.go delete mode 100644 test/gogo/enums_test.go delete mode 100644 test/gogo/fieldmask.pb.go delete mode 100644 test/gogo/fieldmask_json.pb.go delete mode 100644 test/gogo/gogo.pb.go delete mode 100644 test/gogo/gogo_json.pb.go delete mode 100644 test/gogo/gogo_test.go delete mode 100644 test/gogo/scalars.pb.go delete mode 100644 test/gogo/scalars_json.pb.go delete mode 100644 test/gogo/scalars_test.go delete mode 100644 test/gogo/utils_test.go delete mode 100644 test/gogo/wkts.pb.go delete mode 100644 test/gogo/wkts_json.pb.go delete mode 100644 test/gogo/wkts_test.go delete mode 100644 test/golang/gogo.pb.go delete mode 100644 test/golang/gogo_json.pb.go delete mode 100644 test/golang/gogo_test.go diff --git a/.github/workflows/go-code.yml b/.github/workflows/go-code.yml index 36c655e4..f5c0f937 100644 --- a/.github/workflows/go-code.yml +++ b/.github/workflows/go-code.yml @@ -7,22 +7,15 @@ on: jobs: test: name: Go Test - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 timeout-minutes: 10 steps: - name: Check out code uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: "~1.17" - - name: Initialize Go module cache - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: go-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - go-mod-${{ runner.os }}- - name: Clean Build run: make clean build - name: Go Test diff --git a/Makefile b/Makefile index 4318376e..433df6d0 100644 --- a/Makefile +++ b/Makefile @@ -18,10 +18,7 @@ clean: annotations/annotations.pb.go: .dev/protoc-gen-go-json/annotations.proto .dev/golangproto/bin/protoc .dev/golangproto/bin/protoc-gen-go PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I .dev --go_opt=module=github.com/TheThingsIndustries/protoc-gen-go-json --go_out=./ $< -internal/gogoproto/gogo.pb.go: internal/gogoproto/gogo.proto .dev/golangproto/bin/protoc .dev/golangproto/bin/protoc-gen-go - PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I . --go_opt=paths=source_relative --go_out=./ ./internal/gogoproto/gogo.proto - -BINARY_DEPS = annotations/annotations.pb.go internal/gogoproto/gogo.pb.go $(wildcard cmd/protoc-gen-go-json/*.go) $(wildcard internal/gen/*.go) +BINARY_DEPS = annotations/annotations.pb.go $(wildcard cmd/protoc-gen-go-json/*.go) $(wildcard internal/gen/*.go) VERSION ?= 0.0.0-dev @@ -36,8 +33,6 @@ LDFLAGS = -X github.com/TheThingsIndustries/protoc-gen-go-json/internal/gen.Vers .bin/protoc-gen-go-json-linux-arm64: $(BINARY_DEPS) CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o $@ ./cmd/protoc-gen-go-json -REPLACES = Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor,Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types - .PHONY: build build: .bin/protoc-gen-go-json .bin/protoc-gen-go-json-linux-amd64 .bin/protoc-gen-go-json-linux-arm64 @@ -60,33 +55,18 @@ endif curl -sSL -o .dev/golangproto/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.20.1/protoc-3.20.1-$(OS)-x86_64.zip unzip -o .dev/golangproto/protoc.zip -d .dev/golangproto/ -.dev/gogoproto/bin/protoc: - mkdir -p .dev/gogoproto/bin - curl -sSL -o .dev/gogoproto/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.9.1/protoc-3.9.1-$(OS)-x86_64.zip - unzip -o .dev/gogoproto/protoc.zip -d .dev/gogoproto/ - curl -sSL -o .dev/gogoproto/gogoproto.zip https://github.com/gogo/protobuf/archive/refs/heads/master.zip - unzip -o .dev/gogoproto/gogoproto.zip protobuf-master/protobuf/google/protobuf/*.proto -d .dev/gogoproto - mv .dev/gogoproto/protobuf-master/protobuf/google/protobuf/*.proto .dev/gogoproto/include/google/protobuf/ - .dev/golangproto/bin/protoc-gen-go: go build -o $@ google.golang.org/protobuf/cmd/protoc-gen-go -.dev/gogoproto/bin/protoc-gen-gogo: - go build -o $@ github.com/gogo/protobuf/protoc-gen-gogo - .PHONY: testprotos -testprotos: build .dev/golangproto/bin/protoc .dev/gogoproto/bin/protoc .dev/golangproto/bin/protoc-gen-go .dev/gogoproto/bin/protoc-gen-gogo +testprotos: build .dev/golangproto/bin/protoc .dev/golangproto/bin/protoc-gen-go PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I ./test -I . \ --go_opt=paths=source_relative --go_out=./test/golang \ --go-json_opt=paths=source_relative --go-json_opt=std=true --go-json_out=./test/golang \ ./test/*.proto - PATH="$$PWD/.bin:$$PWD/.dev/gogoproto/bin:$$PATH" protoc -I ./test -I . \ - --gogo_opt=paths=source_relative --gogo_opt=$(REPLACES) --gogo_out=./test/gogo \ - --go-json_opt=paths=source_relative --go-json_opt=$(REPLACES) --go-json_opt=lang=gogo --go-json_opt=std=true --go-json_out=./test/gogo \ - ./test/*.proto .PHONY: test test: testprotos - go test ./jsonplugin ./test/gogo ./test/golang + go test ./jsonplugin ./test/golang diff --git a/cmd/protoc-gen-go-json/main.go b/cmd/protoc-gen-go-json/main.go index bd3efa0d..cd4e81d4 100644 --- a/cmd/protoc-gen-go-json/main.go +++ b/cmd/protoc-gen-go-json/main.go @@ -23,7 +23,7 @@ func main() { var flags flag.FlagSet flags.BoolVar(&plugin.Params.Std, "std", false, "generate standard library (un)marshalers") flags.BoolVar(&plugin.Params.LegacyFieldMaskMarshalling, "legacy_fieldmask_marshaling", false, "generate legacy fieldmask marshalers") - flags.StringVar(&plugin.Params.Lang, "lang", "go", "language (go or gogo)") + flags.StringVar(&plugin.Params.Lang, "lang", "go", "language (go)") protogen.Options{ ParamFunc: flags.Set, diff --git a/go.mod b/go.mod index 861fec9f..d20c8ab6 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module github.com/TheThingsIndustries/protoc-gen-go-json go 1.17 require ( - github.com/gogo/protobuf v1.3.2 github.com/google/go-cmp v0.5.9 github.com/json-iterator/go v1.1.12 google.golang.org/protobuf v1.30.0 diff --git a/go.sum b/go.sum index 88ee016d..da212cdf 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= @@ -10,8 +8,6 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -22,33 +18,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/gogo/gogo.go b/gogo/gogo.go deleted file mode 100644 index 053d12af..00000000 --- a/gogo/gogo.go +++ /dev/null @@ -1,429 +0,0 @@ -// Copyright © 2021 The Things Industries B.V. -// SPDX-License-Identifier: Apache-2.0 - -package gogoplugin - -import ( - "bytes" - "reflect" - "strings" - - "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" - "github.com/gogo/protobuf/jsonpb" - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/types" -) - -// MarshalMessage marshals a message with the standard JSON marshaler. -func MarshalMessage(s *jsonplugin.MarshalState, v proto.Message) { - rv := reflect.ValueOf(v) - - // If v is nil or typed nil, we write null. - if v == nil || (rv.Kind() == reflect.Ptr && rv.IsNil()) { - s.WriteNil() - return - } - - // Let gogo jsonpb marshal v. - err := (&jsonpb.Marshaler{ - OrigName: true, - EnumsAsInts: s.Config().EnumsAsInts, - }).Marshal(s, v) - if err != nil { - s.SetErrorf("failed to marshal %s to JSON: %w", proto.MessageName(v), err) - } -} - -// UnmarshalMessage unmarshals a message with the standard JSON unmarshaler. -func UnmarshalMessage(s *jsonplugin.UnmarshalState, v proto.Message) { - // If we read null, don't do anything. - if s.ReadNil() { - return - } - - // Read the raw object. - data := s.ReadRawMessage() - if s.Err() != nil { - return - } - - // Let gogo jsonpb unmarshal v. - err := (&jsonpb.Unmarshaler{ - AllowUnknownFields: true, - }).Unmarshal(bytes.NewBuffer(data), v) - if err != nil { - s.SetErrorf("failed to unmarshal %s from JSON: %w", proto.MessageName(v), err) - } -} - -// MarshalAny marshals a Any WKT. -func MarshalAny(s *jsonplugin.MarshalState, v *types.Any, legacyFieldmask bool) { - if v == nil { - s.WriteNil() - return - } - - // We first need to get the wrapped message out of the Any. - // To do this, we instantiate an empty message of the type of the wrapped message. - // Then we unmarshal the Any into that empty message. - msg, err := types.EmptyAny(v) - if err != nil { - s.SetErrorf("unknown message type %q for Any: %w", v.GetTypeUrl(), err) - } - if err = types.UnmarshalAny(v, msg); err != nil { - s.SetErrorf("failed to unmarshal wrapped message from Any: %w", err) - } - - switch marshaler := msg.(type) { - default: - // If v doesn't implement jsonplugin.Marshaler, delegate to gogo jsonpb. - MarshalMessage(s, v) - case jsonplugin.Marshaler: - // Instantiate a sub-marshaler with the same configuration and marshal the wrapped message to that. - sub := s.Sub() - marshaler.MarshalProtoJSON(sub) - data, err := sub.Bytes() - if err != nil { - return - } - - // We need to prepend the @type field to that object, so we read the { character. - buf := bytes.NewBuffer(data) - objectStart, err := buf.ReadByte() - if err != nil { - s.SetError(err) - return - } - if objectStart != '{' { - s.SetErrorf("marshaled Any is not an object") - return - } - - // We take a look at the next token, because if it's a ", we'll need a comma after we write the @type field. - nextToken, err := buf.ReadByte() - if err != nil { - s.SetError(err) - return - } - buf.UnreadByte() - - // Write the opening { and the type field to the main marshaler. - s.WriteObjectStart() - s.WriteObjectField("@type") - s.WriteString(v.GetTypeUrl()) - - // If the next token is a ", we have more fields, so we need to write a comma. - // Otherwise, it's a } and we don't need a comma. - if nextToken == '"' { - s.WriteMore() - } - - // Write the rest of the buffer (the sub-object without the { character). - s.Write(buf.Bytes()) - case *types.Duration, - *types.FieldMask, - *types.Struct, - *types.Value, - *types.ListValue, - *types.Timestamp: - - // Write the opening { and the type field to the main marshaler. - s.WriteObjectStart() - s.WriteObjectField("@type") - s.WriteString(v.GetTypeUrl()) - - // Write the comma, and the next field, which is always "value" for these types. - s.WriteMore() - s.WriteObjectField("value") - - // Write the value. - switch msg := msg.(type) { - case *types.Duration: - MarshalDuration(s, msg) - case *types.FieldMask: - if legacyFieldmask { - MarshalLegacyFieldMask(s, msg) - } else { - MarshalFieldMask(s, msg) - } - case *types.Struct: - MarshalStruct(s, msg) - case *types.Value: - MarshalValue(s, msg) - case *types.ListValue: - MarshalListValue(s, msg) - case *types.Timestamp: - MarshalTimestamp(s, msg) - } - - // Write the closing }. - s.WriteObjectEnd() - } -} - -// UnmarshalAny unmarshals an Any WKT. -func UnmarshalAny(s *jsonplugin.UnmarshalState) *types.Any { - if s.ReadNil() { - return nil - } - - // Read the raw object and create a sub-unmarshaler for it. - data := s.ReadRawMessage() - if s.Err() != nil { - return nil - } - sub := s.Sub(data) - - // Read the first field in the object. This should be @type. - if key := sub.ReadObjectField(); key != "@type" { - s.SetErrorf("first field in Any is not @type, but %q", key) - return nil - } - typeURL := sub.ReadString() - if err := sub.Err(); err != nil { - return nil - } - - // Find the message type by the name that's in the type URL. - slash := strings.LastIndex(typeURL, "/") - if slash < 0 { - s.SetErrorf("invalid type URL %q", typeURL) - return nil - } - t := proto.MessageType(typeURL[slash+1:]) - if t == nil { - s.SetErrorf("unknown message type %q", typeURL[slash+1:]) - return nil - } - - // Allocate a new message of that type. - msg := reflect.New(t.Elem()).Interface().(proto.Message) - - switch unmarshaler := msg.(type) { - default: - // Delegate unmarshaling to gogo jsonpb. - var any types.Any - if err := (&jsonpb.Unmarshaler{ - AllowUnknownFields: true, - }).Unmarshal(bytes.NewBuffer(data), &any); err != nil { - s.SetErrorf("failed to unmarshal Any from JSON: %w", err) - return nil - } - return &any - case jsonplugin.Unmarshaler: - // Create another sub-unmarshaler for the raw data and unmarshal the message. - sub = s.Sub(data) - unmarshaler.UnmarshalProtoJSON(sub) - case *types.Duration, - *types.FieldMask, - *types.Struct, - *types.Value, - *types.ListValue, - *types.Timestamp: - if field := sub.ReadObjectField(); field != "value" { - s.SetErrorf("unexpected %q field in Any", field) - return nil - } - switch msg.(type) { - case *types.Duration: - msg = UnmarshalDuration(sub) - case *types.FieldMask: - msg = UnmarshalFieldMask(sub) - case *types.Struct: - msg = UnmarshalStruct(sub) - case *types.Value: - msg = UnmarshalValue(sub) - case *types.ListValue: - msg = UnmarshalListValue(sub) - case *types.Timestamp: - msg = UnmarshalTimestamp(sub) - } - } - - if err := sub.Err(); err != nil { - return nil - } - - if field := sub.ReadObjectField(); field != "" { - s.SetErrorf("unexpected %q field in Any", field) - return nil - } - - // Wrap the unmarshaled message in an Any and return that. - v, err := types.MarshalAny(msg) - if err != nil { - s.SetError(err) - return nil - } - return v -} - -// MarshalDuration marshals a Duration WKT. -func MarshalDuration(s *jsonplugin.MarshalState, v *types.Duration) { - if v == nil { - s.WriteNil() - return - } - d, err := types.DurationFromProto(v) - if err != nil { - s.SetErrorf("invalid duration: %w", err) - } - s.WriteDuration(d) -} - -// UnmarshalDuration unmarshals a Duration WKT. -func UnmarshalDuration(s *jsonplugin.UnmarshalState) *types.Duration { - if s.ReadNil() { - return nil - } - d := s.ReadDuration() - if s.Err() != nil { - return nil - } - return types.DurationProto(*d) -} - -// MarshalEmpty marshals an Empty WKT. -func MarshalEmpty(s *jsonplugin.MarshalState, _ *types.Empty) { - s.WriteObjectStart() - s.WriteObjectEnd() -} - -// UnmarshalEmpty unmarshals a Empty WKT. -func UnmarshalEmpty(s *jsonplugin.UnmarshalState) *types.Empty { - if s.ReadNil() { - return nil - } - s.ReadObject(func(key string) { - s.SetErrorf("unexpected key %q in Empty", key) - }) - if s.Err() != nil { - return nil - } - return &types.Empty{} -} - -// MarshalFieldMask marshals a FieldMask WKT. -func MarshalFieldMask(s *jsonplugin.MarshalState, v *types.FieldMask) { - if v == nil { - s.WriteNil() - return - } - s.WriteFieldMask(v) -} - -func MarshalLegacyFieldMask(s *jsonplugin.MarshalState, v *types.FieldMask) { - if v == nil { - s.WriteNil() - return - } - s.WriteLegacyFieldMask(v) -} - -// UnmarshalFieldMask unmarshals a FieldMask WKT. -func UnmarshalFieldMask(s *jsonplugin.UnmarshalState) *types.FieldMask { - if s.ReadNil() { - return nil - } - m := s.ReadFieldMask() - if s.Err() != nil { - return nil - } - return &types.FieldMask{Paths: m.GetPaths()} -} - -// MarshalStruct marshals a Struct WKT. -func MarshalStruct(s *jsonplugin.MarshalState, v *types.Struct) { - if v == nil { - s.WriteNil() - return - } - MarshalMessage(s, v) -} - -// UnmarshalStruct unmarshals a Struct WKT. -func UnmarshalStruct(s *jsonplugin.UnmarshalState) *types.Struct { - if s.ReadNil() { - return nil - } - var v types.Struct - UnmarshalMessage(s, &v) - if s.Err() != nil { - return nil - } - return &v -} - -// MarshalValue marshals a Value WKT. -func MarshalValue(s *jsonplugin.MarshalState, v *types.Value) { - if v == nil { - s.WriteNil() - return - } - MarshalMessage(s, v) -} - -// UnmarshalValue unmarshals a Value WKT. -func UnmarshalValue(s *jsonplugin.UnmarshalState) *types.Value { - if s.ReadNil() { - return &types.Value{Kind: &types.Value_NullValue{}} - } - var v types.Value - UnmarshalMessage(s, &v) - if s.Err() != nil { - return nil - } - return &v -} - -// MarshalListValue marshals a ListValue WKT. -func MarshalListValue(s *jsonplugin.MarshalState, v *types.ListValue) { - if v == nil { - s.WriteNil() - return - } - MarshalMessage(s, v) -} - -// UnmarshalListValue unmarshals a ListValue WKT. -func UnmarshalListValue(s *jsonplugin.UnmarshalState) *types.ListValue { - if s.ReadNil() { - return nil - } - var v types.ListValue - UnmarshalMessage(s, &v) - if s.Err() != nil { - return nil - } - return &v -} - -// MarshalTimestamp marshals a Timestamp WKT. -func MarshalTimestamp(s *jsonplugin.MarshalState, v *types.Timestamp) { - if v == nil { - s.WriteNil() - return - } - t, err := types.TimestampFromProto(v) - if err != nil { - s.SetErrorf("invalid time: %w", err) - } - s.WriteTime(t) -} - -// UnmarshalTimestamp unmarshals a Timestamp WKT. -func UnmarshalTimestamp(s *jsonplugin.UnmarshalState) *types.Timestamp { - if s.ReadNil() { - return nil - } - d := s.ReadTime() - if s.Err() != nil { - return nil - } - v, err := types.TimestampProto(*d) - if err != nil { - s.SetErrorf("invalid time: %w", err) - return nil - } - return v -} diff --git a/internal/gen/gen.go b/internal/gen/gen.go index 72f40a79..275290ad 100644 --- a/internal/gen/gen.go +++ b/internal/gen/gen.go @@ -24,13 +24,9 @@ const ( fmtPackage = protogen.GoImportPath("fmt") strconvPackage = protogen.GoImportPath("strconv") - gogoProtoTypesPackage = protogen.GoImportPath("github.com/gogo/protobuf/types") - - gogoProtoJSONPackage = protogen.GoImportPath("github.com/gogo/protobuf/jsonpb") golangProtoJSONPackage = protogen.GoImportPath("google.golang.org/protobuf/encoding/protojson") jsonPluginPackage = protogen.GoImportPath("github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin") - gogoPluginPackage = protogen.GoImportPath("github.com/TheThingsIndustries/protoc-gen-go-json/gogo") golangPluginPackage = protogen.GoImportPath("github.com/TheThingsIndustries/protoc-gen-go-json/golang") ) diff --git a/internal/gen/messages.go b/internal/gen/messages.go index f4525589..0b89983b 100644 --- a/internal/gen/messages.go +++ b/internal/gen/messages.go @@ -8,7 +8,6 @@ import ( "strings" "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" - "github.com/TheThingsIndustries/protoc-gen-go-json/internal/gogoproto" "google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" @@ -98,44 +97,15 @@ func (g *generator) genMessage(message *protogen.Message) { func fieldIsNullable(field *protogen.Field) bool { // Typically, only message fields are nullable (use pointers). nullable := field.Desc.Kind() == protoreflect.MessageKind - - // If we use gogo, the nullability of fields (messages, but also bytes fields with custom types) is controlled with the (gogoproto.nullable) option. - if Params.Lang == "gogo" { - if proto.HasExtension(field.Desc.Options(), gogoproto.E_Customtype) { - nullable = true - } - if proto.HasExtension(field.Desc.Options(), gogoproto.E_Nullable) { - nullable = proto.GetExtension(field.Desc.Options(), gogoproto.E_Nullable).(bool) - } - } - return nullable } func fieldGoName(field *protogen.Field) interface{} { var fieldGoName interface{} = field.GoName - if Params.Lang == "gogo" { - // If we use gogo, the GoName of a field can be overridden with the (gogoproto.customname) option. - if proto.HasExtension(field.Desc.Options(), gogoproto.E_Customname) { - fieldGoName = proto.GetExtension(field.Desc.Options(), gogoproto.E_Customname).(string) - } - // Fields with the (gogoproto.embed) option should use the name of the embedded message. - if proto.HasExtension(field.Desc.Options(), gogoproto.E_Embed) { - if proto.GetExtension(field.Desc.Options(), gogoproto.E_Embed).(bool) { - fieldGoName = field.Message.GoIdent - } - } - } return fieldGoName } func fieldCustomType(field *protogen.Field) *protogen.GoIdent { - if Params.Lang == "gogo" { - // If we use gogo, the type of a field can be overridden with the (gogoproto.customtype) option. - if proto.HasExtension(field.Desc.Options(), gogoproto.E_Customtype) { - return parseGoIdent(proto.GetExtension(field.Desc.Options(), gogoproto.E_Customtype).(string)) - } - } return nil } diff --git a/internal/gen/messages_marshaler.go b/internal/gen/messages_marshaler.go index 57d7ce61..ad1edc0c 100644 --- a/internal/gen/messages_marshaler.go +++ b/internal/gen/messages_marshaler.go @@ -7,7 +7,6 @@ import ( "fmt" "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" - "github.com/TheThingsIndustries/protoc-gen-go-json/internal/gogoproto" "google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" @@ -133,9 +132,6 @@ nextField: marshalerFunc *protogen.GoIdent ) fieldOpts := field.Desc.Options() - if Params.Lang == "gogo" { - pluginPackage = gogoPluginPackage - } if proto.HasExtension(fieldOpts, annotations.E_Field) { if customtype == nil { marshalerFunc = parseGoIdent(proto.GetExtension(field.Desc.Options(), annotations.E_Field).(*annotations.FieldOptions).GetMarshalerFunc()) @@ -368,7 +364,7 @@ nextField: g.P("if len(", messageOrOneofIdent, ".", fieldGoName, `) > 0 || s.HasField("`, field.Desc.Name(), `") {`) case protoreflect.MessageKind: // For not-nullable messages we have a dummy check. - g.P("if true { // (gogoproto.nullable) = false") + g.P("if true { ") } } } @@ -468,9 +464,6 @@ func (g *generator) writeWKTValue(field *protogen.Field, message *protogen.Messa g.P("} else {") } pluginPackage := golangPluginPackage - if Params.Lang == "gogo" { - pluginPackage = gogoPluginPackage - } switch message.Desc.FullName() { case "google.protobuf.Any": g.P(pluginPackage.Ident("MarshalAny"), "(s, ", ident, ", ", Params.LegacyFieldMaskMarshalling, ")") @@ -489,21 +482,9 @@ func (g *generator) writeWKTValue(field *protogen.Field, message *protogen.Messa case "google.protobuf.ListValue": g.P(pluginPackage.Ident("MarshalListValue"), "(s, ", ident, ")") case "google.protobuf.Timestamp": - if Params.Lang == "gogo" && proto.HasExtension(field.Desc.Options(), gogoproto.E_Stdtime) && proto.GetExtension(field.Desc.Options(), gogoproto.E_Stdtime).(bool) { - // If the file has the (gogoproto.stdtime) option, marshal the Go time directly. - g.P("s.WriteTime(", ifThenElse(nullable, "*", ""), ident, ")") - } else { - // Otherwise delegate to the library. - g.P(pluginPackage.Ident("MarshalTimestamp"), "(s, ", ident, ")") - } + g.P(pluginPackage.Ident("MarshalTimestamp"), "(s, ", ident, ")") case "google.protobuf.Duration": - if Params.Lang == "gogo" && proto.HasExtension(field.Desc.Options(), gogoproto.E_Stdduration) && proto.GetExtension(field.Desc.Options(), gogoproto.E_Stdduration).(bool) { - // If the file has the (gogoproto.stdduration) option, marshal the Go duration directly. - g.P("s.WriteDuration(", ifThenElse(nullable, "*", ""), ident, ")") - } else { - // Otherwise delegate to the library. - g.P(pluginPackage.Ident("MarshalDuration"), "(s, ", ident, ")") - } + g.P(pluginPackage.Ident("MarshalDuration"), "(s, ", ident, ")") default: g.gen.Error(fmt.Errorf("unsupported WKT %q", message.Desc.FullName())) } diff --git a/internal/gen/messages_unmarshaler.go b/internal/gen/messages_unmarshaler.go index c345c2bd..e22048b1 100644 --- a/internal/gen/messages_unmarshaler.go +++ b/internal/gen/messages_unmarshaler.go @@ -7,7 +7,6 @@ import ( "fmt" "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" - "github.com/TheThingsIndustries/protoc-gen-go-json/internal/gogoproto" "google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" @@ -132,9 +131,6 @@ nextField: unmarshalerFunc *protogen.GoIdent ) fieldOpts := field.Desc.Options() - if Params.Lang == "gogo" { - pluginPackage = gogoPluginPackage - } if proto.HasExtension(fieldOpts, annotations.E_Field) { if customtype == nil { unmarshalerFunc = parseGoIdent(proto.GetExtension(field.Desc.Options(), annotations.E_Field).(*annotations.FieldOptions).GetUnmarshalerFunc()) @@ -486,9 +482,6 @@ func (g *generator) readWrapperValue(message *protogen.Message) string { func (g *generator) readWKTValue(field *protogen.Field, message *protogen.Message) string { pluginPackage := golangPluginPackage - if Params.Lang == "gogo" { - pluginPackage = gogoPluginPackage - } switch message.Desc.FullName() { case "google.protobuf.Any": return g.QualifiedGoIdent(pluginPackage.Ident("UnmarshalAny")) + "(s)" @@ -503,14 +496,8 @@ func (g *generator) readWKTValue(field *protogen.Field, message *protogen.Messag case "google.protobuf.ListValue": return g.QualifiedGoIdent(pluginPackage.Ident("UnmarshalListValue")) + "(s)" case "google.protobuf.Timestamp": - if Params.Lang == "gogo" && proto.HasExtension(field.Desc.Options(), gogoproto.E_Stdtime) && proto.GetExtension(field.Desc.Options(), gogoproto.E_Stdtime).(bool) { - return "s.ReadTime()" - } return g.QualifiedGoIdent(pluginPackage.Ident("UnmarshalTimestamp")) + "(s)" case "google.protobuf.Duration": - if Params.Lang == "gogo" && proto.HasExtension(field.Desc.Options(), gogoproto.E_Stdduration) && proto.GetExtension(field.Desc.Options(), gogoproto.E_Stdduration).(bool) { - return "s.ReadDuration()" - } return g.QualifiedGoIdent(pluginPackage.Ident("UnmarshalDuration")) + "(s)" default: g.gen.Error(fmt.Errorf("unsupported WKT %q", message.Desc.FullName())) diff --git a/internal/gogoproto/gogo.pb.go b/internal/gogoproto/gogo.pb.go deleted file mode 100644 index e5fbc035..00000000 --- a/internal/gogoproto/gogo.pb.go +++ /dev/null @@ -1,1299 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: internal/gogoproto/gogo.proto - -package gogoproto - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - reflect "reflect" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var file_internal_gogoproto_gogo_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.EnumOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 62001, - Name: "gogoproto.goproto_enum_prefix", - Tag: "varint,62001,opt,name=goproto_enum_prefix", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.EnumOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 62021, - Name: "gogoproto.goproto_enum_stringer", - Tag: "varint,62021,opt,name=goproto_enum_stringer", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.EnumOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 62022, - Name: "gogoproto.enum_stringer", - Tag: "varint,62022,opt,name=enum_stringer", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.EnumOptions)(nil), - ExtensionType: (*string)(nil), - Field: 62023, - Name: "gogoproto.enum_customname", - Tag: "bytes,62023,opt,name=enum_customname", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.EnumOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 62024, - Name: "gogoproto.enumdecl", - Tag: "varint,62024,opt,name=enumdecl", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.EnumValueOptions)(nil), - ExtensionType: (*string)(nil), - Field: 66001, - Name: "gogoproto.enumvalue_customname", - Tag: "bytes,66001,opt,name=enumvalue_customname", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63001, - Name: "gogoproto.goproto_getters_all", - Tag: "varint,63001,opt,name=goproto_getters_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63002, - Name: "gogoproto.goproto_enum_prefix_all", - Tag: "varint,63002,opt,name=goproto_enum_prefix_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63003, - Name: "gogoproto.goproto_stringer_all", - Tag: "varint,63003,opt,name=goproto_stringer_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63004, - Name: "gogoproto.verbose_equal_all", - Tag: "varint,63004,opt,name=verbose_equal_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63005, - Name: "gogoproto.face_all", - Tag: "varint,63005,opt,name=face_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63006, - Name: "gogoproto.gostring_all", - Tag: "varint,63006,opt,name=gostring_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63007, - Name: "gogoproto.populate_all", - Tag: "varint,63007,opt,name=populate_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63008, - Name: "gogoproto.stringer_all", - Tag: "varint,63008,opt,name=stringer_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63009, - Name: "gogoproto.onlyone_all", - Tag: "varint,63009,opt,name=onlyone_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63013, - Name: "gogoproto.equal_all", - Tag: "varint,63013,opt,name=equal_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63014, - Name: "gogoproto.description_all", - Tag: "varint,63014,opt,name=description_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63015, - Name: "gogoproto.testgen_all", - Tag: "varint,63015,opt,name=testgen_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63016, - Name: "gogoproto.benchgen_all", - Tag: "varint,63016,opt,name=benchgen_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63017, - Name: "gogoproto.marshaler_all", - Tag: "varint,63017,opt,name=marshaler_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63018, - Name: "gogoproto.unmarshaler_all", - Tag: "varint,63018,opt,name=unmarshaler_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63019, - Name: "gogoproto.stable_marshaler_all", - Tag: "varint,63019,opt,name=stable_marshaler_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63020, - Name: "gogoproto.sizer_all", - Tag: "varint,63020,opt,name=sizer_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63021, - Name: "gogoproto.goproto_enum_stringer_all", - Tag: "varint,63021,opt,name=goproto_enum_stringer_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63022, - Name: "gogoproto.enum_stringer_all", - Tag: "varint,63022,opt,name=enum_stringer_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63023, - Name: "gogoproto.unsafe_marshaler_all", - Tag: "varint,63023,opt,name=unsafe_marshaler_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63024, - Name: "gogoproto.unsafe_unmarshaler_all", - Tag: "varint,63024,opt,name=unsafe_unmarshaler_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63025, - Name: "gogoproto.goproto_extensions_map_all", - Tag: "varint,63025,opt,name=goproto_extensions_map_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63026, - Name: "gogoproto.goproto_unrecognized_all", - Tag: "varint,63026,opt,name=goproto_unrecognized_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63027, - Name: "gogoproto.gogoproto_import", - Tag: "varint,63027,opt,name=gogoproto_import", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63028, - Name: "gogoproto.protosizer_all", - Tag: "varint,63028,opt,name=protosizer_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63029, - Name: "gogoproto.compare_all", - Tag: "varint,63029,opt,name=compare_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63030, - Name: "gogoproto.typedecl_all", - Tag: "varint,63030,opt,name=typedecl_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63031, - Name: "gogoproto.enumdecl_all", - Tag: "varint,63031,opt,name=enumdecl_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63032, - Name: "gogoproto.goproto_registration", - Tag: "varint,63032,opt,name=goproto_registration", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63033, - Name: "gogoproto.messagename_all", - Tag: "varint,63033,opt,name=messagename_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63034, - Name: "gogoproto.goproto_sizecache_all", - Tag: "varint,63034,opt,name=goproto_sizecache_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63035, - Name: "gogoproto.goproto_unkeyed_all", - Tag: "varint,63035,opt,name=goproto_unkeyed_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64001, - Name: "gogoproto.goproto_getters", - Tag: "varint,64001,opt,name=goproto_getters", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64003, - Name: "gogoproto.goproto_stringer", - Tag: "varint,64003,opt,name=goproto_stringer", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64004, - Name: "gogoproto.verbose_equal", - Tag: "varint,64004,opt,name=verbose_equal", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64005, - Name: "gogoproto.face", - Tag: "varint,64005,opt,name=face", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64006, - Name: "gogoproto.gostring", - Tag: "varint,64006,opt,name=gostring", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64007, - Name: "gogoproto.populate", - Tag: "varint,64007,opt,name=populate", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 67008, - Name: "gogoproto.stringer", - Tag: "varint,67008,opt,name=stringer", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64009, - Name: "gogoproto.onlyone", - Tag: "varint,64009,opt,name=onlyone", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64013, - Name: "gogoproto.equal", - Tag: "varint,64013,opt,name=equal", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64014, - Name: "gogoproto.description", - Tag: "varint,64014,opt,name=description", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64015, - Name: "gogoproto.testgen", - Tag: "varint,64015,opt,name=testgen", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64016, - Name: "gogoproto.benchgen", - Tag: "varint,64016,opt,name=benchgen", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64017, - Name: "gogoproto.marshaler", - Tag: "varint,64017,opt,name=marshaler", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64018, - Name: "gogoproto.unmarshaler", - Tag: "varint,64018,opt,name=unmarshaler", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64019, - Name: "gogoproto.stable_marshaler", - Tag: "varint,64019,opt,name=stable_marshaler", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64020, - Name: "gogoproto.sizer", - Tag: "varint,64020,opt,name=sizer", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64023, - Name: "gogoproto.unsafe_marshaler", - Tag: "varint,64023,opt,name=unsafe_marshaler", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64024, - Name: "gogoproto.unsafe_unmarshaler", - Tag: "varint,64024,opt,name=unsafe_unmarshaler", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64025, - Name: "gogoproto.goproto_extensions_map", - Tag: "varint,64025,opt,name=goproto_extensions_map", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64026, - Name: "gogoproto.goproto_unrecognized", - Tag: "varint,64026,opt,name=goproto_unrecognized", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64028, - Name: "gogoproto.protosizer", - Tag: "varint,64028,opt,name=protosizer", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64029, - Name: "gogoproto.compare", - Tag: "varint,64029,opt,name=compare", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64030, - Name: "gogoproto.typedecl", - Tag: "varint,64030,opt,name=typedecl", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64033, - Name: "gogoproto.messagename", - Tag: "varint,64033,opt,name=messagename", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64034, - Name: "gogoproto.goproto_sizecache", - Tag: "varint,64034,opt,name=goproto_sizecache", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64035, - Name: "gogoproto.goproto_unkeyed", - Tag: "varint,64035,opt,name=goproto_unkeyed", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65001, - Name: "gogoproto.nullable", - Tag: "varint,65001,opt,name=nullable", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65002, - Name: "gogoproto.embed", - Tag: "varint,65002,opt,name=embed", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65003, - Name: "gogoproto.customtype", - Tag: "bytes,65003,opt,name=customtype", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65004, - Name: "gogoproto.customname", - Tag: "bytes,65004,opt,name=customname", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65005, - Name: "gogoproto.jsontag", - Tag: "bytes,65005,opt,name=jsontag", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65006, - Name: "gogoproto.moretags", - Tag: "bytes,65006,opt,name=moretags", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65007, - Name: "gogoproto.casttype", - Tag: "bytes,65007,opt,name=casttype", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65008, - Name: "gogoproto.castkey", - Tag: "bytes,65008,opt,name=castkey", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65009, - Name: "gogoproto.castvalue", - Tag: "bytes,65009,opt,name=castvalue", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65010, - Name: "gogoproto.stdtime", - Tag: "varint,65010,opt,name=stdtime", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65011, - Name: "gogoproto.stdduration", - Tag: "varint,65011,opt,name=stdduration", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65012, - Name: "gogoproto.wktpointer", - Tag: "varint,65012,opt,name=wktpointer", - Filename: "internal/gogoproto/gogo.proto", - }, -} - -// Extension fields to descriptorpb.EnumOptions. -var ( - // optional bool goproto_enum_prefix = 62001; - E_GoprotoEnumPrefix = &file_internal_gogoproto_gogo_proto_extTypes[0] - // optional bool goproto_enum_stringer = 62021; - E_GoprotoEnumStringer = &file_internal_gogoproto_gogo_proto_extTypes[1] - // optional bool enum_stringer = 62022; - E_EnumStringer = &file_internal_gogoproto_gogo_proto_extTypes[2] - // optional string enum_customname = 62023; - E_EnumCustomname = &file_internal_gogoproto_gogo_proto_extTypes[3] - // optional bool enumdecl = 62024; - E_Enumdecl = &file_internal_gogoproto_gogo_proto_extTypes[4] -) - -// Extension fields to descriptorpb.EnumValueOptions. -var ( - // optional string enumvalue_customname = 66001; - E_EnumvalueCustomname = &file_internal_gogoproto_gogo_proto_extTypes[5] -) - -// Extension fields to descriptorpb.FileOptions. -var ( - // optional bool goproto_getters_all = 63001; - E_GoprotoGettersAll = &file_internal_gogoproto_gogo_proto_extTypes[6] - // optional bool goproto_enum_prefix_all = 63002; - E_GoprotoEnumPrefixAll = &file_internal_gogoproto_gogo_proto_extTypes[7] - // optional bool goproto_stringer_all = 63003; - E_GoprotoStringerAll = &file_internal_gogoproto_gogo_proto_extTypes[8] - // optional bool verbose_equal_all = 63004; - E_VerboseEqualAll = &file_internal_gogoproto_gogo_proto_extTypes[9] - // optional bool face_all = 63005; - E_FaceAll = &file_internal_gogoproto_gogo_proto_extTypes[10] - // optional bool gostring_all = 63006; - E_GostringAll = &file_internal_gogoproto_gogo_proto_extTypes[11] - // optional bool populate_all = 63007; - E_PopulateAll = &file_internal_gogoproto_gogo_proto_extTypes[12] - // optional bool stringer_all = 63008; - E_StringerAll = &file_internal_gogoproto_gogo_proto_extTypes[13] - // optional bool onlyone_all = 63009; - E_OnlyoneAll = &file_internal_gogoproto_gogo_proto_extTypes[14] - // optional bool equal_all = 63013; - E_EqualAll = &file_internal_gogoproto_gogo_proto_extTypes[15] - // optional bool description_all = 63014; - E_DescriptionAll = &file_internal_gogoproto_gogo_proto_extTypes[16] - // optional bool testgen_all = 63015; - E_TestgenAll = &file_internal_gogoproto_gogo_proto_extTypes[17] - // optional bool benchgen_all = 63016; - E_BenchgenAll = &file_internal_gogoproto_gogo_proto_extTypes[18] - // optional bool marshaler_all = 63017; - E_MarshalerAll = &file_internal_gogoproto_gogo_proto_extTypes[19] - // optional bool unmarshaler_all = 63018; - E_UnmarshalerAll = &file_internal_gogoproto_gogo_proto_extTypes[20] - // optional bool stable_marshaler_all = 63019; - E_StableMarshalerAll = &file_internal_gogoproto_gogo_proto_extTypes[21] - // optional bool sizer_all = 63020; - E_SizerAll = &file_internal_gogoproto_gogo_proto_extTypes[22] - // optional bool goproto_enum_stringer_all = 63021; - E_GoprotoEnumStringerAll = &file_internal_gogoproto_gogo_proto_extTypes[23] - // optional bool enum_stringer_all = 63022; - E_EnumStringerAll = &file_internal_gogoproto_gogo_proto_extTypes[24] - // optional bool unsafe_marshaler_all = 63023; - E_UnsafeMarshalerAll = &file_internal_gogoproto_gogo_proto_extTypes[25] - // optional bool unsafe_unmarshaler_all = 63024; - E_UnsafeUnmarshalerAll = &file_internal_gogoproto_gogo_proto_extTypes[26] - // optional bool goproto_extensions_map_all = 63025; - E_GoprotoExtensionsMapAll = &file_internal_gogoproto_gogo_proto_extTypes[27] - // optional bool goproto_unrecognized_all = 63026; - E_GoprotoUnrecognizedAll = &file_internal_gogoproto_gogo_proto_extTypes[28] - // optional bool gogoproto_import = 63027; - E_GogoprotoImport = &file_internal_gogoproto_gogo_proto_extTypes[29] - // optional bool protosizer_all = 63028; - E_ProtosizerAll = &file_internal_gogoproto_gogo_proto_extTypes[30] - // optional bool compare_all = 63029; - E_CompareAll = &file_internal_gogoproto_gogo_proto_extTypes[31] - // optional bool typedecl_all = 63030; - E_TypedeclAll = &file_internal_gogoproto_gogo_proto_extTypes[32] - // optional bool enumdecl_all = 63031; - E_EnumdeclAll = &file_internal_gogoproto_gogo_proto_extTypes[33] - // optional bool goproto_registration = 63032; - E_GoprotoRegistration = &file_internal_gogoproto_gogo_proto_extTypes[34] - // optional bool messagename_all = 63033; - E_MessagenameAll = &file_internal_gogoproto_gogo_proto_extTypes[35] - // optional bool goproto_sizecache_all = 63034; - E_GoprotoSizecacheAll = &file_internal_gogoproto_gogo_proto_extTypes[36] - // optional bool goproto_unkeyed_all = 63035; - E_GoprotoUnkeyedAll = &file_internal_gogoproto_gogo_proto_extTypes[37] -) - -// Extension fields to descriptorpb.MessageOptions. -var ( - // optional bool goproto_getters = 64001; - E_GoprotoGetters = &file_internal_gogoproto_gogo_proto_extTypes[38] - // optional bool goproto_stringer = 64003; - E_GoprotoStringer = &file_internal_gogoproto_gogo_proto_extTypes[39] - // optional bool verbose_equal = 64004; - E_VerboseEqual = &file_internal_gogoproto_gogo_proto_extTypes[40] - // optional bool face = 64005; - E_Face = &file_internal_gogoproto_gogo_proto_extTypes[41] - // optional bool gostring = 64006; - E_Gostring = &file_internal_gogoproto_gogo_proto_extTypes[42] - // optional bool populate = 64007; - E_Populate = &file_internal_gogoproto_gogo_proto_extTypes[43] - // optional bool stringer = 67008; - E_Stringer = &file_internal_gogoproto_gogo_proto_extTypes[44] - // optional bool onlyone = 64009; - E_Onlyone = &file_internal_gogoproto_gogo_proto_extTypes[45] - // optional bool equal = 64013; - E_Equal = &file_internal_gogoproto_gogo_proto_extTypes[46] - // optional bool description = 64014; - E_Description = &file_internal_gogoproto_gogo_proto_extTypes[47] - // optional bool testgen = 64015; - E_Testgen = &file_internal_gogoproto_gogo_proto_extTypes[48] - // optional bool benchgen = 64016; - E_Benchgen = &file_internal_gogoproto_gogo_proto_extTypes[49] - // optional bool marshaler = 64017; - E_Marshaler = &file_internal_gogoproto_gogo_proto_extTypes[50] - // optional bool unmarshaler = 64018; - E_Unmarshaler = &file_internal_gogoproto_gogo_proto_extTypes[51] - // optional bool stable_marshaler = 64019; - E_StableMarshaler = &file_internal_gogoproto_gogo_proto_extTypes[52] - // optional bool sizer = 64020; - E_Sizer = &file_internal_gogoproto_gogo_proto_extTypes[53] - // optional bool unsafe_marshaler = 64023; - E_UnsafeMarshaler = &file_internal_gogoproto_gogo_proto_extTypes[54] - // optional bool unsafe_unmarshaler = 64024; - E_UnsafeUnmarshaler = &file_internal_gogoproto_gogo_proto_extTypes[55] - // optional bool goproto_extensions_map = 64025; - E_GoprotoExtensionsMap = &file_internal_gogoproto_gogo_proto_extTypes[56] - // optional bool goproto_unrecognized = 64026; - E_GoprotoUnrecognized = &file_internal_gogoproto_gogo_proto_extTypes[57] - // optional bool protosizer = 64028; - E_Protosizer = &file_internal_gogoproto_gogo_proto_extTypes[58] - // optional bool compare = 64029; - E_Compare = &file_internal_gogoproto_gogo_proto_extTypes[59] - // optional bool typedecl = 64030; - E_Typedecl = &file_internal_gogoproto_gogo_proto_extTypes[60] - // optional bool messagename = 64033; - E_Messagename = &file_internal_gogoproto_gogo_proto_extTypes[61] - // optional bool goproto_sizecache = 64034; - E_GoprotoSizecache = &file_internal_gogoproto_gogo_proto_extTypes[62] - // optional bool goproto_unkeyed = 64035; - E_GoprotoUnkeyed = &file_internal_gogoproto_gogo_proto_extTypes[63] -) - -// Extension fields to descriptorpb.FieldOptions. -var ( - // optional bool nullable = 65001; - E_Nullable = &file_internal_gogoproto_gogo_proto_extTypes[64] - // optional bool embed = 65002; - E_Embed = &file_internal_gogoproto_gogo_proto_extTypes[65] - // optional string customtype = 65003; - E_Customtype = &file_internal_gogoproto_gogo_proto_extTypes[66] - // optional string customname = 65004; - E_Customname = &file_internal_gogoproto_gogo_proto_extTypes[67] - // optional string jsontag = 65005; - E_Jsontag = &file_internal_gogoproto_gogo_proto_extTypes[68] - // optional string moretags = 65006; - E_Moretags = &file_internal_gogoproto_gogo_proto_extTypes[69] - // optional string casttype = 65007; - E_Casttype = &file_internal_gogoproto_gogo_proto_extTypes[70] - // optional string castkey = 65008; - E_Castkey = &file_internal_gogoproto_gogo_proto_extTypes[71] - // optional string castvalue = 65009; - E_Castvalue = &file_internal_gogoproto_gogo_proto_extTypes[72] - // optional bool stdtime = 65010; - E_Stdtime = &file_internal_gogoproto_gogo_proto_extTypes[73] - // optional bool stdduration = 65011; - E_Stdduration = &file_internal_gogoproto_gogo_proto_extTypes[74] - // optional bool wktpointer = 65012; - E_Wktpointer = &file_internal_gogoproto_gogo_proto_extTypes[75] -) - -var File_internal_gogoproto_gogo_proto protoreflect.FileDescriptor - -var file_internal_gogoproto_gogo_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x09, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3a, 0x4e, 0x0a, 0x13, - 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0xb1, 0xe4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x67, 0x6f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x45, 0x6e, 0x75, 0x6d, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x3a, 0x52, 0x0a, 0x15, - 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0xc5, 0xe4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x67, 0x6f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x45, 0x6e, 0x75, 0x6d, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, - 0x3a, 0x43, 0x0a, 0x0d, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, - 0x72, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0xc6, 0xe4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x65, 0x6e, 0x75, 0x6d, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x65, 0x72, 0x3a, 0x47, 0x0a, 0x0f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc7, 0xe4, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x65, 0x6e, 0x75, 0x6d, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x3a, - 0x0a, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x64, 0x65, 0x63, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, - 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc8, 0xe4, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x64, 0x65, 0x63, 0x6c, 0x3a, 0x56, 0x0a, 0x14, 0x65, 0x6e, - 0x75, 0x6d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xd1, 0x83, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x65, - 0x6e, 0x75, 0x6d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, - 0x6d, 0x65, 0x3a, 0x4e, 0x0a, 0x13, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x67, 0x65, - 0x74, 0x74, 0x65, 0x72, 0x73, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x99, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x11, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x73, 0x41, - 0x6c, 0x6c, 0x3a, 0x55, 0x0a, 0x17, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, 0x6e, - 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9a, 0xec, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x14, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x45, 0x6e, 0x75, 0x6d, - 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x41, 0x6c, 0x6c, 0x3a, 0x50, 0x0a, 0x14, 0x67, 0x6f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x61, 0x6c, - 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x9b, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x4a, 0x0a, 0x11, 0x76, - 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x5f, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x5f, 0x61, 0x6c, 0x6c, - 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9c, - 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x45, - 0x71, 0x75, 0x61, 0x6c, 0x41, 0x6c, 0x6c, 0x3a, 0x39, 0x0a, 0x08, 0x66, 0x61, 0x63, 0x65, 0x5f, - 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x9d, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x41, - 0x6c, 0x6c, 0x3a, 0x41, 0x0a, 0x0c, 0x67, 0x6f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x61, - 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x9e, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x67, 0x6f, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x41, 0x6c, 0x6c, 0x3a, 0x41, 0x0a, 0x0c, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, - 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x9f, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x70, 0x6f, 0x70, - 0x75, 0x6c, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x3a, 0x41, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa0, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x3f, 0x0a, 0x0b, 0x6f, - 0x6e, 0x6c, 0x79, 0x6f, 0x6e, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa1, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x6f, 0x6e, 0x6c, 0x79, 0x6f, 0x6e, 0x65, 0x41, 0x6c, 0x6c, 0x3a, 0x3b, 0x0a, 0x09, - 0x65, 0x71, 0x75, 0x61, 0x6c, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa5, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x08, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x41, 0x6c, 0x6c, 0x3a, 0x47, 0x0a, 0x0f, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa6, 0xec, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0e, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, - 0x6c, 0x6c, 0x3a, 0x3f, 0x0a, 0x0b, 0x74, 0x65, 0x73, 0x74, 0x67, 0x65, 0x6e, 0x5f, 0x61, 0x6c, - 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0xa7, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x67, 0x65, 0x6e, - 0x41, 0x6c, 0x6c, 0x3a, 0x41, 0x0a, 0x0c, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x67, 0x65, 0x6e, 0x5f, - 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0xa8, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x62, 0x65, 0x6e, 0x63, 0x68, - 0x67, 0x65, 0x6e, 0x41, 0x6c, 0x6c, 0x3a, 0x43, 0x0a, 0x0d, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, - 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa9, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6d, - 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x47, 0x0a, 0x0f, 0x75, - 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xaa, 0xec, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, - 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x50, 0x0a, 0x14, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6d, - 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xab, 0xec, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x12, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, - 0x6c, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x3b, 0x0a, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x5f, - 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0xac, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, 0x69, 0x7a, 0x65, 0x72, - 0x41, 0x6c, 0x6c, 0x3a, 0x59, 0x0a, 0x19, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, - 0x6e, 0x75, 0x6d, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, - 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, - 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x45, - 0x6e, 0x75, 0x6d, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x4a, - 0x0a, 0x11, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x5f, - 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0xae, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x65, 0x6e, 0x75, 0x6d, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x50, 0x0a, 0x14, 0x75, 0x6e, - 0x73, 0x61, 0x66, 0x65, 0x5f, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, - 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0xaf, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x75, 0x6e, 0x73, 0x61, 0x66, 0x65, - 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x54, 0x0a, 0x16, - 0x75, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, - 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb0, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x75, 0x6e, - 0x73, 0x61, 0x66, 0x65, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, - 0x6c, 0x6c, 0x3a, 0x5b, 0x0a, 0x1a, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x6d, 0x61, 0x70, 0x5f, 0x61, 0x6c, 0x6c, - 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb1, - 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x4d, 0x61, 0x70, 0x41, 0x6c, 0x6c, 0x3a, - 0x58, 0x0a, 0x18, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x63, - 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, - 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb2, 0xec, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x16, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x6e, 0x72, 0x65, 0x63, 0x6f, - 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x64, 0x41, 0x6c, 0x6c, 0x3a, 0x49, 0x0a, 0x10, 0x67, 0x6f, 0x67, - 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb3, 0xec, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0f, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x49, 0x6d, - 0x70, 0x6f, 0x72, 0x74, 0x3a, 0x45, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x69, 0x7a, - 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb4, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x3f, 0x0a, 0x0b, 0x63, - 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb5, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x41, 0x6c, 0x6c, 0x3a, 0x41, 0x0a, 0x0c, - 0x74, 0x79, 0x70, 0x65, 0x64, 0x65, 0x63, 0x6c, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb6, 0xec, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0b, 0x74, 0x79, 0x70, 0x65, 0x64, 0x65, 0x63, 0x6c, 0x41, 0x6c, 0x6c, 0x3a, - 0x41, 0x0a, 0x0c, 0x65, 0x6e, 0x75, 0x6d, 0x64, 0x65, 0x63, 0x6c, 0x5f, 0x61, 0x6c, 0x6c, 0x12, - 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb7, 0xec, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x65, 0x6e, 0x75, 0x6d, 0x64, 0x65, 0x63, 0x6c, 0x41, - 0x6c, 0x6c, 0x3a, 0x51, 0x0a, 0x14, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb8, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x13, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x47, 0x0a, 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb9, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x41, 0x6c, 0x6c, 0x3a, 0x52, - 0x0a, 0x15, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x63, 0x61, - 0x63, 0x68, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xba, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x67, - 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x69, 0x7a, 0x65, 0x63, 0x61, 0x63, 0x68, 0x65, 0x41, - 0x6c, 0x6c, 0x3a, 0x4e, 0x0a, 0x13, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x75, 0x6e, - 0x6b, 0x65, 0x79, 0x65, 0x64, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xbb, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x11, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x6e, 0x6b, 0x65, 0x79, 0x65, 0x64, 0x41, - 0x6c, 0x6c, 0x3a, 0x4a, 0x0a, 0x0f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x67, 0x65, - 0x74, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x81, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, - 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x73, 0x3a, 0x4c, - 0x0a, 0x10, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x83, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x67, 0x6f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x3a, 0x46, 0x0a, 0x0d, - 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x5f, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x12, 0x1f, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x84, - 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x45, - 0x71, 0x75, 0x61, 0x6c, 0x3a, 0x35, 0x0a, 0x04, 0x66, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x85, 0xf4, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x61, 0x63, 0x65, 0x3a, 0x3d, 0x0a, 0x08, 0x67, - 0x6f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x86, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x67, 0x6f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3d, 0x0a, 0x08, 0x70, 0x6f, - 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x87, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x08, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x3a, 0x3d, 0x0a, 0x08, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc0, 0x8b, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x3a, 0x3b, 0x0a, 0x07, 0x6f, 0x6e, 0x6c, 0x79, - 0x6f, 0x6e, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x89, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6f, 0x6e, - 0x6c, 0x79, 0x6f, 0x6e, 0x65, 0x3a, 0x37, 0x0a, 0x05, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x12, 0x1f, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x8d, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x3a, 0x43, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x8e, - 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x3a, 0x3b, 0x0a, 0x07, 0x74, 0x65, 0x73, 0x74, 0x67, 0x65, 0x6e, 0x12, 0x1f, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x8f, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x74, 0x65, 0x73, 0x74, 0x67, 0x65, 0x6e, - 0x3a, 0x3d, 0x0a, 0x08, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x67, 0x65, 0x6e, 0x12, 0x1f, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x90, 0xf4, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x67, 0x65, 0x6e, 0x3a, - 0x3f, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x91, 0xf4, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, - 0x3a, 0x43, 0x0a, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, - 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x92, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, - 0x68, 0x61, 0x6c, 0x65, 0x72, 0x3a, 0x4c, 0x0a, 0x10, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, - 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x93, 0xf4, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, - 0x6c, 0x65, 0x72, 0x3a, 0x37, 0x0a, 0x05, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x94, 0xf4, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x3a, 0x4c, 0x0a, 0x10, - 0x75, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, - 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x97, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x75, 0x6e, 0x73, 0x61, 0x66, - 0x65, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x3a, 0x50, 0x0a, 0x12, 0x75, 0x6e, - 0x73, 0x61, 0x66, 0x65, 0x5f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, - 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x98, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x75, 0x6e, 0x73, 0x61, 0x66, - 0x65, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x3a, 0x57, 0x0a, 0x16, - 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x5f, 0x6d, 0x61, 0x70, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x99, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x14, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x4d, 0x61, 0x70, 0x3a, 0x54, 0x0a, 0x14, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x63, 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x1f, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9a, - 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x55, - 0x6e, 0x72, 0x65, 0x63, 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x64, 0x3a, 0x41, 0x0a, 0x0a, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9c, 0xf4, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x3a, 0x3b, - 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9d, 0xf4, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x3a, 0x3d, 0x0a, 0x08, 0x74, - 0x79, 0x70, 0x65, 0x64, 0x65, 0x63, 0x6c, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9e, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, 0x64, 0x65, 0x63, 0x6c, 0x3a, 0x43, 0x0a, 0x0b, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa1, 0xf4, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x3a, - 0x4e, 0x0a, 0x11, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x63, - 0x61, 0x63, 0x68, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa2, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x67, - 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x69, 0x7a, 0x65, 0x63, 0x61, 0x63, 0x68, 0x65, 0x3a, - 0x4a, 0x0a, 0x0f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x75, 0x6e, 0x6b, 0x65, 0x79, - 0x65, 0x64, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0xa3, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x67, 0x6f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x6e, 0x6b, 0x65, 0x79, 0x65, 0x64, 0x3a, 0x3b, 0x0a, 0x08, 0x6e, - 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe9, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, - 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x3a, 0x35, 0x0a, 0x05, 0x65, 0x6d, 0x62, 0x65, - 0x64, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0xea, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x3a, - 0x3f, 0x0a, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xeb, 0xfb, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x74, 0x79, 0x70, 0x65, - 0x3a, 0x3f, 0x0a, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xec, 0xfb, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, 0x6d, - 0x65, 0x3a, 0x39, 0x0a, 0x07, 0x6a, 0x73, 0x6f, 0x6e, 0x74, 0x61, 0x67, 0x12, 0x1d, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xed, 0xfb, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x73, 0x6f, 0x6e, 0x74, 0x61, 0x67, 0x3a, 0x3b, 0x0a, 0x08, - 0x6d, 0x6f, 0x72, 0x65, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xee, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x6d, 0x6f, 0x72, 0x65, 0x74, 0x61, 0x67, 0x73, 0x3a, 0x3b, 0x0a, 0x08, 0x63, 0x61, 0x73, - 0x74, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xef, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, - 0x73, 0x74, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x39, 0x0a, 0x07, 0x63, 0x61, 0x73, 0x74, 0x6b, 0x65, - 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0xf0, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x73, 0x74, 0x6b, 0x65, - 0x79, 0x3a, 0x3d, 0x0a, 0x09, 0x63, 0x61, 0x73, 0x74, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xf1, 0xfb, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x73, 0x74, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x39, 0x0a, 0x07, 0x73, 0x74, 0x64, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xf2, 0xfb, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x73, 0x74, 0x64, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x41, 0x0a, 0x0b, 0x73, - 0x74, 0x64, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xf3, 0xfb, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0b, 0x73, 0x74, 0x64, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3f, - 0x0a, 0x0a, 0x77, 0x6b, 0x74, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xf4, 0xfb, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0a, 0x77, 0x6b, 0x74, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x42, - 0x45, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x0a, 0x47, 0x6f, 0x47, 0x6f, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x73, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, - 0x6f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x6f, 0x67, - 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, -} - -var file_internal_gogoproto_gogo_proto_goTypes = []interface{}{ - (*descriptorpb.EnumOptions)(nil), // 0: google.protobuf.EnumOptions - (*descriptorpb.EnumValueOptions)(nil), // 1: google.protobuf.EnumValueOptions - (*descriptorpb.FileOptions)(nil), // 2: google.protobuf.FileOptions - (*descriptorpb.MessageOptions)(nil), // 3: google.protobuf.MessageOptions - (*descriptorpb.FieldOptions)(nil), // 4: google.protobuf.FieldOptions -} -var file_internal_gogoproto_gogo_proto_depIdxs = []int32{ - 0, // 0: gogoproto.goproto_enum_prefix:extendee -> google.protobuf.EnumOptions - 0, // 1: gogoproto.goproto_enum_stringer:extendee -> google.protobuf.EnumOptions - 0, // 2: gogoproto.enum_stringer:extendee -> google.protobuf.EnumOptions - 0, // 3: gogoproto.enum_customname:extendee -> google.protobuf.EnumOptions - 0, // 4: gogoproto.enumdecl:extendee -> google.protobuf.EnumOptions - 1, // 5: gogoproto.enumvalue_customname:extendee -> google.protobuf.EnumValueOptions - 2, // 6: gogoproto.goproto_getters_all:extendee -> google.protobuf.FileOptions - 2, // 7: gogoproto.goproto_enum_prefix_all:extendee -> google.protobuf.FileOptions - 2, // 8: gogoproto.goproto_stringer_all:extendee -> google.protobuf.FileOptions - 2, // 9: gogoproto.verbose_equal_all:extendee -> google.protobuf.FileOptions - 2, // 10: gogoproto.face_all:extendee -> google.protobuf.FileOptions - 2, // 11: gogoproto.gostring_all:extendee -> google.protobuf.FileOptions - 2, // 12: gogoproto.populate_all:extendee -> google.protobuf.FileOptions - 2, // 13: gogoproto.stringer_all:extendee -> google.protobuf.FileOptions - 2, // 14: gogoproto.onlyone_all:extendee -> google.protobuf.FileOptions - 2, // 15: gogoproto.equal_all:extendee -> google.protobuf.FileOptions - 2, // 16: gogoproto.description_all:extendee -> google.protobuf.FileOptions - 2, // 17: gogoproto.testgen_all:extendee -> google.protobuf.FileOptions - 2, // 18: gogoproto.benchgen_all:extendee -> google.protobuf.FileOptions - 2, // 19: gogoproto.marshaler_all:extendee -> google.protobuf.FileOptions - 2, // 20: gogoproto.unmarshaler_all:extendee -> google.protobuf.FileOptions - 2, // 21: gogoproto.stable_marshaler_all:extendee -> google.protobuf.FileOptions - 2, // 22: gogoproto.sizer_all:extendee -> google.protobuf.FileOptions - 2, // 23: gogoproto.goproto_enum_stringer_all:extendee -> google.protobuf.FileOptions - 2, // 24: gogoproto.enum_stringer_all:extendee -> google.protobuf.FileOptions - 2, // 25: gogoproto.unsafe_marshaler_all:extendee -> google.protobuf.FileOptions - 2, // 26: gogoproto.unsafe_unmarshaler_all:extendee -> google.protobuf.FileOptions - 2, // 27: gogoproto.goproto_extensions_map_all:extendee -> google.protobuf.FileOptions - 2, // 28: gogoproto.goproto_unrecognized_all:extendee -> google.protobuf.FileOptions - 2, // 29: gogoproto.gogoproto_import:extendee -> google.protobuf.FileOptions - 2, // 30: gogoproto.protosizer_all:extendee -> google.protobuf.FileOptions - 2, // 31: gogoproto.compare_all:extendee -> google.protobuf.FileOptions - 2, // 32: gogoproto.typedecl_all:extendee -> google.protobuf.FileOptions - 2, // 33: gogoproto.enumdecl_all:extendee -> google.protobuf.FileOptions - 2, // 34: gogoproto.goproto_registration:extendee -> google.protobuf.FileOptions - 2, // 35: gogoproto.messagename_all:extendee -> google.protobuf.FileOptions - 2, // 36: gogoproto.goproto_sizecache_all:extendee -> google.protobuf.FileOptions - 2, // 37: gogoproto.goproto_unkeyed_all:extendee -> google.protobuf.FileOptions - 3, // 38: gogoproto.goproto_getters:extendee -> google.protobuf.MessageOptions - 3, // 39: gogoproto.goproto_stringer:extendee -> google.protobuf.MessageOptions - 3, // 40: gogoproto.verbose_equal:extendee -> google.protobuf.MessageOptions - 3, // 41: gogoproto.face:extendee -> google.protobuf.MessageOptions - 3, // 42: gogoproto.gostring:extendee -> google.protobuf.MessageOptions - 3, // 43: gogoproto.populate:extendee -> google.protobuf.MessageOptions - 3, // 44: gogoproto.stringer:extendee -> google.protobuf.MessageOptions - 3, // 45: gogoproto.onlyone:extendee -> google.protobuf.MessageOptions - 3, // 46: gogoproto.equal:extendee -> google.protobuf.MessageOptions - 3, // 47: gogoproto.description:extendee -> google.protobuf.MessageOptions - 3, // 48: gogoproto.testgen:extendee -> google.protobuf.MessageOptions - 3, // 49: gogoproto.benchgen:extendee -> google.protobuf.MessageOptions - 3, // 50: gogoproto.marshaler:extendee -> google.protobuf.MessageOptions - 3, // 51: gogoproto.unmarshaler:extendee -> google.protobuf.MessageOptions - 3, // 52: gogoproto.stable_marshaler:extendee -> google.protobuf.MessageOptions - 3, // 53: gogoproto.sizer:extendee -> google.protobuf.MessageOptions - 3, // 54: gogoproto.unsafe_marshaler:extendee -> google.protobuf.MessageOptions - 3, // 55: gogoproto.unsafe_unmarshaler:extendee -> google.protobuf.MessageOptions - 3, // 56: gogoproto.goproto_extensions_map:extendee -> google.protobuf.MessageOptions - 3, // 57: gogoproto.goproto_unrecognized:extendee -> google.protobuf.MessageOptions - 3, // 58: gogoproto.protosizer:extendee -> google.protobuf.MessageOptions - 3, // 59: gogoproto.compare:extendee -> google.protobuf.MessageOptions - 3, // 60: gogoproto.typedecl:extendee -> google.protobuf.MessageOptions - 3, // 61: gogoproto.messagename:extendee -> google.protobuf.MessageOptions - 3, // 62: gogoproto.goproto_sizecache:extendee -> google.protobuf.MessageOptions - 3, // 63: gogoproto.goproto_unkeyed:extendee -> google.protobuf.MessageOptions - 4, // 64: gogoproto.nullable:extendee -> google.protobuf.FieldOptions - 4, // 65: gogoproto.embed:extendee -> google.protobuf.FieldOptions - 4, // 66: gogoproto.customtype:extendee -> google.protobuf.FieldOptions - 4, // 67: gogoproto.customname:extendee -> google.protobuf.FieldOptions - 4, // 68: gogoproto.jsontag:extendee -> google.protobuf.FieldOptions - 4, // 69: gogoproto.moretags:extendee -> google.protobuf.FieldOptions - 4, // 70: gogoproto.casttype:extendee -> google.protobuf.FieldOptions - 4, // 71: gogoproto.castkey:extendee -> google.protobuf.FieldOptions - 4, // 72: gogoproto.castvalue:extendee -> google.protobuf.FieldOptions - 4, // 73: gogoproto.stdtime:extendee -> google.protobuf.FieldOptions - 4, // 74: gogoproto.stdduration:extendee -> google.protobuf.FieldOptions - 4, // 75: gogoproto.wktpointer:extendee -> google.protobuf.FieldOptions - 76, // [76:76] is the sub-list for method output_type - 76, // [76:76] is the sub-list for method input_type - 76, // [76:76] is the sub-list for extension type_name - 0, // [0:76] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_internal_gogoproto_gogo_proto_init() } -func file_internal_gogoproto_gogo_proto_init() { - if File_internal_gogoproto_gogo_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_internal_gogoproto_gogo_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 76, - NumServices: 0, - }, - GoTypes: file_internal_gogoproto_gogo_proto_goTypes, - DependencyIndexes: file_internal_gogoproto_gogo_proto_depIdxs, - ExtensionInfos: file_internal_gogoproto_gogo_proto_extTypes, - }.Build() - File_internal_gogoproto_gogo_proto = out.File - file_internal_gogoproto_gogo_proto_rawDesc = nil - file_internal_gogoproto_gogo_proto_goTypes = nil - file_internal_gogoproto_gogo_proto_depIdxs = nil -} diff --git a/internal/gogoproto/gogo.proto b/internal/gogoproto/gogo.proto deleted file mode 100644 index a18a859b..00000000 --- a/internal/gogoproto/gogo.proto +++ /dev/null @@ -1,143 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto2"; -package gogoproto; - -import "google/protobuf/descriptor.proto"; - -option java_package = "com.google.protobuf"; -option java_outer_classname = "GoGoProtos"; -option go_package = "github.com/gogo/protobuf/gogoproto"; - -extend google.protobuf.EnumOptions { - optional bool goproto_enum_prefix = 62001; - optional bool goproto_enum_stringer = 62021; - optional bool enum_stringer = 62022; - optional string enum_customname = 62023; - optional bool enumdecl = 62024; -} - -extend google.protobuf.EnumValueOptions { - optional string enumvalue_customname = 66001; -} - -extend google.protobuf.FileOptions { - optional bool goproto_getters_all = 63001; - optional bool goproto_enum_prefix_all = 63002; - optional bool goproto_stringer_all = 63003; - optional bool verbose_equal_all = 63004; - optional bool face_all = 63005; - optional bool gostring_all = 63006; - optional bool populate_all = 63007; - optional bool stringer_all = 63008; - optional bool onlyone_all = 63009; - - optional bool equal_all = 63013; - optional bool description_all = 63014; - optional bool testgen_all = 63015; - optional bool benchgen_all = 63016; - optional bool marshaler_all = 63017; - optional bool unmarshaler_all = 63018; - optional bool stable_marshaler_all = 63019; - - optional bool sizer_all = 63020; - - optional bool goproto_enum_stringer_all = 63021; - optional bool enum_stringer_all = 63022; - - optional bool unsafe_marshaler_all = 63023; - optional bool unsafe_unmarshaler_all = 63024; - - optional bool goproto_extensions_map_all = 63025; - optional bool goproto_unrecognized_all = 63026; - optional bool gogoproto_import = 63027; - optional bool protosizer_all = 63028; - optional bool compare_all = 63029; - optional bool typedecl_all = 63030; - optional bool enumdecl_all = 63031; - - optional bool goproto_registration = 63032; - optional bool messagename_all = 63033; - - optional bool goproto_sizecache_all = 63034; - optional bool goproto_unkeyed_all = 63035; -} - -extend google.protobuf.MessageOptions { - optional bool goproto_getters = 64001; - optional bool goproto_stringer = 64003; - optional bool verbose_equal = 64004; - optional bool face = 64005; - optional bool gostring = 64006; - optional bool populate = 64007; - optional bool stringer = 67008; - optional bool onlyone = 64009; - - optional bool equal = 64013; - optional bool description = 64014; - optional bool testgen = 64015; - optional bool benchgen = 64016; - optional bool marshaler = 64017; - optional bool unmarshaler = 64018; - optional bool stable_marshaler = 64019; - - optional bool sizer = 64020; - - optional bool unsafe_marshaler = 64023; - optional bool unsafe_unmarshaler = 64024; - - optional bool goproto_extensions_map = 64025; - optional bool goproto_unrecognized = 64026; - - optional bool protosizer = 64028; - optional bool compare = 64029; - - optional bool typedecl = 64030; - - optional bool messagename = 64033; - - optional bool goproto_sizecache = 64034; - optional bool goproto_unkeyed = 64035; -} - -extend google.protobuf.FieldOptions { - optional bool nullable = 65001; - optional bool embed = 65002; - optional string customtype = 65003; - optional string customname = 65004; - optional string jsontag = 65005; - optional string moretags = 65006; - optional string casttype = 65007; - optional string castkey = 65008; - optional string castvalue = 65009; - - optional bool stdtime = 65010; - optional bool stdduration = 65011; - optional bool wktpointer = 65012; -} diff --git a/test/enums.proto b/test/enums.proto index e7af87f1..8da67118 100644 --- a/test/enums.proto +++ b/test/enums.proto @@ -4,23 +4,16 @@ syntax = "proto3"; import "annotations.proto"; -import "internal/gogoproto/gogo.proto"; package thethings.json.test; option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/test"; -option (gogoproto.enum_stringer_all) = true; -option (gogoproto.goproto_enum_stringer_all) = false; - option (thethings.json.file) = { marshaler_all: true, unmarshaler_all: true }; enum RegularEnum { option (thethings.json.enum) = { marshaler: false, unmarshaler: false }; - option (gogoproto.goproto_enum_prefix) = false; - option (gogoproto.enum_stringer) = false; - REGULAR_UNKNOWN = 0; REGULAR_A = 1; diff --git a/test/gogo.proto b/test/gogo.proto deleted file mode 100644 index 9355750a..00000000 --- a/test/gogo.proto +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright © 2021 The Things Industries B.V. -// SPDX-License-Identifier: Apache-2.0 - -syntax = "proto3"; - -import "annotations.proto"; -import "internal/gogoproto/gogo.proto"; - -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -package thethings.json.test; - -option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/test"; - -option (thethings.json.file) = { marshaler_all: true, unmarshaler_all: true }; - -message MessageWithGoGoOptions { - bytes eui_with_custom_name = 1 [ - (gogoproto.customname) = "EUIWithCustomName" - ]; - - bytes eui_with_custom_name_and_type = 2 [ - (gogoproto.customname) = "EUIWithCustomNameAndType", - (gogoproto.customtype) = "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.EUI64", - (thethings.json.field) = { - marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEX", - unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEX" - } - ]; - - bytes non_nullable_eui_with_custom_name_and_type = 3 [ - (gogoproto.customname) = "NonNullableEUIWithCustomNameAndType", - (gogoproto.customtype) = "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.EUI64", - (gogoproto.nullable) = false, - (thethings.json.field) = { - marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEX", - unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEX" - } - ]; - - repeated bytes euis_with_custom_name_and_type = 4 [ - (gogoproto.customname) = "EUIsWithCustomNameAndType", - (gogoproto.customtype) = "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.EUI64", - (thethings.json.field) = { - marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEXArray", - unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEXArray" - } - ]; - - google.protobuf.Duration duration = 5 [(gogoproto.stdduration) = true]; - google.protobuf.Duration non_nullable_duration = 6 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; - - google.protobuf.Timestamp timestamp = 7 [(gogoproto.stdtime) = true]; - google.protobuf.Timestamp non_nullable_timestamp = 8 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -} - -message SubMessage { - string field = 1; -} - -message SubMessageWithoutMarshalers { - option (thethings.json.message) = { marshaler: false, unmarshaler: false }; - - string other_field = 1; -} - -message MessageWithNullable { - SubMessage sub = 1 [ - (gogoproto.nullable) = false - ]; - repeated SubMessage subs = 2 [ - (gogoproto.nullable) = false - ]; - - SubMessageWithoutMarshalers other_sub = 3 [ - (gogoproto.nullable) = false - ]; - repeated SubMessageWithoutMarshalers other_subs = 4 [ - (gogoproto.nullable) = false - ]; -} - -message MessageWithEmbedded{ - SubMessage sub = 1 [ - (gogoproto.embed) = true - ]; - SubMessageWithoutMarshalers other_sub = 2 [ - (gogoproto.embed) = true - ]; -} - -message MessageWithNullableEmbedded{ - SubMessage sub = 1 [ - (gogoproto.nullable) = false, - (gogoproto.embed) = true - ]; - SubMessageWithoutMarshalers other_sub = 2 [ - (gogoproto.nullable) = false, - (gogoproto.embed) = true - ]; -} diff --git a/test/gogo/api.pb.go b/test/gogo/api.pb.go deleted file mode 100644 index 9c031701..00000000 --- a/test/gogo/api.pb.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: api.proto - -package test - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - 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 - -func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } - -var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 109 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x2c, 0xc8, 0xd4, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x2e, 0xc9, 0x48, 0x2d, 0xc9, 0xc8, 0xcc, 0x4b, 0x2f, - 0xd6, 0xcb, 0x2a, 0xce, 0xcf, 0xd3, 0x2b, 0x49, 0x2d, 0x2e, 0x71, 0xb2, 0x88, 0x32, 0x4b, 0xcf, - 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x0f, 0xc9, 0x48, 0x0d, 0x01, 0xab, 0xf0, - 0xcc, 0x4b, 0x29, 0x2d, 0x2e, 0x29, 0xca, 0x4c, 0x2d, 0xd6, 0x07, 0x6b, 0x4e, 0xd6, 0x4d, 0x4f, - 0xcd, 0xd3, 0x4d, 0xcf, 0xd7, 0x05, 0xe9, 0xd4, 0x07, 0xe9, 0x4c, 0x62, 0x03, 0x4b, 0x18, 0x03, - 0x02, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x7e, 0x2f, 0x44, 0x62, 0x00, 0x00, 0x00, -} diff --git a/test/gogo/enums.pb.go b/test/gogo/enums.pb.go deleted file mode 100644 index e47b3b9b..00000000 --- a/test/gogo/enums.pb.go +++ /dev/null @@ -1,334 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: enums.proto - -package test - -import ( - fmt "fmt" - _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" - _ "github.com/gogo/protobuf/gogoproto" - 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 - -type RegularEnum int32 - -const ( - REGULAR_UNKNOWN RegularEnum = 0 - REGULAR_A RegularEnum = 1 - REGULAR_B RegularEnum = 2 -) - -var RegularEnum_name = map[int32]string{ - 0: "REGULAR_UNKNOWN", - 1: "REGULAR_A", - 2: "REGULAR_B", -} - -var RegularEnum_value = map[string]int32{ - "REGULAR_UNKNOWN": 0, - "REGULAR_A": 1, - "REGULAR_B": 2, -} - -func (RegularEnum) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_888b6bd9597961ff, []int{0} -} - -type CustomEnum int32 - -const ( - CustomEnum_CUSTOM_UNKNOWN CustomEnum = 0 - CustomEnum_CUSTOM_V1_0 CustomEnum = 1 - CustomEnum_CUSTOM_V1_0_1 CustomEnum = 2 -) - -var CustomEnum_name = map[int32]string{ - 0: "CUSTOM_UNKNOWN", - 1: "CUSTOM_V1_0", - 2: "CUSTOM_V1_0_1", -} - -var CustomEnum_value = map[string]int32{ - "CUSTOM_UNKNOWN": 0, - "CUSTOM_V1_0": 1, - "CUSTOM_V1_0_1": 2, -} - -func (CustomEnum) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_888b6bd9597961ff, []int{1} -} - -type CustomEnumValue struct { - Value CustomEnum `protobuf:"varint,1,opt,name=value,proto3,enum=thethings.json.test.CustomEnum" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CustomEnumValue) Reset() { *m = CustomEnumValue{} } -func (m *CustomEnumValue) String() string { return proto.CompactTextString(m) } -func (*CustomEnumValue) ProtoMessage() {} -func (*CustomEnumValue) Descriptor() ([]byte, []int) { - return fileDescriptor_888b6bd9597961ff, []int{0} -} -func (m *CustomEnumValue) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CustomEnumValue.Unmarshal(m, b) -} -func (m *CustomEnumValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CustomEnumValue.Marshal(b, m, deterministic) -} -func (m *CustomEnumValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_CustomEnumValue.Merge(m, src) -} -func (m *CustomEnumValue) XXX_Size() int { - return xxx_messageInfo_CustomEnumValue.Size(m) -} -func (m *CustomEnumValue) XXX_DiscardUnknown() { - xxx_messageInfo_CustomEnumValue.DiscardUnknown(m) -} - -var xxx_messageInfo_CustomEnumValue proto.InternalMessageInfo - -func (m *CustomEnumValue) GetValue() CustomEnum { - if m != nil { - return m.Value - } - return CustomEnum_CUSTOM_UNKNOWN -} - -type MessageWithEnums struct { - Regular RegularEnum `protobuf:"varint,1,opt,name=regular,proto3,enum=thethings.json.test.RegularEnum" json:"regular,omitempty"` - Regulars []RegularEnum `protobuf:"varint,2,rep,packed,name=regulars,proto3,enum=thethings.json.test.RegularEnum" json:"regulars,omitempty"` - Custom CustomEnum `protobuf:"varint,3,opt,name=custom,proto3,enum=thethings.json.test.CustomEnum" json:"custom,omitempty"` - Customs []CustomEnum `protobuf:"varint,4,rep,packed,name=customs,proto3,enum=thethings.json.test.CustomEnum" json:"customs,omitempty"` - WrappedCustom *CustomEnumValue `protobuf:"bytes,5,opt,name=wrapped_custom,json=wrappedCustom,proto3" json:"wrapped_custom,omitempty"` - WrappedCustoms []*CustomEnumValue `protobuf:"bytes,6,rep,name=wrapped_customs,json=wrappedCustoms,proto3" json:"wrapped_customs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithEnums) Reset() { *m = MessageWithEnums{} } -func (m *MessageWithEnums) String() string { return proto.CompactTextString(m) } -func (*MessageWithEnums) ProtoMessage() {} -func (*MessageWithEnums) Descriptor() ([]byte, []int) { - return fileDescriptor_888b6bd9597961ff, []int{1} -} -func (m *MessageWithEnums) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithEnums.Unmarshal(m, b) -} -func (m *MessageWithEnums) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithEnums.Marshal(b, m, deterministic) -} -func (m *MessageWithEnums) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithEnums.Merge(m, src) -} -func (m *MessageWithEnums) XXX_Size() int { - return xxx_messageInfo_MessageWithEnums.Size(m) -} -func (m *MessageWithEnums) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithEnums.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithEnums proto.InternalMessageInfo - -func (m *MessageWithEnums) GetRegular() RegularEnum { - if m != nil { - return m.Regular - } - return REGULAR_UNKNOWN -} - -func (m *MessageWithEnums) GetRegulars() []RegularEnum { - if m != nil { - return m.Regulars - } - return nil -} - -func (m *MessageWithEnums) GetCustom() CustomEnum { - if m != nil { - return m.Custom - } - return CustomEnum_CUSTOM_UNKNOWN -} - -func (m *MessageWithEnums) GetCustoms() []CustomEnum { - if m != nil { - return m.Customs - } - return nil -} - -func (m *MessageWithEnums) GetWrappedCustom() *CustomEnumValue { - if m != nil { - return m.WrappedCustom - } - return nil -} - -func (m *MessageWithEnums) GetWrappedCustoms() []*CustomEnumValue { - if m != nil { - return m.WrappedCustoms - } - return nil -} - -type MessageWithOneofEnums struct { - // Types that are valid to be assigned to Value: - // - // *MessageWithOneofEnums_Regular - // *MessageWithOneofEnums_Custom - // *MessageWithOneofEnums_WrappedCustom - Value isMessageWithOneofEnums_Value `protobuf_oneof:"value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithOneofEnums) Reset() { *m = MessageWithOneofEnums{} } -func (m *MessageWithOneofEnums) String() string { return proto.CompactTextString(m) } -func (*MessageWithOneofEnums) ProtoMessage() {} -func (*MessageWithOneofEnums) Descriptor() ([]byte, []int) { - return fileDescriptor_888b6bd9597961ff, []int{2} -} -func (m *MessageWithOneofEnums) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithOneofEnums.Unmarshal(m, b) -} -func (m *MessageWithOneofEnums) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithOneofEnums.Marshal(b, m, deterministic) -} -func (m *MessageWithOneofEnums) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithOneofEnums.Merge(m, src) -} -func (m *MessageWithOneofEnums) XXX_Size() int { - return xxx_messageInfo_MessageWithOneofEnums.Size(m) -} -func (m *MessageWithOneofEnums) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithOneofEnums.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithOneofEnums proto.InternalMessageInfo - -type isMessageWithOneofEnums_Value interface { - isMessageWithOneofEnums_Value() -} - -type MessageWithOneofEnums_Regular struct { - Regular RegularEnum `protobuf:"varint,1,opt,name=regular,proto3,enum=thethings.json.test.RegularEnum,oneof" json:"regular,omitempty"` -} -type MessageWithOneofEnums_Custom struct { - Custom CustomEnum `protobuf:"varint,2,opt,name=custom,proto3,enum=thethings.json.test.CustomEnum,oneof" json:"custom,omitempty"` -} -type MessageWithOneofEnums_WrappedCustom struct { - WrappedCustom *CustomEnumValue `protobuf:"bytes,3,opt,name=wrapped_custom,json=wrappedCustom,proto3,oneof" json:"wrapped_custom,omitempty"` -} - -func (*MessageWithOneofEnums_Regular) isMessageWithOneofEnums_Value() {} -func (*MessageWithOneofEnums_Custom) isMessageWithOneofEnums_Value() {} -func (*MessageWithOneofEnums_WrappedCustom) isMessageWithOneofEnums_Value() {} - -func (m *MessageWithOneofEnums) GetValue() isMessageWithOneofEnums_Value { - if m != nil { - return m.Value - } - return nil -} - -func (m *MessageWithOneofEnums) GetRegular() RegularEnum { - if x, ok := m.GetValue().(*MessageWithOneofEnums_Regular); ok { - return x.Regular - } - return REGULAR_UNKNOWN -} - -func (m *MessageWithOneofEnums) GetCustom() CustomEnum { - if x, ok := m.GetValue().(*MessageWithOneofEnums_Custom); ok { - return x.Custom - } - return CustomEnum_CUSTOM_UNKNOWN -} - -func (m *MessageWithOneofEnums) GetWrappedCustom() *CustomEnumValue { - if x, ok := m.GetValue().(*MessageWithOneofEnums_WrappedCustom); ok { - return x.WrappedCustom - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*MessageWithOneofEnums) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*MessageWithOneofEnums_Regular)(nil), - (*MessageWithOneofEnums_Custom)(nil), - (*MessageWithOneofEnums_WrappedCustom)(nil), - } -} - -func init() { - proto.RegisterEnum("thethings.json.test.RegularEnum", RegularEnum_name, RegularEnum_value) - proto.RegisterEnum("thethings.json.test.CustomEnum", CustomEnum_name, CustomEnum_value) - proto.RegisterType((*CustomEnumValue)(nil), "thethings.json.test.CustomEnumValue") - proto.RegisterType((*MessageWithEnums)(nil), "thethings.json.test.MessageWithEnums") - proto.RegisterType((*MessageWithOneofEnums)(nil), "thethings.json.test.MessageWithOneofEnums") -} - -func init() { proto.RegisterFile("enums.proto", fileDescriptor_888b6bd9597961ff) } - -var fileDescriptor_888b6bd9597961ff = []byte{ - // 519 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x51, 0x6f, 0xd2, 0x50, - 0x14, 0xc7, 0x7b, 0xe9, 0x06, 0xf3, 0x20, 0x50, 0xef, 0x62, 0x52, 0x48, 0xc4, 0x4a, 0x7c, 0x58, - 0x48, 0x28, 0x74, 0x46, 0xcd, 0x96, 0xbd, 0x8c, 0x65, 0x11, 0x33, 0x01, 0x53, 0x61, 0x4b, 0x7c, - 0x21, 0x1d, 0xbb, 0xb6, 0x35, 0x70, 0x2f, 0xe9, 0xbd, 0xd5, 0xaf, 0xe0, 0x87, 0xf0, 0x4d, 0x9f, - 0x78, 0xf2, 0x33, 0xed, 0x69, 0xe1, 0xc9, 0x8f, 0x60, 0xb8, 0x2d, 0xd0, 0xe9, 0x92, 0xd5, 0xb7, - 0xd3, 0x73, 0xff, 0xff, 0xff, 0x3d, 0xfd, 0x9d, 0x16, 0xf2, 0x84, 0x86, 0x53, 0x6e, 0xce, 0x02, - 0x26, 0x18, 0xde, 0x15, 0x1e, 0x11, 0x9e, 0x4f, 0x5d, 0x6e, 0x7e, 0xe6, 0x8c, 0x9a, 0x82, 0x70, - 0x51, 0x79, 0xe4, 0x50, 0xca, 0x84, 0x23, 0x7c, 0x46, 0x63, 0x5d, 0xe5, 0x89, 0x4f, 0x05, 0x09, - 0xa8, 0x33, 0x69, 0xba, 0xcc, 0x65, 0xb2, 0x27, 0xab, 0xe8, 0xb8, 0xf6, 0x1e, 0x4a, 0x27, 0x21, - 0x17, 0x6c, 0x7a, 0x4a, 0xc3, 0xe9, 0xb9, 0x33, 0x09, 0x09, 0x7e, 0x09, 0xdb, 0x5f, 0x96, 0x85, - 0x8e, 0x0c, 0xb4, 0x57, 0xdc, 0x7f, 0x6a, 0xde, 0x71, 0x93, 0xb9, 0x31, 0xd9, 0x91, 0xfa, 0x30, - 0xbb, 0x98, 0x97, 0x33, 0x3a, 0xaa, 0x7d, 0x57, 0x41, 0xeb, 0x12, 0xce, 0x1d, 0x97, 0x5c, 0xf8, - 0xc2, 0x5b, 0x4a, 0x38, 0x3e, 0x84, 0x5c, 0x40, 0xdc, 0x70, 0xe2, 0x04, 0x71, 0xaa, 0x71, 0x67, - 0xaa, 0x1d, 0x69, 0x64, 0xec, 0xca, 0x80, 0x8f, 0x60, 0x27, 0x2e, 0xb9, 0x9e, 0x31, 0xd4, 0x54, - 0xe6, 0xb5, 0x03, 0xbf, 0x86, 0xec, 0x58, 0xce, 0xaa, 0xab, 0xe9, 0x5e, 0x27, 0x96, 0xe3, 0x03, - 0xc8, 0x45, 0x15, 0xd7, 0xb7, 0xe4, 0xad, 0xf7, 0x3a, 0x57, 0x7a, 0x7c, 0x06, 0xc5, 0xaf, 0x81, - 0x33, 0x9b, 0x91, 0xab, 0x51, 0x7c, 0xf7, 0xb6, 0x81, 0xf6, 0xf2, 0xfb, 0xcf, 0xef, 0x49, 0x90, - 0xfc, 0xed, 0x42, 0xec, 0x8d, 0xfa, 0xb8, 0x0b, 0xa5, 0xdb, 0x61, 0x5c, 0xcf, 0x1a, 0x6a, 0xea, - 0xb4, 0xe2, 0xad, 0x34, 0x5e, 0xbb, 0x41, 0xf0, 0x38, 0xb1, 0x9e, 0x3e, 0x25, 0xec, 0x53, 0xb4, - 0xa3, 0xa3, 0xff, 0xde, 0x51, 0x47, 0xd9, 0x6c, 0xe9, 0x60, 0xcd, 0x39, 0x93, 0x8a, 0x73, 0x47, - 0x59, 0x93, 0xee, 0xfe, 0x83, 0x4b, 0x4d, 0x8f, 0xab, 0xa3, 0xfc, 0x05, 0xac, 0x9d, 0x8b, 0xbf, - 0xdf, 0xba, 0x0d, 0xf9, 0xc4, 0xb0, 0x78, 0x17, 0x4a, 0xf6, 0xe9, 0x9b, 0xe1, 0xbb, 0x63, 0x7b, - 0x34, 0xec, 0x9d, 0xf5, 0xfa, 0x17, 0x3d, 0x4d, 0xc1, 0x05, 0x78, 0xb0, 0x6a, 0x1e, 0x6b, 0x28, - 0xf9, 0xd8, 0xd6, 0x32, 0x15, 0x6d, 0x31, 0x2f, 0x6f, 0xed, 0x28, 0x86, 0xf2, 0xed, 0x47, 0x55, - 0xf9, 0xf5, 0xb3, 0xaa, 0xd4, 0x39, 0xc0, 0x66, 0x00, 0x8c, 0xa1, 0x78, 0x32, 0xfc, 0x30, 0xe8, - 0x77, 0x13, 0x89, 0xcf, 0x20, 0x1f, 0xf7, 0xce, 0xad, 0x51, 0x4b, 0x43, 0x32, 0xe4, 0x21, 0xa8, - 0x96, 0xd9, 0xc2, 0xdb, 0x96, 0xd9, 0x32, 0x5b, 0xb8, 0x0a, 0x85, 0x84, 0x64, 0x64, 0x69, 0x99, - 0x4a, 0x7e, 0x31, 0x2f, 0xe7, 0x40, 0x9e, 0x5b, 0x95, 0xe2, 0x62, 0x5e, 0x06, 0x1d, 0xd5, 0xb3, - 0x91, 0xaa, 0xdd, 0x91, 0x63, 0x20, 0x0d, 0xdd, 0x5c, 0x57, 0x95, 0xdf, 0xd7, 0x55, 0xf4, 0xf1, - 0x95, 0xeb, 0x0b, 0x2f, 0xbc, 0x34, 0xc7, 0x6c, 0xda, 0x1c, 0x78, 0x64, 0x20, 0x21, 0xbd, 0xa5, - 0x57, 0x21, 0x17, 0x81, 0x4f, 0x78, 0x53, 0xfe, 0xdc, 0xe3, 0x86, 0x4b, 0x68, 0xc3, 0x65, 0x8d, - 0x25, 0xbc, 0xe6, 0x12, 0xde, 0x65, 0x56, 0x1e, 0xbc, 0xf8, 0x13, 0x00, 0x00, 0xff, 0xff, 0x19, - 0x9f, 0x31, 0xfc, 0x4b, 0x04, 0x00, 0x00, -} - -func (x CustomEnum) String() string { - s, ok := CustomEnum_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} diff --git a/test/gogo/enums_json.pb.go b/test/gogo/enums_json.pb.go deleted file mode 100644 index f024d439..00000000 --- a/test/gogo/enums_json.pb.go +++ /dev/null @@ -1,300 +0,0 @@ -// Code generated by protoc-gen-go-json. DO NOT EDIT. -// versions: -// - protoc-gen-go-json v0.0.0-dev -// - protoc v3.9.1 -// source: enums.proto - -package test - -import ( - jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" -) - -// CustomEnum_customname contains custom string values that override CustomEnum_name. -var CustomEnum_customname = map[int32]string{ - 1: "1.0", - 2: "1.0.1", -} - -// MarshalProtoJSON marshals the CustomEnum to JSON. -func (x CustomEnum) MarshalProtoJSON(s *jsonplugin.MarshalState) { - s.WriteEnumString(int32(x), CustomEnum_customname, CustomEnum_name) -} - -// MarshalText marshals the CustomEnum to text. -func (x CustomEnum) MarshalText() ([]byte, error) { - return []byte(jsonplugin.GetEnumString(int32(x), CustomEnum_customname, CustomEnum_name)), nil -} - -// MarshalJSON marshals the CustomEnum to JSON. -func (x CustomEnum) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// CustomEnum_customvalue contains custom string values that extend CustomEnum_value. -var CustomEnum_customvalue = map[string]int32{ - "UNKNOWN": 0, - "V1_0": 1, - "1.0": 1, - "1.0.0": 1, - "V1_0_1": 2, - "1.0.1": 2, -} - -// UnmarshalProtoJSON unmarshals the CustomEnum from JSON. -func (x *CustomEnum) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - v := s.ReadEnum(CustomEnum_value, CustomEnum_customvalue) - if err := s.Err(); err != nil { - s.SetErrorf("could not read CustomEnum enum: %v", err) - return - } - *x = CustomEnum(v) -} - -// UnmarshalText unmarshals the CustomEnum from text. -func (x *CustomEnum) UnmarshalText(b []byte) error { - i, err := jsonplugin.ParseEnumString(string(b), CustomEnum_customvalue, CustomEnum_value) - if err != nil { - return err - } - *x = CustomEnum(i) - return nil -} - -// UnmarshalJSON unmarshals the CustomEnum from JSON. -func (x *CustomEnum) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the CustomEnumValue message to JSON. -func (x *CustomEnumValue) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - x.Value.MarshalProtoJSON(s) - return -} - -// MarshalJSON marshals the CustomEnumValue to JSON. -func (x *CustomEnumValue) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the CustomEnumValue message from JSON. -func (x *CustomEnumValue) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - x.Value.UnmarshalProtoJSON(s) - return -} - -// UnmarshalJSON unmarshals the CustomEnumValue from JSON. -func (x *CustomEnumValue) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithEnums message to JSON. -func (x *MessageWithEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.Regular != 0 || s.HasField("regular") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("regular") - s.WriteEnum(int32(x.Regular), RegularEnum_name) - } - if len(x.Regulars) > 0 || s.HasField("regulars") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("regulars") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.Regulars { - s.WriteMoreIf(&wroteElement) - s.WriteEnum(int32(element), RegularEnum_name) - } - s.WriteArrayEnd() - } - if x.Custom != 0 || s.HasField("custom") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("custom") - x.Custom.MarshalProtoJSON(s) - } - if len(x.Customs) > 0 || s.HasField("customs") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("customs") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.Customs { - s.WriteMoreIf(&wroteElement) - element.MarshalProtoJSON(s) - } - s.WriteArrayEnd() - } - if x.WrappedCustom != nil || s.HasField("wrapped_custom") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("wrapped_custom") - x.WrappedCustom.MarshalProtoJSON(s.WithField("wrapped_custom")) - } - if len(x.WrappedCustoms) > 0 || s.HasField("wrapped_customs") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("wrapped_customs") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.WrappedCustoms { - s.WriteMoreIf(&wroteElement) - element.MarshalProtoJSON(s.WithField("wrapped_customs")) - } - s.WriteArrayEnd() - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithEnums to JSON. -func (x *MessageWithEnums) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithEnums message from JSON. -func (x *MessageWithEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "regular": - s.AddField("regular") - x.Regular = RegularEnum(s.ReadEnum(RegularEnum_value)) - case "regulars": - s.AddField("regulars") - if s.ReadNil() { - x.Regulars = nil - return - } - s.ReadArray(func() { - x.Regulars = append(x.Regulars, RegularEnum(s.ReadEnum(RegularEnum_value))) - }) - case "custom": - s.AddField("custom") - x.Custom.UnmarshalProtoJSON(s) - case "customs": - s.AddField("customs") - if s.ReadNil() { - x.Customs = nil - return - } - s.ReadArray(func() { - var v CustomEnum - v.UnmarshalProtoJSON(s) - x.Customs = append(x.Customs, v) - }) - case "wrapped_custom", "wrappedCustom": - s.AddField("wrapped_custom") - if s.ReadNil() { - x.WrappedCustom = nil - return - } - x.WrappedCustom = &CustomEnumValue{} - x.WrappedCustom.UnmarshalProtoJSON(s.WithField("wrapped_custom", false)) - case "wrapped_customs", "wrappedCustoms": - s.AddField("wrapped_customs") - if s.ReadNil() { - x.WrappedCustoms = nil - return - } - s.ReadArray(func() { - if s.ReadNil() { - x.WrappedCustoms = append(x.WrappedCustoms, nil) - return - } - v := &CustomEnumValue{} - v.UnmarshalProtoJSON(s.WithField("wrapped_customs", false)) - if s.Err() != nil { - return - } - x.WrappedCustoms = append(x.WrappedCustoms, v) - }) - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithEnums from JSON. -func (x *MessageWithEnums) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithOneofEnums message to JSON. -func (x *MessageWithOneofEnums) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.Value != nil { - switch ov := x.Value.(type) { - case *MessageWithOneofEnums_Regular: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("regular") - s.WriteEnum(int32(ov.Regular), RegularEnum_name) - case *MessageWithOneofEnums_Custom: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("custom") - ov.Custom.MarshalProtoJSON(s) - case *MessageWithOneofEnums_WrappedCustom: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("wrapped_custom") - ov.WrappedCustom.MarshalProtoJSON(s.WithField("wrapped_custom")) - } - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithOneofEnums to JSON. -func (x *MessageWithOneofEnums) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithOneofEnums message from JSON. -func (x *MessageWithOneofEnums) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "regular": - s.AddField("regular") - ov := &MessageWithOneofEnums_Regular{} - x.Value = ov - ov.Regular = RegularEnum(s.ReadEnum(RegularEnum_value)) - case "custom": - s.AddField("custom") - ov := &MessageWithOneofEnums_Custom{} - x.Value = ov - ov.Custom.UnmarshalProtoJSON(s) - case "wrapped_custom", "wrappedCustom": - s.AddField("wrapped_custom") - ov := &MessageWithOneofEnums_WrappedCustom{} - x.Value = ov - if s.ReadNil() { - ov.WrappedCustom = nil - return - } - ov.WrappedCustom = &CustomEnumValue{} - ov.WrappedCustom.UnmarshalProtoJSON(s.WithField("wrapped_custom", false)) - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithOneofEnums from JSON. -func (x *MessageWithOneofEnums) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} diff --git a/test/gogo/enums_test.go b/test/gogo/enums_test.go deleted file mode 100644 index d31a1eb3..00000000 --- a/test/gogo/enums_test.go +++ /dev/null @@ -1,206 +0,0 @@ -package test_test - -import ( - "fmt" - "testing" - - . "github.com/TheThingsIndustries/protoc-gen-go-json/test/gogo" -) - -var testMessagesWithWithEnums = []struct { - name string - msg MessageWithEnums - expected string - expectedMask []string -}{ - { - name: "empty", - msg: MessageWithEnums{}, - expected: `{}`, - }, - { - name: "zero", - msg: MessageWithEnums{}, - expected: `{ - "regular": 0, - "regulars": [], - "custom": "CUSTOM_UNKNOWN", - "customs": [], - "wrapped_custom": null, - "wrapped_customs": [] - }`, - expectedMask: []string{ - "regular", - "regulars", - "custom", - "customs", - "wrapped_custom", - "wrapped_customs", - }, - }, - { - name: "full", - msg: MessageWithEnums{ - Regular: REGULAR_A, - Regulars: []RegularEnum{REGULAR_A, REGULAR_B}, - Custom: CustomEnum_CUSTOM_V1_0, - Customs: []CustomEnum{ - CustomEnum_CUSTOM_V1_0, - CustomEnum_CUSTOM_V1_0_1, - }, - WrappedCustom: &CustomEnumValue{ - Value: CustomEnum_CUSTOM_V1_0, - }, - WrappedCustoms: []*CustomEnumValue{ - {Value: CustomEnum_CUSTOM_V1_0}, - {Value: CustomEnum_CUSTOM_V1_0_1}, - }, - }, - expected: `{ - "regular": 1, - "regulars": [1, 2], - "custom": "1.0", - "customs": ["1.0", "1.0.1"], - "wrapped_custom": "1.0", - "wrapped_customs": ["1.0", "1.0.1"] - }`, - expectedMask: []string{ - "regular", - "regulars", - "custom", - "customs", - "wrapped_custom", - "wrapped_customs", - }, - }, -} - -func TestMarshalMessageWithEnums(t *testing.T) { - for _, tt := range testMessagesWithWithEnums { - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithEnums(t *testing.T) { - for _, tt := range testMessagesWithWithEnums { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} - -var testMessagesWithWithOneofEnums = []struct { - name string - msg MessageWithOneofEnums - expected string - expectedMask []string -}{ - { - name: "empty", - msg: MessageWithOneofEnums{}, - expected: `{}`, - }, - { - name: "regular_zero", - msg: MessageWithOneofEnums{ - Value: &MessageWithOneofEnums_Regular{Regular: REGULAR_UNKNOWN}, - }, - expected: `{"regular": 0}`, - expectedMask: []string{"regular"}, - }, - { - name: "regular", - msg: MessageWithOneofEnums{ - Value: &MessageWithOneofEnums_Regular{Regular: REGULAR_A}, - }, - expected: `{"regular": 1}`, - expectedMask: []string{"regular"}, - }, - { - name: "custom_zero", - msg: MessageWithOneofEnums{ - Value: &MessageWithOneofEnums_Custom{Custom: CustomEnum_CUSTOM_UNKNOWN}, - }, - expected: `{"custom": "CUSTOM_UNKNOWN"}`, - expectedMask: []string{"custom"}, - }, - { - name: "custom", - msg: MessageWithOneofEnums{ - Value: &MessageWithOneofEnums_Custom{Custom: CustomEnum_CUSTOM_V1_0}, - }, - expected: `{"custom": "1.0"}`, - expectedMask: []string{"custom"}, - }, - { - name: "wrapped_zero", - msg: MessageWithOneofEnums{ - Value: &MessageWithOneofEnums_WrappedCustom{WrappedCustom: &CustomEnumValue{ - Value: CustomEnum_CUSTOM_UNKNOWN, - }}, - }, - expected: `{"wrapped_custom": "CUSTOM_UNKNOWN"}`, - expectedMask: []string{"wrapped_custom"}, - }, - { - name: "wrapped", - msg: MessageWithOneofEnums{ - Value: &MessageWithOneofEnums_WrappedCustom{WrappedCustom: &CustomEnumValue{ - Value: CustomEnum_CUSTOM_V1_0, - }}, - }, - expected: `{"wrapped_custom": "1.0"}`, - expectedMask: []string{"wrapped_custom"}, - }, -} - -func TestMarshalMessageWithOneofEnums(t *testing.T) { - for _, tt := range testMessagesWithWithOneofEnums { - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithOneofEnums(t *testing.T) { - for _, tt := range testMessagesWithWithOneofEnums { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} - -func TestCustomEnum_TextMarshalers(t *testing.T) { - for _, tt := range []struct { - enum CustomEnum - values []string - }{ - {CustomEnum_CUSTOM_UNKNOWN, []string{"CUSTOM_UNKNOWN", "UNKNOWN", "0"}}, - {CustomEnum_CUSTOM_V1_0, []string{"1.0", "1.0.0", "CUSTOM_V1_0", "V1_0", "1"}}, - {CustomEnum_CUSTOM_V1_0_1, []string{"1.0.1", "CUSTOM_V1_0_1", "V1_0_1", "2"}}, - } { - t.Run(fmt.Sprintf("MarshalText_%s", tt.enum), func(t *testing.T) { - txt, err := tt.enum.MarshalText() - if err != nil { - t.Fatal(err) - } - if string(txt) != tt.values[0] { - t.Errorf("expected: %s, got: %s", tt.values[0], string(txt)) - } - }) - t.Run(fmt.Sprintf("UnmarshalText_%s", tt.enum), func(t *testing.T) { - for _, value := range tt.values { - var enum CustomEnum - err := enum.UnmarshalText([]byte(value)) - if err != nil { - t.Fatal(err) - } - if enum != tt.enum { - t.Errorf("expected %q to unmarshal as %s, got: %s", value, tt.enum, enum) - } - } - }) - } -} diff --git a/test/gogo/fieldmask.pb.go b/test/gogo/fieldmask.pb.go deleted file mode 100644 index e9081a86..00000000 --- a/test/gogo/fieldmask.pb.go +++ /dev/null @@ -1,363 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: fieldmask.proto - -package test - -import ( - fmt "fmt" - _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" - proto "github.com/gogo/protobuf/proto" - types "github.com/gogo/protobuf/types" - 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 - -type MessageWithFieldMask struct { - FieldMask *types.FieldMask `protobuf:"bytes,1,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithFieldMask) Reset() { *m = MessageWithFieldMask{} } -func (m *MessageWithFieldMask) String() string { return proto.CompactTextString(m) } -func (*MessageWithFieldMask) ProtoMessage() {} -func (*MessageWithFieldMask) Descriptor() ([]byte, []int) { - return fileDescriptor_13c7df288dcaeb9c, []int{0} -} -func (m *MessageWithFieldMask) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithFieldMask.Unmarshal(m, b) -} -func (m *MessageWithFieldMask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithFieldMask.Marshal(b, m, deterministic) -} -func (m *MessageWithFieldMask) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithFieldMask.Merge(m, src) -} -func (m *MessageWithFieldMask) XXX_Size() int { - return xxx_messageInfo_MessageWithFieldMask.Size(m) -} -func (m *MessageWithFieldMask) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithFieldMask.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithFieldMask proto.InternalMessageInfo - -func (m *MessageWithFieldMask) GetFieldMask() *types.FieldMask { - if m != nil { - return m.FieldMask - } - return nil -} - -func (m *MessageWithFieldMask) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type MessageWithoutFieldMask struct { - 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 *MessageWithoutFieldMask) Reset() { *m = MessageWithoutFieldMask{} } -func (m *MessageWithoutFieldMask) String() string { return proto.CompactTextString(m) } -func (*MessageWithoutFieldMask) ProtoMessage() {} -func (*MessageWithoutFieldMask) Descriptor() ([]byte, []int) { - return fileDescriptor_13c7df288dcaeb9c, []int{1} -} -func (m *MessageWithoutFieldMask) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithoutFieldMask.Unmarshal(m, b) -} -func (m *MessageWithoutFieldMask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithoutFieldMask.Marshal(b, m, deterministic) -} -func (m *MessageWithoutFieldMask) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithoutFieldMask.Merge(m, src) -} -func (m *MessageWithoutFieldMask) XXX_Size() int { - return xxx_messageInfo_MessageWithoutFieldMask.Size(m) -} -func (m *MessageWithoutFieldMask) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithoutFieldMask.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithoutFieldMask proto.InternalMessageInfo - -func (m *MessageWithoutFieldMask) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type MessageWithSubmessageWithFieldmask struct { - Submessage *MessageWithFieldMask `protobuf:"bytes,1,opt,name=submessage,proto3" json:"submessage,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithSubmessageWithFieldmask) Reset() { *m = MessageWithSubmessageWithFieldmask{} } -func (m *MessageWithSubmessageWithFieldmask) String() string { return proto.CompactTextString(m) } -func (*MessageWithSubmessageWithFieldmask) ProtoMessage() {} -func (*MessageWithSubmessageWithFieldmask) Descriptor() ([]byte, []int) { - return fileDescriptor_13c7df288dcaeb9c, []int{2} -} -func (m *MessageWithSubmessageWithFieldmask) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithSubmessageWithFieldmask.Unmarshal(m, b) -} -func (m *MessageWithSubmessageWithFieldmask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithSubmessageWithFieldmask.Marshal(b, m, deterministic) -} -func (m *MessageWithSubmessageWithFieldmask) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithSubmessageWithFieldmask.Merge(m, src) -} -func (m *MessageWithSubmessageWithFieldmask) XXX_Size() int { - return xxx_messageInfo_MessageWithSubmessageWithFieldmask.Size(m) -} -func (m *MessageWithSubmessageWithFieldmask) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithSubmessageWithFieldmask.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithSubmessageWithFieldmask proto.InternalMessageInfo - -func (m *MessageWithSubmessageWithFieldmask) GetSubmessage() *MessageWithFieldMask { - if m != nil { - return m.Submessage - } - return nil -} - -type MessageWithSubmessageWithoutFieldmask struct { - Submessage *MessageWithoutFieldMask `protobuf:"bytes,1,opt,name=submessage,proto3" json:"submessage,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithSubmessageWithoutFieldmask) Reset() { *m = MessageWithSubmessageWithoutFieldmask{} } -func (m *MessageWithSubmessageWithoutFieldmask) String() string { return proto.CompactTextString(m) } -func (*MessageWithSubmessageWithoutFieldmask) ProtoMessage() {} -func (*MessageWithSubmessageWithoutFieldmask) Descriptor() ([]byte, []int) { - return fileDescriptor_13c7df288dcaeb9c, []int{3} -} -func (m *MessageWithSubmessageWithoutFieldmask) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithSubmessageWithoutFieldmask.Unmarshal(m, b) -} -func (m *MessageWithSubmessageWithoutFieldmask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithSubmessageWithoutFieldmask.Marshal(b, m, deterministic) -} -func (m *MessageWithSubmessageWithoutFieldmask) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithSubmessageWithoutFieldmask.Merge(m, src) -} -func (m *MessageWithSubmessageWithoutFieldmask) XXX_Size() int { - return xxx_messageInfo_MessageWithSubmessageWithoutFieldmask.Size(m) -} -func (m *MessageWithSubmessageWithoutFieldmask) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithSubmessageWithoutFieldmask.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithSubmessageWithoutFieldmask proto.InternalMessageInfo - -func (m *MessageWithSubmessageWithoutFieldmask) GetSubmessage() *MessageWithoutFieldMask { - if m != nil { - return m.Submessage - } - return nil -} - -type MessageWithFieldmaskAndSubmessageWithFieldmask struct { - FieldMask *types.FieldMask `protobuf:"bytes,1,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"` - Submessage *MessageWithoutFieldMask `protobuf:"bytes,2,opt,name=submessage,proto3" json:"submessage,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) Reset() { - *m = MessageWithFieldmaskAndSubmessageWithFieldmask{} -} -func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) String() string { - return proto.CompactTextString(m) -} -func (*MessageWithFieldmaskAndSubmessageWithFieldmask) ProtoMessage() {} -func (*MessageWithFieldmaskAndSubmessageWithFieldmask) Descriptor() ([]byte, []int) { - return fileDescriptor_13c7df288dcaeb9c, []int{4} -} -func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithFieldmask.Unmarshal(m, b) -} -func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithFieldmask.Marshal(b, m, deterministic) -} -func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithFieldmask.Merge(m, src) -} -func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) XXX_Size() int { - return xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithFieldmask.Size(m) -} -func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithFieldmask.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithFieldmask proto.InternalMessageInfo - -func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) GetFieldMask() *types.FieldMask { - if m != nil { - return m.FieldMask - } - return nil -} - -func (m *MessageWithFieldmaskAndSubmessageWithFieldmask) GetSubmessage() *MessageWithoutFieldMask { - if m != nil { - return m.Submessage - } - return nil -} - -type MessageWithFieldmaskAndSubmessageWithoutFieldmask struct { - FieldMask *types.FieldMask `protobuf:"bytes,1,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"` - Submessage *MessageWithFieldMask `protobuf:"bytes,2,opt,name=submessage,proto3" json:"submessage,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) Reset() { - *m = MessageWithFieldmaskAndSubmessageWithoutFieldmask{} -} -func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) String() string { - return proto.CompactTextString(m) -} -func (*MessageWithFieldmaskAndSubmessageWithoutFieldmask) ProtoMessage() {} -func (*MessageWithFieldmaskAndSubmessageWithoutFieldmask) Descriptor() ([]byte, []int) { - return fileDescriptor_13c7df288dcaeb9c, []int{5} -} -func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithoutFieldmask.Unmarshal(m, b) -} -func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithoutFieldmask.Marshal(b, m, deterministic) -} -func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithoutFieldmask.Merge(m, src) -} -func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) XXX_Size() int { - return xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithoutFieldmask.Size(m) -} -func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithoutFieldmask.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithFieldmaskAndSubmessageWithoutFieldmask proto.InternalMessageInfo - -func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) GetFieldMask() *types.FieldMask { - if m != nil { - return m.FieldMask - } - return nil -} - -func (m *MessageWithFieldmaskAndSubmessageWithoutFieldmask) GetSubmessage() *MessageWithFieldMask { - if m != nil { - return m.Submessage - } - return nil -} - -type MessageWithSubmessageWithFieldmaskAndMarshaler struct { - Submessage *MessageWithFieldMask `protobuf:"bytes,1,opt,name=submessage,proto3" json:"submessage,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) Reset() { - *m = MessageWithSubmessageWithFieldmaskAndMarshaler{} -} -func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) String() string { - return proto.CompactTextString(m) -} -func (*MessageWithSubmessageWithFieldmaskAndMarshaler) ProtoMessage() {} -func (*MessageWithSubmessageWithFieldmaskAndMarshaler) Descriptor() ([]byte, []int) { - return fileDescriptor_13c7df288dcaeb9c, []int{6} -} -func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithSubmessageWithFieldmaskAndMarshaler.Unmarshal(m, b) -} -func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithSubmessageWithFieldmaskAndMarshaler.Marshal(b, m, deterministic) -} -func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithSubmessageWithFieldmaskAndMarshaler.Merge(m, src) -} -func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) XXX_Size() int { - return xxx_messageInfo_MessageWithSubmessageWithFieldmaskAndMarshaler.Size(m) -} -func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithSubmessageWithFieldmaskAndMarshaler.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithSubmessageWithFieldmaskAndMarshaler proto.InternalMessageInfo - -func (m *MessageWithSubmessageWithFieldmaskAndMarshaler) GetSubmessage() *MessageWithFieldMask { - if m != nil { - return m.Submessage - } - return nil -} - -func init() { - proto.RegisterType((*MessageWithFieldMask)(nil), "thethings.json.test.MessageWithFieldMask") - proto.RegisterType((*MessageWithoutFieldMask)(nil), "thethings.json.test.MessageWithoutFieldMask") - proto.RegisterType((*MessageWithSubmessageWithFieldmask)(nil), "thethings.json.test.MessageWithSubmessageWithFieldmask") - proto.RegisterType((*MessageWithSubmessageWithoutFieldmask)(nil), "thethings.json.test.MessageWithSubmessageWithoutFieldmask") - proto.RegisterType((*MessageWithFieldmaskAndSubmessageWithFieldmask)(nil), "thethings.json.test.MessageWithFieldmaskAndSubmessageWithFieldmask") - proto.RegisterType((*MessageWithFieldmaskAndSubmessageWithoutFieldmask)(nil), "thethings.json.test.MessageWithFieldmaskAndSubmessageWithoutFieldmask") - proto.RegisterType((*MessageWithSubmessageWithFieldmaskAndMarshaler)(nil), "thethings.json.test.MessageWithSubmessageWithFieldmaskAndMarshaler") -} - -func init() { proto.RegisterFile("fieldmask.proto", fileDescriptor_13c7df288dcaeb9c) } - -var fileDescriptor_13c7df288dcaeb9c = []byte{ - // 348 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xc1, 0x4a, 0xc3, 0x40, - 0x10, 0x86, 0x49, 0x91, 0x62, 0xd7, 0x83, 0x18, 0x05, 0x6b, 0x4f, 0x25, 0x20, 0x54, 0x30, 0x1b, - 0x54, 0x10, 0xf5, 0x56, 0x0f, 0x85, 0x82, 0xbd, 0xd4, 0x82, 0xe0, 0x45, 0x36, 0xcd, 0x74, 0xb3, - 0xb6, 0xd9, 0x95, 0xcc, 0xee, 0x13, 0xf8, 0x36, 0xbe, 0x81, 0xaf, 0xe4, 0x53, 0x48, 0xb6, 0xb6, - 0x4d, 0x6c, 0x8a, 0x62, 0xbc, 0x25, 0xcc, 0xbf, 0xf3, 0x7d, 0x33, 0x9b, 0x90, 0xdd, 0x89, 0x80, - 0x59, 0x94, 0x30, 0x9c, 0xd2, 0x97, 0x54, 0x69, 0xe5, 0xee, 0xeb, 0x18, 0x74, 0x2c, 0x24, 0x47, - 0xfa, 0x8c, 0x4a, 0x52, 0x0d, 0xa8, 0x5b, 0x7b, 0x4c, 0x4a, 0xa5, 0x99, 0x16, 0x4a, 0xe2, 0x3c, - 0xd7, 0x6a, 0x73, 0xa5, 0xf8, 0x0c, 0x02, 0xfb, 0x16, 0x9a, 0x49, 0x60, 0x1b, 0x3d, 0xad, 0x3a, - 0x79, 0x40, 0x0e, 0x06, 0x80, 0xc8, 0x38, 0x3c, 0x08, 0x1d, 0xf7, 0xb2, 0xf2, 0x80, 0xe1, 0xd4, - 0xbd, 0x26, 0x64, 0x95, 0x6d, 0x3a, 0x6d, 0xa7, 0xb3, 0x73, 0xde, 0xa2, 0xf3, 0x76, 0x74, 0xd1, - 0x8e, 0x2e, 0xf3, 0xc3, 0xc6, 0x64, 0x79, 0xd4, 0x25, 0x5b, 0x92, 0x25, 0xd0, 0xac, 0xb5, 0x9d, - 0x4e, 0x63, 0x68, 0x9f, 0x3d, 0x9f, 0x1c, 0xe6, 0x30, 0xca, 0xe8, 0xde, 0x5a, 0xdc, 0xc9, 0xc5, - 0x15, 0xf1, 0x72, 0xf1, 0x7b, 0x13, 0x26, 0xdf, 0x1c, 0x33, 0x2b, 0xb7, 0x4f, 0x08, 0x2e, 0x4b, - 0x5f, 0x8e, 0x27, 0xb4, 0x64, 0x35, 0xb4, 0x6c, 0xc4, 0x61, 0xee, 0xb0, 0x67, 0xc8, 0xf1, 0x46, - 0xe0, 0xc2, 0xd6, 0x32, 0xef, 0x4a, 0x98, 0xa7, 0x3f, 0x31, 0xf3, 0xf3, 0x16, 0xb0, 0xef, 0x0e, - 0x59, 0x73, 0xcb, 0x30, 0x5d, 0x19, 0x6d, 0x1a, 0xba, 0xc2, 0xc5, 0x14, 0xdd, 0x6b, 0xd5, 0xdd, - 0xcf, 0x7e, 0xe5, 0x5e, 0xd8, 0x5f, 0x05, 0xfd, 0x7e, 0x89, 0xfe, 0x1f, 0xaf, 0xfb, 0xb5, 0xb8, - 0xf7, 0x0d, 0xbb, 0xee, 0xca, 0x68, 0xc0, 0x52, 0x8c, 0xd9, 0x0c, 0xd2, 0x7f, 0xfc, 0xd8, 0x6e, - 0xea, 0x1f, 0x6f, 0x47, 0xb5, 0x6d, 0xe7, 0xf6, 0xea, 0xf1, 0x92, 0x0b, 0x1d, 0x9b, 0x90, 0x8e, - 0x55, 0x12, 0x8c, 0x62, 0x18, 0xd9, 0x56, 0x7d, 0x19, 0x19, 0xd4, 0xa9, 0x00, 0x9c, 0xff, 0xb7, - 0x63, 0x9f, 0x83, 0xf4, 0xb9, 0xf2, 0x33, 0x44, 0x90, 0x21, 0xc2, 0xba, 0x2d, 0x5c, 0x7c, 0x06, - 0x00, 0x00, 0xff, 0xff, 0x47, 0xec, 0x76, 0xa4, 0x19, 0x04, 0x00, 0x00, -} diff --git a/test/gogo/fieldmask_json.pb.go b/test/gogo/fieldmask_json.pb.go deleted file mode 100644 index ad3c5977..00000000 --- a/test/gogo/fieldmask_json.pb.go +++ /dev/null @@ -1,305 +0,0 @@ -// Code generated by protoc-gen-go-json. DO NOT EDIT. -// versions: -// - protoc-gen-go-json v0.0.0-dev -// - protoc v3.9.1 -// source: fieldmask.proto - -package test - -import ( - gogo "github.com/TheThingsIndustries/protoc-gen-go-json/gogo" - jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" -) - -// MarshalProtoJSON marshals the MessageWithFieldMask message to JSON. -func (x *MessageWithFieldMask) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.FieldMask != nil || s.HasField("field_mask") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("field_mask") - if x.FieldMask == nil { - s.WriteNil() - } else { - gogo.MarshalFieldMask(s, x.FieldMask) - } - } - if x.Name != "" || s.HasField("name") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("name") - s.WriteString(x.Name) - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithFieldMask to JSON. -func (x *MessageWithFieldMask) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithFieldMask message from JSON. -func (x *MessageWithFieldMask) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "field_mask", "fieldMask": - s.AddField("field_mask") - if s.ReadNil() { - x.FieldMask = nil - return - } - v := gogo.UnmarshalFieldMask(s) - if s.Err() != nil { - return - } - x.FieldMask = v - case "name": - s.AddField("name") - x.Name = s.ReadString() - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithFieldMask from JSON. -func (x *MessageWithFieldMask) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithSubmessageWithFieldmask message to JSON. -func (x *MessageWithSubmessageWithFieldmask) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.Submessage != nil || s.HasField("submessage") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("submessage") - x.Submessage.MarshalProtoJSON(s.WithField("submessage")) - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithSubmessageWithFieldmask to JSON. -func (x *MessageWithSubmessageWithFieldmask) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithSubmessageWithFieldmask message from JSON. -func (x *MessageWithSubmessageWithFieldmask) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "submessage": - s.AddField("submessage") - if s.ReadNil() { - x.Submessage = nil - return - } - x.Submessage = &MessageWithFieldMask{} - x.Submessage.UnmarshalProtoJSON(s.WithField("submessage", false)) - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithSubmessageWithFieldmask from JSON. -func (x *MessageWithSubmessageWithFieldmask) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithFieldmaskAndSubmessageWithFieldmask message to JSON. -func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.FieldMask != nil || s.HasField("field_mask") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("field_mask") - if x.FieldMask == nil { - s.WriteNil() - } else { - gogo.MarshalFieldMask(s, x.FieldMask) - } - } - if x.Submessage != nil || s.HasField("submessage") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("submessage") - // NOTE: MessageWithoutFieldMask does not seem to implement MarshalProtoJSON. - gogo.MarshalMessage(s, x.Submessage) - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithFieldmaskAndSubmessageWithFieldmask to JSON. -func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithFieldmaskAndSubmessageWithFieldmask message from JSON. -func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "field_mask", "fieldMask": - s.AddField("field_mask") - if s.ReadNil() { - x.FieldMask = nil - return - } - v := gogo.UnmarshalFieldMask(s) - if s.Err() != nil { - return - } - x.FieldMask = v - case "submessage": - s.AddField("submessage") - if s.ReadNil() { - x.Submessage = nil - return - } - // NOTE: MessageWithoutFieldMask does not seem to implement UnmarshalProtoJSON. - var v MessageWithoutFieldMask - gogo.UnmarshalMessage(s, &v) - x.Submessage = &v - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithFieldmaskAndSubmessageWithFieldmask from JSON. -func (x *MessageWithFieldmaskAndSubmessageWithFieldmask) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithFieldmaskAndSubmessageWithoutFieldmask message to JSON. -func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.FieldMask != nil || s.HasField("field_mask") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("field_mask") - if x.FieldMask == nil { - s.WriteNil() - } else { - gogo.MarshalFieldMask(s, x.FieldMask) - } - } - if x.Submessage != nil || s.HasField("submessage") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("submessage") - x.Submessage.MarshalProtoJSON(s.WithField("submessage")) - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithFieldmaskAndSubmessageWithoutFieldmask to JSON. -func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithFieldmaskAndSubmessageWithoutFieldmask message from JSON. -func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "field_mask", "fieldMask": - s.AddField("field_mask") - if s.ReadNil() { - x.FieldMask = nil - return - } - v := gogo.UnmarshalFieldMask(s) - if s.Err() != nil { - return - } - x.FieldMask = v - case "submessage": - s.AddField("submessage") - if s.ReadNil() { - x.Submessage = nil - return - } - x.Submessage = &MessageWithFieldMask{} - x.Submessage.UnmarshalProtoJSON(s.WithField("submessage", false)) - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithFieldmaskAndSubmessageWithoutFieldmask from JSON. -func (x *MessageWithFieldmaskAndSubmessageWithoutFieldmask) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithSubmessageWithFieldmaskAndMarshaler message to JSON. -func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.Submessage != nil || s.HasField("submessage") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("submessage") - x.Submessage.MarshalProtoJSON(s.WithField("submessage")) - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithSubmessageWithFieldmaskAndMarshaler to JSON. -func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithSubmessageWithFieldmaskAndMarshaler message from JSON. -func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "submessage": - s.AddField("submessage") - if s.ReadNil() { - x.Submessage = nil - return - } - x.Submessage = &MessageWithFieldMask{} - x.Submessage.UnmarshalProtoJSON(s.WithField("submessage", false)) - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithSubmessageWithFieldmaskAndMarshaler from JSON. -func (x *MessageWithSubmessageWithFieldmaskAndMarshaler) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} diff --git a/test/gogo/gogo.pb.go b/test/gogo/gogo.pb.go deleted file mode 100644 index 023cb821..00000000 --- a/test/gogo/gogo.pb.go +++ /dev/null @@ -1,364 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: gogo.proto - -package test - -import ( - fmt "fmt" - _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" - github_com_TheThingsIndustries_protoc_gen_go_json_test_types "github.com/TheThingsIndustries/protoc-gen-go-json/test/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - math "math" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -type MessageWithGoGoOptions struct { - EUIWithCustomName []byte `protobuf:"bytes,1,opt,name=eui_with_custom_name,json=euiWithCustomName,proto3" json:"eui_with_custom_name,omitempty"` - EUIWithCustomNameAndType *github_com_TheThingsIndustries_protoc_gen_go_json_test_types.EUI64 `protobuf:"bytes,2,opt,name=eui_with_custom_name_and_type,json=euiWithCustomNameAndType,proto3,customtype=github.com/TheThingsIndustries/protoc-gen-go-json/test/types.EUI64" json:"eui_with_custom_name_and_type,omitempty"` - NonNullableEUIWithCustomNameAndType github_com_TheThingsIndustries_protoc_gen_go_json_test_types.EUI64 `protobuf:"bytes,3,opt,name=non_nullable_eui_with_custom_name_and_type,json=nonNullableEuiWithCustomNameAndType,proto3,customtype=github.com/TheThingsIndustries/protoc-gen-go-json/test/types.EUI64" json:"non_nullable_eui_with_custom_name_and_type"` - EUIsWithCustomNameAndType []github_com_TheThingsIndustries_protoc_gen_go_json_test_types.EUI64 `protobuf:"bytes,4,rep,name=euis_with_custom_name_and_type,json=euisWithCustomNameAndType,proto3,customtype=github.com/TheThingsIndustries/protoc-gen-go-json/test/types.EUI64" json:"euis_with_custom_name_and_type,omitempty"` - Duration *time.Duration `protobuf:"bytes,5,opt,name=duration,proto3,stdduration" json:"duration,omitempty"` - NonNullableDuration time.Duration `protobuf:"bytes,6,opt,name=non_nullable_duration,json=nonNullableDuration,proto3,stdduration" json:"non_nullable_duration"` - Timestamp *time.Time `protobuf:"bytes,7,opt,name=timestamp,proto3,stdtime" json:"timestamp,omitempty"` - NonNullableTimestamp time.Time `protobuf:"bytes,8,opt,name=non_nullable_timestamp,json=nonNullableTimestamp,proto3,stdtime" json:"non_nullable_timestamp"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithGoGoOptions) Reset() { *m = MessageWithGoGoOptions{} } -func (m *MessageWithGoGoOptions) String() string { return proto.CompactTextString(m) } -func (*MessageWithGoGoOptions) ProtoMessage() {} -func (*MessageWithGoGoOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_592445b5231bc2b9, []int{0} -} -func (m *MessageWithGoGoOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithGoGoOptions.Unmarshal(m, b) -} -func (m *MessageWithGoGoOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithGoGoOptions.Marshal(b, m, deterministic) -} -func (m *MessageWithGoGoOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithGoGoOptions.Merge(m, src) -} -func (m *MessageWithGoGoOptions) XXX_Size() int { - return xxx_messageInfo_MessageWithGoGoOptions.Size(m) -} -func (m *MessageWithGoGoOptions) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithGoGoOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithGoGoOptions proto.InternalMessageInfo - -func (m *MessageWithGoGoOptions) GetEUIWithCustomName() []byte { - if m != nil { - return m.EUIWithCustomName - } - return nil -} - -func (m *MessageWithGoGoOptions) GetDuration() *time.Duration { - if m != nil { - return m.Duration - } - return nil -} - -func (m *MessageWithGoGoOptions) GetNonNullableDuration() time.Duration { - if m != nil { - return m.NonNullableDuration - } - return 0 -} - -func (m *MessageWithGoGoOptions) GetTimestamp() *time.Time { - if m != nil { - return m.Timestamp - } - return nil -} - -func (m *MessageWithGoGoOptions) GetNonNullableTimestamp() time.Time { - if m != nil { - return m.NonNullableTimestamp - } - return time.Time{} -} - -type SubMessage struct { - Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubMessage) Reset() { *m = SubMessage{} } -func (m *SubMessage) String() string { return proto.CompactTextString(m) } -func (*SubMessage) ProtoMessage() {} -func (*SubMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_592445b5231bc2b9, []int{1} -} -func (m *SubMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubMessage.Unmarshal(m, b) -} -func (m *SubMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubMessage.Marshal(b, m, deterministic) -} -func (m *SubMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubMessage.Merge(m, src) -} -func (m *SubMessage) XXX_Size() int { - return xxx_messageInfo_SubMessage.Size(m) -} -func (m *SubMessage) XXX_DiscardUnknown() { - xxx_messageInfo_SubMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_SubMessage proto.InternalMessageInfo - -func (m *SubMessage) GetField() string { - if m != nil { - return m.Field - } - return "" -} - -type SubMessageWithoutMarshalers struct { - OtherField string `protobuf:"bytes,1,opt,name=other_field,json=otherField,proto3" json:"other_field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubMessageWithoutMarshalers) Reset() { *m = SubMessageWithoutMarshalers{} } -func (m *SubMessageWithoutMarshalers) String() string { return proto.CompactTextString(m) } -func (*SubMessageWithoutMarshalers) ProtoMessage() {} -func (*SubMessageWithoutMarshalers) Descriptor() ([]byte, []int) { - return fileDescriptor_592445b5231bc2b9, []int{2} -} -func (m *SubMessageWithoutMarshalers) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubMessageWithoutMarshalers.Unmarshal(m, b) -} -func (m *SubMessageWithoutMarshalers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubMessageWithoutMarshalers.Marshal(b, m, deterministic) -} -func (m *SubMessageWithoutMarshalers) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubMessageWithoutMarshalers.Merge(m, src) -} -func (m *SubMessageWithoutMarshalers) XXX_Size() int { - return xxx_messageInfo_SubMessageWithoutMarshalers.Size(m) -} -func (m *SubMessageWithoutMarshalers) XXX_DiscardUnknown() { - xxx_messageInfo_SubMessageWithoutMarshalers.DiscardUnknown(m) -} - -var xxx_messageInfo_SubMessageWithoutMarshalers proto.InternalMessageInfo - -func (m *SubMessageWithoutMarshalers) GetOtherField() string { - if m != nil { - return m.OtherField - } - return "" -} - -type MessageWithNullable struct { - Sub SubMessage `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub"` - Subs []SubMessage `protobuf:"bytes,2,rep,name=subs,proto3" json:"subs"` - OtherSub SubMessageWithoutMarshalers `protobuf:"bytes,3,opt,name=other_sub,json=otherSub,proto3" json:"other_sub"` - OtherSubs []SubMessageWithoutMarshalers `protobuf:"bytes,4,rep,name=other_subs,json=otherSubs,proto3" json:"other_subs"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithNullable) Reset() { *m = MessageWithNullable{} } -func (m *MessageWithNullable) String() string { return proto.CompactTextString(m) } -func (*MessageWithNullable) ProtoMessage() {} -func (*MessageWithNullable) Descriptor() ([]byte, []int) { - return fileDescriptor_592445b5231bc2b9, []int{3} -} -func (m *MessageWithNullable) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithNullable.Unmarshal(m, b) -} -func (m *MessageWithNullable) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithNullable.Marshal(b, m, deterministic) -} -func (m *MessageWithNullable) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithNullable.Merge(m, src) -} -func (m *MessageWithNullable) XXX_Size() int { - return xxx_messageInfo_MessageWithNullable.Size(m) -} -func (m *MessageWithNullable) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithNullable.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithNullable proto.InternalMessageInfo - -func (m *MessageWithNullable) GetSub() SubMessage { - if m != nil { - return m.Sub - } - return SubMessage{} -} - -func (m *MessageWithNullable) GetSubs() []SubMessage { - if m != nil { - return m.Subs - } - return nil -} - -func (m *MessageWithNullable) GetOtherSub() SubMessageWithoutMarshalers { - if m != nil { - return m.OtherSub - } - return SubMessageWithoutMarshalers{} -} - -func (m *MessageWithNullable) GetOtherSubs() []SubMessageWithoutMarshalers { - if m != nil { - return m.OtherSubs - } - return nil -} - -type MessageWithEmbedded struct { - *SubMessage `protobuf:"bytes,1,opt,name=sub,proto3,embedded=sub" json:"sub,omitempty"` - *SubMessageWithoutMarshalers `protobuf:"bytes,2,opt,name=other_sub,json=otherSub,proto3,embedded=other_sub" json:"other_sub,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithEmbedded) Reset() { *m = MessageWithEmbedded{} } -func (m *MessageWithEmbedded) String() string { return proto.CompactTextString(m) } -func (*MessageWithEmbedded) ProtoMessage() {} -func (*MessageWithEmbedded) Descriptor() ([]byte, []int) { - return fileDescriptor_592445b5231bc2b9, []int{4} -} -func (m *MessageWithEmbedded) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithEmbedded.Unmarshal(m, b) -} -func (m *MessageWithEmbedded) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithEmbedded.Marshal(b, m, deterministic) -} -func (m *MessageWithEmbedded) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithEmbedded.Merge(m, src) -} -func (m *MessageWithEmbedded) XXX_Size() int { - return xxx_messageInfo_MessageWithEmbedded.Size(m) -} -func (m *MessageWithEmbedded) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithEmbedded.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithEmbedded proto.InternalMessageInfo - -type MessageWithNullableEmbedded struct { - SubMessage `protobuf:"bytes,1,opt,name=sub,proto3,embedded=sub" json:"sub"` - SubMessageWithoutMarshalers `protobuf:"bytes,2,opt,name=other_sub,json=otherSub,proto3,embedded=other_sub" json:"other_sub"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithNullableEmbedded) Reset() { *m = MessageWithNullableEmbedded{} } -func (m *MessageWithNullableEmbedded) String() string { return proto.CompactTextString(m) } -func (*MessageWithNullableEmbedded) ProtoMessage() {} -func (*MessageWithNullableEmbedded) Descriptor() ([]byte, []int) { - return fileDescriptor_592445b5231bc2b9, []int{5} -} -func (m *MessageWithNullableEmbedded) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithNullableEmbedded.Unmarshal(m, b) -} -func (m *MessageWithNullableEmbedded) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithNullableEmbedded.Marshal(b, m, deterministic) -} -func (m *MessageWithNullableEmbedded) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithNullableEmbedded.Merge(m, src) -} -func (m *MessageWithNullableEmbedded) XXX_Size() int { - return xxx_messageInfo_MessageWithNullableEmbedded.Size(m) -} -func (m *MessageWithNullableEmbedded) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithNullableEmbedded.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithNullableEmbedded proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MessageWithGoGoOptions)(nil), "thethings.json.test.MessageWithGoGoOptions") - proto.RegisterType((*SubMessage)(nil), "thethings.json.test.SubMessage") - proto.RegisterType((*SubMessageWithoutMarshalers)(nil), "thethings.json.test.SubMessageWithoutMarshalers") - proto.RegisterType((*MessageWithNullable)(nil), "thethings.json.test.MessageWithNullable") - proto.RegisterType((*MessageWithEmbedded)(nil), "thethings.json.test.MessageWithEmbedded") - proto.RegisterType((*MessageWithNullableEmbedded)(nil), "thethings.json.test.MessageWithNullableEmbedded") -} - -func init() { proto.RegisterFile("gogo.proto", fileDescriptor_592445b5231bc2b9) } - -var fileDescriptor_592445b5231bc2b9 = []byte{ - // 749 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x95, 0x3f, 0x4f, 0xdb, 0x4e, - 0x18, 0xc7, 0xb1, 0x13, 0xf8, 0x25, 0x17, 0x06, 0x38, 0xfe, 0x28, 0x09, 0x02, 0x47, 0x61, 0x41, - 0x3f, 0x09, 0xa7, 0xa2, 0x15, 0x55, 0x8b, 0x54, 0x95, 0xb4, 0x01, 0x22, 0x95, 0x54, 0x0a, 0x89, - 0xa8, 0x58, 0x2c, 0x1b, 0x1f, 0xb6, 0xab, 0xf8, 0x2e, 0xf2, 0xdd, 0xa9, 0xe2, 0x0d, 0x30, 0x74, - 0xea, 0xd0, 0xa1, 0x53, 0x97, 0x6e, 0xac, 0x55, 0xc7, 0xee, 0x55, 0xa7, 0xce, 0x1d, 0x52, 0x09, - 0x75, 0xe2, 0x2d, 0x74, 0xa9, 0xee, 0x92, 0xd8, 0x49, 0x13, 0xa0, 0x40, 0x86, 0x8e, 0xbe, 0xe7, - 0x9e, 0x8f, 0xbf, 0xf7, 0xf1, 0xe5, 0x09, 0x00, 0x0e, 0x71, 0x88, 0xde, 0x0c, 0x08, 0x23, 0x70, - 0x86, 0xb9, 0x88, 0xb9, 0x1e, 0x76, 0xa8, 0xfe, 0x92, 0x12, 0xac, 0x33, 0x44, 0x59, 0x76, 0xda, - 0xc4, 0x98, 0x30, 0x93, 0x79, 0x04, 0xd3, 0xf6, 0xbe, 0xec, 0xa2, 0x87, 0x19, 0x0a, 0xb0, 0xd9, - 0x28, 0x88, 0x66, 0xb9, 0x56, 0x88, 0x30, 0xd9, 0x25, 0x87, 0x10, 0xa7, 0x81, 0x0a, 0xf2, 0xc9, - 0xe2, 0x47, 0x05, 0x9b, 0x07, 0xb2, 0xbf, 0x53, 0xd7, 0xfe, 0xac, 0x33, 0xcf, 0x47, 0x94, 0x99, - 0x7e, 0xb3, 0xbd, 0x21, 0x7f, 0x92, 0x02, 0xf3, 0xbb, 0x88, 0x52, 0xd3, 0x41, 0xfb, 0x1e, 0x73, - 0xb7, 0xc9, 0x36, 0x79, 0xde, 0x94, 0x01, 0xe0, 0x16, 0x98, 0x45, 0xdc, 0x33, 0x5e, 0x79, 0xcc, - 0x35, 0x0e, 0x39, 0x65, 0xc4, 0x37, 0xb0, 0xe9, 0xa3, 0xb4, 0x92, 0x53, 0x56, 0x26, 0x8b, 0x73, - 0x67, 0x2d, 0x6d, 0xba, 0x54, 0x2f, 0x8b, 0xae, 0x27, 0xb2, 0x5a, 0x31, 0x7d, 0x54, 0x9d, 0x46, - 0xdc, 0xeb, 0x5f, 0x82, 0x9f, 0x55, 0xb0, 0x38, 0x0c, 0x64, 0x98, 0xd8, 0x36, 0xd8, 0x71, 0x13, - 0xa5, 0x55, 0x49, 0xfc, 0xa5, 0x9c, 0x9f, 0x66, 0xde, 0x2a, 0x60, 0xdb, 0xf1, 0x98, 0xcb, 0x2d, - 0xfd, 0x90, 0xf8, 0x85, 0x9a, 0x8b, 0x6a, 0xd2, 0x52, 0x19, 0xdb, 0x9c, 0xb2, 0xc0, 0x43, 0xb4, - 0x7d, 0x96, 0xc3, 0x55, 0x07, 0xe1, 0x55, 0x87, 0xac, 0x0a, 0x7b, 0x05, 0x61, 0xaf, 0x20, 0x50, - 0x54, 0xdf, 0x35, 0x03, 0xea, 0x9a, 0x8d, 0x9d, 0xd2, 0x0b, 0x58, 0xbe, 0x15, 0xa8, 0x8e, 0xfd, - 0x10, 0xf5, 0xbd, 0xa5, 0x15, 0x6f, 0x05, 0x2b, 0xd5, 0xcb, 0xeb, 0xf7, 0xce, 0x5a, 0x5a, 0x7a, - 0xc0, 0xd8, 0x26, 0xb6, 0x6b, 0xc7, 0x4d, 0x54, 0x4d, 0x0f, 0x88, 0xeb, 0x54, 0xe0, 0x4f, 0x15, - 0xfc, 0x8f, 0x09, 0x36, 0x30, 0x6f, 0x34, 0x4c, 0xab, 0x81, 0x8c, 0xcb, 0x65, 0xc6, 0xa4, 0xcc, - 0xd7, 0xea, 0x3f, 0x2b, 0xf3, 0x4b, 0x4b, 0x1b, 0x1b, 0x99, 0xd0, 0xe5, 0x0a, 0xc1, 0x95, 0x8e, - 0x98, 0x0b, 0xdd, 0x2e, 0xe3, 0x9e, 0x4d, 0x17, 0x69, 0xfe, 0xaa, 0x82, 0x25, 0xc4, 0x3d, 0x7a, - 0x89, 0xda, 0x78, 0x2e, 0xb6, 0x32, 0x59, 0x3c, 0x11, 0x6a, 0xdf, 0x2b, 0xe0, 0xd9, 0x88, 0xd4, - 0x6e, 0x06, 0x81, 0x79, 0x0c, 0x2b, 0x23, 0xf3, 0x2b, 0x79, 0x23, 0x13, 0x9c, 0x29, 0xd5, 0xcb, - 0x74, 0xb8, 0xd6, 0x8c, 0xd0, 0x35, 0x5c, 0xe6, 0x06, 0x48, 0x74, 0x27, 0x51, 0x7a, 0x3c, 0xa7, - 0xac, 0xa4, 0xd6, 0x32, 0x7a, 0x7b, 0x14, 0xe9, 0xdd, 0x51, 0xa4, 0x3f, 0xed, 0x6c, 0x28, 0xc6, - 0xdf, 0xfd, 0xd0, 0x94, 0x6a, 0xd8, 0x00, 0xf7, 0xc1, 0x5c, 0xdf, 0x7d, 0x0f, 0x49, 0x13, 0x57, - 0x91, 0x12, 0xe2, 0x6e, 0x49, 0xda, 0x4c, 0xcf, 0x27, 0xef, 0x96, 0xe1, 0x23, 0x90, 0x0c, 0xe7, - 0x5f, 0xfa, 0x3f, 0x09, 0xcb, 0x0e, 0xc0, 0x6a, 0xdd, 0x1d, 0xc5, 0xf8, 0x1b, 0x41, 0x8a, 0x5a, - 0xe0, 0x01, 0x98, 0xef, 0x0b, 0x16, 0xc1, 0x12, 0x57, 0xc2, 0x64, 0x34, 0x09, 0x9c, 0xed, 0x89, - 0x16, 0xd6, 0xf3, 0x79, 0x00, 0xf6, 0xb8, 0xd5, 0x19, 0xc5, 0x70, 0x16, 0x8c, 0x1f, 0x79, 0xa8, - 0x61, 0xcb, 0x61, 0x9b, 0xac, 0xb6, 0x1f, 0xf2, 0x3b, 0x60, 0x21, 0xda, 0x23, 0xc4, 0x13, 0xce, - 0x3a, 0xf7, 0x08, 0x05, 0x14, 0x6a, 0x20, 0x45, 0x98, 0x8b, 0x02, 0xa3, 0xb7, 0x15, 0xc8, 0xa5, - 0x2d, 0xb1, 0xf2, 0x30, 0x71, 0x7e, 0x9a, 0x89, 0x27, 0xc6, 0xa6, 0xc6, 0xf2, 0x9f, 0x54, 0x30, - 0xd3, 0xc3, 0xe9, 0xc6, 0x81, 0xf7, 0x41, 0x8c, 0x72, 0x4b, 0xb6, 0xa6, 0xd6, 0x34, 0x7d, 0xc8, - 0x9f, 0x94, 0x1e, 0x25, 0x28, 0xc6, 0xc5, 0x99, 0xaa, 0xa2, 0x03, 0x3e, 0x00, 0x71, 0xca, 0x2d, - 0x9a, 0x56, 0x73, 0xb1, 0xbf, 0xef, 0x94, 0x2d, 0x70, 0x0f, 0x24, 0xdb, 0xb1, 0xc5, 0x9b, 0x63, - 0xf2, 0xcd, 0x77, 0xae, 0xe8, 0x1f, 0x38, 0x7b, 0x07, 0x98, 0x90, 0xa0, 0x3d, 0x6e, 0xc1, 0x3a, - 0x00, 0x21, 0x94, 0xca, 0x1f, 0xee, 0xcd, 0xa9, 0xc9, 0x2e, 0x95, 0xe6, 0x3f, 0x28, 0x7d, 0xde, - 0x4a, 0xbe, 0x85, 0x6c, 0x1b, 0xd9, 0xd7, 0xf5, 0xf6, 0xad, 0xa5, 0x29, 0x6d, 0x6f, 0x7d, 0x87, - 0x57, 0x6f, 0x7a, 0x78, 0xc9, 0x0b, 0x0f, 0x9f, 0xff, 0xa8, 0x80, 0x85, 0x21, 0x5f, 0x37, 0x4c, - 0xbb, 0x71, 0xad, 0xb4, 0xf2, 0xe6, 0x46, 0x89, 0xf7, 0x47, 0x91, 0x38, 0x62, 0x86, 0xa9, 0x8b, - 0x8f, 0xe5, 0xed, 0x54, 0xa6, 0x94, 0x83, 0xf5, 0x9b, 0x4d, 0x2e, 0x6b, 0x42, 0x16, 0xee, 0xfe, - 0x0e, 0x00, 0x00, 0xff, 0xff, 0x09, 0xd2, 0xc6, 0xb8, 0x69, 0x09, 0x00, 0x00, -} diff --git a/test/gogo/gogo_json.pb.go b/test/gogo/gogo_json.pb.go deleted file mode 100644 index 425b2c73..00000000 --- a/test/gogo/gogo_json.pb.go +++ /dev/null @@ -1,421 +0,0 @@ -// Code generated by protoc-gen-go-json. DO NOT EDIT. -// versions: -// - protoc-gen-go-json v0.0.0-dev -// - protoc v3.9.1 -// source: gogo.proto - -package test - -import ( - gogo "github.com/TheThingsIndustries/protoc-gen-go-json/gogo" - jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" - types "github.com/TheThingsIndustries/protoc-gen-go-json/test/types" -) - -// MarshalProtoJSON marshals the MessageWithGoGoOptions message to JSON. -func (x *MessageWithGoGoOptions) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if len(x.EUIWithCustomName) > 0 || s.HasField("eui_with_custom_name") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("eui_with_custom_name") - s.WriteBytes(x.EUIWithCustomName) - } - if x.EUIWithCustomNameAndType != nil || s.HasField("eui_with_custom_name_and_type") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("eui_with_custom_name_and_type") - x.EUIWithCustomNameAndType.MarshalProtoJSON(s.WithField("eui_with_custom_name_and_type")) - } - if len(x.NonNullableEUIWithCustomNameAndType) > 0 || s.HasField("non_nullable_eui_with_custom_name_and_type") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("non_nullable_eui_with_custom_name_and_type") - x.NonNullableEUIWithCustomNameAndType.MarshalProtoJSON(s.WithField("non_nullable_eui_with_custom_name_and_type")) - } - if len(x.EUIsWithCustomNameAndType) > 0 || s.HasField("euis_with_custom_name_and_type") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("euis_with_custom_name_and_type") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.EUIsWithCustomNameAndType { - s.WriteMoreIf(&wroteElement) - element.MarshalProtoJSON(s.WithField("euis_with_custom_name_and_type")) - } - s.WriteArrayEnd() - } - if x.Duration != nil || s.HasField("duration") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("duration") - if x.Duration == nil { - s.WriteNil() - } else { - s.WriteDuration(*x.Duration) - } - } - if true { // (gogoproto.nullable) = false - s.WriteMoreIf(&wroteField) - s.WriteObjectField("non_nullable_duration") - s.WriteDuration(x.NonNullableDuration) - } - if x.Timestamp != nil || s.HasField("timestamp") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("timestamp") - if x.Timestamp == nil { - s.WriteNil() - } else { - s.WriteTime(*x.Timestamp) - } - } - if true { // (gogoproto.nullable) = false - s.WriteMoreIf(&wroteField) - s.WriteObjectField("non_nullable_timestamp") - s.WriteTime(x.NonNullableTimestamp) - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithGoGoOptions to JSON. -func (x *MessageWithGoGoOptions) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithGoGoOptions message from JSON. -func (x *MessageWithGoGoOptions) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "eui_with_custom_name", "euiWithCustomName": - s.AddField("eui_with_custom_name") - x.EUIWithCustomName = s.ReadBytes() - case "eui_with_custom_name_and_type", "euiWithCustomNameAndType": - s.AddField("eui_with_custom_name_and_type") - if s.ReadNil() { - x.EUIWithCustomNameAndType = nil - return - } - x.EUIWithCustomNameAndType = &types.EUI64{} - x.EUIWithCustomNameAndType.UnmarshalProtoJSON(s.WithField("eui_with_custom_name_and_type", false)) - case "non_nullable_eui_with_custom_name_and_type", "nonNullableEuiWithCustomNameAndType": - s.AddField("non_nullable_eui_with_custom_name_and_type") - x.NonNullableEUIWithCustomNameAndType.UnmarshalProtoJSON(s.WithField("non_nullable_eui_with_custom_name_and_type", false)) - case "euis_with_custom_name_and_type", "euisWithCustomNameAndType": - s.AddField("euis_with_custom_name_and_type") - if s.ReadNil() { - x.EUIsWithCustomNameAndType = nil - return - } - s.ReadArray(func() { - var v types.EUI64 - v.UnmarshalProtoJSON(s.WithField("euis_with_custom_name_and_type", false)) - x.EUIsWithCustomNameAndType = append(x.EUIsWithCustomNameAndType, v) - }) - case "duration": - s.AddField("duration") - if s.ReadNil() { - x.Duration = nil - return - } - v := s.ReadDuration() - if s.Err() != nil { - return - } - x.Duration = v - case "non_nullable_duration", "nonNullableDuration": - s.AddField("non_nullable_duration") - v := s.ReadDuration() - if s.Err() != nil { - return - } - x.NonNullableDuration = *v - case "timestamp": - s.AddField("timestamp") - if s.ReadNil() { - x.Timestamp = nil - return - } - v := s.ReadTime() - if s.Err() != nil { - return - } - x.Timestamp = v - case "non_nullable_timestamp", "nonNullableTimestamp": - s.AddField("non_nullable_timestamp") - v := s.ReadTime() - if s.Err() != nil { - return - } - x.NonNullableTimestamp = *v - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithGoGoOptions from JSON. -func (x *MessageWithGoGoOptions) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the SubMessage message to JSON. -func (x *SubMessage) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.Field != "" || s.HasField("field") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("field") - s.WriteString(x.Field) - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the SubMessage to JSON. -func (x *SubMessage) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the SubMessage message from JSON. -func (x *SubMessage) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "field": - s.AddField("field") - x.Field = s.ReadString() - } - }) -} - -// UnmarshalJSON unmarshals the SubMessage from JSON. -func (x *SubMessage) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithNullable message to JSON. -func (x *MessageWithNullable) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if true { // (gogoproto.nullable) = false - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sub") - x.Sub.MarshalProtoJSON(s.WithField("sub")) - } - if len(x.Subs) > 0 || s.HasField("subs") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("subs") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.Subs { - s.WriteMoreIf(&wroteElement) - element.MarshalProtoJSON(s.WithField("subs")) - } - s.WriteArrayEnd() - } - if true { // (gogoproto.nullable) = false - s.WriteMoreIf(&wroteField) - s.WriteObjectField("other_sub") - // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. - gogo.MarshalMessage(s, &x.OtherSub) - } - if len(x.OtherSubs) > 0 || s.HasField("other_subs") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("other_subs") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.OtherSubs { - s.WriteMoreIf(&wroteElement) - // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. - gogo.MarshalMessage(s, &element) - } - s.WriteArrayEnd() - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithNullable to JSON. -func (x *MessageWithNullable) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithNullable message from JSON. -func (x *MessageWithNullable) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "sub": - x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) - case "subs": - s.AddField("subs") - if s.ReadNil() { - x.Subs = nil - return - } - s.ReadArray(func() { - v := SubMessage{} - v.UnmarshalProtoJSON(s.WithField("subs", false)) - if s.Err() != nil { - return - } - x.Subs = append(x.Subs, v) - }) - case "other_sub", "otherSub": - s.AddField("other_sub") - // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. - var v SubMessageWithoutMarshalers - gogo.UnmarshalMessage(s, &v) - x.OtherSub = v - case "other_subs", "otherSubs": - s.AddField("other_subs") - if s.ReadNil() { - x.OtherSubs = nil - return - } - s.ReadArray(func() { - // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. - var v SubMessageWithoutMarshalers - gogo.UnmarshalMessage(s, &v) - x.OtherSubs = append(x.OtherSubs, v) - }) - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithNullable from JSON. -func (x *MessageWithNullable) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithEmbedded message to JSON. -func (x *MessageWithEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.SubMessage != nil || s.HasField("sub") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sub") - x.SubMessage.MarshalProtoJSON(s.WithField("sub")) - } - if x.SubMessageWithoutMarshalers != nil || s.HasField("other_sub") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("other_sub") - // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. - gogo.MarshalMessage(s, x.SubMessageWithoutMarshalers) - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithEmbedded to JSON. -func (x *MessageWithEmbedded) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithEmbedded message from JSON. -func (x *MessageWithEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "sub": - if s.ReadNil() { - x.SubMessage = nil - return - } - x.SubMessage = &SubMessage{} - x.SubMessage.UnmarshalProtoJSON(s.WithField("sub", true)) - case "other_sub", "otherSub": - s.AddField("other_sub") - if s.ReadNil() { - x.SubMessageWithoutMarshalers = nil - return - } - // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. - var v SubMessageWithoutMarshalers - gogo.UnmarshalMessage(s, &v) - x.SubMessageWithoutMarshalers = &v - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithEmbedded from JSON. -func (x *MessageWithEmbedded) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithNullableEmbedded message to JSON. -func (x *MessageWithNullableEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if true { // (gogoproto.nullable) = false - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sub") - x.SubMessage.MarshalProtoJSON(s.WithField("sub")) - } - if true { // (gogoproto.nullable) = false - s.WriteMoreIf(&wroteField) - s.WriteObjectField("other_sub") - // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. - gogo.MarshalMessage(s, &x.SubMessageWithoutMarshalers) - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithNullableEmbedded to JSON. -func (x *MessageWithNullableEmbedded) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithNullableEmbedded message from JSON. -func (x *MessageWithNullableEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "sub": - x.SubMessage.UnmarshalProtoJSON(s.WithField("sub", true)) - case "other_sub", "otherSub": - s.AddField("other_sub") - // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. - var v SubMessageWithoutMarshalers - gogo.UnmarshalMessage(s, &v) - x.SubMessageWithoutMarshalers = v - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithNullableEmbedded from JSON. -func (x *MessageWithNullableEmbedded) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} diff --git a/test/gogo/gogo_test.go b/test/gogo/gogo_test.go deleted file mode 100644 index 8cf9ef7d..00000000 --- a/test/gogo/gogo_test.go +++ /dev/null @@ -1,280 +0,0 @@ -package test_test - -import ( - "testing" - - . "github.com/TheThingsIndustries/protoc-gen-go-json/test/gogo" - types "github.com/TheThingsIndustries/protoc-gen-go-json/test/types" -) - -var testMessagesWithGoGoOptions = []struct { - name string - msg MessageWithGoGoOptions - expected string - expectedMask []string -}{ - { - name: "empty", - msg: MessageWithGoGoOptions{ - NonNullableEUIWithCustomNameAndType: types.EUI64{1, 2, 3, 4, 5, 6, 7, 8}, - NonNullableDuration: testDuration, - NonNullableTimestamp: testTime, - }, - expected: `{ - "non_nullable_eui_with_custom_name_and_type": "0102030405060708", - "non_nullable_duration": "3723.123456789s", - "non_nullable_timestamp": "2006-01-02T08:04:05.123456789Z" - }`, - expectedMask: []string{ - "non_nullable_eui_with_custom_name_and_type", - "non_nullable_duration", - "non_nullable_timestamp", - }, - }, - { - name: "zero", - msg: MessageWithGoGoOptions{ - NonNullableEUIWithCustomNameAndType: types.EUI64{1, 2, 3, 4, 5, 6, 7, 8}, - NonNullableDuration: testDuration, - NonNullableTimestamp: testTime, - }, - expected: `{ - "eui_with_custom_name": null, - "eui_with_custom_name_and_type": null, - "non_nullable_eui_with_custom_name_and_type": "0102030405060708", - "euis_with_custom_name_and_type": [], - "duration": null, - "non_nullable_duration": "3723.123456789s", - "timestamp": null, - "non_nullable_timestamp": "2006-01-02T08:04:05.123456789Z" - }`, - expectedMask: []string{ - "eui_with_custom_name", - "eui_with_custom_name_and_type", - "non_nullable_eui_with_custom_name_and_type", - "euis_with_custom_name_and_type", - "duration", - "non_nullable_duration", - "timestamp", - "non_nullable_timestamp", - }, - }, - { - name: "full", - msg: MessageWithGoGoOptions{ - EUIWithCustomName: []byte{1, 2, 3, 4, 5, 6, 7, 8}, - EUIWithCustomNameAndType: &types.EUI64{1, 2, 3, 4, 5, 6, 7, 8}, - NonNullableEUIWithCustomNameAndType: types.EUI64{1, 2, 3, 4, 5, 6, 7, 8}, - EUIsWithCustomNameAndType: []types.EUI64{ - {1, 2, 3, 4, 5, 6, 7, 8}, - }, - Duration: &testDuration, - NonNullableDuration: testDuration, - Timestamp: &testTime, - NonNullableTimestamp: testTime, - }, - expected: `{ - "eui_with_custom_name": "AQIDBAUGBwg=", - "eui_with_custom_name_and_type": "0102030405060708", - "non_nullable_eui_with_custom_name_and_type": "0102030405060708", - "euis_with_custom_name_and_type": ["0102030405060708"], - "duration": "3723.123456789s", - "non_nullable_duration": "3723.123456789s", - "timestamp": "2006-01-02T08:04:05.123456789Z", - "non_nullable_timestamp": "2006-01-02T08:04:05.123456789Z" - }`, - expectedMask: []string{ - "eui_with_custom_name", - "eui_with_custom_name_and_type", - "non_nullable_eui_with_custom_name_and_type", - "euis_with_custom_name_and_type", - "duration", - "non_nullable_duration", - "timestamp", - "non_nullable_timestamp", - }, - }, -} - -func TestMarshalMessageWithGoGoOptions(t *testing.T) { - for _, tt := range testMessagesWithGoGoOptions { - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithGoGoOptions(t *testing.T) { - for _, tt := range testMessagesWithGoGoOptions { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} - -var testMessagesWithNullable = []struct { - name string - msg MessageWithNullable - expected string - expectedMask []string -}{ - { - name: "empty", - msg: MessageWithNullable{ - Sub: SubMessage{Field: "foo"}, - OtherSub: SubMessageWithoutMarshalers{OtherField: "foo"}, - }, - expected: `{ - "sub": {"field": "foo"}, - "other_sub": {"other_field": "foo"} - }`, - expectedMask: []string{ - "sub.field", - "other_sub", // NOTE: no marshaler. - }, - }, - { - name: "full", - msg: MessageWithNullable{ - Sub: SubMessage{Field: "foo"}, - Subs: []SubMessage{ - {Field: "foo"}, - {Field: "bar"}, - }, - OtherSub: SubMessageWithoutMarshalers{OtherField: "foo"}, - OtherSubs: []SubMessageWithoutMarshalers{ - {OtherField: "foo"}, - {OtherField: "bar"}, - }, - }, - expected: `{ - "sub": {"field": "foo"}, - "subs": [ - {"field": "foo"}, - {"field": "bar"} - ], - "other_sub": {"other_field": "foo"}, - "other_subs": [ - {"other_field": "foo"}, - {"other_field": "bar"} - ] - }`, - expectedMask: []string{ - "sub.field", - "subs", - "other_sub", // NOTE: no marshaler. - "other_subs", - }, - }, -} - -func TestMarshalMessageWithNullable(t *testing.T) { - for _, tt := range testMessagesWithNullable { - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithNullable(t *testing.T) { - for _, tt := range testMessagesWithNullable { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} - -var testMessagesWithEmbedded = []struct { - name string - msg MessageWithEmbedded - expected string - expectedMask []string -}{ - { - name: "empty", - msg: MessageWithEmbedded{}, - expected: `{}`, - }, - { - name: "zero", - msg: MessageWithEmbedded{ - SubMessage: &SubMessage{}, - }, - expected: `{ - "sub": {"field": ""} - }`, - expectedMask: []string{ - "sub.field", - }, - }, - { - name: "full", - msg: MessageWithEmbedded{ - SubMessage: &SubMessage{Field: "foo"}, - SubMessageWithoutMarshalers: &SubMessageWithoutMarshalers{OtherField: "foo"}, - }, - expected: `{ - "sub": {"field": "foo"}, - "other_sub": {"other_field": "foo"} - }`, - expectedMask: []string{ - "sub.field", - "other_sub", // NOTE: no marshaler. - }, - }, -} - -func TestMarshalMessageWithEmbedded(t *testing.T) { - for _, tt := range testMessagesWithEmbedded { - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithEmbedded(t *testing.T) { - for _, tt := range testMessagesWithEmbedded { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} - -var testMessagesWithNullableEmbedded = []struct { - name string - msg MessageWithNullableEmbedded - expected string - expectedMask []string -}{ - { - name: "full", - msg: MessageWithNullableEmbedded{ - SubMessage: SubMessage{Field: "foo"}, - SubMessageWithoutMarshalers: SubMessageWithoutMarshalers{OtherField: "foo"}, - }, - expected: `{ - "sub": {"field": "foo"}, - "other_sub": {"other_field": "foo"} - }`, - expectedMask: []string{ - "sub.field", - "other_sub", // NOTE: no marshaler. - }, - }, -} - -func TestMarshalMessageWithNullableEmbedded(t *testing.T) { - for _, tt := range testMessagesWithNullableEmbedded { - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithNullableEmbedded(t *testing.T) { - for _, tt := range testMessagesWithNullableEmbedded { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} diff --git a/test/gogo/scalars.pb.go b/test/gogo/scalars.pb.go deleted file mode 100644 index 412877d0..00000000 --- a/test/gogo/scalars.pb.go +++ /dev/null @@ -1,953 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: scalars.proto - -package test - -import ( - fmt "fmt" - _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" - proto "github.com/gogo/protobuf/proto" - 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 - -type MessageWithScalars struct { - DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3" json:"double_value,omitempty"` - DoubleValues []float64 `protobuf:"fixed64,2,rep,packed,name=double_values,json=doubleValues,proto3" json:"double_values,omitempty"` - FloatValue float32 `protobuf:"fixed32,3,opt,name=float_value,json=floatValue,proto3" json:"float_value,omitempty"` - FloatValues []float32 `protobuf:"fixed32,4,rep,packed,name=float_values,json=floatValues,proto3" json:"float_values,omitempty"` - Int32Value int32 `protobuf:"varint,5,opt,name=int32_value,json=int32Value,proto3" json:"int32_value,omitempty"` - Int32Values []int32 `protobuf:"varint,6,rep,packed,name=int32_values,json=int32Values,proto3" json:"int32_values,omitempty"` - Int64Value int64 `protobuf:"varint,7,opt,name=int64_value,json=int64Value,proto3" json:"int64_value,omitempty"` - Int64Values []int64 `protobuf:"varint,8,rep,packed,name=int64_values,json=int64Values,proto3" json:"int64_values,omitempty"` - Uint32Value uint32 `protobuf:"varint,9,opt,name=uint32_value,json=uint32Value,proto3" json:"uint32_value,omitempty"` - Uint32Values []uint32 `protobuf:"varint,10,rep,packed,name=uint32_values,json=uint32Values,proto3" json:"uint32_values,omitempty"` - Uint64Value uint64 `protobuf:"varint,11,opt,name=uint64_value,json=uint64Value,proto3" json:"uint64_value,omitempty"` - Uint64Values []uint64 `protobuf:"varint,12,rep,packed,name=uint64_values,json=uint64Values,proto3" json:"uint64_values,omitempty"` - Sint32Value int32 `protobuf:"zigzag32,13,opt,name=sint32_value,json=sint32Value,proto3" json:"sint32_value,omitempty"` - Sint32Values []int32 `protobuf:"zigzag32,14,rep,packed,name=sint32_values,json=sint32Values,proto3" json:"sint32_values,omitempty"` - Sint64Value int64 `protobuf:"zigzag64,15,opt,name=sint64_value,json=sint64Value,proto3" json:"sint64_value,omitempty"` - Sint64Values []int64 `protobuf:"zigzag64,16,rep,packed,name=sint64_values,json=sint64Values,proto3" json:"sint64_values,omitempty"` - Fixed32Value uint32 `protobuf:"fixed32,17,opt,name=fixed32_value,json=fixed32Value,proto3" json:"fixed32_value,omitempty"` - Fixed32Values []uint32 `protobuf:"fixed32,18,rep,packed,name=fixed32_values,json=fixed32Values,proto3" json:"fixed32_values,omitempty"` - Fixed64Value uint64 `protobuf:"fixed64,19,opt,name=fixed64_value,json=fixed64Value,proto3" json:"fixed64_value,omitempty"` - Fixed64Values []uint64 `protobuf:"fixed64,20,rep,packed,name=fixed64_values,json=fixed64Values,proto3" json:"fixed64_values,omitempty"` - Sfixed32Value int32 `protobuf:"fixed32,21,opt,name=sfixed32_value,json=sfixed32Value,proto3" json:"sfixed32_value,omitempty"` - Sfixed32Values []int32 `protobuf:"fixed32,22,rep,packed,name=sfixed32_values,json=sfixed32Values,proto3" json:"sfixed32_values,omitempty"` - Sfixed64Value int64 `protobuf:"fixed64,23,opt,name=sfixed64_value,json=sfixed64Value,proto3" json:"sfixed64_value,omitempty"` - Sfixed64Values []int64 `protobuf:"fixed64,24,rep,packed,name=sfixed64_values,json=sfixed64Values,proto3" json:"sfixed64_values,omitempty"` - BoolValue bool `protobuf:"varint,25,opt,name=bool_value,json=boolValue,proto3" json:"bool_value,omitempty"` - BoolValues []bool `protobuf:"varint,26,rep,packed,name=bool_values,json=boolValues,proto3" json:"bool_values,omitempty"` - StringValue string `protobuf:"bytes,27,opt,name=string_value,json=stringValue,proto3" json:"string_value,omitempty"` - StringValues []string `protobuf:"bytes,28,rep,name=string_values,json=stringValues,proto3" json:"string_values,omitempty"` - BytesValue []byte `protobuf:"bytes,29,opt,name=bytes_value,json=bytesValue,proto3" json:"bytes_value,omitempty"` - BytesValues [][]byte `protobuf:"bytes,30,rep,name=bytes_values,json=bytesValues,proto3" json:"bytes_values,omitempty"` - HexBytesValue []byte `protobuf:"bytes,31,opt,name=hex_bytes_value,json=hexBytesValue,proto3" json:"hex_bytes_value,omitempty"` - HexBytesValues [][]byte `protobuf:"bytes,32,rep,name=hex_bytes_values,json=hexBytesValues,proto3" json:"hex_bytes_values,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithScalars) Reset() { *m = MessageWithScalars{} } -func (m *MessageWithScalars) String() string { return proto.CompactTextString(m) } -func (*MessageWithScalars) ProtoMessage() {} -func (*MessageWithScalars) Descriptor() ([]byte, []int) { - return fileDescriptor_5d1bcd1a4bdfc194, []int{0} -} -func (m *MessageWithScalars) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithScalars.Unmarshal(m, b) -} -func (m *MessageWithScalars) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithScalars.Marshal(b, m, deterministic) -} -func (m *MessageWithScalars) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithScalars.Merge(m, src) -} -func (m *MessageWithScalars) XXX_Size() int { - return xxx_messageInfo_MessageWithScalars.Size(m) -} -func (m *MessageWithScalars) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithScalars.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithScalars proto.InternalMessageInfo - -func (m *MessageWithScalars) GetDoubleValue() float64 { - if m != nil { - return m.DoubleValue - } - return 0 -} - -func (m *MessageWithScalars) GetDoubleValues() []float64 { - if m != nil { - return m.DoubleValues - } - return nil -} - -func (m *MessageWithScalars) GetFloatValue() float32 { - if m != nil { - return m.FloatValue - } - return 0 -} - -func (m *MessageWithScalars) GetFloatValues() []float32 { - if m != nil { - return m.FloatValues - } - return nil -} - -func (m *MessageWithScalars) GetInt32Value() int32 { - if m != nil { - return m.Int32Value - } - return 0 -} - -func (m *MessageWithScalars) GetInt32Values() []int32 { - if m != nil { - return m.Int32Values - } - return nil -} - -func (m *MessageWithScalars) GetInt64Value() int64 { - if m != nil { - return m.Int64Value - } - return 0 -} - -func (m *MessageWithScalars) GetInt64Values() []int64 { - if m != nil { - return m.Int64Values - } - return nil -} - -func (m *MessageWithScalars) GetUint32Value() uint32 { - if m != nil { - return m.Uint32Value - } - return 0 -} - -func (m *MessageWithScalars) GetUint32Values() []uint32 { - if m != nil { - return m.Uint32Values - } - return nil -} - -func (m *MessageWithScalars) GetUint64Value() uint64 { - if m != nil { - return m.Uint64Value - } - return 0 -} - -func (m *MessageWithScalars) GetUint64Values() []uint64 { - if m != nil { - return m.Uint64Values - } - return nil -} - -func (m *MessageWithScalars) GetSint32Value() int32 { - if m != nil { - return m.Sint32Value - } - return 0 -} - -func (m *MessageWithScalars) GetSint32Values() []int32 { - if m != nil { - return m.Sint32Values - } - return nil -} - -func (m *MessageWithScalars) GetSint64Value() int64 { - if m != nil { - return m.Sint64Value - } - return 0 -} - -func (m *MessageWithScalars) GetSint64Values() []int64 { - if m != nil { - return m.Sint64Values - } - return nil -} - -func (m *MessageWithScalars) GetFixed32Value() uint32 { - if m != nil { - return m.Fixed32Value - } - return 0 -} - -func (m *MessageWithScalars) GetFixed32Values() []uint32 { - if m != nil { - return m.Fixed32Values - } - return nil -} - -func (m *MessageWithScalars) GetFixed64Value() uint64 { - if m != nil { - return m.Fixed64Value - } - return 0 -} - -func (m *MessageWithScalars) GetFixed64Values() []uint64 { - if m != nil { - return m.Fixed64Values - } - return nil -} - -func (m *MessageWithScalars) GetSfixed32Value() int32 { - if m != nil { - return m.Sfixed32Value - } - return 0 -} - -func (m *MessageWithScalars) GetSfixed32Values() []int32 { - if m != nil { - return m.Sfixed32Values - } - return nil -} - -func (m *MessageWithScalars) GetSfixed64Value() int64 { - if m != nil { - return m.Sfixed64Value - } - return 0 -} - -func (m *MessageWithScalars) GetSfixed64Values() []int64 { - if m != nil { - return m.Sfixed64Values - } - return nil -} - -func (m *MessageWithScalars) GetBoolValue() bool { - if m != nil { - return m.BoolValue - } - return false -} - -func (m *MessageWithScalars) GetBoolValues() []bool { - if m != nil { - return m.BoolValues - } - return nil -} - -func (m *MessageWithScalars) GetStringValue() string { - if m != nil { - return m.StringValue - } - return "" -} - -func (m *MessageWithScalars) GetStringValues() []string { - if m != nil { - return m.StringValues - } - return nil -} - -func (m *MessageWithScalars) GetBytesValue() []byte { - if m != nil { - return m.BytesValue - } - return nil -} - -func (m *MessageWithScalars) GetBytesValues() [][]byte { - if m != nil { - return m.BytesValues - } - return nil -} - -func (m *MessageWithScalars) GetHexBytesValue() []byte { - if m != nil { - return m.HexBytesValue - } - return nil -} - -func (m *MessageWithScalars) GetHexBytesValues() [][]byte { - if m != nil { - return m.HexBytesValues - } - return nil -} - -type MessageWithOneofScalars struct { - // Types that are valid to be assigned to Value: - // - // *MessageWithOneofScalars_DoubleValue - // *MessageWithOneofScalars_FloatValue - // *MessageWithOneofScalars_Int32Value - // *MessageWithOneofScalars_Int64Value - // *MessageWithOneofScalars_Uint32Value - // *MessageWithOneofScalars_Uint64Value - // *MessageWithOneofScalars_Sint32Value - // *MessageWithOneofScalars_Sint64Value - // *MessageWithOneofScalars_Fixed32Value - // *MessageWithOneofScalars_Fixed64Value - // *MessageWithOneofScalars_Sfixed32Value - // *MessageWithOneofScalars_Sfixed64Value - // *MessageWithOneofScalars_BoolValue - // *MessageWithOneofScalars_StringValue - // *MessageWithOneofScalars_BytesValue - // *MessageWithOneofScalars_HexBytesValue - Value isMessageWithOneofScalars_Value `protobuf_oneof:"value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithOneofScalars) Reset() { *m = MessageWithOneofScalars{} } -func (m *MessageWithOneofScalars) String() string { return proto.CompactTextString(m) } -func (*MessageWithOneofScalars) ProtoMessage() {} -func (*MessageWithOneofScalars) Descriptor() ([]byte, []int) { - return fileDescriptor_5d1bcd1a4bdfc194, []int{1} -} -func (m *MessageWithOneofScalars) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithOneofScalars.Unmarshal(m, b) -} -func (m *MessageWithOneofScalars) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithOneofScalars.Marshal(b, m, deterministic) -} -func (m *MessageWithOneofScalars) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithOneofScalars.Merge(m, src) -} -func (m *MessageWithOneofScalars) XXX_Size() int { - return xxx_messageInfo_MessageWithOneofScalars.Size(m) -} -func (m *MessageWithOneofScalars) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithOneofScalars.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithOneofScalars proto.InternalMessageInfo - -type isMessageWithOneofScalars_Value interface { - isMessageWithOneofScalars_Value() -} - -type MessageWithOneofScalars_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` -} -type MessageWithOneofScalars_FloatValue struct { - FloatValue float32 `protobuf:"fixed32,2,opt,name=float_value,json=floatValue,proto3,oneof" json:"float_value,omitempty"` -} -type MessageWithOneofScalars_Int32Value struct { - Int32Value int32 `protobuf:"varint,3,opt,name=int32_value,json=int32Value,proto3,oneof" json:"int32_value,omitempty"` -} -type MessageWithOneofScalars_Int64Value struct { - Int64Value int64 `protobuf:"varint,4,opt,name=int64_value,json=int64Value,proto3,oneof" json:"int64_value,omitempty"` -} -type MessageWithOneofScalars_Uint32Value struct { - Uint32Value uint32 `protobuf:"varint,5,opt,name=uint32_value,json=uint32Value,proto3,oneof" json:"uint32_value,omitempty"` -} -type MessageWithOneofScalars_Uint64Value struct { - Uint64Value uint64 `protobuf:"varint,6,opt,name=uint64_value,json=uint64Value,proto3,oneof" json:"uint64_value,omitempty"` -} -type MessageWithOneofScalars_Sint32Value struct { - Sint32Value int32 `protobuf:"zigzag32,7,opt,name=sint32_value,json=sint32Value,proto3,oneof" json:"sint32_value,omitempty"` -} -type MessageWithOneofScalars_Sint64Value struct { - Sint64Value int64 `protobuf:"zigzag64,8,opt,name=sint64_value,json=sint64Value,proto3,oneof" json:"sint64_value,omitempty"` -} -type MessageWithOneofScalars_Fixed32Value struct { - Fixed32Value uint32 `protobuf:"fixed32,9,opt,name=fixed32_value,json=fixed32Value,proto3,oneof" json:"fixed32_value,omitempty"` -} -type MessageWithOneofScalars_Fixed64Value struct { - Fixed64Value uint64 `protobuf:"fixed64,10,opt,name=fixed64_value,json=fixed64Value,proto3,oneof" json:"fixed64_value,omitempty"` -} -type MessageWithOneofScalars_Sfixed32Value struct { - Sfixed32Value int32 `protobuf:"fixed32,11,opt,name=sfixed32_value,json=sfixed32Value,proto3,oneof" json:"sfixed32_value,omitempty"` -} -type MessageWithOneofScalars_Sfixed64Value struct { - Sfixed64Value int64 `protobuf:"fixed64,12,opt,name=sfixed64_value,json=sfixed64Value,proto3,oneof" json:"sfixed64_value,omitempty"` -} -type MessageWithOneofScalars_BoolValue struct { - BoolValue bool `protobuf:"varint,13,opt,name=bool_value,json=boolValue,proto3,oneof" json:"bool_value,omitempty"` -} -type MessageWithOneofScalars_StringValue struct { - StringValue string `protobuf:"bytes,14,opt,name=string_value,json=stringValue,proto3,oneof" json:"string_value,omitempty"` -} -type MessageWithOneofScalars_BytesValue struct { - BytesValue []byte `protobuf:"bytes,15,opt,name=bytes_value,json=bytesValue,proto3,oneof" json:"bytes_value,omitempty"` -} -type MessageWithOneofScalars_HexBytesValue struct { - HexBytesValue []byte `protobuf:"bytes,16,opt,name=hex_bytes_value,json=hexBytesValue,proto3,oneof" json:"hex_bytes_value,omitempty"` -} - -func (*MessageWithOneofScalars_DoubleValue) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_FloatValue) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Int32Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Int64Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Uint32Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Uint64Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Sint32Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Sint64Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Fixed32Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Fixed64Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Sfixed32Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Sfixed64Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_BoolValue) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_StringValue) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_BytesValue) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_HexBytesValue) isMessageWithOneofScalars_Value() {} - -func (m *MessageWithOneofScalars) GetValue() isMessageWithOneofScalars_Value { - if m != nil { - return m.Value - } - return nil -} - -func (m *MessageWithOneofScalars) GetDoubleValue() float64 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_DoubleValue); ok { - return x.DoubleValue - } - return 0 -} - -func (m *MessageWithOneofScalars) GetFloatValue() float32 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_FloatValue); ok { - return x.FloatValue - } - return 0 -} - -func (m *MessageWithOneofScalars) GetInt32Value() int32 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Int32Value); ok { - return x.Int32Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetInt64Value() int64 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Int64Value); ok { - return x.Int64Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetUint32Value() uint32 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Uint32Value); ok { - return x.Uint32Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetUint64Value() uint64 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Uint64Value); ok { - return x.Uint64Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetSint32Value() int32 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Sint32Value); ok { - return x.Sint32Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetSint64Value() int64 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Sint64Value); ok { - return x.Sint64Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetFixed32Value() uint32 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Fixed32Value); ok { - return x.Fixed32Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetFixed64Value() uint64 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Fixed64Value); ok { - return x.Fixed64Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetSfixed32Value() int32 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Sfixed32Value); ok { - return x.Sfixed32Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetSfixed64Value() int64 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Sfixed64Value); ok { - return x.Sfixed64Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetBoolValue() bool { - if x, ok := m.GetValue().(*MessageWithOneofScalars_BoolValue); ok { - return x.BoolValue - } - return false -} - -func (m *MessageWithOneofScalars) GetStringValue() string { - if x, ok := m.GetValue().(*MessageWithOneofScalars_StringValue); ok { - return x.StringValue - } - return "" -} - -func (m *MessageWithOneofScalars) GetBytesValue() []byte { - if x, ok := m.GetValue().(*MessageWithOneofScalars_BytesValue); ok { - return x.BytesValue - } - return nil -} - -func (m *MessageWithOneofScalars) GetHexBytesValue() []byte { - if x, ok := m.GetValue().(*MessageWithOneofScalars_HexBytesValue); ok { - return x.HexBytesValue - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*MessageWithOneofScalars) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*MessageWithOneofScalars_DoubleValue)(nil), - (*MessageWithOneofScalars_FloatValue)(nil), - (*MessageWithOneofScalars_Int32Value)(nil), - (*MessageWithOneofScalars_Int64Value)(nil), - (*MessageWithOneofScalars_Uint32Value)(nil), - (*MessageWithOneofScalars_Uint64Value)(nil), - (*MessageWithOneofScalars_Sint32Value)(nil), - (*MessageWithOneofScalars_Sint64Value)(nil), - (*MessageWithOneofScalars_Fixed32Value)(nil), - (*MessageWithOneofScalars_Fixed64Value)(nil), - (*MessageWithOneofScalars_Sfixed32Value)(nil), - (*MessageWithOneofScalars_Sfixed64Value)(nil), - (*MessageWithOneofScalars_BoolValue)(nil), - (*MessageWithOneofScalars_StringValue)(nil), - (*MessageWithOneofScalars_BytesValue)(nil), - (*MessageWithOneofScalars_HexBytesValue)(nil), - } -} - -type MessageWithScalarMaps struct { - StringDoubleMap map[string]float64 `protobuf:"bytes,1,rep,name=string_double_map,json=stringDoubleMap,proto3" json:"string_double_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` - StringFloatMap map[string]float32 `protobuf:"bytes,3,rep,name=string_float_map,json=stringFloatMap,proto3" json:"string_float_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` - StringInt32Map map[string]int32 `protobuf:"bytes,5,rep,name=string_int32_map,json=stringInt32Map,proto3" json:"string_int32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Int32StringMap map[int32]string `protobuf:"bytes,6,rep,name=int32_string_map,json=int32StringMap,proto3" json:"int32_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringInt64Map map[string]int64 `protobuf:"bytes,7,rep,name=string_int64_map,json=stringInt64Map,proto3" json:"string_int64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Int64StringMap map[int64]string `protobuf:"bytes,8,rep,name=int64_string_map,json=int64StringMap,proto3" json:"int64_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringUint32Map map[string]uint32 `protobuf:"bytes,9,rep,name=string_uint32_map,json=stringUint32Map,proto3" json:"string_uint32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Uint32StringMap map[uint32]string `protobuf:"bytes,10,rep,name=uint32_string_map,json=uint32StringMap,proto3" json:"uint32_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringUint64Map map[string]uint64 `protobuf:"bytes,11,rep,name=string_uint64_map,json=stringUint64Map,proto3" json:"string_uint64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Uint64StringMap map[uint64]string `protobuf:"bytes,12,rep,name=uint64_string_map,json=uint64StringMap,proto3" json:"uint64_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringSint32Map map[string]int32 `protobuf:"bytes,13,rep,name=string_sint32_map,json=stringSint32Map,proto3" json:"string_sint32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"zigzag32,2,opt,name=value,proto3"` - Sint32StringMap map[int32]string `protobuf:"bytes,14,rep,name=sint32_string_map,json=sint32StringMap,proto3" json:"sint32_string_map,omitempty" protobuf_key:"zigzag32,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringSint64Map map[string]int64 `protobuf:"bytes,15,rep,name=string_sint64_map,json=stringSint64Map,proto3" json:"string_sint64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"zigzag64,2,opt,name=value,proto3"` - Sint64StringMap map[int64]string `protobuf:"bytes,16,rep,name=sint64_string_map,json=sint64StringMap,proto3" json:"sint64_string_map,omitempty" protobuf_key:"zigzag64,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringFixed32Map map[string]uint32 `protobuf:"bytes,17,rep,name=string_fixed32_map,json=stringFixed32Map,proto3" json:"string_fixed32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` - Fixed32StringMap map[uint32]string `protobuf:"bytes,18,rep,name=fixed32_string_map,json=fixed32StringMap,proto3" json:"fixed32_string_map,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringFixed64Map map[string]uint64 `protobuf:"bytes,19,rep,name=string_fixed64_map,json=stringFixed64Map,proto3" json:"string_fixed64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` - Fixed64StringMap map[uint64]string `protobuf:"bytes,20,rep,name=fixed64_string_map,json=fixed64StringMap,proto3" json:"fixed64_string_map,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringSfixed32Map map[string]int32 `protobuf:"bytes,21,rep,name=string_sfixed32_map,json=stringSfixed32Map,proto3" json:"string_sfixed32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` - Sfixed32StringMap map[int32]string `protobuf:"bytes,22,rep,name=sfixed32_string_map,json=sfixed32StringMap,proto3" json:"sfixed32_string_map,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringSfixed64Map map[string]int64 `protobuf:"bytes,23,rep,name=string_sfixed64_map,json=stringSfixed64Map,proto3" json:"string_sfixed64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` - Sfixed64StringMap map[int64]string `protobuf:"bytes,24,rep,name=sfixed64_string_map,json=sfixed64StringMap,proto3" json:"sfixed64_string_map,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringBoolMap map[string]bool `protobuf:"bytes,25,rep,name=string_bool_map,json=stringBoolMap,proto3" json:"string_bool_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - BoolStringMap map[bool]string `protobuf:"bytes,26,rep,name=bool_string_map,json=boolStringMap,proto3" json:"bool_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringStringMap map[string]string `protobuf:"bytes,27,rep,name=string_string_map,json=stringStringMap,proto3" json:"string_string_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringBytesMap map[string][]byte `protobuf:"bytes,29,rep,name=string_bytes_map,json=stringBytesMap,proto3" json:"string_bytes_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringHexBytesMap map[string][]byte `protobuf:"bytes,30,rep,name=string_hex_bytes_map,json=stringHexBytesMap,proto3" json:"string_hex_bytes_map,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 *MessageWithScalarMaps) Reset() { *m = MessageWithScalarMaps{} } -func (m *MessageWithScalarMaps) String() string { return proto.CompactTextString(m) } -func (*MessageWithScalarMaps) ProtoMessage() {} -func (*MessageWithScalarMaps) Descriptor() ([]byte, []int) { - return fileDescriptor_5d1bcd1a4bdfc194, []int{2} -} -func (m *MessageWithScalarMaps) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithScalarMaps.Unmarshal(m, b) -} -func (m *MessageWithScalarMaps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithScalarMaps.Marshal(b, m, deterministic) -} -func (m *MessageWithScalarMaps) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithScalarMaps.Merge(m, src) -} -func (m *MessageWithScalarMaps) XXX_Size() int { - return xxx_messageInfo_MessageWithScalarMaps.Size(m) -} -func (m *MessageWithScalarMaps) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithScalarMaps.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithScalarMaps proto.InternalMessageInfo - -func (m *MessageWithScalarMaps) GetStringDoubleMap() map[string]float64 { - if m != nil { - return m.StringDoubleMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringFloatMap() map[string]float32 { - if m != nil { - return m.StringFloatMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringInt32Map() map[string]int32 { - if m != nil { - return m.StringInt32Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetInt32StringMap() map[int32]string { - if m != nil { - return m.Int32StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringInt64Map() map[string]int64 { - if m != nil { - return m.StringInt64Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetInt64StringMap() map[int64]string { - if m != nil { - return m.Int64StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringUint32Map() map[string]uint32 { - if m != nil { - return m.StringUint32Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetUint32StringMap() map[uint32]string { - if m != nil { - return m.Uint32StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringUint64Map() map[string]uint64 { - if m != nil { - return m.StringUint64Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetUint64StringMap() map[uint64]string { - if m != nil { - return m.Uint64StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringSint32Map() map[string]int32 { - if m != nil { - return m.StringSint32Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetSint32StringMap() map[int32]string { - if m != nil { - return m.Sint32StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringSint64Map() map[string]int64 { - if m != nil { - return m.StringSint64Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetSint64StringMap() map[int64]string { - if m != nil { - return m.Sint64StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringFixed32Map() map[string]uint32 { - if m != nil { - return m.StringFixed32Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetFixed32StringMap() map[uint32]string { - if m != nil { - return m.Fixed32StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringFixed64Map() map[string]uint64 { - if m != nil { - return m.StringFixed64Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetFixed64StringMap() map[uint64]string { - if m != nil { - return m.Fixed64StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringSfixed32Map() map[string]int32 { - if m != nil { - return m.StringSfixed32Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetSfixed32StringMap() map[int32]string { - if m != nil { - return m.Sfixed32StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringSfixed64Map() map[string]int64 { - if m != nil { - return m.StringSfixed64Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetSfixed64StringMap() map[int64]string { - if m != nil { - return m.Sfixed64StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringBoolMap() map[string]bool { - if m != nil { - return m.StringBoolMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetBoolStringMap() map[bool]string { - if m != nil { - return m.BoolStringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringStringMap() map[string]string { - if m != nil { - return m.StringStringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringBytesMap() map[string][]byte { - if m != nil { - return m.StringBytesMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringHexBytesMap() map[string][]byte { - if m != nil { - return m.StringHexBytesMap - } - return nil -} - -func init() { - proto.RegisterType((*MessageWithScalars)(nil), "thethings.json.test.MessageWithScalars") - proto.RegisterType((*MessageWithOneofScalars)(nil), "thethings.json.test.MessageWithOneofScalars") - proto.RegisterType((*MessageWithScalarMaps)(nil), "thethings.json.test.MessageWithScalarMaps") - proto.RegisterMapType((map[bool]string)(nil), "thethings.json.test.MessageWithScalarMaps.BoolStringMapEntry") - proto.RegisterMapType((map[uint32]string)(nil), "thethings.json.test.MessageWithScalarMaps.Fixed32StringMapEntry") - proto.RegisterMapType((map[uint64]string)(nil), "thethings.json.test.MessageWithScalarMaps.Fixed64StringMapEntry") - proto.RegisterMapType((map[int32]string)(nil), "thethings.json.test.MessageWithScalarMaps.Int32StringMapEntry") - proto.RegisterMapType((map[int64]string)(nil), "thethings.json.test.MessageWithScalarMaps.Int64StringMapEntry") - proto.RegisterMapType((map[int32]string)(nil), "thethings.json.test.MessageWithScalarMaps.Sfixed32StringMapEntry") - proto.RegisterMapType((map[int64]string)(nil), "thethings.json.test.MessageWithScalarMaps.Sfixed64StringMapEntry") - proto.RegisterMapType((map[int32]string)(nil), "thethings.json.test.MessageWithScalarMaps.Sint32StringMapEntry") - proto.RegisterMapType((map[int64]string)(nil), "thethings.json.test.MessageWithScalarMaps.Sint64StringMapEntry") - proto.RegisterMapType((map[string]bool)(nil), "thethings.json.test.MessageWithScalarMaps.StringBoolMapEntry") - proto.RegisterMapType((map[string][]byte)(nil), "thethings.json.test.MessageWithScalarMaps.StringBytesMapEntry") - proto.RegisterMapType((map[string]float64)(nil), "thethings.json.test.MessageWithScalarMaps.StringDoubleMapEntry") - proto.RegisterMapType((map[string]uint32)(nil), "thethings.json.test.MessageWithScalarMaps.StringFixed32MapEntry") - proto.RegisterMapType((map[string]uint64)(nil), "thethings.json.test.MessageWithScalarMaps.StringFixed64MapEntry") - proto.RegisterMapType((map[string]float32)(nil), "thethings.json.test.MessageWithScalarMaps.StringFloatMapEntry") - proto.RegisterMapType((map[string][]byte)(nil), "thethings.json.test.MessageWithScalarMaps.StringHexBytesMapEntry") - proto.RegisterMapType((map[string]int32)(nil), "thethings.json.test.MessageWithScalarMaps.StringInt32MapEntry") - proto.RegisterMapType((map[string]int64)(nil), "thethings.json.test.MessageWithScalarMaps.StringInt64MapEntry") - proto.RegisterMapType((map[string]int32)(nil), "thethings.json.test.MessageWithScalarMaps.StringSfixed32MapEntry") - proto.RegisterMapType((map[string]int64)(nil), "thethings.json.test.MessageWithScalarMaps.StringSfixed64MapEntry") - proto.RegisterMapType((map[string]int32)(nil), "thethings.json.test.MessageWithScalarMaps.StringSint32MapEntry") - proto.RegisterMapType((map[string]int64)(nil), "thethings.json.test.MessageWithScalarMaps.StringSint64MapEntry") - proto.RegisterMapType((map[string]string)(nil), "thethings.json.test.MessageWithScalarMaps.StringStringMapEntry") - proto.RegisterMapType((map[string]uint32)(nil), "thethings.json.test.MessageWithScalarMaps.StringUint32MapEntry") - proto.RegisterMapType((map[string]uint64)(nil), "thethings.json.test.MessageWithScalarMaps.StringUint64MapEntry") - proto.RegisterMapType((map[uint32]string)(nil), "thethings.json.test.MessageWithScalarMaps.Uint32StringMapEntry") - proto.RegisterMapType((map[uint64]string)(nil), "thethings.json.test.MessageWithScalarMaps.Uint64StringMapEntry") -} - -func init() { proto.RegisterFile("scalars.proto", fileDescriptor_5d1bcd1a4bdfc194) } - -var fileDescriptor_5d1bcd1a4bdfc194 = []byte{ - // 1587 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcd, 0x6e, 0xdb, 0xc6, - 0x1a, 0xf5, 0x88, 0xfa, 0x1d, 0x92, 0xfa, 0xa1, 0xed, 0x44, 0x76, 0x6e, 0xe2, 0x71, 0x8c, 0x8b, - 0xcc, 0x26, 0x32, 0x90, 0x18, 0xc2, 0xc5, 0x05, 0xee, 0x6d, 0xa2, 0x26, 0xad, 0x02, 0xd4, 0x6d, - 0x31, 0x4e, 0xda, 0xa0, 0x9b, 0x40, 0x4e, 0x28, 0x4b, 0x8d, 0x22, 0xba, 0x1a, 0xaa, 0x88, 0xb7, - 0x7d, 0x86, 0x6c, 0xba, 0x29, 0x0a, 0x14, 0xe8, 0x22, 0x7d, 0x8b, 0xa2, 0xeb, 0x3e, 0x44, 0x97, - 0x79, 0x8a, 0x62, 0x86, 0x43, 0x72, 0x66, 0x48, 0x9b, 0x22, 0xed, 0x45, 0x77, 0xf6, 0xa7, 0x0f, - 0xe7, 0x9c, 0x6f, 0x0e, 0xe7, 0xf0, 0x23, 0xb4, 0xe9, 0xcb, 0xd1, 0x6c, 0xb4, 0xa0, 0xbd, 0xd3, - 0x85, 0xe7, 0x7b, 0xce, 0xba, 0x3f, 0x71, 0xfd, 0xc9, 0x74, 0x7e, 0x42, 0x7b, 0xdf, 0x52, 0x6f, - 0xde, 0xf3, 0x5d, 0xea, 0x6f, 0x77, 0x46, 0xf3, 0xb9, 0xe7, 0x8f, 0xfc, 0xa9, 0x37, 0x17, 0x7d, - 0xb7, 0xff, 0x32, 0xa1, 0x73, 0xe8, 0x52, 0x3a, 0x3a, 0x71, 0xbf, 0x9e, 0xfa, 0x93, 0xa3, 0x00, - 0xc4, 0xd9, 0x85, 0xd6, 0x2b, 0x6f, 0x79, 0x3c, 0x73, 0x5f, 0x7c, 0x3f, 0x9a, 0x2d, 0xdd, 0x2e, - 0x40, 0x00, 0x03, 0x62, 0x06, 0xb5, 0xaf, 0x58, 0xc9, 0xd9, 0x83, 0xb6, 0xdc, 0x42, 0xbb, 0x25, - 0x64, 0x60, 0x40, 0x2c, 0xa9, 0x87, 0x3a, 0x3b, 0xd0, 0x1c, 0xcf, 0xbc, 0x91, 0x2f, 0x60, 0x0c, - 0x04, 0x70, 0x89, 0x40, 0x5e, 0x0a, 0x50, 0x76, 0xa1, 0x25, 0x35, 0xd0, 0x6e, 0x19, 0x19, 0xb8, - 0x44, 0xcc, 0xb8, 0x83, 0x63, 0x4c, 0xe7, 0xfe, 0xfd, 0x7b, 0x02, 0xa3, 0x82, 0x00, 0xae, 0x10, - 0xc8, 0x4b, 0x11, 0x86, 0xd4, 0x40, 0xbb, 0x55, 0x64, 0xe0, 0x0a, 0x31, 0xe3, 0x8e, 0x10, 0xa3, - 0x7f, 0x20, 0x30, 0x6a, 0x08, 0x60, 0x83, 0x63, 0xf4, 0x0f, 0x64, 0x8c, 0xb0, 0x81, 0x76, 0xeb, - 0xc8, 0xc0, 0x06, 0x31, 0xe3, 0x0e, 0x7e, 0x26, 0x4b, 0x59, 0x48, 0x03, 0x01, 0x6c, 0x13, 0x73, - 0x29, 0x29, 0xd9, 0x83, 0xf6, 0x52, 0x91, 0x02, 0x91, 0x81, 0x6d, 0x62, 0x2d, 0x65, 0x2d, 0x02, - 0x27, 0x12, 0x63, 0x22, 0x80, 0xcb, 0x01, 0x4e, 0xa8, 0x46, 0xe0, 0xc4, 0x72, 0x2c, 0x64, 0xe0, - 0x32, 0xb1, 0x96, 0x9a, 0x1e, 0x2a, 0xeb, 0xb1, 0x11, 0xc0, 0x1d, 0x62, 0x52, 0x55, 0x0f, 0x55, - 0xf4, 0x34, 0x91, 0x81, 0x3b, 0xc4, 0xa2, 0x9a, 0x1e, 0x2a, 0xeb, 0x69, 0x21, 0x80, 0x9d, 0x00, - 0x47, 0xd2, 0x43, 0x15, 0x3d, 0x6d, 0x64, 0x60, 0x87, 0x58, 0x54, 0xd6, 0xb3, 0x07, 0xed, 0xf1, - 0xf4, 0xad, 0xfb, 0x2a, 0x12, 0xd4, 0x41, 0x00, 0xd7, 0x88, 0x25, 0x8a, 0x01, 0xd2, 0xbf, 0x61, - 0x53, 0x69, 0xa2, 0x5d, 0x07, 0x19, 0xb8, 0x46, 0x6c, 0xb9, 0x2b, 0xc6, 0x8a, 0x44, 0xad, 0x23, - 0x80, 0xab, 0x02, 0x2b, 0x54, 0x15, 0x62, 0xc5, 0xb2, 0x36, 0x90, 0x81, 0xab, 0xc4, 0x96, 0xbb, - 0x28, 0x6b, 0xa3, 0xaa, 0xb0, 0x4d, 0x04, 0x70, 0x8b, 0xd8, 0x54, 0x51, 0x76, 0x07, 0xb6, 0xa8, - 0x26, 0xed, 0x1a, 0x32, 0x70, 0x8b, 0x34, 0xa9, 0xaa, 0x2d, 0xc2, 0x8b, 0xc4, 0x5d, 0x47, 0x00, - 0xb7, 0x43, 0xbc, 0x50, 0x5d, 0x84, 0x17, 0xcb, 0xeb, 0x22, 0x03, 0xb7, 0x49, 0x93, 0xaa, 0xfa, - 0x6e, 0x42, 0x78, 0xec, 0x79, 0x33, 0x81, 0xb5, 0x85, 0x00, 0xae, 0x93, 0x06, 0xab, 0x04, 0x38, - 0x3b, 0xd0, 0x8c, 0x7f, 0xa6, 0xdd, 0x6d, 0x64, 0xe0, 0x3a, 0x81, 0xd1, 0xef, 0x81, 0x7f, 0xfe, - 0x62, 0x3a, 0x3f, 0x11, 0x08, 0x37, 0x10, 0xc0, 0x0d, 0x62, 0x06, 0xb5, 0xd8, 0x3f, 0xa9, 0x85, - 0x76, 0xff, 0x85, 0x0c, 0xdc, 0x20, 0x96, 0xd4, 0xc3, 0xef, 0xc8, 0xf1, 0x99, 0xef, 0x52, 0x01, - 0x73, 0x13, 0x01, 0x6c, 0x11, 0xc8, 0x4b, 0xd1, 0x1d, 0x91, 0x1a, 0x68, 0xf7, 0x16, 0x32, 0xb0, - 0x45, 0xcc, 0xb8, 0x83, 0x3a, 0xbf, 0x03, 0xd8, 0x9a, 0xb8, 0x6f, 0x5f, 0xc8, 0x40, 0x3b, 0x0c, - 0x68, 0xf0, 0x23, 0xf8, 0xf0, 0x7e, 0xeb, 0x1d, 0x80, 0x9f, 0x9e, 0x4c, 0xfd, 0xc9, 0xf2, 0xb8, - 0xf7, 0xd2, 0x7b, 0xb3, 0xff, 0x74, 0xe2, 0x3e, 0xe5, 0x19, 0xf5, 0x64, 0xfe, 0x6a, 0xc9, 0xb4, - 0xb8, 0x74, 0x9f, 0xc7, 0xd2, 0xcb, 0xbb, 0x27, 0xee, 0xfc, 0xee, 0x89, 0x77, 0x97, 0x65, 0xd7, - 0x3e, 0xcb, 0xae, 0x7d, 0xff, 0xec, 0xd4, 0xa5, 0xbd, 0xc3, 0xd1, 0x82, 0x4e, 0x46, 0xb3, 0xe1, - 0xe3, 0xe7, 0xce, 0x93, 0x4b, 0x01, 0x3d, 0x9b, 0xbf, 0x89, 0xa0, 0x88, 0x3d, 0x71, 0xdf, 0x0e, - 0xe2, 0x39, 0xff, 0x04, 0xb0, 0xad, 0x0d, 0x41, 0xbb, 0x88, 0x0d, 0x3b, 0xf8, 0x85, 0x4d, 0xf1, - 0x13, 0x80, 0x9f, 0x5d, 0xd1, 0x14, 0x0f, 0x17, 0x8b, 0xd1, 0x99, 0xf3, 0xf9, 0x95, 0x8d, 0xc2, - 0xf1, 0x48, 0x53, 0x99, 0x87, 0xde, 0x7e, 0x57, 0x85, 0xd7, 0xa5, 0x90, 0xff, 0x62, 0xee, 0x7a, - 0xe3, 0x30, 0xe9, 0xf7, 0xd2, 0x92, 0x7e, 0xb8, 0xa6, 0x66, 0xfd, 0xae, 0x1a, 0xe3, 0x25, 0x16, - 0xe3, 0xc3, 0x35, 0x2d, 0xc8, 0x95, 0x94, 0x66, 0x49, 0x5f, 0x61, 0x2d, 0x4a, 0x4e, 0x2b, 0x21, - 0x5c, 0x66, 0x21, 0x2c, 0x5a, 0xe2, 0xa0, 0x51, 0x33, 0x96, 0x85, 0xbd, 0xcd, 0xd4, 0xa8, 0x29, - 0xab, 0x06, 0x68, 0x95, 0x05, 0x68, 0xd8, 0x24, 0x21, 0x29, 0xe9, 0xc8, 0x22, 0xbf, 0xc3, 0x9a, - 0xd4, 0x7c, 0x54, 0xa3, 0xaf, 0xce, 0xa2, 0x2f, 0x6c, 0x8a, 0x63, 0x46, 0xcb, 0x35, 0x16, 0xfc, - 0xb5, 0xe1, 0x5a, 0x22, 0xd9, 0xb4, 0xc8, 0x82, 0x2c, 0xb2, 0xa2, 0xb6, 0x38, 0x16, 0xf4, 0x34, - 0x62, 0xf9, 0xdf, 0x1a, 0xae, 0x25, 0xf3, 0x48, 0x8f, 0x19, 0x8b, 0xc5, 0x4c, 0xdc, 0x18, 0x22, - 0xee, 0x28, 0xf9, 0xc1, 0xde, 0x02, 0xf5, 0xe1, 0x9a, 0x9c, 0x20, 0x7b, 0x5a, 0x40, 0x34, 0x59, - 0x40, 0xf0, 0x29, 0xa5, 0x88, 0xd8, 0x55, 0x6f, 0x3f, 0x7b, 0x09, 0x58, 0xcc, 0x1c, 0xe9, 0xfe, - 0xff, 0x91, 0x72, 0xb9, 0xdb, 0xff, 0xf4, 0xcb, 0xcd, 0xce, 0x4b, 0xb9, 0x0e, 0x83, 0x1a, 0xac, - 0x70, 0xed, 0xb7, 0x7f, 0xb8, 0x03, 0x37, 0x13, 0xbb, 0xcf, 0xe1, 0xe8, 0x94, 0x3a, 0xaf, 0x61, - 0x47, 0x9c, 0x98, 0xb8, 0x1b, 0x6f, 0x46, 0xa7, 0x5d, 0x80, 0x0c, 0x6c, 0xde, 0xfb, 0xa8, 0x97, - 0xb2, 0x59, 0xf5, 0x52, 0x61, 0x7a, 0x47, 0x1c, 0xe3, 0x11, 0x87, 0x38, 0x1c, 0x9d, 0x3e, 0x9e, - 0xfb, 0x8b, 0x33, 0xd2, 0xa2, 0x6a, 0xd5, 0x99, 0xc0, 0xb6, 0x20, 0x0b, 0xee, 0x18, 0xe3, 0x32, - 0x38, 0xd7, 0xff, 0x73, 0x73, 0x7d, 0xc2, 0x10, 0x22, 0xaa, 0x26, 0x55, 0x8a, 0x12, 0x53, 0x70, - 0x33, 0x18, 0x53, 0xa5, 0x20, 0xd3, 0x13, 0x86, 0xa0, 0x33, 0x85, 0x45, 0xc6, 0x14, 0x50, 0x08, - 0x3e, 0xc6, 0x54, 0xcd, 0xcd, 0xc4, 0xe1, 0x02, 0xba, 0x98, 0x69, 0xaa, 0x14, 0xd5, 0x99, 0xfa, - 0x07, 0x9c, 0xa9, 0x56, 0x7c, 0xa6, 0xfe, 0x41, 0xca, 0x4c, 0xbc, 0x28, 0x66, 0xea, 0x1f, 0xc8, - 0x33, 0xd5, 0x8b, 0xcc, 0xd4, 0x3f, 0x48, 0x99, 0x49, 0x2a, 0x4a, 0x8f, 0xdf, 0x32, 0x36, 0xaa, - 0x51, 0xf0, 0xf1, 0x7b, 0x36, 0x55, 0x9c, 0x12, 0x8f, 0x5f, 0x54, 0x65, 0x64, 0xcb, 0x84, 0x57, - 0x30, 0x37, 0xd9, 0xb3, 0x69, 0x8a, 0x59, 0xad, 0xa5, 0xe6, 0x96, 0x3a, 0x99, 0xb0, 0xcb, 0xbc, - 0xc4, 0x64, 0x92, 0x5f, 0xd2, 0x64, 0x81, 0x61, 0x62, 0x32, 0xd5, 0x31, 0xab, 0xd0, 0x64, 0x09, - 0xcb, 0x5a, 0xcb, 0x73, 0x3d, 0xa3, 0xb1, 0x67, 0x76, 0xc1, 0xc9, 0x8e, 0x52, 0x3d, 0x3b, 0x92, - 0x3d, 0xa3, 0x09, 0xcf, 0x9a, 0xf9, 0xc9, 0x52, 0x3d, 0xa3, 0xe7, 0x7a, 0x46, 0x63, 0xcf, 0x5a, - 0x97, 0x98, 0x2c, 0xe9, 0xd9, 0x91, 0xec, 0x19, 0x4d, 0x78, 0xd6, 0x2e, 0x34, 0x59, 0xd2, 0x33, - 0xaa, 0x79, 0x36, 0x87, 0x4e, 0x98, 0xbc, 0xe2, 0x8d, 0xcc, 0xd8, 0x3a, 0x9c, 0xed, 0x41, 0xfe, - 0xec, 0x0d, 0x30, 0x22, 0x3a, 0x91, 0x4b, 0x71, 0x99, 0xf1, 0x85, 0x44, 0xd2, 0x74, 0x4e, 0x6e, - 0x3e, 0x01, 0xa9, 0x8d, 0xd7, 0x1e, 0x6b, 0x65, 0x7d, 0x3e, 0x61, 0xdd, 0xfa, 0x65, 0xe6, 0x93, - 0xbc, 0x93, 0xe7, 0x0b, 0xcc, 0x0b, 0xe7, 0x53, 0xdd, 0xdb, 0x28, 0x36, 0x5f, 0xc2, 0xbe, 0xf6, - 0x58, 0x2b, 0x3b, 0xdf, 0xc1, 0xf5, 0xf0, 0xc9, 0x94, 0x0d, 0xdc, 0xe4, 0x84, 0x0f, 0xf3, 0x3f, - 0x9b, 0x63, 0xcd, 0x41, 0xf1, 0xdc, 0x4b, 0x75, 0x4e, 0x99, 0xe2, 0xe1, 0xb5, 0xfc, 0x94, 0xe3, - 0x54, 0x13, 0x3b, 0x34, 0xe1, 0xa2, 0x3e, 0xa5, 0xb0, 0xf1, 0xfa, 0xa5, 0xa6, 0x94, 0x7c, 0x54, - 0xa6, 0x0c, 0x8c, 0x8c, 0xa6, 0x54, 0x9d, 0xec, 0x16, 0x9c, 0x32, 0x61, 0x65, 0x87, 0x26, 0xbc, - 0x74, 0xa1, 0xc8, 0x82, 0x17, 0x7c, 0x99, 0x65, 0x74, 0x5b, 0x9c, 0xee, 0x7f, 0xb9, 0x27, 0x1c, - 0x78, 0xde, 0x2c, 0xa2, 0x12, 0x1f, 0xbe, 0xa2, 0xc6, 0x68, 0x38, 0xbe, 0x34, 0xd5, 0x76, 0x6e, - 0x1a, 0x06, 0xa6, 0x4d, 0x64, 0x1f, 0xcb, 0x35, 0x39, 0x33, 0x63, 0xa2, 0x1b, 0x45, 0x33, 0x53, - 0x8f, 0x31, 0xb5, 0x2a, 0xad, 0x40, 0xc1, 0x66, 0xce, 0xb8, 0x6e, 0x16, 0x5c, 0x81, 0xf8, 0x9e, - 0xac, 0xaf, 0x40, 0x61, 0xd1, 0xf9, 0xb9, 0x04, 0x37, 0x04, 0x55, 0xfc, 0x21, 0xc0, 0xe8, 0x6e, - 0x15, 0x7c, 0x18, 0x87, 0x62, 0x33, 0x0f, 0x19, 0x07, 0xbf, 0xb1, 0x2f, 0x89, 0x5f, 0x01, 0xfc, - 0xf2, 0x2a, 0xbe, 0x24, 0x04, 0xc7, 0xe3, 0xe7, 0x4c, 0x3b, 0xb9, 0x9a, 0x4f, 0x0a, 0x19, 0x33, - 0xbc, 0x3a, 0xd2, 0x14, 0xdb, 0x03, 0xb8, 0x91, 0xb6, 0xf6, 0x3b, 0x6d, 0x68, 0xbc, 0x76, 0xcf, - 0xf8, 0xe7, 0x75, 0x83, 0xb0, 0x3f, 0x9d, 0x0d, 0xf1, 0x1d, 0xc2, 0x3f, 0xa7, 0x01, 0x09, 0xfe, - 0xf9, 0x6f, 0xe9, 0x3f, 0x60, 0xfb, 0x21, 0x5c, 0x4f, 0x59, 0xe7, 0xb3, 0x20, 0x4a, 0xa9, 0x10, - 0xca, 0x9e, 0x9e, 0x05, 0x51, 0xd1, 0x20, 0x52, 0x16, 0x70, 0x19, 0xa2, 0x92, 0x02, 0xd1, 0x38, - 0x4f, 0x45, 0x9c, 0x38, 0x59, 0x2a, 0x8c, 0xa4, 0x0a, 0x3d, 0x41, 0x64, 0x08, 0x23, 0x4b, 0x45, - 0x64, 0x89, 0xba, 0x0a, 0x67, 0xc9, 0xb0, 0x35, 0x8c, 0xb4, 0x0d, 0x57, 0xc6, 0xb0, 0x73, 0xe9, - 0x58, 0xfd, 0x38, 0xca, 0x29, 0x3a, 0x2e, 0x3a, 0x8f, 0xf2, 0xca, 0x3a, 0x8e, 0x72, 0x9d, 0x47, - 0x47, 0xc7, 0xc8, 0x38, 0x8f, 0x4e, 0x2e, 0x1d, 0xab, 0x9f, 0x87, 0x93, 0xa2, 0xe3, 0xa2, 0xf3, - 0x70, 0xb2, 0x74, 0x7c, 0x0c, 0x37, 0x53, 0x37, 0xb8, 0x2c, 0x21, 0x35, 0x0d, 0x24, 0x75, 0x2d, - 0x93, 0x41, 0x6a, 0xf9, 0x94, 0xac, 0x7e, 0x24, 0xd5, 0x34, 0x25, 0x17, 0x9d, 0x49, 0x35, 0x4b, - 0xc9, 0x23, 0x78, 0x2d, 0x7d, 0x29, 0xca, 0x92, 0xd2, 0xd2, 0x51, 0xc6, 0x59, 0xa7, 0xd2, 0xca, - 0xa9, 0x65, 0xf5, 0x63, 0x69, 0xa7, 0x6a, 0xb9, 0xe8, 0x5c, 0xda, 0x59, 0x5a, 0x1e, 0x40, 0x27, - 0xb9, 0x64, 0x64, 0xe9, 0xa8, 0x6b, 0x08, 0xc9, 0xfd, 0x41, 0x46, 0xa8, 0xaf, 0x7e, 0x6f, 0xce, - 0xc5, 0x68, 0xac, 0x9c, 0xcc, 0xca, 0xeb, 0x37, 0x0b, 0xc2, 0x4a, 0xb5, 0x45, 0x7f, 0x89, 0xe7, - 0x41, 0x19, 0x3c, 0xf8, 0xf0, 0x7e, 0xab, 0x5c, 0x07, 0x6d, 0xf0, 0x4d, 0xbf, 0xd8, 0x0b, 0xfa, - 0xb8, 0xca, 0x7f, 0xb8, 0xff, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc5, 0x44, 0x4a, 0xf2, 0x02, - 0x1d, 0x00, 0x00, -} diff --git a/test/gogo/scalars_json.pb.go b/test/gogo/scalars_json.pb.go deleted file mode 100644 index 0556ba9e..00000000 --- a/test/gogo/scalars_json.pb.go +++ /dev/null @@ -1,1166 +0,0 @@ -// Code generated by protoc-gen-go-json. DO NOT EDIT. -// versions: -// - protoc-gen-go-json v0.0.0-dev -// - protoc v3.9.1 -// source: scalars.proto - -package test - -import ( - jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" - types "github.com/TheThingsIndustries/protoc-gen-go-json/test/types" -) - -// MarshalProtoJSON marshals the MessageWithScalars message to JSON. -func (x *MessageWithScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.DoubleValue != 0 || s.HasField("double_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("double_value") - s.WriteFloat64(x.DoubleValue) - } - if len(x.DoubleValues) > 0 || s.HasField("double_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("double_values") - s.WriteFloat64Array(x.DoubleValues) - } - if x.FloatValue != 0 || s.HasField("float_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("float_value") - s.WriteFloat32(x.FloatValue) - } - if len(x.FloatValues) > 0 || s.HasField("float_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("float_values") - s.WriteFloat32Array(x.FloatValues) - } - if x.Int32Value != 0 || s.HasField("int32_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("int32_value") - s.WriteInt32(x.Int32Value) - } - if len(x.Int32Values) > 0 || s.HasField("int32_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("int32_values") - s.WriteInt32Array(x.Int32Values) - } - if x.Int64Value != 0 || s.HasField("int64_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("int64_value") - s.WriteInt64(x.Int64Value) - } - if len(x.Int64Values) > 0 || s.HasField("int64_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("int64_values") - s.WriteInt64Array(x.Int64Values) - } - if x.Uint32Value != 0 || s.HasField("uint32_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("uint32_value") - s.WriteUint32(x.Uint32Value) - } - if len(x.Uint32Values) > 0 || s.HasField("uint32_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("uint32_values") - s.WriteUint32Array(x.Uint32Values) - } - if x.Uint64Value != 0 || s.HasField("uint64_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("uint64_value") - s.WriteUint64(x.Uint64Value) - } - if len(x.Uint64Values) > 0 || s.HasField("uint64_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("uint64_values") - s.WriteUint64Array(x.Uint64Values) - } - if x.Sint32Value != 0 || s.HasField("sint32_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sint32_value") - s.WriteInt32(x.Sint32Value) - } - if len(x.Sint32Values) > 0 || s.HasField("sint32_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sint32_values") - s.WriteInt32Array(x.Sint32Values) - } - if x.Sint64Value != 0 || s.HasField("sint64_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sint64_value") - s.WriteInt64(x.Sint64Value) - } - if len(x.Sint64Values) > 0 || s.HasField("sint64_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sint64_values") - s.WriteInt64Array(x.Sint64Values) - } - if x.Fixed32Value != 0 || s.HasField("fixed32_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("fixed32_value") - s.WriteUint32(x.Fixed32Value) - } - if len(x.Fixed32Values) > 0 || s.HasField("fixed32_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("fixed32_values") - s.WriteUint32Array(x.Fixed32Values) - } - if x.Fixed64Value != 0 || s.HasField("fixed64_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("fixed64_value") - s.WriteUint64(x.Fixed64Value) - } - if len(x.Fixed64Values) > 0 || s.HasField("fixed64_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("fixed64_values") - s.WriteUint64Array(x.Fixed64Values) - } - if x.Sfixed32Value != 0 || s.HasField("sfixed32_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sfixed32_value") - s.WriteInt32(x.Sfixed32Value) - } - if len(x.Sfixed32Values) > 0 || s.HasField("sfixed32_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sfixed32_values") - s.WriteInt32Array(x.Sfixed32Values) - } - if x.Sfixed64Value != 0 || s.HasField("sfixed64_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sfixed64_value") - s.WriteInt64(x.Sfixed64Value) - } - if len(x.Sfixed64Values) > 0 || s.HasField("sfixed64_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sfixed64_values") - s.WriteInt64Array(x.Sfixed64Values) - } - if x.BoolValue || s.HasField("bool_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("bool_value") - s.WriteBool(x.BoolValue) - } - if len(x.BoolValues) > 0 || s.HasField("bool_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("bool_values") - s.WriteBoolArray(x.BoolValues) - } - if x.StringValue != "" || s.HasField("string_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_value") - s.WriteString(x.StringValue) - } - if len(x.StringValues) > 0 || s.HasField("string_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_values") - s.WriteStringArray(x.StringValues) - } - if len(x.BytesValue) > 0 || s.HasField("bytes_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("bytes_value") - s.WriteBytes(x.BytesValue) - } - if len(x.BytesValues) > 0 || s.HasField("bytes_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("bytes_values") - s.WriteBytesArray(x.BytesValues) - } - if len(x.HexBytesValue) > 0 || s.HasField("hex_bytes_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("hex_bytes_value") - types.MarshalHEX(s.WithField("hex_bytes_value"), x.HexBytesValue) - } - if len(x.HexBytesValues) > 0 || s.HasField("hex_bytes_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("hex_bytes_values") - types.MarshalHEXArray(s.WithField("hex_bytes_values"), x.HexBytesValues) - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithScalars to JSON. -func (x *MessageWithScalars) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithScalars message from JSON. -func (x *MessageWithScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "double_value", "doubleValue": - s.AddField("double_value") - x.DoubleValue = s.ReadFloat64() - case "double_values", "doubleValues": - s.AddField("double_values") - if s.ReadNil() { - x.DoubleValues = nil - return - } - x.DoubleValues = s.ReadFloat64Array() - case "float_value", "floatValue": - s.AddField("float_value") - x.FloatValue = s.ReadFloat32() - case "float_values", "floatValues": - s.AddField("float_values") - if s.ReadNil() { - x.FloatValues = nil - return - } - x.FloatValues = s.ReadFloat32Array() - case "int32_value", "int32Value": - s.AddField("int32_value") - x.Int32Value = s.ReadInt32() - case "int32_values", "int32Values": - s.AddField("int32_values") - if s.ReadNil() { - x.Int32Values = nil - return - } - x.Int32Values = s.ReadInt32Array() - case "int64_value", "int64Value": - s.AddField("int64_value") - x.Int64Value = s.ReadInt64() - case "int64_values", "int64Values": - s.AddField("int64_values") - if s.ReadNil() { - x.Int64Values = nil - return - } - x.Int64Values = s.ReadInt64Array() - case "uint32_value", "uint32Value": - s.AddField("uint32_value") - x.Uint32Value = s.ReadUint32() - case "uint32_values", "uint32Values": - s.AddField("uint32_values") - if s.ReadNil() { - x.Uint32Values = nil - return - } - x.Uint32Values = s.ReadUint32Array() - case "uint64_value", "uint64Value": - s.AddField("uint64_value") - x.Uint64Value = s.ReadUint64() - case "uint64_values", "uint64Values": - s.AddField("uint64_values") - if s.ReadNil() { - x.Uint64Values = nil - return - } - x.Uint64Values = s.ReadUint64Array() - case "sint32_value", "sint32Value": - s.AddField("sint32_value") - x.Sint32Value = s.ReadInt32() - case "sint32_values", "sint32Values": - s.AddField("sint32_values") - if s.ReadNil() { - x.Sint32Values = nil - return - } - x.Sint32Values = s.ReadInt32Array() - case "sint64_value", "sint64Value": - s.AddField("sint64_value") - x.Sint64Value = s.ReadInt64() - case "sint64_values", "sint64Values": - s.AddField("sint64_values") - if s.ReadNil() { - x.Sint64Values = nil - return - } - x.Sint64Values = s.ReadInt64Array() - case "fixed32_value", "fixed32Value": - s.AddField("fixed32_value") - x.Fixed32Value = s.ReadUint32() - case "fixed32_values", "fixed32Values": - s.AddField("fixed32_values") - if s.ReadNil() { - x.Fixed32Values = nil - return - } - x.Fixed32Values = s.ReadUint32Array() - case "fixed64_value", "fixed64Value": - s.AddField("fixed64_value") - x.Fixed64Value = s.ReadUint64() - case "fixed64_values", "fixed64Values": - s.AddField("fixed64_values") - if s.ReadNil() { - x.Fixed64Values = nil - return - } - x.Fixed64Values = s.ReadUint64Array() - case "sfixed32_value", "sfixed32Value": - s.AddField("sfixed32_value") - x.Sfixed32Value = s.ReadInt32() - case "sfixed32_values", "sfixed32Values": - s.AddField("sfixed32_values") - if s.ReadNil() { - x.Sfixed32Values = nil - return - } - x.Sfixed32Values = s.ReadInt32Array() - case "sfixed64_value", "sfixed64Value": - s.AddField("sfixed64_value") - x.Sfixed64Value = s.ReadInt64() - case "sfixed64_values", "sfixed64Values": - s.AddField("sfixed64_values") - if s.ReadNil() { - x.Sfixed64Values = nil - return - } - x.Sfixed64Values = s.ReadInt64Array() - case "bool_value", "boolValue": - s.AddField("bool_value") - x.BoolValue = s.ReadBool() - case "bool_values", "boolValues": - s.AddField("bool_values") - if s.ReadNil() { - x.BoolValues = nil - return - } - x.BoolValues = s.ReadBoolArray() - case "string_value", "stringValue": - s.AddField("string_value") - x.StringValue = s.ReadString() - case "string_values", "stringValues": - s.AddField("string_values") - if s.ReadNil() { - x.StringValues = nil - return - } - x.StringValues = s.ReadStringArray() - case "bytes_value", "bytesValue": - s.AddField("bytes_value") - x.BytesValue = s.ReadBytes() - case "bytes_values", "bytesValues": - s.AddField("bytes_values") - if s.ReadNil() { - x.BytesValues = nil - return - } - x.BytesValues = s.ReadBytesArray() - case "hex_bytes_value", "hexBytesValue": - s.AddField("hex_bytes_value") - x.HexBytesValue = types.UnmarshalHEX(s.WithField("hex_bytes_value", false)) - case "hex_bytes_values", "hexBytesValues": - s.AddField("hex_bytes_values") - if s.ReadNil() { - x.HexBytesValues = nil - return - } - x.HexBytesValues = types.UnmarshalHEXArray(s.WithField("hex_bytes_values", false)) - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithScalars from JSON. -func (x *MessageWithScalars) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithOneofScalars message to JSON. -func (x *MessageWithOneofScalars) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.Value != nil { - switch ov := x.Value.(type) { - case *MessageWithOneofScalars_DoubleValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("double_value") - s.WriteFloat64(ov.DoubleValue) - case *MessageWithOneofScalars_FloatValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("float_value") - s.WriteFloat32(ov.FloatValue) - case *MessageWithOneofScalars_Int32Value: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("int32_value") - s.WriteInt32(ov.Int32Value) - case *MessageWithOneofScalars_Int64Value: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("int64_value") - s.WriteInt64(ov.Int64Value) - case *MessageWithOneofScalars_Uint32Value: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("uint32_value") - s.WriteUint32(ov.Uint32Value) - case *MessageWithOneofScalars_Uint64Value: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("uint64_value") - s.WriteUint64(ov.Uint64Value) - case *MessageWithOneofScalars_Sint32Value: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sint32_value") - s.WriteInt32(ov.Sint32Value) - case *MessageWithOneofScalars_Sint64Value: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sint64_value") - s.WriteInt64(ov.Sint64Value) - case *MessageWithOneofScalars_Fixed32Value: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("fixed32_value") - s.WriteUint32(ov.Fixed32Value) - case *MessageWithOneofScalars_Fixed64Value: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("fixed64_value") - s.WriteUint64(ov.Fixed64Value) - case *MessageWithOneofScalars_Sfixed32Value: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sfixed32_value") - s.WriteInt32(ov.Sfixed32Value) - case *MessageWithOneofScalars_Sfixed64Value: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sfixed64_value") - s.WriteInt64(ov.Sfixed64Value) - case *MessageWithOneofScalars_BoolValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("bool_value") - s.WriteBool(ov.BoolValue) - case *MessageWithOneofScalars_StringValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_value") - s.WriteString(ov.StringValue) - case *MessageWithOneofScalars_BytesValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("bytes_value") - s.WriteBytes(ov.BytesValue) - case *MessageWithOneofScalars_HexBytesValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("hex_bytes_value") - types.MarshalHEX(s.WithField("hex_bytes_value"), ov.HexBytesValue) - } - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithOneofScalars to JSON. -func (x *MessageWithOneofScalars) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithOneofScalars message from JSON. -func (x *MessageWithOneofScalars) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "double_value", "doubleValue": - s.AddField("double_value") - ov := &MessageWithOneofScalars_DoubleValue{} - x.Value = ov - ov.DoubleValue = s.ReadFloat64() - case "float_value", "floatValue": - s.AddField("float_value") - ov := &MessageWithOneofScalars_FloatValue{} - x.Value = ov - ov.FloatValue = s.ReadFloat32() - case "int32_value", "int32Value": - s.AddField("int32_value") - ov := &MessageWithOneofScalars_Int32Value{} - x.Value = ov - ov.Int32Value = s.ReadInt32() - case "int64_value", "int64Value": - s.AddField("int64_value") - ov := &MessageWithOneofScalars_Int64Value{} - x.Value = ov - ov.Int64Value = s.ReadInt64() - case "uint32_value", "uint32Value": - s.AddField("uint32_value") - ov := &MessageWithOneofScalars_Uint32Value{} - x.Value = ov - ov.Uint32Value = s.ReadUint32() - case "uint64_value", "uint64Value": - s.AddField("uint64_value") - ov := &MessageWithOneofScalars_Uint64Value{} - x.Value = ov - ov.Uint64Value = s.ReadUint64() - case "sint32_value", "sint32Value": - s.AddField("sint32_value") - ov := &MessageWithOneofScalars_Sint32Value{} - x.Value = ov - ov.Sint32Value = s.ReadInt32() - case "sint64_value", "sint64Value": - s.AddField("sint64_value") - ov := &MessageWithOneofScalars_Sint64Value{} - x.Value = ov - ov.Sint64Value = s.ReadInt64() - case "fixed32_value", "fixed32Value": - s.AddField("fixed32_value") - ov := &MessageWithOneofScalars_Fixed32Value{} - x.Value = ov - ov.Fixed32Value = s.ReadUint32() - case "fixed64_value", "fixed64Value": - s.AddField("fixed64_value") - ov := &MessageWithOneofScalars_Fixed64Value{} - x.Value = ov - ov.Fixed64Value = s.ReadUint64() - case "sfixed32_value", "sfixed32Value": - s.AddField("sfixed32_value") - ov := &MessageWithOneofScalars_Sfixed32Value{} - x.Value = ov - ov.Sfixed32Value = s.ReadInt32() - case "sfixed64_value", "sfixed64Value": - s.AddField("sfixed64_value") - ov := &MessageWithOneofScalars_Sfixed64Value{} - x.Value = ov - ov.Sfixed64Value = s.ReadInt64() - case "bool_value", "boolValue": - s.AddField("bool_value") - ov := &MessageWithOneofScalars_BoolValue{} - x.Value = ov - ov.BoolValue = s.ReadBool() - case "string_value", "stringValue": - s.AddField("string_value") - ov := &MessageWithOneofScalars_StringValue{} - x.Value = ov - ov.StringValue = s.ReadString() - case "bytes_value", "bytesValue": - s.AddField("bytes_value") - ov := &MessageWithOneofScalars_BytesValue{} - x.Value = ov - ov.BytesValue = s.ReadBytes() - case "hex_bytes_value", "hexBytesValue": - s.AddField("hex_bytes_value") - ov := &MessageWithOneofScalars_HexBytesValue{} - x.Value = ov - ov.HexBytesValue = types.UnmarshalHEX(s.WithField("hex_bytes_value", false)) - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithOneofScalars from JSON. -func (x *MessageWithOneofScalars) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithScalarMaps message to JSON. -func (x *MessageWithScalarMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.StringDoubleMap != nil || s.HasField("string_double_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_double_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringDoubleMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - s.WriteFloat64(v) - } - s.WriteObjectEnd() - } - if x.StringFloatMap != nil || s.HasField("string_float_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_float_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringFloatMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - s.WriteFloat32(v) - } - s.WriteObjectEnd() - } - if x.StringInt32Map != nil || s.HasField("string_int32_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_int32_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringInt32Map { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - s.WriteInt32(v) - } - s.WriteObjectEnd() - } - if x.Int32StringMap != nil || s.HasField("int32_string_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("int32_string_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.Int32StringMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectInt32Field(k) - s.WriteString(v) - } - s.WriteObjectEnd() - } - if x.StringInt64Map != nil || s.HasField("string_int64_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_int64_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringInt64Map { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - s.WriteInt64(v) - } - s.WriteObjectEnd() - } - if x.Int64StringMap != nil || s.HasField("int64_string_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("int64_string_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.Int64StringMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectInt64Field(k) - s.WriteString(v) - } - s.WriteObjectEnd() - } - if x.StringUint32Map != nil || s.HasField("string_uint32_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_uint32_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringUint32Map { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - s.WriteUint32(v) - } - s.WriteObjectEnd() - } - if x.Uint32StringMap != nil || s.HasField("uint32_string_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("uint32_string_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.Uint32StringMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectUint32Field(k) - s.WriteString(v) - } - s.WriteObjectEnd() - } - if x.StringUint64Map != nil || s.HasField("string_uint64_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_uint64_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringUint64Map { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - s.WriteUint64(v) - } - s.WriteObjectEnd() - } - if x.Uint64StringMap != nil || s.HasField("uint64_string_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("uint64_string_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.Uint64StringMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectUint64Field(k) - s.WriteString(v) - } - s.WriteObjectEnd() - } - if x.StringSint32Map != nil || s.HasField("string_sint32_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_sint32_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringSint32Map { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - s.WriteInt32(v) - } - s.WriteObjectEnd() - } - if x.Sint32StringMap != nil || s.HasField("sint32_string_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sint32_string_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.Sint32StringMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectInt32Field(k) - s.WriteString(v) - } - s.WriteObjectEnd() - } - if x.StringSint64Map != nil || s.HasField("string_sint64_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_sint64_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringSint64Map { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - s.WriteInt64(v) - } - s.WriteObjectEnd() - } - if x.Sint64StringMap != nil || s.HasField("sint64_string_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sint64_string_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.Sint64StringMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectInt64Field(k) - s.WriteString(v) - } - s.WriteObjectEnd() - } - if x.StringFixed32Map != nil || s.HasField("string_fixed32_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_fixed32_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringFixed32Map { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - s.WriteUint32(v) - } - s.WriteObjectEnd() - } - if x.Fixed32StringMap != nil || s.HasField("fixed32_string_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("fixed32_string_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.Fixed32StringMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectUint32Field(k) - s.WriteString(v) - } - s.WriteObjectEnd() - } - if x.StringFixed64Map != nil || s.HasField("string_fixed64_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_fixed64_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringFixed64Map { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - s.WriteUint64(v) - } - s.WriteObjectEnd() - } - if x.Fixed64StringMap != nil || s.HasField("fixed64_string_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("fixed64_string_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.Fixed64StringMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectUint64Field(k) - s.WriteString(v) - } - s.WriteObjectEnd() - } - if x.StringSfixed32Map != nil || s.HasField("string_sfixed32_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_sfixed32_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringSfixed32Map { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - s.WriteInt32(v) - } - s.WriteObjectEnd() - } - if x.Sfixed32StringMap != nil || s.HasField("sfixed32_string_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sfixed32_string_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.Sfixed32StringMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectInt32Field(k) - s.WriteString(v) - } - s.WriteObjectEnd() - } - if x.StringSfixed64Map != nil || s.HasField("string_sfixed64_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_sfixed64_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringSfixed64Map { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - s.WriteInt64(v) - } - s.WriteObjectEnd() - } - if x.Sfixed64StringMap != nil || s.HasField("sfixed64_string_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sfixed64_string_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.Sfixed64StringMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectInt64Field(k) - s.WriteString(v) - } - s.WriteObjectEnd() - } - if x.StringBoolMap != nil || s.HasField("string_bool_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_bool_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringBoolMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - s.WriteBool(v) - } - s.WriteObjectEnd() - } - if x.BoolStringMap != nil || s.HasField("bool_string_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("bool_string_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.BoolStringMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectBoolField(k) - s.WriteString(v) - } - s.WriteObjectEnd() - } - if x.StringStringMap != nil || s.HasField("string_string_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_string_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringStringMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - s.WriteString(v) - } - s.WriteObjectEnd() - } - if x.StringBytesMap != nil || s.HasField("string_bytes_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_bytes_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringBytesMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - s.WriteBytes(v) - } - s.WriteObjectEnd() - } - if x.StringHexBytesMap != nil || s.HasField("string_hex_bytes_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_hex_bytes_map") - types.MarshalStringHEXMap(s.WithField("string_hex_bytes_map"), x.StringHexBytesMap) - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithScalarMaps to JSON. -func (x *MessageWithScalarMaps) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithScalarMaps message from JSON. -func (x *MessageWithScalarMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "string_double_map", "stringDoubleMap": - s.AddField("string_double_map") - if s.ReadNil() { - x.StringDoubleMap = nil - return - } - x.StringDoubleMap = make(map[string]float64) - s.ReadStringMap(func(key string) { - x.StringDoubleMap[key] = s.ReadFloat64() - }) - case "string_float_map", "stringFloatMap": - s.AddField("string_float_map") - if s.ReadNil() { - x.StringFloatMap = nil - return - } - x.StringFloatMap = make(map[string]float32) - s.ReadStringMap(func(key string) { - x.StringFloatMap[key] = s.ReadFloat32() - }) - case "string_int32_map", "stringInt32Map": - s.AddField("string_int32_map") - if s.ReadNil() { - x.StringInt32Map = nil - return - } - x.StringInt32Map = make(map[string]int32) - s.ReadStringMap(func(key string) { - x.StringInt32Map[key] = s.ReadInt32() - }) - case "int32_string_map", "int32StringMap": - s.AddField("int32_string_map") - if s.ReadNil() { - x.Int32StringMap = nil - return - } - x.Int32StringMap = make(map[int32]string) - s.ReadInt32Map(func(key int32) { - x.Int32StringMap[key] = s.ReadString() - }) - case "string_int64_map", "stringInt64Map": - s.AddField("string_int64_map") - if s.ReadNil() { - x.StringInt64Map = nil - return - } - x.StringInt64Map = make(map[string]int64) - s.ReadStringMap(func(key string) { - x.StringInt64Map[key] = s.ReadInt64() - }) - case "int64_string_map", "int64StringMap": - s.AddField("int64_string_map") - if s.ReadNil() { - x.Int64StringMap = nil - return - } - x.Int64StringMap = make(map[int64]string) - s.ReadInt64Map(func(key int64) { - x.Int64StringMap[key] = s.ReadString() - }) - case "string_uint32_map", "stringUint32Map": - s.AddField("string_uint32_map") - if s.ReadNil() { - x.StringUint32Map = nil - return - } - x.StringUint32Map = make(map[string]uint32) - s.ReadStringMap(func(key string) { - x.StringUint32Map[key] = s.ReadUint32() - }) - case "uint32_string_map", "uint32StringMap": - s.AddField("uint32_string_map") - if s.ReadNil() { - x.Uint32StringMap = nil - return - } - x.Uint32StringMap = make(map[uint32]string) - s.ReadUint32Map(func(key uint32) { - x.Uint32StringMap[key] = s.ReadString() - }) - case "string_uint64_map", "stringUint64Map": - s.AddField("string_uint64_map") - if s.ReadNil() { - x.StringUint64Map = nil - return - } - x.StringUint64Map = make(map[string]uint64) - s.ReadStringMap(func(key string) { - x.StringUint64Map[key] = s.ReadUint64() - }) - case "uint64_string_map", "uint64StringMap": - s.AddField("uint64_string_map") - if s.ReadNil() { - x.Uint64StringMap = nil - return - } - x.Uint64StringMap = make(map[uint64]string) - s.ReadUint64Map(func(key uint64) { - x.Uint64StringMap[key] = s.ReadString() - }) - case "string_sint32_map", "stringSint32Map": - s.AddField("string_sint32_map") - if s.ReadNil() { - x.StringSint32Map = nil - return - } - x.StringSint32Map = make(map[string]int32) - s.ReadStringMap(func(key string) { - x.StringSint32Map[key] = s.ReadInt32() - }) - case "sint32_string_map", "sint32StringMap": - s.AddField("sint32_string_map") - if s.ReadNil() { - x.Sint32StringMap = nil - return - } - x.Sint32StringMap = make(map[int32]string) - s.ReadInt32Map(func(key int32) { - x.Sint32StringMap[key] = s.ReadString() - }) - case "string_sint64_map", "stringSint64Map": - s.AddField("string_sint64_map") - if s.ReadNil() { - x.StringSint64Map = nil - return - } - x.StringSint64Map = make(map[string]int64) - s.ReadStringMap(func(key string) { - x.StringSint64Map[key] = s.ReadInt64() - }) - case "sint64_string_map", "sint64StringMap": - s.AddField("sint64_string_map") - if s.ReadNil() { - x.Sint64StringMap = nil - return - } - x.Sint64StringMap = make(map[int64]string) - s.ReadInt64Map(func(key int64) { - x.Sint64StringMap[key] = s.ReadString() - }) - case "string_fixed32_map", "stringFixed32Map": - s.AddField("string_fixed32_map") - if s.ReadNil() { - x.StringFixed32Map = nil - return - } - x.StringFixed32Map = make(map[string]uint32) - s.ReadStringMap(func(key string) { - x.StringFixed32Map[key] = s.ReadUint32() - }) - case "fixed32_string_map", "fixed32StringMap": - s.AddField("fixed32_string_map") - if s.ReadNil() { - x.Fixed32StringMap = nil - return - } - x.Fixed32StringMap = make(map[uint32]string) - s.ReadUint32Map(func(key uint32) { - x.Fixed32StringMap[key] = s.ReadString() - }) - case "string_fixed64_map", "stringFixed64Map": - s.AddField("string_fixed64_map") - if s.ReadNil() { - x.StringFixed64Map = nil - return - } - x.StringFixed64Map = make(map[string]uint64) - s.ReadStringMap(func(key string) { - x.StringFixed64Map[key] = s.ReadUint64() - }) - case "fixed64_string_map", "fixed64StringMap": - s.AddField("fixed64_string_map") - if s.ReadNil() { - x.Fixed64StringMap = nil - return - } - x.Fixed64StringMap = make(map[uint64]string) - s.ReadUint64Map(func(key uint64) { - x.Fixed64StringMap[key] = s.ReadString() - }) - case "string_sfixed32_map", "stringSfixed32Map": - s.AddField("string_sfixed32_map") - if s.ReadNil() { - x.StringSfixed32Map = nil - return - } - x.StringSfixed32Map = make(map[string]int32) - s.ReadStringMap(func(key string) { - x.StringSfixed32Map[key] = s.ReadInt32() - }) - case "sfixed32_string_map", "sfixed32StringMap": - s.AddField("sfixed32_string_map") - if s.ReadNil() { - x.Sfixed32StringMap = nil - return - } - x.Sfixed32StringMap = make(map[int32]string) - s.ReadInt32Map(func(key int32) { - x.Sfixed32StringMap[key] = s.ReadString() - }) - case "string_sfixed64_map", "stringSfixed64Map": - s.AddField("string_sfixed64_map") - if s.ReadNil() { - x.StringSfixed64Map = nil - return - } - x.StringSfixed64Map = make(map[string]int64) - s.ReadStringMap(func(key string) { - x.StringSfixed64Map[key] = s.ReadInt64() - }) - case "sfixed64_string_map", "sfixed64StringMap": - s.AddField("sfixed64_string_map") - if s.ReadNil() { - x.Sfixed64StringMap = nil - return - } - x.Sfixed64StringMap = make(map[int64]string) - s.ReadInt64Map(func(key int64) { - x.Sfixed64StringMap[key] = s.ReadString() - }) - case "string_bool_map", "stringBoolMap": - s.AddField("string_bool_map") - if s.ReadNil() { - x.StringBoolMap = nil - return - } - x.StringBoolMap = make(map[string]bool) - s.ReadStringMap(func(key string) { - x.StringBoolMap[key] = s.ReadBool() - }) - case "bool_string_map", "boolStringMap": - s.AddField("bool_string_map") - if s.ReadNil() { - x.BoolStringMap = nil - return - } - x.BoolStringMap = make(map[bool]string) - s.ReadBoolMap(func(key bool) { - x.BoolStringMap[key] = s.ReadString() - }) - case "string_string_map", "stringStringMap": - s.AddField("string_string_map") - if s.ReadNil() { - x.StringStringMap = nil - return - } - x.StringStringMap = make(map[string]string) - s.ReadStringMap(func(key string) { - x.StringStringMap[key] = s.ReadString() - }) - case "string_bytes_map", "stringBytesMap": - s.AddField("string_bytes_map") - if s.ReadNil() { - x.StringBytesMap = nil - return - } - x.StringBytesMap = make(map[string][]byte) - s.ReadStringMap(func(key string) { - x.StringBytesMap[key] = s.ReadBytes() - }) - case "string_hex_bytes_map", "stringHexBytesMap": - s.AddField("string_hex_bytes_map") - if s.ReadNil() { - x.StringHexBytesMap = nil - return - } - x.StringHexBytesMap = types.UnmarshalStringHEXMap(s.WithField("string_hex_bytes_map", false)) - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithScalarMaps from JSON. -func (x *MessageWithScalarMaps) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} diff --git a/test/gogo/scalars_test.go b/test/gogo/scalars_test.go deleted file mode 100644 index 1ac06025..00000000 --- a/test/gogo/scalars_test.go +++ /dev/null @@ -1,635 +0,0 @@ -package test_test - -import ( - "testing" - - . "github.com/TheThingsIndustries/protoc-gen-go-json/test/gogo" -) - -var testMessagesWithScalars = []struct { - name string - msg MessageWithScalars - expected string - expectedMask []string -}{ - { - name: "empty", - msg: MessageWithScalars{}, - expected: `{}`, - }, - { - name: "zero", - msg: MessageWithScalars{}, - expected: `{ - "double_value": 0, - "double_values": [], - "float_value": 0, - "float_values": [], - "int32_value": 0, - "int32_values": [], - "int64_value": "0", - "int64_values": [], - "uint32_value": 0, - "uint32_values": [], - "uint64_value": "0", - "uint64_values": [], - "sint32_value": 0, - "sint32_values": [], - "sint64_value": "0", - "sint64_values": [], - "fixed32_value": 0, - "fixed32_values": [], - "fixed64_value": "0", - "fixed64_values": [], - "sfixed32_value": 0, - "sfixed32_values": [], - "sfixed64_value": "0", - "sfixed64_values": [], - "bool_value": false, - "bool_values": [], - "string_value": "", - "string_values": [], - "bytes_value": null, - "bytes_values": [], - "hex_bytes_value": null, - "hex_bytes_values": [] - }`, - expectedMask: []string{ - "double_value", - "double_values", - "float_value", - "float_values", - "int32_value", - "int32_values", - "int64_value", - "int64_values", - "uint32_value", - "uint32_values", - "uint64_value", - "uint64_values", - "sint32_value", - "sint32_values", - "sint64_value", - "sint64_values", - "fixed32_value", - "fixed32_values", - "fixed64_value", - "fixed64_values", - "sfixed32_value", - "sfixed32_values", - "sfixed64_value", - "sfixed64_values", - "bool_value", - "bool_values", - "string_value", - "string_values", - "bytes_value", - "bytes_values", - "hex_bytes_value", - "hex_bytes_values", - }, - }, - { - name: "full", - msg: MessageWithScalars{ - DoubleValue: 12.34, - DoubleValues: []float64{12.34, 56.78}, - FloatValue: 12.34, - FloatValues: []float32{12.34, 56.78}, - Int32Value: -42, - Int32Values: []int32{1, 2, -42}, - Int64Value: -42, - Int64Values: []int64{1, 2, -42}, - Uint32Value: 42, - Uint32Values: []uint32{1, 2, 42}, - Uint64Value: 42, - Uint64Values: []uint64{1, 2, 42}, - Sint32Value: -42, - Sint32Values: []int32{1, 2, -42}, - Sint64Value: -42, - Sint64Values: []int64{1, 2, -42}, - Fixed32Value: 42, - Fixed32Values: []uint32{1, 2, 42}, - Fixed64Value: 42, - Fixed64Values: []uint64{1, 2, 42}, - Sfixed32Value: -42, - Sfixed32Values: []int32{1, 2, -42}, - Sfixed64Value: -42, - Sfixed64Values: []int64{1, 2, -42}, - BoolValue: true, - BoolValues: []bool{true, false}, - StringValue: "foo", - StringValues: []string{"foo", "bar"}, - BytesValue: []byte("foo"), - BytesValues: [][]byte{[]byte("foo"), []byte("bar")}, - HexBytesValue: []byte("foo"), - HexBytesValues: [][]byte{[]byte("foo"), []byte("bar")}, - }, - expected: `{ - "double_value": 12.34, - "double_values": [12.34, 56.78], - "float_value": 12.34, - "float_values": [12.34, 56.78], - "int32_value": -42, - "int32_values": [1, 2, -42], - "int64_value": "-42", - "int64_values": ["1", "2", "-42"], - "uint32_value": 42, - "uint32_values": [1, 2, 42], - "uint64_value": "42", - "uint64_values": ["1", "2", "42"], - "sint32_value": -42, - "sint32_values": [1, 2, -42], - "sint64_value": "-42", - "sint64_values": ["1", "2", "-42"], - "fixed32_value": 42, - "fixed32_values": [1, 2, 42], - "fixed64_value": "42", - "fixed64_values": ["1", "2", "42"], - "sfixed32_value": -42, - "sfixed32_values": [1, 2, -42], - "sfixed64_value": "-42", - "sfixed64_values": ["1", "2", "-42"], - "bool_value": true, - "bool_values": [true, false], - "string_value": "foo", - "string_values": ["foo", "bar"], - "bytes_value": "Zm9v", - "bytes_values": ["Zm9v", "YmFy"], - "hex_bytes_value": "666F6F", - "hex_bytes_values": ["666F6F", "626172"] - }`, - expectedMask: []string{ - "double_value", - "double_values", - "float_value", - "float_values", - "int32_value", - "int32_values", - "int64_value", - "int64_values", - "uint32_value", - "uint32_values", - "uint64_value", - "uint64_values", - "sint32_value", - "sint32_values", - "sint64_value", - "sint64_values", - "fixed32_value", - "fixed32_values", - "fixed64_value", - "fixed64_values", - "sfixed32_value", - "sfixed32_values", - "sfixed64_value", - "sfixed64_values", - "bool_value", - "bool_values", - "string_value", - "string_values", - "bytes_value", - "bytes_values", - "hex_bytes_value", - "hex_bytes_values", - }, - }, -} - -func TestMarshalMessageWithScalars(t *testing.T) { - for _, tt := range testMessagesWithScalars { - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithScalars(t *testing.T) { - for _, tt := range testMessagesWithScalars { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} - -var testMessagesWithOneofScalars = []struct { - name string - msg MessageWithOneofScalars - expected string - expectedMask []string -}{ - { - name: "empty", - msg: MessageWithOneofScalars{}, - expected: `{}`, - }, - { - name: "double_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_DoubleValue{}, - }, - expected: `{"double_value": 0}`, - expectedMask: []string{"double_value"}, - }, - { - name: "double_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_DoubleValue{DoubleValue: 12.34}, - }, - expected: `{"double_value": 12.34}`, - expectedMask: []string{"double_value"}, - }, - { - name: "float_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_FloatValue{}, - }, - expected: `{"float_value": 0}`, - expectedMask: []string{"float_value"}, - }, - { - name: "float_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_FloatValue{FloatValue: 12.34}, - }, - expected: `{"float_value": 12.34}`, - expectedMask: []string{"float_value"}, - }, - { - name: "int32_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Int32Value{}, - }, - expected: `{"int32_value": 0}`, - expectedMask: []string{"int32_value"}, - }, - { - name: "int32_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Int32Value{Int32Value: -42}, - }, - expected: `{"int32_value": -42}`, - expectedMask: []string{"int32_value"}, - }, - { - name: "int64_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Int64Value{}, - }, - expected: `{"int64_value": "0"}`, - expectedMask: []string{"int64_value"}, - }, - { - name: "int64_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Int64Value{Int64Value: -42}, - }, - expected: `{"int64_value": "-42"}`, - expectedMask: []string{"int64_value"}, - }, - { - name: "uint32_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Uint32Value{}, - }, - expected: `{"uint32_value": 0}`, - expectedMask: []string{"uint32_value"}, - }, - { - name: "uint32_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Uint32Value{Uint32Value: 42}, - }, - expected: `{"uint32_value": 42}`, - expectedMask: []string{"uint32_value"}, - }, - { - name: "uint64_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Uint64Value{}, - }, - expected: `{"uint64_value": "0"}`, - expectedMask: []string{"uint64_value"}, - }, - { - name: "uint64_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Uint64Value{Uint64Value: 42}, - }, - expected: `{"uint64_value": "42"}`, - expectedMask: []string{"uint64_value"}, - }, - { - name: "sint32_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Sint32Value{}, - }, - expected: `{"sint32_value": 0}`, - expectedMask: []string{"sint32_value"}, - }, - { - name: "sint32_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Sint32Value{Sint32Value: -42}, - }, - expected: `{"sint32_value": -42}`, - expectedMask: []string{"sint32_value"}, - }, - { - name: "sint64_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Sint64Value{}, - }, - expected: `{"sint64_value": "0"}`, - expectedMask: []string{"sint64_value"}, - }, - { - name: "sint64_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Sint64Value{Sint64Value: -42}, - }, - expected: `{"sint64_value": "-42"}`, - expectedMask: []string{"sint64_value"}, - }, - { - name: "fixed32_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Fixed32Value{}, - }, - expected: `{"fixed32_value": 0}`, - expectedMask: []string{"fixed32_value"}, - }, - { - name: "fixed32_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Fixed32Value{Fixed32Value: 42}, - }, - expected: `{"fixed32_value": 42}`, - expectedMask: []string{"fixed32_value"}, - }, - { - name: "fixed64_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Fixed64Value{}, - }, - expected: `{"fixed64_value": "0"}`, - expectedMask: []string{"fixed64_value"}, - }, - { - name: "fixed64_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Fixed64Value{Fixed64Value: 42}, - }, - expected: `{"fixed64_value": "42"}`, - expectedMask: []string{"fixed64_value"}, - }, - - { - name: "sfixed32_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Sfixed32Value{}, - }, - expected: `{"sfixed32_value": 0}`, - expectedMask: []string{"sfixed32_value"}, - }, - { - name: "sfixed32_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Sfixed32Value{Sfixed32Value: -42}, - }, - expected: `{"sfixed32_value": -42}`, - expectedMask: []string{"sfixed32_value"}, - }, - { - name: "sfixed64_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Sfixed64Value{}, - }, - expected: `{"sfixed64_value": "0"}`, - expectedMask: []string{"sfixed64_value"}, - }, - { - name: "sfixed64_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Sfixed64Value{Sfixed64Value: -42}, - }, - expected: `{"sfixed64_value": "-42"}`, - expectedMask: []string{"sfixed64_value"}, - }, - - { - name: "bool_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_BoolValue{}, - }, - expected: `{"bool_value": false}`, - expectedMask: []string{"bool_value"}, - }, - { - name: "bool_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_BoolValue{BoolValue: true}, - }, - expected: `{"bool_value": true}`, - expectedMask: []string{"bool_value"}, - }, - { - name: "string_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_StringValue{}, - }, - expected: `{"string_value": ""}`, - expectedMask: []string{"string_value"}, - }, - { - name: "string_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_StringValue{StringValue: "foo"}, - }, - expected: `{"string_value": "foo"}`, - expectedMask: []string{"string_value"}, - }, - { - name: "bytes_null", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_BytesValue{}, - }, - expected: `{"bytes_value": null}`, - expectedMask: []string{"bytes_value"}, - }, - { - name: "bytes_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_BytesValue{BytesValue: []byte{}}, - }, - expected: `{"bytes_value": ""}`, - expectedMask: []string{"bytes_value"}, - }, - { - name: "bytes_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_BytesValue{BytesValue: []byte("foo")}, - }, - expected: `{"bytes_value": "Zm9v"}`, - expectedMask: []string{"bytes_value"}, - }, - { - name: "hex_bytes_null", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_HexBytesValue{}, - }, - expected: `{"hex_bytes_value": null}`, - expectedMask: []string{"hex_bytes_value"}, - }, - { - name: "hex_bytes_zero", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_HexBytesValue{HexBytesValue: []byte{}}, - }, - expected: `{"hex_bytes_value": ""}`, - expectedMask: []string{"hex_bytes_value"}, - }, - { - name: "hex_bytes_value", - msg: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_HexBytesValue{HexBytesValue: []byte("foo")}, - }, - expected: `{"hex_bytes_value": "666F6F"}`, - expectedMask: []string{"hex_bytes_value"}, - }, -} - -func TestMarshalMessageWithOneofScalars(t *testing.T) { - for _, tt := range testMessagesWithOneofScalars { - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithOneofScalars(t *testing.T) { - for _, tt := range testMessagesWithOneofScalars { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} - -var testMessagesWithScalarMaps = []struct { - name string - msg MessageWithScalarMaps - expected string - expectedMask []string -}{ - { - name: "empty", - msg: MessageWithScalarMaps{}, - expected: `{}`, - }, - { - name: "full", - msg: MessageWithScalarMaps{ - StringDoubleMap: map[string]float64{"value": -42}, - StringFloatMap: map[string]float32{"value": -42}, - StringInt32Map: map[string]int32{"value": -42}, - Int32StringMap: map[int32]string{-42: "answer"}, - StringInt64Map: map[string]int64{"value": -42}, - Int64StringMap: map[int64]string{-42: "answer"}, - StringUint32Map: map[string]uint32{"value": 42}, - Uint32StringMap: map[uint32]string{42: "answer"}, - StringUint64Map: map[string]uint64{"value": 42}, - Uint64StringMap: map[uint64]string{42: "answer"}, - StringSint32Map: map[string]int32{"value": -42}, - Sint32StringMap: map[int32]string{-42: "answer"}, - StringSint64Map: map[string]int64{"value": -42}, - Sint64StringMap: map[int64]string{-42: "answer"}, - StringFixed32Map: map[string]uint32{"value": 42}, - Fixed32StringMap: map[uint32]string{42: "answer"}, - StringFixed64Map: map[string]uint64{"value": 42}, - Fixed64StringMap: map[uint64]string{42: "answer"}, - StringSfixed32Map: map[string]int32{"value": -42}, - Sfixed32StringMap: map[int32]string{-42: "answer"}, - StringSfixed64Map: map[string]int64{"value": -42}, - Sfixed64StringMap: map[int64]string{-42: "answer"}, - StringBoolMap: map[string]bool{"yes": true}, - BoolStringMap: map[bool]string{true: "yes"}, - StringStringMap: map[string]string{"value": "foo"}, - StringBytesMap: map[string][]byte{"value": []byte("foo")}, - StringHexBytesMap: map[string][]byte{"value": []byte("foo")}, - }, - expected: `{ - "string_double_map": {"value": -42}, - "string_float_map": {"value": -42}, - "string_int32_map": {"value": -42}, - "int32_string_map": {"-42": "answer"}, - "string_int64_map": {"value": "-42"}, - "int64_string_map": {"-42": "answer"}, - "string_uint32_map": {"value": 42}, - "uint32_string_map": {"42": "answer"}, - "string_uint64_map": {"value": "42"}, - "uint64_string_map": {"42": "answer"}, - "string_sint32_map": {"value": -42}, - "sint32_string_map": {"-42": "answer"}, - "string_sint64_map": {"value": "-42"}, - "sint64_string_map": {"-42": "answer"}, - "string_fixed32_map": {"value": 42}, - "fixed32_string_map": {"42": "answer"}, - "string_fixed64_map": {"value": "42"}, - "fixed64_string_map": {"42": "answer"}, - "string_sfixed32_map": {"value": -42}, - "sfixed32_string_map": {"-42": "answer"}, - "string_sfixed64_map": {"value": "-42"}, - "sfixed64_string_map": {"-42": "answer"}, - "string_bool_map": {"yes": true}, - "bool_string_map": {"true": "yes"}, - "string_string_map": {"value": "foo"}, - "string_bytes_map": {"value": "Zm9v"}, - "string_hex_bytes_map": {"value": "666F6F"} - }`, - expectedMask: []string{ - "string_double_map", - "string_float_map", - "string_int32_map", - "int32_string_map", - "string_int64_map", - "int64_string_map", - "string_uint32_map", - "uint32_string_map", - "string_uint64_map", - "uint64_string_map", - "string_sint32_map", - "sint32_string_map", - "string_sint64_map", - "sint64_string_map", - "string_fixed32_map", - "fixed32_string_map", - "string_fixed64_map", - "fixed64_string_map", - "string_sfixed32_map", - "sfixed32_string_map", - "string_sfixed64_map", - "sfixed64_string_map", - "string_bool_map", - "bool_string_map", - "string_string_map", - "string_bytes_map", - "string_hex_bytes_map", - }, - }, -} - -func TestMarshalMessageWithScalarMaps(t *testing.T) { - for _, tt := range testMessagesWithScalarMaps { - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithScalarMaps(t *testing.T) { - for _, tt := range testMessagesWithScalarMaps { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} diff --git a/test/gogo/utils_test.go b/test/gogo/utils_test.go deleted file mode 100644 index 4098998e..00000000 --- a/test/gogo/utils_test.go +++ /dev/null @@ -1,132 +0,0 @@ -package test_test - -import ( - "bytes" - "encoding/json" - "reflect" - "testing" - - "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" - "github.com/gogo/protobuf/jsonpb" - proto "github.com/gogo/protobuf/proto" - "github.com/google/go-cmp/cmp" -) - -var gogoMarshaler = jsonpb.Marshaler{ - OrigName: true, - EnumsAsInts: true, -} - -func gogoMarshal(t *testing.T, msg proto.Message) []byte { - t.Helper() - var buf bytes.Buffer - if err := gogoMarshaler.Marshal(&buf, msg); err != nil { - t.Logf("gogo failed to marshal: %v", err) - } - return buf.Bytes() -} - -var gogoUnmarshaler = jsonpb.Unmarshaler{} - -func gogoUnmarshal(t *testing.T, msg proto.Message, data []byte) { - t.Helper() - buf := bytes.NewBuffer(data) - if err := gogoUnmarshaler.Unmarshal(buf, msg); err != nil { - t.Logf("gogo failed to unmarshal: %v", err) - } -} - -func generatedMarshal(t *testing.T, msg proto.Message, mask []string) []byte { - t.Helper() - m, ok := msg.(jsonplugin.Marshaler) - if !ok { - t.Fatalf("message %T does not implement the jsonplugin.Marshaler", msg) - } - s := jsonplugin.NewMarshalState(jsonplugin.DefaultMarshalerConfig).WithFieldMask(mask...) - m.MarshalProtoJSON(s) - b, err := s.Bytes() - if err != nil { - t.Fatalf("generated failed to marshal: %v", err) - } - return b -} - -func generatedUnmarshal(t *testing.T, msg proto.Message, data []byte) []string { - t.Helper() - unmarshaler, ok := msg.(jsonplugin.Unmarshaler) - if !ok { - t.Fatalf("message %T does not implement the jsonplugin.Unmarshaler", msg) - } - s := jsonplugin.NewUnmarshalState(data, jsonplugin.DefaultUnmarshalerConfig) - unmarshaler.UnmarshalProtoJSON(s) - if err := s.Err(); err != nil { - t.Fatalf("generated failed to unmarshal: %v", err) - } - paths := s.FieldMask().GetPaths() - if len(paths) == 0 { - return nil - } - return paths -} - -func indent(t *testing.T, data []byte) string { - t.Helper() - var buf bytes.Buffer - if err := json.Indent(&buf, data, "", " "); err != nil { - t.Fatalf("failed to indent %s: %v", string(data), err) - } - return buf.String() -} - -func expectMarshalEqual(t *testing.T, msg proto.Message, mask []string, expected []byte) { - t.Helper() - - expectedFormatted := indent(t, expected) - - gogoMarshaled := gogoMarshal(t, msg) - - generatedMarshaled := generatedMarshal(t, msg, mask) - generatedFormatted := indent(t, generatedMarshaled) - generatedDiff := cmp.Diff(expectedFormatted, generatedFormatted) - - if generatedDiff != "" { - t.Errorf("expected : %s", string(expected)) - t.Errorf("gogo : %s", string(gogoMarshaled)) - t.Errorf("generated: %s", string(generatedMarshaled)) - if generatedDiff != "" { - t.Errorf(" diff : %s", generatedDiff) - } - } -} - -func expectUnmarshalEqual(t *testing.T, msg proto.Message, expected []byte, expectedMask []string) { - t.Helper() - if msg == nil { - return - } - - expectedMsgText := proto.MarshalTextString(msg) - - gogoUnmarshaled := reflect.New(reflect.ValueOf(msg).Elem().Type()).Interface().(proto.Message) - gogoUnmarshal(t, gogoUnmarshaled, expected) - gogoMsgText := proto.MarshalTextString(gogoUnmarshaled) - - generatedUnmarshaled := reflect.New(reflect.ValueOf(msg).Elem().Type()).Interface().(proto.Message) - mask := generatedUnmarshal(t, generatedUnmarshaled, expected) - generatedMsgText := proto.MarshalTextString(generatedUnmarshaled) - generatedDiff := cmp.Diff(expectedMsgText, generatedMsgText) - maskDiff := cmp.Diff(expectedMask, mask) - - if generatedDiff != "" { - t.Errorf("expected : %s", string(expectedMsgText)) - t.Errorf("gogo : %s", string(gogoMsgText)) - t.Errorf("generated: %s", string(generatedMsgText)) - if generatedDiff != "" { - t.Errorf(" diff : %s", generatedDiff) - } - } - - if maskDiff != "" { - t.Errorf("mask diff: %s", maskDiff) - } -} diff --git a/test/gogo/wkts.pb.go b/test/gogo/wkts.pb.go deleted file mode 100644 index 5d3cdd97..00000000 --- a/test/gogo/wkts.pb.go +++ /dev/null @@ -1,973 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: wkts.proto - -package test - -import ( - fmt "fmt" - _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" - proto "github.com/gogo/protobuf/proto" - types "github.com/gogo/protobuf/types" - 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 - -type MessageWithMarshaler struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithMarshaler) Reset() { *m = MessageWithMarshaler{} } -func (m *MessageWithMarshaler) String() string { return proto.CompactTextString(m) } -func (*MessageWithMarshaler) ProtoMessage() {} -func (*MessageWithMarshaler) Descriptor() ([]byte, []int) { - return fileDescriptor_4f76f3479ade79d3, []int{0} -} -func (m *MessageWithMarshaler) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithMarshaler.Unmarshal(m, b) -} -func (m *MessageWithMarshaler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithMarshaler.Marshal(b, m, deterministic) -} -func (m *MessageWithMarshaler) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithMarshaler.Merge(m, src) -} -func (m *MessageWithMarshaler) XXX_Size() int { - return xxx_messageInfo_MessageWithMarshaler.Size(m) -} -func (m *MessageWithMarshaler) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithMarshaler.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithMarshaler proto.InternalMessageInfo - -func (m *MessageWithMarshaler) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -type MessageWithoutMarshaler struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithoutMarshaler) Reset() { *m = MessageWithoutMarshaler{} } -func (m *MessageWithoutMarshaler) String() string { return proto.CompactTextString(m) } -func (*MessageWithoutMarshaler) ProtoMessage() {} -func (*MessageWithoutMarshaler) Descriptor() ([]byte, []int) { - return fileDescriptor_4f76f3479ade79d3, []int{1} -} -func (m *MessageWithoutMarshaler) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithoutMarshaler.Unmarshal(m, b) -} -func (m *MessageWithoutMarshaler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithoutMarshaler.Marshal(b, m, deterministic) -} -func (m *MessageWithoutMarshaler) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithoutMarshaler.Merge(m, src) -} -func (m *MessageWithoutMarshaler) XXX_Size() int { - return xxx_messageInfo_MessageWithoutMarshaler.Size(m) -} -func (m *MessageWithoutMarshaler) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithoutMarshaler.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithoutMarshaler proto.InternalMessageInfo - -func (m *MessageWithoutMarshaler) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -type MessageWithWKTs struct { - DoubleValue *types.DoubleValue `protobuf:"bytes,1,opt,name=double_value,json=doubleValue,proto3" json:"double_value,omitempty"` - DoubleValues []*types.DoubleValue `protobuf:"bytes,2,rep,name=double_values,json=doubleValues,proto3" json:"double_values,omitempty"` - FloatValue *types.FloatValue `protobuf:"bytes,3,opt,name=float_value,json=floatValue,proto3" json:"float_value,omitempty"` - FloatValues []*types.FloatValue `protobuf:"bytes,4,rep,name=float_values,json=floatValues,proto3" json:"float_values,omitempty"` - Int32Value *types.Int32Value `protobuf:"bytes,5,opt,name=int32_value,json=int32Value,proto3" json:"int32_value,omitempty"` - Int32Values []*types.Int32Value `protobuf:"bytes,6,rep,name=int32_values,json=int32Values,proto3" json:"int32_values,omitempty"` - Int64Value *types.Int64Value `protobuf:"bytes,7,opt,name=int64_value,json=int64Value,proto3" json:"int64_value,omitempty"` - Int64Values []*types.Int64Value `protobuf:"bytes,8,rep,name=int64_values,json=int64Values,proto3" json:"int64_values,omitempty"` - Uint32Value *types.UInt32Value `protobuf:"bytes,9,opt,name=uint32_value,json=uint32Value,proto3" json:"uint32_value,omitempty"` - Uint32Values []*types.UInt32Value `protobuf:"bytes,10,rep,name=uint32_values,json=uint32Values,proto3" json:"uint32_values,omitempty"` - Uint64Value *types.UInt64Value `protobuf:"bytes,11,opt,name=uint64_value,json=uint64Value,proto3" json:"uint64_value,omitempty"` - Uint64Values []*types.UInt64Value `protobuf:"bytes,12,rep,name=uint64_values,json=uint64Values,proto3" json:"uint64_values,omitempty"` - BoolValue *types.BoolValue `protobuf:"bytes,13,opt,name=bool_value,json=boolValue,proto3" json:"bool_value,omitempty"` - BoolValues []*types.BoolValue `protobuf:"bytes,14,rep,name=bool_values,json=boolValues,proto3" json:"bool_values,omitempty"` - StringValue *types.StringValue `protobuf:"bytes,15,opt,name=string_value,json=stringValue,proto3" json:"string_value,omitempty"` - StringValues []*types.StringValue `protobuf:"bytes,16,rep,name=string_values,json=stringValues,proto3" json:"string_values,omitempty"` - BytesValue *types.BytesValue `protobuf:"bytes,17,opt,name=bytes_value,json=bytesValue,proto3" json:"bytes_value,omitempty"` - BytesValues []*types.BytesValue `protobuf:"bytes,18,rep,name=bytes_values,json=bytesValues,proto3" json:"bytes_values,omitempty"` - EmptyValue *types.Empty `protobuf:"bytes,19,opt,name=empty_value,json=emptyValue,proto3" json:"empty_value,omitempty"` - EmptyValues []*types.Empty `protobuf:"bytes,20,rep,name=empty_values,json=emptyValues,proto3" json:"empty_values,omitempty"` - TimestampValue *types.Timestamp `protobuf:"bytes,21,opt,name=timestamp_value,json=timestampValue,proto3" json:"timestamp_value,omitempty"` - TimestampValues []*types.Timestamp `protobuf:"bytes,22,rep,name=timestamp_values,json=timestampValues,proto3" json:"timestamp_values,omitempty"` - DurationValue *types.Duration `protobuf:"bytes,23,opt,name=duration_value,json=durationValue,proto3" json:"duration_value,omitempty"` - DurationValues []*types.Duration `protobuf:"bytes,24,rep,name=duration_values,json=durationValues,proto3" json:"duration_values,omitempty"` - FieldMaskValue *types.FieldMask `protobuf:"bytes,25,opt,name=field_mask_value,json=fieldMaskValue,proto3" json:"field_mask_value,omitempty"` - FieldMaskValues []*types.FieldMask `protobuf:"bytes,26,rep,name=field_mask_values,json=fieldMaskValues,proto3" json:"field_mask_values,omitempty"` - ValueValue *types.Value `protobuf:"bytes,27,opt,name=value_value,json=valueValue,proto3" json:"value_value,omitempty"` - ValueValues []*types.Value `protobuf:"bytes,28,rep,name=value_values,json=valueValues,proto3" json:"value_values,omitempty"` - ListValueValue *types.ListValue `protobuf:"bytes,29,opt,name=list_value_value,json=listValueValue,proto3" json:"list_value_value,omitempty"` - ListValueValues []*types.ListValue `protobuf:"bytes,30,rep,name=list_value_values,json=listValueValues,proto3" json:"list_value_values,omitempty"` - StructValue *types.Struct `protobuf:"bytes,31,opt,name=struct_value,json=structValue,proto3" json:"struct_value,omitempty"` - StructValues []*types.Struct `protobuf:"bytes,32,rep,name=struct_values,json=structValues,proto3" json:"struct_values,omitempty"` - AnyValue *types.Any `protobuf:"bytes,33,opt,name=any_value,json=anyValue,proto3" json:"any_value,omitempty"` - AnyValues []*types.Any `protobuf:"bytes,34,rep,name=any_values,json=anyValues,proto3" json:"any_values,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithWKTs) Reset() { *m = MessageWithWKTs{} } -func (m *MessageWithWKTs) String() string { return proto.CompactTextString(m) } -func (*MessageWithWKTs) ProtoMessage() {} -func (*MessageWithWKTs) Descriptor() ([]byte, []int) { - return fileDescriptor_4f76f3479ade79d3, []int{2} -} -func (m *MessageWithWKTs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithWKTs.Unmarshal(m, b) -} -func (m *MessageWithWKTs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithWKTs.Marshal(b, m, deterministic) -} -func (m *MessageWithWKTs) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithWKTs.Merge(m, src) -} -func (m *MessageWithWKTs) XXX_Size() int { - return xxx_messageInfo_MessageWithWKTs.Size(m) -} -func (m *MessageWithWKTs) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithWKTs.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithWKTs proto.InternalMessageInfo - -func (m *MessageWithWKTs) GetDoubleValue() *types.DoubleValue { - if m != nil { - return m.DoubleValue - } - return nil -} - -func (m *MessageWithWKTs) GetDoubleValues() []*types.DoubleValue { - if m != nil { - return m.DoubleValues - } - return nil -} - -func (m *MessageWithWKTs) GetFloatValue() *types.FloatValue { - if m != nil { - return m.FloatValue - } - return nil -} - -func (m *MessageWithWKTs) GetFloatValues() []*types.FloatValue { - if m != nil { - return m.FloatValues - } - return nil -} - -func (m *MessageWithWKTs) GetInt32Value() *types.Int32Value { - if m != nil { - return m.Int32Value - } - return nil -} - -func (m *MessageWithWKTs) GetInt32Values() []*types.Int32Value { - if m != nil { - return m.Int32Values - } - return nil -} - -func (m *MessageWithWKTs) GetInt64Value() *types.Int64Value { - if m != nil { - return m.Int64Value - } - return nil -} - -func (m *MessageWithWKTs) GetInt64Values() []*types.Int64Value { - if m != nil { - return m.Int64Values - } - return nil -} - -func (m *MessageWithWKTs) GetUint32Value() *types.UInt32Value { - if m != nil { - return m.Uint32Value - } - return nil -} - -func (m *MessageWithWKTs) GetUint32Values() []*types.UInt32Value { - if m != nil { - return m.Uint32Values - } - return nil -} - -func (m *MessageWithWKTs) GetUint64Value() *types.UInt64Value { - if m != nil { - return m.Uint64Value - } - return nil -} - -func (m *MessageWithWKTs) GetUint64Values() []*types.UInt64Value { - if m != nil { - return m.Uint64Values - } - return nil -} - -func (m *MessageWithWKTs) GetBoolValue() *types.BoolValue { - if m != nil { - return m.BoolValue - } - return nil -} - -func (m *MessageWithWKTs) GetBoolValues() []*types.BoolValue { - if m != nil { - return m.BoolValues - } - return nil -} - -func (m *MessageWithWKTs) GetStringValue() *types.StringValue { - if m != nil { - return m.StringValue - } - return nil -} - -func (m *MessageWithWKTs) GetStringValues() []*types.StringValue { - if m != nil { - return m.StringValues - } - return nil -} - -func (m *MessageWithWKTs) GetBytesValue() *types.BytesValue { - if m != nil { - return m.BytesValue - } - return nil -} - -func (m *MessageWithWKTs) GetBytesValues() []*types.BytesValue { - if m != nil { - return m.BytesValues - } - return nil -} - -func (m *MessageWithWKTs) GetEmptyValue() *types.Empty { - if m != nil { - return m.EmptyValue - } - return nil -} - -func (m *MessageWithWKTs) GetEmptyValues() []*types.Empty { - if m != nil { - return m.EmptyValues - } - return nil -} - -func (m *MessageWithWKTs) GetTimestampValue() *types.Timestamp { - if m != nil { - return m.TimestampValue - } - return nil -} - -func (m *MessageWithWKTs) GetTimestampValues() []*types.Timestamp { - if m != nil { - return m.TimestampValues - } - return nil -} - -func (m *MessageWithWKTs) GetDurationValue() *types.Duration { - if m != nil { - return m.DurationValue - } - return nil -} - -func (m *MessageWithWKTs) GetDurationValues() []*types.Duration { - if m != nil { - return m.DurationValues - } - return nil -} - -func (m *MessageWithWKTs) GetFieldMaskValue() *types.FieldMask { - if m != nil { - return m.FieldMaskValue - } - return nil -} - -func (m *MessageWithWKTs) GetFieldMaskValues() []*types.FieldMask { - if m != nil { - return m.FieldMaskValues - } - return nil -} - -func (m *MessageWithWKTs) GetValueValue() *types.Value { - if m != nil { - return m.ValueValue - } - return nil -} - -func (m *MessageWithWKTs) GetValueValues() []*types.Value { - if m != nil { - return m.ValueValues - } - return nil -} - -func (m *MessageWithWKTs) GetListValueValue() *types.ListValue { - if m != nil { - return m.ListValueValue - } - return nil -} - -func (m *MessageWithWKTs) GetListValueValues() []*types.ListValue { - if m != nil { - return m.ListValueValues - } - return nil -} - -func (m *MessageWithWKTs) GetStructValue() *types.Struct { - if m != nil { - return m.StructValue - } - return nil -} - -func (m *MessageWithWKTs) GetStructValues() []*types.Struct { - if m != nil { - return m.StructValues - } - return nil -} - -func (m *MessageWithWKTs) GetAnyValue() *types.Any { - if m != nil { - return m.AnyValue - } - return nil -} - -func (m *MessageWithWKTs) GetAnyValues() []*types.Any { - if m != nil { - return m.AnyValues - } - return nil -} - -type MessageWithOneofWKTs struct { - // Types that are valid to be assigned to Value: - // - // *MessageWithOneofWKTs_DoubleValue - // *MessageWithOneofWKTs_FloatValue - // *MessageWithOneofWKTs_Int32Value - // *MessageWithOneofWKTs_Int64Value - // *MessageWithOneofWKTs_Uint32Value - // *MessageWithOneofWKTs_Uint64Value - // *MessageWithOneofWKTs_BoolValue - // *MessageWithOneofWKTs_StringValue - // *MessageWithOneofWKTs_BytesValue - // *MessageWithOneofWKTs_EmptyValue - // *MessageWithOneofWKTs_TimestampValue - // *MessageWithOneofWKTs_DurationValue - // *MessageWithOneofWKTs_FieldMaskValue - // *MessageWithOneofWKTs_ValueValue - // *MessageWithOneofWKTs_ListValueValue - // *MessageWithOneofWKTs_StructValue - // *MessageWithOneofWKTs_AnyValue - Value isMessageWithOneofWKTs_Value `protobuf_oneof:"value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithOneofWKTs) Reset() { *m = MessageWithOneofWKTs{} } -func (m *MessageWithOneofWKTs) String() string { return proto.CompactTextString(m) } -func (*MessageWithOneofWKTs) ProtoMessage() {} -func (*MessageWithOneofWKTs) Descriptor() ([]byte, []int) { - return fileDescriptor_4f76f3479ade79d3, []int{3} -} -func (m *MessageWithOneofWKTs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithOneofWKTs.Unmarshal(m, b) -} -func (m *MessageWithOneofWKTs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithOneofWKTs.Marshal(b, m, deterministic) -} -func (m *MessageWithOneofWKTs) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithOneofWKTs.Merge(m, src) -} -func (m *MessageWithOneofWKTs) XXX_Size() int { - return xxx_messageInfo_MessageWithOneofWKTs.Size(m) -} -func (m *MessageWithOneofWKTs) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithOneofWKTs.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithOneofWKTs proto.InternalMessageInfo - -type isMessageWithOneofWKTs_Value interface { - isMessageWithOneofWKTs_Value() -} - -type MessageWithOneofWKTs_DoubleValue struct { - DoubleValue *types.DoubleValue `protobuf:"bytes,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` -} -type MessageWithOneofWKTs_FloatValue struct { - FloatValue *types.FloatValue `protobuf:"bytes,2,opt,name=float_value,json=floatValue,proto3,oneof" json:"float_value,omitempty"` -} -type MessageWithOneofWKTs_Int32Value struct { - Int32Value *types.Int32Value `protobuf:"bytes,3,opt,name=int32_value,json=int32Value,proto3,oneof" json:"int32_value,omitempty"` -} -type MessageWithOneofWKTs_Int64Value struct { - Int64Value *types.Int64Value `protobuf:"bytes,4,opt,name=int64_value,json=int64Value,proto3,oneof" json:"int64_value,omitempty"` -} -type MessageWithOneofWKTs_Uint32Value struct { - Uint32Value *types.UInt32Value `protobuf:"bytes,5,opt,name=uint32_value,json=uint32Value,proto3,oneof" json:"uint32_value,omitempty"` -} -type MessageWithOneofWKTs_Uint64Value struct { - Uint64Value *types.UInt64Value `protobuf:"bytes,6,opt,name=uint64_value,json=uint64Value,proto3,oneof" json:"uint64_value,omitempty"` -} -type MessageWithOneofWKTs_BoolValue struct { - BoolValue *types.BoolValue `protobuf:"bytes,7,opt,name=bool_value,json=boolValue,proto3,oneof" json:"bool_value,omitempty"` -} -type MessageWithOneofWKTs_StringValue struct { - StringValue *types.StringValue `protobuf:"bytes,8,opt,name=string_value,json=stringValue,proto3,oneof" json:"string_value,omitempty"` -} -type MessageWithOneofWKTs_BytesValue struct { - BytesValue *types.BytesValue `protobuf:"bytes,9,opt,name=bytes_value,json=bytesValue,proto3,oneof" json:"bytes_value,omitempty"` -} -type MessageWithOneofWKTs_EmptyValue struct { - EmptyValue *types.Empty `protobuf:"bytes,10,opt,name=empty_value,json=emptyValue,proto3,oneof" json:"empty_value,omitempty"` -} -type MessageWithOneofWKTs_TimestampValue struct { - TimestampValue *types.Timestamp `protobuf:"bytes,11,opt,name=timestamp_value,json=timestampValue,proto3,oneof" json:"timestamp_value,omitempty"` -} -type MessageWithOneofWKTs_DurationValue struct { - DurationValue *types.Duration `protobuf:"bytes,12,opt,name=duration_value,json=durationValue,proto3,oneof" json:"duration_value,omitempty"` -} -type MessageWithOneofWKTs_FieldMaskValue struct { - FieldMaskValue *types.FieldMask `protobuf:"bytes,13,opt,name=field_mask_value,json=fieldMaskValue,proto3,oneof" json:"field_mask_value,omitempty"` -} -type MessageWithOneofWKTs_ValueValue struct { - ValueValue *types.Value `protobuf:"bytes,14,opt,name=value_value,json=valueValue,proto3,oneof" json:"value_value,omitempty"` -} -type MessageWithOneofWKTs_ListValueValue struct { - ListValueValue *types.ListValue `protobuf:"bytes,15,opt,name=list_value_value,json=listValueValue,proto3,oneof" json:"list_value_value,omitempty"` -} -type MessageWithOneofWKTs_StructValue struct { - StructValue *types.Struct `protobuf:"bytes,16,opt,name=struct_value,json=structValue,proto3,oneof" json:"struct_value,omitempty"` -} -type MessageWithOneofWKTs_AnyValue struct { - AnyValue *types.Any `protobuf:"bytes,17,opt,name=any_value,json=anyValue,proto3,oneof" json:"any_value,omitempty"` -} - -func (*MessageWithOneofWKTs_DoubleValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_FloatValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_Int32Value) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_Int64Value) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_Uint32Value) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_Uint64Value) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_BoolValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_StringValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_BytesValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_EmptyValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_TimestampValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_DurationValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_FieldMaskValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_ValueValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_ListValueValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_StructValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_AnyValue) isMessageWithOneofWKTs_Value() {} - -func (m *MessageWithOneofWKTs) GetValue() isMessageWithOneofWKTs_Value { - if m != nil { - return m.Value - } - return nil -} - -func (m *MessageWithOneofWKTs) GetDoubleValue() *types.DoubleValue { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_DoubleValue); ok { - return x.DoubleValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetFloatValue() *types.FloatValue { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_FloatValue); ok { - return x.FloatValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetInt32Value() *types.Int32Value { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_Int32Value); ok { - return x.Int32Value - } - return nil -} - -func (m *MessageWithOneofWKTs) GetInt64Value() *types.Int64Value { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_Int64Value); ok { - return x.Int64Value - } - return nil -} - -func (m *MessageWithOneofWKTs) GetUint32Value() *types.UInt32Value { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_Uint32Value); ok { - return x.Uint32Value - } - return nil -} - -func (m *MessageWithOneofWKTs) GetUint64Value() *types.UInt64Value { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_Uint64Value); ok { - return x.Uint64Value - } - return nil -} - -func (m *MessageWithOneofWKTs) GetBoolValue() *types.BoolValue { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_BoolValue); ok { - return x.BoolValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetStringValue() *types.StringValue { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_StringValue); ok { - return x.StringValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetBytesValue() *types.BytesValue { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_BytesValue); ok { - return x.BytesValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetEmptyValue() *types.Empty { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_EmptyValue); ok { - return x.EmptyValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetTimestampValue() *types.Timestamp { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_TimestampValue); ok { - return x.TimestampValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetDurationValue() *types.Duration { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_DurationValue); ok { - return x.DurationValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetFieldMaskValue() *types.FieldMask { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_FieldMaskValue); ok { - return x.FieldMaskValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetValueValue() *types.Value { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_ValueValue); ok { - return x.ValueValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetListValueValue() *types.ListValue { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_ListValueValue); ok { - return x.ListValueValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetStructValue() *types.Struct { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_StructValue); ok { - return x.StructValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetAnyValue() *types.Any { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_AnyValue); ok { - return x.AnyValue - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*MessageWithOneofWKTs) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*MessageWithOneofWKTs_DoubleValue)(nil), - (*MessageWithOneofWKTs_FloatValue)(nil), - (*MessageWithOneofWKTs_Int32Value)(nil), - (*MessageWithOneofWKTs_Int64Value)(nil), - (*MessageWithOneofWKTs_Uint32Value)(nil), - (*MessageWithOneofWKTs_Uint64Value)(nil), - (*MessageWithOneofWKTs_BoolValue)(nil), - (*MessageWithOneofWKTs_StringValue)(nil), - (*MessageWithOneofWKTs_BytesValue)(nil), - (*MessageWithOneofWKTs_EmptyValue)(nil), - (*MessageWithOneofWKTs_TimestampValue)(nil), - (*MessageWithOneofWKTs_DurationValue)(nil), - (*MessageWithOneofWKTs_FieldMaskValue)(nil), - (*MessageWithOneofWKTs_ValueValue)(nil), - (*MessageWithOneofWKTs_ListValueValue)(nil), - (*MessageWithOneofWKTs_StructValue)(nil), - (*MessageWithOneofWKTs_AnyValue)(nil), - } -} - -type MessageWithWKTMaps struct { - StringDoubleMap map[string]*types.DoubleValue `protobuf:"bytes,1,rep,name=string_double_map,json=stringDoubleMap,proto3" json:"string_double_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringFloatMap map[string]*types.FloatValue `protobuf:"bytes,2,rep,name=string_float_map,json=stringFloatMap,proto3" json:"string_float_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringInt32Map map[string]*types.Int32Value `protobuf:"bytes,3,rep,name=string_int32_map,json=stringInt32Map,proto3" json:"string_int32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringInt64Map map[string]*types.Int64Value `protobuf:"bytes,4,rep,name=string_int64_map,json=stringInt64Map,proto3" json:"string_int64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringUint32Map map[string]*types.UInt32Value `protobuf:"bytes,5,rep,name=string_uint32_map,json=stringUint32Map,proto3" json:"string_uint32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringUint64Map map[string]*types.UInt64Value `protobuf:"bytes,6,rep,name=string_uint64_map,json=stringUint64Map,proto3" json:"string_uint64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringBoolMap map[string]*types.BoolValue `protobuf:"bytes,7,rep,name=string_bool_map,json=stringBoolMap,proto3" json:"string_bool_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringStringMap map[string]*types.StringValue `protobuf:"bytes,8,rep,name=string_string_map,json=stringStringMap,proto3" json:"string_string_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringBytesMap map[string]*types.BytesValue `protobuf:"bytes,9,rep,name=string_bytes_map,json=stringBytesMap,proto3" json:"string_bytes_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringEmptyMap map[string]*types.Empty `protobuf:"bytes,10,rep,name=string_empty_map,json=stringEmptyMap,proto3" json:"string_empty_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringTimestampMap map[string]*types.Timestamp `protobuf:"bytes,11,rep,name=string_timestamp_map,json=stringTimestampMap,proto3" json:"string_timestamp_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringDurationMap map[string]*types.Duration `protobuf:"bytes,12,rep,name=string_duration_map,json=stringDurationMap,proto3" json:"string_duration_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringFieldMaskMap map[string]*types.FieldMask `protobuf:"bytes,13,rep,name=string_field_mask_map,json=stringFieldMaskMap,proto3" json:"string_field_mask_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringValueMap map[string]*types.Value `protobuf:"bytes,14,rep,name=string_value_map,json=stringValueMap,proto3" json:"string_value_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringListValueMap map[string]*types.ListValue `protobuf:"bytes,15,rep,name=string_list_value_map,json=stringListValueMap,proto3" json:"string_list_value_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringStructMap map[string]*types.Struct `protobuf:"bytes,16,rep,name=string_struct_map,json=stringStructMap,proto3" json:"string_struct_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringAnyMap map[string]*types.Any `protobuf:"bytes,17,rep,name=string_any_map,json=stringAnyMap,proto3" json:"string_any_map,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 *MessageWithWKTMaps) Reset() { *m = MessageWithWKTMaps{} } -func (m *MessageWithWKTMaps) String() string { return proto.CompactTextString(m) } -func (*MessageWithWKTMaps) ProtoMessage() {} -func (*MessageWithWKTMaps) Descriptor() ([]byte, []int) { - return fileDescriptor_4f76f3479ade79d3, []int{4} -} -func (m *MessageWithWKTMaps) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithWKTMaps.Unmarshal(m, b) -} -func (m *MessageWithWKTMaps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithWKTMaps.Marshal(b, m, deterministic) -} -func (m *MessageWithWKTMaps) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithWKTMaps.Merge(m, src) -} -func (m *MessageWithWKTMaps) XXX_Size() int { - return xxx_messageInfo_MessageWithWKTMaps.Size(m) -} -func (m *MessageWithWKTMaps) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithWKTMaps.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithWKTMaps proto.InternalMessageInfo - -func (m *MessageWithWKTMaps) GetStringDoubleMap() map[string]*types.DoubleValue { - if m != nil { - return m.StringDoubleMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringFloatMap() map[string]*types.FloatValue { - if m != nil { - return m.StringFloatMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringInt32Map() map[string]*types.Int32Value { - if m != nil { - return m.StringInt32Map - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringInt64Map() map[string]*types.Int64Value { - if m != nil { - return m.StringInt64Map - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringUint32Map() map[string]*types.UInt32Value { - if m != nil { - return m.StringUint32Map - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringUint64Map() map[string]*types.UInt64Value { - if m != nil { - return m.StringUint64Map - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringBoolMap() map[string]*types.BoolValue { - if m != nil { - return m.StringBoolMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringStringMap() map[string]*types.StringValue { - if m != nil { - return m.StringStringMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringBytesMap() map[string]*types.BytesValue { - if m != nil { - return m.StringBytesMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringEmptyMap() map[string]*types.Empty { - if m != nil { - return m.StringEmptyMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringTimestampMap() map[string]*types.Timestamp { - if m != nil { - return m.StringTimestampMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringDurationMap() map[string]*types.Duration { - if m != nil { - return m.StringDurationMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringFieldMaskMap() map[string]*types.FieldMask { - if m != nil { - return m.StringFieldMaskMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringValueMap() map[string]*types.Value { - if m != nil { - return m.StringValueMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringListValueMap() map[string]*types.ListValue { - if m != nil { - return m.StringListValueMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringStructMap() map[string]*types.Struct { - if m != nil { - return m.StringStructMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringAnyMap() map[string]*types.Any { - if m != nil { - return m.StringAnyMap - } - return nil -} - -func init() { - proto.RegisterType((*MessageWithMarshaler)(nil), "thethings.json.test.MessageWithMarshaler") - proto.RegisterType((*MessageWithoutMarshaler)(nil), "thethings.json.test.MessageWithoutMarshaler") - proto.RegisterType((*MessageWithWKTs)(nil), "thethings.json.test.MessageWithWKTs") - proto.RegisterType((*MessageWithOneofWKTs)(nil), "thethings.json.test.MessageWithOneofWKTs") - proto.RegisterType((*MessageWithWKTMaps)(nil), "thethings.json.test.MessageWithWKTMaps") - proto.RegisterMapType((map[string]*types.Any)(nil), "thethings.json.test.MessageWithWKTMaps.StringAnyMapEntry") - proto.RegisterMapType((map[string]*types.BoolValue)(nil), "thethings.json.test.MessageWithWKTMaps.StringBoolMapEntry") - proto.RegisterMapType((map[string]*types.BytesValue)(nil), "thethings.json.test.MessageWithWKTMaps.StringBytesMapEntry") - proto.RegisterMapType((map[string]*types.DoubleValue)(nil), "thethings.json.test.MessageWithWKTMaps.StringDoubleMapEntry") - proto.RegisterMapType((map[string]*types.Duration)(nil), "thethings.json.test.MessageWithWKTMaps.StringDurationMapEntry") - proto.RegisterMapType((map[string]*types.Empty)(nil), "thethings.json.test.MessageWithWKTMaps.StringEmptyMapEntry") - proto.RegisterMapType((map[string]*types.FieldMask)(nil), "thethings.json.test.MessageWithWKTMaps.StringFieldMaskMapEntry") - proto.RegisterMapType((map[string]*types.FloatValue)(nil), "thethings.json.test.MessageWithWKTMaps.StringFloatMapEntry") - proto.RegisterMapType((map[string]*types.Int32Value)(nil), "thethings.json.test.MessageWithWKTMaps.StringInt32MapEntry") - proto.RegisterMapType((map[string]*types.Int64Value)(nil), "thethings.json.test.MessageWithWKTMaps.StringInt64MapEntry") - proto.RegisterMapType((map[string]*types.ListValue)(nil), "thethings.json.test.MessageWithWKTMaps.StringListValueMapEntry") - proto.RegisterMapType((map[string]*types.StringValue)(nil), "thethings.json.test.MessageWithWKTMaps.StringStringMapEntry") - proto.RegisterMapType((map[string]*types.Struct)(nil), "thethings.json.test.MessageWithWKTMaps.StringStructMapEntry") - proto.RegisterMapType((map[string]*types.Timestamp)(nil), "thethings.json.test.MessageWithWKTMaps.StringTimestampMapEntry") - proto.RegisterMapType((map[string]*types.UInt32Value)(nil), "thethings.json.test.MessageWithWKTMaps.StringUint32MapEntry") - proto.RegisterMapType((map[string]*types.UInt64Value)(nil), "thethings.json.test.MessageWithWKTMaps.StringUint64MapEntry") - proto.RegisterMapType((map[string]*types.Value)(nil), "thethings.json.test.MessageWithWKTMaps.StringValueMapEntry") -} - -func init() { proto.RegisterFile("wkts.proto", fileDescriptor_4f76f3479ade79d3) } - -var fileDescriptor_4f76f3479ade79d3 = []byte{ - // 1630 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x59, 0xed, 0x52, 0xdb, 0x46, - 0x17, 0x36, 0xe1, 0xcb, 0x5e, 0x19, 0x7f, 0x08, 0x12, 0x84, 0x93, 0x37, 0xe1, 0xe5, 0xd7, 0x3b, - 0xef, 0x14, 0x93, 0x04, 0x86, 0x16, 0x42, 0x49, 0xa0, 0x81, 0x21, 0xd3, 0x32, 0x9d, 0x71, 0xa1, - 0x99, 0x7e, 0x4c, 0xa9, 0x6c, 0x84, 0xed, 0x62, 0x4b, 0xae, 0x57, 0x4a, 0x86, 0x4b, 0xe8, 0xad, - 0xf4, 0xd2, 0x3a, 0xbd, 0x82, 0xfe, 0xea, 0xec, 0xea, 0xac, 0xf6, 0xac, 0xa4, 0x95, 0x82, 0xfe, - 0x24, 0xf2, 0xee, 0x3e, 0xe7, 0x39, 0x67, 0x77, 0xf5, 0x3c, 0xab, 0x85, 0x90, 0x8f, 0xb7, 0x3e, - 0x6d, 0x4f, 0xa6, 0x9e, 0xef, 0x99, 0xcb, 0xfe, 0xc0, 0xf1, 0x07, 0x43, 0xb7, 0x4f, 0xdb, 0xbf, - 0x51, 0xcf, 0x6d, 0xfb, 0x0e, 0xf5, 0x5b, 0x4d, 0xdb, 0x75, 0x3d, 0xdf, 0xf6, 0x87, 0x9e, 0x0b, - 0xe3, 0x5a, 0x6b, 0x7d, 0xcf, 0xeb, 0x8f, 0x9c, 0x2d, 0xfe, 0xab, 0x1b, 0xdc, 0x6c, 0xd9, 0xee, - 0x1d, 0x74, 0x3d, 0x8d, 0x77, 0x5d, 0x07, 0x53, 0x8e, 0x85, 0xfe, 0xc7, 0xf1, 0x7e, 0x67, 0x3c, - 0xf1, 0x05, 0x78, 0x3d, 0xde, 0x79, 0x33, 0x74, 0x46, 0xd7, 0x57, 0x63, 0x9b, 0xde, 0xc2, 0x88, - 0x27, 0xf1, 0x11, 0xd4, 0x9f, 0x06, 0x3d, 0x1f, 0x7a, 0x9f, 0xc5, 0x7b, 0xfd, 0xe1, 0xd8, 0xa1, - 0xbe, 0x3d, 0x9e, 0xe8, 0xb2, 0xfb, 0x38, 0xb5, 0x27, 0x13, 0x67, 0x0a, 0x85, 0x6d, 0x3c, 0x27, - 0x2b, 0xe7, 0x0e, 0xa5, 0x76, 0xdf, 0x79, 0x3f, 0xf4, 0x07, 0xe7, 0xf6, 0x94, 0x0e, 0xec, 0x91, - 0x33, 0x35, 0x2d, 0xb2, 0x38, 0x0e, 0xdb, 0xad, 0x99, 0xf5, 0x99, 0xff, 0x55, 0x3a, 0xe2, 0xe7, - 0xc6, 0x97, 0x64, 0x15, 0x21, 0xbc, 0xc0, 0xff, 0x04, 0xd0, 0x7e, 0xf9, 0xaf, 0x3f, 0xd7, 0xe6, - 0xca, 0xa5, 0x46, 0x69, 0xe3, 0x8f, 0x26, 0xa9, 0x23, 0xfc, 0xfb, 0xaf, 0x2f, 0xa8, 0xf9, 0x9a, - 0x54, 0xaf, 0xbd, 0xa0, 0x3b, 0x72, 0xae, 0x3e, 0xd8, 0xa3, 0x20, 0x04, 0x1b, 0x2f, 0x9f, 0xb4, - 0xc3, 0xdc, 0xdb, 0x22, 0xf7, 0xf6, 0x5b, 0x3e, 0xe8, 0x7b, 0x36, 0xa6, 0x63, 0x5c, 0xcb, 0x1f, - 0xe6, 0x11, 0x59, 0xc2, 0x01, 0xa8, 0xf5, 0x60, 0x7d, 0x36, 0x37, 0x42, 0x15, 0x45, 0xa0, 0xe6, - 0x01, 0x31, 0x6e, 0x46, 0x9e, 0xed, 0x43, 0x0a, 0xb3, 0x3c, 0x85, 0xc7, 0x89, 0x00, 0xa7, 0x6c, - 0x4c, 0x88, 0x27, 0x37, 0xd1, 0xb3, 0x79, 0x48, 0xaa, 0x08, 0x4d, 0xad, 0x39, 0xce, 0x9f, 0x09, - 0x37, 0x24, 0x9c, 0xb3, 0x0f, 0x5d, 0x7f, 0xfb, 0x25, 0xb0, 0xcf, 0x6b, 0xd8, 0xdf, 0xb1, 0x31, - 0xc0, 0x3e, 0x8c, 0x9e, 0x19, 0x3b, 0x42, 0x53, 0x6b, 0x41, 0xc3, 0x8e, 0xe0, 0x86, 0x84, 0x0b, - 0xf6, 0xdd, 0x1d, 0x60, 0x5f, 0xd4, 0xb3, 0xef, 0xee, 0x48, 0x76, 0x78, 0x06, 0x76, 0x81, 0xa6, - 0x56, 0x59, 0xcf, 0x2e, 0xe0, 0x86, 0x84, 0xf3, 0xd5, 0x0f, 0x70, 0xf1, 0x15, 0xcd, 0xea, 0x5f, - 0xe2, 0xf4, 0x03, 0x54, 0xfe, 0x11, 0x59, 0x0a, 0x94, 0xfa, 0x89, 0x66, 0xf5, 0x71, 0x84, 0x6a, - 0x80, 0x67, 0x00, 0x72, 0x88, 0xa6, 0xc0, 0xc8, 0xc8, 0x21, 0x2a, 0x22, 0x40, 0x93, 0x00, 0x39, - 0xc8, 0x59, 0xa8, 0x66, 0xe4, 0x20, 0x22, 0x54, 0x03, 0x3c, 0x0f, 0x7b, 0x84, 0x74, 0x3d, 0x6f, - 0x04, 0x19, 0x2c, 0xf1, 0x0c, 0x5a, 0x09, 0xfc, 0xb1, 0xe7, 0x8d, 0x42, 0x74, 0xa5, 0x2b, 0x1e, - 0xcd, 0x57, 0xc4, 0x90, 0x50, 0x6a, 0xd5, 0x38, 0x77, 0x16, 0x96, 0x44, 0x58, 0x5e, 0x3b, 0xf5, - 0xa7, 0x43, 0xb7, 0x0f, 0xcc, 0x75, 0x4d, 0xed, 0xdf, 0xf1, 0x41, 0x50, 0x3b, 0x95, 0x3f, 0x58, - 0xed, 0x38, 0x00, 0xb5, 0x1a, 0x9a, 0xda, 0x71, 0x84, 0x2a, 0x8a, 0xc0, 0x77, 0x60, 0xf7, 0xce, - 0x77, 0x28, 0xa4, 0xd0, 0xd4, 0xec, 0xc0, 0x63, 0x36, 0x46, 0x54, 0x10, 0x3d, 0xb3, 0x1d, 0x88, - 0xd0, 0xd4, 0x32, 0x35, 0x3b, 0x10, 0xc1, 0x0d, 0x09, 0xa7, 0xe6, 0xe7, 0xc4, 0xe0, 0xa2, 0x0c, - 0xec, 0xcb, 0x9c, 0xfd, 0x51, 0x02, 0x7e, 0xc2, 0xc6, 0x74, 0x08, 0x1f, 0x1a, 0x12, 0xef, 0x91, - 0x2a, 0x02, 0x52, 0x6b, 0x85, 0x13, 0xeb, 0x90, 0x86, 0x44, 0x52, 0xf3, 0x2b, 0x52, 0x8f, 0xb4, - 0x1a, 0x78, 0x1f, 0x6a, 0x96, 0xfc, 0x42, 0x8c, 0xeb, 0xd4, 0x22, 0x48, 0xc8, 0x7f, 0x42, 0x1a, - 0xb1, 0x20, 0xd4, 0x7a, 0xa4, 0x59, 0x7c, 0x19, 0xa5, 0xae, 0x46, 0xa1, 0xe6, 0x1b, 0x52, 0x13, - 0xa6, 0x05, 0xa9, 0xac, 0xf2, 0x54, 0xd6, 0x92, 0xfa, 0x09, 0xc3, 0x3a, 0x4b, 0x02, 0x10, 0x26, - 0x72, 0x4c, 0xea, 0x6a, 0x04, 0x6a, 0x59, 0x3c, 0x8f, 0x8c, 0x10, 0x35, 0x25, 0x04, 0x35, 0xdf, - 0x92, 0x86, 0x74, 0x3f, 0xc8, 0x63, 0x4d, 0x33, 0x25, 0xa7, 0x6c, 0xe0, 0xb9, 0x4d, 0x6f, 0x3b, - 0xb5, 0x1b, 0xf1, 0x18, 0x66, 0x72, 0x4a, 0x9a, 0xf1, 0x28, 0xd4, 0x6a, 0x69, 0xe6, 0x44, 0x86, - 0xa9, 0xab, 0x61, 0xf8, 0x9e, 0xe0, 0x60, 0x48, 0xe4, 0xb1, 0x66, 0x4f, 0xc0, 0x66, 0xe4, 0x83, - 0xa2, 0x3d, 0x81, 0x80, 0xd4, 0x7a, 0xa2, 0xd9, 0x13, 0xb0, 0x0f, 0x25, 0x92, 0xcf, 0xc0, 0x68, - 0x48, 0xc1, 0x44, 0x80, 0xf8, 0x3f, 0x9a, 0x19, 0xf8, 0x66, 0x48, 0xc1, 0x48, 0x6a, 0x23, 0xf1, - 0x18, 0xcd, 0x40, 0x3c, 0x0a, 0xb5, 0x9e, 0x6a, 0x66, 0x40, 0x86, 0xa9, 0xab, 0x61, 0xa8, 0xb9, - 0xcf, 0x75, 0x21, 0xe8, 0x09, 0x4b, 0x7c, 0xc6, 0x33, 0x59, 0x4d, 0x7b, 0xab, 0x83, 0x9e, 0xcf, - 0x25, 0x21, 0xe8, 0x81, 0x1f, 0x1e, 0x70, 0x49, 0x88, 0xb0, 0xd4, 0x5a, 0xe7, 0xfc, 0x5a, 0x70, - 0x15, 0x81, 0xa9, 0xf9, 0x82, 0x54, 0x6c, 0x57, 0xbc, 0x8d, 0xff, 0xe5, 0xb4, 0x2b, 0x09, 0xe4, - 0x91, 0x7b, 0xd7, 0x29, 0xdb, 0x2e, 0xbc, 0x89, 0xdb, 0x84, 0x44, 0x10, 0x6a, 0x6d, 0x70, 0xb6, - 0x74, 0x4c, 0x45, 0x60, 0xe8, 0xc6, 0xdf, 0x65, 0xe5, 0xf4, 0xf3, 0xad, 0xeb, 0x78, 0x37, 0xfc, - 0x40, 0x72, 0x74, 0xff, 0x03, 0xc9, 0x59, 0x49, 0x3d, 0x92, 0x1c, 0xaa, 0xe7, 0x89, 0x07, 0xb9, - 0xe7, 0x89, 0xb3, 0x52, 0xec, 0x44, 0xa1, 0x9c, 0x08, 0x66, 0x73, 0x4f, 0x04, 0x0c, 0xaf, 0x9c, - 0x09, 0x14, 0x4f, 0x9f, 0xcb, 0xf5, 0x74, 0xc0, 0x4b, 0x43, 0x53, 0x5d, 0x79, 0x3e, 0xdf, 0x95, - 0xd9, 0x14, 0xa8, 0xbe, 0xac, 0x9a, 0xea, 0x42, 0xbe, 0xa9, 0x8a, 0x10, 0x22, 0x8b, 0x57, 0x8a, - 0x27, 0x2e, 0xe6, 0x79, 0xe2, 0x59, 0x09, 0xbb, 0xe2, 0x51, 0xcc, 0xd8, 0xca, 0xf9, 0xc6, 0xc6, - 0xf8, 0xb1, 0xb5, 0x1d, 0xaa, 0xbe, 0x54, 0xc9, 0xf5, 0x25, 0x36, 0x8b, 0xc8, 0x99, 0xf6, 0x54, - 0x67, 0x21, 0x59, 0xce, 0xc2, 0xa0, 0xc8, 0x5b, 0x4e, 0x92, 0x06, 0x61, 0xe4, 0x19, 0xc4, 0x59, - 0x29, 0x61, 0x11, 0xc7, 0x09, 0x6d, 0xaf, 0xe6, 0x68, 0xfb, 0x59, 0x29, 0xae, 0xee, 0xa7, 0x29, - 0xca, 0xbc, 0x94, 0xa7, 0xcc, 0x2c, 0x97, 0x98, 0x36, 0xef, 0xa9, 0x9a, 0x5a, 0xcb, 0xd2, 0x54, - 0x36, 0x1b, 0x1f, 0xb0, 0xa8, 0x25, 0xa5, 0xb1, 0x9e, 0x27, 0x8d, 0x2c, 0x85, 0x98, 0x38, 0x1e, - 0xc4, 0x44, 0xad, 0x91, 0x29, 0x6a, 0xb0, 0x1d, 0x22, 0x59, 0xdb, 0xc6, 0xc2, 0xd4, 0xd4, 0x0b, - 0xd3, 0x59, 0x49, 0x4a, 0xd3, 0xf1, 0x22, 0x99, 0xe7, 0x80, 0x8d, 0x7f, 0x5a, 0xc4, 0x54, 0x3f, - 0x7d, 0xce, 0xed, 0x09, 0x35, 0x07, 0xa4, 0x09, 0xdb, 0x14, 0x34, 0x67, 0x6c, 0x4f, 0xac, 0x19, - 0xae, 0x60, 0x07, 0xed, 0x94, 0xef, 0xd3, 0x76, 0x32, 0x06, 0x6c, 0xe1, 0x50, 0x8e, 0xce, 0xed, - 0xc9, 0x89, 0xeb, 0x4f, 0xef, 0x3a, 0x75, 0xaa, 0xb6, 0x9a, 0x0e, 0x69, 0x00, 0x53, 0x28, 0x4d, - 0x8c, 0x28, 0xfc, 0x52, 0x7a, 0x75, 0x3f, 0x22, 0xae, 0x5a, 0x11, 0x4f, 0x8d, 0x2a, 0x8d, 0x88, - 0x26, 0x14, 0x10, 0x46, 0x33, 0x5b, 0x84, 0x86, 0x4b, 0x4b, 0x9c, 0x46, 0x34, 0xaa, 0x34, 0xbb, - 0x3b, 0x9c, 0x66, 0xae, 0x20, 0xcd, 0xee, 0x4e, 0x0a, 0x0d, 0x6f, 0x44, 0xcb, 0x13, 0xc8, 0x72, - 0xe6, 0x8b, 0x2c, 0xcf, 0xe5, 0x50, 0xa9, 0x07, 0x96, 0x27, 0x6a, 0x8d, 0x31, 0x41, 0x45, 0x0b, - 0x45, 0x99, 0x50, 0x49, 0x88, 0x29, 0xac, 0xa9, 0x4b, 0xa0, 0xe9, 0x8a, 0xab, 0x2b, 0xe3, 0x59, - 0xe4, 0x3c, 0xfb, 0xf7, 0xe3, 0x61, 0xc2, 0x1b, 0xb1, 0xc0, 0x47, 0x00, 0xb4, 0xa1, 0x6a, 0xe0, - 0x3f, 0xc6, 0x52, 0x2e, 0x52, 0x4d, 0xf8, 0x6f, 0xbc, 0x9a, 0xa8, 0x15, 0x6d, 0x84, 0x50, 0xab, - 0x19, 0x51, 0xa5, 0xc8, 0x46, 0xe0, 0x32, 0x1e, 0xdf, 0x08, 0xa2, 0x11, 0xd1, 0x84, 0x92, 0xce, - 0x68, 0x48, 0x11, 0x1a, 0xae, 0xf6, 0x71, 0x1a, 0xd1, 0x68, 0xfe, 0x4e, 0x56, 0x80, 0x46, 0xca, - 0x3f, 0xa3, 0x32, 0x38, 0xd5, 0xeb, 0xfb, 0x51, 0x45, 0xce, 0x10, 0xd1, 0x99, 0x34, 0xd1, 0x61, - 0xba, 0x64, 0x59, 0x28, 0x90, 0xb0, 0x0a, 0xc6, 0x18, 0x7e, 0xc2, 0x1e, 0xde, 0x53, 0x83, 0x20, - 0x42, 0x44, 0x08, 0xbb, 0x00, 0xb5, 0x9b, 0x53, 0xf2, 0x50, 0xe8, 0x90, 0xb4, 0x15, 0xc6, 0xb8, - 0x54, 0xa4, 0xc6, 0xc8, 0x71, 0xe2, 0x35, 0xe2, 0x0e, 0xb4, 0x7a, 0xa1, 0x85, 0x30, 0xba, 0x5a, - 0x91, 0xd5, 0xe3, 0xa2, 0x1e, 0x5f, 0x3d, 0xd1, 0x88, 0x4a, 0x43, 0x76, 0xc5, 0xb8, 0xea, 0x45, - 0x4a, 0x8b, 0x9c, 0x2c, 0x5e, 0x1a, 0xee, 0x50, 0xdf, 0x34, 0x66, 0x6d, 0x8c, 0xaf, 0x51, 0xf0, - 0x4d, 0x0b, 0x7a, 0x7e, 0xca, 0x9b, 0x16, 0xb6, 0x9a, 0x57, 0x04, 0xea, 0xbd, 0x62, 0x36, 0xc8, - 0x68, 0x9a, 0x9c, 0x66, 0xef, 0x7e, 0x34, 0x47, 0xae, 0xdc, 0xfe, 0x70, 0x44, 0x0b, 0x9b, 0x5a, - 0xbf, 0x92, 0x95, 0x34, 0x2b, 0x33, 0x1b, 0x64, 0xf6, 0xd6, 0xb9, 0x83, 0x5b, 0x45, 0xf6, 0x68, - 0xbe, 0x04, 0x57, 0x85, 0x93, 0x75, 0xf6, 0x55, 0x5f, 0x38, 0x74, 0xff, 0xc1, 0x17, 0x33, 0xad, - 0x5f, 0xc8, 0x72, 0x8a, 0x87, 0xa5, 0x10, 0xbc, 0x50, 0x09, 0x32, 0xef, 0xf2, 0xd2, 0xe2, 0x2b, - 0xe6, 0x55, 0x24, 0x3e, 0xba, 0xac, 0xd2, 0xc4, 0x97, 0x12, 0x5f, 0x30, 0xbe, 0xb8, 0x88, 0x42, - 0xf1, 0xa3, 0x15, 0x50, 0xdd, 0xaa, 0xc8, 0x0a, 0x5c, 0xa6, 0x57, 0xa0, 0x30, 0x64, 0x96, 0xf0, - 0x49, 0x0c, 0x29, 0x35, 0xfc, 0x4c, 0xcc, 0xa4, 0x3f, 0xa5, 0xc4, 0x7f, 0xae, 0xc6, 0xcf, 0xba, - 0x30, 0x4b, 0xcb, 0x5f, 0xf5, 0xa5, 0x22, 0xf9, 0xe3, 0x0b, 0xb1, 0xb4, 0x35, 0x56, 0x0c, 0xa9, - 0xc8, 0x1a, 0xa3, 0x1b, 0x2f, 0x14, 0xff, 0x07, 0x11, 0x5f, 0x71, 0xa2, 0x94, 0xf8, 0x9f, 0xa9, - 0xf1, 0x75, 0x17, 0x5b, 0x28, 0xb4, 0x4d, 0x56, 0x35, 0xce, 0x53, 0x64, 0xfe, 0xe5, 0x9d, 0x15, - 0xa2, 0xb8, 0x22, 0x8f, 0xd2, 0xad, 0x26, 0x85, 0x61, 0x4b, 0x65, 0xc8, 0xb8, 0x8d, 0x4a, 0xab, - 0x21, 0xe1, 0x2c, 0x45, 0x6a, 0x90, 0x77, 0x4c, 0x69, 0x2b, 0xa0, 0xa8, 0x7b, 0x91, 0x15, 0x48, - 0x2c, 0x6e, 0x94, 0x7d, 0xc2, 0x3c, 0x8a, 0x64, 0x2f, 0xef, 0x87, 0x10, 0xc5, 0x4f, 0xe8, 0x0d, - 0x40, 0x7e, 0x91, 0x12, 0x7f, 0x53, 0x8d, 0xaf, 0xbd, 0xff, 0x41, 0xc1, 0x2f, 0x49, 0x33, 0xe1, - 0x12, 0x29, 0x91, 0xff, 0xaf, 0x46, 0x4e, 0xbf, 0xeb, 0x91, 0x61, 0x8f, 0xdf, 0xf0, 0xbf, 0x40, - 0xcd, 0x34, 0x66, 0x7e, 0xdc, 0xed, 0x0f, 0xfd, 0x41, 0xd0, 0x6d, 0xf7, 0xbc, 0xf1, 0xd6, 0xc5, - 0xc0, 0xb9, 0xe0, 0xb6, 0xf5, 0xce, 0xbd, 0x0e, 0x98, 0x13, 0x39, 0x34, 0xfc, 0x53, 0x59, 0x6f, - 0xb3, 0xef, 0xb8, 0x9b, 0x7d, 0x6f, 0x93, 0xd9, 0xd9, 0x16, 0xb3, 0xb3, 0xee, 0x02, 0xef, 0xd8, - 0xfe, 0x37, 0x00, 0x00, 0xff, 0xff, 0x47, 0x96, 0x51, 0x92, 0x40, 0x1c, 0x00, 0x00, -} diff --git a/test/gogo/wkts_json.pb.go b/test/gogo/wkts_json.pb.go deleted file mode 100644 index 6f9461ff..00000000 --- a/test/gogo/wkts_json.pb.go +++ /dev/null @@ -1,1916 +0,0 @@ -// Code generated by protoc-gen-go-json. DO NOT EDIT. -// versions: -// - protoc-gen-go-json v0.0.0-dev -// - protoc v3.9.1 -// source: wkts.proto - -package test - -import ( - gogo "github.com/TheThingsIndustries/protoc-gen-go-json/gogo" - jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" - types "github.com/gogo/protobuf/types" -) - -// MarshalProtoJSON marshals the MessageWithMarshaler message to JSON. -func (x *MessageWithMarshaler) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.Message != "" || s.HasField("message") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("message") - s.WriteString(x.Message) - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithMarshaler to JSON. -func (x *MessageWithMarshaler) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithMarshaler message from JSON. -func (x *MessageWithMarshaler) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "message": - s.AddField("message") - x.Message = s.ReadString() - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithMarshaler from JSON. -func (x *MessageWithMarshaler) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithWKTs message to JSON. -func (x *MessageWithWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.DoubleValue != nil || s.HasField("double_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("double_value") - if x.DoubleValue == nil { - s.WriteNil() - } else { - s.WriteFloat64(x.DoubleValue.Value) - } - } - if len(x.DoubleValues) > 0 || s.HasField("double_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("double_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.DoubleValues { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - s.WriteFloat64(element.Value) - } - } - s.WriteArrayEnd() - } - if x.FloatValue != nil || s.HasField("float_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("float_value") - if x.FloatValue == nil { - s.WriteNil() - } else { - s.WriteFloat32(x.FloatValue.Value) - } - } - if len(x.FloatValues) > 0 || s.HasField("float_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("float_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.FloatValues { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - s.WriteFloat32(element.Value) - } - } - s.WriteArrayEnd() - } - if x.Int32Value != nil || s.HasField("int32_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("int32_value") - if x.Int32Value == nil { - s.WriteNil() - } else { - s.WriteInt32(x.Int32Value.Value) - } - } - if len(x.Int32Values) > 0 || s.HasField("int32_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("int32_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.Int32Values { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - s.WriteInt32(element.Value) - } - } - s.WriteArrayEnd() - } - if x.Int64Value != nil || s.HasField("int64_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("int64_value") - if x.Int64Value == nil { - s.WriteNil() - } else { - s.WriteInt64(x.Int64Value.Value) - } - } - if len(x.Int64Values) > 0 || s.HasField("int64_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("int64_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.Int64Values { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - s.WriteInt64(element.Value) - } - } - s.WriteArrayEnd() - } - if x.Uint32Value != nil || s.HasField("uint32_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("uint32_value") - if x.Uint32Value == nil { - s.WriteNil() - } else { - s.WriteUint32(x.Uint32Value.Value) - } - } - if len(x.Uint32Values) > 0 || s.HasField("uint32_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("uint32_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.Uint32Values { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - s.WriteUint32(element.Value) - } - } - s.WriteArrayEnd() - } - if x.Uint64Value != nil || s.HasField("uint64_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("uint64_value") - if x.Uint64Value == nil { - s.WriteNil() - } else { - s.WriteUint64(x.Uint64Value.Value) - } - } - if len(x.Uint64Values) > 0 || s.HasField("uint64_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("uint64_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.Uint64Values { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - s.WriteUint64(element.Value) - } - } - s.WriteArrayEnd() - } - if x.BoolValue != nil || s.HasField("bool_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("bool_value") - if x.BoolValue == nil { - s.WriteNil() - } else { - s.WriteBool(x.BoolValue.Value) - } - } - if len(x.BoolValues) > 0 || s.HasField("bool_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("bool_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.BoolValues { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - s.WriteBool(element.Value) - } - } - s.WriteArrayEnd() - } - if x.StringValue != nil || s.HasField("string_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_value") - if x.StringValue == nil { - s.WriteNil() - } else { - s.WriteString(x.StringValue.Value) - } - } - if len(x.StringValues) > 0 || s.HasField("string_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.StringValues { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - s.WriteString(element.Value) - } - } - s.WriteArrayEnd() - } - if x.BytesValue != nil || s.HasField("bytes_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("bytes_value") - if x.BytesValue == nil { - s.WriteNil() - } else { - s.WriteBytes(x.BytesValue.Value) - } - } - if len(x.BytesValues) > 0 || s.HasField("bytes_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("bytes_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.BytesValues { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - s.WriteBytes(element.Value) - } - } - s.WriteArrayEnd() - } - if x.EmptyValue != nil || s.HasField("empty_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("empty_value") - if x.EmptyValue == nil { - s.WriteNil() - } else { - gogo.MarshalEmpty(s, x.EmptyValue) - } - } - if len(x.EmptyValues) > 0 || s.HasField("empty_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("empty_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.EmptyValues { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - gogo.MarshalEmpty(s, element) - } - } - s.WriteArrayEnd() - } - if x.TimestampValue != nil || s.HasField("timestamp_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("timestamp_value") - if x.TimestampValue == nil { - s.WriteNil() - } else { - gogo.MarshalTimestamp(s, x.TimestampValue) - } - } - if len(x.TimestampValues) > 0 || s.HasField("timestamp_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("timestamp_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.TimestampValues { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - gogo.MarshalTimestamp(s, element) - } - } - s.WriteArrayEnd() - } - if x.DurationValue != nil || s.HasField("duration_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("duration_value") - if x.DurationValue == nil { - s.WriteNil() - } else { - gogo.MarshalDuration(s, x.DurationValue) - } - } - if len(x.DurationValues) > 0 || s.HasField("duration_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("duration_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.DurationValues { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - gogo.MarshalDuration(s, element) - } - } - s.WriteArrayEnd() - } - if x.FieldMaskValue != nil || s.HasField("field_mask_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("field_mask_value") - if x.FieldMaskValue == nil { - s.WriteNil() - } else { - gogo.MarshalFieldMask(s, x.FieldMaskValue) - } - } - if len(x.FieldMaskValues) > 0 || s.HasField("field_mask_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("field_mask_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.FieldMaskValues { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - gogo.MarshalFieldMask(s, element) - } - } - s.WriteArrayEnd() - } - if x.ValueValue != nil || s.HasField("value_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("value_value") - if x.ValueValue == nil { - s.WriteNil() - } else { - gogo.MarshalValue(s, x.ValueValue) - } - } - if len(x.ValueValues) > 0 || s.HasField("value_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("value_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.ValueValues { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - gogo.MarshalValue(s, element) - } - } - s.WriteArrayEnd() - } - if x.ListValueValue != nil || s.HasField("list_value_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("list_value_value") - if x.ListValueValue == nil { - s.WriteNil() - } else { - gogo.MarshalListValue(s, x.ListValueValue) - } - } - if len(x.ListValueValues) > 0 || s.HasField("list_value_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("list_value_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.ListValueValues { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - gogo.MarshalListValue(s, element) - } - } - s.WriteArrayEnd() - } - if x.StructValue != nil || s.HasField("struct_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("struct_value") - if x.StructValue == nil { - s.WriteNil() - } else { - gogo.MarshalStruct(s, x.StructValue) - } - } - if len(x.StructValues) > 0 || s.HasField("struct_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("struct_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.StructValues { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - gogo.MarshalStruct(s, element) - } - } - s.WriteArrayEnd() - } - if x.AnyValue != nil || s.HasField("any_value") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("any_value") - if x.AnyValue == nil { - s.WriteNil() - } else { - gogo.MarshalAny(s, x.AnyValue, false) - } - } - if len(x.AnyValues) > 0 || s.HasField("any_values") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("any_values") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.AnyValues { - s.WriteMoreIf(&wroteElement) - if element == nil { - s.WriteNil() - } else { - gogo.MarshalAny(s, element, false) - } - } - s.WriteArrayEnd() - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithWKTs to JSON. -func (x *MessageWithWKTs) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithWKTs message from JSON. -func (x *MessageWithWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "double_value", "doubleValue": - s.AddField("double_value") - if s.ReadNil() { - x.DoubleValue = nil - return - } - v := s.ReadWrappedFloat64() - if s.Err() != nil { - return - } - x.DoubleValue = &types.DoubleValue{Value: v} - case "double_values", "doubleValues": - s.AddField("double_values") - if s.ReadNil() { - x.DoubleValues = nil - return - } - s.ReadArray(func() { - if s.ReadNil() { - x.DoubleValues = append(x.DoubleValues, nil) - return - } - v := s.ReadWrappedFloat64() - if s.Err() != nil { - return - } - x.DoubleValues = append(x.DoubleValues, &types.DoubleValue{Value: v}) - }) - case "float_value", "floatValue": - s.AddField("float_value") - if s.ReadNil() { - x.FloatValue = nil - return - } - v := s.ReadWrappedFloat32() - if s.Err() != nil { - return - } - x.FloatValue = &types.FloatValue{Value: v} - case "float_values", "floatValues": - s.AddField("float_values") - if s.ReadNil() { - x.FloatValues = nil - return - } - s.ReadArray(func() { - if s.ReadNil() { - x.FloatValues = append(x.FloatValues, nil) - return - } - v := s.ReadWrappedFloat32() - if s.Err() != nil { - return - } - x.FloatValues = append(x.FloatValues, &types.FloatValue{Value: v}) - }) - case "int32_value", "int32Value": - s.AddField("int32_value") - if s.ReadNil() { - x.Int32Value = nil - return - } - v := s.ReadWrappedInt32() - if s.Err() != nil { - return - } - x.Int32Value = &types.Int32Value{Value: v} - case "int32_values", "int32Values": - s.AddField("int32_values") - if s.ReadNil() { - x.Int32Values = nil - return - } - s.ReadArray(func() { - if s.ReadNil() { - x.Int32Values = append(x.Int32Values, nil) - return - } - v := s.ReadWrappedInt32() - if s.Err() != nil { - return - } - x.Int32Values = append(x.Int32Values, &types.Int32Value{Value: v}) - }) - case "int64_value", "int64Value": - s.AddField("int64_value") - if s.ReadNil() { - x.Int64Value = nil - return - } - v := s.ReadWrappedInt64() - if s.Err() != nil { - return - } - x.Int64Value = &types.Int64Value{Value: v} - case "int64_values", "int64Values": - s.AddField("int64_values") - if s.ReadNil() { - x.Int64Values = nil - return - } - s.ReadArray(func() { - if s.ReadNil() { - x.Int64Values = append(x.Int64Values, nil) - return - } - v := s.ReadWrappedInt64() - if s.Err() != nil { - return - } - x.Int64Values = append(x.Int64Values, &types.Int64Value{Value: v}) - }) - case "uint32_value", "uint32Value": - s.AddField("uint32_value") - if s.ReadNil() { - x.Uint32Value = nil - return - } - v := s.ReadWrappedUint32() - if s.Err() != nil { - return - } - x.Uint32Value = &types.UInt32Value{Value: v} - case "uint32_values", "uint32Values": - s.AddField("uint32_values") - if s.ReadNil() { - x.Uint32Values = nil - return - } - s.ReadArray(func() { - if s.ReadNil() { - x.Uint32Values = append(x.Uint32Values, nil) - return - } - v := s.ReadWrappedUint32() - if s.Err() != nil { - return - } - x.Uint32Values = append(x.Uint32Values, &types.UInt32Value{Value: v}) - }) - case "uint64_value", "uint64Value": - s.AddField("uint64_value") - if s.ReadNil() { - x.Uint64Value = nil - return - } - v := s.ReadWrappedUint64() - if s.Err() != nil { - return - } - x.Uint64Value = &types.UInt64Value{Value: v} - case "uint64_values", "uint64Values": - s.AddField("uint64_values") - if s.ReadNil() { - x.Uint64Values = nil - return - } - s.ReadArray(func() { - if s.ReadNil() { - x.Uint64Values = append(x.Uint64Values, nil) - return - } - v := s.ReadWrappedUint64() - if s.Err() != nil { - return - } - x.Uint64Values = append(x.Uint64Values, &types.UInt64Value{Value: v}) - }) - case "bool_value", "boolValue": - s.AddField("bool_value") - if s.ReadNil() { - x.BoolValue = nil - return - } - v := s.ReadWrappedBool() - if s.Err() != nil { - return - } - x.BoolValue = &types.BoolValue{Value: v} - case "bool_values", "boolValues": - s.AddField("bool_values") - if s.ReadNil() { - x.BoolValues = nil - return - } - s.ReadArray(func() { - if s.ReadNil() { - x.BoolValues = append(x.BoolValues, nil) - return - } - v := s.ReadWrappedBool() - if s.Err() != nil { - return - } - x.BoolValues = append(x.BoolValues, &types.BoolValue{Value: v}) - }) - case "string_value", "stringValue": - s.AddField("string_value") - if s.ReadNil() { - x.StringValue = nil - return - } - v := s.ReadWrappedString() - if s.Err() != nil { - return - } - x.StringValue = &types.StringValue{Value: v} - case "string_values", "stringValues": - s.AddField("string_values") - if s.ReadNil() { - x.StringValues = nil - return - } - s.ReadArray(func() { - if s.ReadNil() { - x.StringValues = append(x.StringValues, nil) - return - } - v := s.ReadWrappedString() - if s.Err() != nil { - return - } - x.StringValues = append(x.StringValues, &types.StringValue{Value: v}) - }) - case "bytes_value", "bytesValue": - s.AddField("bytes_value") - if s.ReadNil() { - x.BytesValue = nil - return - } - v := s.ReadWrappedBytes() - if s.Err() != nil { - return - } - x.BytesValue = &types.BytesValue{Value: v} - case "bytes_values", "bytesValues": - s.AddField("bytes_values") - if s.ReadNil() { - x.BytesValues = nil - return - } - s.ReadArray(func() { - if s.ReadNil() { - x.BytesValues = append(x.BytesValues, nil) - return - } - v := s.ReadWrappedBytes() - if s.Err() != nil { - return - } - x.BytesValues = append(x.BytesValues, &types.BytesValue{Value: v}) - }) - case "empty_value", "emptyValue": - s.AddField("empty_value") - if s.ReadNil() { - x.EmptyValue = nil - return - } - v := gogo.UnmarshalEmpty(s) - if s.Err() != nil { - return - } - x.EmptyValue = v - case "empty_values", "emptyValues": - s.AddField("empty_values") - if s.ReadNil() { - x.EmptyValues = nil - return - } - s.ReadArray(func() { - v := gogo.UnmarshalEmpty(s) - if s.Err() != nil { - return - } - x.EmptyValues = append(x.EmptyValues, v) - }) - case "timestamp_value", "timestampValue": - s.AddField("timestamp_value") - if s.ReadNil() { - x.TimestampValue = nil - return - } - v := gogo.UnmarshalTimestamp(s) - if s.Err() != nil { - return - } - x.TimestampValue = v - case "timestamp_values", "timestampValues": - s.AddField("timestamp_values") - if s.ReadNil() { - x.TimestampValues = nil - return - } - s.ReadArray(func() { - v := gogo.UnmarshalTimestamp(s) - if s.Err() != nil { - return - } - x.TimestampValues = append(x.TimestampValues, v) - }) - case "duration_value", "durationValue": - s.AddField("duration_value") - if s.ReadNil() { - x.DurationValue = nil - return - } - v := gogo.UnmarshalDuration(s) - if s.Err() != nil { - return - } - x.DurationValue = v - case "duration_values", "durationValues": - s.AddField("duration_values") - if s.ReadNil() { - x.DurationValues = nil - return - } - s.ReadArray(func() { - v := gogo.UnmarshalDuration(s) - if s.Err() != nil { - return - } - x.DurationValues = append(x.DurationValues, v) - }) - case "field_mask_value", "fieldMaskValue": - s.AddField("field_mask_value") - if s.ReadNil() { - x.FieldMaskValue = nil - return - } - v := gogo.UnmarshalFieldMask(s) - if s.Err() != nil { - return - } - x.FieldMaskValue = v - case "field_mask_values", "fieldMaskValues": - s.AddField("field_mask_values") - if s.ReadNil() { - x.FieldMaskValues = nil - return - } - s.ReadArray(func() { - v := gogo.UnmarshalFieldMask(s) - if s.Err() != nil { - return - } - x.FieldMaskValues = append(x.FieldMaskValues, v) - }) - case "value_value", "valueValue": - s.AddField("value_value") - if s.ReadNil() { - x.ValueValue = &types.Value{Kind: &types.Value_NullValue{}} - return - } - v := gogo.UnmarshalValue(s) - if s.Err() != nil { - return - } - x.ValueValue = v - case "value_values", "valueValues": - s.AddField("value_values") - if s.ReadNil() { - x.ValueValues = nil - return - } - s.ReadArray(func() { - v := gogo.UnmarshalValue(s) - if s.Err() != nil { - return - } - x.ValueValues = append(x.ValueValues, v) - }) - case "list_value_value", "listValueValue": - s.AddField("list_value_value") - if s.ReadNil() { - x.ListValueValue = nil - return - } - v := gogo.UnmarshalListValue(s) - if s.Err() != nil { - return - } - x.ListValueValue = v - case "list_value_values", "listValueValues": - s.AddField("list_value_values") - if s.ReadNil() { - x.ListValueValues = nil - return - } - s.ReadArray(func() { - v := gogo.UnmarshalListValue(s) - if s.Err() != nil { - return - } - x.ListValueValues = append(x.ListValueValues, v) - }) - case "struct_value", "structValue": - s.AddField("struct_value") - if s.ReadNil() { - x.StructValue = nil - return - } - v := gogo.UnmarshalStruct(s) - if s.Err() != nil { - return - } - x.StructValue = v - case "struct_values", "structValues": - s.AddField("struct_values") - if s.ReadNil() { - x.StructValues = nil - return - } - s.ReadArray(func() { - v := gogo.UnmarshalStruct(s) - if s.Err() != nil { - return - } - x.StructValues = append(x.StructValues, v) - }) - case "any_value", "anyValue": - s.AddField("any_value") - if s.ReadNil() { - x.AnyValue = nil - return - } - v := gogo.UnmarshalAny(s) - if s.Err() != nil { - return - } - x.AnyValue = v - case "any_values", "anyValues": - s.AddField("any_values") - if s.ReadNil() { - x.AnyValues = nil - return - } - s.ReadArray(func() { - v := gogo.UnmarshalAny(s) - if s.Err() != nil { - return - } - x.AnyValues = append(x.AnyValues, v) - }) - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithWKTs from JSON. -func (x *MessageWithWKTs) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithOneofWKTs message to JSON. -func (x *MessageWithOneofWKTs) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.Value != nil { - switch ov := x.Value.(type) { - case *MessageWithOneofWKTs_DoubleValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("double_value") - if ov.DoubleValue == nil { - s.WriteNil() - } else { - s.WriteFloat64(ov.DoubleValue.Value) - } - case *MessageWithOneofWKTs_FloatValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("float_value") - if ov.FloatValue == nil { - s.WriteNil() - } else { - s.WriteFloat32(ov.FloatValue.Value) - } - case *MessageWithOneofWKTs_Int32Value: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("int32_value") - if ov.Int32Value == nil { - s.WriteNil() - } else { - s.WriteInt32(ov.Int32Value.Value) - } - case *MessageWithOneofWKTs_Int64Value: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("int64_value") - if ov.Int64Value == nil { - s.WriteNil() - } else { - s.WriteInt64(ov.Int64Value.Value) - } - case *MessageWithOneofWKTs_Uint32Value: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("uint32_value") - if ov.Uint32Value == nil { - s.WriteNil() - } else { - s.WriteUint32(ov.Uint32Value.Value) - } - case *MessageWithOneofWKTs_Uint64Value: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("uint64_value") - if ov.Uint64Value == nil { - s.WriteNil() - } else { - s.WriteUint64(ov.Uint64Value.Value) - } - case *MessageWithOneofWKTs_BoolValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("bool_value") - if ov.BoolValue == nil { - s.WriteNil() - } else { - s.WriteBool(ov.BoolValue.Value) - } - case *MessageWithOneofWKTs_StringValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_value") - if ov.StringValue == nil { - s.WriteNil() - } else { - s.WriteString(ov.StringValue.Value) - } - case *MessageWithOneofWKTs_BytesValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("bytes_value") - if ov.BytesValue == nil { - s.WriteNil() - } else { - s.WriteBytes(ov.BytesValue.Value) - } - case *MessageWithOneofWKTs_EmptyValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("empty_value") - if ov.EmptyValue == nil { - s.WriteNil() - } else { - gogo.MarshalEmpty(s, ov.EmptyValue) - } - case *MessageWithOneofWKTs_TimestampValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("timestamp_value") - if ov.TimestampValue == nil { - s.WriteNil() - } else { - gogo.MarshalTimestamp(s, ov.TimestampValue) - } - case *MessageWithOneofWKTs_DurationValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("duration_value") - if ov.DurationValue == nil { - s.WriteNil() - } else { - gogo.MarshalDuration(s, ov.DurationValue) - } - case *MessageWithOneofWKTs_FieldMaskValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("field_mask_value") - if ov.FieldMaskValue == nil { - s.WriteNil() - } else { - gogo.MarshalFieldMask(s, ov.FieldMaskValue) - } - case *MessageWithOneofWKTs_ValueValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("value_value") - if ov.ValueValue == nil { - s.WriteNil() - } else { - gogo.MarshalValue(s, ov.ValueValue) - } - case *MessageWithOneofWKTs_ListValueValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("list_value_value") - if ov.ListValueValue == nil { - s.WriteNil() - } else { - gogo.MarshalListValue(s, ov.ListValueValue) - } - case *MessageWithOneofWKTs_StructValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("struct_value") - if ov.StructValue == nil { - s.WriteNil() - } else { - gogo.MarshalStruct(s, ov.StructValue) - } - case *MessageWithOneofWKTs_AnyValue: - s.WriteMoreIf(&wroteField) - s.WriteObjectField("any_value") - if ov.AnyValue == nil { - s.WriteNil() - } else { - gogo.MarshalAny(s, ov.AnyValue, false) - } - } - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithOneofWKTs to JSON. -func (x *MessageWithOneofWKTs) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithOneofWKTs message from JSON. -func (x *MessageWithOneofWKTs) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "double_value", "doubleValue": - s.AddField("double_value") - ov := &MessageWithOneofWKTs_DoubleValue{} - x.Value = ov - if s.ReadNil() { - ov.DoubleValue = nil - return - } - v := s.ReadWrappedFloat64() - if s.Err() != nil { - return - } - ov.DoubleValue = &types.DoubleValue{Value: v} - case "float_value", "floatValue": - s.AddField("float_value") - ov := &MessageWithOneofWKTs_FloatValue{} - x.Value = ov - if s.ReadNil() { - ov.FloatValue = nil - return - } - v := s.ReadWrappedFloat32() - if s.Err() != nil { - return - } - ov.FloatValue = &types.FloatValue{Value: v} - case "int32_value", "int32Value": - s.AddField("int32_value") - ov := &MessageWithOneofWKTs_Int32Value{} - x.Value = ov - if s.ReadNil() { - ov.Int32Value = nil - return - } - v := s.ReadWrappedInt32() - if s.Err() != nil { - return - } - ov.Int32Value = &types.Int32Value{Value: v} - case "int64_value", "int64Value": - s.AddField("int64_value") - ov := &MessageWithOneofWKTs_Int64Value{} - x.Value = ov - if s.ReadNil() { - ov.Int64Value = nil - return - } - v := s.ReadWrappedInt64() - if s.Err() != nil { - return - } - ov.Int64Value = &types.Int64Value{Value: v} - case "uint32_value", "uint32Value": - s.AddField("uint32_value") - ov := &MessageWithOneofWKTs_Uint32Value{} - x.Value = ov - if s.ReadNil() { - ov.Uint32Value = nil - return - } - v := s.ReadWrappedUint32() - if s.Err() != nil { - return - } - ov.Uint32Value = &types.UInt32Value{Value: v} - case "uint64_value", "uint64Value": - s.AddField("uint64_value") - ov := &MessageWithOneofWKTs_Uint64Value{} - x.Value = ov - if s.ReadNil() { - ov.Uint64Value = nil - return - } - v := s.ReadWrappedUint64() - if s.Err() != nil { - return - } - ov.Uint64Value = &types.UInt64Value{Value: v} - case "bool_value", "boolValue": - s.AddField("bool_value") - ov := &MessageWithOneofWKTs_BoolValue{} - x.Value = ov - if s.ReadNil() { - ov.BoolValue = nil - return - } - v := s.ReadWrappedBool() - if s.Err() != nil { - return - } - ov.BoolValue = &types.BoolValue{Value: v} - case "string_value", "stringValue": - s.AddField("string_value") - ov := &MessageWithOneofWKTs_StringValue{} - x.Value = ov - if s.ReadNil() { - ov.StringValue = nil - return - } - v := s.ReadWrappedString() - if s.Err() != nil { - return - } - ov.StringValue = &types.StringValue{Value: v} - case "bytes_value", "bytesValue": - s.AddField("bytes_value") - ov := &MessageWithOneofWKTs_BytesValue{} - x.Value = ov - if s.ReadNil() { - ov.BytesValue = nil - return - } - v := s.ReadWrappedBytes() - if s.Err() != nil { - return - } - ov.BytesValue = &types.BytesValue{Value: v} - case "empty_value", "emptyValue": - s.AddField("empty_value") - ov := &MessageWithOneofWKTs_EmptyValue{} - x.Value = ov - if s.ReadNil() { - ov.EmptyValue = nil - return - } - v := gogo.UnmarshalEmpty(s) - if s.Err() != nil { - return - } - ov.EmptyValue = v - case "timestamp_value", "timestampValue": - s.AddField("timestamp_value") - ov := &MessageWithOneofWKTs_TimestampValue{} - x.Value = ov - if s.ReadNil() { - ov.TimestampValue = nil - return - } - v := gogo.UnmarshalTimestamp(s) - if s.Err() != nil { - return - } - ov.TimestampValue = v - case "duration_value", "durationValue": - s.AddField("duration_value") - ov := &MessageWithOneofWKTs_DurationValue{} - x.Value = ov - if s.ReadNil() { - ov.DurationValue = nil - return - } - v := gogo.UnmarshalDuration(s) - if s.Err() != nil { - return - } - ov.DurationValue = v - case "field_mask_value", "fieldMaskValue": - s.AddField("field_mask_value") - ov := &MessageWithOneofWKTs_FieldMaskValue{} - x.Value = ov - if s.ReadNil() { - ov.FieldMaskValue = nil - return - } - v := gogo.UnmarshalFieldMask(s) - if s.Err() != nil { - return - } - ov.FieldMaskValue = v - case "value_value", "valueValue": - s.AddField("value_value") - ov := &MessageWithOneofWKTs_ValueValue{} - x.Value = ov - if s.ReadNil() { - ov.ValueValue = &types.Value{Kind: &types.Value_NullValue{}} - return - } - v := gogo.UnmarshalValue(s) - if s.Err() != nil { - return - } - ov.ValueValue = v - case "list_value_value", "listValueValue": - s.AddField("list_value_value") - ov := &MessageWithOneofWKTs_ListValueValue{} - x.Value = ov - if s.ReadNil() { - ov.ListValueValue = nil - return - } - v := gogo.UnmarshalListValue(s) - if s.Err() != nil { - return - } - ov.ListValueValue = v - case "struct_value", "structValue": - s.AddField("struct_value") - ov := &MessageWithOneofWKTs_StructValue{} - x.Value = ov - if s.ReadNil() { - ov.StructValue = nil - return - } - v := gogo.UnmarshalStruct(s) - if s.Err() != nil { - return - } - ov.StructValue = v - case "any_value", "anyValue": - s.AddField("any_value") - ov := &MessageWithOneofWKTs_AnyValue{} - x.Value = ov - if s.ReadNil() { - ov.AnyValue = nil - return - } - v := gogo.UnmarshalAny(s) - if s.Err() != nil { - return - } - ov.AnyValue = v - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithOneofWKTs from JSON. -func (x *MessageWithOneofWKTs) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithWKTMaps message to JSON. -func (x *MessageWithWKTMaps) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.StringDoubleMap != nil || s.HasField("string_double_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_double_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringDoubleMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - s.WriteFloat64(v.Value) - } - } - s.WriteObjectEnd() - } - if x.StringFloatMap != nil || s.HasField("string_float_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_float_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringFloatMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - s.WriteFloat32(v.Value) - } - } - s.WriteObjectEnd() - } - if x.StringInt32Map != nil || s.HasField("string_int32_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_int32_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringInt32Map { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - s.WriteInt32(v.Value) - } - } - s.WriteObjectEnd() - } - if x.StringInt64Map != nil || s.HasField("string_int64_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_int64_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringInt64Map { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - s.WriteInt64(v.Value) - } - } - s.WriteObjectEnd() - } - if x.StringUint32Map != nil || s.HasField("string_uint32_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_uint32_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringUint32Map { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - s.WriteUint32(v.Value) - } - } - s.WriteObjectEnd() - } - if x.StringUint64Map != nil || s.HasField("string_uint64_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_uint64_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringUint64Map { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - s.WriteUint64(v.Value) - } - } - s.WriteObjectEnd() - } - if x.StringBoolMap != nil || s.HasField("string_bool_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_bool_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringBoolMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - s.WriteBool(v.Value) - } - } - s.WriteObjectEnd() - } - if x.StringStringMap != nil || s.HasField("string_string_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_string_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringStringMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - s.WriteString(v.Value) - } - } - s.WriteObjectEnd() - } - if x.StringBytesMap != nil || s.HasField("string_bytes_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_bytes_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringBytesMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - s.WriteBytes(v.Value) - } - } - s.WriteObjectEnd() - } - if x.StringEmptyMap != nil || s.HasField("string_empty_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_empty_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringEmptyMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - gogo.MarshalEmpty(s, v) - } - } - s.WriteObjectEnd() - } - if x.StringTimestampMap != nil || s.HasField("string_timestamp_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_timestamp_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringTimestampMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - gogo.MarshalTimestamp(s, v) - } - } - s.WriteObjectEnd() - } - if x.StringDurationMap != nil || s.HasField("string_duration_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_duration_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringDurationMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - gogo.MarshalDuration(s, v) - } - } - s.WriteObjectEnd() - } - if x.StringFieldMaskMap != nil || s.HasField("string_field_mask_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_field_mask_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringFieldMaskMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - gogo.MarshalFieldMask(s, v) - } - } - s.WriteObjectEnd() - } - if x.StringValueMap != nil || s.HasField("string_value_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_value_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringValueMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - gogo.MarshalValue(s, v) - } - } - s.WriteObjectEnd() - } - if x.StringListValueMap != nil || s.HasField("string_list_value_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_list_value_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringListValueMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - gogo.MarshalListValue(s, v) - } - } - s.WriteObjectEnd() - } - if x.StringStructMap != nil || s.HasField("string_struct_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_struct_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringStructMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - gogo.MarshalStruct(s, v) - } - } - s.WriteObjectEnd() - } - if x.StringAnyMap != nil || s.HasField("string_any_map") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("string_any_map") - s.WriteObjectStart() - var wroteElement bool - for k, v := range x.StringAnyMap { - s.WriteMoreIf(&wroteElement) - s.WriteObjectStringField(k) - if v == nil { - s.WriteNil() - } else { - gogo.MarshalAny(s, v, false) - } - } - s.WriteObjectEnd() - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithWKTMaps to JSON. -func (x *MessageWithWKTMaps) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithWKTMaps message from JSON. -func (x *MessageWithWKTMaps) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "string_double_map", "stringDoubleMap": - s.AddField("string_double_map") - if s.ReadNil() { - x.StringDoubleMap = nil - return - } - x.StringDoubleMap = make(map[string]*types.DoubleValue) - s.ReadStringMap(func(key string) { - if s.ReadNil() { - x.StringDoubleMap[key] = nil - } else { - v := s.ReadWrappedFloat64() - if s.Err() != nil { - return - } - x.StringDoubleMap[key] = &types.DoubleValue{Value: v} - } - }) - case "string_float_map", "stringFloatMap": - s.AddField("string_float_map") - if s.ReadNil() { - x.StringFloatMap = nil - return - } - x.StringFloatMap = make(map[string]*types.FloatValue) - s.ReadStringMap(func(key string) { - if s.ReadNil() { - x.StringFloatMap[key] = nil - } else { - v := s.ReadWrappedFloat32() - if s.Err() != nil { - return - } - x.StringFloatMap[key] = &types.FloatValue{Value: v} - } - }) - case "string_int32_map", "stringInt32Map": - s.AddField("string_int32_map") - if s.ReadNil() { - x.StringInt32Map = nil - return - } - x.StringInt32Map = make(map[string]*types.Int32Value) - s.ReadStringMap(func(key string) { - if s.ReadNil() { - x.StringInt32Map[key] = nil - } else { - v := s.ReadWrappedInt32() - if s.Err() != nil { - return - } - x.StringInt32Map[key] = &types.Int32Value{Value: v} - } - }) - case "string_int64_map", "stringInt64Map": - s.AddField("string_int64_map") - if s.ReadNil() { - x.StringInt64Map = nil - return - } - x.StringInt64Map = make(map[string]*types.Int64Value) - s.ReadStringMap(func(key string) { - if s.ReadNil() { - x.StringInt64Map[key] = nil - } else { - v := s.ReadWrappedInt64() - if s.Err() != nil { - return - } - x.StringInt64Map[key] = &types.Int64Value{Value: v} - } - }) - case "string_uint32_map", "stringUint32Map": - s.AddField("string_uint32_map") - if s.ReadNil() { - x.StringUint32Map = nil - return - } - x.StringUint32Map = make(map[string]*types.UInt32Value) - s.ReadStringMap(func(key string) { - if s.ReadNil() { - x.StringUint32Map[key] = nil - } else { - v := s.ReadWrappedUint32() - if s.Err() != nil { - return - } - x.StringUint32Map[key] = &types.UInt32Value{Value: v} - } - }) - case "string_uint64_map", "stringUint64Map": - s.AddField("string_uint64_map") - if s.ReadNil() { - x.StringUint64Map = nil - return - } - x.StringUint64Map = make(map[string]*types.UInt64Value) - s.ReadStringMap(func(key string) { - if s.ReadNil() { - x.StringUint64Map[key] = nil - } else { - v := s.ReadWrappedUint64() - if s.Err() != nil { - return - } - x.StringUint64Map[key] = &types.UInt64Value{Value: v} - } - }) - case "string_bool_map", "stringBoolMap": - s.AddField("string_bool_map") - if s.ReadNil() { - x.StringBoolMap = nil - return - } - x.StringBoolMap = make(map[string]*types.BoolValue) - s.ReadStringMap(func(key string) { - if s.ReadNil() { - x.StringBoolMap[key] = nil - } else { - v := s.ReadWrappedBool() - if s.Err() != nil { - return - } - x.StringBoolMap[key] = &types.BoolValue{Value: v} - } - }) - case "string_string_map", "stringStringMap": - s.AddField("string_string_map") - if s.ReadNil() { - x.StringStringMap = nil - return - } - x.StringStringMap = make(map[string]*types.StringValue) - s.ReadStringMap(func(key string) { - if s.ReadNil() { - x.StringStringMap[key] = nil - } else { - v := s.ReadWrappedString() - if s.Err() != nil { - return - } - x.StringStringMap[key] = &types.StringValue{Value: v} - } - }) - case "string_bytes_map", "stringBytesMap": - s.AddField("string_bytes_map") - if s.ReadNil() { - x.StringBytesMap = nil - return - } - x.StringBytesMap = make(map[string]*types.BytesValue) - s.ReadStringMap(func(key string) { - if s.ReadNil() { - x.StringBytesMap[key] = nil - } else { - v := s.ReadWrappedBytes() - if s.Err() != nil { - return - } - x.StringBytesMap[key] = &types.BytesValue{Value: v} - } - }) - case "string_empty_map", "stringEmptyMap": - s.AddField("string_empty_map") - if s.ReadNil() { - x.StringEmptyMap = nil - return - } - x.StringEmptyMap = make(map[string]*types.Empty) - s.ReadStringMap(func(key string) { - v := gogo.UnmarshalEmpty(s) - if s.Err() != nil { - return - } - x.StringEmptyMap[key] = v - }) - case "string_timestamp_map", "stringTimestampMap": - s.AddField("string_timestamp_map") - if s.ReadNil() { - x.StringTimestampMap = nil - return - } - x.StringTimestampMap = make(map[string]*types.Timestamp) - s.ReadStringMap(func(key string) { - v := gogo.UnmarshalTimestamp(s) - if s.Err() != nil { - return - } - x.StringTimestampMap[key] = v - }) - case "string_duration_map", "stringDurationMap": - s.AddField("string_duration_map") - if s.ReadNil() { - x.StringDurationMap = nil - return - } - x.StringDurationMap = make(map[string]*types.Duration) - s.ReadStringMap(func(key string) { - v := gogo.UnmarshalDuration(s) - if s.Err() != nil { - return - } - x.StringDurationMap[key] = v - }) - case "string_field_mask_map", "stringFieldMaskMap": - s.AddField("string_field_mask_map") - if s.ReadNil() { - x.StringFieldMaskMap = nil - return - } - x.StringFieldMaskMap = make(map[string]*types.FieldMask) - s.ReadStringMap(func(key string) { - v := gogo.UnmarshalFieldMask(s) - if s.Err() != nil { - return - } - x.StringFieldMaskMap[key] = v - }) - case "string_value_map", "stringValueMap": - s.AddField("string_value_map") - if s.ReadNil() { - x.StringValueMap = nil - return - } - x.StringValueMap = make(map[string]*types.Value) - s.ReadStringMap(func(key string) { - v := gogo.UnmarshalValue(s) - if s.Err() != nil { - return - } - x.StringValueMap[key] = v - }) - case "string_list_value_map", "stringListValueMap": - s.AddField("string_list_value_map") - if s.ReadNil() { - x.StringListValueMap = nil - return - } - x.StringListValueMap = make(map[string]*types.ListValue) - s.ReadStringMap(func(key string) { - v := gogo.UnmarshalListValue(s) - if s.Err() != nil { - return - } - x.StringListValueMap[key] = v - }) - case "string_struct_map", "stringStructMap": - s.AddField("string_struct_map") - if s.ReadNil() { - x.StringStructMap = nil - return - } - x.StringStructMap = make(map[string]*types.Struct) - s.ReadStringMap(func(key string) { - v := gogo.UnmarshalStruct(s) - if s.Err() != nil { - return - } - x.StringStructMap[key] = v - }) - case "string_any_map", "stringAnyMap": - s.AddField("string_any_map") - if s.ReadNil() { - x.StringAnyMap = nil - return - } - x.StringAnyMap = make(map[string]*types.Any) - s.ReadStringMap(func(key string) { - v := gogo.UnmarshalAny(s) - if s.Err() != nil { - return - } - x.StringAnyMap[key] = v - }) - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithWKTMaps from JSON. -func (x *MessageWithWKTMaps) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} diff --git a/test/gogo/wkts_test.go b/test/gogo/wkts_test.go deleted file mode 100644 index f172b24b..00000000 --- a/test/gogo/wkts_test.go +++ /dev/null @@ -1,947 +0,0 @@ -package test_test - -import ( - "testing" - "time" - - . "github.com/TheThingsIndustries/protoc-gen-go-json/test/gogo" - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/types" -) - -var ( - testTime = time.Date(2006, time.January, 2, 15, 4, 5, 123456789, time.FixedZone("07:00", 7*3600)) - testDuration = time.Hour + 2*time.Minute + 3*time.Second + 123456789 -) - -func TestTimeDuration(t *testing.T) { - expectedTime := "2006-01-02T15:04:05.123456789+07:00" - if actualTime := testTime.Format(time.RFC3339Nano); actualTime != expectedTime { - t.Fatalf("expected timestamp %s, got %s", expectedTime, actualTime) - } - expectedDuration := "1h2m3.123456789s" - if actualDuration := testDuration.String(); actualDuration != expectedDuration { - t.Fatalf("expected timestamp %s, got %s", expectedDuration, actualDuration) - } -} - -func mustTimestamp(t time.Time) *types.Timestamp { - tmst, err := types.TimestampProto(t) - if err != nil { - panic(err) - } - return tmst -} - -func mustDuration(t time.Duration) *types.Duration { - return types.DurationProto(t) -} - -func mustAny(pb proto.Message) *types.Any { - any, err := types.MarshalAny(pb) - if err != nil { - panic(err) - } - return any -} - -var testMessagesWithWKTs = []struct { - name string - msg MessageWithWKTs - unmarshalOnly bool - expected string - expectedMask []string -}{ - { - name: "empty", - msg: MessageWithWKTs{}, - expected: `{}`, - }, - { - name: "zero", - msg: MessageWithWKTs{}, - expected: `{ - "double_value": null, - "double_values": [], - "float_value": null, - "float_values": [], - "int32_value": null, - "int32_values": [], - "int64_value": null, - "int64_values": [], - "uint32_value": null, - "uint32_values": [], - "uint64_value": null, - "uint64_values": [], - "bool_value": null, - "bool_values": [], - "string_value": null, - "string_values": [], - "bytes_value": null, - "bytes_values": [], - "empty_values": [], - "timestamp_value": null, - "timestamp_values": [], - "duration_value": null, - "duration_values": [], - "field_mask_value": null, - "field_mask_values": [], - "value_values": [], - "list_value_value": null, - "list_value_values": [], - "struct_value": null, - "struct_values": [], - "any_value": null, - "any_values": [] - }`, - expectedMask: []string{ - "double_value", - "double_values", - "float_value", - "float_values", - "int32_value", - "int32_values", - "int64_value", - "int64_values", - "uint32_value", - "uint32_values", - "uint64_value", - "uint64_values", - "bool_value", - "bool_values", - "string_value", - "string_values", - "bytes_value", - "bytes_values", - "empty_values", - "timestamp_value", - "timestamp_values", - "duration_value", - "duration_values", - "field_mask_value", - "field_mask_values", - "value_values", - "list_value_value", - "list_value_values", - "struct_value", - "struct_values", - "any_value", - "any_values", - }, - }, - { - name: "full", - msg: MessageWithWKTs{ - DoubleValue: &types.DoubleValue{Value: 12.34}, - DoubleValues: []*types.DoubleValue{ - {Value: 12.34}, - {Value: 56.78}, - }, - FloatValue: &types.FloatValue{Value: 12.34}, - FloatValues: []*types.FloatValue{ - {Value: 12.34}, - {Value: 56.78}, - }, - Int32Value: &types.Int32Value{Value: -42}, - Int32Values: []*types.Int32Value{ - {Value: 1}, - {Value: 2}, - {Value: -42}, - }, - Int64Value: &types.Int64Value{Value: -42}, - Int64Values: []*types.Int64Value{ - {Value: 1}, - {Value: 2}, - {Value: -42}, - }, - Uint32Value: &types.UInt32Value{Value: 42}, - Uint32Values: []*types.UInt32Value{ - {Value: 1}, - {Value: 2}, - {Value: 42}, - }, - Uint64Value: &types.UInt64Value{Value: 42}, - Uint64Values: []*types.UInt64Value{ - {Value: 1}, - {Value: 2}, - {Value: 42}, - }, - BoolValue: &types.BoolValue{Value: true}, - BoolValues: []*types.BoolValue{ - {Value: true}, - {Value: false}, - }, - StringValue: &types.StringValue{Value: "foo"}, - StringValues: []*types.StringValue{ - {Value: "foo"}, - {Value: "bar"}, - }, - BytesValue: &types.BytesValue{Value: []byte("foo")}, - BytesValues: []*types.BytesValue{ - {Value: []byte("foo")}, - {Value: []byte("bar")}, - }, - EmptyValue: &types.Empty{}, - EmptyValues: []*types.Empty{{}, {}}, - TimestampValue: mustTimestamp(testTime), - TimestampValues: []*types.Timestamp{ - mustTimestamp(testTime), - mustTimestamp(testTime.Truncate(10)), - mustTimestamp(testTime.Truncate(100)), - mustTimestamp(testTime.Truncate(1000)), - mustTimestamp(testTime.Truncate(10000)), - mustTimestamp(testTime.Truncate(100000)), - mustTimestamp(testTime.Truncate(1000000)), - mustTimestamp(testTime.Truncate(10000000)), - mustTimestamp(testTime.Truncate(100000000)), - mustTimestamp(testTime.Truncate(1000000000)), - }, - DurationValue: mustDuration(testDuration), - DurationValues: []*types.Duration{ - mustDuration(testDuration), - mustDuration(testDuration.Truncate(10)), - mustDuration(testDuration.Truncate(100)), - mustDuration(testDuration.Truncate(1000)), - mustDuration(testDuration.Truncate(10000)), - mustDuration(testDuration.Truncate(100000)), - mustDuration(testDuration.Truncate(1000000)), - mustDuration(testDuration.Truncate(10000000)), - mustDuration(testDuration.Truncate(100000000)), - mustDuration(testDuration.Truncate(1000000000)), - }, - FieldMaskValue: &types.FieldMask{Paths: []string{"foo.bar", "bar", "baz.qux"}}, - FieldMaskValues: []*types.FieldMask{ - {Paths: []string{"foo.bar", "bar", "baz.qux"}}, - }, - ValueValue: &types.Value{Kind: &types.Value_StringValue{StringValue: "foo"}}, - ValueValues: []*types.Value{ - {Kind: &types.Value_NullValue{}}, - {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, - {Kind: &types.Value_StringValue{StringValue: "foo"}}, - {Kind: &types.Value_BoolValue{BoolValue: true}}, - }, - ListValueValue: &types.ListValue{ - Values: []*types.Value{ - {Kind: &types.Value_NullValue{}}, - {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, - {Kind: &types.Value_StringValue{StringValue: "foo"}}, - {Kind: &types.Value_BoolValue{BoolValue: true}}, - }, - }, - ListValueValues: []*types.ListValue{ - { - Values: []*types.Value{ - {Kind: &types.Value_NullValue{}}, - {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, - {Kind: &types.Value_StringValue{StringValue: "foo"}}, - {Kind: &types.Value_BoolValue{BoolValue: true}}, - }, - }, - }, - StructValue: &types.Struct{ - Fields: map[string]*types.Value{ - "null": {Kind: &types.Value_NullValue{}}, - "number": {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, - "string": {Kind: &types.Value_StringValue{StringValue: "foo"}}, - "bool": {Kind: &types.Value_BoolValue{BoolValue: true}}, - }, - }, - StructValues: []*types.Struct{ - {Fields: map[string]*types.Value{"null": {Kind: &types.Value_NullValue{}}}}, - {Fields: map[string]*types.Value{"number": {Kind: &types.Value_NumberValue{NumberValue: 12.34}}}}, - {Fields: map[string]*types.Value{"string": {Kind: &types.Value_StringValue{StringValue: "foo"}}}}, - {Fields: map[string]*types.Value{"bool": {Kind: &types.Value_BoolValue{BoolValue: true}}}}, - }, - AnyValue: mustAny(&MessageWithMarshaler{Message: "hello"}), - AnyValues: []*types.Any{ - mustAny(&MessageWithMarshaler{Message: "hello"}), - mustAny(&MessageWithoutMarshaler{Message: "hello"}), - mustAny(mustTimestamp(testTime)), - mustAny(mustDuration(testDuration)), - mustAny(&types.FieldMask{Paths: []string{"foo.bar", "bar", "baz.qux"}}), - mustAny(&types.Value{Kind: &types.Value_StringValue{StringValue: "foo"}}), - }, - }, - expected: `{ - "double_value": 12.34, - "double_values": [12.34, 56.78], - "float_value": 12.34, - "float_values": [12.34, 56.78], - "int32_value": -42, - "int32_values": [1, 2, -42], - "int64_value": "-42", - "int64_values": ["1", "2", "-42"], - "uint32_value": 42, - "uint32_values": [1, 2, 42], - "uint64_value": "42", - "uint64_values": ["1", "2", "42"], - "bool_value": true, - "bool_values": [true, false], - "string_value": "foo", - "string_values": ["foo", "bar"], - "bytes_value": "Zm9v", - "bytes_values": ["Zm9v", "YmFy"], - "empty_value": {}, - "empty_values": [{}, {}], - "timestamp_value": "2006-01-02T08:04:05.123456789Z", - "timestamp_values": [ - "2006-01-02T08:04:05.123456789Z", - "2006-01-02T08:04:05.123456780Z", - "2006-01-02T08:04:05.123456700Z", - "2006-01-02T08:04:05.123456Z", - "2006-01-02T08:04:05.123450Z", - "2006-01-02T08:04:05.123400Z", - "2006-01-02T08:04:05.123Z", - "2006-01-02T08:04:05.120Z", - "2006-01-02T08:04:05.100Z", - "2006-01-02T08:04:05Z" - ], - "duration_value": "3723.123456789s", - "duration_values": [ - "3723.123456789s", - "3723.123456780s", - "3723.123456700s", - "3723.123456s", - "3723.123450s", - "3723.123400s", - "3723.123s", - "3723.120s", - "3723.100s", - "3723s" - ], - "field_mask_value": "foo.bar,bar,baz.qux", - "field_mask_values": ["foo.bar,bar,baz.qux"], - "value_value": "foo", - "value_values": [null, 12.34, "foo", true], - "list_value_value": [null, 12.34, "foo", true], - "list_value_values": [[null, 12.34, "foo", true]], - "struct_value": { - "bool": true, - "null": null, - "number": 12.34, - "string": "foo" - }, - "struct_values": [ - {"null": null}, - {"number": 12.34}, - {"string": "foo"}, - {"bool": true} - ], - "any_value": { - "@type": "type.googleapis.com/thethings.json.test.MessageWithMarshaler", - "message": "hello" - }, - "any_values": [ - { - "@type": "type.googleapis.com/thethings.json.test.MessageWithMarshaler", - "message": "hello" - }, - { - "@type": "type.googleapis.com/thethings.json.test.MessageWithoutMarshaler", - "message": "hello" - }, - { - "@type":"type.googleapis.com/google.protobuf.Timestamp", - "value":"2006-01-02T08:04:05.123456789Z" - }, - { - "@type":"type.googleapis.com/google.protobuf.Duration", - "value":"3723.123456789s" - }, - { - "@type":"type.googleapis.com/google.protobuf.FieldMask", - "value": "foo.bar,bar,baz.qux" - }, - { - "@type":"type.googleapis.com/google.protobuf.Value", - "value":"foo" - } - ] - }`, - expectedMask: []string{ - "double_value", - "double_values", - "float_value", - "float_values", - "int32_value", - "int32_values", - "int64_value", - "int64_values", - "uint32_value", - "uint32_values", - "uint64_value", - "uint64_values", - "bool_value", - "bool_values", - "string_value", - "string_values", - "bytes_value", - "bytes_values", - "empty_value", - "empty_values", - "timestamp_value", - "timestamp_values", - "duration_value", - "duration_values", - "field_mask_value", - "field_mask_values", - "value_value", - "value_values", - "list_value_value", - "list_value_values", - "struct_value", - "struct_values", - "any_value", - "any_values", - }, - }, - { - name: "wrappers", - msg: MessageWithWKTs{ - DoubleValue: &types.DoubleValue{Value: 12.34}, - DoubleValues: []*types.DoubleValue{ - {Value: 12.34}, - {Value: 56.78}, - }, - FloatValue: &types.FloatValue{Value: 12.34}, - FloatValues: []*types.FloatValue{ - {Value: 12.34}, - {Value: 56.78}, - }, - Int32Value: &types.Int32Value{Value: -42}, - Int32Values: []*types.Int32Value{ - {Value: 1}, - {Value: 2}, - {Value: -42}, - }, - Int64Value: &types.Int64Value{Value: -42}, - Int64Values: []*types.Int64Value{ - {Value: 1}, - {Value: 2}, - {Value: -42}, - }, - Uint32Value: &types.UInt32Value{Value: 42}, - Uint32Values: []*types.UInt32Value{ - {Value: 1}, - {Value: 2}, - {Value: 42}, - }, - Uint64Value: &types.UInt64Value{Value: 42}, - Uint64Values: []*types.UInt64Value{ - {Value: 1}, - {Value: 2}, - {Value: 42}, - }, - BoolValue: &types.BoolValue{Value: true}, - BoolValues: []*types.BoolValue{ - {Value: true}, - {Value: false}, - }, - StringValue: &types.StringValue{Value: "foo"}, - StringValues: []*types.StringValue{ - {Value: "foo"}, - {Value: "bar"}, - }, - BytesValue: &types.BytesValue{Value: []byte("foo")}, - BytesValues: []*types.BytesValue{ - {Value: []byte("foo")}, - {Value: []byte("bar")}, - }, - }, - unmarshalOnly: true, - expected: `{ - "double_value": {"value": 12.34}, - "double_values": [{"value": 12.34}, {"value": 56.78}], - "float_value": {"value": 12.34}, - "float_values": [{"value": 12.34}, {"value": 56.78}], - "int32_value": {"value": -42}, - "int32_values": [{"value": 1}, {"value": 2}, {"value": -42}], - "int64_value": {"value": "-42"}, - "int64_values": [{"value": "1"}, {"value": "2"}, {"value": "-42"}], - "uint32_value": {"value": 42}, - "uint32_values": [{"value": 1}, {"value": 2}, {"value": 42}], - "uint64_value": {"value": "42"}, - "uint64_values": [{"value": "1"}, {"value": "2"}, {"value": "42"}], - "bool_value": {"value": true}, - "bool_values": [{"value": true}, {"value": false}], - "string_value": {"value": "foo"}, - "string_values": [{"value": "foo"}, {"value": "bar"}], - "bytes_value": {"value": "Zm9v"}, - "bytes_values": [{"value": "Zm9v"}, {"value": "YmFy"}] - }`, - expectedMask: []string{ - "double_value", - "double_values", - "float_value", - "float_values", - "int32_value", - "int32_values", - "int64_value", - "int64_values", - "uint32_value", - "uint32_values", - "uint64_value", - "uint64_values", - "bool_value", - "bool_values", - "string_value", - "string_values", - "bytes_value", - "bytes_values", - }, - }, -} - -func TestMarshalMessageWithWKTs(t *testing.T) { - for _, tt := range testMessagesWithWKTs { - if tt.unmarshalOnly { - continue - } - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithWKTs(t *testing.T) { - for _, tt := range testMessagesWithWKTs { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} - -var testMessagesWithOneofWKTs = []struct { - name string - msg MessageWithOneofWKTs - expected string - expectedMask []string -}{ - { - name: "empty", - msg: MessageWithOneofWKTs{}, - expected: `{}`, - }, - { - name: "double_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_DoubleValue{}, - }, - expected: `{"double_value": null}`, - expectedMask: []string{"double_value"}, - }, - { - name: "double_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_DoubleValue{DoubleValue: &types.DoubleValue{Value: 12.34}}, - }, - expected: `{"double_value": 12.34}`, - expectedMask: []string{"double_value"}, - }, - { - name: "float_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_FloatValue{}, - }, - expected: `{"float_value": null}`, - expectedMask: []string{"float_value"}, - }, - { - name: "float_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_FloatValue{FloatValue: &types.FloatValue{Value: 12.34}}, - }, - expected: `{"float_value": 12.34}`, - expectedMask: []string{"float_value"}, - }, - { - name: "int32_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_Int32Value{}, - }, - expected: `{"int32_value": null}`, - expectedMask: []string{"int32_value"}, - }, - { - name: "int32_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_Int32Value{Int32Value: &types.Int32Value{Value: -42}}, - }, - expected: `{"int32_value": -42}`, - expectedMask: []string{"int32_value"}, - }, - { - name: "int64_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_Int64Value{}, - }, - expected: `{"int64_value": null}`, - expectedMask: []string{"int64_value"}, - }, - { - name: "int64_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_Int64Value{Int64Value: &types.Int64Value{Value: -42}}, - }, - expected: `{"int64_value": "-42"}`, - expectedMask: []string{"int64_value"}, - }, - { - name: "uint32_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_Uint32Value{}, - }, - expected: `{"uint32_value": null}`, - expectedMask: []string{"uint32_value"}, - }, - { - name: "uint32_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_Uint32Value{Uint32Value: &types.UInt32Value{Value: 42}}, - }, - expected: `{"uint32_value": 42}`, - expectedMask: []string{"uint32_value"}, - }, - { - name: "uint64_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_Uint64Value{}, - }, - expected: `{"uint64_value": null}`, - expectedMask: []string{"uint64_value"}, - }, - { - name: "uint64_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_Uint64Value{Uint64Value: &types.UInt64Value{Value: 42}}, - }, - expected: `{"uint64_value": "42"}`, - expectedMask: []string{"uint64_value"}, - }, - { - name: "bool_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_BoolValue{}, - }, - expected: `{"bool_value": null}`, - expectedMask: []string{"bool_value"}, - }, - { - name: "bool_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_BoolValue{BoolValue: &types.BoolValue{Value: true}}, - }, - expected: `{"bool_value": true}`, - expectedMask: []string{"bool_value"}, - }, - { - name: "string_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_StringValue{}, - }, - expected: `{"string_value": null}`, - expectedMask: []string{"string_value"}, - }, - { - name: "string_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_StringValue{StringValue: &types.StringValue{Value: "foo"}}, - }, - expected: `{"string_value": "foo"}`, - expectedMask: []string{"string_value"}, - }, - { - name: "bytes_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_BytesValue{}, - }, - expected: `{"bytes_value": null}`, - expectedMask: []string{"bytes_value"}, - }, - { - name: "bytes_zero", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_BytesValue{BytesValue: &types.BytesValue{Value: []byte{}}}, - }, - expected: `{"bytes_value": ""}`, - expectedMask: []string{"bytes_value"}, - }, - { - name: "bytes_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_BytesValue{BytesValue: &types.BytesValue{Value: []byte("foo")}}, - }, - expected: `{"bytes_value": "Zm9v"}`, - expectedMask: []string{"bytes_value"}, - }, - { - name: "empty_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_EmptyValue{}, - }, - expected: `{"empty_value": null}`, - expectedMask: []string{"empty_value"}, - }, - { - name: "empty_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_EmptyValue{EmptyValue: &types.Empty{}}, - }, - expected: `{"empty_value": {}}`, - expectedMask: []string{"empty_value"}, - }, - { - name: "timestamp_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_TimestampValue{}, - }, - expected: `{"timestamp_value": null}`, - expectedMask: []string{"timestamp_value"}, - }, - { - name: "timestamp_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_TimestampValue{TimestampValue: mustTimestamp(testTime)}, - }, - expected: `{"timestamp_value": "2006-01-02T08:04:05.123456789Z"}`, - expectedMask: []string{"timestamp_value"}, - }, - { - name: "duration_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_DurationValue{}, - }, - expected: `{"duration_value": null}`, - expectedMask: []string{"duration_value"}, - }, - { - name: "duration_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_DurationValue{DurationValue: mustDuration(testDuration)}, - }, - expected: `{"duration_value": "3723.123456789s"}`, - expectedMask: []string{"duration_value"}, - }, - { - name: "field_mask_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_FieldMaskValue{}, - }, - expected: `{"field_mask_value": null}`, - expectedMask: []string{"field_mask_value"}, - }, - { - name: "field_mask_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_FieldMaskValue{FieldMaskValue: &types.FieldMask{Paths: []string{"foo.bar", "bar", "baz.qux"}}}, - }, - expected: `{"field_mask_value": "foo.bar,bar,baz.qux"}`, - expectedMask: []string{"field_mask_value"}, - }, - { - name: "value_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_ValueValue{ValueValue: &types.Value{Kind: &types.Value_NullValue{}}}, - }, - expected: `{"value_value": null}`, - expectedMask: []string{"value_value"}, - }, - { - name: "value_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_ValueValue{ValueValue: &types.Value{Kind: &types.Value_StringValue{StringValue: "foo"}}}, - }, - expected: `{"value_value": "foo"}`, - expectedMask: []string{"value_value"}, - }, - { - name: "list_value_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_ListValueValue{}, - }, - expected: `{"list_value_value": null}`, - expectedMask: []string{"list_value_value"}, - }, - { - name: "list_value_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_ListValueValue{ - ListValueValue: &types.ListValue{ - Values: []*types.Value{ - {Kind: &types.Value_NullValue{}}, - {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, - {Kind: &types.Value_StringValue{StringValue: "foo"}}, - {Kind: &types.Value_BoolValue{BoolValue: true}}, - }, - }, - }, - }, - expected: `{"list_value_value": [null, 12.34, "foo", true]}`, - expectedMask: []string{"list_value_value"}, - }, - { - name: "struct_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_StructValue{}, - }, - expected: `{"struct_value": null}`, - expectedMask: []string{"struct_value"}, - }, - { - name: "struct_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_StructValue{ - StructValue: &types.Struct{ - Fields: map[string]*types.Value{ - "null": {Kind: &types.Value_NullValue{}}, - "number": {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, - "string": {Kind: &types.Value_StringValue{StringValue: "foo"}}, - "bool": {Kind: &types.Value_BoolValue{BoolValue: true}}, - }, - }, - }, - }, - expected: `{"struct_value": {"bool": true, "null": null, "number": 12.34, "string": "foo"}}`, - expectedMask: []string{"struct_value"}, - }, - { - name: "any_null", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_AnyValue{}, - }, - expected: `{"any_value": null}`, - expectedMask: []string{"any_value"}, - }, - { - name: "any_value", - msg: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_AnyValue{ - AnyValue: mustAny(&MessageWithMarshaler{Message: "hello"}), - }, - }, - expected: `{"any_value": { - "@type": "type.googleapis.com/thethings.json.test.MessageWithMarshaler", - "message": "hello" - }}`, - expectedMask: []string{"any_value"}, - }, -} - -func TestMarshalMessageWithOneofWKTs(t *testing.T) { - for _, tt := range testMessagesWithOneofWKTs { - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithOneofWKTs(t *testing.T) { - for _, tt := range testMessagesWithOneofWKTs { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} - -var testMessagesWithWKTMaps = []struct { - name string - msg MessageWithWKTMaps - expected string - expectedMask []string -}{ - { - name: "empty", - msg: MessageWithWKTMaps{}, - expected: `{}`, - }, - { - name: "full", - msg: MessageWithWKTMaps{ - StringDoubleMap: map[string]*types.DoubleValue{"value": {Value: 12.34}}, - StringFloatMap: map[string]*types.FloatValue{"value": {Value: 12.34}}, - StringInt32Map: map[string]*types.Int32Value{"value": {Value: -42}}, - StringInt64Map: map[string]*types.Int64Value{"value": {Value: -42}}, - StringUint32Map: map[string]*types.UInt32Value{"value": {Value: 42}}, - StringUint64Map: map[string]*types.UInt64Value{"value": {Value: 42}}, - StringBoolMap: map[string]*types.BoolValue{"yes": {Value: true}}, - StringStringMap: map[string]*types.StringValue{"value": {Value: "foo"}}, - StringBytesMap: map[string]*types.BytesValue{"value": {Value: []byte("foo")}}, - StringEmptyMap: map[string]*types.Empty{"value": {}}, - StringTimestampMap: map[string]*types.Timestamp{"value": mustTimestamp(testTime)}, - StringDurationMap: map[string]*types.Duration{"value": mustDuration(testDuration)}, - StringFieldMaskMap: map[string]*types.FieldMask{"value": {Paths: []string{"foo.bar", "bar", "baz.qux"}}}, - StringValueMap: map[string]*types.Value{"value": {Kind: &types.Value_StringValue{StringValue: "foo"}}}, - StringListValueMap: map[string]*types.ListValue{"value": {Values: []*types.Value{ - {Kind: &types.Value_NullValue{}}, - {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, - {Kind: &types.Value_StringValue{StringValue: "foo"}}, - {Kind: &types.Value_BoolValue{BoolValue: true}}, - }}}, - StringStructMap: map[string]*types.Struct{ - "value": {Fields: map[string]*types.Value{ - "null": {Kind: &types.Value_NullValue{}}, - "number": {Kind: &types.Value_NumberValue{NumberValue: 12.34}}, - "string": {Kind: &types.Value_StringValue{StringValue: "foo"}}, - "bool": {Kind: &types.Value_BoolValue{BoolValue: true}}, - }}, - }, - StringAnyMap: map[string]*types.Any{ - "value": mustAny(&MessageWithMarshaler{Message: "hello"}), - }, - }, - expected: `{ - "string_double_map": {"value": 12.34}, - "string_float_map": {"value": 12.34}, - "string_int32_map": {"value": -42}, - "string_int64_map": {"value": "-42"}, - "string_uint32_map": {"value": 42}, - "string_uint64_map": {"value": "42"}, - "string_bool_map": {"yes": true}, - "string_string_map": {"value": "foo"}, - "string_bytes_map": {"value": "Zm9v"}, - "string_empty_map": {"value": {}}, - "string_timestamp_map": {"value": "2006-01-02T08:04:05.123456789Z"}, - "string_duration_map": {"value": "3723.123456789s"}, - "string_field_mask_map": {"value": "foo.bar,bar,baz.qux"}, - "string_value_map": {"value": "foo"}, - "string_list_value_map": {"value": [null, 12.34, "foo", true]}, - "string_struct_map": {"value": {"bool": true, "null": null, "number": 12.34, "string": "foo"}}, - "string_any_map": {"value": {"@type": "type.googleapis.com/thethings.json.test.MessageWithMarshaler", "message": "hello"}} - }`, - expectedMask: []string{ - "string_double_map", - "string_float_map", - "string_int32_map", - "string_int64_map", - "string_uint32_map", - "string_uint64_map", - "string_bool_map", - "string_string_map", - "string_bytes_map", - "string_empty_map", - "string_timestamp_map", - "string_duration_map", - "string_field_mask_map", - "string_value_map", - "string_list_value_map", - "string_struct_map", - "string_any_map", - }, - }, -} - -func TestMarshalMessageWithWKTMaps(t *testing.T) { - for _, tt := range testMessagesWithWKTMaps { - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithWKTMaps(t *testing.T) { - for _, tt := range testMessagesWithWKTMaps { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} diff --git a/test/golang/enums.pb.go b/test/golang/enums.pb.go index 15b74a95..b2101e96 100644 --- a/test/golang/enums.pb.go +++ b/test/golang/enums.pb.go @@ -11,7 +11,6 @@ package test import ( _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" - _ "github.com/gogo/protobuf/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -358,72 +357,69 @@ var file_enums_proto_rawDesc = []byte{ 0x0a, 0x0b, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, - 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, 0x0f, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, - 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, - 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x06, - 0xea, 0xaa, 0x19, 0x02, 0x18, 0x01, 0x22, 0x9c, 0x03, 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x3a, 0x0a, 0x07, 0x72, - 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, - 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x07, - 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x3c, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x75, 0x6c, - 0x61, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, - 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, - 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x08, 0x72, 0x65, 0x67, - 0x75, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x39, - 0x0a, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, 0x32, - 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, - 0x52, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x77, 0x72, 0x61, - 0x70, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, - 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, - 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, - 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x4d, 0x0a, 0x0f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, - 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x43, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x22, 0xe8, 0x01, 0x0a, 0x15, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, - 0x3c, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, - 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, - 0x75, 0x6d, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x39, 0x0a, - 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, 0x0f, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, + 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x06, 0xea, 0xaa, 0x19, 0x02, 0x18, 0x01, 0x22, 0x9c, 0x03, 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x3a, 0x0a, 0x07, + 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x48, 0x00, - 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x4d, 0x0a, 0x0e, 0x77, 0x72, 0x61, 0x70, - 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, + 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x3c, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x75, + 0x6c, 0x61, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x08, 0x72, 0x65, + 0x67, 0x75, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, + 0x39, 0x0a, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, + 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, + 0x6d, 0x52, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x77, 0x72, + 0x61, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, + 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, + 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, + 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x4d, 0x0a, 0x0f, 0x77, 0x72, 0x61, 0x70, 0x70, + 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, - 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, - 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x2a, 0x52, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x12, - 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, - 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, - 0x41, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x42, - 0x10, 0x02, 0x1a, 0x10, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x00, 0x20, 0x00, 0x88, 0xa3, 0x1e, 0x00, - 0xb0, 0xa4, 0x1e, 0x00, 0x2a, 0x73, 0x0a, 0x0a, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, - 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x55, 0x4e, 0x4b, - 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x0b, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, - 0x5f, 0x56, 0x31, 0x5f, 0x30, 0x10, 0x01, 0x1a, 0x10, 0xea, 0xaa, 0x19, 0x0c, 0x0a, 0x03, 0x31, - 0x2e, 0x30, 0x12, 0x05, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x12, 0x1e, 0x0a, 0x0d, 0x43, 0x55, 0x53, - 0x54, 0x4f, 0x4d, 0x5f, 0x56, 0x31, 0x5f, 0x30, 0x5f, 0x31, 0x10, 0x02, 0x1a, 0x0b, 0xea, 0xaa, - 0x19, 0x07, 0x0a, 0x05, 0x31, 0x2e, 0x30, 0x2e, 0x31, 0x1a, 0x0e, 0xea, 0xaa, 0x19, 0x0a, 0x18, - 0x01, 0x2a, 0x06, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x42, 0x48, 0x5a, 0x36, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, - 0x65, 0x73, 0x74, 0xf0, 0xe2, 0x1e, 0x01, 0xe8, 0xe2, 0x1e, 0x00, 0xea, 0xaa, 0x19, 0x04, 0x08, - 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x22, 0xe8, 0x01, 0x0a, 0x15, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x45, 0x6e, 0x75, 0x6d, 0x73, + 0x12, 0x3c, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, + 0x6e, 0x75, 0x6d, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x39, + 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, + 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x48, + 0x00, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x4d, 0x0a, 0x0e, 0x77, 0x72, 0x61, + 0x70, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, + 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, + 0x65, 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x2a, 0x4a, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, + 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, + 0x5f, 0x41, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, + 0x42, 0x10, 0x02, 0x1a, 0x08, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x00, 0x20, 0x00, 0x2a, 0x73, 0x0a, + 0x0a, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x0e, 0x43, + 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, + 0x21, 0x0a, 0x0b, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x56, 0x31, 0x5f, 0x30, 0x10, 0x01, + 0x1a, 0x10, 0xea, 0xaa, 0x19, 0x0c, 0x0a, 0x03, 0x31, 0x2e, 0x30, 0x12, 0x05, 0x31, 0x2e, 0x30, + 0x2e, 0x30, 0x12, 0x1e, 0x0a, 0x0d, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x56, 0x31, 0x5f, + 0x30, 0x5f, 0x31, 0x10, 0x02, 0x1a, 0x0b, 0xea, 0xaa, 0x19, 0x07, 0x0a, 0x05, 0x31, 0x2e, 0x30, + 0x2e, 0x31, 0x1a, 0x0e, 0xea, 0xaa, 0x19, 0x0a, 0x18, 0x01, 0x2a, 0x06, 0x43, 0x55, 0x53, 0x54, + 0x4f, 0x4d, 0x42, 0x40, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, + 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, + 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0xea, 0xaa, 0x19, 0x04, + 0x08, 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/test/golang/gogo.pb.go b/test/golang/gogo.pb.go deleted file mode 100644 index 65f0584e..00000000 --- a/test/golang/gogo.pb.go +++ /dev/null @@ -1,704 +0,0 @@ -// Copyright © 2021 The Things Industries B.V. -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: gogo.proto - -package test - -import ( - _ "github.com/TheThingsIndustries/protoc-gen-go-json/annotations" - _ "github.com/gogo/protobuf/gogoproto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type MessageWithGoGoOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - EuiWithCustomName []byte `protobuf:"bytes,1,opt,name=eui_with_custom_name,json=euiWithCustomName,proto3" json:"eui_with_custom_name,omitempty"` - EuiWithCustomNameAndType []byte `protobuf:"bytes,2,opt,name=eui_with_custom_name_and_type,json=euiWithCustomNameAndType,proto3" json:"eui_with_custom_name_and_type,omitempty"` - NonNullableEuiWithCustomNameAndType []byte `protobuf:"bytes,3,opt,name=non_nullable_eui_with_custom_name_and_type,json=nonNullableEuiWithCustomNameAndType,proto3" json:"non_nullable_eui_with_custom_name_and_type,omitempty"` - EuisWithCustomNameAndType [][]byte `protobuf:"bytes,4,rep,name=euis_with_custom_name_and_type,json=euisWithCustomNameAndType,proto3" json:"euis_with_custom_name_and_type,omitempty"` - Duration *durationpb.Duration `protobuf:"bytes,5,opt,name=duration,proto3" json:"duration,omitempty"` - NonNullableDuration *durationpb.Duration `protobuf:"bytes,6,opt,name=non_nullable_duration,json=nonNullableDuration,proto3" json:"non_nullable_duration,omitempty"` - Timestamp *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - NonNullableTimestamp *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=non_nullable_timestamp,json=nonNullableTimestamp,proto3" json:"non_nullable_timestamp,omitempty"` -} - -func (x *MessageWithGoGoOptions) Reset() { - *x = MessageWithGoGoOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_gogo_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MessageWithGoGoOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageWithGoGoOptions) ProtoMessage() {} - -func (x *MessageWithGoGoOptions) ProtoReflect() protoreflect.Message { - mi := &file_gogo_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MessageWithGoGoOptions.ProtoReflect.Descriptor instead. -func (*MessageWithGoGoOptions) Descriptor() ([]byte, []int) { - return file_gogo_proto_rawDescGZIP(), []int{0} -} - -func (x *MessageWithGoGoOptions) GetEuiWithCustomName() []byte { - if x != nil { - return x.EuiWithCustomName - } - return nil -} - -func (x *MessageWithGoGoOptions) GetEuiWithCustomNameAndType() []byte { - if x != nil { - return x.EuiWithCustomNameAndType - } - return nil -} - -func (x *MessageWithGoGoOptions) GetNonNullableEuiWithCustomNameAndType() []byte { - if x != nil { - return x.NonNullableEuiWithCustomNameAndType - } - return nil -} - -func (x *MessageWithGoGoOptions) GetEuisWithCustomNameAndType() [][]byte { - if x != nil { - return x.EuisWithCustomNameAndType - } - return nil -} - -func (x *MessageWithGoGoOptions) GetDuration() *durationpb.Duration { - if x != nil { - return x.Duration - } - return nil -} - -func (x *MessageWithGoGoOptions) GetNonNullableDuration() *durationpb.Duration { - if x != nil { - return x.NonNullableDuration - } - return nil -} - -func (x *MessageWithGoGoOptions) GetTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.Timestamp - } - return nil -} - -func (x *MessageWithGoGoOptions) GetNonNullableTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.NonNullableTimestamp - } - return nil -} - -type SubMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` -} - -func (x *SubMessage) Reset() { - *x = SubMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_gogo_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SubMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubMessage) ProtoMessage() {} - -func (x *SubMessage) ProtoReflect() protoreflect.Message { - mi := &file_gogo_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubMessage.ProtoReflect.Descriptor instead. -func (*SubMessage) Descriptor() ([]byte, []int) { - return file_gogo_proto_rawDescGZIP(), []int{1} -} - -func (x *SubMessage) GetField() string { - if x != nil { - return x.Field - } - return "" -} - -type SubMessageWithoutMarshalers struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OtherField string `protobuf:"bytes,1,opt,name=other_field,json=otherField,proto3" json:"other_field,omitempty"` -} - -func (x *SubMessageWithoutMarshalers) Reset() { - *x = SubMessageWithoutMarshalers{} - if protoimpl.UnsafeEnabled { - mi := &file_gogo_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SubMessageWithoutMarshalers) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubMessageWithoutMarshalers) ProtoMessage() {} - -func (x *SubMessageWithoutMarshalers) ProtoReflect() protoreflect.Message { - mi := &file_gogo_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubMessageWithoutMarshalers.ProtoReflect.Descriptor instead. -func (*SubMessageWithoutMarshalers) Descriptor() ([]byte, []int) { - return file_gogo_proto_rawDescGZIP(), []int{2} -} - -func (x *SubMessageWithoutMarshalers) GetOtherField() string { - if x != nil { - return x.OtherField - } - return "" -} - -type MessageWithNullable struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sub *SubMessage `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"` - Subs []*SubMessage `protobuf:"bytes,2,rep,name=subs,proto3" json:"subs,omitempty"` - OtherSub *SubMessageWithoutMarshalers `protobuf:"bytes,3,opt,name=other_sub,json=otherSub,proto3" json:"other_sub,omitempty"` - OtherSubs []*SubMessageWithoutMarshalers `protobuf:"bytes,4,rep,name=other_subs,json=otherSubs,proto3" json:"other_subs,omitempty"` -} - -func (x *MessageWithNullable) Reset() { - *x = MessageWithNullable{} - if protoimpl.UnsafeEnabled { - mi := &file_gogo_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MessageWithNullable) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageWithNullable) ProtoMessage() {} - -func (x *MessageWithNullable) ProtoReflect() protoreflect.Message { - mi := &file_gogo_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MessageWithNullable.ProtoReflect.Descriptor instead. -func (*MessageWithNullable) Descriptor() ([]byte, []int) { - return file_gogo_proto_rawDescGZIP(), []int{3} -} - -func (x *MessageWithNullable) GetSub() *SubMessage { - if x != nil { - return x.Sub - } - return nil -} - -func (x *MessageWithNullable) GetSubs() []*SubMessage { - if x != nil { - return x.Subs - } - return nil -} - -func (x *MessageWithNullable) GetOtherSub() *SubMessageWithoutMarshalers { - if x != nil { - return x.OtherSub - } - return nil -} - -func (x *MessageWithNullable) GetOtherSubs() []*SubMessageWithoutMarshalers { - if x != nil { - return x.OtherSubs - } - return nil -} - -type MessageWithEmbedded struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sub *SubMessage `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"` - OtherSub *SubMessageWithoutMarshalers `protobuf:"bytes,2,opt,name=other_sub,json=otherSub,proto3" json:"other_sub,omitempty"` -} - -func (x *MessageWithEmbedded) Reset() { - *x = MessageWithEmbedded{} - if protoimpl.UnsafeEnabled { - mi := &file_gogo_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MessageWithEmbedded) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageWithEmbedded) ProtoMessage() {} - -func (x *MessageWithEmbedded) ProtoReflect() protoreflect.Message { - mi := &file_gogo_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MessageWithEmbedded.ProtoReflect.Descriptor instead. -func (*MessageWithEmbedded) Descriptor() ([]byte, []int) { - return file_gogo_proto_rawDescGZIP(), []int{4} -} - -func (x *MessageWithEmbedded) GetSub() *SubMessage { - if x != nil { - return x.Sub - } - return nil -} - -func (x *MessageWithEmbedded) GetOtherSub() *SubMessageWithoutMarshalers { - if x != nil { - return x.OtherSub - } - return nil -} - -type MessageWithNullableEmbedded struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sub *SubMessage `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"` - OtherSub *SubMessageWithoutMarshalers `protobuf:"bytes,2,opt,name=other_sub,json=otherSub,proto3" json:"other_sub,omitempty"` -} - -func (x *MessageWithNullableEmbedded) Reset() { - *x = MessageWithNullableEmbedded{} - if protoimpl.UnsafeEnabled { - mi := &file_gogo_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MessageWithNullableEmbedded) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageWithNullableEmbedded) ProtoMessage() {} - -func (x *MessageWithNullableEmbedded) ProtoReflect() protoreflect.Message { - mi := &file_gogo_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MessageWithNullableEmbedded.ProtoReflect.Descriptor instead. -func (*MessageWithNullableEmbedded) Descriptor() ([]byte, []int) { - return file_gogo_proto_rawDescGZIP(), []int{5} -} - -func (x *MessageWithNullableEmbedded) GetSub() *SubMessage { - if x != nil { - return x.Sub - } - return nil -} - -func (x *MessageWithNullableEmbedded) GetOtherSub() *SubMessageWithoutMarshalers { - if x != nil { - return x.OtherSub - } - return nil -} - -var File_gogo_proto protoreflect.FileDescriptor - -var file_gogo_proto_rawDesc = []byte{ - 0x0a, 0x0a, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x74, 0x68, - 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, - 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x86, 0x0b, 0x0a, 0x16, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x57, 0x69, 0x74, 0x68, 0x47, 0x6f, 0x47, 0x6f, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x46, 0x0a, 0x14, 0x65, 0x75, 0x69, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x15, 0xe2, - 0xde, 0x1f, 0x11, 0x45, 0x55, 0x49, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x11, 0x65, 0x75, 0x69, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0xbd, 0x02, 0x0a, 0x1d, 0x65, 0x75, 0x69, 0x5f, - 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0xfb, 0x01, 0xe2, 0xde, 0x1f, 0x18, 0x45, 0x55, 0x49, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0xda, 0xde, - 0x1f, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, - 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, - 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, - 0x55, 0x49, 0x36, 0x34, 0xea, 0xaa, 0x19, 0x94, 0x01, 0x0a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, - 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, - 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, - 0x45, 0x58, 0x12, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, - 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, - 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x52, 0x18, 0x65, - 0x75, 0x69, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, - 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0xe4, 0x02, 0x0a, 0x2a, 0x6e, 0x6f, 0x6e, 0x5f, - 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x75, 0x69, 0x5f, 0x77, 0x69, 0x74, - 0x68, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x6e, - 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x8a, 0x02, 0xe2, - 0xde, 0x1f, 0x23, 0x4e, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x55, - 0x49, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, - 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0xda, 0xde, 0x1f, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, - 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, - 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x55, 0x49, 0x36, 0x34, 0xc8, 0xde, 0x1f, 0x00, - 0xea, 0xaa, 0x19, 0x94, 0x01, 0x0a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, - 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, - 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x12, 0x49, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, - 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6d, - 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x52, 0x23, 0x6e, 0x6f, 0x6e, 0x4e, 0x75, - 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x75, 0x69, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0xca, - 0x02, 0x0a, 0x1e, 0x65, 0x75, 0x69, 0x73, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x86, 0x02, 0xe2, 0xde, 0x1f, 0x19, 0x45, 0x55, - 0x49, 0x73, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, - 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0xda, 0xde, 0x1f, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, - 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, - 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x55, 0x49, 0x36, 0x34, 0xea, 0xaa, 0x19, - 0x9e, 0x01, 0x0a, 0x4c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, - 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, - 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x41, 0x72, 0x72, 0x61, 0x79, - 0x12, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, - 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, - 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, - 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x41, 0x72, 0x72, 0x61, 0x79, - 0x52, 0x19, 0x65, 0x75, 0x69, 0x73, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x64, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x08, - 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x57, 0x0a, 0x15, 0x6e, 0x6f, 0x6e, 0x5f, - 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x13, 0x6e, 0x6f, - 0x6e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x3e, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x5a, 0x0a, 0x16, 0x6e, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, - 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x14, 0x6e, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, - 0x61, 0x62, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x22, 0x0a, - 0x0a, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x22, 0x48, 0x0a, 0x1b, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, - 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, - 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x46, 0x69, 0x65, 0x6c, - 0x64, 0x3a, 0x08, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x00, 0x10, 0x00, 0x22, 0xb5, 0x02, 0x0a, 0x13, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x75, 0x6c, 0x6c, 0x61, - 0x62, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x03, 0x73, 0x75, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, - 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x03, 0x73, 0x75, 0x62, 0x12, 0x39, 0x0a, 0x04, - 0x73, 0x75, 0x62, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, - 0x00, 0x52, 0x04, 0x73, 0x75, 0x62, 0x73, 0x12, 0x53, 0x0a, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, - 0x5f, 0x73, 0x75, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, - 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x04, 0xc8, 0xde, - 0x1f, 0x00, 0x52, 0x08, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x75, 0x62, 0x12, 0x55, 0x0a, 0x0a, - 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, - 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, - 0x72, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, - 0x75, 0x62, 0x73, 0x22, 0xa3, 0x01, 0x0a, 0x13, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, - 0x69, 0x74, 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x03, 0x73, - 0x75, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, - 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x04, 0xd0, 0xde, 0x1f, 0x01, 0x52, - 0x03, 0x73, 0x75, 0x62, 0x12, 0x53, 0x0a, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, - 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, - 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, - 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, - 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x04, 0xd0, 0xde, 0x1f, 0x01, 0x52, - 0x08, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x75, 0x62, 0x22, 0xb3, 0x01, 0x0a, 0x1b, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, - 0x65, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x03, 0x73, 0x75, 0x62, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, - 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0xd0, 0xde, 0x1f, - 0x01, 0x52, 0x03, 0x73, 0x75, 0x62, 0x12, 0x57, 0x0a, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, - 0x73, 0x75, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, 0x74, - 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, - 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, - 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x08, 0xc8, 0xde, 0x1f, - 0x00, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x08, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x75, 0x62, 0x42, - 0x40, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, - 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, - 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, - 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_gogo_proto_rawDescOnce sync.Once - file_gogo_proto_rawDescData = file_gogo_proto_rawDesc -) - -func file_gogo_proto_rawDescGZIP() []byte { - file_gogo_proto_rawDescOnce.Do(func() { - file_gogo_proto_rawDescData = protoimpl.X.CompressGZIP(file_gogo_proto_rawDescData) - }) - return file_gogo_proto_rawDescData -} - -var file_gogo_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_gogo_proto_goTypes = []interface{}{ - (*MessageWithGoGoOptions)(nil), // 0: thethings.json.test.MessageWithGoGoOptions - (*SubMessage)(nil), // 1: thethings.json.test.SubMessage - (*SubMessageWithoutMarshalers)(nil), // 2: thethings.json.test.SubMessageWithoutMarshalers - (*MessageWithNullable)(nil), // 3: thethings.json.test.MessageWithNullable - (*MessageWithEmbedded)(nil), // 4: thethings.json.test.MessageWithEmbedded - (*MessageWithNullableEmbedded)(nil), // 5: thethings.json.test.MessageWithNullableEmbedded - (*durationpb.Duration)(nil), // 6: google.protobuf.Duration - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp -} -var file_gogo_proto_depIdxs = []int32{ - 6, // 0: thethings.json.test.MessageWithGoGoOptions.duration:type_name -> google.protobuf.Duration - 6, // 1: thethings.json.test.MessageWithGoGoOptions.non_nullable_duration:type_name -> google.protobuf.Duration - 7, // 2: thethings.json.test.MessageWithGoGoOptions.timestamp:type_name -> google.protobuf.Timestamp - 7, // 3: thethings.json.test.MessageWithGoGoOptions.non_nullable_timestamp:type_name -> google.protobuf.Timestamp - 1, // 4: thethings.json.test.MessageWithNullable.sub:type_name -> thethings.json.test.SubMessage - 1, // 5: thethings.json.test.MessageWithNullable.subs:type_name -> thethings.json.test.SubMessage - 2, // 6: thethings.json.test.MessageWithNullable.other_sub:type_name -> thethings.json.test.SubMessageWithoutMarshalers - 2, // 7: thethings.json.test.MessageWithNullable.other_subs:type_name -> thethings.json.test.SubMessageWithoutMarshalers - 1, // 8: thethings.json.test.MessageWithEmbedded.sub:type_name -> thethings.json.test.SubMessage - 2, // 9: thethings.json.test.MessageWithEmbedded.other_sub:type_name -> thethings.json.test.SubMessageWithoutMarshalers - 1, // 10: thethings.json.test.MessageWithNullableEmbedded.sub:type_name -> thethings.json.test.SubMessage - 2, // 11: thethings.json.test.MessageWithNullableEmbedded.other_sub:type_name -> thethings.json.test.SubMessageWithoutMarshalers - 12, // [12:12] is the sub-list for method output_type - 12, // [12:12] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name -} - -func init() { file_gogo_proto_init() } -func file_gogo_proto_init() { - if File_gogo_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_gogo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageWithGoGoOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gogo_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gogo_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubMessageWithoutMarshalers); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gogo_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageWithNullable); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gogo_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageWithEmbedded); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gogo_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageWithNullableEmbedded); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_gogo_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_gogo_proto_goTypes, - DependencyIndexes: file_gogo_proto_depIdxs, - MessageInfos: file_gogo_proto_msgTypes, - }.Build() - File_gogo_proto = out.File - file_gogo_proto_rawDesc = nil - file_gogo_proto_goTypes = nil - file_gogo_proto_depIdxs = nil -} diff --git a/test/golang/gogo_json.pb.go b/test/golang/gogo_json.pb.go deleted file mode 100644 index ab10824f..00000000 --- a/test/golang/gogo_json.pb.go +++ /dev/null @@ -1,444 +0,0 @@ -// Code generated by protoc-gen-go-json. DO NOT EDIT. -// versions: -// - protoc-gen-go-json v0.0.0-dev -// - protoc v3.20.1 -// source: gogo.proto - -package test - -import ( - golang "github.com/TheThingsIndustries/protoc-gen-go-json/golang" - jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-json/jsonplugin" - types "github.com/TheThingsIndustries/protoc-gen-go-json/test/types" -) - -// MarshalProtoJSON marshals the MessageWithGoGoOptions message to JSON. -func (x *MessageWithGoGoOptions) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if len(x.EuiWithCustomName) > 0 || s.HasField("eui_with_custom_name") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("eui_with_custom_name") - s.WriteBytes(x.EuiWithCustomName) - } - if len(x.EuiWithCustomNameAndType) > 0 || s.HasField("eui_with_custom_name_and_type") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("eui_with_custom_name_and_type") - types.MarshalHEX(s.WithField("eui_with_custom_name_and_type"), x.EuiWithCustomNameAndType) - } - if len(x.NonNullableEuiWithCustomNameAndType) > 0 || s.HasField("non_nullable_eui_with_custom_name_and_type") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("non_nullable_eui_with_custom_name_and_type") - types.MarshalHEX(s.WithField("non_nullable_eui_with_custom_name_and_type"), x.NonNullableEuiWithCustomNameAndType) - } - if len(x.EuisWithCustomNameAndType) > 0 || s.HasField("euis_with_custom_name_and_type") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("euis_with_custom_name_and_type") - types.MarshalHEXArray(s.WithField("euis_with_custom_name_and_type"), x.EuisWithCustomNameAndType) - } - if x.Duration != nil || s.HasField("duration") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("duration") - if x.Duration == nil { - s.WriteNil() - } else { - golang.MarshalDuration(s, x.Duration) - } - } - if x.NonNullableDuration != nil || s.HasField("non_nullable_duration") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("non_nullable_duration") - if x.NonNullableDuration == nil { - s.WriteNil() - } else { - golang.MarshalDuration(s, x.NonNullableDuration) - } - } - if x.Timestamp != nil || s.HasField("timestamp") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("timestamp") - if x.Timestamp == nil { - s.WriteNil() - } else { - golang.MarshalTimestamp(s, x.Timestamp) - } - } - if x.NonNullableTimestamp != nil || s.HasField("non_nullable_timestamp") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("non_nullable_timestamp") - if x.NonNullableTimestamp == nil { - s.WriteNil() - } else { - golang.MarshalTimestamp(s, x.NonNullableTimestamp) - } - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithGoGoOptions to JSON. -func (x *MessageWithGoGoOptions) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithGoGoOptions message from JSON. -func (x *MessageWithGoGoOptions) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "eui_with_custom_name", "euiWithCustomName": - s.AddField("eui_with_custom_name") - x.EuiWithCustomName = s.ReadBytes() - case "eui_with_custom_name_and_type", "euiWithCustomNameAndType": - s.AddField("eui_with_custom_name_and_type") - x.EuiWithCustomNameAndType = types.UnmarshalHEX(s.WithField("eui_with_custom_name_and_type", false)) - case "non_nullable_eui_with_custom_name_and_type", "nonNullableEuiWithCustomNameAndType": - s.AddField("non_nullable_eui_with_custom_name_and_type") - x.NonNullableEuiWithCustomNameAndType = types.UnmarshalHEX(s.WithField("non_nullable_eui_with_custom_name_and_type", false)) - case "euis_with_custom_name_and_type", "euisWithCustomNameAndType": - s.AddField("euis_with_custom_name_and_type") - if s.ReadNil() { - x.EuisWithCustomNameAndType = nil - return - } - x.EuisWithCustomNameAndType = types.UnmarshalHEXArray(s.WithField("euis_with_custom_name_and_type", false)) - case "duration": - s.AddField("duration") - if s.ReadNil() { - x.Duration = nil - return - } - v := golang.UnmarshalDuration(s) - if s.Err() != nil { - return - } - x.Duration = v - case "non_nullable_duration", "nonNullableDuration": - s.AddField("non_nullable_duration") - if s.ReadNil() { - x.NonNullableDuration = nil - return - } - v := golang.UnmarshalDuration(s) - if s.Err() != nil { - return - } - x.NonNullableDuration = v - case "timestamp": - s.AddField("timestamp") - if s.ReadNil() { - x.Timestamp = nil - return - } - v := golang.UnmarshalTimestamp(s) - if s.Err() != nil { - return - } - x.Timestamp = v - case "non_nullable_timestamp", "nonNullableTimestamp": - s.AddField("non_nullable_timestamp") - if s.ReadNil() { - x.NonNullableTimestamp = nil - return - } - v := golang.UnmarshalTimestamp(s) - if s.Err() != nil { - return - } - x.NonNullableTimestamp = v - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithGoGoOptions from JSON. -func (x *MessageWithGoGoOptions) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the SubMessage message to JSON. -func (x *SubMessage) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.Field != "" || s.HasField("field") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("field") - s.WriteString(x.Field) - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the SubMessage to JSON. -func (x *SubMessage) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the SubMessage message from JSON. -func (x *SubMessage) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "field": - s.AddField("field") - x.Field = s.ReadString() - } - }) -} - -// UnmarshalJSON unmarshals the SubMessage from JSON. -func (x *SubMessage) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithNullable message to JSON. -func (x *MessageWithNullable) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.Sub != nil || s.HasField("sub") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sub") - x.Sub.MarshalProtoJSON(s.WithField("sub")) - } - if len(x.Subs) > 0 || s.HasField("subs") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("subs") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.Subs { - s.WriteMoreIf(&wroteElement) - element.MarshalProtoJSON(s.WithField("subs")) - } - s.WriteArrayEnd() - } - if x.OtherSub != nil || s.HasField("other_sub") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("other_sub") - // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. - golang.MarshalMessage(s, x.OtherSub) - } - if len(x.OtherSubs) > 0 || s.HasField("other_subs") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("other_subs") - s.WriteArrayStart() - var wroteElement bool - for _, element := range x.OtherSubs { - s.WriteMoreIf(&wroteElement) - // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. - golang.MarshalMessage(s, element) - } - s.WriteArrayEnd() - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithNullable to JSON. -func (x *MessageWithNullable) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithNullable message from JSON. -func (x *MessageWithNullable) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "sub": - if s.ReadNil() { - x.Sub = nil - return - } - x.Sub = &SubMessage{} - x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) - case "subs": - s.AddField("subs") - if s.ReadNil() { - x.Subs = nil - return - } - s.ReadArray(func() { - if s.ReadNil() { - x.Subs = append(x.Subs, nil) - return - } - v := &SubMessage{} - v.UnmarshalProtoJSON(s.WithField("subs", false)) - if s.Err() != nil { - return - } - x.Subs = append(x.Subs, v) - }) - case "other_sub", "otherSub": - s.AddField("other_sub") - if s.ReadNil() { - x.OtherSub = nil - return - } - // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. - var v SubMessageWithoutMarshalers - golang.UnmarshalMessage(s, &v) - x.OtherSub = &v - case "other_subs", "otherSubs": - s.AddField("other_subs") - if s.ReadNil() { - x.OtherSubs = nil - return - } - s.ReadArray(func() { - // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. - var v SubMessageWithoutMarshalers - golang.UnmarshalMessage(s, &v) - x.OtherSubs = append(x.OtherSubs, &v) - }) - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithNullable from JSON. -func (x *MessageWithNullable) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithEmbedded message to JSON. -func (x *MessageWithEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.Sub != nil || s.HasField("sub") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sub") - x.Sub.MarshalProtoJSON(s.WithField("sub")) - } - if x.OtherSub != nil || s.HasField("other_sub") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("other_sub") - // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. - golang.MarshalMessage(s, x.OtherSub) - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithEmbedded to JSON. -func (x *MessageWithEmbedded) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithEmbedded message from JSON. -func (x *MessageWithEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "sub": - if s.ReadNil() { - x.Sub = nil - return - } - x.Sub = &SubMessage{} - x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) - case "other_sub", "otherSub": - s.AddField("other_sub") - if s.ReadNil() { - x.OtherSub = nil - return - } - // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. - var v SubMessageWithoutMarshalers - golang.UnmarshalMessage(s, &v) - x.OtherSub = &v - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithEmbedded from JSON. -func (x *MessageWithEmbedded) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} - -// MarshalProtoJSON marshals the MessageWithNullableEmbedded message to JSON. -func (x *MessageWithNullableEmbedded) MarshalProtoJSON(s *jsonplugin.MarshalState) { - if x == nil { - s.WriteNil() - return - } - s.WriteObjectStart() - var wroteField bool - if x.Sub != nil || s.HasField("sub") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("sub") - x.Sub.MarshalProtoJSON(s.WithField("sub")) - } - if x.OtherSub != nil || s.HasField("other_sub") { - s.WriteMoreIf(&wroteField) - s.WriteObjectField("other_sub") - // NOTE: SubMessageWithoutMarshalers does not seem to implement MarshalProtoJSON. - golang.MarshalMessage(s, x.OtherSub) - } - s.WriteObjectEnd() -} - -// MarshalJSON marshals the MessageWithNullableEmbedded to JSON. -func (x *MessageWithNullableEmbedded) MarshalJSON() ([]byte, error) { - return jsonplugin.DefaultMarshalerConfig.Marshal(x) -} - -// UnmarshalProtoJSON unmarshals the MessageWithNullableEmbedded message from JSON. -func (x *MessageWithNullableEmbedded) UnmarshalProtoJSON(s *jsonplugin.UnmarshalState) { - if s.ReadNil() { - return - } - s.ReadObject(func(key string) { - switch key { - default: - s.ReadAny() // ignore unknown field - case "sub": - if s.ReadNil() { - x.Sub = nil - return - } - x.Sub = &SubMessage{} - x.Sub.UnmarshalProtoJSON(s.WithField("sub", true)) - case "other_sub", "otherSub": - s.AddField("other_sub") - if s.ReadNil() { - x.OtherSub = nil - return - } - // NOTE: SubMessageWithoutMarshalers does not seem to implement UnmarshalProtoJSON. - var v SubMessageWithoutMarshalers - golang.UnmarshalMessage(s, &v) - x.OtherSub = &v - } - }) -} - -// UnmarshalJSON unmarshals the MessageWithNullableEmbedded from JSON. -func (x *MessageWithNullableEmbedded) UnmarshalJSON(b []byte) error { - return jsonplugin.DefaultUnmarshalerConfig.Unmarshal(b, x) -} diff --git a/test/golang/gogo_test.go b/test/golang/gogo_test.go deleted file mode 100644 index 17042ceb..00000000 --- a/test/golang/gogo_test.go +++ /dev/null @@ -1,262 +0,0 @@ -package test_test - -import ( - "testing" - - . "github.com/TheThingsIndustries/protoc-gen-go-json/test/golang" -) - -var testMessagesWithGoGoOptions = []struct { - name string - msg MessageWithGoGoOptions - expected string - expectedMask []string -}{ - { - name: "empty", - msg: MessageWithGoGoOptions{}, - expected: `{}`, - }, - { - name: "zero", - msg: MessageWithGoGoOptions{}, - expected: `{ - "eui_with_custom_name": null, - "eui_with_custom_name_and_type": null, - "non_nullable_eui_with_custom_name_and_type": null, - "euis_with_custom_name_and_type": [], - "duration": null, - "non_nullable_duration": null, - "timestamp": null, - "non_nullable_timestamp": null - }`, - expectedMask: []string{ - "eui_with_custom_name", - "eui_with_custom_name_and_type", - "non_nullable_eui_with_custom_name_and_type", - "euis_with_custom_name_and_type", - "duration", - "non_nullable_duration", - "timestamp", - "non_nullable_timestamp", - }, - }, - { - name: "full", - msg: MessageWithGoGoOptions{ - EuiWithCustomName: []byte{1, 2, 3, 4, 5, 6, 7, 8}, - EuiWithCustomNameAndType: []byte{1, 2, 3, 4, 5, 6, 7, 8}, - NonNullableEuiWithCustomNameAndType: []byte{1, 2, 3, 4, 5, 6, 7, 8}, - EuisWithCustomNameAndType: [][]byte{ - {1, 2, 3, 4, 5, 6, 7, 8}, - }, - Duration: mustDuration(testDuration), - NonNullableDuration: mustDuration(testDuration), - Timestamp: mustTimestamp(testTime), - NonNullableTimestamp: mustTimestamp(testTime), - }, - expected: `{ - "eui_with_custom_name": "AQIDBAUGBwg=", - "eui_with_custom_name_and_type": "0102030405060708", - "non_nullable_eui_with_custom_name_and_type": "0102030405060708", - "euis_with_custom_name_and_type": ["0102030405060708"], - "duration": "3723.123456789s", - "non_nullable_duration": "3723.123456789s", - "timestamp": "2006-01-02T08:04:05.123456789Z", - "non_nullable_timestamp": "2006-01-02T08:04:05.123456789Z" - }`, - expectedMask: []string{ - "eui_with_custom_name", - "eui_with_custom_name_and_type", - "non_nullable_eui_with_custom_name_and_type", - "euis_with_custom_name_and_type", - "duration", - "non_nullable_duration", - "timestamp", - "non_nullable_timestamp", - }, - }, -} - -func TestMarshalMessageWithGoGoOptions(t *testing.T) { - for _, tt := range testMessagesWithGoGoOptions { - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithGoGoOptions(t *testing.T) { - for _, tt := range testMessagesWithGoGoOptions { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} - -var testMessagesWithNullable = []struct { - name string - msg MessageWithNullable - expected string - expectedMask []string -}{ - { - name: "empty", - msg: MessageWithNullable{ - Sub: &SubMessage{Field: "foo"}, - OtherSub: &SubMessageWithoutMarshalers{OtherField: "foo"}, - }, - expected: `{ - "sub": {"field": "foo"}, - "other_sub": {"other_field": "foo"} - }`, - expectedMask: []string{ - "sub.field", - "other_sub", // NOTE: no marshaler. - }, - }, - { - name: "full", - msg: MessageWithNullable{ - Sub: &SubMessage{Field: "foo"}, - Subs: []*SubMessage{ - {Field: "foo"}, - {Field: "bar"}, - }, - OtherSub: &SubMessageWithoutMarshalers{OtherField: "foo"}, - OtherSubs: []*SubMessageWithoutMarshalers{ - {OtherField: "foo"}, - {OtherField: "bar"}, - }, - }, - expected: `{ - "sub": {"field": "foo"}, - "subs": [ - {"field": "foo"}, - {"field": "bar"} - ], - "other_sub": {"other_field": "foo"}, - "other_subs": [ - {"other_field": "foo"}, - {"other_field": "bar"} - ] - }`, - expectedMask: []string{ - "sub.field", - "subs", - "other_sub", // NOTE: no marshaler. - "other_subs", - }, - }, -} - -func TestMarshalMessageWithNullable(t *testing.T) { - for _, tt := range testMessagesWithNullable { - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithNullable(t *testing.T) { - for _, tt := range testMessagesWithNullable { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} - -var testMessagesWithEmbedded = []struct { - name string - msg MessageWithEmbedded - expected string - expectedMask []string -}{ - { - name: "empty", - msg: MessageWithEmbedded{}, - expected: `{}`, - }, - { - name: "zero", - msg: MessageWithEmbedded{ - Sub: &SubMessage{}, - }, - expected: `{ - "sub": {"field": ""} - }`, - expectedMask: []string{ - "sub.field", - }, - }, - { - name: "full", - msg: MessageWithEmbedded{ - Sub: &SubMessage{Field: "foo"}, - OtherSub: &SubMessageWithoutMarshalers{OtherField: "foo"}, - }, - expected: `{ - "sub": {"field": "foo"}, - "other_sub": {"other_field": "foo"} - }`, - expectedMask: []string{ - "sub.field", - "other_sub", // NOTE: no marshaler. - }, - }, -} - -func TestMarshalMessageWithEmbedded(t *testing.T) { - for _, tt := range testMessagesWithEmbedded { - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithEmbedded(t *testing.T) { - for _, tt := range testMessagesWithEmbedded { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} - -var testMessagesWithNullableEmbedded = []struct { - name string - msg MessageWithNullableEmbedded - expected string - expectedMask []string -}{ - { - name: "full", - msg: MessageWithNullableEmbedded{ - Sub: &SubMessage{Field: "foo"}, - OtherSub: &SubMessageWithoutMarshalers{OtherField: "foo"}, - }, - expected: `{ - "sub": {"field": "foo"}, - "other_sub": {"other_field": "foo"} - }`, - expectedMask: []string{ - "sub.field", - "other_sub", // NOTE: no marshaler. - }, - }, -} - -func TestMarshalMessageWithNullableEmbedded(t *testing.T) { - for _, tt := range testMessagesWithNullableEmbedded { - t.Run(tt.name, func(t *testing.T) { - expectMarshalEqual(t, &tt.msg, tt.expectedMask, []byte(tt.expected)) - }) - } -} - -func TestUnmarshalMessageWithNullableEmbedded(t *testing.T) { - for _, tt := range testMessagesWithNullableEmbedded { - t.Run(tt.name, func(t *testing.T) { - expectUnmarshalEqual(t, &tt.msg, []byte(tt.expected), tt.expectedMask) - }) - } -} From bbdaa6c20ab3ee5b00a02eb514992b8b1cf448c1 Mon Sep 17 00:00:00 2001 From: Adrian-Stefan Mares <36161392+adriansmares@users.noreply.github.com> Date: Thu, 6 Apr 2023 14:21:58 +0200 Subject: [PATCH 38/46] Provide error unwrapping (#24) --- jsonplugin/marshal.go | 4 ++++ jsonplugin/unmarshal.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/jsonplugin/marshal.go b/jsonplugin/marshal.go index db2e8ef7..18804812 100644 --- a/jsonplugin/marshal.go +++ b/jsonplugin/marshal.go @@ -31,6 +31,10 @@ func (e *marshalError) Error() string { return fmt.Sprintf("marshal error: %v", e.Err) } +func (e *marshalError) Unwrap() error { + return e.Err +} + // MarshalerConfig is the configuration for the Marshaler. type MarshalerConfig struct { EnumsAsInts bool diff --git a/jsonplugin/unmarshal.go b/jsonplugin/unmarshal.go index d0bd137d..59bdfb79 100644 --- a/jsonplugin/unmarshal.go +++ b/jsonplugin/unmarshal.go @@ -31,6 +31,10 @@ func (e *unmarshalError) Error() string { return fmt.Sprintf("unmarshal error: %v", e.Err) } +func (e *unmarshalError) Unwrap() error { + return e.Err +} + // UnmarshalerConfig is the configuration for the Unmarshaler. type UnmarshalerConfig struct{} From 661cf9113391244cb7b74bab12ecdf4fdb2ed44c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jul 2023 11:26:03 +0200 Subject: [PATCH 39/46] Bump google.golang.org/protobuf from 1.30.0 to 1.31.0 (#25) Bumps google.golang.org/protobuf from 1.30.0 to 1.31.0. --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d20c8ab6..af0d3ad0 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.17 require ( github.com/google/go-cmp v0.5.9 github.com/json-iterator/go v1.1.12 - google.golang.org/protobuf v1.30.0 + google.golang.org/protobuf v1.31.0 ) require ( diff --git a/go.sum b/go.sum index da212cdf..08ad1872 100644 --- a/go.sum +++ b/go.sum @@ -20,5 +20,5 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= From 26ea0d350c88dd754fa5fcea28c6d8c66b6623c5 Mon Sep 17 00:00:00 2001 From: Johan Stokking Date: Tue, 8 Aug 2023 15:42:10 +0200 Subject: [PATCH 40/46] Build with Buf and push to BSR (#26) * Initialize buf module * Update Go * Move annotations.proto to api/thethings/json * Format files * Regenerate protos * Add test to workspace * Build protos with buf * Lint, format and push protos in CI * Remove triage for PRs --------- Co-authored-by: Hylke Visser --- .github/workflows/bsr.yml | 23 + .github/workflows/buf.yml | 21 + .github/workflows/{go-code.yml => go.yml} | 17 +- .github/workflows/issue-triage.yml | 4 +- .gitignore | 1 - Makefile | 34 +- annotations/annotations.pb.go | 330 +++---- api/buf.yaml | 10 + .../thethings/json/annotations.proto | 16 +- buf.gen.test.yaml | 12 + buf.gen.yaml | 6 + buf.work.yaml | 4 + go.mod | 2 +- test/buf.yaml | 15 + test/enums.proto | 29 +- test/fieldmask.proto | 9 +- test/golang/api.pb.go | 4 +- test/golang/enums.pb.go | 127 +-- test/golang/enums_json.pb.go | 2 +- test/golang/fieldmask.pb.go | 125 +-- test/golang/fieldmask_json.pb.go | 2 +- test/golang/scalars.pb.go | 883 +++++++++--------- test/golang/scalars_json.pb.go | 2 +- test/golang/wkts.pb.go | 859 ++++++++--------- test/golang/wkts_json.pb.go | 2 +- test/scalars.proto | 102 +- test/wkts.proto | 50 +- 27 files changed, 1384 insertions(+), 1307 deletions(-) create mode 100644 .github/workflows/bsr.yml create mode 100644 .github/workflows/buf.yml rename .github/workflows/{go-code.yml => go.yml} (50%) create mode 100644 api/buf.yaml rename annotations.proto => api/thethings/json/annotations.proto (97%) create mode 100644 buf.gen.test.yaml create mode 100644 buf.gen.yaml create mode 100644 buf.work.yaml create mode 100644 test/buf.yaml diff --git a/.github/workflows/bsr.yml b/.github/workflows/bsr.yml new file mode 100644 index 00000000..23c14391 --- /dev/null +++ b/.github/workflows/bsr.yml @@ -0,0 +1,23 @@ +name: Buf Schema Registry + +on: + push: + tags: + - "v*" + +jobs: + push: + name: Push + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + - name: Install Buf + uses: bufbuild/buf-setup-action@v1 + with: + version: "1.25.1" + - name: Push + uses: bufbuild/buf-push-action@v1 + with: + input: api + buf_token: ${{ secrets.BUF_TOKEN }} diff --git a/.github/workflows/buf.yml b/.github/workflows/buf.yml new file mode 100644 index 00000000..4e1a0d55 --- /dev/null +++ b/.github/workflows/buf.yml @@ -0,0 +1,21 @@ +name: Buf + +on: + - push + - pull_request + +jobs: + lint: + name: Lint and Format + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + - name: Install Buf + uses: bufbuild/buf-setup-action@v1 + with: + version: "1.25.1" + - name: Buf lint + uses: bufbuild/buf-lint-action@v1 + - name: Buf format + run: buf format --exit-code diff --git a/.github/workflows/go-code.yml b/.github/workflows/go.yml similarity index 50% rename from .github/workflows/go-code.yml rename to .github/workflows/go.yml index f5c0f937..60e101ba 100644 --- a/.github/workflows/go-code.yml +++ b/.github/workflows/go.yml @@ -1,4 +1,4 @@ -name: Go Code +name: Go on: - push @@ -6,17 +6,20 @@ on: jobs: test: - name: Go Test - runs-on: ubuntu-22.04 - timeout-minutes: 10 + name: Test + runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v3 - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "~1.17" - - name: Clean Build + go-version: "~1.20" + - name: Install Buf + uses: bufbuild/buf-setup-action@v1 + with: + version: "1.25.1" + - name: Clean and Build run: make clean build - - name: Go Test + - name: Test run: make test diff --git a/.github/workflows/issue-triage.yml b/.github/workflows/issue-triage.yml index a4b3ee78..f7122ea1 100644 --- a/.github/workflows/issue-triage.yml +++ b/.github/workflows/issue-triage.yml @@ -2,13 +2,11 @@ name: Triage New Issues on: issues: types: [opened] - pull_request_target: - types: [opened] jobs: triage: name: Triage New Issues - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest timeout-minutes: 5 steps: - name: Add "needs/triage" label diff --git a/.gitignore b/.gitignore index 77d84fa7..8591c17c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /.bin -/.dev # https://raw.githubusercontent.com/github/gitignore/master/Global/Linux.gitignore diff --git a/Makefile b/Makefile index 433df6d0..94380f1f 100644 --- a/Makefile +++ b/Makefile @@ -11,12 +11,11 @@ clean: rm -f ./annotations/*.pb.go rm -f ./test/*/*.pb.go -.dev/protoc-gen-go-json/annotations.proto: annotations.proto - mkdir -p $(shell dirname $@) - cp $< $@ +.bin/protoc-gen-go: go.mod + GOBIN=$(PWD)/.bin go install google.golang.org/protobuf/cmd/protoc-gen-go -annotations/annotations.pb.go: .dev/protoc-gen-go-json/annotations.proto .dev/golangproto/bin/protoc .dev/golangproto/bin/protoc-gen-go - PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I .dev --go_opt=module=github.com/TheThingsIndustries/protoc-gen-go-json --go_out=./ $< +annotations/annotations.pb.go: api/thethings/json/annotations.proto .bin/protoc-gen-go + buf generate api BINARY_DEPS = annotations/annotations.pb.go $(wildcard cmd/protoc-gen-go-json/*.go) $(wildcard internal/gen/*.go) @@ -40,31 +39,12 @@ build: .bin/protoc-gen-go-json .bin/protoc-gen-go-json-linux-amd64 .bin/protoc-g .PHONY: watch watch: - ls annotations.proto cmd/protoc-gen-go-json/*.go internal/gen/*.go test/*.proto | entr make build test - -OS := -ifeq ($(shell uname),Linux) - OS = linux -endif -ifeq ($(shell uname),Darwin) - OS = osx -endif - -.dev/golangproto/bin/protoc: - mkdir -p .dev/golangproto/bin - curl -sSL -o .dev/golangproto/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.20.1/protoc-3.20.1-$(OS)-x86_64.zip - unzip -o .dev/golangproto/protoc.zip -d .dev/golangproto/ - -.dev/golangproto/bin/protoc-gen-go: - go build -o $@ google.golang.org/protobuf/cmd/protoc-gen-go + ls api/thethings/json/annotations.proto cmd/protoc-gen-go-json/*.go internal/gen/*.go test/*.proto | entr make build test .PHONY: testprotos -testprotos: build .dev/golangproto/bin/protoc .dev/golangproto/bin/protoc-gen-go - PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I ./test -I . \ - --go_opt=paths=source_relative --go_out=./test/golang \ - --go-json_opt=paths=source_relative --go-json_opt=std=true --go-json_out=./test/golang \ - ./test/*.proto +testprotos: build .bin/protoc-gen-go + buf generate --template buf.gen.test.yaml test .PHONY: test diff --git a/annotations/annotations.pb.go b/annotations/annotations.pb.go index 7fb689ae..6965a5d7 100644 --- a/annotations/annotations.pb.go +++ b/annotations/annotations.pb.go @@ -3,9 +3,9 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: protoc-gen-go-json/annotations.proto +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: thethings/json/annotations.proto package annotations @@ -40,7 +40,7 @@ type FileOptions struct { func (x *FileOptions) Reset() { *x = FileOptions{} if protoimpl.UnsafeEnabled { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[0] + mi := &file_thethings_json_annotations_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -53,7 +53,7 @@ func (x *FileOptions) String() string { func (*FileOptions) ProtoMessage() {} func (x *FileOptions) ProtoReflect() protoreflect.Message { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[0] + mi := &file_thethings_json_annotations_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -66,7 +66,7 @@ func (x *FileOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use FileOptions.ProtoReflect.Descriptor instead. func (*FileOptions) Descriptor() ([]byte, []int) { - return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{0} + return file_thethings_json_annotations_proto_rawDescGZIP(), []int{0} } func (x *FileOptions) GetMarshalerAll() bool { @@ -99,7 +99,7 @@ type MessageOptions struct { func (x *MessageOptions) Reset() { *x = MessageOptions{} if protoimpl.UnsafeEnabled { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[1] + mi := &file_thethings_json_annotations_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -112,7 +112,7 @@ func (x *MessageOptions) String() string { func (*MessageOptions) ProtoMessage() {} func (x *MessageOptions) ProtoReflect() protoreflect.Message { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[1] + mi := &file_thethings_json_annotations_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -125,7 +125,7 @@ func (x *MessageOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageOptions.ProtoReflect.Descriptor instead. func (*MessageOptions) Descriptor() ([]byte, []int) { - return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{1} + return file_thethings_json_annotations_proto_rawDescGZIP(), []int{1} } func (x *MessageOptions) GetMarshaler() bool { @@ -163,7 +163,7 @@ type FieldOptions struct { func (x *FieldOptions) Reset() { *x = FieldOptions{} if protoimpl.UnsafeEnabled { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[2] + mi := &file_thethings_json_annotations_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -176,7 +176,7 @@ func (x *FieldOptions) String() string { func (*FieldOptions) ProtoMessage() {} func (x *FieldOptions) ProtoReflect() protoreflect.Message { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[2] + mi := &file_thethings_json_annotations_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -189,7 +189,7 @@ func (x *FieldOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use FieldOptions.ProtoReflect.Descriptor instead. func (*FieldOptions) Descriptor() ([]byte, []int) { - return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{2} + return file_thethings_json_annotations_proto_rawDescGZIP(), []int{2} } func (x *FieldOptions) GetMarshalerFunc() string { @@ -215,7 +215,7 @@ type OneofOptions struct { func (x *OneofOptions) Reset() { *x = OneofOptions{} if protoimpl.UnsafeEnabled { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[3] + mi := &file_thethings_json_annotations_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -228,7 +228,7 @@ func (x *OneofOptions) String() string { func (*OneofOptions) ProtoMessage() {} func (x *OneofOptions) ProtoReflect() protoreflect.Message { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[3] + mi := &file_thethings_json_annotations_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -241,7 +241,7 @@ func (x *OneofOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use OneofOptions.ProtoReflect.Descriptor instead. func (*OneofOptions) Descriptor() ([]byte, []int) { - return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{3} + return file_thethings_json_annotations_proto_rawDescGZIP(), []int{3} } type EnumOptions struct { @@ -264,7 +264,7 @@ type EnumOptions struct { func (x *EnumOptions) Reset() { *x = EnumOptions{} if protoimpl.UnsafeEnabled { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[4] + mi := &file_thethings_json_annotations_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -277,7 +277,7 @@ func (x *EnumOptions) String() string { func (*EnumOptions) ProtoMessage() {} func (x *EnumOptions) ProtoReflect() protoreflect.Message { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[4] + mi := &file_thethings_json_annotations_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -290,7 +290,7 @@ func (x *EnumOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use EnumOptions.ProtoReflect.Descriptor instead. func (*EnumOptions) Descriptor() ([]byte, []int) { - return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{4} + return file_thethings_json_annotations_proto_rawDescGZIP(), []int{4} } func (x *EnumOptions) GetMarshaler() bool { @@ -342,7 +342,7 @@ type EnumValueOptions struct { func (x *EnumValueOptions) Reset() { *x = EnumValueOptions{} if protoimpl.UnsafeEnabled { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[5] + mi := &file_thethings_json_annotations_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -355,7 +355,7 @@ func (x *EnumValueOptions) String() string { func (*EnumValueOptions) ProtoMessage() {} func (x *EnumValueOptions) ProtoReflect() protoreflect.Message { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[5] + mi := &file_thethings_json_annotations_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -368,7 +368,7 @@ func (x *EnumValueOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use EnumValueOptions.ProtoReflect.Descriptor instead. func (*EnumValueOptions) Descriptor() ([]byte, []int) { - return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{5} + return file_thethings_json_annotations_proto_rawDescGZIP(), []int{5} } func (x *EnumValueOptions) GetValue() string { @@ -394,7 +394,7 @@ type ServiceOptions struct { func (x *ServiceOptions) Reset() { *x = ServiceOptions{} if protoimpl.UnsafeEnabled { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[6] + mi := &file_thethings_json_annotations_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -407,7 +407,7 @@ func (x *ServiceOptions) String() string { func (*ServiceOptions) ProtoMessage() {} func (x *ServiceOptions) ProtoReflect() protoreflect.Message { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[6] + mi := &file_thethings_json_annotations_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -420,7 +420,7 @@ func (x *ServiceOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use ServiceOptions.ProtoReflect.Descriptor instead. func (*ServiceOptions) Descriptor() ([]byte, []int) { - return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{6} + return file_thethings_json_annotations_proto_rawDescGZIP(), []int{6} } type MethodOptions struct { @@ -432,7 +432,7 @@ type MethodOptions struct { func (x *MethodOptions) Reset() { *x = MethodOptions{} if protoimpl.UnsafeEnabled { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[7] + mi := &file_thethings_json_annotations_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -445,7 +445,7 @@ func (x *MethodOptions) String() string { func (*MethodOptions) ProtoMessage() {} func (x *MethodOptions) ProtoReflect() protoreflect.Message { - mi := &file_protoc_gen_go_json_annotations_proto_msgTypes[7] + mi := &file_thethings_json_annotations_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -458,17 +458,17 @@ func (x *MethodOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use MethodOptions.ProtoReflect.Descriptor instead. func (*MethodOptions) Descriptor() ([]byte, []int) { - return file_protoc_gen_go_json_annotations_proto_rawDescGZIP(), []int{7} + return file_thethings_json_annotations_proto_rawDescGZIP(), []int{7} } -var file_protoc_gen_go_json_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ +var file_thethings_json_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ { ExtendedType: (*descriptorpb.FileOptions)(nil), ExtensionType: (*FileOptions)(nil), Field: 51885, Name: "thethings.json.file", Tag: "bytes,51885,opt,name=file", - Filename: "protoc-gen-go-json/annotations.proto", + Filename: "thethings/json/annotations.proto", }, { ExtendedType: (*descriptorpb.MessageOptions)(nil), @@ -476,7 +476,7 @@ var file_protoc_gen_go_json_annotations_proto_extTypes = []protoimpl.ExtensionIn Field: 51885, Name: "thethings.json.message", Tag: "bytes,51885,opt,name=message", - Filename: "protoc-gen-go-json/annotations.proto", + Filename: "thethings/json/annotations.proto", }, { ExtendedType: (*descriptorpb.FieldOptions)(nil), @@ -484,7 +484,7 @@ var file_protoc_gen_go_json_annotations_proto_extTypes = []protoimpl.ExtensionIn Field: 51885, Name: "thethings.json.field", Tag: "bytes,51885,opt,name=field", - Filename: "protoc-gen-go-json/annotations.proto", + Filename: "thethings/json/annotations.proto", }, { ExtendedType: (*descriptorpb.OneofOptions)(nil), @@ -492,7 +492,7 @@ var file_protoc_gen_go_json_annotations_proto_extTypes = []protoimpl.ExtensionIn Field: 51885, Name: "thethings.json.oneof", Tag: "bytes,51885,opt,name=oneof", - Filename: "protoc-gen-go-json/annotations.proto", + Filename: "thethings/json/annotations.proto", }, { ExtendedType: (*descriptorpb.EnumOptions)(nil), @@ -500,7 +500,7 @@ var file_protoc_gen_go_json_annotations_proto_extTypes = []protoimpl.ExtensionIn Field: 51885, Name: "thethings.json.enum", Tag: "bytes,51885,opt,name=enum", - Filename: "protoc-gen-go-json/annotations.proto", + Filename: "thethings/json/annotations.proto", }, { ExtendedType: (*descriptorpb.EnumValueOptions)(nil), @@ -508,7 +508,7 @@ var file_protoc_gen_go_json_annotations_proto_extTypes = []protoimpl.ExtensionIn Field: 51885, Name: "thethings.json.enum_value", Tag: "bytes,51885,opt,name=enum_value", - Filename: "protoc-gen-go-json/annotations.proto", + Filename: "thethings/json/annotations.proto", }, { ExtendedType: (*descriptorpb.ServiceOptions)(nil), @@ -516,7 +516,7 @@ var file_protoc_gen_go_json_annotations_proto_extTypes = []protoimpl.ExtensionIn Field: 51885, Name: "thethings.json.service", Tag: "bytes,51885,opt,name=service", - Filename: "protoc-gen-go-json/annotations.proto", + Filename: "thethings/json/annotations.proto", }, { ExtendedType: (*descriptorpb.MethodOptions)(nil), @@ -524,169 +524,169 @@ var file_protoc_gen_go_json_annotations_proto_extTypes = []protoimpl.ExtensionIn Field: 51885, Name: "thethings.json.method", Tag: "bytes,51885,opt,name=method", - Filename: "protoc-gen-go-json/annotations.proto", + Filename: "thethings/json/annotations.proto", }, } // Extension fields to descriptorpb.FileOptions. var ( // optional thethings.json.FileOptions file = 51885; - E_File = &file_protoc_gen_go_json_annotations_proto_extTypes[0] + E_File = &file_thethings_json_annotations_proto_extTypes[0] ) // Extension fields to descriptorpb.MessageOptions. var ( // optional thethings.json.MessageOptions message = 51885; - E_Message = &file_protoc_gen_go_json_annotations_proto_extTypes[1] + E_Message = &file_thethings_json_annotations_proto_extTypes[1] ) // Extension fields to descriptorpb.FieldOptions. var ( // optional thethings.json.FieldOptions field = 51885; - E_Field = &file_protoc_gen_go_json_annotations_proto_extTypes[2] + E_Field = &file_thethings_json_annotations_proto_extTypes[2] ) // Extension fields to descriptorpb.OneofOptions. var ( // optional thethings.json.OneofOptions oneof = 51885; - E_Oneof = &file_protoc_gen_go_json_annotations_proto_extTypes[3] + E_Oneof = &file_thethings_json_annotations_proto_extTypes[3] ) // Extension fields to descriptorpb.EnumOptions. var ( // optional thethings.json.EnumOptions enum = 51885; - E_Enum = &file_protoc_gen_go_json_annotations_proto_extTypes[4] + E_Enum = &file_thethings_json_annotations_proto_extTypes[4] ) // Extension fields to descriptorpb.EnumValueOptions. var ( // optional thethings.json.EnumValueOptions enum_value = 51885; - E_EnumValue = &file_protoc_gen_go_json_annotations_proto_extTypes[5] + E_EnumValue = &file_thethings_json_annotations_proto_extTypes[5] ) // Extension fields to descriptorpb.ServiceOptions. var ( // optional thethings.json.ServiceOptions service = 51885; - E_Service = &file_protoc_gen_go_json_annotations_proto_extTypes[6] + E_Service = &file_thethings_json_annotations_proto_extTypes[6] ) // Extension fields to descriptorpb.MethodOptions. var ( // optional thethings.json.MethodOptions method = 51885; - E_Method = &file_protoc_gen_go_json_annotations_proto_extTypes[7] + E_Method = &file_thethings_json_annotations_proto_extTypes[7] ) -var File_protoc_gen_go_json_annotations_proto protoreflect.FileDescriptor - -var file_protoc_gen_go_json_annotations_proto_rawDesc = []byte{ - 0x0a, 0x24, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, - 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5b, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x72, 0x73, 0x68, - 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, - 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x12, 0x27, 0x0a, 0x0f, - 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, - 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x22, 0x6a, 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, - 0x61, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6d, 0x61, 0x72, 0x73, - 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, - 0x61, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x6d, 0x61, - 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, - 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, - 0x72, 0x22, 0x60, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x66, - 0x75, 0x6e, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x72, 0x73, 0x68, - 0x61, 0x6c, 0x65, 0x72, 0x46, 0x75, 0x6e, 0x63, 0x12, 0x29, 0x0a, 0x10, 0x75, 0x6e, 0x6d, 0x61, - 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x46, - 0x75, 0x6e, 0x63, 0x22, 0x0e, 0x0a, 0x0c, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x22, 0xbd, 0x01, 0x0a, 0x0b, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, +var File_thethings_json_annotations_proto protoreflect.FileDescriptor + +var file_thethings_json_annotations_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5b, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, + 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6d, 0x61, 0x72, 0x73, + 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x75, 0x6e, 0x6d, 0x61, + 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0e, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, 0x6c, + 0x6c, 0x22, 0x6a, 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, - 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x5f, 0x61, 0x73, 0x5f, - 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6d, 0x61, - 0x72, 0x73, 0x68, 0x61, 0x6c, 0x41, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2a, 0x0a, - 0x11, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x5f, 0x61, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, - 0x6c, 0x41, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x6e, 0x6d, - 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, - 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x70, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x22, 0x42, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, - 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x73, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x0f, 0x0a, 0x0d, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x4f, 0x0a, 0x04, 0x66, 0x69, - 0x6c, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x3a, 0x5b, 0x0a, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, - 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x53, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x3a, 0x53, 0x0a, - 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4f, - 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x6f, 0x6e, 0x65, - 0x6f, 0x66, 0x3a, 0x4f, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, - 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, - 0x6e, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x04, 0x65, - 0x6e, 0x75, 0x6d, 0x3a, 0x64, 0x0a, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, + 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, + 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x22, 0x60, 0x0a, + 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, + 0x0e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, + 0x46, 0x75, 0x6e, 0x63, 0x12, 0x29, 0x0a, 0x10, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, + 0x6c, 0x65, 0x72, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x46, 0x75, 0x6e, 0x63, 0x22, + 0x0e, 0x0a, 0x0c, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, + 0xbd, 0x01, 0x0a, 0x0b, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x2a, 0x0a, + 0x11, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x5f, 0x61, 0x73, 0x5f, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, + 0x6c, 0x41, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x61, 0x72, + 0x73, 0x68, 0x61, 0x6c, 0x5f, 0x61, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x41, 0x73, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, + 0x61, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x6d, 0x61, + 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x22, + 0x42, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x6c, 0x69, + 0x61, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61, 0x6c, 0x69, 0x61, + 0x73, 0x65, 0x73, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x0f, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x4f, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x1c, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x3a, 0x5b, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x68, + 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x3a, 0x53, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x1d, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x3a, 0x53, 0x0a, 0x05, 0x6f, 0x6e, 0x65, + 0x6f, 0x66, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x68, 0x65, 0x74, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x3a, 0x4f, + 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, - 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x09, - 0x65, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x5b, 0x0a, 0x07, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, - 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x57, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x42, - 0x3f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, - 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, - 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x3a, + 0x64, 0x0a, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x09, 0x65, 0x6e, 0x75, 0x6d, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x5b, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0xad, 0x95, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x68, 0x65, 0x74, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x3a, 0x57, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1e, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, 0x95, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x42, 0x3f, 0x5a, 0x3d, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, } var ( - file_protoc_gen_go_json_annotations_proto_rawDescOnce sync.Once - file_protoc_gen_go_json_annotations_proto_rawDescData = file_protoc_gen_go_json_annotations_proto_rawDesc + file_thethings_json_annotations_proto_rawDescOnce sync.Once + file_thethings_json_annotations_proto_rawDescData = file_thethings_json_annotations_proto_rawDesc ) -func file_protoc_gen_go_json_annotations_proto_rawDescGZIP() []byte { - file_protoc_gen_go_json_annotations_proto_rawDescOnce.Do(func() { - file_protoc_gen_go_json_annotations_proto_rawDescData = protoimpl.X.CompressGZIP(file_protoc_gen_go_json_annotations_proto_rawDescData) +func file_thethings_json_annotations_proto_rawDescGZIP() []byte { + file_thethings_json_annotations_proto_rawDescOnce.Do(func() { + file_thethings_json_annotations_proto_rawDescData = protoimpl.X.CompressGZIP(file_thethings_json_annotations_proto_rawDescData) }) - return file_protoc_gen_go_json_annotations_proto_rawDescData + return file_thethings_json_annotations_proto_rawDescData } -var file_protoc_gen_go_json_annotations_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_protoc_gen_go_json_annotations_proto_goTypes = []interface{}{ +var file_thethings_json_annotations_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_thethings_json_annotations_proto_goTypes = []interface{}{ (*FileOptions)(nil), // 0: thethings.json.FileOptions (*MessageOptions)(nil), // 1: thethings.json.MessageOptions (*FieldOptions)(nil), // 2: thethings.json.FieldOptions @@ -704,7 +704,7 @@ var file_protoc_gen_go_json_annotations_proto_goTypes = []interface{}{ (*descriptorpb.ServiceOptions)(nil), // 14: google.protobuf.ServiceOptions (*descriptorpb.MethodOptions)(nil), // 15: google.protobuf.MethodOptions } -var file_protoc_gen_go_json_annotations_proto_depIdxs = []int32{ +var file_thethings_json_annotations_proto_depIdxs = []int32{ 8, // 0: thethings.json.file:extendee -> google.protobuf.FileOptions 9, // 1: thethings.json.message:extendee -> google.protobuf.MessageOptions 10, // 2: thethings.json.field:extendee -> google.protobuf.FieldOptions @@ -728,13 +728,13 @@ var file_protoc_gen_go_json_annotations_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_protoc_gen_go_json_annotations_proto_init() } -func file_protoc_gen_go_json_annotations_proto_init() { - if File_protoc_gen_go_json_annotations_proto != nil { +func init() { file_thethings_json_annotations_proto_init() } +func file_thethings_json_annotations_proto_init() { + if File_thethings_json_annotations_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_protoc_gen_go_json_annotations_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_thethings_json_annotations_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FileOptions); i { case 0: return &v.state @@ -746,7 +746,7 @@ func file_protoc_gen_go_json_annotations_proto_init() { return nil } } - file_protoc_gen_go_json_annotations_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_thethings_json_annotations_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MessageOptions); i { case 0: return &v.state @@ -758,7 +758,7 @@ func file_protoc_gen_go_json_annotations_proto_init() { return nil } } - file_protoc_gen_go_json_annotations_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_thethings_json_annotations_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FieldOptions); i { case 0: return &v.state @@ -770,7 +770,7 @@ func file_protoc_gen_go_json_annotations_proto_init() { return nil } } - file_protoc_gen_go_json_annotations_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_thethings_json_annotations_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OneofOptions); i { case 0: return &v.state @@ -782,7 +782,7 @@ func file_protoc_gen_go_json_annotations_proto_init() { return nil } } - file_protoc_gen_go_json_annotations_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_thethings_json_annotations_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumOptions); i { case 0: return &v.state @@ -794,7 +794,7 @@ func file_protoc_gen_go_json_annotations_proto_init() { return nil } } - file_protoc_gen_go_json_annotations_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_thethings_json_annotations_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EnumValueOptions); i { case 0: return &v.state @@ -806,7 +806,7 @@ func file_protoc_gen_go_json_annotations_proto_init() { return nil } } - file_protoc_gen_go_json_annotations_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_thethings_json_annotations_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServiceOptions); i { case 0: return &v.state @@ -818,7 +818,7 @@ func file_protoc_gen_go_json_annotations_proto_init() { return nil } } - file_protoc_gen_go_json_annotations_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_thethings_json_annotations_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MethodOptions); i { case 0: return &v.state @@ -835,19 +835,19 @@ func file_protoc_gen_go_json_annotations_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_protoc_gen_go_json_annotations_proto_rawDesc, + RawDescriptor: file_thethings_json_annotations_proto_rawDesc, NumEnums: 0, NumMessages: 8, NumExtensions: 8, NumServices: 0, }, - GoTypes: file_protoc_gen_go_json_annotations_proto_goTypes, - DependencyIndexes: file_protoc_gen_go_json_annotations_proto_depIdxs, - MessageInfos: file_protoc_gen_go_json_annotations_proto_msgTypes, - ExtensionInfos: file_protoc_gen_go_json_annotations_proto_extTypes, + GoTypes: file_thethings_json_annotations_proto_goTypes, + DependencyIndexes: file_thethings_json_annotations_proto_depIdxs, + MessageInfos: file_thethings_json_annotations_proto_msgTypes, + ExtensionInfos: file_thethings_json_annotations_proto_extTypes, }.Build() - File_protoc_gen_go_json_annotations_proto = out.File - file_protoc_gen_go_json_annotations_proto_rawDesc = nil - file_protoc_gen_go_json_annotations_proto_goTypes = nil - file_protoc_gen_go_json_annotations_proto_depIdxs = nil + File_thethings_json_annotations_proto = out.File + file_thethings_json_annotations_proto_rawDesc = nil + file_thethings_json_annotations_proto_goTypes = nil + file_thethings_json_annotations_proto_depIdxs = nil } diff --git a/api/buf.yaml b/api/buf.yaml new file mode 100644 index 00000000..dba46d57 --- /dev/null +++ b/api/buf.yaml @@ -0,0 +1,10 @@ +version: v1 +name: buf.build/thethingsindustries/protoc-gen-go-json +lint: + use: + - DEFAULT + except: + - PACKAGE_VERSION_SUFFIX +breaking: + use: + - FILE diff --git a/annotations.proto b/api/thethings/json/annotations.proto similarity index 97% rename from annotations.proto rename to api/thethings/json/annotations.proto index 0297dd9f..7d1f77f8 100644 --- a/annotations.proto +++ b/api/thethings/json/annotations.proto @@ -5,10 +5,10 @@ syntax = "proto2"; package thethings.json; -option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/annotations"; - import "google/protobuf/descriptor.proto"; +option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/annotations"; + // NOTE: protoc-gen-go-json is primarily intended for internal use by // The Things Industries. We have therefore chosen to use option number 51885, // which is in the 50000-99999 range reserved for internal use within individual @@ -52,9 +52,7 @@ extend google.protobuf.FieldOptions { optional FieldOptions field = 51885; } -message OneofOptions { - -} +message OneofOptions {} extend google.protobuf.OneofOptions { optional OneofOptions oneof = 51885; @@ -88,17 +86,13 @@ extend google.protobuf.EnumValueOptions { optional EnumValueOptions enum_value = 51885; } -message ServiceOptions { - -} +message ServiceOptions {} extend google.protobuf.ServiceOptions { optional ServiceOptions service = 51885; } -message MethodOptions { - -} +message MethodOptions {} extend google.protobuf.MethodOptions { optional MethodOptions method = 51885; diff --git a/buf.gen.test.yaml b/buf.gen.test.yaml new file mode 100644 index 00000000..fb5d907d --- /dev/null +++ b/buf.gen.test.yaml @@ -0,0 +1,12 @@ +version: v1 +plugins: + - name: go + path: .bin/protoc-gen-go + out: ./test/golang + opt: paths=source_relative + - name: go-json + path: .bin/protoc-gen-go-json + out: ./test/golang + opt: + - paths=source_relative + - std=true diff --git a/buf.gen.yaml b/buf.gen.yaml new file mode 100644 index 00000000..d38838ea --- /dev/null +++ b/buf.gen.yaml @@ -0,0 +1,6 @@ +version: v1 +plugins: + - name: go + path: .bin/protoc-gen-go + out: . + opt: module=github.com/TheThingsIndustries/protoc-gen-go-json diff --git a/buf.work.yaml b/buf.work.yaml new file mode 100644 index 00000000..d3020665 --- /dev/null +++ b/buf.work.yaml @@ -0,0 +1,4 @@ +version: v1 +directories: + - api + - test diff --git a/go.mod b/go.mod index af0d3ad0..b3be795a 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/TheThingsIndustries/protoc-gen-go-json -go 1.17 +go 1.20 require ( github.com/google/go-cmp v0.5.9 diff --git a/test/buf.yaml b/test/buf.yaml new file mode 100644 index 00000000..97c459cc --- /dev/null +++ b/test/buf.yaml @@ -0,0 +1,15 @@ +version: v1 +name: buf.build/thethingsindustries/protoc-gen-go-json-test +deps: + - buf.build/thethingsindustries/protoc-gen-go-json +breaking: + use: + - FILE +lint: + use: + - DEFAULT + except: + - PACKAGE_VERSION_SUFFIX + - PACKAGE_DIRECTORY_MATCH + - ENUM_VALUE_PREFIX + - ENUM_ZERO_VALUE_SUFFIX diff --git a/test/enums.proto b/test/enums.proto index 8da67118..6277b276 100644 --- a/test/enums.proto +++ b/test/enums.proto @@ -3,16 +3,21 @@ syntax = "proto3"; -import "annotations.proto"; - package thethings.json.test; -option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/test"; +import "thethings/json/annotations.proto"; -option (thethings.json.file) = { marshaler_all: true, unmarshaler_all: true }; +option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/test"; +option (thethings.json.file) = { + marshaler_all: true, + unmarshaler_all: true +}; enum RegularEnum { - option (thethings.json.enum) = { marshaler: false, unmarshaler: false }; + option (thethings.json.enum) = { + marshaler: false, + unmarshaler: false + }; REGULAR_UNKNOWN = 0; @@ -21,15 +26,21 @@ enum RegularEnum { } enum CustomEnum { - option (thethings.json.enum) = { marshal_as_string: true, prefix: "CUSTOM" }; + option (thethings.json.enum) = { + marshal_as_string: true, + prefix: "CUSTOM" + }; CUSTOM_UNKNOWN = 0; - CUSTOM_V1_0 = 1 [ (thethings.json.enum_value) = { value: "1.0", aliases: ["1.0.0"] } ]; - CUSTOM_V1_0_1 = 2 [ (thethings.json.enum_value) = { value: "1.0.1" } ]; + CUSTOM_V1_0 = 1 [(thethings.json.enum_value) = { + value: "1.0", + aliases: ["1.0.0"] + }]; + CUSTOM_V1_0_1 = 2 [(thethings.json.enum_value) = {value: "1.0.1"}]; } message CustomEnumValue { - option (thethings.json.message) = { wrapper: true }; + option (thethings.json.message) = {wrapper: true}; CustomEnum value = 1; } diff --git a/test/fieldmask.proto b/test/fieldmask.proto index 182044cf..8ba37673 100644 --- a/test/fieldmask.proto +++ b/test/fieldmask.proto @@ -3,11 +3,10 @@ syntax = "proto3"; -import "annotations.proto"; +package thethings.json.test; import "google/protobuf/field_mask.proto"; - -package thethings.json.test; +import "thethings/json/annotations.proto"; option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/test"; @@ -39,7 +38,7 @@ message MessageWithFieldmaskAndSubmessageWithoutFieldmask { } message MessageWithSubmessageWithFieldmaskAndMarshaler { - option (thethings.json.message) = { marshaler: true}; + option (thethings.json.message) = {marshaler: true}; MessageWithFieldMask submessage = 1; -} \ No newline at end of file +} diff --git a/test/golang/api.pb.go b/test/golang/api.pb.go index 37657213..3ea10094 100644 --- a/test/golang/api.pb.go +++ b/test/golang/api.pb.go @@ -3,8 +3,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 +// protoc-gen-go v1.31.0 +// protoc (unknown) // source: api.proto package test diff --git a/test/golang/enums.pb.go b/test/golang/enums.pb.go index b2101e96..89ed4f55 100644 --- a/test/golang/enums.pb.go +++ b/test/golang/enums.pb.go @@ -3,8 +3,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 +// protoc-gen-go v1.31.0 +// protoc (unknown) // source: enums.proto package test @@ -356,70 +356,71 @@ var File_enums_proto protoreflect.FileDescriptor var file_enums_proto_rawDesc = []byte{ 0x0a, 0x0b, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, 0x0f, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, - 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, - 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x06, 0xea, 0xaa, 0x19, 0x02, 0x18, 0x01, 0x22, 0x9c, 0x03, 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x3a, 0x0a, 0x07, - 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, - 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, - 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x3c, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x75, - 0x6c, 0x61, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x08, 0x72, 0x65, - 0x67, 0x75, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, + 0x73, 0x74, 0x1a, 0x20, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x6a, 0x73, + 0x6f, 0x6e, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, 0x0f, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, + 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, - 0x39, 0x0a, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, - 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, - 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, - 0x6d, 0x52, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x77, 0x72, - 0x61, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, - 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, - 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, - 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x4d, 0x0a, 0x0f, 0x77, 0x72, 0x61, 0x70, 0x70, - 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, - 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, - 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x43, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x22, 0xe8, 0x01, 0x0a, 0x15, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x45, 0x6e, 0x75, 0x6d, 0x73, - 0x12, 0x3c, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, - 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, - 0x6e, 0x75, 0x6d, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x39, - 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, - 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x48, - 0x00, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x4d, 0x0a, 0x0e, 0x77, 0x72, 0x61, - 0x70, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x06, + 0xea, 0xaa, 0x19, 0x02, 0x18, 0x01, 0x22, 0x9c, 0x03, 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x3a, 0x0a, 0x07, 0x72, + 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, + 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, + 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x07, + 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x3c, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x75, 0x6c, + 0x61, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, + 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x08, 0x72, 0x65, 0x67, + 0x75, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x39, + 0x0a, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, 0x32, + 0x1f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, + 0x52, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x77, 0x72, 0x61, + 0x70, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, - 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, - 0x65, 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x2a, 0x4a, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, - 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, - 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, - 0x5f, 0x41, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, - 0x42, 0x10, 0x02, 0x1a, 0x08, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x00, 0x20, 0x00, 0x2a, 0x73, 0x0a, - 0x0a, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x0e, 0x43, - 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, - 0x21, 0x0a, 0x0b, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x56, 0x31, 0x5f, 0x30, 0x10, 0x01, - 0x1a, 0x10, 0xea, 0xaa, 0x19, 0x0c, 0x0a, 0x03, 0x31, 0x2e, 0x30, 0x12, 0x05, 0x31, 0x2e, 0x30, - 0x2e, 0x30, 0x12, 0x1e, 0x0a, 0x0d, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x56, 0x31, 0x5f, - 0x30, 0x5f, 0x31, 0x10, 0x02, 0x1a, 0x0b, 0xea, 0xaa, 0x19, 0x07, 0x0a, 0x05, 0x31, 0x2e, 0x30, - 0x2e, 0x31, 0x1a, 0x0e, 0xea, 0xaa, 0x19, 0x0a, 0x18, 0x01, 0x2a, 0x06, 0x43, 0x55, 0x53, 0x54, - 0x4f, 0x4d, 0x42, 0x40, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, - 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, - 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0xea, 0xaa, 0x19, 0x04, - 0x08, 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, + 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x4d, 0x0a, 0x0f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, + 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x43, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x22, 0xe8, 0x01, 0x0a, 0x15, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, + 0x3c, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, + 0x75, 0x6d, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x39, 0x0a, + 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, + 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x48, 0x00, + 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x4d, 0x0a, 0x0e, 0x77, 0x72, 0x61, 0x70, + 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, + 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, + 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x2a, 0x4a, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x12, + 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, + 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, + 0x41, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x42, + 0x10, 0x02, 0x1a, 0x08, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x00, 0x20, 0x00, 0x2a, 0x73, 0x0a, 0x0a, + 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x55, + 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x21, + 0x0a, 0x0b, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x56, 0x31, 0x5f, 0x30, 0x10, 0x01, 0x1a, + 0x10, 0xea, 0xaa, 0x19, 0x0c, 0x0a, 0x03, 0x31, 0x2e, 0x30, 0x12, 0x05, 0x31, 0x2e, 0x30, 0x2e, + 0x30, 0x12, 0x1e, 0x0a, 0x0d, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x56, 0x31, 0x5f, 0x30, + 0x5f, 0x31, 0x10, 0x02, 0x1a, 0x0b, 0xea, 0xaa, 0x19, 0x07, 0x0a, 0x05, 0x31, 0x2e, 0x30, 0x2e, + 0x31, 0x1a, 0x0e, 0xea, 0xaa, 0x19, 0x0a, 0x18, 0x01, 0x2a, 0x06, 0x43, 0x55, 0x53, 0x54, 0x4f, + 0x4d, 0x42, 0x40, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, + 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/test/golang/enums_json.pb.go b/test/golang/enums_json.pb.go index 9e3b80e0..f1d2a862 100644 --- a/test/golang/enums_json.pb.go +++ b/test/golang/enums_json.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-json. DO NOT EDIT. // versions: // - protoc-gen-go-json v0.0.0-dev -// - protoc v3.20.1 +// - protoc (unknown) // source: enums.proto package test diff --git a/test/golang/fieldmask.pb.go b/test/golang/fieldmask.pb.go index d8195e34..60d47703 100644 --- a/test/golang/fieldmask.pb.go +++ b/test/golang/fieldmask.pb.go @@ -3,8 +3,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 +// protoc-gen-go v1.31.0 +// protoc (unknown) // source: fieldmask.proto package test @@ -383,70 +383,71 @@ var File_fieldmask_proto protoreflect.FileDescriptor var file_fieldmask_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, - 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x65, 0x0a, 0x14, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, - 0x61, 0x73, 0x6b, 0x12, 0x39, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, - 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, - 0x61, 0x73, 0x6b, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0x2d, 0x0a, 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, - 0x68, 0x6f, 0x75, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x22, 0x6f, 0x0a, 0x22, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, - 0x53, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x49, 0x0a, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, 0x68, - 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x22, 0x75, 0x0a, 0x25, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, - 0x68, 0x53, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, - 0x75, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x4c, 0x0a, 0x0a, 0x73, - 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, - 0x68, 0x6f, 0x75, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x73, - 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xb9, 0x01, 0x0a, 0x2e, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, - 0x73, 0x6b, 0x41, 0x6e, 0x64, 0x53, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, - 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x39, 0x0a, 0x0a, - 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x09, 0x66, 0x69, - 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x4c, 0x0a, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x74, 0x68, - 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xb9, 0x01, 0x0a, 0x31, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x41, 0x6e, - 0x64, 0x53, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, - 0x75, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x39, 0x0a, 0x0a, 0x66, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, + 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x65, 0x0a, 0x14, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, + 0x73, 0x6b, 0x12, 0x39, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, + 0x73, 0x6b, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x2d, 0x0a, 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, + 0x6f, 0x75, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x22, 0x6f, 0x0a, 0x22, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, + 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x49, 0x0a, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x22, 0x75, 0x0a, 0x25, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, + 0x53, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, + 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x4c, 0x0a, 0x0a, 0x73, 0x75, + 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, + 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, + 0x6f, 0x75, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x73, 0x75, + 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xb9, 0x01, 0x0a, 0x2e, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, + 0x6b, 0x41, 0x6e, 0x64, 0x53, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, + 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x39, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x09, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x49, 0x0a, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, 0x68, 0x65, + 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x4c, 0x0a, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, - 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x22, 0x83, 0x01, 0x0a, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, - 0x68, 0x53, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x41, 0x6e, 0x64, 0x4d, 0x61, 0x72, 0x73, 0x68, - 0x61, 0x6c, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, - 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, - 0x06, 0xea, 0xaa, 0x19, 0x02, 0x08, 0x01, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, - 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, - 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x22, 0xb9, 0x01, 0x0a, 0x31, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x41, 0x6e, 0x64, + 0x53, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, + 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x12, 0x39, 0x0a, 0x0a, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x49, 0x0a, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, 0x68, 0x65, 0x74, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x22, 0x83, 0x01, 0x0a, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, + 0x53, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x41, 0x6e, 0x64, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, + 0x6c, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, + 0x73, 0x6b, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x06, + 0xea, 0xaa, 0x19, 0x02, 0x08, 0x01, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, + 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, + 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/test/golang/fieldmask_json.pb.go b/test/golang/fieldmask_json.pb.go index 30ac3b57..5640bc0c 100644 --- a/test/golang/fieldmask_json.pb.go +++ b/test/golang/fieldmask_json.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-json. DO NOT EDIT. // versions: // - protoc-gen-go-json v0.0.0-dev -// - protoc v3.20.1 +// - protoc (unknown) // source: fieldmask.proto package test diff --git a/test/golang/scalars.pb.go b/test/golang/scalars.pb.go index 4227ca75..f35cd8db 100644 --- a/test/golang/scalars.pb.go +++ b/test/golang/scalars.pb.go @@ -3,8 +3,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 +// protoc-gen-go v1.31.0 +// protoc (unknown) // source: scalars.proto package test @@ -856,469 +856,470 @@ var File_scalars_proto protoreflect.FileDescriptor var file_scalars_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x73, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe2, 0x0b, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x21, - 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x66, 0x6c, 0x6f, - 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x6c, 0x6f, 0x61, 0x74, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x02, 0x52, 0x0b, 0x66, - 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, - 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x69, - 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, - 0x05, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1f, - 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, - 0x08, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0c, 0x75, 0x69, - 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x69, - 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, - 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0c, - 0x20, 0x03, 0x28, 0x04, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x11, 0x52, 0x0b, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x11, 0x52, 0x0c, 0x73, 0x69, - 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x69, - 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x12, - 0x52, 0x0b, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, - 0x0d, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x10, - 0x20, 0x03, 0x28, 0x12, 0x52, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x07, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x65, 0x64, - 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x69, 0x78, 0x65, 0x64, - 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x07, 0x52, - 0x0d, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x23, - 0x0a, 0x0d, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x13, 0x20, 0x01, 0x28, 0x06, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x06, 0x52, 0x0d, 0x66, 0x69, 0x78, - 0x65, 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x66, - 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x15, 0x20, 0x01, - 0x28, 0x0f, 0x52, 0x0d, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0f, 0x52, 0x0e, 0x73, 0x66, 0x69, 0x78, - 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x66, - 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x17, 0x20, 0x01, - 0x28, 0x10, 0x52, 0x0d, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x18, 0x18, 0x20, 0x03, 0x28, 0x10, 0x52, 0x0e, 0x73, 0x66, 0x69, 0x78, - 0x65, 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, - 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, - 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x6f, 0x6f, - 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x08, 0x52, 0x0a, - 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, - 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1c, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x73, 0x18, 0x1e, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0xc2, 0x01, 0x0a, 0x0f, 0x68, 0x65, 0x78, 0x5f, 0x62, - 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x99, 0x01, 0xea, 0xaa, 0x19, 0x94, 0x01, 0x0a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, - 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, - 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, - 0x58, 0x12, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, - 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, - 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x52, 0x0d, 0x68, 0x65, - 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0xce, 0x01, 0x0a, 0x10, - 0x68, 0x65, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x18, 0x20, 0x20, 0x03, 0x28, 0x0c, 0x42, 0xa3, 0x01, 0xea, 0xaa, 0x19, 0x9e, 0x01, 0x0a, 0x4c, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, - 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, - 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x4e, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, - 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, - 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6d, 0x61, 0x72, - 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x0e, 0x68, 0x65, - 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x94, 0x06, 0x0a, - 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, - 0x66, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x23, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, - 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, - 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, - 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x02, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, - 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0b, - 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75, - 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x04, 0x48, 0x00, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x11, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x12, 0x48, 0x00, 0x52, 0x0b, 0x73, - 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x66, 0x69, - 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x07, 0x48, 0x00, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x06, 0x48, 0x00, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x65, - 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x73, 0x66, 0x69, 0x78, - 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0f, - 0x48, 0x00, 0x52, 0x0d, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x10, 0x48, 0x00, 0x52, 0x0d, 0x73, 0x66, 0x69, - 0x78, 0x65, 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, - 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, - 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x21, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x0f, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0xc4, 0x01, 0x0a, 0x0f, 0x68, 0x65, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x99, 0x01, - 0xea, 0xaa, 0x19, 0x94, 0x01, 0x0a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, - 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, - 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x12, 0x49, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, - 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6d, - 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x48, 0x00, 0x52, 0x0d, 0x68, 0x65, 0x78, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x22, 0x82, 0x27, 0x0a, 0x15, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, - 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x12, 0x6b, 0x0a, - 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x6d, - 0x61, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, - 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, - 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, - 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, - 0x74, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, - 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, - 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, - 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x68, - 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, - 0x61, 0x70, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, - 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x07, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, - 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, - 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, - 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, - 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x69, 0x6e, - 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x6d, 0x61, - 0x70, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, + 0x74, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2f, + 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe2, 0x0b, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x21, 0x0a, + 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, + 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x02, 0x52, 0x0b, 0x66, 0x6c, + 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x74, + 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x05, + 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1f, 0x0a, + 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x03, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0c, 0x75, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x69, 0x6e, + 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, + 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0c, 0x20, + 0x03, 0x28, 0x04, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x11, 0x52, 0x0b, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x11, 0x52, 0x0c, 0x73, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x69, 0x6e, + 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x12, 0x52, + 0x0b, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, + 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x10, 0x20, + 0x03, 0x28, 0x12, 0x52, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x07, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, + 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, + 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x07, 0x52, 0x0d, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x23, 0x0a, + 0x0d, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x13, + 0x20, 0x01, 0x28, 0x06, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x06, 0x52, 0x0d, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, + 0x0f, 0x52, 0x0d, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0f, 0x52, 0x0e, 0x73, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, + 0x10, 0x52, 0x0d, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x18, 0x20, 0x03, 0x28, 0x10, 0x52, 0x0e, 0x73, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, + 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x62, + 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x6f, 0x6f, 0x6c, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x08, 0x52, 0x0a, 0x62, + 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1c, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x1e, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0xc2, 0x01, 0x0a, 0x0f, 0x68, 0x65, 0x78, 0x5f, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x99, 0x01, 0xea, 0xaa, 0x19, 0x94, 0x01, 0x0a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, + 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, + 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, + 0x12, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, + 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, + 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, + 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x52, 0x0d, 0x68, 0x65, 0x78, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0xce, 0x01, 0x0a, 0x10, 0x68, + 0x65, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, + 0x20, 0x20, 0x03, 0x28, 0x0c, 0x42, 0xa3, 0x01, 0xea, 0xaa, 0x19, 0x9e, 0x01, 0x0a, 0x4c, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, + 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, 0x73, + 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x4e, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, + 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, + 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x0e, 0x68, 0x65, 0x78, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x94, 0x06, 0x0a, 0x17, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, + 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x23, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, + 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, + 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x02, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0b, 0x75, + 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x75, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, + 0x48, 0x00, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x23, 0x0a, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x11, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x12, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x66, 0x69, 0x78, + 0x65, 0x64, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x07, + 0x48, 0x00, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x25, 0x0a, 0x0d, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x06, 0x48, 0x00, 0x52, 0x0c, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x73, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0f, 0x48, + 0x00, 0x52, 0x0d, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x27, 0x0a, 0x0e, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x10, 0x48, 0x00, 0x52, 0x0d, 0x73, 0x66, 0x69, 0x78, + 0x65, 0x64, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, + 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, + 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x21, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0f, + 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0xc4, 0x01, 0x0a, 0x0f, 0x68, 0x65, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x99, 0x01, 0xea, + 0xaa, 0x19, 0x94, 0x01, 0x0a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, + 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, + 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x12, 0x49, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, + 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x6d, 0x61, + 0x72, 0x73, 0x68, 0x61, 0x6c, 0x48, 0x45, 0x58, 0x48, 0x00, 0x52, 0x0d, 0x68, 0x65, 0x78, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x82, 0x27, 0x0a, 0x15, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, + 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x12, 0x6b, 0x0a, 0x11, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x6d, 0x61, + 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, - 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x75, 0x69, 0x6e, - 0x74, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0a, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, - 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0b, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, + 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, + 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, + 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, + 0x10, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, + 0x70, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, + 0x61, 0x70, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x07, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, - 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, - 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, - 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x36, - 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x0f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, - 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x33, - 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, + 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, + 0x70, 0x12, 0x68, 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, - 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, - 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, - 0x11, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, - 0x61, 0x70, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, - 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x69, 0x6e, 0x74, 0x33, - 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, - 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, - 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, - 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, - 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x69, 0x6e, 0x74, 0x36, - 0x34, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x10, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, - 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, - 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, - 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, - 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, - 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, - 0x32, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, - 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, - 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x46, 0x69, 0x78, - 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x10, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, - 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x69, 0x6e, 0x74, + 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, + 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, + 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, + 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x75, 0x69, 0x6e, 0x74, + 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0a, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, + 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, + 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, - 0x34, 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, - 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, - 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x46, 0x69, 0x78, - 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x10, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, 0x13, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, - 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x15, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, - 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, - 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, - 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, 0x13, 0x73, 0x66, 0x69, 0x78, 0x65, - 0x64, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x16, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, - 0x2e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, - 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, 0x13, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x6d, 0x61, - 0x70, 0x18, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, - 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, - 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, - 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, - 0x13, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, + 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, + 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, + 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, + 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, + 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, + 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, - 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, - 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, - 0x12, 0x65, 0x0a, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, - 0x6d, 0x61, 0x70, 0x18, 0x19, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x74, 0x68, 0x65, 0x74, - 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, - 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x6c, - 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x0f, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x3d, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, + 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, + 0x70, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, + 0x61, 0x70, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0f, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, + 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, 0x11, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x10, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0f, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, + 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, + 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, + 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, + 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x10, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, + 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, + 0x4d, 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x12, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x40, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, + 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, + 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x10, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, 0x13, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x66, + 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, - 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x42, 0x6f, 0x6f, - 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x0d, 0x62, 0x6f, 0x6f, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, - 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, - 0x6d, 0x61, 0x70, 0x18, 0x1b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, + 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, 0x13, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x33, 0x32, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x16, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, + 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, + 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, 0x13, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, + 0x18, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, + 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, + 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x71, 0x0a, 0x13, + 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, + 0x6d, 0x61, 0x70, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, - 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x6d, 0x61, 0x70, 0x18, - 0x1d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, - 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x4d, 0x61, 0x70, 0x12, 0xa0, 0x02, 0x0a, 0x14, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x5f, 0x68, 0x65, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x1e, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x73, 0x66, + 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, + 0x65, 0x0a, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x6d, + 0x61, 0x70, 0x18, 0x19, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, + 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x0f, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x3d, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, + 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, + 0x62, 0x6f, 0x6f, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x6b, 0x0a, + 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, + 0x61, 0x70, 0x18, 0x1b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x10, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x1d, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, - 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0xab, 0x01, 0xea, 0xaa, 0x19, 0xa6, 0x01, 0x0a, - 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, - 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, - 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, - 0x72, 0x73, 0x68, 0x61, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x45, 0x58, 0x4d, 0x61, - 0x70, 0x12, 0x52, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, - 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, - 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, - 0x45, 0x58, 0x4d, 0x61, 0x70, 0x52, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x78, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x41, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, - 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, - 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x49, 0x6e, 0x74, 0x36, - 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x42, 0x0a, 0x14, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x4d, 0x61, 0x70, 0x12, 0xa0, 0x02, 0x0a, 0x14, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, + 0x68, 0x65, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x1e, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x4d, 0x61, 0x70, 0x73, 0x2e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, + 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0xab, 0x01, 0xea, 0xaa, 0x19, 0xa6, 0x01, 0x0a, 0x50, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, + 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, + 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x72, + 0x73, 0x68, 0x61, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x45, 0x58, 0x4d, 0x61, 0x70, + 0x12, 0x52, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, + 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, + 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x55, + 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x45, + 0x58, 0x4d, 0x61, 0x70, 0x52, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x78, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x02, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, + 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x55, 0x69, 0x6e, 0x74, 0x36, - 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x49, 0x6e, 0x74, 0x36, 0x34, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, + 0x0a, 0x14, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, + 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, + 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x11, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, + 0x0a, 0x14, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, + 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x11, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, 0x74, + 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x12, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x12, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x11, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x42, 0x0a, 0x14, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x11, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x69, 0x6e, - 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x12, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x69, 0x6e, 0x74, 0x36, - 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x12, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, + 0x20, 0x01, 0x28, 0x07, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x43, 0x0a, 0x15, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x07, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, + 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x06, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, 0x46, 0x69, 0x78, + 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x06, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x44, + 0x0a, 0x16, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x44, 0x0a, 0x16, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x44, 0x0a, 0x16, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x07, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x1a, 0x43, 0x0a, 0x15, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x07, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, - 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x06, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, 0x46, 0x69, - 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x06, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x44, 0x0a, 0x16, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, - 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x44, 0x0a, 0x16, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, - 0x32, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x44, 0x0a, 0x16, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x4d, 0x61, 0x70, + 0x02, 0x20, 0x01, 0x28, 0x10, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x44, 0x0a, 0x16, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x10, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, 0x42, 0x6f, 0x6f, 0x6c, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, + 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x10, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x1a, 0x44, 0x0a, 0x16, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x10, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, 0x42, 0x6f, 0x6f, - 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x14, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x41, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, - 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x1a, 0x44, 0x0a, 0x16, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x78, 0x42, - 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x40, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, - 0x73, 0x74, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x44, 0x0a, 0x16, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x78, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x40, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, + 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, + 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, + 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/test/golang/scalars_json.pb.go b/test/golang/scalars_json.pb.go index b59509f2..eb6af579 100644 --- a/test/golang/scalars_json.pb.go +++ b/test/golang/scalars_json.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-json. DO NOT EDIT. // versions: // - protoc-gen-go-json v0.0.0-dev -// - protoc v3.20.1 +// - protoc (unknown) // source: scalars.proto package test diff --git a/test/golang/wkts.pb.go b/test/golang/wkts.pb.go index 8674eec0..da65137e 100644 --- a/test/golang/wkts.pb.go +++ b/test/golang/wkts.pb.go @@ -3,8 +3,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 +// protoc-gen-go v1.31.0 +// protoc (unknown) // source: wkts.proto package test @@ -907,456 +907,457 @@ var File_wkts_proto protoreflect.FileDescriptor var file_wkts_proto_rawDesc = []byte{ 0x0a, 0x0a, 0x77, 0x6b, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, - 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, - 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x30, 0x0a, - 0x14, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x61, 0x72, 0x73, - 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, - 0x3d, 0x0a, 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, - 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x3a, 0x08, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x00, 0x10, 0x00, 0x22, 0x89, - 0x11, 0x0a, 0x0f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, - 0x54, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, - 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, - 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, - 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, + 0x74, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, + 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, + 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, + 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x74, 0x68, 0x65, 0x74, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x30, 0x0a, 0x14, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4d, 0x61, 0x72, 0x73, 0x68, + 0x61, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3d, + 0x0a, 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, + 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x3a, 0x08, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x00, 0x10, 0x00, 0x22, 0x89, 0x11, + 0x0a, 0x0f, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, + 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, + 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, - 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, - 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, + 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x3e, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x12, 0x3f, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, - 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, - 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, - 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, - 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, - 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x12, 0x3f, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x3e, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, + 0x3f, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x41, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, + 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, + 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, + 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, + 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, + 0x3f, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x41, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, - 0x0a, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x65, - 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x10, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, - 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x3e, 0x0a, 0x0c, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0a, + 0x65, 0x6d, 0x70, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x65, 0x6d, + 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x10, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x16, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, 0x0f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x10, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x19, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0e, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, + 0x11, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, + 0x0a, 0x0c, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1c, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x10, 0x6c, 0x69, 0x73, + 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1d, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x0e, 0x6c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x46, 0x0a, 0x11, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x6c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x10, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x19, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0e, - 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, - 0x0a, 0x11, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, - 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x39, 0x0a, 0x0c, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, - 0x1c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0b, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x10, 0x6c, 0x69, - 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1d, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x0e, 0x6c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x46, 0x0a, 0x11, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x1e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x6c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x75, - 0x63, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x20, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, + 0x75, 0x63, 0x74, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x31, 0x0a, 0x09, 0x61, 0x6e, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x21, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x61, 0x6e, 0x79, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x61, 0x6e, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x22, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, + 0x61, 0x6e, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xec, 0x08, 0x0a, 0x14, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x57, 0x4b, + 0x54, 0x73, 0x12, 0x41, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, + 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, 0x74, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, + 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, + 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, + 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x75, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, + 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x20, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, - 0x72, 0x75, 0x63, 0x74, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x12, 0x31, 0x0a, 0x09, 0x61, 0x6e, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x61, 0x6e, 0x79, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x61, 0x6e, 0x79, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x73, 0x18, 0x22, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, - 0x09, 0x61, 0x6e, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xec, 0x08, 0x0a, 0x14, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x57, - 0x4b, 0x54, 0x73, 0x12, 0x41, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, - 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, - 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, - 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, - 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, - 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, - 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, - 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, - 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, - 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x75, 0x69, - 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x75, 0x69, 0x6e, - 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, - 0x0b, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0a, - 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, - 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, - 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, - 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, - 0x52, 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0b, - 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x6d, 0x70, - 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x0e, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, - 0x0a, 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x46, 0x0a, 0x10, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x0e, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, + 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x62, + 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x6c, - 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, - 0x0c, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x10, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0b, - 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x61, - 0x6e, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x62, + 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x41, 0x6e, 0x79, 0x48, 0x00, 0x52, 0x08, 0x61, 0x6e, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xfa, 0x1a, 0x0a, 0x12, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, - 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, - 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, - 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, - 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, - 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, - 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x33, - 0x32, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0b, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, + 0x0a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x6d, 0x70, 0x74, + 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x0e, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x42, 0x0a, + 0x0e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x48, 0x00, 0x52, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x46, 0x0a, 0x10, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x0e, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x4d, 0x61, 0x73, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x6c, 0x69, + 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, 0x0c, + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x73, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x6e, + 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x41, 0x6e, 0x79, 0x48, 0x00, 0x52, 0x08, 0x61, 0x6e, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, + 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xfa, 0x1a, 0x0a, 0x12, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x12, + 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, + 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, + 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, + 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, + 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, + 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, + 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, 0x68, + 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, + 0x6d, 0x61, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, 0x74, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, + 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, + 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, + 0x61, 0x70, 0x12, 0x62, 0x0a, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x6f, 0x6f, + 0x6c, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, - 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, - 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, - 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x12, - 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, - 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, + 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, + 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, - 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, - 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, - 0x4d, 0x61, 0x70, 0x12, 0x62, 0x0a, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x6f, - 0x6f, 0x6c, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x74, + 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0a, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, + 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x61, 0x70, 0x12, 0x71, + 0x0a, 0x14, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, - 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x6c, - 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x42, 0x6f, 0x6f, 0x6c, 0x4d, 0x61, 0x70, 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x08, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, - 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, - 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, + 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x61, + 0x70, 0x12, 0x6e, 0x0a, 0x13, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, + 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, + 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, + 0x70, 0x12, 0x72, 0x0a, 0x15, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, + 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x12, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, + 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, + 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x72, 0x0a, 0x15, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, - 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0a, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, + 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, 0x68, + 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x5f, 0x0a, 0x0e, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x6e, 0x79, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x11, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x0e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x61, 0x70, 0x12, - 0x71, 0x0a, 0x14, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, - 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, - 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, - 0x61, 0x70, 0x12, 0x6e, 0x0a, 0x13, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x3e, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, - 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, - 0x61, 0x70, 0x12, 0x72, 0x0a, 0x15, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0d, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x3f, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, - 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, - 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x12, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, - 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x12, 0x65, 0x0a, 0x10, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x3b, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, - 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, - 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x72, 0x0a, - 0x15, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x74, - 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, - 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x73, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, - 0x70, 0x12, 0x68, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x72, 0x75, - 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x74, - 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, - 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x75, - 0x63, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x5f, 0x0a, 0x0e, 0x73, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x6e, 0x79, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x11, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x57, 0x4b, 0x54, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x79, 0x4d, 0x61, 0x70, 0x1a, 0x60, 0x0a, 0x14, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x45, + 0x6e, 0x67, 0x41, 0x6e, 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x79, 0x4d, 0x61, 0x70, 0x1a, 0x60, 0x0a, 0x14, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, 0x0a, + 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, - 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4d, 0x61, 0x70, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, - 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, - 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, 0x0a, + 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, 0x0a, + 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x4d, 0x61, 0x70, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x60, 0x0a, + 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x60, - 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x4d, 0x61, - 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x1a, 0x60, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, - 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, - 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x1a, 0x5c, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x6c, - 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x1a, 0x60, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x60, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, + 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x5c, 0x0a, 0x12, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x6c, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x60, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x5e, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x1a, 0x5e, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x1a, 0x59, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x61, 0x0a, - 0x17, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x59, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x1a, 0x5f, 0x0a, 0x16, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x1a, 0x61, 0x0a, 0x17, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x4d, 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x59, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x61, 0x0a, 0x17, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x61, 0x0a, 0x17, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x5f, 0x0a, 0x16, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x61, 0x0a, 0x17, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, + 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0x59, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x1a, 0x5b, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x75, - 0x63, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, - 0x72, 0x75, 0x63, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x55, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x79, 0x4d, 0x61, 0x70, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x40, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, - 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, - 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, - 0xea, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x61, + 0x0a, 0x17, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x5b, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, + 0x75, 0x63, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x55, + 0x0a, 0x11, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x6e, 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x40, 0xea, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x5a, + 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x6a, 0x73, + 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/test/golang/wkts_json.pb.go b/test/golang/wkts_json.pb.go index 7959dc18..820bae35 100644 --- a/test/golang/wkts_json.pb.go +++ b/test/golang/wkts_json.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-json. DO NOT EDIT. // versions: // - protoc-gen-go-json v0.0.0-dev -// - protoc v3.20.1 +// - protoc (unknown) // source: wkts.proto package test diff --git a/test/scalars.proto b/test/scalars.proto index e76b5c3a..3d42c37a 100644 --- a/test/scalars.proto +++ b/test/scalars.proto @@ -3,13 +3,15 @@ syntax = "proto3"; -import "annotations.proto"; - package thethings.json.test; -option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/test"; +import "thethings/json/annotations.proto"; -option (thethings.json.file) = { marshaler_all: true, unmarshaler_all: true }; +option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/test"; +option (thethings.json.file) = { + marshaler_all: true, + unmarshaler_all: true +}; message MessageWithScalars { double double_value = 1; @@ -57,18 +59,14 @@ message MessageWithScalars { bytes bytes_value = 29; repeated bytes bytes_values = 30; - bytes hex_bytes_value = 31 [ - (thethings.json.field) = { - marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEX", - unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEX" - } - ]; - repeated bytes hex_bytes_values = 32 [ - (thethings.json.field) = { - marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEXArray", - unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEXArray" - } - ]; + bytes hex_bytes_value = 31 [(thethings.json.field) = { + marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEX", + unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEX" + }]; + repeated bytes hex_bytes_values = 32 [(thethings.json.field) = { + marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEXArray", + unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEXArray" + }]; } message MessageWithOneofScalars { @@ -88,65 +86,61 @@ message MessageWithOneofScalars { bool bool_value = 13; string string_value = 14; bytes bytes_value = 15; - bytes hex_bytes_value = 16 [ - (thethings.json.field) = { - marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEX", - unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEX" - } - ]; + bytes hex_bytes_value = 16 [(thethings.json.field) = { + marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalHEX", + unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalHEX" + }]; } } message MessageWithScalarMaps { - map string_double_map = 1; + map string_double_map = 1; // map is impossible. - map string_float_map = 3; + map string_float_map = 3; // map is impossible. - map string_int32_map = 5; - map int32_string_map = 6; + map string_int32_map = 5; + map int32_string_map = 6; - map string_int64_map = 7; - map int64_string_map = 8; + map string_int64_map = 7; + map int64_string_map = 8; - map string_uint32_map = 9; - map uint32_string_map = 10; + map string_uint32_map = 9; + map uint32_string_map = 10; - map string_uint64_map = 11; - map uint64_string_map = 12; + map string_uint64_map = 11; + map uint64_string_map = 12; - map string_sint32_map = 13; - map sint32_string_map = 14; + map string_sint32_map = 13; + map sint32_string_map = 14; - map string_sint64_map = 15; - map sint64_string_map = 16; + map string_sint64_map = 15; + map sint64_string_map = 16; - map string_fixed32_map = 17; - map fixed32_string_map = 18; + map string_fixed32_map = 17; + map fixed32_string_map = 18; - map string_fixed64_map = 19; - map fixed64_string_map = 20; + map string_fixed64_map = 19; + map fixed64_string_map = 20; - map string_sfixed32_map = 21; - map sfixed32_string_map = 22; + map string_sfixed32_map = 21; + map sfixed32_string_map = 22; - map string_sfixed64_map = 23; - map sfixed64_string_map = 24; + map string_sfixed64_map = 23; + map sfixed64_string_map = 24; - map string_bool_map = 25; - map bool_string_map = 26; + map string_bool_map = 25; + map bool_string_map = 26; - map string_string_map = 27; + map string_string_map = 27; // map is above. - map string_bytes_map = 29; + map string_bytes_map = 29; // map is impossible. - map string_hex_bytes_map = 30 [ - (thethings.json.field) = { - marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalStringHEXMap", - unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalStringHEXMap" - } - ]; + map string_hex_bytes_map = 30 [(thethings.json.field) = { + marshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.MarshalStringHEXMap", + unmarshaler_func: "github.com/TheThingsIndustries/protoc-gen-go-json/test/types.UnmarshalStringHEXMap" + }]; } diff --git a/test/wkts.proto b/test/wkts.proto index bd190de8..a5dd05d1 100644 --- a/test/wkts.proto +++ b/test/wkts.proto @@ -3,7 +3,7 @@ syntax = "proto3"; -import "annotations.proto"; +package thethings.json.test; import "google/protobuf/any.proto"; import "google/protobuf/duration.proto"; @@ -12,19 +12,23 @@ import "google/protobuf/field_mask.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; - -package thethings.json.test; +import "thethings/json/annotations.proto"; option go_package = "github.com/TheThingsIndustries/protoc-gen-go-json/test"; - -option (thethings.json.file) = { marshaler_all: true, unmarshaler_all: true }; +option (thethings.json.file) = { + marshaler_all: true, + unmarshaler_all: true +}; message MessageWithMarshaler { string message = 1; } message MessageWithoutMarshaler { - option (thethings.json.message) = { marshaler: false, unmarshaler: false }; + option (thethings.json.message) = { + marshaler: false, + unmarshaler: false + }; string message = 1; } @@ -105,21 +109,21 @@ message MessageWithOneofWKTs { } message MessageWithWKTMaps { - map string_double_map = 1; - map string_float_map = 2; - map string_int32_map = 3; - map string_int64_map = 4; - map string_uint32_map = 5; - map string_uint64_map = 6; - map string_bool_map = 7; - map string_string_map = 8; - map string_bytes_map = 9; - map string_empty_map = 10; - map string_timestamp_map = 11; - map string_duration_map = 12; - map string_field_mask_map = 13; - map string_value_map = 14; - map string_list_value_map = 15; - map string_struct_map = 16; - map string_any_map = 17; + map string_double_map = 1; + map string_float_map = 2; + map string_int32_map = 3; + map string_int64_map = 4; + map string_uint32_map = 5; + map string_uint64_map = 6; + map string_bool_map = 7; + map string_string_map = 8; + map string_bytes_map = 9; + map string_empty_map = 10; + map string_timestamp_map = 11; + map string_duration_map = 12; + map string_field_mask_map = 13; + map string_value_map = 14; + map string_list_value_map = 15; + map string_struct_map = 16; + map string_any_map = 17; } From fc1f2e787b5580c09890da218268a3b943cc770f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 11:23:10 +0200 Subject: [PATCH 41/46] Bump actions/checkout from 3 to 4 (#27) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/bsr.yml | 2 +- .github/workflows/buf.yml | 2 +- .github/workflows/go.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bsr.yml b/.github/workflows/bsr.yml index 23c14391..f37e1652 100644 --- a/.github/workflows/bsr.yml +++ b/.github/workflows/bsr.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Buf uses: bufbuild/buf-setup-action@v1 with: diff --git a/.github/workflows/buf.yml b/.github/workflows/buf.yml index 4e1a0d55..a366934f 100644 --- a/.github/workflows/buf.yml +++ b/.github/workflows/buf.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Buf uses: bufbuild/buf-setup-action@v1 with: diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 60e101ba..5c352baf 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v4 with: From 3cc4e864eef63da1f7fdd6403b4d82ed4212c45b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Nov 2023 16:16:28 +0100 Subject: [PATCH 42/46] Bump github.com/google/go-cmp from 0.5.9 to 0.6.0 (#28) Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.9 to 0.6.0. - [Release notes](https://github.com/google/go-cmp/releases) - [Commits](https://github.com/google/go-cmp/compare/v0.5.9...v0.6.0) --- updated-dependencies: - dependency-name: github.com/google/go-cmp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b3be795a..2803a65b 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/TheThingsIndustries/protoc-gen-go-json go 1.20 require ( - github.com/google/go-cmp v0.5.9 + github.com/google/go-cmp v0.6.0 github.com/json-iterator/go v1.1.12 google.golang.org/protobuf v1.31.0 ) diff --git a/go.sum b/go.sum index 08ad1872..a33ba779 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= From 9024ef0a318f60d7083118da6b81e9db0c95dfa1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:30:09 +0100 Subject: [PATCH 43/46] Bump actions/github-script from 6 to 7 (#29) Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/github-script dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/issue-triage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue-triage.yml b/.github/workflows/issue-triage.yml index f7122ea1..11e3a08d 100644 --- a/.github/workflows/issue-triage.yml +++ b/.github/workflows/issue-triage.yml @@ -10,7 +10,7 @@ jobs: timeout-minutes: 5 steps: - name: Add "needs/triage" label - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | From 9795d21dc5076c0c114f9cff06096c08b3136c11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 12:44:17 +0100 Subject: [PATCH 44/46] Bump actions/setup-go from 4 to 5 (#31) Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5c352baf..c352158c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -12,7 +12,7 @@ jobs: - name: Check out code uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: "~1.20" - name: Install Buf From 07c42c625816a53f4f5e0e79bd9f3d5d238c52b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 16:35:17 +0200 Subject: [PATCH 45/46] Bump google.golang.org/protobuf from 1.31.0 to 1.32.0 (#30) Bumps google.golang.org/protobuf from 1.31.0 to 1.32.0. --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 2803a65b..4b0ffb63 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/google/go-cmp v0.6.0 github.com/json-iterator/go v1.1.12 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 ) require ( diff --git a/go.sum b/go.sum index a33ba779..c2d38148 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -18,7 +16,5 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= From 529f53dc599fa0ed07e800ef70fbe660b2c38c0b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:09:31 +0100 Subject: [PATCH 46/46] Bump google.golang.org/protobuf from 1.32.0 to 1.33.0 (#32) Bumps google.golang.org/protobuf from 1.32.0 to 1.33.0. --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4b0ffb63..2f5ff790 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/google/go-cmp v0.6.0 github.com/json-iterator/go v1.1.12 - google.golang.org/protobuf v1.32.0 + google.golang.org/protobuf v1.33.0 ) require ( diff --git a/go.sum b/go.sum index c2d38148..e3a6d57a 100644 --- a/go.sum +++ b/go.sum @@ -16,5 +16,5 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=