From 87c30a2ff6c287f89ca1707127ac512b833a7c1a Mon Sep 17 00:00:00 2001 From: Noah Seger <45796360+noahseger@users.noreply.github.com> Date: Thu, 29 Jun 2023 09:58:23 -0500 Subject: [PATCH] Protoscript (#24) ## Results | Implementation | JavaScript | TypeScript | Standard
Plugin | Required tests | Recommended tests | |-----------------------------------------|:------------------:|:------------------:|:------------------:|:-------------------------------------:|:----------------------------------------:| | [Protobuf-ES](impl/protobuf-es) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
(0 failures) |
(1 failures) | | [protobuf-ts](impl/protobuf-ts) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
(6 failures) |
(5 failures) | | [protoscript](impl/protoscript) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
(934 failures) |
(487 failures) | | [google-protobuf](impl/google-protobuf) | :heavy_check_mark: | :x: | :heavy_check_mark: |
(387 failures) |
(216 failures) | | [protobuf.js](impl/protobuf.js) | :heavy_check_mark: | :heavy_check_mark: | :x: |
(928 failures) |
(471 failures) | | [protoc-gen-ts](impl/protoc-gen-ts) | :x: | :heavy_check_mark: | :heavy_check_mark: |
(1085 failures) |
(369 failures) | | [ts-proto](impl/ts-proto) | :x: | :heavy_check_mark: | :heavy_check_mark: |
(848 failures) |
(528 failures) --- Makefile | 2 + README.md | 2 + impl/protoscript/README.md | 7 + impl/protoscript/buf.gen.yaml | 6 + impl/protoscript/failing_tests.txt | 1421 +++ .../protoscript/failing_tests_text_format.txt | 112 + .../gen/conformance/conformance.pb.ts | 1200 +++ .../protobuf/test_messages_proto2.pb.ts | 8606 +++++++++++++++++ .../protobuf/test_messages_proto3.pb.ts | 6654 +++++++++++++ impl/protoscript/nonexistent_tests.txt | 112 + impl/protoscript/package-lock.json | 1042 ++ impl/protoscript/package.json | 15 + impl/protoscript/runner.ts | 184 + impl/protoscript/succeeding_tests.txt | 271 + impl/protoscript/test.sh | 15 + impl/protoscript/tsconfig.json | 33 + report.js | 2 + 17 files changed, 19684 insertions(+) create mode 100644 impl/protoscript/README.md create mode 100644 impl/protoscript/buf.gen.yaml create mode 100644 impl/protoscript/failing_tests.txt create mode 100644 impl/protoscript/failing_tests_text_format.txt create mode 100644 impl/protoscript/gen/conformance/conformance.pb.ts create mode 100644 impl/protoscript/gen/google/protobuf/test_messages_proto2.pb.ts create mode 100644 impl/protoscript/gen/google/protobuf/test_messages_proto3.pb.ts create mode 100644 impl/protoscript/nonexistent_tests.txt create mode 100644 impl/protoscript/package-lock.json create mode 100644 impl/protoscript/package.json create mode 100755 impl/protoscript/runner.ts create mode 100644 impl/protoscript/succeeding_tests.txt create mode 100755 impl/protoscript/test.sh create mode 100644 impl/protoscript/tsconfig.json diff --git a/Makefile b/Makefile index c94bbeeb..164d4df7 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,7 @@ test: $(BIN)/conformance_test_runner ## Run conformance tests cd impl/protobuf-es; PATH="$(abspath $(BIN)):$(PATH)" ./test.sh cd impl/protobuf-ts; PATH="$(abspath $(BIN)):$(PATH)" ./test.sh cd impl/protoc-gen-ts; PATH="$(abspath $(BIN)):$(PATH)" ./test.sh + cd impl/protoscript; PATH="$(abspath $(BIN)):$(PATH)" ./test.sh cd impl/baseline; PATH="$(abspath $(BIN)):$(PATH)" ./test.sh node report.js @@ -54,6 +55,7 @@ testci: ## Run conformance tests in CI cd impl/protobuf-es; PATH="$(abspath $(BIN)):$(PATH)" ./test.sh cd impl/protobuf-ts; PATH="$(abspath $(BIN)):$(PATH)" ./test.sh cd impl/protoc-gen-ts; PATH="$(abspath $(BIN)):$(PATH)" ./test.sh + cd impl/protoscript; PATH="$(abspath $(BIN)):$(PATH)" ./test.sh cd impl/baseline; PATH="$(abspath $(BIN)):$(PATH)" ./test.sh node report.js diff --git a/README.md b/README.md index cc693c38..d21cf162 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ The current implementations being tested are: * protobuf.js: https://github.com/protobufjs/protobuf.js/ * protoc-gen-ts: https://github.com/thesayyn/protoc-gen-ts * ts-proto: https://github.com/stephenh/ts-proto +* protoscript: https://github.com/TateThurston/protoscript ## Results @@ -21,6 +22,7 @@ The current implementations being tested are: |-----------------------------------------|:------------------:|:------------------:|:------------------:|:-------------------------------------:|:----------------------------------------:| | [Protobuf-ES](impl/protobuf-es) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
(0 failures) |
(1 failures) | | [protobuf-ts](impl/protobuf-ts) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
(6 failures) |
(5 failures) | +| [protoscript](impl/protoscript) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
(934 failures) |
(487 failures) | | [google-protobuf](impl/google-protobuf) | :heavy_check_mark: | :x: | :heavy_check_mark: |
(387 failures) |
(216 failures) | | [protobuf.js](impl/protobuf.js) | :heavy_check_mark: | :heavy_check_mark: | :x: |
(928 failures) |
(471 failures) | | [protoc-gen-ts](impl/protoc-gen-ts) | :x: | :heavy_check_mark: | :heavy_check_mark: |
(1085 failures) |
(369 failures) | diff --git a/impl/protoscript/README.md b/impl/protoscript/README.md new file mode 100644 index 00000000..746c3432 --- /dev/null +++ b/impl/protoscript/README.md @@ -0,0 +1,7 @@ +# ProtoScript + +[ProtoScript](https://github.com/TateThurston/protoScript) + +## Caveats + +Compiles BigInt literals, so TypeScript must target ES2020. diff --git a/impl/protoscript/buf.gen.yaml b/impl/protoscript/buf.gen.yaml new file mode 100644 index 00000000..3bce38b8 --- /dev/null +++ b/impl/protoscript/buf.gen.yaml @@ -0,0 +1,6 @@ +version: v1 +plugins: + - name: protoscript + path: node_modules/protoscript/compiler.js + opt: language=typescript + out: gen diff --git a/impl/protoscript/failing_tests.txt b/impl/protoscript/failing_tests.txt new file mode 100644 index 00000000..782e5486 --- /dev/null +++ b/impl/protoscript/failing_tests.txt @@ -0,0 +1,1421 @@ +Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput +Recommended.FieldMaskPathsDontRoundTrip.JsonOutput +Recommended.FieldMaskTooManyUnderscore.JsonOutput +Recommended.Proto2.JsonInput.FieldNameExtension.Validator +Recommended.Proto2.ProtobufInput.OneofZeroBool.ProtobufOutput +Recommended.Proto2.ProtobufInput.OneofZeroBytes.ProtobufOutput +Recommended.Proto2.ProtobufInput.OneofZeroDouble.ProtobufOutput +Recommended.Proto2.ProtobufInput.OneofZeroEnum.ProtobufOutput +Recommended.Proto2.ProtobufInput.OneofZeroFloat.ProtobufOutput +Recommended.Proto2.ProtobufInput.OneofZeroMessage.ProtobufOutput +Recommended.Proto2.ProtobufInput.OneofZeroMessageSetTwice.ProtobufOutput +Recommended.Proto2.ProtobufInput.OneofZeroString.ProtobufOutput +Recommended.Proto2.ProtobufInput.OneofZeroUint32.ProtobufOutput +Recommended.Proto2.ProtobufInput.OneofZeroUint64.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.BOOL.DefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.BOOL.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.BOOL.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.BOOL.NonDefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.BYTES.DefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.BYTES.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.BYTES.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.BYTES.NonDefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.DOUBLE.DefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.DOUBLE.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.DOUBLE.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.DOUBLE.NonDefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.ENUM.DefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.ENUM.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.ENUM.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.ENUM.NonDefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.FLOAT.DefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.FLOAT.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.FLOAT.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.FLOAT.NonDefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.MESSAGE.DefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.MESSAGE.Merge.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.MESSAGE.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.MESSAGE.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.MESSAGE.NonDefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.STRING.DefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.STRING.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.STRING.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.STRING.NonDefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.UINT32.DefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.UINT32.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.UINT32.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.UINT32.NonDefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.UINT64.DefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.UINT64.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.UINT64.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataOneofBinary.UINT64.NonDefaultValue.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.BOOL[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.BOOL[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.BOOL[2].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.BOOL[3].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.BOOL[4].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.BOOL[5].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.BOOL[6].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.BYTES[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.BYTES[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.BYTES[2].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.BYTES[3].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.DOUBLE[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.DOUBLE[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.DOUBLE[2].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.DOUBLE[3].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.ENUM[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.ENUM[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.ENUM[2].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.ENUM[3].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.ENUM[4].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.ENUM[5].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.FIXED32[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.FIXED32[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.FIXED32[2].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.FIXED64[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.FIXED64[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.FIXED64[2].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.FLOAT[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.FLOAT[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.FLOAT[2].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.FLOAT[3].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.FLOAT[4].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT32[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT32[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT32[2].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT32[3].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT32[4].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT32[5].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT32[6].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT32[7].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT32[8].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT32[9].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT64[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT64[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT64[2].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.INT64[3].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.MESSAGE[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.MESSAGE[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SFIXED32[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SFIXED32[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SFIXED32[2].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SFIXED32[3].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SFIXED64[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SFIXED64[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SFIXED64[2].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SFIXED64[3].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SINT32[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SINT32[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SINT32[2].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SINT32[3].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SINT32[4].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SINT64[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SINT64[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SINT64[2].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.SINT64[3].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.STRING[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.STRING[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.STRING[2].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.STRING[3].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.STRING[4].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.STRING[5].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.STRING[6].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.UINT32[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.UINT32[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.UINT32[2].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.UINT32[3].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.UINT32[4].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.UINT32[5].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.UINT32[6].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.UINT32[7].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.UINT32[8].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.UINT32[9].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.UINT64[0].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.UINT64[1].ProtobufOutput +Recommended.Proto2.ProtobufInput.ValidDataScalarBinary.UINT64[2].ProtobufOutput +Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput +Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput +Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator +Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator +Recommended.Proto3.JsonInput.DurationHas9FractionalDigits.Validator +Recommended.Proto3.JsonInput.DurationHasZeroFractionalDigit.Validator +Recommended.Proto3.JsonInput.FieldNameWithDoubleUnderscores.JsonOutput +Recommended.Proto3.JsonInput.FieldNameWithDoubleUnderscores.ProtobufOutput +Recommended.Proto3.JsonInput.FieldNameWithDoubleUnderscores.Validator +Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInMapValue.ProtobufOutput +Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInOptionalField.ProtobufOutput +Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInRepeatedField.ProtobufOutput +Recommended.Proto3.JsonInput.Int64FieldBeString.Validator +Recommended.Proto3.JsonInput.MultilineNoSpaces.JsonOutput +Recommended.Proto3.JsonInput.MultilineNoSpaces.ProtobufOutput +Recommended.Proto3.JsonInput.MultilineWithSpaces.JsonOutput +Recommended.Proto3.JsonInput.MultilineWithSpaces.ProtobufOutput +Recommended.Proto3.JsonInput.NullValueInNormalMessage.Validator +Recommended.Proto3.JsonInput.NullValueInOtherOneofNewFormat.Validator +Recommended.Proto3.JsonInput.NullValueInOtherOneofOldFormat.Validator +Recommended.Proto3.JsonInput.OneLineNoSpaces.JsonOutput +Recommended.Proto3.JsonInput.OneLineNoSpaces.ProtobufOutput +Recommended.Proto3.JsonInput.OneLineWithSpaces.JsonOutput +Recommended.Proto3.JsonInput.OneLineWithSpaces.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroBool.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroBool.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroBytes.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroBytes.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroDouble.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroDouble.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroEnum.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroEnum.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroFloat.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroFloat.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroMessage.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroMessage.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroString.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroString.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroUint32.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroUint32.ProtobufOutput +Recommended.Proto3.JsonInput.OneofZeroUint64.JsonOutput +Recommended.Proto3.JsonInput.OneofZeroUint64.ProtobufOutput +Recommended.Proto3.JsonInput.TimestampHas3FractionalDigits.Validator +Recommended.Proto3.JsonInput.TimestampHas6FractionalDigits.Validator +Recommended.Proto3.JsonInput.TimestampHas9FractionalDigits.Validator +Recommended.Proto3.JsonInput.TimestampHasZeroFractionalDigit.Validator +Recommended.Proto3.JsonInput.TimestampZeroNormalized.Validator +Recommended.Proto3.JsonInput.Uint64FieldBeString.Validator +Recommended.Proto3.ProtobufInput.OneofZeroBool.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroBytes.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroBytes.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroDouble.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroEnum.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroFloat.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroMessage.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroMessageSetTwice.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroString.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint32.ProtobufOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint64.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BOOL.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BOOL.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BOOL.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BOOL.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BYTES.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BYTES.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BYTES.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.BYTES.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.DOUBLE.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.DOUBLE.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.DOUBLE.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.DOUBLE.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.ENUM.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.ENUM.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.ENUM.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.ENUM.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.FLOAT.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.FLOAT.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.FLOAT.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.FLOAT.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.MESSAGE.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.MESSAGE.Merge.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.MESSAGE.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.MESSAGE.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.MESSAGE.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.STRING.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.STRING.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.STRING.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.STRING.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT32.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT32.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT32.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT32.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT64.DefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT64.MultipleValuesForDifferentField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT64.MultipleValuesForSameField.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.UINT64.NonDefaultValue.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.UnpackedOutput.ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[4].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[5].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[6].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BYTES[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BYTES[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BYTES[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BYTES[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.DOUBLE[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.DOUBLE[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.DOUBLE[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.DOUBLE[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[4].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[5].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED32[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED32[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED32[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED64[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED64[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED64[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FLOAT[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FLOAT[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FLOAT[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FLOAT[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FLOAT[4].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[4].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[5].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[6].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[7].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[8].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[9].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT64[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT64[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT64[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT64[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.MESSAGE[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.MESSAGE[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED32[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED32[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED32[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED32[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED64[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED64[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED64[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED64[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT32[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT32[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT32[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT32[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT32[4].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT64[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT64[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT64[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT64[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.STRING[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.STRING[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.STRING[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.STRING[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.STRING[4].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.STRING[5].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.STRING[6].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[2].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[3].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[4].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[5].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[6].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[7].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[8].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[9].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT64[0].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT64[1].ProtobufOutput +Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT64[2].ProtobufOutput +Recommended.ValueRejectInfNumberValue.JsonOutput +Recommended.ValueRejectNanNumberValue.JsonOutput +Required.DurationProtoInputTooLarge.JsonOutput +Required.DurationProtoInputTooSmall.JsonOutput +Required.Proto2.JsonInput.StoresDefaultPrimitive.Validator +Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_0 +Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_1 +Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_2 +Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_3 +Required.Proto2.ProtobufInput.PrematureEofInPackedFieldValue.BOOL +Required.Proto2.ProtobufInput.RepeatedScalarMessageMerge.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.BOOL.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.BYTES.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.DOUBLE.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.ENUM.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.FLOAT.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.INT32.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.INT64.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.SFIXED32.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.SFIXED64.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.SINT32.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.SINT64.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.STRING.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.UINT32.ProtobufOutput +Required.Proto2.ProtobufInput.RepeatedScalarSelectsLast.UINT64.ProtobufOutput +Required.Proto2.ProtobufInput.UnknownVarint.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.BOOL.BOOL.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.BOOL.BOOL.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.BOOL.BOOL.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.BOOL.BOOL.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.BOOL.BOOL.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.BOOL.BOOL.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.BOOL.BOOL.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.FIXED32.FIXED32.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.FIXED32.FIXED32.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.FIXED32.FIXED32.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.FIXED32.FIXED32.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.FIXED32.FIXED32.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.FIXED32.FIXED32.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.FIXED32.FIXED32.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.FIXED64.FIXED64.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.FIXED64.FIXED64.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.FIXED64.FIXED64.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.FIXED64.FIXED64.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.FIXED64.FIXED64.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.FIXED64.FIXED64.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.FIXED64.FIXED64.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.DOUBLE.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.DOUBLE.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.DOUBLE.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.DOUBLE.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.DOUBLE.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.DOUBLE.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.DOUBLE.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.FLOAT.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.FLOAT.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.FLOAT.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.FLOAT.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.FLOAT.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.FLOAT.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.FLOAT.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.INT32.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.INT32.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.INT32.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.INT32.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.INT32.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.INT32.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT32.INT32.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT64.INT64.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT64.INT64.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT64.INT64.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT64.INT64.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT64.INT64.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT64.INT64.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.INT64.INT64.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SINT32.SINT32.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SINT32.SINT32.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SINT32.SINT32.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SINT32.SINT32.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SINT32.SINT32.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SINT32.SINT32.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SINT32.SINT32.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SINT64.SINT64.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SINT64.SINT64.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SINT64.SINT64.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SINT64.SINT64.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SINT64.SINT64.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SINT64.SINT64.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.SINT64.SINT64.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.BYTES.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.BYTES.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.BYTES.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.BYTES.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.BYTES.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.BYTES.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.BYTES.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.ENUM.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.ENUM.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.ENUM.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.ENUM.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.ENUM.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.ENUM.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.ENUM.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.MESSAGE.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.MESSAGE.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.MESSAGE.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.MESSAGE.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.MESSAGE.MergeValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.MESSAGE.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.MESSAGE.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.MESSAGE.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.STRING.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.STRING.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.STRING.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.STRING.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.STRING.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.STRING.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.STRING.STRING.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.UINT32.UINT32.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.UINT32.UINT32.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.UINT32.UINT32.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.UINT32.UINT32.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.UINT32.UINT32.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.UINT32.UINT32.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.UINT32.UINT32.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.UINT64.UINT64.Default.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.UINT64.UINT64.DuplicateKey.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.UINT64.UINT64.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.UINT64.UINT64.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.UINT64.UINT64.MissingDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.UINT64.UINT64.NonDefault.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataMap.UINT64.UINT64.Unordered.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.BOOL.DefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.BOOL.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.BOOL.MultipleValuesForSameField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.BOOL.NonDefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.BYTES.DefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.BYTES.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.BYTES.MultipleValuesForSameField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.BYTES.NonDefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.DOUBLE.DefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.DOUBLE.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.DOUBLE.MultipleValuesForSameField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.DOUBLE.NonDefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.ENUM.DefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.ENUM.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.ENUM.MultipleValuesForSameField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.ENUM.NonDefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.FLOAT.DefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.FLOAT.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.FLOAT.MultipleValuesForSameField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.FLOAT.NonDefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.MESSAGE.DefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.MESSAGE.Merge.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.MESSAGE.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.MESSAGE.MultipleValuesForSameField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.MESSAGE.NonDefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.STRING.DefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.STRING.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.STRING.MultipleValuesForSameField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.STRING.NonDefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.UINT32.DefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.UINT32.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.UINT32.MultipleValuesForSameField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.UINT32.NonDefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.UINT64.DefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.UINT64.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.UINT64.MultipleValuesForSameField.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataOneof.UINT64.NonDefaultValue.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.BYTES.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.INT32.PackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.INT64.PackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.MESSAGE.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.STRING.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.BOOL[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.BOOL[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.BOOL[2].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.BOOL[3].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.BOOL[4].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.BOOL[5].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.BOOL[6].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.BYTES[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.BYTES[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.BYTES[2].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.BYTES[3].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.DOUBLE[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.DOUBLE[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.DOUBLE[2].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.DOUBLE[3].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.ENUM[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.ENUM[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.ENUM[2].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.ENUM[3].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.ENUM[4].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.ENUM[5].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.FIXED32[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.FIXED32[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.FIXED32[2].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.FIXED64[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.FIXED64[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.FIXED64[2].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.FLOAT[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.FLOAT[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.FLOAT[2].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.FLOAT[3].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.FLOAT[4].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.INT32[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.INT32[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.INT32[2].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.INT32[3].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.INT32[4].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.INT32[5].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.INT32[6].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.INT32[7].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.INT32[8].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.INT32[9].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.INT64[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.INT64[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.INT64[2].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.INT64[3].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.MESSAGE[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.MESSAGE[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SFIXED32[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SFIXED32[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SFIXED32[2].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SFIXED32[3].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SFIXED64[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SFIXED64[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SFIXED64[2].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SFIXED64[3].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SINT32[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SINT32[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SINT32[2].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SINT32[3].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SINT32[4].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SINT64[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SINT64[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SINT64[2].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.SINT64[3].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.STRING[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.STRING[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.STRING[2].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.STRING[3].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.STRING[4].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.STRING[5].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.STRING[6].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.UINT32[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.UINT32[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.UINT32[2].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.UINT32[3].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.UINT32[4].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.UINT32[5].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.UINT32[6].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.UINT32[7].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.UINT32[8].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.UINT32[9].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.UINT64[0].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.UINT64[1].ProtobufOutput +Required.Proto2.ProtobufInput.ValidDataScalar.UINT64[2].ProtobufOutput +Required.Proto3.JsonInput.AllFieldAcceptNull.JsonOutput +Required.Proto3.JsonInput.AllFieldAcceptNull.ProtobufOutput +Required.Proto3.JsonInput.Any.JsonOutput +Required.Proto3.JsonInput.Any.ProtobufOutput +Required.Proto3.JsonInput.AnyNested.JsonOutput +Required.Proto3.JsonInput.AnyNested.ProtobufOutput +Required.Proto3.JsonInput.AnyUnorderedTypeTag.JsonOutput +Required.Proto3.JsonInput.AnyUnorderedTypeTag.ProtobufOutput +Required.Proto3.JsonInput.AnyWithDuration.JsonOutput +Required.Proto3.JsonInput.AnyWithDuration.ProtobufOutput +Required.Proto3.JsonInput.AnyWithFieldMask.JsonOutput +Required.Proto3.JsonInput.AnyWithFieldMask.ProtobufOutput +Required.Proto3.JsonInput.AnyWithInt32ValueWrapper.JsonOutput +Required.Proto3.JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput +Required.Proto3.JsonInput.AnyWithStruct.JsonOutput +Required.Proto3.JsonInput.AnyWithStruct.ProtobufOutput +Required.Proto3.JsonInput.AnyWithTimestamp.JsonOutput +Required.Proto3.JsonInput.AnyWithTimestamp.ProtobufOutput +Required.Proto3.JsonInput.AnyWithValueForInteger.JsonOutput +Required.Proto3.JsonInput.AnyWithValueForInteger.ProtobufOutput +Required.Proto3.JsonInput.AnyWithValueForJsonObject.JsonOutput +Required.Proto3.JsonInput.AnyWithValueForJsonObject.ProtobufOutput +Required.Proto3.JsonInput.BoolFieldFalse.JsonOutput +Required.Proto3.JsonInput.BoolFieldFalse.ProtobufOutput +Required.Proto3.JsonInput.BoolFieldTrue.JsonOutput +Required.Proto3.JsonInput.BoolFieldTrue.ProtobufOutput +Required.Proto3.JsonInput.BoolMapEscapedKey.JsonOutput +Required.Proto3.JsonInput.BoolMapEscapedKey.ProtobufOutput +Required.Proto3.JsonInput.BoolMapField.JsonOutput +Required.Proto3.JsonInput.BoolMapField.ProtobufOutput +Required.Proto3.JsonInput.BytesField.JsonOutput +Required.Proto3.JsonInput.BytesField.ProtobufOutput +Required.Proto3.JsonInput.BytesRepeatedField.JsonOutput +Required.Proto3.JsonInput.BytesRepeatedField.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldInfinity.JsonOutput +Required.Proto3.JsonInput.DoubleFieldInfinity.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldMaxPositiveValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMaxPositiveValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldMinNegativeValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMinNegativeValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldNan.JsonOutput +Required.Proto3.JsonInput.DoubleFieldNan.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldNegativeInfinity.JsonOutput +Required.Proto3.JsonInput.DoubleFieldNegativeInfinity.ProtobufOutput +Required.Proto3.JsonInput.DoubleFieldQuotedValue.JsonOutput +Required.Proto3.JsonInput.DoubleFieldQuotedValue.ProtobufOutput +Required.Proto3.JsonInput.DurationMaxValue.JsonOutput +Required.Proto3.JsonInput.DurationMaxValue.ProtobufOutput +Required.Proto3.JsonInput.DurationMinValue.JsonOutput +Required.Proto3.JsonInput.DurationMinValue.ProtobufOutput +Required.Proto3.JsonInput.DurationNegativeNanos.JsonOutput +Required.Proto3.JsonInput.DurationNegativeNanos.ProtobufOutput +Required.Proto3.JsonInput.DurationNegativeSeconds.JsonOutput +Required.Proto3.JsonInput.DurationNegativeSeconds.ProtobufOutput +Required.Proto3.JsonInput.DurationNull.JsonOutput +Required.Proto3.JsonInput.DurationNull.ProtobufOutput +Required.Proto3.JsonInput.DurationRepeatedValue.JsonOutput +Required.Proto3.JsonInput.DurationRepeatedValue.ProtobufOutput +Required.Proto3.JsonInput.EmptyFieldMask.JsonOutput +Required.Proto3.JsonInput.EmptyFieldMask.ProtobufOutput +Required.Proto3.JsonInput.EnumField.JsonOutput +Required.Proto3.JsonInput.EnumField.ProtobufOutput +Required.Proto3.JsonInput.EnumFieldNumericValueNonZero.JsonOutput +Required.Proto3.JsonInput.EnumFieldNumericValueNonZero.ProtobufOutput +Required.Proto3.JsonInput.EnumFieldNumericValueZero.JsonOutput +Required.Proto3.JsonInput.EnumFieldNumericValueZero.ProtobufOutput +Required.Proto3.JsonInput.EnumFieldUnknownValue.Validator +Required.Proto3.JsonInput.EnumFieldWithAlias.JsonOutput +Required.Proto3.JsonInput.EnumFieldWithAlias.ProtobufOutput +Required.Proto3.JsonInput.EnumFieldWithAliasDifferentCase.JsonOutput +Required.Proto3.JsonInput.EnumFieldWithAliasDifferentCase.ProtobufOutput +Required.Proto3.JsonInput.EnumFieldWithAliasLowerCase.JsonOutput +Required.Proto3.JsonInput.EnumFieldWithAliasLowerCase.ProtobufOutput +Required.Proto3.JsonInput.EnumFieldWithAliasUseAlias.JsonOutput +Required.Proto3.JsonInput.EnumFieldWithAliasUseAlias.ProtobufOutput +Required.Proto3.JsonInput.EnumRepeatedField.JsonOutput +Required.Proto3.JsonInput.EnumRepeatedField.ProtobufOutput +Required.Proto3.JsonInput.FieldMask.JsonOutput +Required.Proto3.JsonInput.FieldMask.ProtobufOutput +Required.Proto3.JsonInput.FieldNameEscaped.JsonOutput +Required.Proto3.JsonInput.FieldNameEscaped.ProtobufOutput +Required.Proto3.JsonInput.FieldNameInLowerCamelCase.Validator +Required.Proto3.JsonInput.FieldNameInSnakeCase.JsonOutput +Required.Proto3.JsonInput.FieldNameInSnakeCase.ProtobufOutput +Required.Proto3.JsonInput.FieldNameWithMixedCases.JsonOutput +Required.Proto3.JsonInput.FieldNameWithMixedCases.ProtobufOutput +Required.Proto3.JsonInput.FieldNameWithMixedCases.Validator +Required.Proto3.JsonInput.FieldNameWithNumbers.JsonOutput +Required.Proto3.JsonInput.FieldNameWithNumbers.ProtobufOutput +Required.Proto3.JsonInput.FieldNameWithNumbers.Validator +Required.Proto3.JsonInput.FloatFieldInfinity.JsonOutput +Required.Proto3.JsonInput.FloatFieldInfinity.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldMaxNegativeValue.JsonOutput +Required.Proto3.JsonInput.FloatFieldMaxNegativeValue.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldMaxPositiveValue.JsonOutput +Required.Proto3.JsonInput.FloatFieldMaxPositiveValue.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldMinNegativeValue.JsonOutput +Required.Proto3.JsonInput.FloatFieldMinNegativeValue.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldMinPositiveValue.JsonOutput +Required.Proto3.JsonInput.FloatFieldMinPositiveValue.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldNan.JsonOutput +Required.Proto3.JsonInput.FloatFieldNan.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldNegativeInfinity.JsonOutput +Required.Proto3.JsonInput.FloatFieldNegativeInfinity.ProtobufOutput +Required.Proto3.JsonInput.FloatFieldQuotedValue.JsonOutput +Required.Proto3.JsonInput.FloatFieldQuotedValue.ProtobufOutput +Required.Proto3.JsonInput.HelloWorld.JsonOutput +Required.Proto3.JsonInput.HelloWorld.ProtobufOutput +Required.Proto3.JsonInput.IgnoreUnknownJsonFalse.ProtobufOutput +Required.Proto3.JsonInput.IgnoreUnknownJsonNull.ProtobufOutput +Required.Proto3.JsonInput.IgnoreUnknownJsonNumber.ProtobufOutput +Required.Proto3.JsonInput.IgnoreUnknownJsonObject.ProtobufOutput +Required.Proto3.JsonInput.IgnoreUnknownJsonString.ProtobufOutput +Required.Proto3.JsonInput.IgnoreUnknownJsonTrue.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldExponentialFormat.JsonOutput +Required.Proto3.JsonInput.Int32FieldExponentialFormat.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldFloatTrailingZero.JsonOutput +Required.Proto3.JsonInput.Int32FieldFloatTrailingZero.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldMaxFloatValue.JsonOutput +Required.Proto3.JsonInput.Int32FieldMaxFloatValue.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldMaxValue.JsonOutput +Required.Proto3.JsonInput.Int32FieldMaxValue.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldMinFloatValue.JsonOutput +Required.Proto3.JsonInput.Int32FieldMinFloatValue.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldMinValue.JsonOutput +Required.Proto3.JsonInput.Int32FieldMinValue.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldStringValue.JsonOutput +Required.Proto3.JsonInput.Int32FieldStringValue.ProtobufOutput +Required.Proto3.JsonInput.Int32FieldStringValueEscaped.JsonOutput +Required.Proto3.JsonInput.Int32FieldStringValueEscaped.ProtobufOutput +Required.Proto3.JsonInput.Int32MapEscapedKey.JsonOutput +Required.Proto3.JsonInput.Int32MapEscapedKey.ProtobufOutput +Required.Proto3.JsonInput.Int32MapField.JsonOutput +Required.Proto3.JsonInput.Int32MapField.ProtobufOutput +Required.Proto3.JsonInput.Int64FieldMaxValue.JsonOutput +Required.Proto3.JsonInput.Int64FieldMaxValue.ProtobufOutput +Required.Proto3.JsonInput.Int64FieldMaxValueNotQuoted.JsonOutput +Required.Proto3.JsonInput.Int64FieldMaxValueNotQuoted.ProtobufOutput +Required.Proto3.JsonInput.Int64FieldMinValue.JsonOutput +Required.Proto3.JsonInput.Int64FieldMinValue.ProtobufOutput +Required.Proto3.JsonInput.Int64FieldMinValueNotQuoted.JsonOutput +Required.Proto3.JsonInput.Int64FieldMinValueNotQuoted.ProtobufOutput +Required.Proto3.JsonInput.Int64MapEscapedKey.JsonOutput +Required.Proto3.JsonInput.Int64MapEscapedKey.ProtobufOutput +Required.Proto3.JsonInput.Int64MapField.JsonOutput +Required.Proto3.JsonInput.Int64MapField.ProtobufOutput +Required.Proto3.JsonInput.MessageField.JsonOutput +Required.Proto3.JsonInput.MessageField.ProtobufOutput +Required.Proto3.JsonInput.MessageMapField.JsonOutput +Required.Proto3.JsonInput.MessageMapField.ProtobufOutput +Required.Proto3.JsonInput.MessageRepeatedField.JsonOutput +Required.Proto3.JsonInput.MessageRepeatedField.ProtobufOutput +Required.Proto3.JsonInput.OneofFieldNullFirst.JsonOutput +Required.Proto3.JsonInput.OneofFieldNullFirst.ProtobufOutput +Required.Proto3.JsonInput.OneofFieldNullSecond.JsonOutput +Required.Proto3.JsonInput.OneofFieldNullSecond.ProtobufOutput +Required.Proto3.JsonInput.OptionalBoolWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalBoolWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalBytesWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalBytesWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalDoubleWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalDoubleWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalFloatWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalFloatWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalInt32Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalInt32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalInt64Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalInt64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalStringWrapper.JsonOutput +Required.Proto3.JsonInput.OptionalStringWrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalUint32Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalUint32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalUint64Wrapper.JsonOutput +Required.Proto3.JsonInput.OptionalUint64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput +Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput +Required.Proto3.JsonInput.OriginalProtoFieldName.JsonOutput +Required.Proto3.JsonInput.OriginalProtoFieldName.ProtobufOutput +Required.Proto3.JsonInput.PrimitiveRepeatedField.JsonOutput +Required.Proto3.JsonInput.PrimitiveRepeatedField.ProtobufOutput +Required.Proto3.JsonInput.RepeatedBoolWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedBoolWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedBytesWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedBytesWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedDoubleWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedDoubleWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedFloatWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedFloatWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedInt32Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedInt32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedInt64Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedInt64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedListValue.JsonOutput +Required.Proto3.JsonInput.RepeatedListValue.ProtobufOutput +Required.Proto3.JsonInput.RepeatedStringWrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedStringWrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedUint32Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedUint32Wrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedUint64Wrapper.JsonOutput +Required.Proto3.JsonInput.RepeatedUint64Wrapper.ProtobufOutput +Required.Proto3.JsonInput.RepeatedValue.JsonOutput +Required.Proto3.JsonInput.RepeatedValue.ProtobufOutput +Required.Proto3.JsonInput.SkipsDefaultPrimitive.Validator +Required.Proto3.JsonInput.StringField.JsonOutput +Required.Proto3.JsonInput.StringField.ProtobufOutput +Required.Proto3.JsonInput.StringFieldEscape.JsonOutput +Required.Proto3.JsonInput.StringFieldEscape.ProtobufOutput +Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput +Required.Proto3.JsonInput.StringFieldSurrogatePair.ProtobufOutput +Required.Proto3.JsonInput.StringFieldUnicode.JsonOutput +Required.Proto3.JsonInput.StringFieldUnicode.ProtobufOutput +Required.Proto3.JsonInput.StringFieldUnicodeEscape.JsonOutput +Required.Proto3.JsonInput.StringFieldUnicodeEscape.ProtobufOutput +Required.Proto3.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.JsonOutput +Required.Proto3.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.ProtobufOutput +Required.Proto3.JsonInput.StringRepeatedField.JsonOutput +Required.Proto3.JsonInput.StringRepeatedField.ProtobufOutput +Required.Proto3.JsonInput.Struct.JsonOutput +Required.Proto3.JsonInput.Struct.ProtobufOutput +Required.Proto3.JsonInput.StructWithEmptyListValue.JsonOutput +Required.Proto3.JsonInput.StructWithEmptyListValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampLeap.JsonOutput +Required.Proto3.JsonInput.TimestampLeap.ProtobufOutput +Required.Proto3.JsonInput.TimestampMaxValue.JsonOutput +Required.Proto3.JsonInput.TimestampMaxValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampMinValue.JsonOutput +Required.Proto3.JsonInput.TimestampMinValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampNull.JsonOutput +Required.Proto3.JsonInput.TimestampNull.ProtobufOutput +Required.Proto3.JsonInput.TimestampRepeatedValue.JsonOutput +Required.Proto3.JsonInput.TimestampRepeatedValue.ProtobufOutput +Required.Proto3.JsonInput.TimestampWithNegativeOffset.JsonOutput +Required.Proto3.JsonInput.TimestampWithNegativeOffset.ProtobufOutput +Required.Proto3.JsonInput.TimestampWithPositiveOffset.JsonOutput +Required.Proto3.JsonInput.TimestampWithPositiveOffset.ProtobufOutput +Required.Proto3.JsonInput.Uint32FieldMaxFloatValue.JsonOutput +Required.Proto3.JsonInput.Uint32FieldMaxFloatValue.ProtobufOutput +Required.Proto3.JsonInput.Uint32FieldMaxValue.JsonOutput +Required.Proto3.JsonInput.Uint32FieldMaxValue.ProtobufOutput +Required.Proto3.JsonInput.Uint32MapField.JsonOutput +Required.Proto3.JsonInput.Uint32MapField.ProtobufOutput +Required.Proto3.JsonInput.Uint64FieldMaxValue.JsonOutput +Required.Proto3.JsonInput.Uint64FieldMaxValue.ProtobufOutput +Required.Proto3.JsonInput.Uint64FieldMaxValueNotQuoted.JsonOutput +Required.Proto3.JsonInput.Uint64FieldMaxValueNotQuoted.ProtobufOutput +Required.Proto3.JsonInput.Uint64MapField.JsonOutput +Required.Proto3.JsonInput.Uint64MapField.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptBool.JsonOutput +Required.Proto3.JsonInput.ValueAcceptBool.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptFloat.JsonOutput +Required.Proto3.JsonInput.ValueAcceptFloat.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptInteger.JsonOutput +Required.Proto3.JsonInput.ValueAcceptInteger.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptList.JsonOutput +Required.Proto3.JsonInput.ValueAcceptList.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptNull.JsonOutput +Required.Proto3.JsonInput.ValueAcceptNull.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptObject.JsonOutput +Required.Proto3.JsonInput.ValueAcceptObject.ProtobufOutput +Required.Proto3.JsonInput.ValueAcceptString.JsonOutput +Required.Proto3.JsonInput.ValueAcceptString.ProtobufOutput +Required.Proto3.JsonInput.WrapperTypesWithNullValue.JsonOutput +Required.Proto3.JsonInput.WrapperTypesWithNullValue.ProtobufOutput +Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput +Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput +Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput +Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput +Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_0 +Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_1 +Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_2 +Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_3 +Required.Proto3.ProtobufInput.PrematureEofInPackedFieldValue.BOOL +Required.Proto3.ProtobufInput.RepeatedScalarMessageMerge.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarMessageMerge.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.BOOL.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.BOOL.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.BYTES.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.BYTES.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.DOUBLE.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.ENUM.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.ENUM.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FLOAT.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT64.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED64.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT64.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.STRING.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT32.ProtobufOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT64.ProtobufOutput +Required.Proto3.ProtobufInput.UnknownVarint.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.MergeValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.MergeValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.Default.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.Default.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.DuplicateKey.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.DuplicateKeyInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.DuplicateValueInMapEntry.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.MissingDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.MissingDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.NonDefault.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.Unordered.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.Merge.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.Merge.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.DefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.MultipleValuesForDifferentField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.MultipleValuesForDifferentField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.MultipleValuesForSameField.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.NonDefaultValue.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.MESSAGE.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.STRING.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[4].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[4].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[5].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[6].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[6].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BYTES[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BYTES[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BYTES[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BYTES[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BYTES[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[4].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[4].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[5].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[5].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED32[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED32[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED32[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED64[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED64[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED64[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[4].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[4].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[5].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[6].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[7].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[7].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[8].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[9].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.MESSAGE[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.MESSAGE[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.MESSAGE[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[4].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[4].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[5].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[6].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[2].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[3].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[4].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[5].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[6].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[7].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[8].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[8].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[9].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT64[0].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT64[1].ProtobufOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT64[2].ProtobufOutput +Required.TimestampProtoInputTooLarge.JsonOutput +Required.TimestampProtoInputTooSmall.JsonOutput diff --git a/impl/protoscript/failing_tests_text_format.txt b/impl/protoscript/failing_tests_text_format.txt new file mode 100644 index 00000000..4e9b0d5a --- /dev/null +++ b/impl/protoscript/failing_tests_text_format.txt @@ -0,0 +1,112 @@ +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString +Required.Proto2.TextFormatInput.GroupFieldEmpty.ProtobufOutput +Required.Proto2.TextFormatInput.GroupFieldEmpty.TextFormatOutput +Required.Proto2.TextFormatInput.GroupFieldNoColon.ProtobufOutput +Required.Proto2.TextFormatInput.GroupFieldNoColon.TextFormatOutput +Required.Proto2.TextFormatInput.GroupFieldWithColon.ProtobufOutput +Required.Proto2.TextFormatInput.GroupFieldWithColon.TextFormatOutput +Required.Proto3.TextFormatInput.AlphabeticallySortedMapBoolKeys.ProtobufOutput +Required.Proto3.TextFormatInput.AlphabeticallySortedMapBoolKeys.TextFormatOutput +Required.Proto3.TextFormatInput.AlphabeticallySortedMapIntKeys.ProtobufOutput +Required.Proto3.TextFormatInput.AlphabeticallySortedMapIntKeys.TextFormatOutput +Required.Proto3.TextFormatInput.AlphabeticallySortedMapStringKeys.ProtobufOutput +Required.Proto3.TextFormatInput.AlphabeticallySortedMapStringKeys.TextFormatOutput +Required.Proto3.TextFormatInput.AnyField.ProtobufOutput +Required.Proto3.TextFormatInput.AnyField.TextFormatOutput +Required.Proto3.TextFormatInput.AnyFieldWithInvalidType +Required.Proto3.TextFormatInput.AnyFieldWithRawBytes.ProtobufOutput +Required.Proto3.TextFormatInput.AnyFieldWithRawBytes.TextFormatOutput +Required.Proto3.TextFormatInput.BytesFieldBadUTF8Hex.ProtobufOutput +Required.Proto3.TextFormatInput.BytesFieldBadUTF8Hex.TextFormatOutput +Required.Proto3.TextFormatInput.BytesFieldBadUTF8Octal.ProtobufOutput +Required.Proto3.TextFormatInput.BytesFieldBadUTF8Octal.TextFormatOutput +Required.Proto3.TextFormatInput.DuplicateMapKey.ProtobufOutput +Required.Proto3.TextFormatInput.FloatField.ProtobufOutput +Required.Proto3.TextFormatInput.FloatField.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldMaxValue.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldMaxValue.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldMinValue.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldMinValue.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldNaNValue.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldNaNValue.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldNegInfValue.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldNegInfValue.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldPosInfValue.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldPosInfValue.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldTooLarge.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldTooLarge.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldTooSmall.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldTooSmall.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldWithInt32Max.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldWithInt32Max.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber.TextFormatOutput +Required.Proto3.TextFormatInput.HelloWorld.ProtobufOutput +Required.Proto3.TextFormatInput.HelloWorld.TextFormatOutput +Required.Proto3.TextFormatInput.Int32FieldMaxValue.ProtobufOutput +Required.Proto3.TextFormatInput.Int32FieldMaxValue.TextFormatOutput +Required.Proto3.TextFormatInput.Int32FieldMinValue.ProtobufOutput +Required.Proto3.TextFormatInput.Int32FieldMinValue.TextFormatOutput +Required.Proto3.TextFormatInput.Int32FieldTooLarge +Required.Proto3.TextFormatInput.Int32FieldTooSmall +Required.Proto3.TextFormatInput.Int64FieldMaxValue.ProtobufOutput +Required.Proto3.TextFormatInput.Int64FieldMaxValue.TextFormatOutput +Required.Proto3.TextFormatInput.Int64FieldMinValue.ProtobufOutput +Required.Proto3.TextFormatInput.Int64FieldMinValue.TextFormatOutput +Required.Proto3.TextFormatInput.Int64FieldTooLarge +Required.Proto3.TextFormatInput.Int64FieldTooSmall +Required.Proto3.TextFormatInput.StringFieldBadUTF8Hex +Required.Proto3.TextFormatInput.StringFieldBadUTF8Octal +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralConcatBytes.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralConcatBytes.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralConcatString.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralConcatString.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralHexEscapesBytes.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralHexEscapesBytes.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralHexEscapesString.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralHexEscapesString.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralIncludesLFBytes +Required.Proto3.TextFormatInput.StringLiteralIncludesLFString +Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeBytes +Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeString +Required.Proto3.TextFormatInput.StringLiteralOctalEscapesBytes.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralOctalEscapesBytes.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralOctalEscapesString.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralOctalEscapesString.TextFormatOutput +Required.Proto3.TextFormatInput.Uint32FieldMaxValue.ProtobufOutput +Required.Proto3.TextFormatInput.Uint32FieldMaxValue.TextFormatOutput +Required.Proto3.TextFormatInput.Uint32FieldTooLarge +Required.Proto3.TextFormatInput.Uint64FieldMaxValue.ProtobufOutput +Required.Proto3.TextFormatInput.Uint64FieldMaxValue.TextFormatOutput +Required.Proto3.TextFormatInput.Uint64FieldTooLarge diff --git a/impl/protoscript/gen/conformance/conformance.pb.ts b/impl/protoscript/gen/conformance/conformance.pb.ts new file mode 100644 index 00000000..6cc133c0 --- /dev/null +++ b/impl/protoscript/gen/conformance/conformance.pb.ts @@ -0,0 +1,1200 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +// Source: conformance/conformance.proto +/* eslint-disable */ + +import type { ByteSource } from "protoscript"; +import { + BinaryReader, + BinaryWriter, + encodeBase64Bytes, + decodeBase64Bytes, +} from "protoscript"; + +//========================================// +// Types // +//========================================// + +export type WireFormat = + | "UNSPECIFIED" + | "PROTOBUF" + | "JSON" + | "JSPB" + | "TEXT_FORMAT"; + +export type TestCategory = + | "UNSPECIFIED_TEST" + | "BINARY_TEST" + | "JSON_TEST" + | "JSON_IGNORE_UNKNOWN_PARSING_TEST" + | "JSPB_TEST" + | "TEXT_FORMAT_TEST"; + +/** + * The conformance runner will request a list of failures as the first request. + * This will be known by message_type == "conformance.FailureSet", a conformance + * test should return a serialized FailureSet in protobuf_payload. + */ +export interface FailureSet { + failure: string[]; +} + +/** + * Represents a single test case's input. The testee should: + * + * 1. parse this proto (which should always succeed) + * 2. parse the protobuf or JSON payload in "payload" (which may fail) + * 3. if the parse succeeded, serialize the message in the requested format. + */ +export interface ConformanceRequest { + protobufPayload?: Uint8Array | null | undefined; + jsonPayload?: string | null | undefined; + /** + * Only used inside Google. Opensource testees just skip it. + */ + jspbPayload?: string | null | undefined; + textPayload?: string | null | undefined; + /** + * Which format should the testee serialize its message to? + */ + requestedOutputFormat: WireFormat; + /** + * The full name for the test message to use; for the moment, either: + * protobuf_test_messages.proto3.TestAllTypesProto3 or + * protobuf_test_messages.google.protobuf.TestAllTypesProto2. + */ + messageType: string; + /** + * Each test is given a specific test category. Some category may need + * specific support in testee programs. Refer to the definition of + * TestCategory for more information. + */ + testCategory: TestCategory; + /** + * Specify details for how to encode jspb. + */ + jspbEncodingOptions: JspbEncodingConfig; + /** + * This can be used in json and text format. If true, testee should print + * unknown fields instead of ignore. This feature is optional. + */ + printUnknownFields: boolean; +} + +/** + * Represents a single test case's output. + */ +export interface ConformanceResponse { + /** + * This string should be set to indicate parsing failed. The string can + * provide more information about the parse error if it is available. + * + * Setting this string does not necessarily mean the testee failed the + * test. Some of the test cases are intentionally invalid input. + */ + parseError?: string | null | undefined; + /** + * If the input was successfully parsed but errors occurred when + * serializing it to the requested output format, set the error message in + * this field. + */ + serializeError?: string | null | undefined; + /** + * This should be set if the test program timed out. The string should + * provide more information about what the child process was doing when it + * was killed. + */ + timeoutError?: string | null | undefined; + /** + * This should be set if some other error occurred. This will always + * indicate that the test failed. The string can provide more information + * about the failure. + */ + runtimeError?: string | null | undefined; + /** + * If the input was successfully parsed and the requested output was + * protobuf, serialize it to protobuf and set it in this field. + */ + protobufPayload?: Uint8Array | null | undefined; + /** + * If the input was successfully parsed and the requested output was JSON, + * serialize to JSON and set it in this field. + */ + jsonPayload?: string | null | undefined; + /** + * For when the testee skipped the test, likely because a certain feature + * wasn't supported, like JSON input/output. + */ + skipped?: string | null | undefined; + /** + * If the input was successfully parsed and the requested output was JSPB, + * serialize to JSPB and set it in this field. JSPB is only used inside + * Google. Opensource testees can just skip it. + */ + jspbPayload?: string | null | undefined; + /** + * If the input was successfully parsed and the requested output was + * TEXT_FORMAT, serialize to TEXT_FORMAT and set it in this field. + */ + textPayload?: string | null | undefined; +} + +/** + * Encoding options for jspb format. + */ +export interface JspbEncodingConfig { + /** + * Encode the value field of Any as jspb array if true, otherwise binary. + */ + useJspbArrayAnyFormat: boolean; +} + +//========================================// +// Protobuf Encode / Decode // +//========================================// + +export const WireFormat = { + UNSPECIFIED: "UNSPECIFIED", + PROTOBUF: "PROTOBUF", + JSON: "JSON", + JSPB: "JSPB", + TEXT_FORMAT: "TEXT_FORMAT", + /** + * @private + */ + _fromInt: function (i: number): WireFormat { + switch (i) { + case 0: { + return "UNSPECIFIED"; + } + case 1: { + return "PROTOBUF"; + } + case 2: { + return "JSON"; + } + case 3: { + return "JSPB"; + } + case 4: { + return "TEXT_FORMAT"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as WireFormat; + } + } + }, + /** + * @private + */ + _toInt: function (i: WireFormat): number { + switch (i) { + case "UNSPECIFIED": { + return 0; + } + case "PROTOBUF": { + return 1; + } + case "JSON": { + return 2; + } + case "JSPB": { + return 3; + } + case "TEXT_FORMAT": { + return 4; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, +} as const; + +export const TestCategory = { + UNSPECIFIED_TEST: "UNSPECIFIED_TEST", + BINARY_TEST: "BINARY_TEST", + JSON_TEST: "JSON_TEST", + /** + * Similar to JSON_TEST. However, during parsing json, testee should ignore + * unknown fields. This feature is optional. Each implementation can decide + * whether to support it. See + * https://developers.google.com/protocol-buffers/docs/proto3#json_options + * for more detail. + */ + JSON_IGNORE_UNKNOWN_PARSING_TEST: "JSON_IGNORE_UNKNOWN_PARSING_TEST", + /** + * Test jspb wire format. Only used inside Google. Opensource testees just + * skip it. + */ + JSPB_TEST: "JSPB_TEST", + /** + * Test text format. For cpp, java and python, testees can already deal with + * this type. Testees of other languages can simply skip it. + */ + TEXT_FORMAT_TEST: "TEXT_FORMAT_TEST", + /** + * @private + */ + _fromInt: function (i: number): TestCategory { + switch (i) { + case 0: { + return "UNSPECIFIED_TEST"; + } + case 1: { + return "BINARY_TEST"; + } + case 2: { + return "JSON_TEST"; + } + case 3: { + return "JSON_IGNORE_UNKNOWN_PARSING_TEST"; + } + case 4: { + return "JSPB_TEST"; + } + case 5: { + return "TEXT_FORMAT_TEST"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as TestCategory; + } + } + }, + /** + * @private + */ + _toInt: function (i: TestCategory): number { + switch (i) { + case "UNSPECIFIED_TEST": { + return 0; + } + case "BINARY_TEST": { + return 1; + } + case "JSON_TEST": { + return 2; + } + case "JSON_IGNORE_UNKNOWN_PARSING_TEST": { + return 3; + } + case "JSPB_TEST": { + return 4; + } + case "TEXT_FORMAT_TEST": { + return 5; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, +} as const; + +export const FailureSet = { + /** + * Serializes FailureSet to protobuf. + */ + encode: function (msg: Partial): Uint8Array { + return FailureSet._writeMessage(msg, new BinaryWriter()).getResultBuffer(); + }, + + /** + * Deserializes FailureSet from protobuf. + */ + decode: function (bytes: ByteSource): FailureSet { + return FailureSet._readMessage( + FailureSet.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes FailureSet with all fields set to their default value. + */ + initialize: function (): FailureSet { + return { + failure: [], + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.failure?.length) { + writer.writeRepeatedString(1, msg.failure); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function (msg: FailureSet, reader: BinaryReader): FailureSet { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.failure.push(reader.readString()); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, +}; + +export const ConformanceRequest = { + /** + * Serializes ConformanceRequest to protobuf. + */ + encode: function (msg: Partial): Uint8Array { + return ConformanceRequest._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes ConformanceRequest from protobuf. + */ + decode: function (bytes: ByteSource): ConformanceRequest { + return ConformanceRequest._readMessage( + ConformanceRequest.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes ConformanceRequest with all fields set to their default value. + */ + initialize: function (): ConformanceRequest { + return { + protobufPayload: undefined, + jsonPayload: undefined, + jspbPayload: undefined, + textPayload: undefined, + requestedOutputFormat: WireFormat._fromInt(0), + messageType: "", + testCategory: TestCategory._fromInt(0), + jspbEncodingOptions: JspbEncodingConfig.initialize(), + printUnknownFields: false, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.protobufPayload?.length) { + writer.writeBytes(1, msg.protobufPayload); + } + if (msg.jsonPayload != undefined) { + writer.writeString(2, msg.jsonPayload); + } + if (msg.jspbPayload != undefined) { + writer.writeString(7, msg.jspbPayload); + } + if (msg.textPayload != undefined) { + writer.writeString(8, msg.textPayload); + } + if ( + msg.requestedOutputFormat && + WireFormat._toInt(msg.requestedOutputFormat) + ) { + writer.writeEnum(3, WireFormat._toInt(msg.requestedOutputFormat)); + } + if (msg.messageType) { + writer.writeString(4, msg.messageType); + } + if (msg.testCategory && TestCategory._toInt(msg.testCategory)) { + writer.writeEnum(5, TestCategory._toInt(msg.testCategory)); + } + if (msg.jspbEncodingOptions) { + writer.writeMessage( + 6, + msg.jspbEncodingOptions, + JspbEncodingConfig._writeMessage + ); + } + if (msg.printUnknownFields) { + writer.writeBool(9, msg.printUnknownFields); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: ConformanceRequest, + reader: BinaryReader + ): ConformanceRequest { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.protobufPayload = reader.readBytes(); + break; + } + case 2: { + msg.jsonPayload = reader.readString(); + break; + } + case 7: { + msg.jspbPayload = reader.readString(); + break; + } + case 8: { + msg.textPayload = reader.readString(); + break; + } + case 3: { + msg.requestedOutputFormat = WireFormat._fromInt(reader.readEnum()); + break; + } + case 4: { + msg.messageType = reader.readString(); + break; + } + case 5: { + msg.testCategory = TestCategory._fromInt(reader.readEnum()); + break; + } + case 6: { + reader.readMessage( + msg.jspbEncodingOptions, + JspbEncodingConfig._readMessage + ); + break; + } + case 9: { + msg.printUnknownFields = reader.readBool(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, +}; + +export const ConformanceResponse = { + /** + * Serializes ConformanceResponse to protobuf. + */ + encode: function (msg: Partial): Uint8Array { + return ConformanceResponse._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes ConformanceResponse from protobuf. + */ + decode: function (bytes: ByteSource): ConformanceResponse { + return ConformanceResponse._readMessage( + ConformanceResponse.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes ConformanceResponse with all fields set to their default value. + */ + initialize: function (): ConformanceResponse { + return { + parseError: undefined, + serializeError: undefined, + timeoutError: undefined, + runtimeError: undefined, + protobufPayload: undefined, + jsonPayload: undefined, + skipped: undefined, + jspbPayload: undefined, + textPayload: undefined, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.parseError != undefined) { + writer.writeString(1, msg.parseError); + } + if (msg.serializeError != undefined) { + writer.writeString(6, msg.serializeError); + } + if (msg.timeoutError != undefined) { + writer.writeString(9, msg.timeoutError); + } + if (msg.runtimeError != undefined) { + writer.writeString(2, msg.runtimeError); + } + if (msg.protobufPayload?.length) { + writer.writeBytes(3, msg.protobufPayload); + } + if (msg.jsonPayload != undefined) { + writer.writeString(4, msg.jsonPayload); + } + if (msg.skipped != undefined) { + writer.writeString(5, msg.skipped); + } + if (msg.jspbPayload != undefined) { + writer.writeString(7, msg.jspbPayload); + } + if (msg.textPayload != undefined) { + writer.writeString(8, msg.textPayload); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: ConformanceResponse, + reader: BinaryReader + ): ConformanceResponse { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.parseError = reader.readString(); + break; + } + case 6: { + msg.serializeError = reader.readString(); + break; + } + case 9: { + msg.timeoutError = reader.readString(); + break; + } + case 2: { + msg.runtimeError = reader.readString(); + break; + } + case 3: { + msg.protobufPayload = reader.readBytes(); + break; + } + case 4: { + msg.jsonPayload = reader.readString(); + break; + } + case 5: { + msg.skipped = reader.readString(); + break; + } + case 7: { + msg.jspbPayload = reader.readString(); + break; + } + case 8: { + msg.textPayload = reader.readString(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, +}; + +export const JspbEncodingConfig = { + /** + * Serializes JspbEncodingConfig to protobuf. + */ + encode: function (msg: Partial): Uint8Array { + return JspbEncodingConfig._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes JspbEncodingConfig from protobuf. + */ + decode: function (bytes: ByteSource): JspbEncodingConfig { + return JspbEncodingConfig._readMessage( + JspbEncodingConfig.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes JspbEncodingConfig with all fields set to their default value. + */ + initialize: function (): JspbEncodingConfig { + return { + useJspbArrayAnyFormat: false, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.useJspbArrayAnyFormat) { + writer.writeBool(1, msg.useJspbArrayAnyFormat); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: JspbEncodingConfig, + reader: BinaryReader + ): JspbEncodingConfig { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.useJspbArrayAnyFormat = reader.readBool(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, +}; + +//========================================// +// JSON Encode / Decode // +//========================================// + +export const WireFormatJSON = { + UNSPECIFIED: "UNSPECIFIED", + PROTOBUF: "PROTOBUF", + JSON: "JSON", + JSPB: "JSPB", + TEXT_FORMAT: "TEXT_FORMAT", + /** + * @private + */ + _fromInt: function (i: number): WireFormat { + switch (i) { + case 0: { + return "UNSPECIFIED"; + } + case 1: { + return "PROTOBUF"; + } + case 2: { + return "JSON"; + } + case 3: { + return "JSPB"; + } + case 4: { + return "TEXT_FORMAT"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as WireFormat; + } + } + }, + /** + * @private + */ + _toInt: function (i: WireFormat): number { + switch (i) { + case "UNSPECIFIED": { + return 0; + } + case "PROTOBUF": { + return 1; + } + case "JSON": { + return 2; + } + case "JSPB": { + return 3; + } + case "TEXT_FORMAT": { + return 4; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, +} as const; + +export const TestCategoryJSON = { + UNSPECIFIED_TEST: "UNSPECIFIED_TEST", + BINARY_TEST: "BINARY_TEST", + JSON_TEST: "JSON_TEST", + /** + * Similar to JSON_TEST. However, during parsing json, testee should ignore + * unknown fields. This feature is optional. Each implementation can decide + * whether to support it. See + * https://developers.google.com/protocol-buffers/docs/proto3#json_options + * for more detail. + */ + JSON_IGNORE_UNKNOWN_PARSING_TEST: "JSON_IGNORE_UNKNOWN_PARSING_TEST", + /** + * Test jspb wire format. Only used inside Google. Opensource testees just + * skip it. + */ + JSPB_TEST: "JSPB_TEST", + /** + * Test text format. For cpp, java and python, testees can already deal with + * this type. Testees of other languages can simply skip it. + */ + TEXT_FORMAT_TEST: "TEXT_FORMAT_TEST", + /** + * @private + */ + _fromInt: function (i: number): TestCategory { + switch (i) { + case 0: { + return "UNSPECIFIED_TEST"; + } + case 1: { + return "BINARY_TEST"; + } + case 2: { + return "JSON_TEST"; + } + case 3: { + return "JSON_IGNORE_UNKNOWN_PARSING_TEST"; + } + case 4: { + return "JSPB_TEST"; + } + case 5: { + return "TEXT_FORMAT_TEST"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as TestCategory; + } + } + }, + /** + * @private + */ + _toInt: function (i: TestCategory): number { + switch (i) { + case "UNSPECIFIED_TEST": { + return 0; + } + case "BINARY_TEST": { + return 1; + } + case "JSON_TEST": { + return 2; + } + case "JSON_IGNORE_UNKNOWN_PARSING_TEST": { + return 3; + } + case "JSPB_TEST": { + return 4; + } + case "TEXT_FORMAT_TEST": { + return 5; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, +} as const; + +export const FailureSetJSON = { + /** + * Serializes FailureSet to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify(FailureSetJSON._writeMessage(msg)); + }, + + /** + * Deserializes FailureSet from JSON. + */ + decode: function (json: string): FailureSet { + return FailureSetJSON._readMessage( + FailureSetJSON.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes FailureSet with all fields set to their default value. + */ + initialize: function (): FailureSet { + return { + failure: [], + }; + }, + + /** + * @private + */ + _writeMessage: function (msg: Partial): Record { + const json: Record = {}; + if (msg.failure?.length) { + json["failure"] = msg.failure; + } + return json; + }, + + /** + * @private + */ + _readMessage: function (msg: FailureSet, json: any): FailureSet { + const _failure_ = json["failure"]; + if (_failure_) { + msg.failure = _failure_; + } + return msg; + }, +}; + +export const ConformanceRequestJSON = { + /** + * Serializes ConformanceRequest to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify(ConformanceRequestJSON._writeMessage(msg)); + }, + + /** + * Deserializes ConformanceRequest from JSON. + */ + decode: function (json: string): ConformanceRequest { + return ConformanceRequestJSON._readMessage( + ConformanceRequestJSON.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes ConformanceRequest with all fields set to their default value. + */ + initialize: function (): ConformanceRequest { + return { + protobufPayload: undefined, + jsonPayload: undefined, + jspbPayload: undefined, + textPayload: undefined, + requestedOutputFormat: WireFormat._fromInt(0), + messageType: "", + testCategory: TestCategory._fromInt(0), + jspbEncodingOptions: JspbEncodingConfigJSON.initialize(), + printUnknownFields: false, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.protobufPayload?.length) { + json["protobufPayload"] = encodeBase64Bytes(msg.protobufPayload); + } + if (msg.jsonPayload != undefined) { + json["jsonPayload"] = msg.jsonPayload; + } + if (msg.jspbPayload != undefined) { + json["jspbPayload"] = msg.jspbPayload; + } + if (msg.textPayload != undefined) { + json["textPayload"] = msg.textPayload; + } + if ( + msg.requestedOutputFormat && + WireFormatJSON._toInt(msg.requestedOutputFormat) + ) { + json["requestedOutputFormat"] = msg.requestedOutputFormat; + } + if (msg.messageType) { + json["messageType"] = msg.messageType; + } + if (msg.testCategory && TestCategoryJSON._toInt(msg.testCategory)) { + json["testCategory"] = msg.testCategory; + } + if (msg.jspbEncodingOptions) { + const _jspbEncodingOptions_ = JspbEncodingConfigJSON._writeMessage( + msg.jspbEncodingOptions + ); + if (Object.keys(_jspbEncodingOptions_).length > 0) { + json["jspbEncodingOptions"] = _jspbEncodingOptions_; + } + } + if (msg.printUnknownFields) { + json["printUnknownFields"] = msg.printUnknownFields; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: ConformanceRequest, + json: any + ): ConformanceRequest { + const _protobufPayload_ = + json["protobufPayload"] ?? json["protobuf_payload"]; + if (_protobufPayload_) { + msg.protobufPayload = decodeBase64Bytes(_protobufPayload_); + } + const _jsonPayload_ = json["jsonPayload"] ?? json["json_payload"]; + if (_jsonPayload_) { + msg.jsonPayload = _jsonPayload_; + } + const _jspbPayload_ = json["jspbPayload"] ?? json["jspb_payload"]; + if (_jspbPayload_) { + msg.jspbPayload = _jspbPayload_; + } + const _textPayload_ = json["textPayload"] ?? json["text_payload"]; + if (_textPayload_) { + msg.textPayload = _textPayload_; + } + const _requestedOutputFormat_ = + json["requestedOutputFormat"] ?? json["requested_output_format"]; + if (_requestedOutputFormat_) { + msg.requestedOutputFormat = _requestedOutputFormat_; + } + const _messageType_ = json["messageType"] ?? json["message_type"]; + if (_messageType_) { + msg.messageType = _messageType_; + } + const _testCategory_ = json["testCategory"] ?? json["test_category"]; + if (_testCategory_) { + msg.testCategory = _testCategory_; + } + const _jspbEncodingOptions_ = + json["jspbEncodingOptions"] ?? json["jspb_encoding_options"]; + if (_jspbEncodingOptions_) { + const m = JspbEncodingConfigJSON.initialize(); + JspbEncodingConfigJSON._readMessage(m, _jspbEncodingOptions_); + msg.jspbEncodingOptions = m; + } + const _printUnknownFields_ = + json["printUnknownFields"] ?? json["print_unknown_fields"]; + if (_printUnknownFields_) { + msg.printUnknownFields = _printUnknownFields_; + } + return msg; + }, +}; + +export const ConformanceResponseJSON = { + /** + * Serializes ConformanceResponse to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify(ConformanceResponseJSON._writeMessage(msg)); + }, + + /** + * Deserializes ConformanceResponse from JSON. + */ + decode: function (json: string): ConformanceResponse { + return ConformanceResponseJSON._readMessage( + ConformanceResponseJSON.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes ConformanceResponse with all fields set to their default value. + */ + initialize: function (): ConformanceResponse { + return { + parseError: undefined, + serializeError: undefined, + timeoutError: undefined, + runtimeError: undefined, + protobufPayload: undefined, + jsonPayload: undefined, + skipped: undefined, + jspbPayload: undefined, + textPayload: undefined, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.parseError != undefined) { + json["parseError"] = msg.parseError; + } + if (msg.serializeError != undefined) { + json["serializeError"] = msg.serializeError; + } + if (msg.timeoutError != undefined) { + json["timeoutError"] = msg.timeoutError; + } + if (msg.runtimeError != undefined) { + json["runtimeError"] = msg.runtimeError; + } + if (msg.protobufPayload?.length) { + json["protobufPayload"] = encodeBase64Bytes(msg.protobufPayload); + } + if (msg.jsonPayload != undefined) { + json["jsonPayload"] = msg.jsonPayload; + } + if (msg.skipped != undefined) { + json["skipped"] = msg.skipped; + } + if (msg.jspbPayload != undefined) { + json["jspbPayload"] = msg.jspbPayload; + } + if (msg.textPayload != undefined) { + json["textPayload"] = msg.textPayload; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: ConformanceResponse, + json: any + ): ConformanceResponse { + const _parseError_ = json["parseError"] ?? json["parse_error"]; + if (_parseError_) { + msg.parseError = _parseError_; + } + const _serializeError_ = json["serializeError"] ?? json["serialize_error"]; + if (_serializeError_) { + msg.serializeError = _serializeError_; + } + const _timeoutError_ = json["timeoutError"] ?? json["timeout_error"]; + if (_timeoutError_) { + msg.timeoutError = _timeoutError_; + } + const _runtimeError_ = json["runtimeError"] ?? json["runtime_error"]; + if (_runtimeError_) { + msg.runtimeError = _runtimeError_; + } + const _protobufPayload_ = + json["protobufPayload"] ?? json["protobuf_payload"]; + if (_protobufPayload_) { + msg.protobufPayload = decodeBase64Bytes(_protobufPayload_); + } + const _jsonPayload_ = json["jsonPayload"] ?? json["json_payload"]; + if (_jsonPayload_) { + msg.jsonPayload = _jsonPayload_; + } + const _skipped_ = json["skipped"]; + if (_skipped_) { + msg.skipped = _skipped_; + } + const _jspbPayload_ = json["jspbPayload"] ?? json["jspb_payload"]; + if (_jspbPayload_) { + msg.jspbPayload = _jspbPayload_; + } + const _textPayload_ = json["textPayload"] ?? json["text_payload"]; + if (_textPayload_) { + msg.textPayload = _textPayload_; + } + return msg; + }, +}; + +export const JspbEncodingConfigJSON = { + /** + * Serializes JspbEncodingConfig to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify(JspbEncodingConfigJSON._writeMessage(msg)); + }, + + /** + * Deserializes JspbEncodingConfig from JSON. + */ + decode: function (json: string): JspbEncodingConfig { + return JspbEncodingConfigJSON._readMessage( + JspbEncodingConfigJSON.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes JspbEncodingConfig with all fields set to their default value. + */ + initialize: function (): JspbEncodingConfig { + return { + useJspbArrayAnyFormat: false, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.useJspbArrayAnyFormat) { + json["useJspbArrayAnyFormat"] = msg.useJspbArrayAnyFormat; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: JspbEncodingConfig, + json: any + ): JspbEncodingConfig { + const _useJspbArrayAnyFormat_ = + json["useJspbArrayAnyFormat"] ?? json["use_jspb_array_any_format"]; + if (_useJspbArrayAnyFormat_) { + msg.useJspbArrayAnyFormat = _useJspbArrayAnyFormat_; + } + return msg; + }, +}; diff --git a/impl/protoscript/gen/google/protobuf/test_messages_proto2.pb.ts b/impl/protoscript/gen/google/protobuf/test_messages_proto2.pb.ts new file mode 100644 index 00000000..23302b7d --- /dev/null +++ b/impl/protoscript/gen/google/protobuf/test_messages_proto2.pb.ts @@ -0,0 +1,8606 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +// Source: google/protobuf/test_messages_proto2.proto +/* eslint-disable */ + +import type { ByteSource } from "protoscript"; +import { + BinaryReader, + BinaryWriter, + encodeBase64Bytes, + decodeBase64Bytes, +} from "protoscript"; + +//========================================// +// Types // +//========================================// + +export type ForeignEnumProto2 = "FOREIGN_FOO" | "FOREIGN_BAR" | "FOREIGN_BAZ"; + +/** + * This proto includes every type of field in both singular and repeated + * forms. + * + * Also, crucially, all messages and enums in this file are eventually + * submessages of this message. So for example, a fuzz test of TestAllTypes + * could trigger bugs that occur in any message type in this file. We verify + * this stays true in a unit test. + */ +export interface TestAllTypesProto2 { + /** + * Singular + */ + optionalInt32: number; + optionalInt64: bigint; + optionalUint32: number; + optionalUint64: bigint; + optionalSint32: number; + optionalSint64: bigint; + optionalFixed32: number; + optionalFixed64: bigint; + optionalSfixed32: number; + optionalSfixed64: bigint; + optionalFloat: number; + optionalDouble: number; + optionalBool: boolean; + optionalString: string; + optionalBytes: Uint8Array; + optionalNestedMessage: TestAllTypesProto2.NestedMessage; + optionalForeignMessage: ForeignMessageProto2; + optionalNestedEnum: TestAllTypesProto2.NestedEnum; + optionalForeignEnum: ForeignEnumProto2; + optionalStringPiece: string; + optionalCord: string; + recursiveMessage: TestAllTypesProto2 | null | undefined; + /** + * Repeated + */ + repeatedInt32: number[]; + repeatedInt64: bigint[]; + repeatedUint32: number[]; + repeatedUint64: bigint[]; + repeatedSint32: number[]; + repeatedSint64: bigint[]; + repeatedFixed32: number[]; + repeatedFixed64: bigint[]; + repeatedSfixed32: number[]; + repeatedSfixed64: bigint[]; + repeatedFloat: number[]; + repeatedDouble: number[]; + repeatedBool: boolean[]; + repeatedString: string[]; + repeatedBytes: Uint8Array[]; + repeatedNestedMessage: TestAllTypesProto2.NestedMessage[]; + repeatedForeignMessage: ForeignMessageProto2[]; + repeatedNestedEnum: TestAllTypesProto2.NestedEnum[]; + repeatedForeignEnum: ForeignEnumProto2[]; + repeatedStringPiece: string[]; + repeatedCord: string[]; + /** + * Packed + */ + packedInt32: number[]; + packedInt64: bigint[]; + packedUint32: number[]; + packedUint64: bigint[]; + packedSint32: number[]; + packedSint64: bigint[]; + packedFixed32: number[]; + packedFixed64: bigint[]; + packedSfixed32: number[]; + packedSfixed64: bigint[]; + packedFloat: number[]; + packedDouble: number[]; + packedBool: boolean[]; + packedNestedEnum: TestAllTypesProto2.NestedEnum[]; + /** + * Unpacked + */ + unpackedInt32: number[]; + unpackedInt64: bigint[]; + unpackedUint32: number[]; + unpackedUint64: bigint[]; + unpackedSint32: number[]; + unpackedSint64: bigint[]; + unpackedFixed32: number[]; + unpackedFixed64: bigint[]; + unpackedSfixed32: number[]; + unpackedSfixed64: bigint[]; + unpackedFloat: number[]; + unpackedDouble: number[]; + unpackedBool: boolean[]; + unpackedNestedEnum: TestAllTypesProto2.NestedEnum[]; + /** + * Map + */ + mapInt32Int32: Record< + string, + TestAllTypesProto2.MapInt32Int32["value"] | undefined + >; + mapInt64Int64: Record< + string, + TestAllTypesProto2.MapInt64Int64["value"] | undefined + >; + mapUint32Uint32: Record< + string, + TestAllTypesProto2.MapUint32Uint32["value"] | undefined + >; + mapUint64Uint64: Record< + string, + TestAllTypesProto2.MapUint64Uint64["value"] | undefined + >; + mapSint32Sint32: Record< + string, + TestAllTypesProto2.MapSint32Sint32["value"] | undefined + >; + mapSint64Sint64: Record< + string, + TestAllTypesProto2.MapSint64Sint64["value"] | undefined + >; + mapFixed32Fixed32: Record< + string, + TestAllTypesProto2.MapFixed32Fixed32["value"] | undefined + >; + mapFixed64Fixed64: Record< + string, + TestAllTypesProto2.MapFixed64Fixed64["value"] | undefined + >; + mapSfixed32Sfixed32: Record< + string, + TestAllTypesProto2.MapSfixed32Sfixed32["value"] | undefined + >; + mapSfixed64Sfixed64: Record< + string, + TestAllTypesProto2.MapSfixed64Sfixed64["value"] | undefined + >; + mapInt32Float: Record< + string, + TestAllTypesProto2.MapInt32Float["value"] | undefined + >; + mapInt32Double: Record< + string, + TestAllTypesProto2.MapInt32Double["value"] | undefined + >; + mapBoolBool: Record< + string, + TestAllTypesProto2.MapBoolBool["value"] | undefined + >; + mapStringString: Record< + string, + TestAllTypesProto2.MapStringString["value"] | undefined + >; + mapStringBytes: Record< + string, + TestAllTypesProto2.MapStringBytes["value"] | undefined + >; + mapStringNestedMessage: Record< + string, + TestAllTypesProto2.MapStringNestedMessage["value"] | undefined + >; + mapStringForeignMessage: Record< + string, + TestAllTypesProto2.MapStringForeignMessage["value"] | undefined + >; + mapStringNestedEnum: Record< + string, + TestAllTypesProto2.MapStringNestedEnum["value"] | undefined + >; + mapStringForeignEnum: Record< + string, + TestAllTypesProto2.MapStringForeignEnum["value"] | undefined + >; + oneofUint32?: number | null | undefined; + oneofNestedMessage?: TestAllTypesProto2.NestedMessage | null | undefined; + oneofString?: string | null | undefined; + oneofBytes?: Uint8Array | null | undefined; + oneofBool?: boolean | null | undefined; + oneofUint64?: bigint | null | undefined; + oneofFloat?: number | null | undefined; + oneofDouble?: number | null | undefined; + oneofEnum?: TestAllTypesProto2.NestedEnum | null | undefined; + defaultInt32: number; + /** + * default values + */ + defaultInt64: bigint; + defaultUint32: number; + defaultUint64: bigint; + defaultSint32: number; + defaultSint64: bigint; + defaultFixed32: number; + defaultFixed64: bigint; + defaultSfixed32: number; + defaultSfixed64: bigint; + defaultFloat: number; + defaultDouble: number; + defaultBool: boolean; + defaultString: string; + defaultBytes: Uint8Array; + fieldname1: number; + /** + * Test field-name-to-JSON-name convention. + * (protobuf says names can be any valid C/C++ identifier.) + */ + fieldName2: number; + fieldName3: number; + fieldName4: number; + field0name5: number; + field0Name6: number; + fieldName7: number; + FieldName8: number; + fieldName9: number; + FieldName10: number; + FIELDNAME11: number; + FIELDName12: number; + fieldName13: number; + FieldName14: number; + fieldName15: number; + fieldName16: number; + fieldName17: number; + FieldName18: number; +} + +export declare namespace TestAllTypesProto2 { + export type NestedEnum = "FOO" | "BAR" | "BAZ" | "NEG"; + + export interface NestedMessage { + a: number; + corecursive: TestAllTypesProto2 | null | undefined; + } + + interface MapInt32Int32 { + key: number; + value: number; + } + + interface MapInt64Int64 { + key: bigint; + value: bigint; + } + + interface MapUint32Uint32 { + key: number; + value: number; + } + + interface MapUint64Uint64 { + key: bigint; + value: bigint; + } + + interface MapSint32Sint32 { + key: number; + value: number; + } + + interface MapSint64Sint64 { + key: bigint; + value: bigint; + } + + interface MapFixed32Fixed32 { + key: number; + value: number; + } + + interface MapFixed64Fixed64 { + key: bigint; + value: bigint; + } + + interface MapSfixed32Sfixed32 { + key: number; + value: number; + } + + interface MapSfixed64Sfixed64 { + key: bigint; + value: bigint; + } + + interface MapInt32Float { + key: number; + value: number; + } + + interface MapInt32Double { + key: number; + value: number; + } + + interface MapBoolBool { + key: boolean; + value: boolean; + } + + interface MapStringString { + key: string; + value: string; + } + + interface MapStringBytes { + key: string; + value: Uint8Array; + } + + interface MapStringNestedMessage { + key: string; + value: TestAllTypesProto2.NestedMessage; + } + + interface MapStringForeignMessage { + key: string; + value: ForeignMessageProto2; + } + + interface MapStringNestedEnum { + key: string; + value: TestAllTypesProto2.NestedEnum; + } + + interface MapStringForeignEnum { + key: string; + value: ForeignEnumProto2; + } + + /** + * groups + */ + export interface Data { + groupInt32: number; + groupUint32: number; + } + + /** + * message_set test case. + */ + export interface MessageSetCorrect {} + + export interface MessageSetCorrectExtension1 { + str: string; + } + + export interface MessageSetCorrectExtension2 { + i: number; + } +} + +export interface ForeignMessageProto2 { + c: number; +} + +export interface UnknownToTestAllTypes { + optionalInt32: number; + optionalString: string; + nestedMessage: ForeignMessageProto2; + optionalBool: boolean; + repeatedInt32: number[]; +} + +export declare namespace UnknownToTestAllTypes { + export interface OptionalGroup { + a: number; + } +} + +export interface NullHypothesisProto2 {} + +export interface EnumOnlyProto2 {} + +export declare namespace EnumOnlyProto2 { + export type Bool = "kFalse" | "kTrue"; +} + +export interface OneStringProto2 { + data: string; +} + +export interface ProtoWithKeywords { + inline: number; + concept: string; + requires: string[]; +} + +export interface TestAllRequiredTypesProto2 { + /** + * Singular + */ + requiredInt32: number; + requiredInt64: bigint; + requiredUint32: number; + requiredUint64: bigint; + requiredSint32: number; + requiredSint64: bigint; + requiredFixed32: number; + requiredFixed64: bigint; + requiredSfixed32: number; + requiredSfixed64: bigint; + requiredFloat: number; + requiredDouble: number; + requiredBool: boolean; + requiredString: string; + requiredBytes: Uint8Array; + requiredNestedMessage: TestAllRequiredTypesProto2.NestedMessage; + requiredForeignMessage: ForeignMessageProto2; + requiredNestedEnum: TestAllRequiredTypesProto2.NestedEnum; + requiredForeignEnum: ForeignEnumProto2; + requiredStringPiece: string; + requiredCord: string; + recursiveMessage: TestAllRequiredTypesProto2 | null | undefined; + optionalRecursiveMessage: TestAllRequiredTypesProto2 | null | undefined; + defaultInt32: number; + /** + * default values + */ + defaultInt64: bigint; + defaultUint32: number; + defaultUint64: bigint; + defaultSint32: number; + defaultSint64: bigint; + defaultFixed32: number; + defaultFixed64: bigint; + defaultSfixed32: number; + defaultSfixed64: bigint; + defaultFloat: number; + defaultDouble: number; + defaultBool: boolean; + defaultString: string; + defaultBytes: Uint8Array; +} + +export declare namespace TestAllRequiredTypesProto2 { + export type NestedEnum = "FOO" | "BAR" | "BAZ" | "NEG"; + + export interface NestedMessage { + a: number; + corecursive: TestAllRequiredTypesProto2 | null | undefined; + optionalCorecursive: TestAllRequiredTypesProto2 | null | undefined; + } + + /** + * groups + */ + export interface Data { + groupInt32: number; + groupUint32: number; + } + + /** + * message_set test case. + */ + export interface MessageSetCorrect {} + + export interface MessageSetCorrectExtension1 { + str: string; + } + + export interface MessageSetCorrectExtension2 { + i: number; + } +} + +//========================================// +// Protobuf Encode / Decode // +//========================================// + +export const ForeignEnumProto2 = { + FOREIGN_FOO: "FOREIGN_FOO", + FOREIGN_BAR: "FOREIGN_BAR", + FOREIGN_BAZ: "FOREIGN_BAZ", + /** + * @private + */ + _fromInt: function (i: number): ForeignEnumProto2 { + switch (i) { + case 0: { + return "FOREIGN_FOO"; + } + case 1: { + return "FOREIGN_BAR"; + } + case 2: { + return "FOREIGN_BAZ"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as ForeignEnumProto2; + } + } + }, + /** + * @private + */ + _toInt: function (i: ForeignEnumProto2): number { + switch (i) { + case "FOREIGN_FOO": { + return 0; + } + case "FOREIGN_BAR": { + return 1; + } + case "FOREIGN_BAZ": { + return 2; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, +} as const; + +export const TestAllTypesProto2 = { + /** + * Serializes TestAllTypesProto2 to protobuf. + */ + encode: function (msg: Partial): Uint8Array { + return TestAllTypesProto2._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes TestAllTypesProto2 from protobuf. + */ + decode: function (bytes: ByteSource): TestAllTypesProto2 { + return TestAllTypesProto2._readMessage( + TestAllTypesProto2.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes TestAllTypesProto2 with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto2 { + return { + optionalInt32: 0, + optionalInt64: 0n, + optionalUint32: 0, + optionalUint64: 0n, + optionalSint32: 0, + optionalSint64: 0n, + optionalFixed32: 0, + optionalFixed64: 0n, + optionalSfixed32: 0, + optionalSfixed64: 0n, + optionalFloat: 0, + optionalDouble: 0, + optionalBool: false, + optionalString: "", + optionalBytes: new Uint8Array(), + optionalNestedMessage: TestAllTypesProto2.NestedMessage.initialize(), + optionalForeignMessage: ForeignMessageProto2.initialize(), + optionalNestedEnum: TestAllTypesProto2.NestedEnum._fromInt(0), + optionalForeignEnum: ForeignEnumProto2._fromInt(0), + optionalStringPiece: "", + optionalCord: "", + recursiveMessage: undefined, + repeatedInt32: [], + repeatedInt64: [], + repeatedUint32: [], + repeatedUint64: [], + repeatedSint32: [], + repeatedSint64: [], + repeatedFixed32: [], + repeatedFixed64: [], + repeatedSfixed32: [], + repeatedSfixed64: [], + repeatedFloat: [], + repeatedDouble: [], + repeatedBool: [], + repeatedString: [], + repeatedBytes: [], + repeatedNestedMessage: [], + repeatedForeignMessage: [], + repeatedNestedEnum: [], + repeatedForeignEnum: [], + repeatedStringPiece: [], + repeatedCord: [], + packedInt32: [], + packedInt64: [], + packedUint32: [], + packedUint64: [], + packedSint32: [], + packedSint64: [], + packedFixed32: [], + packedFixed64: [], + packedSfixed32: [], + packedSfixed64: [], + packedFloat: [], + packedDouble: [], + packedBool: [], + packedNestedEnum: [], + unpackedInt32: [], + unpackedInt64: [], + unpackedUint32: [], + unpackedUint64: [], + unpackedSint32: [], + unpackedSint64: [], + unpackedFixed32: [], + unpackedFixed64: [], + unpackedSfixed32: [], + unpackedSfixed64: [], + unpackedFloat: [], + unpackedDouble: [], + unpackedBool: [], + unpackedNestedEnum: [], + mapInt32Int32: {}, + mapInt64Int64: {}, + mapUint32Uint32: {}, + mapUint64Uint64: {}, + mapSint32Sint32: {}, + mapSint64Sint64: {}, + mapFixed32Fixed32: {}, + mapFixed64Fixed64: {}, + mapSfixed32Sfixed32: {}, + mapSfixed64Sfixed64: {}, + mapInt32Float: {}, + mapInt32Double: {}, + mapBoolBool: {}, + mapStringString: {}, + mapStringBytes: {}, + mapStringNestedMessage: {}, + mapStringForeignMessage: {}, + mapStringNestedEnum: {}, + mapStringForeignEnum: {}, + oneofUint32: undefined, + oneofNestedMessage: undefined, + oneofString: undefined, + oneofBytes: undefined, + oneofBool: undefined, + oneofUint64: undefined, + oneofFloat: undefined, + oneofDouble: undefined, + oneofEnum: undefined, + defaultInt32: 0, + defaultInt64: 0n, + defaultUint32: 0, + defaultUint64: 0n, + defaultSint32: 0, + defaultSint64: 0n, + defaultFixed32: 0, + defaultFixed64: 0n, + defaultSfixed32: 0, + defaultSfixed64: 0n, + defaultFloat: 0, + defaultDouble: 0, + defaultBool: false, + defaultString: "", + defaultBytes: new Uint8Array(), + fieldname1: 0, + fieldName2: 0, + fieldName3: 0, + fieldName4: 0, + field0name5: 0, + field0Name6: 0, + fieldName7: 0, + FieldName8: 0, + fieldName9: 0, + FieldName10: 0, + FIELDNAME11: 0, + FIELDName12: 0, + fieldName13: 0, + FieldName14: 0, + fieldName15: 0, + fieldName16: 0, + fieldName17: 0, + FieldName18: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.optionalInt32) { + writer.writeInt32(1, msg.optionalInt32); + } + if (msg.optionalInt64) { + writer.writeInt64String(2, msg.optionalInt64.toString() as any); + } + if (msg.optionalUint32) { + writer.writeUint32(3, msg.optionalUint32); + } + if (msg.optionalUint64) { + writer.writeUint64String(4, msg.optionalUint64.toString() as any); + } + if (msg.optionalSint32) { + writer.writeSint32(5, msg.optionalSint32); + } + if (msg.optionalSint64) { + writer.writeSint64String(6, msg.optionalSint64.toString() as any); + } + if (msg.optionalFixed32) { + writer.writeFixed32(7, msg.optionalFixed32); + } + if (msg.optionalFixed64) { + writer.writeFixed64String(8, msg.optionalFixed64.toString() as any); + } + if (msg.optionalSfixed32) { + writer.writeSfixed32(9, msg.optionalSfixed32); + } + if (msg.optionalSfixed64) { + writer.writeSfixed64String(10, msg.optionalSfixed64.toString() as any); + } + if (msg.optionalFloat) { + writer.writeFloat(11, msg.optionalFloat); + } + if (msg.optionalDouble) { + writer.writeDouble(12, msg.optionalDouble); + } + if (msg.optionalBool) { + writer.writeBool(13, msg.optionalBool); + } + if (msg.optionalString) { + writer.writeString(14, msg.optionalString); + } + if (msg.optionalBytes?.length) { + writer.writeBytes(15, msg.optionalBytes); + } + if (msg.optionalNestedMessage) { + writer.writeMessage( + 18, + msg.optionalNestedMessage, + TestAllTypesProto2.NestedMessage._writeMessage + ); + } + if (msg.optionalForeignMessage) { + writer.writeMessage( + 19, + msg.optionalForeignMessage, + ForeignMessageProto2._writeMessage + ); + } + if ( + msg.optionalNestedEnum && + TestAllTypesProto2.NestedEnum._toInt(msg.optionalNestedEnum) + ) { + writer.writeEnum( + 21, + TestAllTypesProto2.NestedEnum._toInt(msg.optionalNestedEnum) + ); + } + if ( + msg.optionalForeignEnum && + ForeignEnumProto2._toInt(msg.optionalForeignEnum) + ) { + writer.writeEnum(22, ForeignEnumProto2._toInt(msg.optionalForeignEnum)); + } + if (msg.optionalStringPiece) { + writer.writeString(24, msg.optionalStringPiece); + } + if (msg.optionalCord) { + writer.writeString(25, msg.optionalCord); + } + if (msg.recursiveMessage) { + writer.writeMessage( + 27, + msg.recursiveMessage, + TestAllTypesProto2._writeMessage + ); + } + if (msg.repeatedInt32?.length) { + writer.writePackedInt32(31, msg.repeatedInt32); + } + if (msg.repeatedInt64?.length) { + writer.writePackedInt64String( + 32, + msg.repeatedInt64.map((x) => x.toString() as any) + ); + } + if (msg.repeatedUint32?.length) { + writer.writePackedUint32(33, msg.repeatedUint32); + } + if (msg.repeatedUint64?.length) { + writer.writePackedUint64String( + 34, + msg.repeatedUint64.map((x) => x.toString() as any) + ); + } + if (msg.repeatedSint32?.length) { + writer.writePackedSint32(35, msg.repeatedSint32); + } + if (msg.repeatedSint64?.length) { + writer.writePackedSint64String( + 36, + msg.repeatedSint64.map((x) => x.toString() as any) + ); + } + if (msg.repeatedFixed32?.length) { + writer.writePackedFixed32(37, msg.repeatedFixed32); + } + if (msg.repeatedFixed64?.length) { + writer.writePackedFixed64String( + 38, + msg.repeatedFixed64.map((x) => x.toString() as any) + ); + } + if (msg.repeatedSfixed32?.length) { + writer.writePackedSfixed32(39, msg.repeatedSfixed32); + } + if (msg.repeatedSfixed64?.length) { + writer.writePackedSfixed64String( + 40, + msg.repeatedSfixed64.map((x) => x.toString() as any) + ); + } + if (msg.repeatedFloat?.length) { + writer.writePackedFloat(41, msg.repeatedFloat); + } + if (msg.repeatedDouble?.length) { + writer.writePackedDouble(42, msg.repeatedDouble); + } + if (msg.repeatedBool?.length) { + writer.writePackedBool(43, msg.repeatedBool); + } + if (msg.repeatedString?.length) { + writer.writeRepeatedString(44, msg.repeatedString); + } + if (msg.repeatedBytes?.length) { + writer.writeRepeatedBytes(45, msg.repeatedBytes); + } + if (msg.repeatedNestedMessage?.length) { + writer.writeRepeatedMessage( + 48, + msg.repeatedNestedMessage as any, + TestAllTypesProto2.NestedMessage._writeMessage + ); + } + if (msg.repeatedForeignMessage?.length) { + writer.writeRepeatedMessage( + 49, + msg.repeatedForeignMessage as any, + ForeignMessageProto2._writeMessage + ); + } + if (msg.repeatedNestedEnum?.length) { + writer.writePackedEnum( + 51, + msg.repeatedNestedEnum.map(TestAllTypesProto2.NestedEnum._toInt) + ); + } + if (msg.repeatedForeignEnum?.length) { + writer.writePackedEnum( + 52, + msg.repeatedForeignEnum.map(ForeignEnumProto2._toInt) + ); + } + if (msg.repeatedStringPiece?.length) { + writer.writeRepeatedString(54, msg.repeatedStringPiece); + } + if (msg.repeatedCord?.length) { + writer.writeRepeatedString(55, msg.repeatedCord); + } + if (msg.packedInt32?.length) { + writer.writePackedInt32(75, msg.packedInt32); + } + if (msg.packedInt64?.length) { + writer.writePackedInt64String( + 76, + msg.packedInt64.map((x) => x.toString() as any) + ); + } + if (msg.packedUint32?.length) { + writer.writePackedUint32(77, msg.packedUint32); + } + if (msg.packedUint64?.length) { + writer.writePackedUint64String( + 78, + msg.packedUint64.map((x) => x.toString() as any) + ); + } + if (msg.packedSint32?.length) { + writer.writePackedSint32(79, msg.packedSint32); + } + if (msg.packedSint64?.length) { + writer.writePackedSint64String( + 80, + msg.packedSint64.map((x) => x.toString() as any) + ); + } + if (msg.packedFixed32?.length) { + writer.writePackedFixed32(81, msg.packedFixed32); + } + if (msg.packedFixed64?.length) { + writer.writePackedFixed64String( + 82, + msg.packedFixed64.map((x) => x.toString() as any) + ); + } + if (msg.packedSfixed32?.length) { + writer.writePackedSfixed32(83, msg.packedSfixed32); + } + if (msg.packedSfixed64?.length) { + writer.writePackedSfixed64String( + 84, + msg.packedSfixed64.map((x) => x.toString() as any) + ); + } + if (msg.packedFloat?.length) { + writer.writePackedFloat(85, msg.packedFloat); + } + if (msg.packedDouble?.length) { + writer.writePackedDouble(86, msg.packedDouble); + } + if (msg.packedBool?.length) { + writer.writePackedBool(87, msg.packedBool); + } + if (msg.packedNestedEnum?.length) { + writer.writePackedEnum( + 88, + msg.packedNestedEnum.map(TestAllTypesProto2.NestedEnum._toInt) + ); + } + if (msg.unpackedInt32?.length) { + writer.writePackedInt32(89, msg.unpackedInt32); + } + if (msg.unpackedInt64?.length) { + writer.writePackedInt64String( + 90, + msg.unpackedInt64.map((x) => x.toString() as any) + ); + } + if (msg.unpackedUint32?.length) { + writer.writePackedUint32(91, msg.unpackedUint32); + } + if (msg.unpackedUint64?.length) { + writer.writePackedUint64String( + 92, + msg.unpackedUint64.map((x) => x.toString() as any) + ); + } + if (msg.unpackedSint32?.length) { + writer.writePackedSint32(93, msg.unpackedSint32); + } + if (msg.unpackedSint64?.length) { + writer.writePackedSint64String( + 94, + msg.unpackedSint64.map((x) => x.toString() as any) + ); + } + if (msg.unpackedFixed32?.length) { + writer.writePackedFixed32(95, msg.unpackedFixed32); + } + if (msg.unpackedFixed64?.length) { + writer.writePackedFixed64String( + 96, + msg.unpackedFixed64.map((x) => x.toString() as any) + ); + } + if (msg.unpackedSfixed32?.length) { + writer.writePackedSfixed32(97, msg.unpackedSfixed32); + } + if (msg.unpackedSfixed64?.length) { + writer.writePackedSfixed64String( + 98, + msg.unpackedSfixed64.map((x) => x.toString() as any) + ); + } + if (msg.unpackedFloat?.length) { + writer.writePackedFloat(99, msg.unpackedFloat); + } + if (msg.unpackedDouble?.length) { + writer.writePackedDouble(100, msg.unpackedDouble); + } + if (msg.unpackedBool?.length) { + writer.writePackedBool(101, msg.unpackedBool); + } + if (msg.unpackedNestedEnum?.length) { + writer.writePackedEnum( + 102, + msg.unpackedNestedEnum.map(TestAllTypesProto2.NestedEnum._toInt) + ); + } + if (msg.mapInt32Int32) { + writer.writeRepeatedMessage( + 56, + Object.entries(msg.mapInt32Int32).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapInt32Int32._writeMessage + ); + } + if (msg.mapInt64Int64) { + writer.writeRepeatedMessage( + 57, + Object.entries(msg.mapInt64Int64).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapInt64Int64._writeMessage + ); + } + if (msg.mapUint32Uint32) { + writer.writeRepeatedMessage( + 58, + Object.entries(msg.mapUint32Uint32).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapUint32Uint32._writeMessage + ); + } + if (msg.mapUint64Uint64) { + writer.writeRepeatedMessage( + 59, + Object.entries(msg.mapUint64Uint64).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapUint64Uint64._writeMessage + ); + } + if (msg.mapSint32Sint32) { + writer.writeRepeatedMessage( + 60, + Object.entries(msg.mapSint32Sint32).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapSint32Sint32._writeMessage + ); + } + if (msg.mapSint64Sint64) { + writer.writeRepeatedMessage( + 61, + Object.entries(msg.mapSint64Sint64).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapSint64Sint64._writeMessage + ); + } + if (msg.mapFixed32Fixed32) { + writer.writeRepeatedMessage( + 62, + Object.entries(msg.mapFixed32Fixed32).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapFixed32Fixed32._writeMessage + ); + } + if (msg.mapFixed64Fixed64) { + writer.writeRepeatedMessage( + 63, + Object.entries(msg.mapFixed64Fixed64).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapFixed64Fixed64._writeMessage + ); + } + if (msg.mapSfixed32Sfixed32) { + writer.writeRepeatedMessage( + 64, + Object.entries(msg.mapSfixed32Sfixed32).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapSfixed32Sfixed32._writeMessage + ); + } + if (msg.mapSfixed64Sfixed64) { + writer.writeRepeatedMessage( + 65, + Object.entries(msg.mapSfixed64Sfixed64).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapSfixed64Sfixed64._writeMessage + ); + } + if (msg.mapInt32Float) { + writer.writeRepeatedMessage( + 66, + Object.entries(msg.mapInt32Float).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapInt32Float._writeMessage + ); + } + if (msg.mapInt32Double) { + writer.writeRepeatedMessage( + 67, + Object.entries(msg.mapInt32Double).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapInt32Double._writeMessage + ); + } + if (msg.mapBoolBool) { + writer.writeRepeatedMessage( + 68, + Object.entries(msg.mapBoolBool).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapBoolBool._writeMessage + ); + } + if (msg.mapStringString) { + writer.writeRepeatedMessage( + 69, + Object.entries(msg.mapStringString).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapStringString._writeMessage + ); + } + if (msg.mapStringBytes) { + writer.writeRepeatedMessage( + 70, + Object.entries(msg.mapStringBytes).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapStringBytes._writeMessage + ); + } + if (msg.mapStringNestedMessage) { + writer.writeRepeatedMessage( + 71, + Object.entries(msg.mapStringNestedMessage).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapStringNestedMessage._writeMessage + ); + } + if (msg.mapStringForeignMessage) { + writer.writeRepeatedMessage( + 72, + Object.entries(msg.mapStringForeignMessage).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapStringForeignMessage._writeMessage + ); + } + if (msg.mapStringNestedEnum) { + writer.writeRepeatedMessage( + 73, + Object.entries(msg.mapStringNestedEnum).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapStringNestedEnum._writeMessage + ); + } + if (msg.mapStringForeignEnum) { + writer.writeRepeatedMessage( + 74, + Object.entries(msg.mapStringForeignEnum).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto2.MapStringForeignEnum._writeMessage + ); + } + if (msg.oneofUint32 != undefined) { + writer.writeUint32(111, msg.oneofUint32); + } + if (msg.oneofNestedMessage != undefined) { + writer.writeMessage( + 112, + msg.oneofNestedMessage, + TestAllTypesProto2.NestedMessage._writeMessage + ); + } + if (msg.oneofString != undefined) { + writer.writeString(113, msg.oneofString); + } + if (msg.oneofBytes?.length) { + writer.writeBytes(114, msg.oneofBytes); + } + if (msg.oneofBool != undefined) { + writer.writeBool(115, msg.oneofBool); + } + if (msg.oneofUint64 != undefined) { + writer.writeUint64String(116, msg.oneofUint64.toString() as any); + } + if (msg.oneofFloat != undefined) { + writer.writeFloat(117, msg.oneofFloat); + } + if (msg.oneofDouble != undefined) { + writer.writeDouble(118, msg.oneofDouble); + } + if (msg.oneofEnum != undefined) { + writer.writeEnum( + 119, + TestAllTypesProto2.NestedEnum._toInt(msg.oneofEnum) + ); + } + if (msg.defaultInt32) { + writer.writeInt32(241, msg.defaultInt32); + } + if (msg.defaultInt64) { + writer.writeInt64String(242, msg.defaultInt64.toString() as any); + } + if (msg.defaultUint32) { + writer.writeUint32(243, msg.defaultUint32); + } + if (msg.defaultUint64) { + writer.writeUint64String(244, msg.defaultUint64.toString() as any); + } + if (msg.defaultSint32) { + writer.writeSint32(245, msg.defaultSint32); + } + if (msg.defaultSint64) { + writer.writeSint64String(246, msg.defaultSint64.toString() as any); + } + if (msg.defaultFixed32) { + writer.writeFixed32(247, msg.defaultFixed32); + } + if (msg.defaultFixed64) { + writer.writeFixed64String(248, msg.defaultFixed64.toString() as any); + } + if (msg.defaultSfixed32) { + writer.writeSfixed32(249, msg.defaultSfixed32); + } + if (msg.defaultSfixed64) { + writer.writeSfixed64String(250, msg.defaultSfixed64.toString() as any); + } + if (msg.defaultFloat) { + writer.writeFloat(251, msg.defaultFloat); + } + if (msg.defaultDouble) { + writer.writeDouble(252, msg.defaultDouble); + } + if (msg.defaultBool) { + writer.writeBool(253, msg.defaultBool); + } + if (msg.defaultString) { + writer.writeString(254, msg.defaultString); + } + if (msg.defaultBytes?.length) { + writer.writeBytes(255, msg.defaultBytes); + } + if (msg.fieldname1) { + writer.writeInt32(401, msg.fieldname1); + } + if (msg.fieldName2) { + writer.writeInt32(402, msg.fieldName2); + } + if (msg.fieldName3) { + writer.writeInt32(403, msg.fieldName3); + } + if (msg.fieldName4) { + writer.writeInt32(404, msg.fieldName4); + } + if (msg.field0name5) { + writer.writeInt32(405, msg.field0name5); + } + if (msg.field0Name6) { + writer.writeInt32(406, msg.field0Name6); + } + if (msg.fieldName7) { + writer.writeInt32(407, msg.fieldName7); + } + if (msg.FieldName8) { + writer.writeInt32(408, msg.FieldName8); + } + if (msg.fieldName9) { + writer.writeInt32(409, msg.fieldName9); + } + if (msg.FieldName10) { + writer.writeInt32(410, msg.FieldName10); + } + if (msg.FIELDNAME11) { + writer.writeInt32(411, msg.FIELDNAME11); + } + if (msg.FIELDName12) { + writer.writeInt32(412, msg.FIELDName12); + } + if (msg.fieldName13) { + writer.writeInt32(413, msg.fieldName13); + } + if (msg.FieldName14) { + writer.writeInt32(414, msg.FieldName14); + } + if (msg.fieldName15) { + writer.writeInt32(415, msg.fieldName15); + } + if (msg.fieldName16) { + writer.writeInt32(416, msg.fieldName16); + } + if (msg.fieldName17) { + writer.writeInt32(417, msg.fieldName17); + } + if (msg.FieldName18) { + writer.writeInt32(418, msg.FieldName18); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2, + reader: BinaryReader + ): TestAllTypesProto2 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.optionalInt32 = reader.readInt32(); + break; + } + case 2: { + msg.optionalInt64 = BigInt(reader.readInt64String()); + break; + } + case 3: { + msg.optionalUint32 = reader.readUint32(); + break; + } + case 4: { + msg.optionalUint64 = BigInt(reader.readUint64String()); + break; + } + case 5: { + msg.optionalSint32 = reader.readSint32(); + break; + } + case 6: { + msg.optionalSint64 = BigInt(reader.readSint64String()); + break; + } + case 7: { + msg.optionalFixed32 = reader.readFixed32(); + break; + } + case 8: { + msg.optionalFixed64 = BigInt(reader.readFixed64String()); + break; + } + case 9: { + msg.optionalSfixed32 = reader.readSfixed32(); + break; + } + case 10: { + msg.optionalSfixed64 = BigInt(reader.readSfixed64String()); + break; + } + case 11: { + msg.optionalFloat = reader.readFloat(); + break; + } + case 12: { + msg.optionalDouble = reader.readDouble(); + break; + } + case 13: { + msg.optionalBool = reader.readBool(); + break; + } + case 14: { + msg.optionalString = reader.readString(); + break; + } + case 15: { + msg.optionalBytes = reader.readBytes(); + break; + } + case 18: { + reader.readMessage( + msg.optionalNestedMessage, + TestAllTypesProto2.NestedMessage._readMessage + ); + break; + } + case 19: { + reader.readMessage( + msg.optionalForeignMessage, + ForeignMessageProto2._readMessage + ); + break; + } + case 21: { + msg.optionalNestedEnum = TestAllTypesProto2.NestedEnum._fromInt( + reader.readEnum() + ); + break; + } + case 22: { + msg.optionalForeignEnum = ForeignEnumProto2._fromInt( + reader.readEnum() + ); + break; + } + case 24: { + msg.optionalStringPiece = reader.readString(); + break; + } + case 25: { + msg.optionalCord = reader.readString(); + break; + } + case 27: { + reader.readMessage( + msg.recursiveMessage, + TestAllTypesProto2._readMessage + ); + break; + } + case 31: { + if (reader.isDelimited()) { + msg.repeatedInt32.push(...reader.readPackedInt32()); + } else { + msg.repeatedInt32.push(reader.readInt32()); + } + break; + } + case 32: { + if (reader.isDelimited()) { + msg.repeatedInt64.push( + ...reader.readPackedInt64String().map(BigInt) + ); + } else { + msg.repeatedInt64.push(BigInt(reader.readInt64String())); + } + break; + } + case 33: { + if (reader.isDelimited()) { + msg.repeatedUint32.push(...reader.readPackedUint32()); + } else { + msg.repeatedUint32.push(reader.readUint32()); + } + break; + } + case 34: { + if (reader.isDelimited()) { + msg.repeatedUint64.push( + ...reader.readPackedUint64String().map(BigInt) + ); + } else { + msg.repeatedUint64.push(BigInt(reader.readUint64String())); + } + break; + } + case 35: { + if (reader.isDelimited()) { + msg.repeatedSint32.push(...reader.readPackedSint32()); + } else { + msg.repeatedSint32.push(reader.readSint32()); + } + break; + } + case 36: { + if (reader.isDelimited()) { + msg.repeatedSint64.push( + ...reader.readPackedSint64String().map(BigInt) + ); + } else { + msg.repeatedSint64.push(BigInt(reader.readSint64String())); + } + break; + } + case 37: { + if (reader.isDelimited()) { + msg.repeatedFixed32.push(...reader.readPackedFixed32()); + } else { + msg.repeatedFixed32.push(reader.readFixed32()); + } + break; + } + case 38: { + if (reader.isDelimited()) { + msg.repeatedFixed64.push( + ...reader.readPackedFixed64String().map(BigInt) + ); + } else { + msg.repeatedFixed64.push(BigInt(reader.readFixed64String())); + } + break; + } + case 39: { + if (reader.isDelimited()) { + msg.repeatedSfixed32.push(...reader.readPackedSfixed32()); + } else { + msg.repeatedSfixed32.push(reader.readSfixed32()); + } + break; + } + case 40: { + if (reader.isDelimited()) { + msg.repeatedSfixed64.push( + ...reader.readPackedSfixed64String().map(BigInt) + ); + } else { + msg.repeatedSfixed64.push(BigInt(reader.readSfixed64String())); + } + break; + } + case 41: { + if (reader.isDelimited()) { + msg.repeatedFloat.push(...reader.readPackedFloat()); + } else { + msg.repeatedFloat.push(reader.readFloat()); + } + break; + } + case 42: { + if (reader.isDelimited()) { + msg.repeatedDouble.push(...reader.readPackedDouble()); + } else { + msg.repeatedDouble.push(reader.readDouble()); + } + break; + } + case 43: { + if (reader.isDelimited()) { + msg.repeatedBool.push(...reader.readPackedBool()); + } else { + msg.repeatedBool.push(reader.readBool()); + } + break; + } + case 44: { + msg.repeatedString.push(reader.readString()); + break; + } + case 45: { + msg.repeatedBytes.push(reader.readBytes()); + break; + } + case 48: { + const m = TestAllTypesProto2.NestedMessage.initialize(); + reader.readMessage(m, TestAllTypesProto2.NestedMessage._readMessage); + msg.repeatedNestedMessage.push(m); + break; + } + case 49: { + const m = ForeignMessageProto2.initialize(); + reader.readMessage(m, ForeignMessageProto2._readMessage); + msg.repeatedForeignMessage.push(m); + break; + } + case 51: { + if (reader.isDelimited()) { + msg.repeatedNestedEnum.push( + ...reader + .readPackedEnum() + .map(TestAllTypesProto2.NestedEnum._fromInt) + ); + } else { + msg.repeatedNestedEnum.push( + TestAllTypesProto2.NestedEnum._fromInt(reader.readEnum()) + ); + } + break; + } + case 52: { + if (reader.isDelimited()) { + msg.repeatedForeignEnum.push( + ...reader.readPackedEnum().map(ForeignEnumProto2._fromInt) + ); + } else { + msg.repeatedForeignEnum.push( + ForeignEnumProto2._fromInt(reader.readEnum()) + ); + } + break; + } + case 54: { + msg.repeatedStringPiece.push(reader.readString()); + break; + } + case 55: { + msg.repeatedCord.push(reader.readString()); + break; + } + case 75: { + if (reader.isDelimited()) { + msg.packedInt32.push(...reader.readPackedInt32()); + } else { + msg.packedInt32.push(reader.readInt32()); + } + break; + } + case 76: { + if (reader.isDelimited()) { + msg.packedInt64.push(...reader.readPackedInt64String().map(BigInt)); + } else { + msg.packedInt64.push(BigInt(reader.readInt64String())); + } + break; + } + case 77: { + if (reader.isDelimited()) { + msg.packedUint32.push(...reader.readPackedUint32()); + } else { + msg.packedUint32.push(reader.readUint32()); + } + break; + } + case 78: { + if (reader.isDelimited()) { + msg.packedUint64.push( + ...reader.readPackedUint64String().map(BigInt) + ); + } else { + msg.packedUint64.push(BigInt(reader.readUint64String())); + } + break; + } + case 79: { + if (reader.isDelimited()) { + msg.packedSint32.push(...reader.readPackedSint32()); + } else { + msg.packedSint32.push(reader.readSint32()); + } + break; + } + case 80: { + if (reader.isDelimited()) { + msg.packedSint64.push( + ...reader.readPackedSint64String().map(BigInt) + ); + } else { + msg.packedSint64.push(BigInt(reader.readSint64String())); + } + break; + } + case 81: { + if (reader.isDelimited()) { + msg.packedFixed32.push(...reader.readPackedFixed32()); + } else { + msg.packedFixed32.push(reader.readFixed32()); + } + break; + } + case 82: { + if (reader.isDelimited()) { + msg.packedFixed64.push( + ...reader.readPackedFixed64String().map(BigInt) + ); + } else { + msg.packedFixed64.push(BigInt(reader.readFixed64String())); + } + break; + } + case 83: { + if (reader.isDelimited()) { + msg.packedSfixed32.push(...reader.readPackedSfixed32()); + } else { + msg.packedSfixed32.push(reader.readSfixed32()); + } + break; + } + case 84: { + if (reader.isDelimited()) { + msg.packedSfixed64.push( + ...reader.readPackedSfixed64String().map(BigInt) + ); + } else { + msg.packedSfixed64.push(BigInt(reader.readSfixed64String())); + } + break; + } + case 85: { + if (reader.isDelimited()) { + msg.packedFloat.push(...reader.readPackedFloat()); + } else { + msg.packedFloat.push(reader.readFloat()); + } + break; + } + case 86: { + if (reader.isDelimited()) { + msg.packedDouble.push(...reader.readPackedDouble()); + } else { + msg.packedDouble.push(reader.readDouble()); + } + break; + } + case 87: { + if (reader.isDelimited()) { + msg.packedBool.push(...reader.readPackedBool()); + } else { + msg.packedBool.push(reader.readBool()); + } + break; + } + case 88: { + if (reader.isDelimited()) { + msg.packedNestedEnum.push( + ...reader + .readPackedEnum() + .map(TestAllTypesProto2.NestedEnum._fromInt) + ); + } else { + msg.packedNestedEnum.push( + TestAllTypesProto2.NestedEnum._fromInt(reader.readEnum()) + ); + } + break; + } + case 89: { + if (reader.isDelimited()) { + msg.unpackedInt32.push(...reader.readPackedInt32()); + } else { + msg.unpackedInt32.push(reader.readInt32()); + } + break; + } + case 90: { + if (reader.isDelimited()) { + msg.unpackedInt64.push( + ...reader.readPackedInt64String().map(BigInt) + ); + } else { + msg.unpackedInt64.push(BigInt(reader.readInt64String())); + } + break; + } + case 91: { + if (reader.isDelimited()) { + msg.unpackedUint32.push(...reader.readPackedUint32()); + } else { + msg.unpackedUint32.push(reader.readUint32()); + } + break; + } + case 92: { + if (reader.isDelimited()) { + msg.unpackedUint64.push( + ...reader.readPackedUint64String().map(BigInt) + ); + } else { + msg.unpackedUint64.push(BigInt(reader.readUint64String())); + } + break; + } + case 93: { + if (reader.isDelimited()) { + msg.unpackedSint32.push(...reader.readPackedSint32()); + } else { + msg.unpackedSint32.push(reader.readSint32()); + } + break; + } + case 94: { + if (reader.isDelimited()) { + msg.unpackedSint64.push( + ...reader.readPackedSint64String().map(BigInt) + ); + } else { + msg.unpackedSint64.push(BigInt(reader.readSint64String())); + } + break; + } + case 95: { + if (reader.isDelimited()) { + msg.unpackedFixed32.push(...reader.readPackedFixed32()); + } else { + msg.unpackedFixed32.push(reader.readFixed32()); + } + break; + } + case 96: { + if (reader.isDelimited()) { + msg.unpackedFixed64.push( + ...reader.readPackedFixed64String().map(BigInt) + ); + } else { + msg.unpackedFixed64.push(BigInt(reader.readFixed64String())); + } + break; + } + case 97: { + if (reader.isDelimited()) { + msg.unpackedSfixed32.push(...reader.readPackedSfixed32()); + } else { + msg.unpackedSfixed32.push(reader.readSfixed32()); + } + break; + } + case 98: { + if (reader.isDelimited()) { + msg.unpackedSfixed64.push( + ...reader.readPackedSfixed64String().map(BigInt) + ); + } else { + msg.unpackedSfixed64.push(BigInt(reader.readSfixed64String())); + } + break; + } + case 99: { + if (reader.isDelimited()) { + msg.unpackedFloat.push(...reader.readPackedFloat()); + } else { + msg.unpackedFloat.push(reader.readFloat()); + } + break; + } + case 100: { + if (reader.isDelimited()) { + msg.unpackedDouble.push(...reader.readPackedDouble()); + } else { + msg.unpackedDouble.push(reader.readDouble()); + } + break; + } + case 101: { + if (reader.isDelimited()) { + msg.unpackedBool.push(...reader.readPackedBool()); + } else { + msg.unpackedBool.push(reader.readBool()); + } + break; + } + case 102: { + if (reader.isDelimited()) { + msg.unpackedNestedEnum.push( + ...reader + .readPackedEnum() + .map(TestAllTypesProto2.NestedEnum._fromInt) + ); + } else { + msg.unpackedNestedEnum.push( + TestAllTypesProto2.NestedEnum._fromInt(reader.readEnum()) + ); + } + break; + } + case 56: { + const map = {} as TestAllTypesProto2.MapInt32Int32; + reader.readMessage( + map, + TestAllTypesProto2.MapInt32Int32._readMessage + ); + msg.mapInt32Int32[map.key.toString()] = map.value; + break; + } + case 57: { + const map = {} as TestAllTypesProto2.MapInt64Int64; + reader.readMessage( + map, + TestAllTypesProto2.MapInt64Int64._readMessage + ); + msg.mapInt64Int64[map.key.toString()] = map.value; + break; + } + case 58: { + const map = {} as TestAllTypesProto2.MapUint32Uint32; + reader.readMessage( + map, + TestAllTypesProto2.MapUint32Uint32._readMessage + ); + msg.mapUint32Uint32[map.key.toString()] = map.value; + break; + } + case 59: { + const map = {} as TestAllTypesProto2.MapUint64Uint64; + reader.readMessage( + map, + TestAllTypesProto2.MapUint64Uint64._readMessage + ); + msg.mapUint64Uint64[map.key.toString()] = map.value; + break; + } + case 60: { + const map = {} as TestAllTypesProto2.MapSint32Sint32; + reader.readMessage( + map, + TestAllTypesProto2.MapSint32Sint32._readMessage + ); + msg.mapSint32Sint32[map.key.toString()] = map.value; + break; + } + case 61: { + const map = {} as TestAllTypesProto2.MapSint64Sint64; + reader.readMessage( + map, + TestAllTypesProto2.MapSint64Sint64._readMessage + ); + msg.mapSint64Sint64[map.key.toString()] = map.value; + break; + } + case 62: { + const map = {} as TestAllTypesProto2.MapFixed32Fixed32; + reader.readMessage( + map, + TestAllTypesProto2.MapFixed32Fixed32._readMessage + ); + msg.mapFixed32Fixed32[map.key.toString()] = map.value; + break; + } + case 63: { + const map = {} as TestAllTypesProto2.MapFixed64Fixed64; + reader.readMessage( + map, + TestAllTypesProto2.MapFixed64Fixed64._readMessage + ); + msg.mapFixed64Fixed64[map.key.toString()] = map.value; + break; + } + case 64: { + const map = {} as TestAllTypesProto2.MapSfixed32Sfixed32; + reader.readMessage( + map, + TestAllTypesProto2.MapSfixed32Sfixed32._readMessage + ); + msg.mapSfixed32Sfixed32[map.key.toString()] = map.value; + break; + } + case 65: { + const map = {} as TestAllTypesProto2.MapSfixed64Sfixed64; + reader.readMessage( + map, + TestAllTypesProto2.MapSfixed64Sfixed64._readMessage + ); + msg.mapSfixed64Sfixed64[map.key.toString()] = map.value; + break; + } + case 66: { + const map = {} as TestAllTypesProto2.MapInt32Float; + reader.readMessage( + map, + TestAllTypesProto2.MapInt32Float._readMessage + ); + msg.mapInt32Float[map.key.toString()] = map.value; + break; + } + case 67: { + const map = {} as TestAllTypesProto2.MapInt32Double; + reader.readMessage( + map, + TestAllTypesProto2.MapInt32Double._readMessage + ); + msg.mapInt32Double[map.key.toString()] = map.value; + break; + } + case 68: { + const map = {} as TestAllTypesProto2.MapBoolBool; + reader.readMessage(map, TestAllTypesProto2.MapBoolBool._readMessage); + msg.mapBoolBool[map.key.toString()] = map.value; + break; + } + case 69: { + const map = {} as TestAllTypesProto2.MapStringString; + reader.readMessage( + map, + TestAllTypesProto2.MapStringString._readMessage + ); + msg.mapStringString[map.key.toString()] = map.value; + break; + } + case 70: { + const map = {} as TestAllTypesProto2.MapStringBytes; + reader.readMessage( + map, + TestAllTypesProto2.MapStringBytes._readMessage + ); + msg.mapStringBytes[map.key.toString()] = map.value; + break; + } + case 71: { + const map = {} as TestAllTypesProto2.MapStringNestedMessage; + reader.readMessage( + map, + TestAllTypesProto2.MapStringNestedMessage._readMessage + ); + msg.mapStringNestedMessage[map.key.toString()] = map.value; + break; + } + case 72: { + const map = {} as TestAllTypesProto2.MapStringForeignMessage; + reader.readMessage( + map, + TestAllTypesProto2.MapStringForeignMessage._readMessage + ); + msg.mapStringForeignMessage[map.key.toString()] = map.value; + break; + } + case 73: { + const map = {} as TestAllTypesProto2.MapStringNestedEnum; + reader.readMessage( + map, + TestAllTypesProto2.MapStringNestedEnum._readMessage + ); + msg.mapStringNestedEnum[map.key.toString()] = map.value; + break; + } + case 74: { + const map = {} as TestAllTypesProto2.MapStringForeignEnum; + reader.readMessage( + map, + TestAllTypesProto2.MapStringForeignEnum._readMessage + ); + msg.mapStringForeignEnum[map.key.toString()] = map.value; + break; + } + case 111: { + msg.oneofUint32 = reader.readUint32(); + break; + } + case 112: { + msg.oneofNestedMessage = + TestAllTypesProto2.NestedMessage.initialize(); + reader.readMessage( + msg.oneofNestedMessage, + TestAllTypesProto2.NestedMessage._readMessage + ); + break; + } + case 113: { + msg.oneofString = reader.readString(); + break; + } + case 114: { + msg.oneofBytes = reader.readBytes(); + break; + } + case 115: { + msg.oneofBool = reader.readBool(); + break; + } + case 116: { + msg.oneofUint64 = BigInt(reader.readUint64String()); + break; + } + case 117: { + msg.oneofFloat = reader.readFloat(); + break; + } + case 118: { + msg.oneofDouble = reader.readDouble(); + break; + } + case 119: { + msg.oneofEnum = TestAllTypesProto2.NestedEnum._fromInt( + reader.readEnum() + ); + break; + } + case 241: { + msg.defaultInt32 = reader.readInt32(); + break; + } + case 242: { + msg.defaultInt64 = BigInt(reader.readInt64String()); + break; + } + case 243: { + msg.defaultUint32 = reader.readUint32(); + break; + } + case 244: { + msg.defaultUint64 = BigInt(reader.readUint64String()); + break; + } + case 245: { + msg.defaultSint32 = reader.readSint32(); + break; + } + case 246: { + msg.defaultSint64 = BigInt(reader.readSint64String()); + break; + } + case 247: { + msg.defaultFixed32 = reader.readFixed32(); + break; + } + case 248: { + msg.defaultFixed64 = BigInt(reader.readFixed64String()); + break; + } + case 249: { + msg.defaultSfixed32 = reader.readSfixed32(); + break; + } + case 250: { + msg.defaultSfixed64 = BigInt(reader.readSfixed64String()); + break; + } + case 251: { + msg.defaultFloat = reader.readFloat(); + break; + } + case 252: { + msg.defaultDouble = reader.readDouble(); + break; + } + case 253: { + msg.defaultBool = reader.readBool(); + break; + } + case 254: { + msg.defaultString = reader.readString(); + break; + } + case 255: { + msg.defaultBytes = reader.readBytes(); + break; + } + case 401: { + msg.fieldname1 = reader.readInt32(); + break; + } + case 402: { + msg.fieldName2 = reader.readInt32(); + break; + } + case 403: { + msg.fieldName3 = reader.readInt32(); + break; + } + case 404: { + msg.fieldName4 = reader.readInt32(); + break; + } + case 405: { + msg.field0name5 = reader.readInt32(); + break; + } + case 406: { + msg.field0Name6 = reader.readInt32(); + break; + } + case 407: { + msg.fieldName7 = reader.readInt32(); + break; + } + case 408: { + msg.FieldName8 = reader.readInt32(); + break; + } + case 409: { + msg.fieldName9 = reader.readInt32(); + break; + } + case 410: { + msg.FieldName10 = reader.readInt32(); + break; + } + case 411: { + msg.FIELDNAME11 = reader.readInt32(); + break; + } + case 412: { + msg.FIELDName12 = reader.readInt32(); + break; + } + case 413: { + msg.fieldName13 = reader.readInt32(); + break; + } + case 414: { + msg.FieldName14 = reader.readInt32(); + break; + } + case 415: { + msg.fieldName15 = reader.readInt32(); + break; + } + case 416: { + msg.fieldName16 = reader.readInt32(); + break; + } + case 417: { + msg.fieldName17 = reader.readInt32(); + break; + } + case 418: { + msg.FieldName18 = reader.readInt32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + + NestedEnum: { + FOO: "FOO", + BAR: "BAR", + BAZ: "BAZ", + NEG: "NEG", + /** + * @private + */ + _fromInt: function (i: number): TestAllTypesProto2.NestedEnum { + switch (i) { + case 0: { + return "FOO"; + } + case 1: { + return "BAR"; + } + case 2: { + return "BAZ"; + } + case -1: { + return "NEG"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as TestAllTypesProto2.NestedEnum; + } + } + }, + /** + * @private + */ + _toInt: function (i: TestAllTypesProto2.NestedEnum): number { + switch (i) { + case "FOO": { + return 0; + } + case "BAR": { + return 1; + } + case "BAZ": { + return 2; + } + case "NEG": { + return -1; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, + } as const, + + NestedMessage: { + /** + * Serializes TestAllTypesProto2.NestedMessage to protobuf. + */ + encode: function ( + msg: Partial + ): Uint8Array { + return TestAllTypesProto2.NestedMessage._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes TestAllTypesProto2.NestedMessage from protobuf. + */ + decode: function (bytes: ByteSource): TestAllTypesProto2.NestedMessage { + return TestAllTypesProto2.NestedMessage._readMessage( + TestAllTypesProto2.NestedMessage.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes TestAllTypesProto2.NestedMessage with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto2.NestedMessage { + return { + a: 0, + corecursive: undefined, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.a) { + writer.writeInt32(1, msg.a); + } + if (msg.corecursive) { + writer.writeMessage( + 2, + msg.corecursive, + TestAllTypesProto2._writeMessage + ); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.NestedMessage, + reader: BinaryReader + ): TestAllTypesProto2.NestedMessage { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.a = reader.readInt32(); + break; + } + case 2: { + reader.readMessage( + msg.corecursive, + TestAllTypesProto2._readMessage + ); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapInt32Int32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeInt32(1, msg.key); + } + if (msg.value) { + writer.writeInt32(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapInt32Int32, + reader: BinaryReader + ): TestAllTypesProto2.MapInt32Int32 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readInt32(); + break; + } + case 2: { + msg.value = reader.readInt32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapInt64Int64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeInt64String(1, msg.key.toString() as any); + } + if (msg.value) { + writer.writeInt64String(2, msg.value.toString() as any); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapInt64Int64, + reader: BinaryReader + ): TestAllTypesProto2.MapInt64Int64 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = BigInt(reader.readInt64String()); + break; + } + case 2: { + msg.value = BigInt(reader.readInt64String()); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapUint32Uint32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeUint32(1, msg.key); + } + if (msg.value) { + writer.writeUint32(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapUint32Uint32, + reader: BinaryReader + ): TestAllTypesProto2.MapUint32Uint32 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readUint32(); + break; + } + case 2: { + msg.value = reader.readUint32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapUint64Uint64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeUint64String(1, msg.key.toString() as any); + } + if (msg.value) { + writer.writeUint64String(2, msg.value.toString() as any); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapUint64Uint64, + reader: BinaryReader + ): TestAllTypesProto2.MapUint64Uint64 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = BigInt(reader.readUint64String()); + break; + } + case 2: { + msg.value = BigInt(reader.readUint64String()); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapSint32Sint32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeSint32(1, msg.key); + } + if (msg.value) { + writer.writeSint32(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapSint32Sint32, + reader: BinaryReader + ): TestAllTypesProto2.MapSint32Sint32 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readSint32(); + break; + } + case 2: { + msg.value = reader.readSint32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapSint64Sint64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeSint64String(1, msg.key.toString() as any); + } + if (msg.value) { + writer.writeSint64String(2, msg.value.toString() as any); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapSint64Sint64, + reader: BinaryReader + ): TestAllTypesProto2.MapSint64Sint64 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = BigInt(reader.readSint64String()); + break; + } + case 2: { + msg.value = BigInt(reader.readSint64String()); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapFixed32Fixed32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeFixed32(1, msg.key); + } + if (msg.value) { + writer.writeFixed32(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapFixed32Fixed32, + reader: BinaryReader + ): TestAllTypesProto2.MapFixed32Fixed32 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readFixed32(); + break; + } + case 2: { + msg.value = reader.readFixed32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapFixed64Fixed64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeFixed64String(1, msg.key.toString() as any); + } + if (msg.value) { + writer.writeFixed64String(2, msg.value.toString() as any); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapFixed64Fixed64, + reader: BinaryReader + ): TestAllTypesProto2.MapFixed64Fixed64 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = BigInt(reader.readFixed64String()); + break; + } + case 2: { + msg.value = BigInt(reader.readFixed64String()); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapSfixed32Sfixed32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeSfixed32(1, msg.key); + } + if (msg.value) { + writer.writeSfixed32(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapSfixed32Sfixed32, + reader: BinaryReader + ): TestAllTypesProto2.MapSfixed32Sfixed32 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readSfixed32(); + break; + } + case 2: { + msg.value = reader.readSfixed32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapSfixed64Sfixed64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeSfixed64String(1, msg.key.toString() as any); + } + if (msg.value) { + writer.writeSfixed64String(2, msg.value.toString() as any); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapSfixed64Sfixed64, + reader: BinaryReader + ): TestAllTypesProto2.MapSfixed64Sfixed64 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = BigInt(reader.readSfixed64String()); + break; + } + case 2: { + msg.value = BigInt(reader.readSfixed64String()); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapInt32Float: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeInt32(1, msg.key); + } + if (msg.value) { + writer.writeFloat(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapInt32Float, + reader: BinaryReader + ): TestAllTypesProto2.MapInt32Float { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readInt32(); + break; + } + case 2: { + msg.value = reader.readFloat(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapInt32Double: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeInt32(1, msg.key); + } + if (msg.value) { + writer.writeDouble(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapInt32Double, + reader: BinaryReader + ): TestAllTypesProto2.MapInt32Double { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readInt32(); + break; + } + case 2: { + msg.value = reader.readDouble(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapBoolBool: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeBool(1, msg.key); + } + if (msg.value) { + writer.writeBool(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapBoolBool, + reader: BinaryReader + ): TestAllTypesProto2.MapBoolBool { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readBool(); + break; + } + case 2: { + msg.value = reader.readBool(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapStringString: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeString(1, msg.key); + } + if (msg.value) { + writer.writeString(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapStringString, + reader: BinaryReader + ): TestAllTypesProto2.MapStringString { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readString(); + break; + } + case 2: { + msg.value = reader.readString(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapStringBytes: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeString(1, msg.key); + } + if (msg.value?.length) { + writer.writeBytes(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapStringBytes, + reader: BinaryReader + ): TestAllTypesProto2.MapStringBytes { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readString(); + break; + } + case 2: { + msg.value = reader.readBytes(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapStringNestedMessage: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeString(1, msg.key); + } + if (msg.value) { + writer.writeMessage( + 2, + msg.value, + TestAllTypesProto2.NestedMessage._writeMessage + ); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapStringNestedMessage, + reader: BinaryReader + ): TestAllTypesProto2.MapStringNestedMessage { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readString(); + break; + } + case 2: { + msg.value = TestAllTypesProto2.NestedMessage.initialize(); + reader.readMessage( + msg.value, + TestAllTypesProto2.NestedMessage._readMessage + ); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapStringForeignMessage: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeString(1, msg.key); + } + if (msg.value) { + writer.writeMessage(2, msg.value, ForeignMessageProto2._writeMessage); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapStringForeignMessage, + reader: BinaryReader + ): TestAllTypesProto2.MapStringForeignMessage { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readString(); + break; + } + case 2: { + msg.value = ForeignMessageProto2.initialize(); + reader.readMessage(msg.value, ForeignMessageProto2._readMessage); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapStringNestedEnum: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeString(1, msg.key); + } + if (msg.value && TestAllTypesProto2.NestedEnum._toInt(msg.value)) { + writer.writeEnum(2, TestAllTypesProto2.NestedEnum._toInt(msg.value)); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapStringNestedEnum, + reader: BinaryReader + ): TestAllTypesProto2.MapStringNestedEnum { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readString(); + break; + } + case 2: { + msg.value = TestAllTypesProto2.NestedEnum._fromInt( + reader.readEnum() + ); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapStringForeignEnum: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeString(1, msg.key); + } + if (msg.value && ForeignEnumProto2._toInt(msg.value)) { + writer.writeEnum(2, ForeignEnumProto2._toInt(msg.value)); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapStringForeignEnum, + reader: BinaryReader + ): TestAllTypesProto2.MapStringForeignEnum { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readString(); + break; + } + case 2: { + msg.value = ForeignEnumProto2._fromInt(reader.readEnum()); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + Data: { + /** + * Serializes TestAllTypesProto2.Data to protobuf. + */ + encode: function (msg: Partial): Uint8Array { + return TestAllTypesProto2.Data._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes TestAllTypesProto2.Data from protobuf. + */ + decode: function (bytes: ByteSource): TestAllTypesProto2.Data { + return TestAllTypesProto2.Data._readMessage( + TestAllTypesProto2.Data.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes TestAllTypesProto2.Data with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto2.Data { + return { + groupInt32: 0, + groupUint32: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.groupInt32) { + writer.writeInt32(202, msg.groupInt32); + } + if (msg.groupUint32) { + writer.writeUint32(203, msg.groupUint32); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.Data, + reader: BinaryReader + ): TestAllTypesProto2.Data { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 202: { + msg.groupInt32 = reader.readInt32(); + break; + } + case 203: { + msg.groupUint32 = reader.readUint32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MessageSetCorrect: { + /** + * Serializes TestAllTypesProto2.MessageSetCorrect to protobuf. + */ + encode: function ( + _msg?: Partial + ): Uint8Array { + return new Uint8Array(); + }, + + /** + * Deserializes TestAllTypesProto2.MessageSetCorrect from protobuf. + */ + decode: function ( + _bytes?: ByteSource + ): TestAllTypesProto2.MessageSetCorrect { + return {}; + }, + + /** + * Initializes TestAllTypesProto2.MessageSetCorrect with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto2.MessageSetCorrect { + return {}; + }, + + /** + * @private + */ + _writeMessage: function ( + _msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + _msg: TestAllTypesProto2.MessageSetCorrect, + _reader: BinaryReader + ): TestAllTypesProto2.MessageSetCorrect { + return _msg; + }, + }, + + MessageSetCorrectExtension1: { + /** + * Serializes TestAllTypesProto2.MessageSetCorrectExtension1 to protobuf. + */ + encode: function ( + msg: Partial + ): Uint8Array { + return TestAllTypesProto2.MessageSetCorrectExtension1._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes TestAllTypesProto2.MessageSetCorrectExtension1 from protobuf. + */ + decode: function ( + bytes: ByteSource + ): TestAllTypesProto2.MessageSetCorrectExtension1 { + return TestAllTypesProto2.MessageSetCorrectExtension1._readMessage( + TestAllTypesProto2.MessageSetCorrectExtension1.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes TestAllTypesProto2.MessageSetCorrectExtension1 with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto2.MessageSetCorrectExtension1 { + return { + str: "", + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.str) { + writer.writeString(25, msg.str); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MessageSetCorrectExtension1, + reader: BinaryReader + ): TestAllTypesProto2.MessageSetCorrectExtension1 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 25: { + msg.str = reader.readString(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MessageSetCorrectExtension2: { + /** + * Serializes TestAllTypesProto2.MessageSetCorrectExtension2 to protobuf. + */ + encode: function ( + msg: Partial + ): Uint8Array { + return TestAllTypesProto2.MessageSetCorrectExtension2._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes TestAllTypesProto2.MessageSetCorrectExtension2 from protobuf. + */ + decode: function ( + bytes: ByteSource + ): TestAllTypesProto2.MessageSetCorrectExtension2 { + return TestAllTypesProto2.MessageSetCorrectExtension2._readMessage( + TestAllTypesProto2.MessageSetCorrectExtension2.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes TestAllTypesProto2.MessageSetCorrectExtension2 with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto2.MessageSetCorrectExtension2 { + return { + i: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.i) { + writer.writeInt32(9, msg.i); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MessageSetCorrectExtension2, + reader: BinaryReader + ): TestAllTypesProto2.MessageSetCorrectExtension2 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 9: { + msg.i = reader.readInt32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, +}; + +export const ForeignMessageProto2 = { + /** + * Serializes ForeignMessageProto2 to protobuf. + */ + encode: function (msg: Partial): Uint8Array { + return ForeignMessageProto2._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes ForeignMessageProto2 from protobuf. + */ + decode: function (bytes: ByteSource): ForeignMessageProto2 { + return ForeignMessageProto2._readMessage( + ForeignMessageProto2.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes ForeignMessageProto2 with all fields set to their default value. + */ + initialize: function (): ForeignMessageProto2 { + return { + c: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.c) { + writer.writeInt32(1, msg.c); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: ForeignMessageProto2, + reader: BinaryReader + ): ForeignMessageProto2 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.c = reader.readInt32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, +}; + +export const UnknownToTestAllTypes = { + /** + * Serializes UnknownToTestAllTypes to protobuf. + */ + encode: function (msg: Partial): Uint8Array { + return UnknownToTestAllTypes._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes UnknownToTestAllTypes from protobuf. + */ + decode: function (bytes: ByteSource): UnknownToTestAllTypes { + return UnknownToTestAllTypes._readMessage( + UnknownToTestAllTypes.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes UnknownToTestAllTypes with all fields set to their default value. + */ + initialize: function (): UnknownToTestAllTypes { + return { + optionalInt32: 0, + optionalString: "", + nestedMessage: ForeignMessageProto2.initialize(), + optionalBool: false, + repeatedInt32: [], + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.optionalInt32) { + writer.writeInt32(1001, msg.optionalInt32); + } + if (msg.optionalString) { + writer.writeString(1002, msg.optionalString); + } + if (msg.nestedMessage) { + writer.writeMessage( + 1003, + msg.nestedMessage, + ForeignMessageProto2._writeMessage + ); + } + if (msg.optionalBool) { + writer.writeBool(1006, msg.optionalBool); + } + if (msg.repeatedInt32?.length) { + writer.writePackedInt32(1011, msg.repeatedInt32); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: UnknownToTestAllTypes, + reader: BinaryReader + ): UnknownToTestAllTypes { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1001: { + msg.optionalInt32 = reader.readInt32(); + break; + } + case 1002: { + msg.optionalString = reader.readString(); + break; + } + case 1003: { + reader.readMessage( + msg.nestedMessage, + ForeignMessageProto2._readMessage + ); + break; + } + case 1006: { + msg.optionalBool = reader.readBool(); + break; + } + case 1011: { + if (reader.isDelimited()) { + msg.repeatedInt32.push(...reader.readPackedInt32()); + } else { + msg.repeatedInt32.push(reader.readInt32()); + } + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + + OptionalGroup: { + /** + * Serializes UnknownToTestAllTypes.OptionalGroup to protobuf. + */ + encode: function ( + msg: Partial + ): Uint8Array { + return UnknownToTestAllTypes.OptionalGroup._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes UnknownToTestAllTypes.OptionalGroup from protobuf. + */ + decode: function (bytes: ByteSource): UnknownToTestAllTypes.OptionalGroup { + return UnknownToTestAllTypes.OptionalGroup._readMessage( + UnknownToTestAllTypes.OptionalGroup.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes UnknownToTestAllTypes.OptionalGroup with all fields set to their default value. + */ + initialize: function (): UnknownToTestAllTypes.OptionalGroup { + return { + a: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.a) { + writer.writeInt32(1, msg.a); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: UnknownToTestAllTypes.OptionalGroup, + reader: BinaryReader + ): UnknownToTestAllTypes.OptionalGroup { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.a = reader.readInt32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, +}; + +export const NullHypothesisProto2 = { + /** + * Serializes NullHypothesisProto2 to protobuf. + */ + encode: function (_msg?: Partial): Uint8Array { + return new Uint8Array(); + }, + + /** + * Deserializes NullHypothesisProto2 from protobuf. + */ + decode: function (_bytes?: ByteSource): NullHypothesisProto2 { + return {}; + }, + + /** + * Initializes NullHypothesisProto2 with all fields set to their default value. + */ + initialize: function (): NullHypothesisProto2 { + return {}; + }, + + /** + * @private + */ + _writeMessage: function ( + _msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + _msg: NullHypothesisProto2, + _reader: BinaryReader + ): NullHypothesisProto2 { + return _msg; + }, +}; + +export const EnumOnlyProto2 = { + /** + * Serializes EnumOnlyProto2 to protobuf. + */ + encode: function (_msg?: Partial): Uint8Array { + return new Uint8Array(); + }, + + /** + * Deserializes EnumOnlyProto2 from protobuf. + */ + decode: function (_bytes?: ByteSource): EnumOnlyProto2 { + return {}; + }, + + /** + * Initializes EnumOnlyProto2 with all fields set to their default value. + */ + initialize: function (): EnumOnlyProto2 { + return {}; + }, + + /** + * @private + */ + _writeMessage: function ( + _msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + _msg: EnumOnlyProto2, + _reader: BinaryReader + ): EnumOnlyProto2 { + return _msg; + }, + + Bool: { + kFalse: "kFalse", + kTrue: "kTrue", + /** + * @private + */ + _fromInt: function (i: number): EnumOnlyProto2.Bool { + switch (i) { + case 0: { + return "kFalse"; + } + case 1: { + return "kTrue"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as EnumOnlyProto2.Bool; + } + } + }, + /** + * @private + */ + _toInt: function (i: EnumOnlyProto2.Bool): number { + switch (i) { + case "kFalse": { + return 0; + } + case "kTrue": { + return 1; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, + } as const, +}; + +export const OneStringProto2 = { + /** + * Serializes OneStringProto2 to protobuf. + */ + encode: function (msg: Partial): Uint8Array { + return OneStringProto2._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes OneStringProto2 from protobuf. + */ + decode: function (bytes: ByteSource): OneStringProto2 { + return OneStringProto2._readMessage( + OneStringProto2.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes OneStringProto2 with all fields set to their default value. + */ + initialize: function (): OneStringProto2 { + return { + data: "", + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.data) { + writer.writeString(1, msg.data); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: OneStringProto2, + reader: BinaryReader + ): OneStringProto2 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.data = reader.readString(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, +}; + +export const ProtoWithKeywords = { + /** + * Serializes ProtoWithKeywords to protobuf. + */ + encode: function (msg: Partial): Uint8Array { + return ProtoWithKeywords._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes ProtoWithKeywords from protobuf. + */ + decode: function (bytes: ByteSource): ProtoWithKeywords { + return ProtoWithKeywords._readMessage( + ProtoWithKeywords.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes ProtoWithKeywords with all fields set to their default value. + */ + initialize: function (): ProtoWithKeywords { + return { + inline: 0, + concept: "", + requires: [], + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.inline) { + writer.writeInt32(1, msg.inline); + } + if (msg.concept) { + writer.writeString(2, msg.concept); + } + if (msg.requires?.length) { + writer.writeRepeatedString(3, msg.requires); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: ProtoWithKeywords, + reader: BinaryReader + ): ProtoWithKeywords { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.inline = reader.readInt32(); + break; + } + case 2: { + msg.concept = reader.readString(); + break; + } + case 3: { + msg.requires.push(reader.readString()); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, +}; + +export const TestAllRequiredTypesProto2 = { + /** + * Serializes TestAllRequiredTypesProto2 to protobuf. + */ + encode: function (msg: Partial): Uint8Array { + return TestAllRequiredTypesProto2._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes TestAllRequiredTypesProto2 from protobuf. + */ + decode: function (bytes: ByteSource): TestAllRequiredTypesProto2 { + return TestAllRequiredTypesProto2._readMessage( + TestAllRequiredTypesProto2.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes TestAllRequiredTypesProto2 with all fields set to their default value. + */ + initialize: function (): TestAllRequiredTypesProto2 { + return { + requiredInt32: 0, + requiredInt64: 0n, + requiredUint32: 0, + requiredUint64: 0n, + requiredSint32: 0, + requiredSint64: 0n, + requiredFixed32: 0, + requiredFixed64: 0n, + requiredSfixed32: 0, + requiredSfixed64: 0n, + requiredFloat: 0, + requiredDouble: 0, + requiredBool: false, + requiredString: "", + requiredBytes: new Uint8Array(), + requiredNestedMessage: + TestAllRequiredTypesProto2.NestedMessage.initialize(), + requiredForeignMessage: ForeignMessageProto2.initialize(), + requiredNestedEnum: TestAllRequiredTypesProto2.NestedEnum._fromInt(0), + requiredForeignEnum: ForeignEnumProto2._fromInt(0), + requiredStringPiece: "", + requiredCord: "", + recursiveMessage: undefined, + optionalRecursiveMessage: undefined, + defaultInt32: 0, + defaultInt64: 0n, + defaultUint32: 0, + defaultUint64: 0n, + defaultSint32: 0, + defaultSint64: 0n, + defaultFixed32: 0, + defaultFixed64: 0n, + defaultSfixed32: 0, + defaultSfixed64: 0n, + defaultFloat: 0, + defaultDouble: 0, + defaultBool: false, + defaultString: "", + defaultBytes: new Uint8Array(), + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.requiredInt32) { + writer.writeInt32(1, msg.requiredInt32); + } + if (msg.requiredInt64) { + writer.writeInt64String(2, msg.requiredInt64.toString() as any); + } + if (msg.requiredUint32) { + writer.writeUint32(3, msg.requiredUint32); + } + if (msg.requiredUint64) { + writer.writeUint64String(4, msg.requiredUint64.toString() as any); + } + if (msg.requiredSint32) { + writer.writeSint32(5, msg.requiredSint32); + } + if (msg.requiredSint64) { + writer.writeSint64String(6, msg.requiredSint64.toString() as any); + } + if (msg.requiredFixed32) { + writer.writeFixed32(7, msg.requiredFixed32); + } + if (msg.requiredFixed64) { + writer.writeFixed64String(8, msg.requiredFixed64.toString() as any); + } + if (msg.requiredSfixed32) { + writer.writeSfixed32(9, msg.requiredSfixed32); + } + if (msg.requiredSfixed64) { + writer.writeSfixed64String(10, msg.requiredSfixed64.toString() as any); + } + if (msg.requiredFloat) { + writer.writeFloat(11, msg.requiredFloat); + } + if (msg.requiredDouble) { + writer.writeDouble(12, msg.requiredDouble); + } + if (msg.requiredBool) { + writer.writeBool(13, msg.requiredBool); + } + if (msg.requiredString) { + writer.writeString(14, msg.requiredString); + } + if (msg.requiredBytes?.length) { + writer.writeBytes(15, msg.requiredBytes); + } + if (msg.requiredNestedMessage) { + writer.writeMessage( + 18, + msg.requiredNestedMessage, + TestAllRequiredTypesProto2.NestedMessage._writeMessage + ); + } + if (msg.requiredForeignMessage) { + writer.writeMessage( + 19, + msg.requiredForeignMessage, + ForeignMessageProto2._writeMessage + ); + } + if ( + msg.requiredNestedEnum && + TestAllRequiredTypesProto2.NestedEnum._toInt(msg.requiredNestedEnum) + ) { + writer.writeEnum( + 21, + TestAllRequiredTypesProto2.NestedEnum._toInt(msg.requiredNestedEnum) + ); + } + if ( + msg.requiredForeignEnum && + ForeignEnumProto2._toInt(msg.requiredForeignEnum) + ) { + writer.writeEnum(22, ForeignEnumProto2._toInt(msg.requiredForeignEnum)); + } + if (msg.requiredStringPiece) { + writer.writeString(24, msg.requiredStringPiece); + } + if (msg.requiredCord) { + writer.writeString(25, msg.requiredCord); + } + if (msg.recursiveMessage) { + writer.writeMessage( + 27, + msg.recursiveMessage, + TestAllRequiredTypesProto2._writeMessage + ); + } + if (msg.optionalRecursiveMessage) { + writer.writeMessage( + 28, + msg.optionalRecursiveMessage, + TestAllRequiredTypesProto2._writeMessage + ); + } + if (msg.defaultInt32) { + writer.writeInt32(241, msg.defaultInt32); + } + if (msg.defaultInt64) { + writer.writeInt64String(242, msg.defaultInt64.toString() as any); + } + if (msg.defaultUint32) { + writer.writeUint32(243, msg.defaultUint32); + } + if (msg.defaultUint64) { + writer.writeUint64String(244, msg.defaultUint64.toString() as any); + } + if (msg.defaultSint32) { + writer.writeSint32(245, msg.defaultSint32); + } + if (msg.defaultSint64) { + writer.writeSint64String(246, msg.defaultSint64.toString() as any); + } + if (msg.defaultFixed32) { + writer.writeFixed32(247, msg.defaultFixed32); + } + if (msg.defaultFixed64) { + writer.writeFixed64String(248, msg.defaultFixed64.toString() as any); + } + if (msg.defaultSfixed32) { + writer.writeSfixed32(249, msg.defaultSfixed32); + } + if (msg.defaultSfixed64) { + writer.writeSfixed64String(250, msg.defaultSfixed64.toString() as any); + } + if (msg.defaultFloat) { + writer.writeFloat(251, msg.defaultFloat); + } + if (msg.defaultDouble) { + writer.writeDouble(252, msg.defaultDouble); + } + if (msg.defaultBool) { + writer.writeBool(253, msg.defaultBool); + } + if (msg.defaultString) { + writer.writeString(254, msg.defaultString); + } + if (msg.defaultBytes?.length) { + writer.writeBytes(255, msg.defaultBytes); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllRequiredTypesProto2, + reader: BinaryReader + ): TestAllRequiredTypesProto2 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.requiredInt32 = reader.readInt32(); + break; + } + case 2: { + msg.requiredInt64 = BigInt(reader.readInt64String()); + break; + } + case 3: { + msg.requiredUint32 = reader.readUint32(); + break; + } + case 4: { + msg.requiredUint64 = BigInt(reader.readUint64String()); + break; + } + case 5: { + msg.requiredSint32 = reader.readSint32(); + break; + } + case 6: { + msg.requiredSint64 = BigInt(reader.readSint64String()); + break; + } + case 7: { + msg.requiredFixed32 = reader.readFixed32(); + break; + } + case 8: { + msg.requiredFixed64 = BigInt(reader.readFixed64String()); + break; + } + case 9: { + msg.requiredSfixed32 = reader.readSfixed32(); + break; + } + case 10: { + msg.requiredSfixed64 = BigInt(reader.readSfixed64String()); + break; + } + case 11: { + msg.requiredFloat = reader.readFloat(); + break; + } + case 12: { + msg.requiredDouble = reader.readDouble(); + break; + } + case 13: { + msg.requiredBool = reader.readBool(); + break; + } + case 14: { + msg.requiredString = reader.readString(); + break; + } + case 15: { + msg.requiredBytes = reader.readBytes(); + break; + } + case 18: { + reader.readMessage( + msg.requiredNestedMessage, + TestAllRequiredTypesProto2.NestedMessage._readMessage + ); + break; + } + case 19: { + reader.readMessage( + msg.requiredForeignMessage, + ForeignMessageProto2._readMessage + ); + break; + } + case 21: { + msg.requiredNestedEnum = + TestAllRequiredTypesProto2.NestedEnum._fromInt(reader.readEnum()); + break; + } + case 22: { + msg.requiredForeignEnum = ForeignEnumProto2._fromInt( + reader.readEnum() + ); + break; + } + case 24: { + msg.requiredStringPiece = reader.readString(); + break; + } + case 25: { + msg.requiredCord = reader.readString(); + break; + } + case 27: { + reader.readMessage( + msg.recursiveMessage, + TestAllRequiredTypesProto2._readMessage + ); + break; + } + case 28: { + reader.readMessage( + msg.optionalRecursiveMessage, + TestAllRequiredTypesProto2._readMessage + ); + break; + } + case 241: { + msg.defaultInt32 = reader.readInt32(); + break; + } + case 242: { + msg.defaultInt64 = BigInt(reader.readInt64String()); + break; + } + case 243: { + msg.defaultUint32 = reader.readUint32(); + break; + } + case 244: { + msg.defaultUint64 = BigInt(reader.readUint64String()); + break; + } + case 245: { + msg.defaultSint32 = reader.readSint32(); + break; + } + case 246: { + msg.defaultSint64 = BigInt(reader.readSint64String()); + break; + } + case 247: { + msg.defaultFixed32 = reader.readFixed32(); + break; + } + case 248: { + msg.defaultFixed64 = BigInt(reader.readFixed64String()); + break; + } + case 249: { + msg.defaultSfixed32 = reader.readSfixed32(); + break; + } + case 250: { + msg.defaultSfixed64 = BigInt(reader.readSfixed64String()); + break; + } + case 251: { + msg.defaultFloat = reader.readFloat(); + break; + } + case 252: { + msg.defaultDouble = reader.readDouble(); + break; + } + case 253: { + msg.defaultBool = reader.readBool(); + break; + } + case 254: { + msg.defaultString = reader.readString(); + break; + } + case 255: { + msg.defaultBytes = reader.readBytes(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + + NestedEnum: { + FOO: "FOO", + BAR: "BAR", + BAZ: "BAZ", + NEG: "NEG", + /** + * @private + */ + _fromInt: function (i: number): TestAllRequiredTypesProto2.NestedEnum { + switch (i) { + case 0: { + return "FOO"; + } + case 1: { + return "BAR"; + } + case 2: { + return "BAZ"; + } + case -1: { + return "NEG"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as TestAllRequiredTypesProto2.NestedEnum; + } + } + }, + /** + * @private + */ + _toInt: function (i: TestAllRequiredTypesProto2.NestedEnum): number { + switch (i) { + case "FOO": { + return 0; + } + case "BAR": { + return 1; + } + case "BAZ": { + return 2; + } + case "NEG": { + return -1; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, + } as const, + + NestedMessage: { + /** + * Serializes TestAllRequiredTypesProto2.NestedMessage to protobuf. + */ + encode: function ( + msg: Partial + ): Uint8Array { + return TestAllRequiredTypesProto2.NestedMessage._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes TestAllRequiredTypesProto2.NestedMessage from protobuf. + */ + decode: function ( + bytes: ByteSource + ): TestAllRequiredTypesProto2.NestedMessage { + return TestAllRequiredTypesProto2.NestedMessage._readMessage( + TestAllRequiredTypesProto2.NestedMessage.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes TestAllRequiredTypesProto2.NestedMessage with all fields set to their default value. + */ + initialize: function (): TestAllRequiredTypesProto2.NestedMessage { + return { + a: 0, + corecursive: undefined, + optionalCorecursive: undefined, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.a) { + writer.writeInt32(1, msg.a); + } + if (msg.corecursive) { + writer.writeMessage( + 2, + msg.corecursive, + TestAllRequiredTypesProto2._writeMessage + ); + } + if (msg.optionalCorecursive) { + writer.writeMessage( + 3, + msg.optionalCorecursive, + TestAllRequiredTypesProto2._writeMessage + ); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllRequiredTypesProto2.NestedMessage, + reader: BinaryReader + ): TestAllRequiredTypesProto2.NestedMessage { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.a = reader.readInt32(); + break; + } + case 2: { + reader.readMessage( + msg.corecursive, + TestAllRequiredTypesProto2._readMessage + ); + break; + } + case 3: { + reader.readMessage( + msg.optionalCorecursive, + TestAllRequiredTypesProto2._readMessage + ); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + Data: { + /** + * Serializes TestAllRequiredTypesProto2.Data to protobuf. + */ + encode: function ( + msg: Partial + ): Uint8Array { + return TestAllRequiredTypesProto2.Data._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes TestAllRequiredTypesProto2.Data from protobuf. + */ + decode: function (bytes: ByteSource): TestAllRequiredTypesProto2.Data { + return TestAllRequiredTypesProto2.Data._readMessage( + TestAllRequiredTypesProto2.Data.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes TestAllRequiredTypesProto2.Data with all fields set to their default value. + */ + initialize: function (): TestAllRequiredTypesProto2.Data { + return { + groupInt32: 0, + groupUint32: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.groupInt32) { + writer.writeInt32(202, msg.groupInt32); + } + if (msg.groupUint32) { + writer.writeUint32(203, msg.groupUint32); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllRequiredTypesProto2.Data, + reader: BinaryReader + ): TestAllRequiredTypesProto2.Data { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 202: { + msg.groupInt32 = reader.readInt32(); + break; + } + case 203: { + msg.groupUint32 = reader.readUint32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MessageSetCorrect: { + /** + * Serializes TestAllRequiredTypesProto2.MessageSetCorrect to protobuf. + */ + encode: function ( + _msg?: Partial + ): Uint8Array { + return new Uint8Array(); + }, + + /** + * Deserializes TestAllRequiredTypesProto2.MessageSetCorrect from protobuf. + */ + decode: function ( + _bytes?: ByteSource + ): TestAllRequiredTypesProto2.MessageSetCorrect { + return {}; + }, + + /** + * Initializes TestAllRequiredTypesProto2.MessageSetCorrect with all fields set to their default value. + */ + initialize: function (): TestAllRequiredTypesProto2.MessageSetCorrect { + return {}; + }, + + /** + * @private + */ + _writeMessage: function ( + _msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + _msg: TestAllRequiredTypesProto2.MessageSetCorrect, + _reader: BinaryReader + ): TestAllRequiredTypesProto2.MessageSetCorrect { + return _msg; + }, + }, + + MessageSetCorrectExtension1: { + /** + * Serializes TestAllRequiredTypesProto2.MessageSetCorrectExtension1 to protobuf. + */ + encode: function ( + msg: Partial + ): Uint8Array { + return TestAllRequiredTypesProto2.MessageSetCorrectExtension1._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes TestAllRequiredTypesProto2.MessageSetCorrectExtension1 from protobuf. + */ + decode: function ( + bytes: ByteSource + ): TestAllRequiredTypesProto2.MessageSetCorrectExtension1 { + return TestAllRequiredTypesProto2.MessageSetCorrectExtension1._readMessage( + TestAllRequiredTypesProto2.MessageSetCorrectExtension1.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes TestAllRequiredTypesProto2.MessageSetCorrectExtension1 with all fields set to their default value. + */ + initialize: + function (): TestAllRequiredTypesProto2.MessageSetCorrectExtension1 { + return { + str: "", + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.str) { + writer.writeString(25, msg.str); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllRequiredTypesProto2.MessageSetCorrectExtension1, + reader: BinaryReader + ): TestAllRequiredTypesProto2.MessageSetCorrectExtension1 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 25: { + msg.str = reader.readString(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MessageSetCorrectExtension2: { + /** + * Serializes TestAllRequiredTypesProto2.MessageSetCorrectExtension2 to protobuf. + */ + encode: function ( + msg: Partial + ): Uint8Array { + return TestAllRequiredTypesProto2.MessageSetCorrectExtension2._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes TestAllRequiredTypesProto2.MessageSetCorrectExtension2 from protobuf. + */ + decode: function ( + bytes: ByteSource + ): TestAllRequiredTypesProto2.MessageSetCorrectExtension2 { + return TestAllRequiredTypesProto2.MessageSetCorrectExtension2._readMessage( + TestAllRequiredTypesProto2.MessageSetCorrectExtension2.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes TestAllRequiredTypesProto2.MessageSetCorrectExtension2 with all fields set to their default value. + */ + initialize: + function (): TestAllRequiredTypesProto2.MessageSetCorrectExtension2 { + return { + i: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.i) { + writer.writeInt32(9, msg.i); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllRequiredTypesProto2.MessageSetCorrectExtension2, + reader: BinaryReader + ): TestAllRequiredTypesProto2.MessageSetCorrectExtension2 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 9: { + msg.i = reader.readInt32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, +}; + +//========================================// +// JSON Encode / Decode // +//========================================// + +export const ForeignEnumProto2JSON = { + FOREIGN_FOO: "FOREIGN_FOO", + FOREIGN_BAR: "FOREIGN_BAR", + FOREIGN_BAZ: "FOREIGN_BAZ", + /** + * @private + */ + _fromInt: function (i: number): ForeignEnumProto2 { + switch (i) { + case 0: { + return "FOREIGN_FOO"; + } + case 1: { + return "FOREIGN_BAR"; + } + case 2: { + return "FOREIGN_BAZ"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as ForeignEnumProto2; + } + } + }, + /** + * @private + */ + _toInt: function (i: ForeignEnumProto2): number { + switch (i) { + case "FOREIGN_FOO": { + return 0; + } + case "FOREIGN_BAR": { + return 1; + } + case "FOREIGN_BAZ": { + return 2; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, +} as const; + +export const TestAllTypesProto2JSON = { + /** + * Serializes TestAllTypesProto2 to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify(TestAllTypesProto2JSON._writeMessage(msg)); + }, + + /** + * Deserializes TestAllTypesProto2 from JSON. + */ + decode: function (json: string): TestAllTypesProto2 { + return TestAllTypesProto2JSON._readMessage( + TestAllTypesProto2JSON.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes TestAllTypesProto2 with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto2 { + return { + optionalInt32: 0, + optionalInt64: 0n, + optionalUint32: 0, + optionalUint64: 0n, + optionalSint32: 0, + optionalSint64: 0n, + optionalFixed32: 0, + optionalFixed64: 0n, + optionalSfixed32: 0, + optionalSfixed64: 0n, + optionalFloat: 0, + optionalDouble: 0, + optionalBool: false, + optionalString: "", + optionalBytes: new Uint8Array(), + optionalNestedMessage: TestAllTypesProto2JSON.NestedMessage.initialize(), + optionalForeignMessage: ForeignMessageProto2JSON.initialize(), + optionalNestedEnum: TestAllTypesProto2.NestedEnum._fromInt(0), + optionalForeignEnum: ForeignEnumProto2._fromInt(0), + optionalStringPiece: "", + optionalCord: "", + recursiveMessage: TestAllTypesProto2JSON.initialize(), + repeatedInt32: [], + repeatedInt64: [], + repeatedUint32: [], + repeatedUint64: [], + repeatedSint32: [], + repeatedSint64: [], + repeatedFixed32: [], + repeatedFixed64: [], + repeatedSfixed32: [], + repeatedSfixed64: [], + repeatedFloat: [], + repeatedDouble: [], + repeatedBool: [], + repeatedString: [], + repeatedBytes: [], + repeatedNestedMessage: [], + repeatedForeignMessage: [], + repeatedNestedEnum: [], + repeatedForeignEnum: [], + repeatedStringPiece: [], + repeatedCord: [], + packedInt32: [], + packedInt64: [], + packedUint32: [], + packedUint64: [], + packedSint32: [], + packedSint64: [], + packedFixed32: [], + packedFixed64: [], + packedSfixed32: [], + packedSfixed64: [], + packedFloat: [], + packedDouble: [], + packedBool: [], + packedNestedEnum: [], + unpackedInt32: [], + unpackedInt64: [], + unpackedUint32: [], + unpackedUint64: [], + unpackedSint32: [], + unpackedSint64: [], + unpackedFixed32: [], + unpackedFixed64: [], + unpackedSfixed32: [], + unpackedSfixed64: [], + unpackedFloat: [], + unpackedDouble: [], + unpackedBool: [], + unpackedNestedEnum: [], + mapInt32Int32: {}, + mapInt64Int64: {}, + mapUint32Uint32: {}, + mapUint64Uint64: {}, + mapSint32Sint32: {}, + mapSint64Sint64: {}, + mapFixed32Fixed32: {}, + mapFixed64Fixed64: {}, + mapSfixed32Sfixed32: {}, + mapSfixed64Sfixed64: {}, + mapInt32Float: {}, + mapInt32Double: {}, + mapBoolBool: {}, + mapStringString: {}, + mapStringBytes: {}, + mapStringNestedMessage: {}, + mapStringForeignMessage: {}, + mapStringNestedEnum: {}, + mapStringForeignEnum: {}, + oneofUint32: undefined, + oneofNestedMessage: undefined, + oneofString: undefined, + oneofBytes: undefined, + oneofBool: undefined, + oneofUint64: undefined, + oneofFloat: undefined, + oneofDouble: undefined, + oneofEnum: undefined, + defaultInt32: 0, + defaultInt64: 0n, + defaultUint32: 0, + defaultUint64: 0n, + defaultSint32: 0, + defaultSint64: 0n, + defaultFixed32: 0, + defaultFixed64: 0n, + defaultSfixed32: 0, + defaultSfixed64: 0n, + defaultFloat: 0, + defaultDouble: 0, + defaultBool: false, + defaultString: "", + defaultBytes: new Uint8Array(), + fieldname1: 0, + fieldName2: 0, + fieldName3: 0, + fieldName4: 0, + field0name5: 0, + field0Name6: 0, + fieldName7: 0, + FieldName8: 0, + fieldName9: 0, + FieldName10: 0, + FIELDNAME11: 0, + FIELDName12: 0, + fieldName13: 0, + FieldName14: 0, + fieldName15: 0, + fieldName16: 0, + fieldName17: 0, + FieldName18: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.optionalInt32) { + json["optionalInt32"] = msg.optionalInt32; + } + if (msg.optionalInt64) { + json["optionalInt64"] = msg.optionalInt64.toString(); + } + if (msg.optionalUint32) { + json["optionalUint32"] = msg.optionalUint32; + } + if (msg.optionalUint64) { + json["optionalUint64"] = msg.optionalUint64.toString(); + } + if (msg.optionalSint32) { + json["optionalSint32"] = msg.optionalSint32; + } + if (msg.optionalSint64) { + json["optionalSint64"] = msg.optionalSint64.toString(); + } + if (msg.optionalFixed32) { + json["optionalFixed32"] = msg.optionalFixed32; + } + if (msg.optionalFixed64) { + json["optionalFixed64"] = msg.optionalFixed64.toString(); + } + if (msg.optionalSfixed32) { + json["optionalSfixed32"] = msg.optionalSfixed32; + } + if (msg.optionalSfixed64) { + json["optionalSfixed64"] = msg.optionalSfixed64.toString(); + } + if (msg.optionalFloat) { + json["optionalFloat"] = msg.optionalFloat; + } + if (msg.optionalDouble) { + json["optionalDouble"] = msg.optionalDouble; + } + if (msg.optionalBool) { + json["optionalBool"] = msg.optionalBool; + } + if (msg.optionalString) { + json["optionalString"] = msg.optionalString; + } + if (msg.optionalBytes?.length) { + json["optionalBytes"] = encodeBase64Bytes(msg.optionalBytes); + } + if (msg.optionalNestedMessage) { + const _optionalNestedMessage_ = + TestAllTypesProto2JSON.NestedMessage._writeMessage( + msg.optionalNestedMessage + ); + if (Object.keys(_optionalNestedMessage_).length > 0) { + json["optionalNestedMessage"] = _optionalNestedMessage_; + } + } + if (msg.optionalForeignMessage) { + const _optionalForeignMessage_ = ForeignMessageProto2JSON._writeMessage( + msg.optionalForeignMessage + ); + if (Object.keys(_optionalForeignMessage_).length > 0) { + json["optionalForeignMessage"] = _optionalForeignMessage_; + } + } + if ( + msg.optionalNestedEnum && + TestAllTypesProto2JSON.NestedEnum._toInt(msg.optionalNestedEnum) + ) { + json["optionalNestedEnum"] = msg.optionalNestedEnum; + } + if ( + msg.optionalForeignEnum && + ForeignEnumProto2JSON._toInt(msg.optionalForeignEnum) + ) { + json["optionalForeignEnum"] = msg.optionalForeignEnum; + } + if (msg.optionalStringPiece) { + json["optionalStringPiece"] = msg.optionalStringPiece; + } + if (msg.optionalCord) { + json["optionalCord"] = msg.optionalCord; + } + if (msg.recursiveMessage) { + const _recursiveMessage_ = TestAllTypesProto2JSON._writeMessage( + msg.recursiveMessage + ); + if (Object.keys(_recursiveMessage_).length > 0) { + json["recursiveMessage"] = _recursiveMessage_; + } + } + if (msg.repeatedInt32?.length) { + json["repeatedInt32"] = msg.repeatedInt32; + } + if (msg.repeatedInt64?.length) { + json["repeatedInt64"] = msg.repeatedInt64.map((x) => x.toString()); + } + if (msg.repeatedUint32?.length) { + json["repeatedUint32"] = msg.repeatedUint32; + } + if (msg.repeatedUint64?.length) { + json["repeatedUint64"] = msg.repeatedUint64.map((x) => x.toString()); + } + if (msg.repeatedSint32?.length) { + json["repeatedSint32"] = msg.repeatedSint32; + } + if (msg.repeatedSint64?.length) { + json["repeatedSint64"] = msg.repeatedSint64.map((x) => x.toString()); + } + if (msg.repeatedFixed32?.length) { + json["repeatedFixed32"] = msg.repeatedFixed32; + } + if (msg.repeatedFixed64?.length) { + json["repeatedFixed64"] = msg.repeatedFixed64.map((x) => x.toString()); + } + if (msg.repeatedSfixed32?.length) { + json["repeatedSfixed32"] = msg.repeatedSfixed32; + } + if (msg.repeatedSfixed64?.length) { + json["repeatedSfixed64"] = msg.repeatedSfixed64.map((x) => x.toString()); + } + if (msg.repeatedFloat?.length) { + json["repeatedFloat"] = msg.repeatedFloat; + } + if (msg.repeatedDouble?.length) { + json["repeatedDouble"] = msg.repeatedDouble; + } + if (msg.repeatedBool?.length) { + json["repeatedBool"] = msg.repeatedBool; + } + if (msg.repeatedString?.length) { + json["repeatedString"] = msg.repeatedString; + } + if (msg.repeatedBytes?.length) { + json["repeatedBytes"] = msg.repeatedBytes.map(encodeBase64Bytes); + } + if (msg.repeatedNestedMessage?.length) { + json["repeatedNestedMessage"] = msg.repeatedNestedMessage.map( + TestAllTypesProto2JSON.NestedMessage._writeMessage + ); + } + if (msg.repeatedForeignMessage?.length) { + json["repeatedForeignMessage"] = msg.repeatedForeignMessage.map( + ForeignMessageProto2JSON._writeMessage + ); + } + if (msg.repeatedNestedEnum?.length) { + json["repeatedNestedEnum"] = msg.repeatedNestedEnum; + } + if (msg.repeatedForeignEnum?.length) { + json["repeatedForeignEnum"] = msg.repeatedForeignEnum; + } + if (msg.repeatedStringPiece?.length) { + json["repeatedStringPiece"] = msg.repeatedStringPiece; + } + if (msg.repeatedCord?.length) { + json["repeatedCord"] = msg.repeatedCord; + } + if (msg.packedInt32?.length) { + json["packedInt32"] = msg.packedInt32; + } + if (msg.packedInt64?.length) { + json["packedInt64"] = msg.packedInt64.map((x) => x.toString()); + } + if (msg.packedUint32?.length) { + json["packedUint32"] = msg.packedUint32; + } + if (msg.packedUint64?.length) { + json["packedUint64"] = msg.packedUint64.map((x) => x.toString()); + } + if (msg.packedSint32?.length) { + json["packedSint32"] = msg.packedSint32; + } + if (msg.packedSint64?.length) { + json["packedSint64"] = msg.packedSint64.map((x) => x.toString()); + } + if (msg.packedFixed32?.length) { + json["packedFixed32"] = msg.packedFixed32; + } + if (msg.packedFixed64?.length) { + json["packedFixed64"] = msg.packedFixed64.map((x) => x.toString()); + } + if (msg.packedSfixed32?.length) { + json["packedSfixed32"] = msg.packedSfixed32; + } + if (msg.packedSfixed64?.length) { + json["packedSfixed64"] = msg.packedSfixed64.map((x) => x.toString()); + } + if (msg.packedFloat?.length) { + json["packedFloat"] = msg.packedFloat; + } + if (msg.packedDouble?.length) { + json["packedDouble"] = msg.packedDouble; + } + if (msg.packedBool?.length) { + json["packedBool"] = msg.packedBool; + } + if (msg.packedNestedEnum?.length) { + json["packedNestedEnum"] = msg.packedNestedEnum; + } + if (msg.unpackedInt32?.length) { + json["unpackedInt32"] = msg.unpackedInt32; + } + if (msg.unpackedInt64?.length) { + json["unpackedInt64"] = msg.unpackedInt64.map((x) => x.toString()); + } + if (msg.unpackedUint32?.length) { + json["unpackedUint32"] = msg.unpackedUint32; + } + if (msg.unpackedUint64?.length) { + json["unpackedUint64"] = msg.unpackedUint64.map((x) => x.toString()); + } + if (msg.unpackedSint32?.length) { + json["unpackedSint32"] = msg.unpackedSint32; + } + if (msg.unpackedSint64?.length) { + json["unpackedSint64"] = msg.unpackedSint64.map((x) => x.toString()); + } + if (msg.unpackedFixed32?.length) { + json["unpackedFixed32"] = msg.unpackedFixed32; + } + if (msg.unpackedFixed64?.length) { + json["unpackedFixed64"] = msg.unpackedFixed64.map((x) => x.toString()); + } + if (msg.unpackedSfixed32?.length) { + json["unpackedSfixed32"] = msg.unpackedSfixed32; + } + if (msg.unpackedSfixed64?.length) { + json["unpackedSfixed64"] = msg.unpackedSfixed64.map((x) => x.toString()); + } + if (msg.unpackedFloat?.length) { + json["unpackedFloat"] = msg.unpackedFloat; + } + if (msg.unpackedDouble?.length) { + json["unpackedDouble"] = msg.unpackedDouble; + } + if (msg.unpackedBool?.length) { + json["unpackedBool"] = msg.unpackedBool; + } + if (msg.unpackedNestedEnum?.length) { + json["unpackedNestedEnum"] = msg.unpackedNestedEnum; + } + if (msg.mapInt32Int32) { + const _mapInt32Int32_ = Object.fromEntries( + Object.entries(msg.mapInt32Int32) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapInt32Int32._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapInt32Int32_).length > 0) { + json["mapInt32Int32"] = _mapInt32Int32_; + } + } + if (msg.mapInt64Int64) { + const _mapInt64Int64_ = Object.fromEntries( + Object.entries(msg.mapInt64Int64) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapInt64Int64._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapInt64Int64_).length > 0) { + json["mapInt64Int64"] = _mapInt64Int64_; + } + } + if (msg.mapUint32Uint32) { + const _mapUint32Uint32_ = Object.fromEntries( + Object.entries(msg.mapUint32Uint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapUint32Uint32._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapUint32Uint32_).length > 0) { + json["mapUint32Uint32"] = _mapUint32Uint32_; + } + } + if (msg.mapUint64Uint64) { + const _mapUint64Uint64_ = Object.fromEntries( + Object.entries(msg.mapUint64Uint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapUint64Uint64._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapUint64Uint64_).length > 0) { + json["mapUint64Uint64"] = _mapUint64Uint64_; + } + } + if (msg.mapSint32Sint32) { + const _mapSint32Sint32_ = Object.fromEntries( + Object.entries(msg.mapSint32Sint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapSint32Sint32._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapSint32Sint32_).length > 0) { + json["mapSint32Sint32"] = _mapSint32Sint32_; + } + } + if (msg.mapSint64Sint64) { + const _mapSint64Sint64_ = Object.fromEntries( + Object.entries(msg.mapSint64Sint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapSint64Sint64._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapSint64Sint64_).length > 0) { + json["mapSint64Sint64"] = _mapSint64Sint64_; + } + } + if (msg.mapFixed32Fixed32) { + const _mapFixed32Fixed32_ = Object.fromEntries( + Object.entries(msg.mapFixed32Fixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapFixed32Fixed32._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapFixed32Fixed32_).length > 0) { + json["mapFixed32Fixed32"] = _mapFixed32Fixed32_; + } + } + if (msg.mapFixed64Fixed64) { + const _mapFixed64Fixed64_ = Object.fromEntries( + Object.entries(msg.mapFixed64Fixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapFixed64Fixed64._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapFixed64Fixed64_).length > 0) { + json["mapFixed64Fixed64"] = _mapFixed64Fixed64_; + } + } + if (msg.mapSfixed32Sfixed32) { + const _mapSfixed32Sfixed32_ = Object.fromEntries( + Object.entries(msg.mapSfixed32Sfixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapSfixed32Sfixed32._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapSfixed32Sfixed32_).length > 0) { + json["mapSfixed32Sfixed32"] = _mapSfixed32Sfixed32_; + } + } + if (msg.mapSfixed64Sfixed64) { + const _mapSfixed64Sfixed64_ = Object.fromEntries( + Object.entries(msg.mapSfixed64Sfixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapSfixed64Sfixed64._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapSfixed64Sfixed64_).length > 0) { + json["mapSfixed64Sfixed64"] = _mapSfixed64Sfixed64_; + } + } + if (msg.mapInt32Float) { + const _mapInt32Float_ = Object.fromEntries( + Object.entries(msg.mapInt32Float) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapInt32Float._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapInt32Float_).length > 0) { + json["mapInt32Float"] = _mapInt32Float_; + } + } + if (msg.mapInt32Double) { + const _mapInt32Double_ = Object.fromEntries( + Object.entries(msg.mapInt32Double) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapInt32Double._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapInt32Double_).length > 0) { + json["mapInt32Double"] = _mapInt32Double_; + } + } + if (msg.mapBoolBool) { + const _mapBoolBool_ = Object.fromEntries( + Object.entries(msg.mapBoolBool) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapBoolBool._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapBoolBool_).length > 0) { + json["mapBoolBool"] = _mapBoolBool_; + } + } + if (msg.mapStringString) { + const _mapStringString_ = Object.fromEntries( + Object.entries(msg.mapStringString) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapStringString._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapStringString_).length > 0) { + json["mapStringString"] = _mapStringString_; + } + } + if (msg.mapStringBytes) { + const _mapStringBytes_ = Object.fromEntries( + Object.entries(msg.mapStringBytes) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapStringBytes._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapStringBytes_).length > 0) { + json["mapStringBytes"] = _mapStringBytes_; + } + } + if (msg.mapStringNestedMessage) { + const _mapStringNestedMessage_ = Object.fromEntries( + Object.entries(msg.mapStringNestedMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapStringNestedMessage._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapStringNestedMessage_).length > 0) { + json["mapStringNestedMessage"] = _mapStringNestedMessage_; + } + } + if (msg.mapStringForeignMessage) { + const _mapStringForeignMessage_ = Object.fromEntries( + Object.entries(msg.mapStringForeignMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapStringForeignMessage._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapStringForeignMessage_).length > 0) { + json["mapStringForeignMessage"] = _mapStringForeignMessage_; + } + } + if (msg.mapStringNestedEnum) { + const _mapStringNestedEnum_ = Object.fromEntries( + Object.entries(msg.mapStringNestedEnum) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapStringNestedEnum._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapStringNestedEnum_).length > 0) { + json["mapStringNestedEnum"] = _mapStringNestedEnum_; + } + } + if (msg.mapStringForeignEnum) { + const _mapStringForeignEnum_ = Object.fromEntries( + Object.entries(msg.mapStringForeignEnum) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapStringForeignEnum._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapStringForeignEnum_).length > 0) { + json["mapStringForeignEnum"] = _mapStringForeignEnum_; + } + } + if (msg.oneofUint32 != undefined) { + json["oneofUint32"] = msg.oneofUint32; + } + if (msg.oneofNestedMessage != undefined) { + const _oneofNestedMessage_ = + TestAllTypesProto2JSON.NestedMessage._writeMessage( + msg.oneofNestedMessage + ); + json["oneofNestedMessage"] = _oneofNestedMessage_; + } + if (msg.oneofString != undefined) { + json["oneofString"] = msg.oneofString; + } + if (msg.oneofBytes?.length) { + json["oneofBytes"] = encodeBase64Bytes(msg.oneofBytes); + } + if (msg.oneofBool != undefined) { + json["oneofBool"] = msg.oneofBool; + } + if (msg.oneofUint64 != undefined) { + json["oneofUint64"] = msg.oneofUint64.toString(); + } + if (msg.oneofFloat != undefined) { + json["oneofFloat"] = msg.oneofFloat; + } + if (msg.oneofDouble != undefined) { + json["oneofDouble"] = msg.oneofDouble; + } + if (msg.oneofEnum != undefined) { + json["oneofEnum"] = msg.oneofEnum; + } + if (msg.defaultInt32) { + json["defaultInt32"] = msg.defaultInt32; + } + if (msg.defaultInt64) { + json["defaultInt64"] = msg.defaultInt64.toString(); + } + if (msg.defaultUint32) { + json["defaultUint32"] = msg.defaultUint32; + } + if (msg.defaultUint64) { + json["defaultUint64"] = msg.defaultUint64.toString(); + } + if (msg.defaultSint32) { + json["defaultSint32"] = msg.defaultSint32; + } + if (msg.defaultSint64) { + json["defaultSint64"] = msg.defaultSint64.toString(); + } + if (msg.defaultFixed32) { + json["defaultFixed32"] = msg.defaultFixed32; + } + if (msg.defaultFixed64) { + json["defaultFixed64"] = msg.defaultFixed64.toString(); + } + if (msg.defaultSfixed32) { + json["defaultSfixed32"] = msg.defaultSfixed32; + } + if (msg.defaultSfixed64) { + json["defaultSfixed64"] = msg.defaultSfixed64.toString(); + } + if (msg.defaultFloat) { + json["defaultFloat"] = msg.defaultFloat; + } + if (msg.defaultDouble) { + json["defaultDouble"] = msg.defaultDouble; + } + if (msg.defaultBool) { + json["defaultBool"] = msg.defaultBool; + } + if (msg.defaultString) { + json["defaultString"] = msg.defaultString; + } + if (msg.defaultBytes?.length) { + json["defaultBytes"] = encodeBase64Bytes(msg.defaultBytes); + } + if (msg.fieldname1) { + json["fieldname1"] = msg.fieldname1; + } + if (msg.fieldName2) { + json["fieldName2"] = msg.fieldName2; + } + if (msg.fieldName3) { + json["FieldName3"] = msg.fieldName3; + } + if (msg.fieldName4) { + json["fieldName4"] = msg.fieldName4; + } + if (msg.field0name5) { + json["field0name5"] = msg.field0name5; + } + if (msg.field0Name6) { + json["field0Name6"] = msg.field0Name6; + } + if (msg.fieldName7) { + json["fieldName7"] = msg.fieldName7; + } + if (msg.FieldName8) { + json["FieldName8"] = msg.FieldName8; + } + if (msg.fieldName9) { + json["fieldName9"] = msg.fieldName9; + } + if (msg.FieldName10) { + json["FieldName10"] = msg.FieldName10; + } + if (msg.FIELDNAME11) { + json["FIELDNAME11"] = msg.FIELDNAME11; + } + if (msg.FIELDName12) { + json["FIELDName12"] = msg.FIELDName12; + } + if (msg.fieldName13) { + json["FieldName13"] = msg.fieldName13; + } + if (msg.FieldName14) { + json["FieldName14"] = msg.FieldName14; + } + if (msg.fieldName15) { + json["fieldName15"] = msg.fieldName15; + } + if (msg.fieldName16) { + json["fieldName16"] = msg.fieldName16; + } + if (msg.fieldName17) { + json["fieldName17"] = msg.fieldName17; + } + if (msg.FieldName18) { + json["FieldName18"] = msg.FieldName18; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2, + json: any + ): TestAllTypesProto2 { + const _optionalInt32_ = json["optionalInt32"] ?? json["optional_int32"]; + if (_optionalInt32_) { + msg.optionalInt32 = _optionalInt32_; + } + const _optionalInt64_ = json["optionalInt64"] ?? json["optional_int64"]; + if (_optionalInt64_) { + msg.optionalInt64 = BigInt(_optionalInt64_); + } + const _optionalUint32_ = json["optionalUint32"] ?? json["optional_uint32"]; + if (_optionalUint32_) { + msg.optionalUint32 = _optionalUint32_; + } + const _optionalUint64_ = json["optionalUint64"] ?? json["optional_uint64"]; + if (_optionalUint64_) { + msg.optionalUint64 = BigInt(_optionalUint64_); + } + const _optionalSint32_ = json["optionalSint32"] ?? json["optional_sint32"]; + if (_optionalSint32_) { + msg.optionalSint32 = _optionalSint32_; + } + const _optionalSint64_ = json["optionalSint64"] ?? json["optional_sint64"]; + if (_optionalSint64_) { + msg.optionalSint64 = BigInt(_optionalSint64_); + } + const _optionalFixed32_ = + json["optionalFixed32"] ?? json["optional_fixed32"]; + if (_optionalFixed32_) { + msg.optionalFixed32 = _optionalFixed32_; + } + const _optionalFixed64_ = + json["optionalFixed64"] ?? json["optional_fixed64"]; + if (_optionalFixed64_) { + msg.optionalFixed64 = BigInt(_optionalFixed64_); + } + const _optionalSfixed32_ = + json["optionalSfixed32"] ?? json["optional_sfixed32"]; + if (_optionalSfixed32_) { + msg.optionalSfixed32 = _optionalSfixed32_; + } + const _optionalSfixed64_ = + json["optionalSfixed64"] ?? json["optional_sfixed64"]; + if (_optionalSfixed64_) { + msg.optionalSfixed64 = BigInt(_optionalSfixed64_); + } + const _optionalFloat_ = json["optionalFloat"] ?? json["optional_float"]; + if (_optionalFloat_) { + msg.optionalFloat = _optionalFloat_; + } + const _optionalDouble_ = json["optionalDouble"] ?? json["optional_double"]; + if (_optionalDouble_) { + msg.optionalDouble = _optionalDouble_; + } + const _optionalBool_ = json["optionalBool"] ?? json["optional_bool"]; + if (_optionalBool_) { + msg.optionalBool = _optionalBool_; + } + const _optionalString_ = json["optionalString"] ?? json["optional_string"]; + if (_optionalString_) { + msg.optionalString = _optionalString_; + } + const _optionalBytes_ = json["optionalBytes"] ?? json["optional_bytes"]; + if (_optionalBytes_) { + msg.optionalBytes = decodeBase64Bytes(_optionalBytes_); + } + const _optionalNestedMessage_ = + json["optionalNestedMessage"] ?? json["optional_nested_message"]; + if (_optionalNestedMessage_) { + const m = TestAllTypesProto2JSON.NestedMessage.initialize(); + TestAllTypesProto2JSON.NestedMessage._readMessage( + m, + _optionalNestedMessage_ + ); + msg.optionalNestedMessage = m; + } + const _optionalForeignMessage_ = + json["optionalForeignMessage"] ?? json["optional_foreign_message"]; + if (_optionalForeignMessage_) { + const m = ForeignMessageProto2JSON.initialize(); + ForeignMessageProto2JSON._readMessage(m, _optionalForeignMessage_); + msg.optionalForeignMessage = m; + } + const _optionalNestedEnum_ = + json["optionalNestedEnum"] ?? json["optional_nested_enum"]; + if (_optionalNestedEnum_) { + msg.optionalNestedEnum = _optionalNestedEnum_; + } + const _optionalForeignEnum_ = + json["optionalForeignEnum"] ?? json["optional_foreign_enum"]; + if (_optionalForeignEnum_) { + msg.optionalForeignEnum = _optionalForeignEnum_; + } + const _optionalStringPiece_ = + json["optionalStringPiece"] ?? json["optional_string_piece"]; + if (_optionalStringPiece_) { + msg.optionalStringPiece = _optionalStringPiece_; + } + const _optionalCord_ = json["optionalCord"] ?? json["optional_cord"]; + if (_optionalCord_) { + msg.optionalCord = _optionalCord_; + } + const _recursiveMessage_ = + json["recursiveMessage"] ?? json["recursive_message"]; + if (_recursiveMessage_) { + const m = TestAllTypesProto2JSON.initialize(); + TestAllTypesProto2JSON._readMessage(m, _recursiveMessage_); + msg.recursiveMessage = m; + } + const _repeatedInt32_ = json["repeatedInt32"] ?? json["repeated_int32"]; + if (_repeatedInt32_) { + msg.repeatedInt32 = _repeatedInt32_; + } + const _repeatedInt64_ = json["repeatedInt64"] ?? json["repeated_int64"]; + if (_repeatedInt64_) { + msg.repeatedInt64 = _repeatedInt64_.map(BigInt); + } + const _repeatedUint32_ = json["repeatedUint32"] ?? json["repeated_uint32"]; + if (_repeatedUint32_) { + msg.repeatedUint32 = _repeatedUint32_; + } + const _repeatedUint64_ = json["repeatedUint64"] ?? json["repeated_uint64"]; + if (_repeatedUint64_) { + msg.repeatedUint64 = _repeatedUint64_.map(BigInt); + } + const _repeatedSint32_ = json["repeatedSint32"] ?? json["repeated_sint32"]; + if (_repeatedSint32_) { + msg.repeatedSint32 = _repeatedSint32_; + } + const _repeatedSint64_ = json["repeatedSint64"] ?? json["repeated_sint64"]; + if (_repeatedSint64_) { + msg.repeatedSint64 = _repeatedSint64_.map(BigInt); + } + const _repeatedFixed32_ = + json["repeatedFixed32"] ?? json["repeated_fixed32"]; + if (_repeatedFixed32_) { + msg.repeatedFixed32 = _repeatedFixed32_; + } + const _repeatedFixed64_ = + json["repeatedFixed64"] ?? json["repeated_fixed64"]; + if (_repeatedFixed64_) { + msg.repeatedFixed64 = _repeatedFixed64_.map(BigInt); + } + const _repeatedSfixed32_ = + json["repeatedSfixed32"] ?? json["repeated_sfixed32"]; + if (_repeatedSfixed32_) { + msg.repeatedSfixed32 = _repeatedSfixed32_; + } + const _repeatedSfixed64_ = + json["repeatedSfixed64"] ?? json["repeated_sfixed64"]; + if (_repeatedSfixed64_) { + msg.repeatedSfixed64 = _repeatedSfixed64_.map(BigInt); + } + const _repeatedFloat_ = json["repeatedFloat"] ?? json["repeated_float"]; + if (_repeatedFloat_) { + msg.repeatedFloat = _repeatedFloat_; + } + const _repeatedDouble_ = json["repeatedDouble"] ?? json["repeated_double"]; + if (_repeatedDouble_) { + msg.repeatedDouble = _repeatedDouble_; + } + const _repeatedBool_ = json["repeatedBool"] ?? json["repeated_bool"]; + if (_repeatedBool_) { + msg.repeatedBool = _repeatedBool_; + } + const _repeatedString_ = json["repeatedString"] ?? json["repeated_string"]; + if (_repeatedString_) { + msg.repeatedString = _repeatedString_; + } + const _repeatedBytes_ = json["repeatedBytes"] ?? json["repeated_bytes"]; + if (_repeatedBytes_) { + msg.repeatedBytes = _repeatedBytes_.map(decodeBase64Bytes); + } + const _repeatedNestedMessage_ = + json["repeatedNestedMessage"] ?? json["repeated_nested_message"]; + if (_repeatedNestedMessage_) { + for (const item of _repeatedNestedMessage_) { + const m = TestAllTypesProto2JSON.NestedMessage.initialize(); + TestAllTypesProto2JSON.NestedMessage._readMessage(m, item); + msg.repeatedNestedMessage.push(m); + } + } + const _repeatedForeignMessage_ = + json["repeatedForeignMessage"] ?? json["repeated_foreign_message"]; + if (_repeatedForeignMessage_) { + for (const item of _repeatedForeignMessage_) { + const m = ForeignMessageProto2JSON.initialize(); + ForeignMessageProto2JSON._readMessage(m, item); + msg.repeatedForeignMessage.push(m); + } + } + const _repeatedNestedEnum_ = + json["repeatedNestedEnum"] ?? json["repeated_nested_enum"]; + if (_repeatedNestedEnum_) { + msg.repeatedNestedEnum = _repeatedNestedEnum_; + } + const _repeatedForeignEnum_ = + json["repeatedForeignEnum"] ?? json["repeated_foreign_enum"]; + if (_repeatedForeignEnum_) { + msg.repeatedForeignEnum = _repeatedForeignEnum_; + } + const _repeatedStringPiece_ = + json["repeatedStringPiece"] ?? json["repeated_string_piece"]; + if (_repeatedStringPiece_) { + msg.repeatedStringPiece = _repeatedStringPiece_; + } + const _repeatedCord_ = json["repeatedCord"] ?? json["repeated_cord"]; + if (_repeatedCord_) { + msg.repeatedCord = _repeatedCord_; + } + const _packedInt32_ = json["packedInt32"] ?? json["packed_int32"]; + if (_packedInt32_) { + msg.packedInt32 = _packedInt32_; + } + const _packedInt64_ = json["packedInt64"] ?? json["packed_int64"]; + if (_packedInt64_) { + msg.packedInt64 = _packedInt64_.map(BigInt); + } + const _packedUint32_ = json["packedUint32"] ?? json["packed_uint32"]; + if (_packedUint32_) { + msg.packedUint32 = _packedUint32_; + } + const _packedUint64_ = json["packedUint64"] ?? json["packed_uint64"]; + if (_packedUint64_) { + msg.packedUint64 = _packedUint64_.map(BigInt); + } + const _packedSint32_ = json["packedSint32"] ?? json["packed_sint32"]; + if (_packedSint32_) { + msg.packedSint32 = _packedSint32_; + } + const _packedSint64_ = json["packedSint64"] ?? json["packed_sint64"]; + if (_packedSint64_) { + msg.packedSint64 = _packedSint64_.map(BigInt); + } + const _packedFixed32_ = json["packedFixed32"] ?? json["packed_fixed32"]; + if (_packedFixed32_) { + msg.packedFixed32 = _packedFixed32_; + } + const _packedFixed64_ = json["packedFixed64"] ?? json["packed_fixed64"]; + if (_packedFixed64_) { + msg.packedFixed64 = _packedFixed64_.map(BigInt); + } + const _packedSfixed32_ = json["packedSfixed32"] ?? json["packed_sfixed32"]; + if (_packedSfixed32_) { + msg.packedSfixed32 = _packedSfixed32_; + } + const _packedSfixed64_ = json["packedSfixed64"] ?? json["packed_sfixed64"]; + if (_packedSfixed64_) { + msg.packedSfixed64 = _packedSfixed64_.map(BigInt); + } + const _packedFloat_ = json["packedFloat"] ?? json["packed_float"]; + if (_packedFloat_) { + msg.packedFloat = _packedFloat_; + } + const _packedDouble_ = json["packedDouble"] ?? json["packed_double"]; + if (_packedDouble_) { + msg.packedDouble = _packedDouble_; + } + const _packedBool_ = json["packedBool"] ?? json["packed_bool"]; + if (_packedBool_) { + msg.packedBool = _packedBool_; + } + const _packedNestedEnum_ = + json["packedNestedEnum"] ?? json["packed_nested_enum"]; + if (_packedNestedEnum_) { + msg.packedNestedEnum = _packedNestedEnum_; + } + const _unpackedInt32_ = json["unpackedInt32"] ?? json["unpacked_int32"]; + if (_unpackedInt32_) { + msg.unpackedInt32 = _unpackedInt32_; + } + const _unpackedInt64_ = json["unpackedInt64"] ?? json["unpacked_int64"]; + if (_unpackedInt64_) { + msg.unpackedInt64 = _unpackedInt64_.map(BigInt); + } + const _unpackedUint32_ = json["unpackedUint32"] ?? json["unpacked_uint32"]; + if (_unpackedUint32_) { + msg.unpackedUint32 = _unpackedUint32_; + } + const _unpackedUint64_ = json["unpackedUint64"] ?? json["unpacked_uint64"]; + if (_unpackedUint64_) { + msg.unpackedUint64 = _unpackedUint64_.map(BigInt); + } + const _unpackedSint32_ = json["unpackedSint32"] ?? json["unpacked_sint32"]; + if (_unpackedSint32_) { + msg.unpackedSint32 = _unpackedSint32_; + } + const _unpackedSint64_ = json["unpackedSint64"] ?? json["unpacked_sint64"]; + if (_unpackedSint64_) { + msg.unpackedSint64 = _unpackedSint64_.map(BigInt); + } + const _unpackedFixed32_ = + json["unpackedFixed32"] ?? json["unpacked_fixed32"]; + if (_unpackedFixed32_) { + msg.unpackedFixed32 = _unpackedFixed32_; + } + const _unpackedFixed64_ = + json["unpackedFixed64"] ?? json["unpacked_fixed64"]; + if (_unpackedFixed64_) { + msg.unpackedFixed64 = _unpackedFixed64_.map(BigInt); + } + const _unpackedSfixed32_ = + json["unpackedSfixed32"] ?? json["unpacked_sfixed32"]; + if (_unpackedSfixed32_) { + msg.unpackedSfixed32 = _unpackedSfixed32_; + } + const _unpackedSfixed64_ = + json["unpackedSfixed64"] ?? json["unpacked_sfixed64"]; + if (_unpackedSfixed64_) { + msg.unpackedSfixed64 = _unpackedSfixed64_.map(BigInt); + } + const _unpackedFloat_ = json["unpackedFloat"] ?? json["unpacked_float"]; + if (_unpackedFloat_) { + msg.unpackedFloat = _unpackedFloat_; + } + const _unpackedDouble_ = json["unpackedDouble"] ?? json["unpacked_double"]; + if (_unpackedDouble_) { + msg.unpackedDouble = _unpackedDouble_; + } + const _unpackedBool_ = json["unpackedBool"] ?? json["unpacked_bool"]; + if (_unpackedBool_) { + msg.unpackedBool = _unpackedBool_; + } + const _unpackedNestedEnum_ = + json["unpackedNestedEnum"] ?? json["unpacked_nested_enum"]; + if (_unpackedNestedEnum_) { + msg.unpackedNestedEnum = _unpackedNestedEnum_; + } + const _mapInt32Int32_ = json["mapInt32Int32"] ?? json["map_int32_int32"]; + if (_mapInt32Int32_) { + msg.mapInt32Int32 = Object.fromEntries( + Object.entries(_mapInt32Int32_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapInt32Int32._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapInt64Int64_ = json["mapInt64Int64"] ?? json["map_int64_int64"]; + if (_mapInt64Int64_) { + msg.mapInt64Int64 = Object.fromEntries( + Object.entries(_mapInt64Int64_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapInt64Int64._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapUint32Uint32_ = + json["mapUint32Uint32"] ?? json["map_uint32_uint32"]; + if (_mapUint32Uint32_) { + msg.mapUint32Uint32 = Object.fromEntries( + Object.entries(_mapUint32Uint32_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapUint32Uint32._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapUint64Uint64_ = + json["mapUint64Uint64"] ?? json["map_uint64_uint64"]; + if (_mapUint64Uint64_) { + msg.mapUint64Uint64 = Object.fromEntries( + Object.entries(_mapUint64Uint64_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapUint64Uint64._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapSint32Sint32_ = + json["mapSint32Sint32"] ?? json["map_sint32_sint32"]; + if (_mapSint32Sint32_) { + msg.mapSint32Sint32 = Object.fromEntries( + Object.entries(_mapSint32Sint32_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapSint32Sint32._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapSint64Sint64_ = + json["mapSint64Sint64"] ?? json["map_sint64_sint64"]; + if (_mapSint64Sint64_) { + msg.mapSint64Sint64 = Object.fromEntries( + Object.entries(_mapSint64Sint64_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapSint64Sint64._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapFixed32Fixed32_ = + json["mapFixed32Fixed32"] ?? json["map_fixed32_fixed32"]; + if (_mapFixed32Fixed32_) { + msg.mapFixed32Fixed32 = Object.fromEntries( + Object.entries(_mapFixed32Fixed32_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapFixed32Fixed32._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapFixed64Fixed64_ = + json["mapFixed64Fixed64"] ?? json["map_fixed64_fixed64"]; + if (_mapFixed64Fixed64_) { + msg.mapFixed64Fixed64 = Object.fromEntries( + Object.entries(_mapFixed64Fixed64_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapFixed64Fixed64._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapSfixed32Sfixed32_ = + json["mapSfixed32Sfixed32"] ?? json["map_sfixed32_sfixed32"]; + if (_mapSfixed32Sfixed32_) { + msg.mapSfixed32Sfixed32 = Object.fromEntries( + Object.entries(_mapSfixed32Sfixed32_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapSfixed32Sfixed32._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapSfixed64Sfixed64_ = + json["mapSfixed64Sfixed64"] ?? json["map_sfixed64_sfixed64"]; + if (_mapSfixed64Sfixed64_) { + msg.mapSfixed64Sfixed64 = Object.fromEntries( + Object.entries(_mapSfixed64Sfixed64_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapSfixed64Sfixed64._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapInt32Float_ = json["mapInt32Float"] ?? json["map_int32_float"]; + if (_mapInt32Float_) { + msg.mapInt32Float = Object.fromEntries( + Object.entries(_mapInt32Float_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapInt32Float._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapInt32Double_ = json["mapInt32Double"] ?? json["map_int32_double"]; + if (_mapInt32Double_) { + msg.mapInt32Double = Object.fromEntries( + Object.entries(_mapInt32Double_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapInt32Double._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapBoolBool_ = json["mapBoolBool"] ?? json["map_bool_bool"]; + if (_mapBoolBool_) { + msg.mapBoolBool = Object.fromEntries( + Object.entries(_mapBoolBool_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapBoolBool._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapStringString_ = + json["mapStringString"] ?? json["map_string_string"]; + if (_mapStringString_) { + msg.mapStringString = Object.fromEntries( + Object.entries(_mapStringString_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapStringString._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapStringBytes_ = json["mapStringBytes"] ?? json["map_string_bytes"]; + if (_mapStringBytes_) { + msg.mapStringBytes = Object.fromEntries( + Object.entries(_mapStringBytes_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapStringBytes._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapStringNestedMessage_ = + json["mapStringNestedMessage"] ?? json["map_string_nested_message"]; + if (_mapStringNestedMessage_) { + msg.mapStringNestedMessage = Object.fromEntries( + Object.entries(_mapStringNestedMessage_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapStringNestedMessage._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapStringForeignMessage_ = + json["mapStringForeignMessage"] ?? json["map_string_foreign_message"]; + if (_mapStringForeignMessage_) { + msg.mapStringForeignMessage = Object.fromEntries( + Object.entries(_mapStringForeignMessage_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapStringForeignMessage._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapStringNestedEnum_ = + json["mapStringNestedEnum"] ?? json["map_string_nested_enum"]; + if (_mapStringNestedEnum_) { + msg.mapStringNestedEnum = Object.fromEntries( + Object.entries(_mapStringNestedEnum_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapStringNestedEnum._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapStringForeignEnum_ = + json["mapStringForeignEnum"] ?? json["map_string_foreign_enum"]; + if (_mapStringForeignEnum_) { + msg.mapStringForeignEnum = Object.fromEntries( + Object.entries(_mapStringForeignEnum_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto2JSON.MapStringForeignEnum._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _oneofUint32_ = json["oneofUint32"] ?? json["oneof_uint32"]; + if (_oneofUint32_) { + msg.oneofUint32 = _oneofUint32_; + } + const _oneofNestedMessage_ = + json["oneofNestedMessage"] ?? json["oneof_nested_message"]; + if (_oneofNestedMessage_) { + const m = TestAllTypesProto2JSON.NestedMessage.initialize(); + TestAllTypesProto2JSON.NestedMessage._readMessage( + m, + _oneofNestedMessage_ + ); + msg.oneofNestedMessage = m; + } + const _oneofString_ = json["oneofString"] ?? json["oneof_string"]; + if (_oneofString_) { + msg.oneofString = _oneofString_; + } + const _oneofBytes_ = json["oneofBytes"] ?? json["oneof_bytes"]; + if (_oneofBytes_) { + msg.oneofBytes = decodeBase64Bytes(_oneofBytes_); + } + const _oneofBool_ = json["oneofBool"] ?? json["oneof_bool"]; + if (_oneofBool_) { + msg.oneofBool = _oneofBool_; + } + const _oneofUint64_ = json["oneofUint64"] ?? json["oneof_uint64"]; + if (_oneofUint64_) { + msg.oneofUint64 = BigInt(_oneofUint64_); + } + const _oneofFloat_ = json["oneofFloat"] ?? json["oneof_float"]; + if (_oneofFloat_) { + msg.oneofFloat = _oneofFloat_; + } + const _oneofDouble_ = json["oneofDouble"] ?? json["oneof_double"]; + if (_oneofDouble_) { + msg.oneofDouble = _oneofDouble_; + } + const _oneofEnum_ = json["oneofEnum"] ?? json["oneof_enum"]; + if (_oneofEnum_) { + msg.oneofEnum = _oneofEnum_; + } + const _defaultInt32_ = json["defaultInt32"] ?? json["default_int32"]; + if (_defaultInt32_) { + msg.defaultInt32 = _defaultInt32_; + } + const _defaultInt64_ = json["defaultInt64"] ?? json["default_int64"]; + if (_defaultInt64_) { + msg.defaultInt64 = BigInt(_defaultInt64_); + } + const _defaultUint32_ = json["defaultUint32"] ?? json["default_uint32"]; + if (_defaultUint32_) { + msg.defaultUint32 = _defaultUint32_; + } + const _defaultUint64_ = json["defaultUint64"] ?? json["default_uint64"]; + if (_defaultUint64_) { + msg.defaultUint64 = BigInt(_defaultUint64_); + } + const _defaultSint32_ = json["defaultSint32"] ?? json["default_sint32"]; + if (_defaultSint32_) { + msg.defaultSint32 = _defaultSint32_; + } + const _defaultSint64_ = json["defaultSint64"] ?? json["default_sint64"]; + if (_defaultSint64_) { + msg.defaultSint64 = BigInt(_defaultSint64_); + } + const _defaultFixed32_ = json["defaultFixed32"] ?? json["default_fixed32"]; + if (_defaultFixed32_) { + msg.defaultFixed32 = _defaultFixed32_; + } + const _defaultFixed64_ = json["defaultFixed64"] ?? json["default_fixed64"]; + if (_defaultFixed64_) { + msg.defaultFixed64 = BigInt(_defaultFixed64_); + } + const _defaultSfixed32_ = + json["defaultSfixed32"] ?? json["default_sfixed32"]; + if (_defaultSfixed32_) { + msg.defaultSfixed32 = _defaultSfixed32_; + } + const _defaultSfixed64_ = + json["defaultSfixed64"] ?? json["default_sfixed64"]; + if (_defaultSfixed64_) { + msg.defaultSfixed64 = BigInt(_defaultSfixed64_); + } + const _defaultFloat_ = json["defaultFloat"] ?? json["default_float"]; + if (_defaultFloat_) { + msg.defaultFloat = _defaultFloat_; + } + const _defaultDouble_ = json["defaultDouble"] ?? json["default_double"]; + if (_defaultDouble_) { + msg.defaultDouble = _defaultDouble_; + } + const _defaultBool_ = json["defaultBool"] ?? json["default_bool"]; + if (_defaultBool_) { + msg.defaultBool = _defaultBool_; + } + const _defaultString_ = json["defaultString"] ?? json["default_string"]; + if (_defaultString_) { + msg.defaultString = _defaultString_; + } + const _defaultBytes_ = json["defaultBytes"] ?? json["default_bytes"]; + if (_defaultBytes_) { + msg.defaultBytes = decodeBase64Bytes(_defaultBytes_); + } + const _fieldname1_ = json["fieldname1"]; + if (_fieldname1_) { + msg.fieldname1 = _fieldname1_; + } + const _fieldName2_ = json["fieldName2"] ?? json["field_name2"]; + if (_fieldName2_) { + msg.fieldName2 = _fieldName2_; + } + const _fieldName3_ = + json["FieldName3"] ?? json["fieldName3"] ?? json["_field_name3"]; + if (_fieldName3_) { + msg.fieldName3 = _fieldName3_; + } + const _fieldName4_ = json["fieldName4"] ?? json["field__name4_"]; + if (_fieldName4_) { + msg.fieldName4 = _fieldName4_; + } + const _field0name5_ = json["field0name5"]; + if (_field0name5_) { + msg.field0name5 = _field0name5_; + } + const _field0Name6_ = json["field0Name6"] ?? json["field_0_name6"]; + if (_field0Name6_) { + msg.field0Name6 = _field0Name6_; + } + const _fieldName7_ = json["fieldName7"]; + if (_fieldName7_) { + msg.fieldName7 = _fieldName7_; + } + const _FieldName8_ = json["FieldName8"]; + if (_FieldName8_) { + msg.FieldName8 = _FieldName8_; + } + const _fieldName9_ = json["fieldName9"] ?? json["field_Name9"]; + if (_fieldName9_) { + msg.fieldName9 = _fieldName9_; + } + const _FieldName10_ = json["FieldName10"] ?? json["Field_Name10"]; + if (_FieldName10_) { + msg.FieldName10 = _FieldName10_; + } + const _FIELDNAME11_ = json["FIELDNAME11"] ?? json["FIELD_NAME11"]; + if (_FIELDNAME11_) { + msg.FIELDNAME11 = _FIELDNAME11_; + } + const _FIELDName12_ = json["FIELDName12"] ?? json["FIELD_name12"]; + if (_FIELDName12_) { + msg.FIELDName12 = _FIELDName12_; + } + const _fieldName13_ = + json["FieldName13"] ?? json["fieldName13"] ?? json["__field_name13"]; + if (_fieldName13_) { + msg.fieldName13 = _fieldName13_; + } + const _FieldName14_ = json["FieldName14"] ?? json["__Field_name14"]; + if (_FieldName14_) { + msg.FieldName14 = _FieldName14_; + } + const _fieldName15_ = json["fieldName15"] ?? json["field__name15"]; + if (_fieldName15_) { + msg.fieldName15 = _fieldName15_; + } + const _fieldName16_ = json["fieldName16"] ?? json["field__Name16"]; + if (_fieldName16_) { + msg.fieldName16 = _fieldName16_; + } + const _fieldName17_ = json["fieldName17"] ?? json["field_name17__"]; + if (_fieldName17_) { + msg.fieldName17 = _fieldName17_; + } + const _FieldName18_ = json["FieldName18"] ?? json["Field_name18__"]; + if (_FieldName18_) { + msg.FieldName18 = _FieldName18_; + } + return msg; + }, + + NestedEnum: { + FOO: "FOO", + BAR: "BAR", + BAZ: "BAZ", + NEG: "NEG", + /** + * @private + */ + _fromInt: function (i: number): TestAllTypesProto2.NestedEnum { + switch (i) { + case 0: { + return "FOO"; + } + case 1: { + return "BAR"; + } + case 2: { + return "BAZ"; + } + case -1: { + return "NEG"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as TestAllTypesProto2.NestedEnum; + } + } + }, + /** + * @private + */ + _toInt: function (i: TestAllTypesProto2.NestedEnum): number { + switch (i) { + case "FOO": { + return 0; + } + case "BAR": { + return 1; + } + case "BAZ": { + return 2; + } + case "NEG": { + return -1; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, + } as const, + + NestedMessage: { + /** + * Serializes TestAllTypesProto2.NestedMessage to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify( + TestAllTypesProto2JSON.NestedMessage._writeMessage(msg) + ); + }, + + /** + * Deserializes TestAllTypesProto2.NestedMessage from JSON. + */ + decode: function (json: string): TestAllTypesProto2.NestedMessage { + return TestAllTypesProto2JSON.NestedMessage._readMessage( + TestAllTypesProto2JSON.NestedMessage.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes TestAllTypesProto2.NestedMessage with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto2.NestedMessage { + return { + a: 0, + corecursive: TestAllTypesProto2JSON.initialize(), + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.a) { + json["a"] = msg.a; + } + if (msg.corecursive) { + const _corecursive_ = TestAllTypesProto2JSON._writeMessage( + msg.corecursive + ); + if (Object.keys(_corecursive_).length > 0) { + json["corecursive"] = _corecursive_; + } + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.NestedMessage, + json: any + ): TestAllTypesProto2.NestedMessage { + const _a_ = json["a"]; + if (_a_) { + msg.a = _a_; + } + const _corecursive_ = json["corecursive"]; + if (_corecursive_) { + const m = TestAllTypesProto2JSON.initialize(); + TestAllTypesProto2JSON._readMessage(m, _corecursive_); + msg.corecursive = m; + } + return msg; + }, + }, + + MapInt32Int32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapInt32Int32, + json: any + ): TestAllTypesProto2.MapInt32Int32 { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapInt64Int64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key.toString(); + } + if (msg.value) { + json["value"] = msg.value.toString(); + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapInt64Int64, + json: any + ): TestAllTypesProto2.MapInt64Int64 { + const _key_ = json["key"]; + if (_key_) { + msg.key = BigInt(_key_); + } + const _value_ = json["value"]; + if (_value_) { + msg.value = BigInt(_value_); + } + return msg; + }, + }, + + MapUint32Uint32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapUint32Uint32, + json: any + ): TestAllTypesProto2.MapUint32Uint32 { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapUint64Uint64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key.toString(); + } + if (msg.value) { + json["value"] = msg.value.toString(); + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapUint64Uint64, + json: any + ): TestAllTypesProto2.MapUint64Uint64 { + const _key_ = json["key"]; + if (_key_) { + msg.key = BigInt(_key_); + } + const _value_ = json["value"]; + if (_value_) { + msg.value = BigInt(_value_); + } + return msg; + }, + }, + + MapSint32Sint32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapSint32Sint32, + json: any + ): TestAllTypesProto2.MapSint32Sint32 { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapSint64Sint64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key.toString(); + } + if (msg.value) { + json["value"] = msg.value.toString(); + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapSint64Sint64, + json: any + ): TestAllTypesProto2.MapSint64Sint64 { + const _key_ = json["key"]; + if (_key_) { + msg.key = BigInt(_key_); + } + const _value_ = json["value"]; + if (_value_) { + msg.value = BigInt(_value_); + } + return msg; + }, + }, + + MapFixed32Fixed32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapFixed32Fixed32, + json: any + ): TestAllTypesProto2.MapFixed32Fixed32 { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapFixed64Fixed64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key.toString(); + } + if (msg.value) { + json["value"] = msg.value.toString(); + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapFixed64Fixed64, + json: any + ): TestAllTypesProto2.MapFixed64Fixed64 { + const _key_ = json["key"]; + if (_key_) { + msg.key = BigInt(_key_); + } + const _value_ = json["value"]; + if (_value_) { + msg.value = BigInt(_value_); + } + return msg; + }, + }, + + MapSfixed32Sfixed32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapSfixed32Sfixed32, + json: any + ): TestAllTypesProto2.MapSfixed32Sfixed32 { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapSfixed64Sfixed64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key.toString(); + } + if (msg.value) { + json["value"] = msg.value.toString(); + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapSfixed64Sfixed64, + json: any + ): TestAllTypesProto2.MapSfixed64Sfixed64 { + const _key_ = json["key"]; + if (_key_) { + msg.key = BigInt(_key_); + } + const _value_ = json["value"]; + if (_value_) { + msg.value = BigInt(_value_); + } + return msg; + }, + }, + + MapInt32Float: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapInt32Float, + json: any + ): TestAllTypesProto2.MapInt32Float { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapInt32Double: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapInt32Double, + json: any + ): TestAllTypesProto2.MapInt32Double { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapBoolBool: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapBoolBool, + json: any + ): TestAllTypesProto2.MapBoolBool { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapStringString: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapStringString, + json: any + ): TestAllTypesProto2.MapStringString { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapStringBytes: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value?.length) { + json["value"] = encodeBase64Bytes(msg.value); + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapStringBytes, + json: any + ): TestAllTypesProto2.MapStringBytes { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = decodeBase64Bytes(_value_); + } + return msg; + }, + }, + + MapStringNestedMessage: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + const _value_ = TestAllTypesProto2JSON.NestedMessage._writeMessage( + msg.value + ); + if (Object.keys(_value_).length > 0) { + json["value"] = _value_; + } + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapStringNestedMessage, + json: any + ): TestAllTypesProto2.MapStringNestedMessage { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + const m = TestAllTypesProto2JSON.NestedMessage.initialize(); + TestAllTypesProto2JSON.NestedMessage._readMessage(m, _value_); + msg.value = m; + } + return msg; + }, + }, + + MapStringForeignMessage: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + const _value_ = ForeignMessageProto2JSON._writeMessage(msg.value); + if (Object.keys(_value_).length > 0) { + json["value"] = _value_; + } + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapStringForeignMessage, + json: any + ): TestAllTypesProto2.MapStringForeignMessage { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + const m = ForeignMessageProto2JSON.initialize(); + ForeignMessageProto2JSON._readMessage(m, _value_); + msg.value = m; + } + return msg; + }, + }, + + MapStringNestedEnum: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value && TestAllTypesProto2JSON.NestedEnum._toInt(msg.value)) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapStringNestedEnum, + json: any + ): TestAllTypesProto2.MapStringNestedEnum { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapStringForeignEnum: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value && ForeignEnumProto2JSON._toInt(msg.value)) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MapStringForeignEnum, + json: any + ): TestAllTypesProto2.MapStringForeignEnum { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + Data: { + /** + * Serializes TestAllTypesProto2.Data to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify(TestAllTypesProto2JSON.Data._writeMessage(msg)); + }, + + /** + * Deserializes TestAllTypesProto2.Data from JSON. + */ + decode: function (json: string): TestAllTypesProto2.Data { + return TestAllTypesProto2JSON.Data._readMessage( + TestAllTypesProto2JSON.Data.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes TestAllTypesProto2.Data with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto2.Data { + return { + groupInt32: 0, + groupUint32: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.groupInt32) { + json["groupInt32"] = msg.groupInt32; + } + if (msg.groupUint32) { + json["groupUint32"] = msg.groupUint32; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.Data, + json: any + ): TestAllTypesProto2.Data { + const _groupInt32_ = json["groupInt32"] ?? json["group_int32"]; + if (_groupInt32_) { + msg.groupInt32 = _groupInt32_; + } + const _groupUint32_ = json["groupUint32"] ?? json["group_uint32"]; + if (_groupUint32_) { + msg.groupUint32 = _groupUint32_; + } + return msg; + }, + }, + + MessageSetCorrect: { + /** + * Serializes TestAllTypesProto2.MessageSetCorrect to JSON. + */ + encode: function ( + _msg?: Partial + ): string { + return "{}"; + }, + + /** + * Deserializes TestAllTypesProto2.MessageSetCorrect from JSON. + */ + decode: function (_json?: string): TestAllTypesProto2.MessageSetCorrect { + return {}; + }, + + /** + * Initializes TestAllTypesProto2.MessageSetCorrect with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto2.MessageSetCorrect { + return {}; + }, + + /** + * @private + */ + _writeMessage: function ( + _msg: Partial + ): Record { + return {}; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MessageSetCorrect, + _json: any + ): TestAllTypesProto2.MessageSetCorrect { + return msg; + }, + }, + + MessageSetCorrectExtension1: { + /** + * Serializes TestAllTypesProto2.MessageSetCorrectExtension1 to JSON. + */ + encode: function ( + msg: Partial + ): string { + return JSON.stringify( + TestAllTypesProto2JSON.MessageSetCorrectExtension1._writeMessage(msg) + ); + }, + + /** + * Deserializes TestAllTypesProto2.MessageSetCorrectExtension1 from JSON. + */ + decode: function ( + json: string + ): TestAllTypesProto2.MessageSetCorrectExtension1 { + return TestAllTypesProto2JSON.MessageSetCorrectExtension1._readMessage( + TestAllTypesProto2JSON.MessageSetCorrectExtension1.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes TestAllTypesProto2.MessageSetCorrectExtension1 with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto2.MessageSetCorrectExtension1 { + return { + str: "", + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.str) { + json["str"] = msg.str; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MessageSetCorrectExtension1, + json: any + ): TestAllTypesProto2.MessageSetCorrectExtension1 { + const _str_ = json["str"]; + if (_str_) { + msg.str = _str_; + } + return msg; + }, + }, + + MessageSetCorrectExtension2: { + /** + * Serializes TestAllTypesProto2.MessageSetCorrectExtension2 to JSON. + */ + encode: function ( + msg: Partial + ): string { + return JSON.stringify( + TestAllTypesProto2JSON.MessageSetCorrectExtension2._writeMessage(msg) + ); + }, + + /** + * Deserializes TestAllTypesProto2.MessageSetCorrectExtension2 from JSON. + */ + decode: function ( + json: string + ): TestAllTypesProto2.MessageSetCorrectExtension2 { + return TestAllTypesProto2JSON.MessageSetCorrectExtension2._readMessage( + TestAllTypesProto2JSON.MessageSetCorrectExtension2.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes TestAllTypesProto2.MessageSetCorrectExtension2 with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto2.MessageSetCorrectExtension2 { + return { + i: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.i) { + json["i"] = msg.i; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto2.MessageSetCorrectExtension2, + json: any + ): TestAllTypesProto2.MessageSetCorrectExtension2 { + const _i_ = json["i"]; + if (_i_) { + msg.i = _i_; + } + return msg; + }, + }, +}; + +export const ForeignMessageProto2JSON = { + /** + * Serializes ForeignMessageProto2 to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify(ForeignMessageProto2JSON._writeMessage(msg)); + }, + + /** + * Deserializes ForeignMessageProto2 from JSON. + */ + decode: function (json: string): ForeignMessageProto2 { + return ForeignMessageProto2JSON._readMessage( + ForeignMessageProto2JSON.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes ForeignMessageProto2 with all fields set to their default value. + */ + initialize: function (): ForeignMessageProto2 { + return { + c: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.c) { + json["c"] = msg.c; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: ForeignMessageProto2, + json: any + ): ForeignMessageProto2 { + const _c_ = json["c"]; + if (_c_) { + msg.c = _c_; + } + return msg; + }, +}; + +export const UnknownToTestAllTypesJSON = { + /** + * Serializes UnknownToTestAllTypes to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify(UnknownToTestAllTypesJSON._writeMessage(msg)); + }, + + /** + * Deserializes UnknownToTestAllTypes from JSON. + */ + decode: function (json: string): UnknownToTestAllTypes { + return UnknownToTestAllTypesJSON._readMessage( + UnknownToTestAllTypesJSON.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes UnknownToTestAllTypes with all fields set to their default value. + */ + initialize: function (): UnknownToTestAllTypes { + return { + optionalInt32: 0, + optionalString: "", + nestedMessage: ForeignMessageProto2JSON.initialize(), + optionalBool: false, + repeatedInt32: [], + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.optionalInt32) { + json["optionalInt32"] = msg.optionalInt32; + } + if (msg.optionalString) { + json["optionalString"] = msg.optionalString; + } + if (msg.nestedMessage) { + const _nestedMessage_ = ForeignMessageProto2JSON._writeMessage( + msg.nestedMessage + ); + if (Object.keys(_nestedMessage_).length > 0) { + json["nestedMessage"] = _nestedMessage_; + } + } + if (msg.optionalBool) { + json["optionalBool"] = msg.optionalBool; + } + if (msg.repeatedInt32?.length) { + json["repeatedInt32"] = msg.repeatedInt32; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: UnknownToTestAllTypes, + json: any + ): UnknownToTestAllTypes { + const _optionalInt32_ = json["optionalInt32"] ?? json["optional_int32"]; + if (_optionalInt32_) { + msg.optionalInt32 = _optionalInt32_; + } + const _optionalString_ = json["optionalString"] ?? json["optional_string"]; + if (_optionalString_) { + msg.optionalString = _optionalString_; + } + const _nestedMessage_ = json["nestedMessage"] ?? json["nested_message"]; + if (_nestedMessage_) { + const m = ForeignMessageProto2JSON.initialize(); + ForeignMessageProto2JSON._readMessage(m, _nestedMessage_); + msg.nestedMessage = m; + } + const _optionalBool_ = json["optionalBool"] ?? json["optional_bool"]; + if (_optionalBool_) { + msg.optionalBool = _optionalBool_; + } + const _repeatedInt32_ = json["repeatedInt32"] ?? json["repeated_int32"]; + if (_repeatedInt32_) { + msg.repeatedInt32 = _repeatedInt32_; + } + return msg; + }, + + OptionalGroup: { + /** + * Serializes UnknownToTestAllTypes.OptionalGroup to JSON. + */ + encode: function ( + msg: Partial + ): string { + return JSON.stringify( + UnknownToTestAllTypesJSON.OptionalGroup._writeMessage(msg) + ); + }, + + /** + * Deserializes UnknownToTestAllTypes.OptionalGroup from JSON. + */ + decode: function (json: string): UnknownToTestAllTypes.OptionalGroup { + return UnknownToTestAllTypesJSON.OptionalGroup._readMessage( + UnknownToTestAllTypesJSON.OptionalGroup.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes UnknownToTestAllTypes.OptionalGroup with all fields set to their default value. + */ + initialize: function (): UnknownToTestAllTypes.OptionalGroup { + return { + a: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.a) { + json["a"] = msg.a; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: UnknownToTestAllTypes.OptionalGroup, + json: any + ): UnknownToTestAllTypes.OptionalGroup { + const _a_ = json["a"]; + if (_a_) { + msg.a = _a_; + } + return msg; + }, + }, +}; + +export const NullHypothesisProto2JSON = { + /** + * Serializes NullHypothesisProto2 to JSON. + */ + encode: function (_msg?: Partial): string { + return "{}"; + }, + + /** + * Deserializes NullHypothesisProto2 from JSON. + */ + decode: function (_json?: string): NullHypothesisProto2 { + return {}; + }, + + /** + * Initializes NullHypothesisProto2 with all fields set to their default value. + */ + initialize: function (): NullHypothesisProto2 { + return {}; + }, + + /** + * @private + */ + _writeMessage: function ( + _msg: Partial + ): Record { + return {}; + }, + + /** + * @private + */ + _readMessage: function ( + msg: NullHypothesisProto2, + _json: any + ): NullHypothesisProto2 { + return msg; + }, +}; + +export const EnumOnlyProto2JSON = { + /** + * Serializes EnumOnlyProto2 to JSON. + */ + encode: function (_msg?: Partial): string { + return "{}"; + }, + + /** + * Deserializes EnumOnlyProto2 from JSON. + */ + decode: function (_json?: string): EnumOnlyProto2 { + return {}; + }, + + /** + * Initializes EnumOnlyProto2 with all fields set to their default value. + */ + initialize: function (): EnumOnlyProto2 { + return {}; + }, + + /** + * @private + */ + _writeMessage: function ( + _msg: Partial + ): Record { + return {}; + }, + + /** + * @private + */ + _readMessage: function (msg: EnumOnlyProto2, _json: any): EnumOnlyProto2 { + return msg; + }, + + Bool: { + kFalse: "kFalse", + kTrue: "kTrue", + /** + * @private + */ + _fromInt: function (i: number): EnumOnlyProto2.Bool { + switch (i) { + case 0: { + return "kFalse"; + } + case 1: { + return "kTrue"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as EnumOnlyProto2.Bool; + } + } + }, + /** + * @private + */ + _toInt: function (i: EnumOnlyProto2.Bool): number { + switch (i) { + case "kFalse": { + return 0; + } + case "kTrue": { + return 1; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, + } as const, +}; + +export const OneStringProto2JSON = { + /** + * Serializes OneStringProto2 to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify(OneStringProto2JSON._writeMessage(msg)); + }, + + /** + * Deserializes OneStringProto2 from JSON. + */ + decode: function (json: string): OneStringProto2 { + return OneStringProto2JSON._readMessage( + OneStringProto2JSON.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes OneStringProto2 with all fields set to their default value. + */ + initialize: function (): OneStringProto2 { + return { + data: "", + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.data) { + json["data"] = msg.data; + } + return json; + }, + + /** + * @private + */ + _readMessage: function (msg: OneStringProto2, json: any): OneStringProto2 { + const _data_ = json["data"]; + if (_data_) { + msg.data = _data_; + } + return msg; + }, +}; + +export const ProtoWithKeywordsJSON = { + /** + * Serializes ProtoWithKeywords to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify(ProtoWithKeywordsJSON._writeMessage(msg)); + }, + + /** + * Deserializes ProtoWithKeywords from JSON. + */ + decode: function (json: string): ProtoWithKeywords { + return ProtoWithKeywordsJSON._readMessage( + ProtoWithKeywordsJSON.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes ProtoWithKeywords with all fields set to their default value. + */ + initialize: function (): ProtoWithKeywords { + return { + inline: 0, + concept: "", + requires: [], + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.inline) { + json["inline"] = msg.inline; + } + if (msg.concept) { + json["concept"] = msg.concept; + } + if (msg.requires?.length) { + json["requires"] = msg.requires; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: ProtoWithKeywords, + json: any + ): ProtoWithKeywords { + const _inline_ = json["inline"]; + if (_inline_) { + msg.inline = _inline_; + } + const _concept_ = json["concept"]; + if (_concept_) { + msg.concept = _concept_; + } + const _requires_ = json["requires"]; + if (_requires_) { + msg.requires = _requires_; + } + return msg; + }, +}; + +export const TestAllRequiredTypesProto2JSON = { + /** + * Serializes TestAllRequiredTypesProto2 to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify(TestAllRequiredTypesProto2JSON._writeMessage(msg)); + }, + + /** + * Deserializes TestAllRequiredTypesProto2 from JSON. + */ + decode: function (json: string): TestAllRequiredTypesProto2 { + return TestAllRequiredTypesProto2JSON._readMessage( + TestAllRequiredTypesProto2JSON.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes TestAllRequiredTypesProto2 with all fields set to their default value. + */ + initialize: function (): TestAllRequiredTypesProto2 { + return { + requiredInt32: 0, + requiredInt64: 0n, + requiredUint32: 0, + requiredUint64: 0n, + requiredSint32: 0, + requiredSint64: 0n, + requiredFixed32: 0, + requiredFixed64: 0n, + requiredSfixed32: 0, + requiredSfixed64: 0n, + requiredFloat: 0, + requiredDouble: 0, + requiredBool: false, + requiredString: "", + requiredBytes: new Uint8Array(), + requiredNestedMessage: + TestAllRequiredTypesProto2JSON.NestedMessage.initialize(), + requiredForeignMessage: ForeignMessageProto2JSON.initialize(), + requiredNestedEnum: TestAllRequiredTypesProto2.NestedEnum._fromInt(0), + requiredForeignEnum: ForeignEnumProto2._fromInt(0), + requiredStringPiece: "", + requiredCord: "", + recursiveMessage: TestAllRequiredTypesProto2JSON.initialize(), + optionalRecursiveMessage: TestAllRequiredTypesProto2JSON.initialize(), + defaultInt32: 0, + defaultInt64: 0n, + defaultUint32: 0, + defaultUint64: 0n, + defaultSint32: 0, + defaultSint64: 0n, + defaultFixed32: 0, + defaultFixed64: 0n, + defaultSfixed32: 0, + defaultSfixed64: 0n, + defaultFloat: 0, + defaultDouble: 0, + defaultBool: false, + defaultString: "", + defaultBytes: new Uint8Array(), + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.requiredInt32) { + json["requiredInt32"] = msg.requiredInt32; + } + if (msg.requiredInt64) { + json["requiredInt64"] = msg.requiredInt64.toString(); + } + if (msg.requiredUint32) { + json["requiredUint32"] = msg.requiredUint32; + } + if (msg.requiredUint64) { + json["requiredUint64"] = msg.requiredUint64.toString(); + } + if (msg.requiredSint32) { + json["requiredSint32"] = msg.requiredSint32; + } + if (msg.requiredSint64) { + json["requiredSint64"] = msg.requiredSint64.toString(); + } + if (msg.requiredFixed32) { + json["requiredFixed32"] = msg.requiredFixed32; + } + if (msg.requiredFixed64) { + json["requiredFixed64"] = msg.requiredFixed64.toString(); + } + if (msg.requiredSfixed32) { + json["requiredSfixed32"] = msg.requiredSfixed32; + } + if (msg.requiredSfixed64) { + json["requiredSfixed64"] = msg.requiredSfixed64.toString(); + } + if (msg.requiredFloat) { + json["requiredFloat"] = msg.requiredFloat; + } + if (msg.requiredDouble) { + json["requiredDouble"] = msg.requiredDouble; + } + if (msg.requiredBool) { + json["requiredBool"] = msg.requiredBool; + } + if (msg.requiredString) { + json["requiredString"] = msg.requiredString; + } + if (msg.requiredBytes?.length) { + json["requiredBytes"] = encodeBase64Bytes(msg.requiredBytes); + } + if (msg.requiredNestedMessage) { + const _requiredNestedMessage_ = + TestAllRequiredTypesProto2JSON.NestedMessage._writeMessage( + msg.requiredNestedMessage + ); + if (Object.keys(_requiredNestedMessage_).length > 0) { + json["requiredNestedMessage"] = _requiredNestedMessage_; + } + } + if (msg.requiredForeignMessage) { + const _requiredForeignMessage_ = ForeignMessageProto2JSON._writeMessage( + msg.requiredForeignMessage + ); + if (Object.keys(_requiredForeignMessage_).length > 0) { + json["requiredForeignMessage"] = _requiredForeignMessage_; + } + } + if ( + msg.requiredNestedEnum && + TestAllRequiredTypesProto2JSON.NestedEnum._toInt(msg.requiredNestedEnum) + ) { + json["requiredNestedEnum"] = msg.requiredNestedEnum; + } + if ( + msg.requiredForeignEnum && + ForeignEnumProto2JSON._toInt(msg.requiredForeignEnum) + ) { + json["requiredForeignEnum"] = msg.requiredForeignEnum; + } + if (msg.requiredStringPiece) { + json["requiredStringPiece"] = msg.requiredStringPiece; + } + if (msg.requiredCord) { + json["requiredCord"] = msg.requiredCord; + } + if (msg.recursiveMessage) { + const _recursiveMessage_ = TestAllRequiredTypesProto2JSON._writeMessage( + msg.recursiveMessage + ); + if (Object.keys(_recursiveMessage_).length > 0) { + json["recursiveMessage"] = _recursiveMessage_; + } + } + if (msg.optionalRecursiveMessage) { + const _optionalRecursiveMessage_ = + TestAllRequiredTypesProto2JSON._writeMessage( + msg.optionalRecursiveMessage + ); + if (Object.keys(_optionalRecursiveMessage_).length > 0) { + json["optionalRecursiveMessage"] = _optionalRecursiveMessage_; + } + } + if (msg.defaultInt32) { + json["defaultInt32"] = msg.defaultInt32; + } + if (msg.defaultInt64) { + json["defaultInt64"] = msg.defaultInt64.toString(); + } + if (msg.defaultUint32) { + json["defaultUint32"] = msg.defaultUint32; + } + if (msg.defaultUint64) { + json["defaultUint64"] = msg.defaultUint64.toString(); + } + if (msg.defaultSint32) { + json["defaultSint32"] = msg.defaultSint32; + } + if (msg.defaultSint64) { + json["defaultSint64"] = msg.defaultSint64.toString(); + } + if (msg.defaultFixed32) { + json["defaultFixed32"] = msg.defaultFixed32; + } + if (msg.defaultFixed64) { + json["defaultFixed64"] = msg.defaultFixed64.toString(); + } + if (msg.defaultSfixed32) { + json["defaultSfixed32"] = msg.defaultSfixed32; + } + if (msg.defaultSfixed64) { + json["defaultSfixed64"] = msg.defaultSfixed64.toString(); + } + if (msg.defaultFloat) { + json["defaultFloat"] = msg.defaultFloat; + } + if (msg.defaultDouble) { + json["defaultDouble"] = msg.defaultDouble; + } + if (msg.defaultBool) { + json["defaultBool"] = msg.defaultBool; + } + if (msg.defaultString) { + json["defaultString"] = msg.defaultString; + } + if (msg.defaultBytes?.length) { + json["defaultBytes"] = encodeBase64Bytes(msg.defaultBytes); + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllRequiredTypesProto2, + json: any + ): TestAllRequiredTypesProto2 { + const _requiredInt32_ = json["requiredInt32"] ?? json["required_int32"]; + if (_requiredInt32_) { + msg.requiredInt32 = _requiredInt32_; + } + const _requiredInt64_ = json["requiredInt64"] ?? json["required_int64"]; + if (_requiredInt64_) { + msg.requiredInt64 = BigInt(_requiredInt64_); + } + const _requiredUint32_ = json["requiredUint32"] ?? json["required_uint32"]; + if (_requiredUint32_) { + msg.requiredUint32 = _requiredUint32_; + } + const _requiredUint64_ = json["requiredUint64"] ?? json["required_uint64"]; + if (_requiredUint64_) { + msg.requiredUint64 = BigInt(_requiredUint64_); + } + const _requiredSint32_ = json["requiredSint32"] ?? json["required_sint32"]; + if (_requiredSint32_) { + msg.requiredSint32 = _requiredSint32_; + } + const _requiredSint64_ = json["requiredSint64"] ?? json["required_sint64"]; + if (_requiredSint64_) { + msg.requiredSint64 = BigInt(_requiredSint64_); + } + const _requiredFixed32_ = + json["requiredFixed32"] ?? json["required_fixed32"]; + if (_requiredFixed32_) { + msg.requiredFixed32 = _requiredFixed32_; + } + const _requiredFixed64_ = + json["requiredFixed64"] ?? json["required_fixed64"]; + if (_requiredFixed64_) { + msg.requiredFixed64 = BigInt(_requiredFixed64_); + } + const _requiredSfixed32_ = + json["requiredSfixed32"] ?? json["required_sfixed32"]; + if (_requiredSfixed32_) { + msg.requiredSfixed32 = _requiredSfixed32_; + } + const _requiredSfixed64_ = + json["requiredSfixed64"] ?? json["required_sfixed64"]; + if (_requiredSfixed64_) { + msg.requiredSfixed64 = BigInt(_requiredSfixed64_); + } + const _requiredFloat_ = json["requiredFloat"] ?? json["required_float"]; + if (_requiredFloat_) { + msg.requiredFloat = _requiredFloat_; + } + const _requiredDouble_ = json["requiredDouble"] ?? json["required_double"]; + if (_requiredDouble_) { + msg.requiredDouble = _requiredDouble_; + } + const _requiredBool_ = json["requiredBool"] ?? json["required_bool"]; + if (_requiredBool_) { + msg.requiredBool = _requiredBool_; + } + const _requiredString_ = json["requiredString"] ?? json["required_string"]; + if (_requiredString_) { + msg.requiredString = _requiredString_; + } + const _requiredBytes_ = json["requiredBytes"] ?? json["required_bytes"]; + if (_requiredBytes_) { + msg.requiredBytes = decodeBase64Bytes(_requiredBytes_); + } + const _requiredNestedMessage_ = + json["requiredNestedMessage"] ?? json["required_nested_message"]; + if (_requiredNestedMessage_) { + const m = TestAllRequiredTypesProto2JSON.NestedMessage.initialize(); + TestAllRequiredTypesProto2JSON.NestedMessage._readMessage( + m, + _requiredNestedMessage_ + ); + msg.requiredNestedMessage = m; + } + const _requiredForeignMessage_ = + json["requiredForeignMessage"] ?? json["required_foreign_message"]; + if (_requiredForeignMessage_) { + const m = ForeignMessageProto2JSON.initialize(); + ForeignMessageProto2JSON._readMessage(m, _requiredForeignMessage_); + msg.requiredForeignMessage = m; + } + const _requiredNestedEnum_ = + json["requiredNestedEnum"] ?? json["required_nested_enum"]; + if (_requiredNestedEnum_) { + msg.requiredNestedEnum = _requiredNestedEnum_; + } + const _requiredForeignEnum_ = + json["requiredForeignEnum"] ?? json["required_foreign_enum"]; + if (_requiredForeignEnum_) { + msg.requiredForeignEnum = _requiredForeignEnum_; + } + const _requiredStringPiece_ = + json["requiredStringPiece"] ?? json["required_string_piece"]; + if (_requiredStringPiece_) { + msg.requiredStringPiece = _requiredStringPiece_; + } + const _requiredCord_ = json["requiredCord"] ?? json["required_cord"]; + if (_requiredCord_) { + msg.requiredCord = _requiredCord_; + } + const _recursiveMessage_ = + json["recursiveMessage"] ?? json["recursive_message"]; + if (_recursiveMessage_) { + const m = TestAllRequiredTypesProto2JSON.initialize(); + TestAllRequiredTypesProto2JSON._readMessage(m, _recursiveMessage_); + msg.recursiveMessage = m; + } + const _optionalRecursiveMessage_ = + json["optionalRecursiveMessage"] ?? json["optional_recursive_message"]; + if (_optionalRecursiveMessage_) { + const m = TestAllRequiredTypesProto2JSON.initialize(); + TestAllRequiredTypesProto2JSON._readMessage( + m, + _optionalRecursiveMessage_ + ); + msg.optionalRecursiveMessage = m; + } + const _defaultInt32_ = json["defaultInt32"] ?? json["default_int32"]; + if (_defaultInt32_) { + msg.defaultInt32 = _defaultInt32_; + } + const _defaultInt64_ = json["defaultInt64"] ?? json["default_int64"]; + if (_defaultInt64_) { + msg.defaultInt64 = BigInt(_defaultInt64_); + } + const _defaultUint32_ = json["defaultUint32"] ?? json["default_uint32"]; + if (_defaultUint32_) { + msg.defaultUint32 = _defaultUint32_; + } + const _defaultUint64_ = json["defaultUint64"] ?? json["default_uint64"]; + if (_defaultUint64_) { + msg.defaultUint64 = BigInt(_defaultUint64_); + } + const _defaultSint32_ = json["defaultSint32"] ?? json["default_sint32"]; + if (_defaultSint32_) { + msg.defaultSint32 = _defaultSint32_; + } + const _defaultSint64_ = json["defaultSint64"] ?? json["default_sint64"]; + if (_defaultSint64_) { + msg.defaultSint64 = BigInt(_defaultSint64_); + } + const _defaultFixed32_ = json["defaultFixed32"] ?? json["default_fixed32"]; + if (_defaultFixed32_) { + msg.defaultFixed32 = _defaultFixed32_; + } + const _defaultFixed64_ = json["defaultFixed64"] ?? json["default_fixed64"]; + if (_defaultFixed64_) { + msg.defaultFixed64 = BigInt(_defaultFixed64_); + } + const _defaultSfixed32_ = + json["defaultSfixed32"] ?? json["default_sfixed32"]; + if (_defaultSfixed32_) { + msg.defaultSfixed32 = _defaultSfixed32_; + } + const _defaultSfixed64_ = + json["defaultSfixed64"] ?? json["default_sfixed64"]; + if (_defaultSfixed64_) { + msg.defaultSfixed64 = BigInt(_defaultSfixed64_); + } + const _defaultFloat_ = json["defaultFloat"] ?? json["default_float"]; + if (_defaultFloat_) { + msg.defaultFloat = _defaultFloat_; + } + const _defaultDouble_ = json["defaultDouble"] ?? json["default_double"]; + if (_defaultDouble_) { + msg.defaultDouble = _defaultDouble_; + } + const _defaultBool_ = json["defaultBool"] ?? json["default_bool"]; + if (_defaultBool_) { + msg.defaultBool = _defaultBool_; + } + const _defaultString_ = json["defaultString"] ?? json["default_string"]; + if (_defaultString_) { + msg.defaultString = _defaultString_; + } + const _defaultBytes_ = json["defaultBytes"] ?? json["default_bytes"]; + if (_defaultBytes_) { + msg.defaultBytes = decodeBase64Bytes(_defaultBytes_); + } + return msg; + }, + + NestedEnum: { + FOO: "FOO", + BAR: "BAR", + BAZ: "BAZ", + NEG: "NEG", + /** + * @private + */ + _fromInt: function (i: number): TestAllRequiredTypesProto2.NestedEnum { + switch (i) { + case 0: { + return "FOO"; + } + case 1: { + return "BAR"; + } + case 2: { + return "BAZ"; + } + case -1: { + return "NEG"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as TestAllRequiredTypesProto2.NestedEnum; + } + } + }, + /** + * @private + */ + _toInt: function (i: TestAllRequiredTypesProto2.NestedEnum): number { + switch (i) { + case "FOO": { + return 0; + } + case "BAR": { + return 1; + } + case "BAZ": { + return 2; + } + case "NEG": { + return -1; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, + } as const, + + NestedMessage: { + /** + * Serializes TestAllRequiredTypesProto2.NestedMessage to JSON. + */ + encode: function ( + msg: Partial + ): string { + return JSON.stringify( + TestAllRequiredTypesProto2JSON.NestedMessage._writeMessage(msg) + ); + }, + + /** + * Deserializes TestAllRequiredTypesProto2.NestedMessage from JSON. + */ + decode: function (json: string): TestAllRequiredTypesProto2.NestedMessage { + return TestAllRequiredTypesProto2JSON.NestedMessage._readMessage( + TestAllRequiredTypesProto2JSON.NestedMessage.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes TestAllRequiredTypesProto2.NestedMessage with all fields set to their default value. + */ + initialize: function (): TestAllRequiredTypesProto2.NestedMessage { + return { + a: 0, + corecursive: TestAllRequiredTypesProto2JSON.initialize(), + optionalCorecursive: TestAllRequiredTypesProto2JSON.initialize(), + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.a) { + json["a"] = msg.a; + } + if (msg.corecursive) { + const _corecursive_ = TestAllRequiredTypesProto2JSON._writeMessage( + msg.corecursive + ); + if (Object.keys(_corecursive_).length > 0) { + json["corecursive"] = _corecursive_; + } + } + if (msg.optionalCorecursive) { + const _optionalCorecursive_ = + TestAllRequiredTypesProto2JSON._writeMessage(msg.optionalCorecursive); + if (Object.keys(_optionalCorecursive_).length > 0) { + json["optionalCorecursive"] = _optionalCorecursive_; + } + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllRequiredTypesProto2.NestedMessage, + json: any + ): TestAllRequiredTypesProto2.NestedMessage { + const _a_ = json["a"]; + if (_a_) { + msg.a = _a_; + } + const _corecursive_ = json["corecursive"]; + if (_corecursive_) { + const m = TestAllRequiredTypesProto2JSON.initialize(); + TestAllRequiredTypesProto2JSON._readMessage(m, _corecursive_); + msg.corecursive = m; + } + const _optionalCorecursive_ = + json["optionalCorecursive"] ?? json["optional_corecursive"]; + if (_optionalCorecursive_) { + const m = TestAllRequiredTypesProto2JSON.initialize(); + TestAllRequiredTypesProto2JSON._readMessage(m, _optionalCorecursive_); + msg.optionalCorecursive = m; + } + return msg; + }, + }, + + Data: { + /** + * Serializes TestAllRequiredTypesProto2.Data to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify( + TestAllRequiredTypesProto2JSON.Data._writeMessage(msg) + ); + }, + + /** + * Deserializes TestAllRequiredTypesProto2.Data from JSON. + */ + decode: function (json: string): TestAllRequiredTypesProto2.Data { + return TestAllRequiredTypesProto2JSON.Data._readMessage( + TestAllRequiredTypesProto2JSON.Data.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes TestAllRequiredTypesProto2.Data with all fields set to their default value. + */ + initialize: function (): TestAllRequiredTypesProto2.Data { + return { + groupInt32: 0, + groupUint32: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.groupInt32) { + json["groupInt32"] = msg.groupInt32; + } + if (msg.groupUint32) { + json["groupUint32"] = msg.groupUint32; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllRequiredTypesProto2.Data, + json: any + ): TestAllRequiredTypesProto2.Data { + const _groupInt32_ = json["groupInt32"] ?? json["group_int32"]; + if (_groupInt32_) { + msg.groupInt32 = _groupInt32_; + } + const _groupUint32_ = json["groupUint32"] ?? json["group_uint32"]; + if (_groupUint32_) { + msg.groupUint32 = _groupUint32_; + } + return msg; + }, + }, + + MessageSetCorrect: { + /** + * Serializes TestAllRequiredTypesProto2.MessageSetCorrect to JSON. + */ + encode: function ( + _msg?: Partial + ): string { + return "{}"; + }, + + /** + * Deserializes TestAllRequiredTypesProto2.MessageSetCorrect from JSON. + */ + decode: function ( + _json?: string + ): TestAllRequiredTypesProto2.MessageSetCorrect { + return {}; + }, + + /** + * Initializes TestAllRequiredTypesProto2.MessageSetCorrect with all fields set to their default value. + */ + initialize: function (): TestAllRequiredTypesProto2.MessageSetCorrect { + return {}; + }, + + /** + * @private + */ + _writeMessage: function ( + _msg: Partial + ): Record { + return {}; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllRequiredTypesProto2.MessageSetCorrect, + _json: any + ): TestAllRequiredTypesProto2.MessageSetCorrect { + return msg; + }, + }, + + MessageSetCorrectExtension1: { + /** + * Serializes TestAllRequiredTypesProto2.MessageSetCorrectExtension1 to JSON. + */ + encode: function ( + msg: Partial + ): string { + return JSON.stringify( + TestAllRequiredTypesProto2JSON.MessageSetCorrectExtension1._writeMessage( + msg + ) + ); + }, + + /** + * Deserializes TestAllRequiredTypesProto2.MessageSetCorrectExtension1 from JSON. + */ + decode: function ( + json: string + ): TestAllRequiredTypesProto2.MessageSetCorrectExtension1 { + return TestAllRequiredTypesProto2JSON.MessageSetCorrectExtension1._readMessage( + TestAllRequiredTypesProto2JSON.MessageSetCorrectExtension1.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes TestAllRequiredTypesProto2.MessageSetCorrectExtension1 with all fields set to their default value. + */ + initialize: + function (): TestAllRequiredTypesProto2.MessageSetCorrectExtension1 { + return { + str: "", + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.str) { + json["str"] = msg.str; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllRequiredTypesProto2.MessageSetCorrectExtension1, + json: any + ): TestAllRequiredTypesProto2.MessageSetCorrectExtension1 { + const _str_ = json["str"]; + if (_str_) { + msg.str = _str_; + } + return msg; + }, + }, + + MessageSetCorrectExtension2: { + /** + * Serializes TestAllRequiredTypesProto2.MessageSetCorrectExtension2 to JSON. + */ + encode: function ( + msg: Partial + ): string { + return JSON.stringify( + TestAllRequiredTypesProto2JSON.MessageSetCorrectExtension2._writeMessage( + msg + ) + ); + }, + + /** + * Deserializes TestAllRequiredTypesProto2.MessageSetCorrectExtension2 from JSON. + */ + decode: function ( + json: string + ): TestAllRequiredTypesProto2.MessageSetCorrectExtension2 { + return TestAllRequiredTypesProto2JSON.MessageSetCorrectExtension2._readMessage( + TestAllRequiredTypesProto2JSON.MessageSetCorrectExtension2.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes TestAllRequiredTypesProto2.MessageSetCorrectExtension2 with all fields set to their default value. + */ + initialize: + function (): TestAllRequiredTypesProto2.MessageSetCorrectExtension2 { + return { + i: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.i) { + json["i"] = msg.i; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllRequiredTypesProto2.MessageSetCorrectExtension2, + json: any + ): TestAllRequiredTypesProto2.MessageSetCorrectExtension2 { + const _i_ = json["i"]; + if (_i_) { + msg.i = _i_; + } + return msg; + }, + }, +}; diff --git a/impl/protoscript/gen/google/protobuf/test_messages_proto3.pb.ts b/impl/protoscript/gen/google/protobuf/test_messages_proto3.pb.ts new file mode 100644 index 00000000..506e39a7 --- /dev/null +++ b/impl/protoscript/gen/google/protobuf/test_messages_proto3.pb.ts @@ -0,0 +1,6654 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +// Source: google/protobuf/test_messages_proto3.proto +/* eslint-disable */ + +import type { ByteSource } from "protoscript"; +import { + BinaryReader, + BinaryWriter, + encodeBase64Bytes, + decodeBase64Bytes, +} from "protoscript"; + +import * as protoscript from "protoscript"; + +//========================================// +// Types // +//========================================// + +export type ForeignEnum = "FOREIGN_FOO" | "FOREIGN_BAR" | "FOREIGN_BAZ"; + +/** + * This proto includes every type of field in both singular and repeated + * forms. + * + * Also, crucially, all messages and enums in this file are eventually + * submessages of this message. So for example, a fuzz test of TestAllTypes + * could trigger bugs that occur in any message type in this file. We verify + * this stays true in a unit test. + */ +export interface TestAllTypesProto3 { + /** + * Singular + */ + optionalInt32: number; + optionalInt64: bigint; + optionalUint32: number; + optionalUint64: bigint; + optionalSint32: number; + optionalSint64: bigint; + optionalFixed32: number; + optionalFixed64: bigint; + optionalSfixed32: number; + optionalSfixed64: bigint; + optionalFloat: number; + optionalDouble: number; + optionalBool: boolean; + optionalString: string; + optionalBytes: Uint8Array; + optionalNestedMessage: TestAllTypesProto3.NestedMessage; + optionalForeignMessage: ForeignMessage; + optionalNestedEnum: TestAllTypesProto3.NestedEnum; + optionalForeignEnum: ForeignEnum; + optionalAliasedEnum: TestAllTypesProto3.AliasedEnum; + optionalStringPiece: string; + optionalCord: string; + recursiveMessage: TestAllTypesProto3 | null | undefined; + /** + * Repeated + */ + repeatedInt32: number[]; + repeatedInt64: bigint[]; + repeatedUint32: number[]; + repeatedUint64: bigint[]; + repeatedSint32: number[]; + repeatedSint64: bigint[]; + repeatedFixed32: number[]; + repeatedFixed64: bigint[]; + repeatedSfixed32: number[]; + repeatedSfixed64: bigint[]; + repeatedFloat: number[]; + repeatedDouble: number[]; + repeatedBool: boolean[]; + repeatedString: string[]; + repeatedBytes: Uint8Array[]; + repeatedNestedMessage: TestAllTypesProto3.NestedMessage[]; + repeatedForeignMessage: ForeignMessage[]; + repeatedNestedEnum: TestAllTypesProto3.NestedEnum[]; + repeatedForeignEnum: ForeignEnum[]; + repeatedStringPiece: string[]; + repeatedCord: string[]; + /** + * Packed + */ + packedInt32: number[]; + packedInt64: bigint[]; + packedUint32: number[]; + packedUint64: bigint[]; + packedSint32: number[]; + packedSint64: bigint[]; + packedFixed32: number[]; + packedFixed64: bigint[]; + packedSfixed32: number[]; + packedSfixed64: bigint[]; + packedFloat: number[]; + packedDouble: number[]; + packedBool: boolean[]; + packedNestedEnum: TestAllTypesProto3.NestedEnum[]; + /** + * Unpacked + */ + unpackedInt32: number[]; + unpackedInt64: bigint[]; + unpackedUint32: number[]; + unpackedUint64: bigint[]; + unpackedSint32: number[]; + unpackedSint64: bigint[]; + unpackedFixed32: number[]; + unpackedFixed64: bigint[]; + unpackedSfixed32: number[]; + unpackedSfixed64: bigint[]; + unpackedFloat: number[]; + unpackedDouble: number[]; + unpackedBool: boolean[]; + unpackedNestedEnum: TestAllTypesProto3.NestedEnum[]; + /** + * Map + */ + mapInt32Int32: Record< + string, + TestAllTypesProto3.MapInt32Int32["value"] | undefined + >; + mapInt64Int64: Record< + string, + TestAllTypesProto3.MapInt64Int64["value"] | undefined + >; + mapUint32Uint32: Record< + string, + TestAllTypesProto3.MapUint32Uint32["value"] | undefined + >; + mapUint64Uint64: Record< + string, + TestAllTypesProto3.MapUint64Uint64["value"] | undefined + >; + mapSint32Sint32: Record< + string, + TestAllTypesProto3.MapSint32Sint32["value"] | undefined + >; + mapSint64Sint64: Record< + string, + TestAllTypesProto3.MapSint64Sint64["value"] | undefined + >; + mapFixed32Fixed32: Record< + string, + TestAllTypesProto3.MapFixed32Fixed32["value"] | undefined + >; + mapFixed64Fixed64: Record< + string, + TestAllTypesProto3.MapFixed64Fixed64["value"] | undefined + >; + mapSfixed32Sfixed32: Record< + string, + TestAllTypesProto3.MapSfixed32Sfixed32["value"] | undefined + >; + mapSfixed64Sfixed64: Record< + string, + TestAllTypesProto3.MapSfixed64Sfixed64["value"] | undefined + >; + mapInt32Float: Record< + string, + TestAllTypesProto3.MapInt32Float["value"] | undefined + >; + mapInt32Double: Record< + string, + TestAllTypesProto3.MapInt32Double["value"] | undefined + >; + mapBoolBool: Record< + string, + TestAllTypesProto3.MapBoolBool["value"] | undefined + >; + mapStringString: Record< + string, + TestAllTypesProto3.MapStringString["value"] | undefined + >; + mapStringBytes: Record< + string, + TestAllTypesProto3.MapStringBytes["value"] | undefined + >; + mapStringNestedMessage: Record< + string, + TestAllTypesProto3.MapStringNestedMessage["value"] | undefined + >; + mapStringForeignMessage: Record< + string, + TestAllTypesProto3.MapStringForeignMessage["value"] | undefined + >; + mapStringNestedEnum: Record< + string, + TestAllTypesProto3.MapStringNestedEnum["value"] | undefined + >; + mapStringForeignEnum: Record< + string, + TestAllTypesProto3.MapStringForeignEnum["value"] | undefined + >; + oneofUint32?: number | null | undefined; + oneofNestedMessage?: TestAllTypesProto3.NestedMessage | null | undefined; + oneofString?: string | null | undefined; + oneofBytes?: Uint8Array | null | undefined; + oneofBool?: boolean | null | undefined; + oneofUint64?: bigint | null | undefined; + oneofFloat?: number | null | undefined; + oneofDouble?: number | null | undefined; + oneofEnum?: TestAllTypesProto3.NestedEnum | null | undefined; + oneofNullValue?: protoscript.NullValue | null | undefined; + /** + * Well-known types + */ + optionalBoolWrapper: protoscript.BoolValue; + optionalInt32Wrapper: protoscript.Int32Value; + optionalInt64Wrapper: protoscript.Int64Value; + optionalUint32Wrapper: protoscript.UInt32Value; + optionalUint64Wrapper: protoscript.UInt64Value; + optionalFloatWrapper: protoscript.FloatValue; + optionalDoubleWrapper: protoscript.DoubleValue; + optionalStringWrapper: protoscript.StringValue; + optionalBytesWrapper: protoscript.BytesValue; + repeatedBoolWrapper: protoscript.BoolValue[]; + repeatedInt32Wrapper: protoscript.Int32Value[]; + repeatedInt64Wrapper: protoscript.Int64Value[]; + repeatedUint32Wrapper: protoscript.UInt32Value[]; + repeatedUint64Wrapper: protoscript.UInt64Value[]; + repeatedFloatWrapper: protoscript.FloatValue[]; + repeatedDoubleWrapper: protoscript.DoubleValue[]; + repeatedStringWrapper: protoscript.StringValue[]; + repeatedBytesWrapper: protoscript.BytesValue[]; + optionalDuration: protoscript.Duration; + optionalTimestamp: protoscript.Timestamp; + optionalFieldMask: protoscript.FieldMask; + optionalStruct: protoscript.Struct; + optionalAny: protoscript.Any; + optionalValue: protoscript.Value; + optionalNullValue: protoscript.NullValue; + repeatedDuration: protoscript.Duration[]; + repeatedTimestamp: protoscript.Timestamp[]; + repeatedFieldmask: protoscript.FieldMask[]; + repeatedStruct: protoscript.Struct[]; + repeatedAny: protoscript.Any[]; + repeatedValue: protoscript.Value[]; + repeatedListValue: protoscript.ListValue[]; + /** + * Test field-name-to-JSON-name convention. + * (protobuf says names can be any valid C/C++ identifier.) + */ + fieldname1: number; + fieldName2: number; + fieldName3: number; + fieldName4: number; + field0name5: number; + field0Name6: number; + fieldName7: number; + FieldName8: number; + fieldName9: number; + FieldName10: number; + FIELDNAME11: number; + FIELDName12: number; + fieldName13: number; + FieldName14: number; + fieldName15: number; + fieldName16: number; + fieldName17: number; + FieldName18: number; +} + +export declare namespace TestAllTypesProto3 { + export type NestedEnum = "FOO" | "BAR" | "BAZ" | "NEG"; + + export type AliasedEnum = + | "ALIAS_FOO" + | "ALIAS_BAR" + | "ALIAS_BAZ" + | "MOO" + | "moo" + | "bAz"; + + export interface NestedMessage { + a: number; + corecursive: TestAllTypesProto3 | null | undefined; + } + + interface MapInt32Int32 { + key: number; + value: number; + } + + interface MapInt64Int64 { + key: bigint; + value: bigint; + } + + interface MapUint32Uint32 { + key: number; + value: number; + } + + interface MapUint64Uint64 { + key: bigint; + value: bigint; + } + + interface MapSint32Sint32 { + key: number; + value: number; + } + + interface MapSint64Sint64 { + key: bigint; + value: bigint; + } + + interface MapFixed32Fixed32 { + key: number; + value: number; + } + + interface MapFixed64Fixed64 { + key: bigint; + value: bigint; + } + + interface MapSfixed32Sfixed32 { + key: number; + value: number; + } + + interface MapSfixed64Sfixed64 { + key: bigint; + value: bigint; + } + + interface MapInt32Float { + key: number; + value: number; + } + + interface MapInt32Double { + key: number; + value: number; + } + + interface MapBoolBool { + key: boolean; + value: boolean; + } + + interface MapStringString { + key: string; + value: string; + } + + interface MapStringBytes { + key: string; + value: Uint8Array; + } + + interface MapStringNestedMessage { + key: string; + value: TestAllTypesProto3.NestedMessage; + } + + interface MapStringForeignMessage { + key: string; + value: ForeignMessage; + } + + interface MapStringNestedEnum { + key: string; + value: TestAllTypesProto3.NestedEnum; + } + + interface MapStringForeignEnum { + key: string; + value: ForeignEnum; + } +} + +export interface ForeignMessage { + c: number; +} + +export interface NullHypothesisProto3 {} + +export interface EnumOnlyProto3 {} + +export declare namespace EnumOnlyProto3 { + export type Bool = "kFalse" | "kTrue"; +} + +//========================================// +// Protobuf Encode / Decode // +//========================================// + +export const ForeignEnum = { + FOREIGN_FOO: "FOREIGN_FOO", + FOREIGN_BAR: "FOREIGN_BAR", + FOREIGN_BAZ: "FOREIGN_BAZ", + /** + * @private + */ + _fromInt: function (i: number): ForeignEnum { + switch (i) { + case 0: { + return "FOREIGN_FOO"; + } + case 1: { + return "FOREIGN_BAR"; + } + case 2: { + return "FOREIGN_BAZ"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as ForeignEnum; + } + } + }, + /** + * @private + */ + _toInt: function (i: ForeignEnum): number { + switch (i) { + case "FOREIGN_FOO": { + return 0; + } + case "FOREIGN_BAR": { + return 1; + } + case "FOREIGN_BAZ": { + return 2; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, +} as const; + +export const TestAllTypesProto3 = { + /** + * Serializes TestAllTypesProto3 to protobuf. + */ + encode: function (msg: Partial): Uint8Array { + return TestAllTypesProto3._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes TestAllTypesProto3 from protobuf. + */ + decode: function (bytes: ByteSource): TestAllTypesProto3 { + return TestAllTypesProto3._readMessage( + TestAllTypesProto3.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes TestAllTypesProto3 with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto3 { + return { + optionalInt32: 0, + optionalInt64: 0n, + optionalUint32: 0, + optionalUint64: 0n, + optionalSint32: 0, + optionalSint64: 0n, + optionalFixed32: 0, + optionalFixed64: 0n, + optionalSfixed32: 0, + optionalSfixed64: 0n, + optionalFloat: 0, + optionalDouble: 0, + optionalBool: false, + optionalString: "", + optionalBytes: new Uint8Array(), + optionalNestedMessage: TestAllTypesProto3.NestedMessage.initialize(), + optionalForeignMessage: ForeignMessage.initialize(), + optionalNestedEnum: TestAllTypesProto3.NestedEnum._fromInt(0), + optionalForeignEnum: ForeignEnum._fromInt(0), + optionalAliasedEnum: TestAllTypesProto3.AliasedEnum._fromInt(0), + optionalStringPiece: "", + optionalCord: "", + recursiveMessage: undefined, + repeatedInt32: [], + repeatedInt64: [], + repeatedUint32: [], + repeatedUint64: [], + repeatedSint32: [], + repeatedSint64: [], + repeatedFixed32: [], + repeatedFixed64: [], + repeatedSfixed32: [], + repeatedSfixed64: [], + repeatedFloat: [], + repeatedDouble: [], + repeatedBool: [], + repeatedString: [], + repeatedBytes: [], + repeatedNestedMessage: [], + repeatedForeignMessage: [], + repeatedNestedEnum: [], + repeatedForeignEnum: [], + repeatedStringPiece: [], + repeatedCord: [], + packedInt32: [], + packedInt64: [], + packedUint32: [], + packedUint64: [], + packedSint32: [], + packedSint64: [], + packedFixed32: [], + packedFixed64: [], + packedSfixed32: [], + packedSfixed64: [], + packedFloat: [], + packedDouble: [], + packedBool: [], + packedNestedEnum: [], + unpackedInt32: [], + unpackedInt64: [], + unpackedUint32: [], + unpackedUint64: [], + unpackedSint32: [], + unpackedSint64: [], + unpackedFixed32: [], + unpackedFixed64: [], + unpackedSfixed32: [], + unpackedSfixed64: [], + unpackedFloat: [], + unpackedDouble: [], + unpackedBool: [], + unpackedNestedEnum: [], + mapInt32Int32: {}, + mapInt64Int64: {}, + mapUint32Uint32: {}, + mapUint64Uint64: {}, + mapSint32Sint32: {}, + mapSint64Sint64: {}, + mapFixed32Fixed32: {}, + mapFixed64Fixed64: {}, + mapSfixed32Sfixed32: {}, + mapSfixed64Sfixed64: {}, + mapInt32Float: {}, + mapInt32Double: {}, + mapBoolBool: {}, + mapStringString: {}, + mapStringBytes: {}, + mapStringNestedMessage: {}, + mapStringForeignMessage: {}, + mapStringNestedEnum: {}, + mapStringForeignEnum: {}, + oneofUint32: undefined, + oneofNestedMessage: undefined, + oneofString: undefined, + oneofBytes: undefined, + oneofBool: undefined, + oneofUint64: undefined, + oneofFloat: undefined, + oneofDouble: undefined, + oneofEnum: undefined, + oneofNullValue: undefined, + optionalBoolWrapper: protoscript.BoolValue.initialize(), + optionalInt32Wrapper: protoscript.Int32Value.initialize(), + optionalInt64Wrapper: protoscript.Int64Value.initialize(), + optionalUint32Wrapper: protoscript.UInt32Value.initialize(), + optionalUint64Wrapper: protoscript.UInt64Value.initialize(), + optionalFloatWrapper: protoscript.FloatValue.initialize(), + optionalDoubleWrapper: protoscript.DoubleValue.initialize(), + optionalStringWrapper: protoscript.StringValue.initialize(), + optionalBytesWrapper: protoscript.BytesValue.initialize(), + repeatedBoolWrapper: [], + repeatedInt32Wrapper: [], + repeatedInt64Wrapper: [], + repeatedUint32Wrapper: [], + repeatedUint64Wrapper: [], + repeatedFloatWrapper: [], + repeatedDoubleWrapper: [], + repeatedStringWrapper: [], + repeatedBytesWrapper: [], + optionalDuration: protoscript.Duration.initialize(), + optionalTimestamp: protoscript.Timestamp.initialize(), + optionalFieldMask: protoscript.FieldMask.initialize(), + optionalStruct: protoscript.Struct.initialize(), + optionalAny: protoscript.Any.initialize(), + optionalValue: protoscript.Value.initialize(), + optionalNullValue: protoscript.NullValue._fromInt(0), + repeatedDuration: [], + repeatedTimestamp: [], + repeatedFieldmask: [], + repeatedStruct: [], + repeatedAny: [], + repeatedValue: [], + repeatedListValue: [], + fieldname1: 0, + fieldName2: 0, + fieldName3: 0, + fieldName4: 0, + field0name5: 0, + field0Name6: 0, + fieldName7: 0, + FieldName8: 0, + fieldName9: 0, + FieldName10: 0, + FIELDNAME11: 0, + FIELDName12: 0, + fieldName13: 0, + FieldName14: 0, + fieldName15: 0, + fieldName16: 0, + fieldName17: 0, + FieldName18: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.optionalInt32) { + writer.writeInt32(1, msg.optionalInt32); + } + if (msg.optionalInt64) { + writer.writeInt64String(2, msg.optionalInt64.toString() as any); + } + if (msg.optionalUint32) { + writer.writeUint32(3, msg.optionalUint32); + } + if (msg.optionalUint64) { + writer.writeUint64String(4, msg.optionalUint64.toString() as any); + } + if (msg.optionalSint32) { + writer.writeSint32(5, msg.optionalSint32); + } + if (msg.optionalSint64) { + writer.writeSint64String(6, msg.optionalSint64.toString() as any); + } + if (msg.optionalFixed32) { + writer.writeFixed32(7, msg.optionalFixed32); + } + if (msg.optionalFixed64) { + writer.writeFixed64String(8, msg.optionalFixed64.toString() as any); + } + if (msg.optionalSfixed32) { + writer.writeSfixed32(9, msg.optionalSfixed32); + } + if (msg.optionalSfixed64) { + writer.writeSfixed64String(10, msg.optionalSfixed64.toString() as any); + } + if (msg.optionalFloat) { + writer.writeFloat(11, msg.optionalFloat); + } + if (msg.optionalDouble) { + writer.writeDouble(12, msg.optionalDouble); + } + if (msg.optionalBool) { + writer.writeBool(13, msg.optionalBool); + } + if (msg.optionalString) { + writer.writeString(14, msg.optionalString); + } + if (msg.optionalBytes?.length) { + writer.writeBytes(15, msg.optionalBytes); + } + if (msg.optionalNestedMessage) { + writer.writeMessage( + 18, + msg.optionalNestedMessage, + TestAllTypesProto3.NestedMessage._writeMessage + ); + } + if (msg.optionalForeignMessage) { + writer.writeMessage( + 19, + msg.optionalForeignMessage, + ForeignMessage._writeMessage + ); + } + if ( + msg.optionalNestedEnum && + TestAllTypesProto3.NestedEnum._toInt(msg.optionalNestedEnum) + ) { + writer.writeEnum( + 21, + TestAllTypesProto3.NestedEnum._toInt(msg.optionalNestedEnum) + ); + } + if ( + msg.optionalForeignEnum && + ForeignEnum._toInt(msg.optionalForeignEnum) + ) { + writer.writeEnum(22, ForeignEnum._toInt(msg.optionalForeignEnum)); + } + if ( + msg.optionalAliasedEnum && + TestAllTypesProto3.AliasedEnum._toInt(msg.optionalAliasedEnum) + ) { + writer.writeEnum( + 23, + TestAllTypesProto3.AliasedEnum._toInt(msg.optionalAliasedEnum) + ); + } + if (msg.optionalStringPiece) { + writer.writeString(24, msg.optionalStringPiece); + } + if (msg.optionalCord) { + writer.writeString(25, msg.optionalCord); + } + if (msg.recursiveMessage) { + writer.writeMessage( + 27, + msg.recursiveMessage, + TestAllTypesProto3._writeMessage + ); + } + if (msg.repeatedInt32?.length) { + writer.writePackedInt32(31, msg.repeatedInt32); + } + if (msg.repeatedInt64?.length) { + writer.writePackedInt64String( + 32, + msg.repeatedInt64.map((x) => x.toString() as any) + ); + } + if (msg.repeatedUint32?.length) { + writer.writePackedUint32(33, msg.repeatedUint32); + } + if (msg.repeatedUint64?.length) { + writer.writePackedUint64String( + 34, + msg.repeatedUint64.map((x) => x.toString() as any) + ); + } + if (msg.repeatedSint32?.length) { + writer.writePackedSint32(35, msg.repeatedSint32); + } + if (msg.repeatedSint64?.length) { + writer.writePackedSint64String( + 36, + msg.repeatedSint64.map((x) => x.toString() as any) + ); + } + if (msg.repeatedFixed32?.length) { + writer.writePackedFixed32(37, msg.repeatedFixed32); + } + if (msg.repeatedFixed64?.length) { + writer.writePackedFixed64String( + 38, + msg.repeatedFixed64.map((x) => x.toString() as any) + ); + } + if (msg.repeatedSfixed32?.length) { + writer.writePackedSfixed32(39, msg.repeatedSfixed32); + } + if (msg.repeatedSfixed64?.length) { + writer.writePackedSfixed64String( + 40, + msg.repeatedSfixed64.map((x) => x.toString() as any) + ); + } + if (msg.repeatedFloat?.length) { + writer.writePackedFloat(41, msg.repeatedFloat); + } + if (msg.repeatedDouble?.length) { + writer.writePackedDouble(42, msg.repeatedDouble); + } + if (msg.repeatedBool?.length) { + writer.writePackedBool(43, msg.repeatedBool); + } + if (msg.repeatedString?.length) { + writer.writeRepeatedString(44, msg.repeatedString); + } + if (msg.repeatedBytes?.length) { + writer.writeRepeatedBytes(45, msg.repeatedBytes); + } + if (msg.repeatedNestedMessage?.length) { + writer.writeRepeatedMessage( + 48, + msg.repeatedNestedMessage as any, + TestAllTypesProto3.NestedMessage._writeMessage + ); + } + if (msg.repeatedForeignMessage?.length) { + writer.writeRepeatedMessage( + 49, + msg.repeatedForeignMessage as any, + ForeignMessage._writeMessage + ); + } + if (msg.repeatedNestedEnum?.length) { + writer.writePackedEnum( + 51, + msg.repeatedNestedEnum.map(TestAllTypesProto3.NestedEnum._toInt) + ); + } + if (msg.repeatedForeignEnum?.length) { + writer.writePackedEnum( + 52, + msg.repeatedForeignEnum.map(ForeignEnum._toInt) + ); + } + if (msg.repeatedStringPiece?.length) { + writer.writeRepeatedString(54, msg.repeatedStringPiece); + } + if (msg.repeatedCord?.length) { + writer.writeRepeatedString(55, msg.repeatedCord); + } + if (msg.packedInt32?.length) { + writer.writePackedInt32(75, msg.packedInt32); + } + if (msg.packedInt64?.length) { + writer.writePackedInt64String( + 76, + msg.packedInt64.map((x) => x.toString() as any) + ); + } + if (msg.packedUint32?.length) { + writer.writePackedUint32(77, msg.packedUint32); + } + if (msg.packedUint64?.length) { + writer.writePackedUint64String( + 78, + msg.packedUint64.map((x) => x.toString() as any) + ); + } + if (msg.packedSint32?.length) { + writer.writePackedSint32(79, msg.packedSint32); + } + if (msg.packedSint64?.length) { + writer.writePackedSint64String( + 80, + msg.packedSint64.map((x) => x.toString() as any) + ); + } + if (msg.packedFixed32?.length) { + writer.writePackedFixed32(81, msg.packedFixed32); + } + if (msg.packedFixed64?.length) { + writer.writePackedFixed64String( + 82, + msg.packedFixed64.map((x) => x.toString() as any) + ); + } + if (msg.packedSfixed32?.length) { + writer.writePackedSfixed32(83, msg.packedSfixed32); + } + if (msg.packedSfixed64?.length) { + writer.writePackedSfixed64String( + 84, + msg.packedSfixed64.map((x) => x.toString() as any) + ); + } + if (msg.packedFloat?.length) { + writer.writePackedFloat(85, msg.packedFloat); + } + if (msg.packedDouble?.length) { + writer.writePackedDouble(86, msg.packedDouble); + } + if (msg.packedBool?.length) { + writer.writePackedBool(87, msg.packedBool); + } + if (msg.packedNestedEnum?.length) { + writer.writePackedEnum( + 88, + msg.packedNestedEnum.map(TestAllTypesProto3.NestedEnum._toInt) + ); + } + if (msg.unpackedInt32?.length) { + writer.writePackedInt32(89, msg.unpackedInt32); + } + if (msg.unpackedInt64?.length) { + writer.writePackedInt64String( + 90, + msg.unpackedInt64.map((x) => x.toString() as any) + ); + } + if (msg.unpackedUint32?.length) { + writer.writePackedUint32(91, msg.unpackedUint32); + } + if (msg.unpackedUint64?.length) { + writer.writePackedUint64String( + 92, + msg.unpackedUint64.map((x) => x.toString() as any) + ); + } + if (msg.unpackedSint32?.length) { + writer.writePackedSint32(93, msg.unpackedSint32); + } + if (msg.unpackedSint64?.length) { + writer.writePackedSint64String( + 94, + msg.unpackedSint64.map((x) => x.toString() as any) + ); + } + if (msg.unpackedFixed32?.length) { + writer.writePackedFixed32(95, msg.unpackedFixed32); + } + if (msg.unpackedFixed64?.length) { + writer.writePackedFixed64String( + 96, + msg.unpackedFixed64.map((x) => x.toString() as any) + ); + } + if (msg.unpackedSfixed32?.length) { + writer.writePackedSfixed32(97, msg.unpackedSfixed32); + } + if (msg.unpackedSfixed64?.length) { + writer.writePackedSfixed64String( + 98, + msg.unpackedSfixed64.map((x) => x.toString() as any) + ); + } + if (msg.unpackedFloat?.length) { + writer.writePackedFloat(99, msg.unpackedFloat); + } + if (msg.unpackedDouble?.length) { + writer.writePackedDouble(100, msg.unpackedDouble); + } + if (msg.unpackedBool?.length) { + writer.writePackedBool(101, msg.unpackedBool); + } + if (msg.unpackedNestedEnum?.length) { + writer.writePackedEnum( + 102, + msg.unpackedNestedEnum.map(TestAllTypesProto3.NestedEnum._toInt) + ); + } + if (msg.mapInt32Int32) { + writer.writeRepeatedMessage( + 56, + Object.entries(msg.mapInt32Int32).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapInt32Int32._writeMessage + ); + } + if (msg.mapInt64Int64) { + writer.writeRepeatedMessage( + 57, + Object.entries(msg.mapInt64Int64).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapInt64Int64._writeMessage + ); + } + if (msg.mapUint32Uint32) { + writer.writeRepeatedMessage( + 58, + Object.entries(msg.mapUint32Uint32).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapUint32Uint32._writeMessage + ); + } + if (msg.mapUint64Uint64) { + writer.writeRepeatedMessage( + 59, + Object.entries(msg.mapUint64Uint64).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapUint64Uint64._writeMessage + ); + } + if (msg.mapSint32Sint32) { + writer.writeRepeatedMessage( + 60, + Object.entries(msg.mapSint32Sint32).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapSint32Sint32._writeMessage + ); + } + if (msg.mapSint64Sint64) { + writer.writeRepeatedMessage( + 61, + Object.entries(msg.mapSint64Sint64).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapSint64Sint64._writeMessage + ); + } + if (msg.mapFixed32Fixed32) { + writer.writeRepeatedMessage( + 62, + Object.entries(msg.mapFixed32Fixed32).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapFixed32Fixed32._writeMessage + ); + } + if (msg.mapFixed64Fixed64) { + writer.writeRepeatedMessage( + 63, + Object.entries(msg.mapFixed64Fixed64).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapFixed64Fixed64._writeMessage + ); + } + if (msg.mapSfixed32Sfixed32) { + writer.writeRepeatedMessage( + 64, + Object.entries(msg.mapSfixed32Sfixed32).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapSfixed32Sfixed32._writeMessage + ); + } + if (msg.mapSfixed64Sfixed64) { + writer.writeRepeatedMessage( + 65, + Object.entries(msg.mapSfixed64Sfixed64).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapSfixed64Sfixed64._writeMessage + ); + } + if (msg.mapInt32Float) { + writer.writeRepeatedMessage( + 66, + Object.entries(msg.mapInt32Float).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapInt32Float._writeMessage + ); + } + if (msg.mapInt32Double) { + writer.writeRepeatedMessage( + 67, + Object.entries(msg.mapInt32Double).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapInt32Double._writeMessage + ); + } + if (msg.mapBoolBool) { + writer.writeRepeatedMessage( + 68, + Object.entries(msg.mapBoolBool).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapBoolBool._writeMessage + ); + } + if (msg.mapStringString) { + writer.writeRepeatedMessage( + 69, + Object.entries(msg.mapStringString).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapStringString._writeMessage + ); + } + if (msg.mapStringBytes) { + writer.writeRepeatedMessage( + 70, + Object.entries(msg.mapStringBytes).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapStringBytes._writeMessage + ); + } + if (msg.mapStringNestedMessage) { + writer.writeRepeatedMessage( + 71, + Object.entries(msg.mapStringNestedMessage).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapStringNestedMessage._writeMessage + ); + } + if (msg.mapStringForeignMessage) { + writer.writeRepeatedMessage( + 72, + Object.entries(msg.mapStringForeignMessage).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapStringForeignMessage._writeMessage + ); + } + if (msg.mapStringNestedEnum) { + writer.writeRepeatedMessage( + 73, + Object.entries(msg.mapStringNestedEnum).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapStringNestedEnum._writeMessage + ); + } + if (msg.mapStringForeignEnum) { + writer.writeRepeatedMessage( + 74, + Object.entries(msg.mapStringForeignEnum).map(([key, value]) => ({ + key: key as any, + value: value as any, + })) as any, + TestAllTypesProto3.MapStringForeignEnum._writeMessage + ); + } + if (msg.oneofUint32 != undefined) { + writer.writeUint32(111, msg.oneofUint32); + } + if (msg.oneofNestedMessage != undefined) { + writer.writeMessage( + 112, + msg.oneofNestedMessage, + TestAllTypesProto3.NestedMessage._writeMessage + ); + } + if (msg.oneofString != undefined) { + writer.writeString(113, msg.oneofString); + } + if (msg.oneofBytes?.length) { + writer.writeBytes(114, msg.oneofBytes); + } + if (msg.oneofBool != undefined) { + writer.writeBool(115, msg.oneofBool); + } + if (msg.oneofUint64 != undefined) { + writer.writeUint64String(116, msg.oneofUint64.toString() as any); + } + if (msg.oneofFloat != undefined) { + writer.writeFloat(117, msg.oneofFloat); + } + if (msg.oneofDouble != undefined) { + writer.writeDouble(118, msg.oneofDouble); + } + if (msg.oneofEnum != undefined) { + writer.writeEnum( + 119, + TestAllTypesProto3.NestedEnum._toInt(msg.oneofEnum) + ); + } + if (msg.oneofNullValue != undefined) { + writer.writeEnum(120, protoscript.NullValue._toInt(msg.oneofNullValue)); + } + if (msg.optionalBoolWrapper) { + writer.writeMessage( + 201, + msg.optionalBoolWrapper, + protoscript.BoolValue._writeMessage + ); + } + if (msg.optionalInt32Wrapper) { + writer.writeMessage( + 202, + msg.optionalInt32Wrapper, + protoscript.Int32Value._writeMessage + ); + } + if (msg.optionalInt64Wrapper) { + writer.writeMessage( + 203, + msg.optionalInt64Wrapper, + protoscript.Int64Value._writeMessage + ); + } + if (msg.optionalUint32Wrapper) { + writer.writeMessage( + 204, + msg.optionalUint32Wrapper, + protoscript.UInt32Value._writeMessage + ); + } + if (msg.optionalUint64Wrapper) { + writer.writeMessage( + 205, + msg.optionalUint64Wrapper, + protoscript.UInt64Value._writeMessage + ); + } + if (msg.optionalFloatWrapper) { + writer.writeMessage( + 206, + msg.optionalFloatWrapper, + protoscript.FloatValue._writeMessage + ); + } + if (msg.optionalDoubleWrapper) { + writer.writeMessage( + 207, + msg.optionalDoubleWrapper, + protoscript.DoubleValue._writeMessage + ); + } + if (msg.optionalStringWrapper) { + writer.writeMessage( + 208, + msg.optionalStringWrapper, + protoscript.StringValue._writeMessage + ); + } + if (msg.optionalBytesWrapper) { + writer.writeMessage( + 209, + msg.optionalBytesWrapper, + protoscript.BytesValue._writeMessage + ); + } + if (msg.repeatedBoolWrapper?.length) { + writer.writeRepeatedMessage( + 211, + msg.repeatedBoolWrapper as any, + protoscript.BoolValue._writeMessage + ); + } + if (msg.repeatedInt32Wrapper?.length) { + writer.writeRepeatedMessage( + 212, + msg.repeatedInt32Wrapper as any, + protoscript.Int32Value._writeMessage + ); + } + if (msg.repeatedInt64Wrapper?.length) { + writer.writeRepeatedMessage( + 213, + msg.repeatedInt64Wrapper as any, + protoscript.Int64Value._writeMessage + ); + } + if (msg.repeatedUint32Wrapper?.length) { + writer.writeRepeatedMessage( + 214, + msg.repeatedUint32Wrapper as any, + protoscript.UInt32Value._writeMessage + ); + } + if (msg.repeatedUint64Wrapper?.length) { + writer.writeRepeatedMessage( + 215, + msg.repeatedUint64Wrapper as any, + protoscript.UInt64Value._writeMessage + ); + } + if (msg.repeatedFloatWrapper?.length) { + writer.writeRepeatedMessage( + 216, + msg.repeatedFloatWrapper as any, + protoscript.FloatValue._writeMessage + ); + } + if (msg.repeatedDoubleWrapper?.length) { + writer.writeRepeatedMessage( + 217, + msg.repeatedDoubleWrapper as any, + protoscript.DoubleValue._writeMessage + ); + } + if (msg.repeatedStringWrapper?.length) { + writer.writeRepeatedMessage( + 218, + msg.repeatedStringWrapper as any, + protoscript.StringValue._writeMessage + ); + } + if (msg.repeatedBytesWrapper?.length) { + writer.writeRepeatedMessage( + 219, + msg.repeatedBytesWrapper as any, + protoscript.BytesValue._writeMessage + ); + } + if (msg.optionalDuration) { + writer.writeMessage( + 301, + msg.optionalDuration, + protoscript.Duration._writeMessage + ); + } + if (msg.optionalTimestamp) { + writer.writeMessage( + 302, + msg.optionalTimestamp, + protoscript.Timestamp._writeMessage + ); + } + if (msg.optionalFieldMask) { + writer.writeMessage( + 303, + msg.optionalFieldMask, + protoscript.FieldMask._writeMessage + ); + } + if (msg.optionalStruct) { + writer.writeMessage( + 304, + msg.optionalStruct, + protoscript.Struct._writeMessage + ); + } + if (msg.optionalAny) { + writer.writeMessage(305, msg.optionalAny, protoscript.Any._writeMessage); + } + if (msg.optionalValue) { + writer.writeMessage( + 306, + msg.optionalValue, + protoscript.Value._writeMessage + ); + } + if ( + msg.optionalNullValue && + protoscript.NullValue._toInt(msg.optionalNullValue) + ) { + writer.writeEnum( + 307, + protoscript.NullValue._toInt(msg.optionalNullValue) + ); + } + if (msg.repeatedDuration?.length) { + writer.writeRepeatedMessage( + 311, + msg.repeatedDuration as any, + protoscript.Duration._writeMessage + ); + } + if (msg.repeatedTimestamp?.length) { + writer.writeRepeatedMessage( + 312, + msg.repeatedTimestamp as any, + protoscript.Timestamp._writeMessage + ); + } + if (msg.repeatedFieldmask?.length) { + writer.writeRepeatedMessage( + 313, + msg.repeatedFieldmask as any, + protoscript.FieldMask._writeMessage + ); + } + if (msg.repeatedStruct?.length) { + writer.writeRepeatedMessage( + 324, + msg.repeatedStruct as any, + protoscript.Struct._writeMessage + ); + } + if (msg.repeatedAny?.length) { + writer.writeRepeatedMessage( + 315, + msg.repeatedAny as any, + protoscript.Any._writeMessage + ); + } + if (msg.repeatedValue?.length) { + writer.writeRepeatedMessage( + 316, + msg.repeatedValue as any, + protoscript.Value._writeMessage + ); + } + if (msg.repeatedListValue?.length) { + writer.writeRepeatedMessage( + 317, + msg.repeatedListValue as any, + protoscript.ListValue._writeMessage + ); + } + if (msg.fieldname1) { + writer.writeInt32(401, msg.fieldname1); + } + if (msg.fieldName2) { + writer.writeInt32(402, msg.fieldName2); + } + if (msg.fieldName3) { + writer.writeInt32(403, msg.fieldName3); + } + if (msg.fieldName4) { + writer.writeInt32(404, msg.fieldName4); + } + if (msg.field0name5) { + writer.writeInt32(405, msg.field0name5); + } + if (msg.field0Name6) { + writer.writeInt32(406, msg.field0Name6); + } + if (msg.fieldName7) { + writer.writeInt32(407, msg.fieldName7); + } + if (msg.FieldName8) { + writer.writeInt32(408, msg.FieldName8); + } + if (msg.fieldName9) { + writer.writeInt32(409, msg.fieldName9); + } + if (msg.FieldName10) { + writer.writeInt32(410, msg.FieldName10); + } + if (msg.FIELDNAME11) { + writer.writeInt32(411, msg.FIELDNAME11); + } + if (msg.FIELDName12) { + writer.writeInt32(412, msg.FIELDName12); + } + if (msg.fieldName13) { + writer.writeInt32(413, msg.fieldName13); + } + if (msg.FieldName14) { + writer.writeInt32(414, msg.FieldName14); + } + if (msg.fieldName15) { + writer.writeInt32(415, msg.fieldName15); + } + if (msg.fieldName16) { + writer.writeInt32(416, msg.fieldName16); + } + if (msg.fieldName17) { + writer.writeInt32(417, msg.fieldName17); + } + if (msg.FieldName18) { + writer.writeInt32(418, msg.FieldName18); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3, + reader: BinaryReader + ): TestAllTypesProto3 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.optionalInt32 = reader.readInt32(); + break; + } + case 2: { + msg.optionalInt64 = BigInt(reader.readInt64String()); + break; + } + case 3: { + msg.optionalUint32 = reader.readUint32(); + break; + } + case 4: { + msg.optionalUint64 = BigInt(reader.readUint64String()); + break; + } + case 5: { + msg.optionalSint32 = reader.readSint32(); + break; + } + case 6: { + msg.optionalSint64 = BigInt(reader.readSint64String()); + break; + } + case 7: { + msg.optionalFixed32 = reader.readFixed32(); + break; + } + case 8: { + msg.optionalFixed64 = BigInt(reader.readFixed64String()); + break; + } + case 9: { + msg.optionalSfixed32 = reader.readSfixed32(); + break; + } + case 10: { + msg.optionalSfixed64 = BigInt(reader.readSfixed64String()); + break; + } + case 11: { + msg.optionalFloat = reader.readFloat(); + break; + } + case 12: { + msg.optionalDouble = reader.readDouble(); + break; + } + case 13: { + msg.optionalBool = reader.readBool(); + break; + } + case 14: { + msg.optionalString = reader.readString(); + break; + } + case 15: { + msg.optionalBytes = reader.readBytes(); + break; + } + case 18: { + reader.readMessage( + msg.optionalNestedMessage, + TestAllTypesProto3.NestedMessage._readMessage + ); + break; + } + case 19: { + reader.readMessage( + msg.optionalForeignMessage, + ForeignMessage._readMessage + ); + break; + } + case 21: { + msg.optionalNestedEnum = TestAllTypesProto3.NestedEnum._fromInt( + reader.readEnum() + ); + break; + } + case 22: { + msg.optionalForeignEnum = ForeignEnum._fromInt(reader.readEnum()); + break; + } + case 23: { + msg.optionalAliasedEnum = TestAllTypesProto3.AliasedEnum._fromInt( + reader.readEnum() + ); + break; + } + case 24: { + msg.optionalStringPiece = reader.readString(); + break; + } + case 25: { + msg.optionalCord = reader.readString(); + break; + } + case 27: { + reader.readMessage( + msg.recursiveMessage, + TestAllTypesProto3._readMessage + ); + break; + } + case 31: { + if (reader.isDelimited()) { + msg.repeatedInt32.push(...reader.readPackedInt32()); + } else { + msg.repeatedInt32.push(reader.readInt32()); + } + break; + } + case 32: { + if (reader.isDelimited()) { + msg.repeatedInt64.push( + ...reader.readPackedInt64String().map(BigInt) + ); + } else { + msg.repeatedInt64.push(BigInt(reader.readInt64String())); + } + break; + } + case 33: { + if (reader.isDelimited()) { + msg.repeatedUint32.push(...reader.readPackedUint32()); + } else { + msg.repeatedUint32.push(reader.readUint32()); + } + break; + } + case 34: { + if (reader.isDelimited()) { + msg.repeatedUint64.push( + ...reader.readPackedUint64String().map(BigInt) + ); + } else { + msg.repeatedUint64.push(BigInt(reader.readUint64String())); + } + break; + } + case 35: { + if (reader.isDelimited()) { + msg.repeatedSint32.push(...reader.readPackedSint32()); + } else { + msg.repeatedSint32.push(reader.readSint32()); + } + break; + } + case 36: { + if (reader.isDelimited()) { + msg.repeatedSint64.push( + ...reader.readPackedSint64String().map(BigInt) + ); + } else { + msg.repeatedSint64.push(BigInt(reader.readSint64String())); + } + break; + } + case 37: { + if (reader.isDelimited()) { + msg.repeatedFixed32.push(...reader.readPackedFixed32()); + } else { + msg.repeatedFixed32.push(reader.readFixed32()); + } + break; + } + case 38: { + if (reader.isDelimited()) { + msg.repeatedFixed64.push( + ...reader.readPackedFixed64String().map(BigInt) + ); + } else { + msg.repeatedFixed64.push(BigInt(reader.readFixed64String())); + } + break; + } + case 39: { + if (reader.isDelimited()) { + msg.repeatedSfixed32.push(...reader.readPackedSfixed32()); + } else { + msg.repeatedSfixed32.push(reader.readSfixed32()); + } + break; + } + case 40: { + if (reader.isDelimited()) { + msg.repeatedSfixed64.push( + ...reader.readPackedSfixed64String().map(BigInt) + ); + } else { + msg.repeatedSfixed64.push(BigInt(reader.readSfixed64String())); + } + break; + } + case 41: { + if (reader.isDelimited()) { + msg.repeatedFloat.push(...reader.readPackedFloat()); + } else { + msg.repeatedFloat.push(reader.readFloat()); + } + break; + } + case 42: { + if (reader.isDelimited()) { + msg.repeatedDouble.push(...reader.readPackedDouble()); + } else { + msg.repeatedDouble.push(reader.readDouble()); + } + break; + } + case 43: { + if (reader.isDelimited()) { + msg.repeatedBool.push(...reader.readPackedBool()); + } else { + msg.repeatedBool.push(reader.readBool()); + } + break; + } + case 44: { + msg.repeatedString.push(reader.readString()); + break; + } + case 45: { + msg.repeatedBytes.push(reader.readBytes()); + break; + } + case 48: { + const m = TestAllTypesProto3.NestedMessage.initialize(); + reader.readMessage(m, TestAllTypesProto3.NestedMessage._readMessage); + msg.repeatedNestedMessage.push(m); + break; + } + case 49: { + const m = ForeignMessage.initialize(); + reader.readMessage(m, ForeignMessage._readMessage); + msg.repeatedForeignMessage.push(m); + break; + } + case 51: { + if (reader.isDelimited()) { + msg.repeatedNestedEnum.push( + ...reader + .readPackedEnum() + .map(TestAllTypesProto3.NestedEnum._fromInt) + ); + } else { + msg.repeatedNestedEnum.push( + TestAllTypesProto3.NestedEnum._fromInt(reader.readEnum()) + ); + } + break; + } + case 52: { + if (reader.isDelimited()) { + msg.repeatedForeignEnum.push( + ...reader.readPackedEnum().map(ForeignEnum._fromInt) + ); + } else { + msg.repeatedForeignEnum.push( + ForeignEnum._fromInt(reader.readEnum()) + ); + } + break; + } + case 54: { + msg.repeatedStringPiece.push(reader.readString()); + break; + } + case 55: { + msg.repeatedCord.push(reader.readString()); + break; + } + case 75: { + if (reader.isDelimited()) { + msg.packedInt32.push(...reader.readPackedInt32()); + } else { + msg.packedInt32.push(reader.readInt32()); + } + break; + } + case 76: { + if (reader.isDelimited()) { + msg.packedInt64.push(...reader.readPackedInt64String().map(BigInt)); + } else { + msg.packedInt64.push(BigInt(reader.readInt64String())); + } + break; + } + case 77: { + if (reader.isDelimited()) { + msg.packedUint32.push(...reader.readPackedUint32()); + } else { + msg.packedUint32.push(reader.readUint32()); + } + break; + } + case 78: { + if (reader.isDelimited()) { + msg.packedUint64.push( + ...reader.readPackedUint64String().map(BigInt) + ); + } else { + msg.packedUint64.push(BigInt(reader.readUint64String())); + } + break; + } + case 79: { + if (reader.isDelimited()) { + msg.packedSint32.push(...reader.readPackedSint32()); + } else { + msg.packedSint32.push(reader.readSint32()); + } + break; + } + case 80: { + if (reader.isDelimited()) { + msg.packedSint64.push( + ...reader.readPackedSint64String().map(BigInt) + ); + } else { + msg.packedSint64.push(BigInt(reader.readSint64String())); + } + break; + } + case 81: { + if (reader.isDelimited()) { + msg.packedFixed32.push(...reader.readPackedFixed32()); + } else { + msg.packedFixed32.push(reader.readFixed32()); + } + break; + } + case 82: { + if (reader.isDelimited()) { + msg.packedFixed64.push( + ...reader.readPackedFixed64String().map(BigInt) + ); + } else { + msg.packedFixed64.push(BigInt(reader.readFixed64String())); + } + break; + } + case 83: { + if (reader.isDelimited()) { + msg.packedSfixed32.push(...reader.readPackedSfixed32()); + } else { + msg.packedSfixed32.push(reader.readSfixed32()); + } + break; + } + case 84: { + if (reader.isDelimited()) { + msg.packedSfixed64.push( + ...reader.readPackedSfixed64String().map(BigInt) + ); + } else { + msg.packedSfixed64.push(BigInt(reader.readSfixed64String())); + } + break; + } + case 85: { + if (reader.isDelimited()) { + msg.packedFloat.push(...reader.readPackedFloat()); + } else { + msg.packedFloat.push(reader.readFloat()); + } + break; + } + case 86: { + if (reader.isDelimited()) { + msg.packedDouble.push(...reader.readPackedDouble()); + } else { + msg.packedDouble.push(reader.readDouble()); + } + break; + } + case 87: { + if (reader.isDelimited()) { + msg.packedBool.push(...reader.readPackedBool()); + } else { + msg.packedBool.push(reader.readBool()); + } + break; + } + case 88: { + if (reader.isDelimited()) { + msg.packedNestedEnum.push( + ...reader + .readPackedEnum() + .map(TestAllTypesProto3.NestedEnum._fromInt) + ); + } else { + msg.packedNestedEnum.push( + TestAllTypesProto3.NestedEnum._fromInt(reader.readEnum()) + ); + } + break; + } + case 89: { + if (reader.isDelimited()) { + msg.unpackedInt32.push(...reader.readPackedInt32()); + } else { + msg.unpackedInt32.push(reader.readInt32()); + } + break; + } + case 90: { + if (reader.isDelimited()) { + msg.unpackedInt64.push( + ...reader.readPackedInt64String().map(BigInt) + ); + } else { + msg.unpackedInt64.push(BigInt(reader.readInt64String())); + } + break; + } + case 91: { + if (reader.isDelimited()) { + msg.unpackedUint32.push(...reader.readPackedUint32()); + } else { + msg.unpackedUint32.push(reader.readUint32()); + } + break; + } + case 92: { + if (reader.isDelimited()) { + msg.unpackedUint64.push( + ...reader.readPackedUint64String().map(BigInt) + ); + } else { + msg.unpackedUint64.push(BigInt(reader.readUint64String())); + } + break; + } + case 93: { + if (reader.isDelimited()) { + msg.unpackedSint32.push(...reader.readPackedSint32()); + } else { + msg.unpackedSint32.push(reader.readSint32()); + } + break; + } + case 94: { + if (reader.isDelimited()) { + msg.unpackedSint64.push( + ...reader.readPackedSint64String().map(BigInt) + ); + } else { + msg.unpackedSint64.push(BigInt(reader.readSint64String())); + } + break; + } + case 95: { + if (reader.isDelimited()) { + msg.unpackedFixed32.push(...reader.readPackedFixed32()); + } else { + msg.unpackedFixed32.push(reader.readFixed32()); + } + break; + } + case 96: { + if (reader.isDelimited()) { + msg.unpackedFixed64.push( + ...reader.readPackedFixed64String().map(BigInt) + ); + } else { + msg.unpackedFixed64.push(BigInt(reader.readFixed64String())); + } + break; + } + case 97: { + if (reader.isDelimited()) { + msg.unpackedSfixed32.push(...reader.readPackedSfixed32()); + } else { + msg.unpackedSfixed32.push(reader.readSfixed32()); + } + break; + } + case 98: { + if (reader.isDelimited()) { + msg.unpackedSfixed64.push( + ...reader.readPackedSfixed64String().map(BigInt) + ); + } else { + msg.unpackedSfixed64.push(BigInt(reader.readSfixed64String())); + } + break; + } + case 99: { + if (reader.isDelimited()) { + msg.unpackedFloat.push(...reader.readPackedFloat()); + } else { + msg.unpackedFloat.push(reader.readFloat()); + } + break; + } + case 100: { + if (reader.isDelimited()) { + msg.unpackedDouble.push(...reader.readPackedDouble()); + } else { + msg.unpackedDouble.push(reader.readDouble()); + } + break; + } + case 101: { + if (reader.isDelimited()) { + msg.unpackedBool.push(...reader.readPackedBool()); + } else { + msg.unpackedBool.push(reader.readBool()); + } + break; + } + case 102: { + if (reader.isDelimited()) { + msg.unpackedNestedEnum.push( + ...reader + .readPackedEnum() + .map(TestAllTypesProto3.NestedEnum._fromInt) + ); + } else { + msg.unpackedNestedEnum.push( + TestAllTypesProto3.NestedEnum._fromInt(reader.readEnum()) + ); + } + break; + } + case 56: { + const map = {} as TestAllTypesProto3.MapInt32Int32; + reader.readMessage( + map, + TestAllTypesProto3.MapInt32Int32._readMessage + ); + msg.mapInt32Int32[map.key.toString()] = map.value; + break; + } + case 57: { + const map = {} as TestAllTypesProto3.MapInt64Int64; + reader.readMessage( + map, + TestAllTypesProto3.MapInt64Int64._readMessage + ); + msg.mapInt64Int64[map.key.toString()] = map.value; + break; + } + case 58: { + const map = {} as TestAllTypesProto3.MapUint32Uint32; + reader.readMessage( + map, + TestAllTypesProto3.MapUint32Uint32._readMessage + ); + msg.mapUint32Uint32[map.key.toString()] = map.value; + break; + } + case 59: { + const map = {} as TestAllTypesProto3.MapUint64Uint64; + reader.readMessage( + map, + TestAllTypesProto3.MapUint64Uint64._readMessage + ); + msg.mapUint64Uint64[map.key.toString()] = map.value; + break; + } + case 60: { + const map = {} as TestAllTypesProto3.MapSint32Sint32; + reader.readMessage( + map, + TestAllTypesProto3.MapSint32Sint32._readMessage + ); + msg.mapSint32Sint32[map.key.toString()] = map.value; + break; + } + case 61: { + const map = {} as TestAllTypesProto3.MapSint64Sint64; + reader.readMessage( + map, + TestAllTypesProto3.MapSint64Sint64._readMessage + ); + msg.mapSint64Sint64[map.key.toString()] = map.value; + break; + } + case 62: { + const map = {} as TestAllTypesProto3.MapFixed32Fixed32; + reader.readMessage( + map, + TestAllTypesProto3.MapFixed32Fixed32._readMessage + ); + msg.mapFixed32Fixed32[map.key.toString()] = map.value; + break; + } + case 63: { + const map = {} as TestAllTypesProto3.MapFixed64Fixed64; + reader.readMessage( + map, + TestAllTypesProto3.MapFixed64Fixed64._readMessage + ); + msg.mapFixed64Fixed64[map.key.toString()] = map.value; + break; + } + case 64: { + const map = {} as TestAllTypesProto3.MapSfixed32Sfixed32; + reader.readMessage( + map, + TestAllTypesProto3.MapSfixed32Sfixed32._readMessage + ); + msg.mapSfixed32Sfixed32[map.key.toString()] = map.value; + break; + } + case 65: { + const map = {} as TestAllTypesProto3.MapSfixed64Sfixed64; + reader.readMessage( + map, + TestAllTypesProto3.MapSfixed64Sfixed64._readMessage + ); + msg.mapSfixed64Sfixed64[map.key.toString()] = map.value; + break; + } + case 66: { + const map = {} as TestAllTypesProto3.MapInt32Float; + reader.readMessage( + map, + TestAllTypesProto3.MapInt32Float._readMessage + ); + msg.mapInt32Float[map.key.toString()] = map.value; + break; + } + case 67: { + const map = {} as TestAllTypesProto3.MapInt32Double; + reader.readMessage( + map, + TestAllTypesProto3.MapInt32Double._readMessage + ); + msg.mapInt32Double[map.key.toString()] = map.value; + break; + } + case 68: { + const map = {} as TestAllTypesProto3.MapBoolBool; + reader.readMessage(map, TestAllTypesProto3.MapBoolBool._readMessage); + msg.mapBoolBool[map.key.toString()] = map.value; + break; + } + case 69: { + const map = {} as TestAllTypesProto3.MapStringString; + reader.readMessage( + map, + TestAllTypesProto3.MapStringString._readMessage + ); + msg.mapStringString[map.key.toString()] = map.value; + break; + } + case 70: { + const map = {} as TestAllTypesProto3.MapStringBytes; + reader.readMessage( + map, + TestAllTypesProto3.MapStringBytes._readMessage + ); + msg.mapStringBytes[map.key.toString()] = map.value; + break; + } + case 71: { + const map = {} as TestAllTypesProto3.MapStringNestedMessage; + reader.readMessage( + map, + TestAllTypesProto3.MapStringNestedMessage._readMessage + ); + msg.mapStringNestedMessage[map.key.toString()] = map.value; + break; + } + case 72: { + const map = {} as TestAllTypesProto3.MapStringForeignMessage; + reader.readMessage( + map, + TestAllTypesProto3.MapStringForeignMessage._readMessage + ); + msg.mapStringForeignMessage[map.key.toString()] = map.value; + break; + } + case 73: { + const map = {} as TestAllTypesProto3.MapStringNestedEnum; + reader.readMessage( + map, + TestAllTypesProto3.MapStringNestedEnum._readMessage + ); + msg.mapStringNestedEnum[map.key.toString()] = map.value; + break; + } + case 74: { + const map = {} as TestAllTypesProto3.MapStringForeignEnum; + reader.readMessage( + map, + TestAllTypesProto3.MapStringForeignEnum._readMessage + ); + msg.mapStringForeignEnum[map.key.toString()] = map.value; + break; + } + case 111: { + msg.oneofUint32 = reader.readUint32(); + break; + } + case 112: { + msg.oneofNestedMessage = + TestAllTypesProto3.NestedMessage.initialize(); + reader.readMessage( + msg.oneofNestedMessage, + TestAllTypesProto3.NestedMessage._readMessage + ); + break; + } + case 113: { + msg.oneofString = reader.readString(); + break; + } + case 114: { + msg.oneofBytes = reader.readBytes(); + break; + } + case 115: { + msg.oneofBool = reader.readBool(); + break; + } + case 116: { + msg.oneofUint64 = BigInt(reader.readUint64String()); + break; + } + case 117: { + msg.oneofFloat = reader.readFloat(); + break; + } + case 118: { + msg.oneofDouble = reader.readDouble(); + break; + } + case 119: { + msg.oneofEnum = TestAllTypesProto3.NestedEnum._fromInt( + reader.readEnum() + ); + break; + } + case 120: { + msg.oneofNullValue = protoscript.NullValue._fromInt( + reader.readEnum() + ); + break; + } + case 201: { + reader.readMessage( + msg.optionalBoolWrapper, + protoscript.BoolValue._readMessage + ); + break; + } + case 202: { + reader.readMessage( + msg.optionalInt32Wrapper, + protoscript.Int32Value._readMessage + ); + break; + } + case 203: { + reader.readMessage( + msg.optionalInt64Wrapper, + protoscript.Int64Value._readMessage + ); + break; + } + case 204: { + reader.readMessage( + msg.optionalUint32Wrapper, + protoscript.UInt32Value._readMessage + ); + break; + } + case 205: { + reader.readMessage( + msg.optionalUint64Wrapper, + protoscript.UInt64Value._readMessage + ); + break; + } + case 206: { + reader.readMessage( + msg.optionalFloatWrapper, + protoscript.FloatValue._readMessage + ); + break; + } + case 207: { + reader.readMessage( + msg.optionalDoubleWrapper, + protoscript.DoubleValue._readMessage + ); + break; + } + case 208: { + reader.readMessage( + msg.optionalStringWrapper, + protoscript.StringValue._readMessage + ); + break; + } + case 209: { + reader.readMessage( + msg.optionalBytesWrapper, + protoscript.BytesValue._readMessage + ); + break; + } + case 211: { + const m = protoscript.BoolValue.initialize(); + reader.readMessage(m, protoscript.BoolValue._readMessage); + msg.repeatedBoolWrapper.push(m); + break; + } + case 212: { + const m = protoscript.Int32Value.initialize(); + reader.readMessage(m, protoscript.Int32Value._readMessage); + msg.repeatedInt32Wrapper.push(m); + break; + } + case 213: { + const m = protoscript.Int64Value.initialize(); + reader.readMessage(m, protoscript.Int64Value._readMessage); + msg.repeatedInt64Wrapper.push(m); + break; + } + case 214: { + const m = protoscript.UInt32Value.initialize(); + reader.readMessage(m, protoscript.UInt32Value._readMessage); + msg.repeatedUint32Wrapper.push(m); + break; + } + case 215: { + const m = protoscript.UInt64Value.initialize(); + reader.readMessage(m, protoscript.UInt64Value._readMessage); + msg.repeatedUint64Wrapper.push(m); + break; + } + case 216: { + const m = protoscript.FloatValue.initialize(); + reader.readMessage(m, protoscript.FloatValue._readMessage); + msg.repeatedFloatWrapper.push(m); + break; + } + case 217: { + const m = protoscript.DoubleValue.initialize(); + reader.readMessage(m, protoscript.DoubleValue._readMessage); + msg.repeatedDoubleWrapper.push(m); + break; + } + case 218: { + const m = protoscript.StringValue.initialize(); + reader.readMessage(m, protoscript.StringValue._readMessage); + msg.repeatedStringWrapper.push(m); + break; + } + case 219: { + const m = protoscript.BytesValue.initialize(); + reader.readMessage(m, protoscript.BytesValue._readMessage); + msg.repeatedBytesWrapper.push(m); + break; + } + case 301: { + reader.readMessage( + msg.optionalDuration, + protoscript.Duration._readMessage + ); + break; + } + case 302: { + reader.readMessage( + msg.optionalTimestamp, + protoscript.Timestamp._readMessage + ); + break; + } + case 303: { + reader.readMessage( + msg.optionalFieldMask, + protoscript.FieldMask._readMessage + ); + break; + } + case 304: { + reader.readMessage( + msg.optionalStruct, + protoscript.Struct._readMessage + ); + break; + } + case 305: { + reader.readMessage(msg.optionalAny, protoscript.Any._readMessage); + break; + } + case 306: { + reader.readMessage(msg.optionalValue, protoscript.Value._readMessage); + break; + } + case 307: { + msg.optionalNullValue = protoscript.NullValue._fromInt( + reader.readEnum() + ); + break; + } + case 311: { + const m = protoscript.Duration.initialize(); + reader.readMessage(m, protoscript.Duration._readMessage); + msg.repeatedDuration.push(m); + break; + } + case 312: { + const m = protoscript.Timestamp.initialize(); + reader.readMessage(m, protoscript.Timestamp._readMessage); + msg.repeatedTimestamp.push(m); + break; + } + case 313: { + const m = protoscript.FieldMask.initialize(); + reader.readMessage(m, protoscript.FieldMask._readMessage); + msg.repeatedFieldmask.push(m); + break; + } + case 324: { + const m = protoscript.Struct.initialize(); + reader.readMessage(m, protoscript.Struct._readMessage); + msg.repeatedStruct.push(m); + break; + } + case 315: { + const m = protoscript.Any.initialize(); + reader.readMessage(m, protoscript.Any._readMessage); + msg.repeatedAny.push(m); + break; + } + case 316: { + const m = protoscript.Value.initialize(); + reader.readMessage(m, protoscript.Value._readMessage); + msg.repeatedValue.push(m); + break; + } + case 317: { + const m = protoscript.ListValue.initialize(); + reader.readMessage(m, protoscript.ListValue._readMessage); + msg.repeatedListValue.push(m); + break; + } + case 401: { + msg.fieldname1 = reader.readInt32(); + break; + } + case 402: { + msg.fieldName2 = reader.readInt32(); + break; + } + case 403: { + msg.fieldName3 = reader.readInt32(); + break; + } + case 404: { + msg.fieldName4 = reader.readInt32(); + break; + } + case 405: { + msg.field0name5 = reader.readInt32(); + break; + } + case 406: { + msg.field0Name6 = reader.readInt32(); + break; + } + case 407: { + msg.fieldName7 = reader.readInt32(); + break; + } + case 408: { + msg.FieldName8 = reader.readInt32(); + break; + } + case 409: { + msg.fieldName9 = reader.readInt32(); + break; + } + case 410: { + msg.FieldName10 = reader.readInt32(); + break; + } + case 411: { + msg.FIELDNAME11 = reader.readInt32(); + break; + } + case 412: { + msg.FIELDName12 = reader.readInt32(); + break; + } + case 413: { + msg.fieldName13 = reader.readInt32(); + break; + } + case 414: { + msg.FieldName14 = reader.readInt32(); + break; + } + case 415: { + msg.fieldName15 = reader.readInt32(); + break; + } + case 416: { + msg.fieldName16 = reader.readInt32(); + break; + } + case 417: { + msg.fieldName17 = reader.readInt32(); + break; + } + case 418: { + msg.FieldName18 = reader.readInt32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + + NestedEnum: { + FOO: "FOO", + BAR: "BAR", + BAZ: "BAZ", + NEG: "NEG", + /** + * @private + */ + _fromInt: function (i: number): TestAllTypesProto3.NestedEnum { + switch (i) { + case 0: { + return "FOO"; + } + case 1: { + return "BAR"; + } + case 2: { + return "BAZ"; + } + case -1: { + return "NEG"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as TestAllTypesProto3.NestedEnum; + } + } + }, + /** + * @private + */ + _toInt: function (i: TestAllTypesProto3.NestedEnum): number { + switch (i) { + case "FOO": { + return 0; + } + case "BAR": { + return 1; + } + case "BAZ": { + return 2; + } + case "NEG": { + return -1; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, + } as const, + + AliasedEnum: { + ALIAS_FOO: "ALIAS_FOO", + ALIAS_BAR: "ALIAS_BAR", + ALIAS_BAZ: "ALIAS_BAZ", + MOO: "MOO", + moo: "moo", + bAz: "bAz", + /** + * @private + */ + _fromInt: function (i: number): TestAllTypesProto3.AliasedEnum { + switch (i) { + case 0: { + return "ALIAS_FOO"; + } + case 1: { + return "ALIAS_BAR"; + } + case 2: { + return "ALIAS_BAZ"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as TestAllTypesProto3.AliasedEnum; + } + } + }, + /** + * @private + */ + _toInt: function (i: TestAllTypesProto3.AliasedEnum): number { + switch (i) { + case "ALIAS_FOO": { + return 0; + } + case "ALIAS_BAR": { + return 1; + } + case "ALIAS_BAZ": { + return 2; + } + case "MOO": { + return 2; + } + case "moo": { + return 2; + } + case "bAz": { + return 2; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, + } as const, + + NestedMessage: { + /** + * Serializes TestAllTypesProto3.NestedMessage to protobuf. + */ + encode: function ( + msg: Partial + ): Uint8Array { + return TestAllTypesProto3.NestedMessage._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes TestAllTypesProto3.NestedMessage from protobuf. + */ + decode: function (bytes: ByteSource): TestAllTypesProto3.NestedMessage { + return TestAllTypesProto3.NestedMessage._readMessage( + TestAllTypesProto3.NestedMessage.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes TestAllTypesProto3.NestedMessage with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto3.NestedMessage { + return { + a: 0, + corecursive: undefined, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.a) { + writer.writeInt32(1, msg.a); + } + if (msg.corecursive) { + writer.writeMessage( + 2, + msg.corecursive, + TestAllTypesProto3._writeMessage + ); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.NestedMessage, + reader: BinaryReader + ): TestAllTypesProto3.NestedMessage { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.a = reader.readInt32(); + break; + } + case 2: { + reader.readMessage( + msg.corecursive, + TestAllTypesProto3._readMessage + ); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapInt32Int32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeInt32(1, msg.key); + } + if (msg.value) { + writer.writeInt32(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapInt32Int32, + reader: BinaryReader + ): TestAllTypesProto3.MapInt32Int32 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readInt32(); + break; + } + case 2: { + msg.value = reader.readInt32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapInt64Int64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeInt64String(1, msg.key.toString() as any); + } + if (msg.value) { + writer.writeInt64String(2, msg.value.toString() as any); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapInt64Int64, + reader: BinaryReader + ): TestAllTypesProto3.MapInt64Int64 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = BigInt(reader.readInt64String()); + break; + } + case 2: { + msg.value = BigInt(reader.readInt64String()); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapUint32Uint32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeUint32(1, msg.key); + } + if (msg.value) { + writer.writeUint32(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapUint32Uint32, + reader: BinaryReader + ): TestAllTypesProto3.MapUint32Uint32 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readUint32(); + break; + } + case 2: { + msg.value = reader.readUint32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapUint64Uint64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeUint64String(1, msg.key.toString() as any); + } + if (msg.value) { + writer.writeUint64String(2, msg.value.toString() as any); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapUint64Uint64, + reader: BinaryReader + ): TestAllTypesProto3.MapUint64Uint64 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = BigInt(reader.readUint64String()); + break; + } + case 2: { + msg.value = BigInt(reader.readUint64String()); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapSint32Sint32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeSint32(1, msg.key); + } + if (msg.value) { + writer.writeSint32(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapSint32Sint32, + reader: BinaryReader + ): TestAllTypesProto3.MapSint32Sint32 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readSint32(); + break; + } + case 2: { + msg.value = reader.readSint32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapSint64Sint64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeSint64String(1, msg.key.toString() as any); + } + if (msg.value) { + writer.writeSint64String(2, msg.value.toString() as any); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapSint64Sint64, + reader: BinaryReader + ): TestAllTypesProto3.MapSint64Sint64 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = BigInt(reader.readSint64String()); + break; + } + case 2: { + msg.value = BigInt(reader.readSint64String()); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapFixed32Fixed32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeFixed32(1, msg.key); + } + if (msg.value) { + writer.writeFixed32(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapFixed32Fixed32, + reader: BinaryReader + ): TestAllTypesProto3.MapFixed32Fixed32 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readFixed32(); + break; + } + case 2: { + msg.value = reader.readFixed32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapFixed64Fixed64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeFixed64String(1, msg.key.toString() as any); + } + if (msg.value) { + writer.writeFixed64String(2, msg.value.toString() as any); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapFixed64Fixed64, + reader: BinaryReader + ): TestAllTypesProto3.MapFixed64Fixed64 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = BigInt(reader.readFixed64String()); + break; + } + case 2: { + msg.value = BigInt(reader.readFixed64String()); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapSfixed32Sfixed32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeSfixed32(1, msg.key); + } + if (msg.value) { + writer.writeSfixed32(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapSfixed32Sfixed32, + reader: BinaryReader + ): TestAllTypesProto3.MapSfixed32Sfixed32 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readSfixed32(); + break; + } + case 2: { + msg.value = reader.readSfixed32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapSfixed64Sfixed64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeSfixed64String(1, msg.key.toString() as any); + } + if (msg.value) { + writer.writeSfixed64String(2, msg.value.toString() as any); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapSfixed64Sfixed64, + reader: BinaryReader + ): TestAllTypesProto3.MapSfixed64Sfixed64 { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = BigInt(reader.readSfixed64String()); + break; + } + case 2: { + msg.value = BigInt(reader.readSfixed64String()); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapInt32Float: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeInt32(1, msg.key); + } + if (msg.value) { + writer.writeFloat(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapInt32Float, + reader: BinaryReader + ): TestAllTypesProto3.MapInt32Float { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readInt32(); + break; + } + case 2: { + msg.value = reader.readFloat(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapInt32Double: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeInt32(1, msg.key); + } + if (msg.value) { + writer.writeDouble(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapInt32Double, + reader: BinaryReader + ): TestAllTypesProto3.MapInt32Double { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readInt32(); + break; + } + case 2: { + msg.value = reader.readDouble(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapBoolBool: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeBool(1, msg.key); + } + if (msg.value) { + writer.writeBool(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapBoolBool, + reader: BinaryReader + ): TestAllTypesProto3.MapBoolBool { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readBool(); + break; + } + case 2: { + msg.value = reader.readBool(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapStringString: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeString(1, msg.key); + } + if (msg.value) { + writer.writeString(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapStringString, + reader: BinaryReader + ): TestAllTypesProto3.MapStringString { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readString(); + break; + } + case 2: { + msg.value = reader.readString(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapStringBytes: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeString(1, msg.key); + } + if (msg.value?.length) { + writer.writeBytes(2, msg.value); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapStringBytes, + reader: BinaryReader + ): TestAllTypesProto3.MapStringBytes { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readString(); + break; + } + case 2: { + msg.value = reader.readBytes(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapStringNestedMessage: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeString(1, msg.key); + } + if (msg.value) { + writer.writeMessage( + 2, + msg.value, + TestAllTypesProto3.NestedMessage._writeMessage + ); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapStringNestedMessage, + reader: BinaryReader + ): TestAllTypesProto3.MapStringNestedMessage { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readString(); + break; + } + case 2: { + msg.value = TestAllTypesProto3.NestedMessage.initialize(); + reader.readMessage( + msg.value, + TestAllTypesProto3.NestedMessage._readMessage + ); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapStringForeignMessage: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeString(1, msg.key); + } + if (msg.value) { + writer.writeMessage(2, msg.value, ForeignMessage._writeMessage); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapStringForeignMessage, + reader: BinaryReader + ): TestAllTypesProto3.MapStringForeignMessage { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readString(); + break; + } + case 2: { + msg.value = ForeignMessage.initialize(); + reader.readMessage(msg.value, ForeignMessage._readMessage); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapStringNestedEnum: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeString(1, msg.key); + } + if (msg.value && TestAllTypesProto3.NestedEnum._toInt(msg.value)) { + writer.writeEnum(2, TestAllTypesProto3.NestedEnum._toInt(msg.value)); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapStringNestedEnum, + reader: BinaryReader + ): TestAllTypesProto3.MapStringNestedEnum { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readString(); + break; + } + case 2: { + msg.value = TestAllTypesProto3.NestedEnum._fromInt( + reader.readEnum() + ); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, + + MapStringForeignEnum: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.key) { + writer.writeString(1, msg.key); + } + if (msg.value && ForeignEnum._toInt(msg.value)) { + writer.writeEnum(2, ForeignEnum._toInt(msg.value)); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapStringForeignEnum, + reader: BinaryReader + ): TestAllTypesProto3.MapStringForeignEnum { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.key = reader.readString(); + break; + } + case 2: { + msg.value = ForeignEnum._fromInt(reader.readEnum()); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, + }, +}; + +export const ForeignMessage = { + /** + * Serializes ForeignMessage to protobuf. + */ + encode: function (msg: Partial): Uint8Array { + return ForeignMessage._writeMessage( + msg, + new BinaryWriter() + ).getResultBuffer(); + }, + + /** + * Deserializes ForeignMessage from protobuf. + */ + decode: function (bytes: ByteSource): ForeignMessage { + return ForeignMessage._readMessage( + ForeignMessage.initialize(), + new BinaryReader(bytes) + ); + }, + + /** + * Initializes ForeignMessage with all fields set to their default value. + */ + initialize: function (): ForeignMessage { + return { + c: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + if (msg.c) { + writer.writeInt32(1, msg.c); + } + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + msg: ForeignMessage, + reader: BinaryReader + ): ForeignMessage { + while (reader.nextField()) { + const field = reader.getFieldNumber(); + switch (field) { + case 1: { + msg.c = reader.readInt32(); + break; + } + default: { + reader.skipField(); + break; + } + } + } + return msg; + }, +}; + +export const NullHypothesisProto3 = { + /** + * Serializes NullHypothesisProto3 to protobuf. + */ + encode: function (_msg?: Partial): Uint8Array { + return new Uint8Array(); + }, + + /** + * Deserializes NullHypothesisProto3 from protobuf. + */ + decode: function (_bytes?: ByteSource): NullHypothesisProto3 { + return {}; + }, + + /** + * Initializes NullHypothesisProto3 with all fields set to their default value. + */ + initialize: function (): NullHypothesisProto3 { + return {}; + }, + + /** + * @private + */ + _writeMessage: function ( + _msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + _msg: NullHypothesisProto3, + _reader: BinaryReader + ): NullHypothesisProto3 { + return _msg; + }, +}; + +export const EnumOnlyProto3 = { + /** + * Serializes EnumOnlyProto3 to protobuf. + */ + encode: function (_msg?: Partial): Uint8Array { + return new Uint8Array(); + }, + + /** + * Deserializes EnumOnlyProto3 from protobuf. + */ + decode: function (_bytes?: ByteSource): EnumOnlyProto3 { + return {}; + }, + + /** + * Initializes EnumOnlyProto3 with all fields set to their default value. + */ + initialize: function (): EnumOnlyProto3 { + return {}; + }, + + /** + * @private + */ + _writeMessage: function ( + _msg: Partial, + writer: BinaryWriter + ): BinaryWriter { + return writer; + }, + + /** + * @private + */ + _readMessage: function ( + _msg: EnumOnlyProto3, + _reader: BinaryReader + ): EnumOnlyProto3 { + return _msg; + }, + + Bool: { + kFalse: "kFalse", + kTrue: "kTrue", + /** + * @private + */ + _fromInt: function (i: number): EnumOnlyProto3.Bool { + switch (i) { + case 0: { + return "kFalse"; + } + case 1: { + return "kTrue"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as EnumOnlyProto3.Bool; + } + } + }, + /** + * @private + */ + _toInt: function (i: EnumOnlyProto3.Bool): number { + switch (i) { + case "kFalse": { + return 0; + } + case "kTrue": { + return 1; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, + } as const, +}; + +//========================================// +// JSON Encode / Decode // +//========================================// + +export const ForeignEnumJSON = { + FOREIGN_FOO: "FOREIGN_FOO", + FOREIGN_BAR: "FOREIGN_BAR", + FOREIGN_BAZ: "FOREIGN_BAZ", + /** + * @private + */ + _fromInt: function (i: number): ForeignEnum { + switch (i) { + case 0: { + return "FOREIGN_FOO"; + } + case 1: { + return "FOREIGN_BAR"; + } + case 2: { + return "FOREIGN_BAZ"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as ForeignEnum; + } + } + }, + /** + * @private + */ + _toInt: function (i: ForeignEnum): number { + switch (i) { + case "FOREIGN_FOO": { + return 0; + } + case "FOREIGN_BAR": { + return 1; + } + case "FOREIGN_BAZ": { + return 2; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, +} as const; + +export const TestAllTypesProto3JSON = { + /** + * Serializes TestAllTypesProto3 to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify(TestAllTypesProto3JSON._writeMessage(msg)); + }, + + /** + * Deserializes TestAllTypesProto3 from JSON. + */ + decode: function (json: string): TestAllTypesProto3 { + return TestAllTypesProto3JSON._readMessage( + TestAllTypesProto3JSON.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes TestAllTypesProto3 with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto3 { + return { + optionalInt32: 0, + optionalInt64: 0n, + optionalUint32: 0, + optionalUint64: 0n, + optionalSint32: 0, + optionalSint64: 0n, + optionalFixed32: 0, + optionalFixed64: 0n, + optionalSfixed32: 0, + optionalSfixed64: 0n, + optionalFloat: 0, + optionalDouble: 0, + optionalBool: false, + optionalString: "", + optionalBytes: new Uint8Array(), + optionalNestedMessage: TestAllTypesProto3JSON.NestedMessage.initialize(), + optionalForeignMessage: ForeignMessageJSON.initialize(), + optionalNestedEnum: TestAllTypesProto3.NestedEnum._fromInt(0), + optionalForeignEnum: ForeignEnum._fromInt(0), + optionalAliasedEnum: TestAllTypesProto3.AliasedEnum._fromInt(0), + optionalStringPiece: "", + optionalCord: "", + recursiveMessage: TestAllTypesProto3JSON.initialize(), + repeatedInt32: [], + repeatedInt64: [], + repeatedUint32: [], + repeatedUint64: [], + repeatedSint32: [], + repeatedSint64: [], + repeatedFixed32: [], + repeatedFixed64: [], + repeatedSfixed32: [], + repeatedSfixed64: [], + repeatedFloat: [], + repeatedDouble: [], + repeatedBool: [], + repeatedString: [], + repeatedBytes: [], + repeatedNestedMessage: [], + repeatedForeignMessage: [], + repeatedNestedEnum: [], + repeatedForeignEnum: [], + repeatedStringPiece: [], + repeatedCord: [], + packedInt32: [], + packedInt64: [], + packedUint32: [], + packedUint64: [], + packedSint32: [], + packedSint64: [], + packedFixed32: [], + packedFixed64: [], + packedSfixed32: [], + packedSfixed64: [], + packedFloat: [], + packedDouble: [], + packedBool: [], + packedNestedEnum: [], + unpackedInt32: [], + unpackedInt64: [], + unpackedUint32: [], + unpackedUint64: [], + unpackedSint32: [], + unpackedSint64: [], + unpackedFixed32: [], + unpackedFixed64: [], + unpackedSfixed32: [], + unpackedSfixed64: [], + unpackedFloat: [], + unpackedDouble: [], + unpackedBool: [], + unpackedNestedEnum: [], + mapInt32Int32: {}, + mapInt64Int64: {}, + mapUint32Uint32: {}, + mapUint64Uint64: {}, + mapSint32Sint32: {}, + mapSint64Sint64: {}, + mapFixed32Fixed32: {}, + mapFixed64Fixed64: {}, + mapSfixed32Sfixed32: {}, + mapSfixed64Sfixed64: {}, + mapInt32Float: {}, + mapInt32Double: {}, + mapBoolBool: {}, + mapStringString: {}, + mapStringBytes: {}, + mapStringNestedMessage: {}, + mapStringForeignMessage: {}, + mapStringNestedEnum: {}, + mapStringForeignEnum: {}, + oneofUint32: undefined, + oneofNestedMessage: undefined, + oneofString: undefined, + oneofBytes: undefined, + oneofBool: undefined, + oneofUint64: undefined, + oneofFloat: undefined, + oneofDouble: undefined, + oneofEnum: undefined, + oneofNullValue: undefined, + optionalBoolWrapper: protoscript.BoolValueJSON.initialize(), + optionalInt32Wrapper: protoscript.Int32ValueJSON.initialize(), + optionalInt64Wrapper: protoscript.Int64ValueJSON.initialize(), + optionalUint32Wrapper: protoscript.UInt32ValueJSON.initialize(), + optionalUint64Wrapper: protoscript.UInt64ValueJSON.initialize(), + optionalFloatWrapper: protoscript.FloatValueJSON.initialize(), + optionalDoubleWrapper: protoscript.DoubleValueJSON.initialize(), + optionalStringWrapper: protoscript.StringValueJSON.initialize(), + optionalBytesWrapper: protoscript.BytesValueJSON.initialize(), + repeatedBoolWrapper: [], + repeatedInt32Wrapper: [], + repeatedInt64Wrapper: [], + repeatedUint32Wrapper: [], + repeatedUint64Wrapper: [], + repeatedFloatWrapper: [], + repeatedDoubleWrapper: [], + repeatedStringWrapper: [], + repeatedBytesWrapper: [], + optionalDuration: protoscript.DurationJSON.initialize(), + optionalTimestamp: protoscript.TimestampJSON.initialize(), + optionalFieldMask: protoscript.FieldMaskJSON.initialize(), + optionalStruct: protoscript.StructJSON.initialize(), + optionalAny: protoscript.AnyJSON.initialize(), + optionalValue: protoscript.ValueJSON.initialize(), + optionalNullValue: protoscript.NullValue._fromInt(0), + repeatedDuration: [], + repeatedTimestamp: [], + repeatedFieldmask: [], + repeatedStruct: [], + repeatedAny: [], + repeatedValue: [], + repeatedListValue: [], + fieldname1: 0, + fieldName2: 0, + fieldName3: 0, + fieldName4: 0, + field0name5: 0, + field0Name6: 0, + fieldName7: 0, + FieldName8: 0, + fieldName9: 0, + FieldName10: 0, + FIELDNAME11: 0, + FIELDName12: 0, + fieldName13: 0, + FieldName14: 0, + fieldName15: 0, + fieldName16: 0, + fieldName17: 0, + FieldName18: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.optionalInt32) { + json["optionalInt32"] = msg.optionalInt32; + } + if (msg.optionalInt64) { + json["optionalInt64"] = msg.optionalInt64.toString(); + } + if (msg.optionalUint32) { + json["optionalUint32"] = msg.optionalUint32; + } + if (msg.optionalUint64) { + json["optionalUint64"] = msg.optionalUint64.toString(); + } + if (msg.optionalSint32) { + json["optionalSint32"] = msg.optionalSint32; + } + if (msg.optionalSint64) { + json["optionalSint64"] = msg.optionalSint64.toString(); + } + if (msg.optionalFixed32) { + json["optionalFixed32"] = msg.optionalFixed32; + } + if (msg.optionalFixed64) { + json["optionalFixed64"] = msg.optionalFixed64.toString(); + } + if (msg.optionalSfixed32) { + json["optionalSfixed32"] = msg.optionalSfixed32; + } + if (msg.optionalSfixed64) { + json["optionalSfixed64"] = msg.optionalSfixed64.toString(); + } + if (msg.optionalFloat) { + json["optionalFloat"] = msg.optionalFloat; + } + if (msg.optionalDouble) { + json["optionalDouble"] = msg.optionalDouble; + } + if (msg.optionalBool) { + json["optionalBool"] = msg.optionalBool; + } + if (msg.optionalString) { + json["optionalString"] = msg.optionalString; + } + if (msg.optionalBytes?.length) { + json["optionalBytes"] = encodeBase64Bytes(msg.optionalBytes); + } + if (msg.optionalNestedMessage) { + const _optionalNestedMessage_ = + TestAllTypesProto3JSON.NestedMessage._writeMessage( + msg.optionalNestedMessage + ); + if (Object.keys(_optionalNestedMessage_).length > 0) { + json["optionalNestedMessage"] = _optionalNestedMessage_; + } + } + if (msg.optionalForeignMessage) { + const _optionalForeignMessage_ = ForeignMessageJSON._writeMessage( + msg.optionalForeignMessage + ); + if (Object.keys(_optionalForeignMessage_).length > 0) { + json["optionalForeignMessage"] = _optionalForeignMessage_; + } + } + if ( + msg.optionalNestedEnum && + TestAllTypesProto3JSON.NestedEnum._toInt(msg.optionalNestedEnum) + ) { + json["optionalNestedEnum"] = msg.optionalNestedEnum; + } + if ( + msg.optionalForeignEnum && + ForeignEnumJSON._toInt(msg.optionalForeignEnum) + ) { + json["optionalForeignEnum"] = msg.optionalForeignEnum; + } + if ( + msg.optionalAliasedEnum && + TestAllTypesProto3JSON.AliasedEnum._toInt(msg.optionalAliasedEnum) + ) { + json["optionalAliasedEnum"] = msg.optionalAliasedEnum; + } + if (msg.optionalStringPiece) { + json["optionalStringPiece"] = msg.optionalStringPiece; + } + if (msg.optionalCord) { + json["optionalCord"] = msg.optionalCord; + } + if (msg.recursiveMessage) { + const _recursiveMessage_ = TestAllTypesProto3JSON._writeMessage( + msg.recursiveMessage + ); + if (Object.keys(_recursiveMessage_).length > 0) { + json["recursiveMessage"] = _recursiveMessage_; + } + } + if (msg.repeatedInt32?.length) { + json["repeatedInt32"] = msg.repeatedInt32; + } + if (msg.repeatedInt64?.length) { + json["repeatedInt64"] = msg.repeatedInt64.map((x) => x.toString()); + } + if (msg.repeatedUint32?.length) { + json["repeatedUint32"] = msg.repeatedUint32; + } + if (msg.repeatedUint64?.length) { + json["repeatedUint64"] = msg.repeatedUint64.map((x) => x.toString()); + } + if (msg.repeatedSint32?.length) { + json["repeatedSint32"] = msg.repeatedSint32; + } + if (msg.repeatedSint64?.length) { + json["repeatedSint64"] = msg.repeatedSint64.map((x) => x.toString()); + } + if (msg.repeatedFixed32?.length) { + json["repeatedFixed32"] = msg.repeatedFixed32; + } + if (msg.repeatedFixed64?.length) { + json["repeatedFixed64"] = msg.repeatedFixed64.map((x) => x.toString()); + } + if (msg.repeatedSfixed32?.length) { + json["repeatedSfixed32"] = msg.repeatedSfixed32; + } + if (msg.repeatedSfixed64?.length) { + json["repeatedSfixed64"] = msg.repeatedSfixed64.map((x) => x.toString()); + } + if (msg.repeatedFloat?.length) { + json["repeatedFloat"] = msg.repeatedFloat; + } + if (msg.repeatedDouble?.length) { + json["repeatedDouble"] = msg.repeatedDouble; + } + if (msg.repeatedBool?.length) { + json["repeatedBool"] = msg.repeatedBool; + } + if (msg.repeatedString?.length) { + json["repeatedString"] = msg.repeatedString; + } + if (msg.repeatedBytes?.length) { + json["repeatedBytes"] = msg.repeatedBytes.map(encodeBase64Bytes); + } + if (msg.repeatedNestedMessage?.length) { + json["repeatedNestedMessage"] = msg.repeatedNestedMessage.map( + TestAllTypesProto3JSON.NestedMessage._writeMessage + ); + } + if (msg.repeatedForeignMessage?.length) { + json["repeatedForeignMessage"] = msg.repeatedForeignMessage.map( + ForeignMessageJSON._writeMessage + ); + } + if (msg.repeatedNestedEnum?.length) { + json["repeatedNestedEnum"] = msg.repeatedNestedEnum; + } + if (msg.repeatedForeignEnum?.length) { + json["repeatedForeignEnum"] = msg.repeatedForeignEnum; + } + if (msg.repeatedStringPiece?.length) { + json["repeatedStringPiece"] = msg.repeatedStringPiece; + } + if (msg.repeatedCord?.length) { + json["repeatedCord"] = msg.repeatedCord; + } + if (msg.packedInt32?.length) { + json["packedInt32"] = msg.packedInt32; + } + if (msg.packedInt64?.length) { + json["packedInt64"] = msg.packedInt64.map((x) => x.toString()); + } + if (msg.packedUint32?.length) { + json["packedUint32"] = msg.packedUint32; + } + if (msg.packedUint64?.length) { + json["packedUint64"] = msg.packedUint64.map((x) => x.toString()); + } + if (msg.packedSint32?.length) { + json["packedSint32"] = msg.packedSint32; + } + if (msg.packedSint64?.length) { + json["packedSint64"] = msg.packedSint64.map((x) => x.toString()); + } + if (msg.packedFixed32?.length) { + json["packedFixed32"] = msg.packedFixed32; + } + if (msg.packedFixed64?.length) { + json["packedFixed64"] = msg.packedFixed64.map((x) => x.toString()); + } + if (msg.packedSfixed32?.length) { + json["packedSfixed32"] = msg.packedSfixed32; + } + if (msg.packedSfixed64?.length) { + json["packedSfixed64"] = msg.packedSfixed64.map((x) => x.toString()); + } + if (msg.packedFloat?.length) { + json["packedFloat"] = msg.packedFloat; + } + if (msg.packedDouble?.length) { + json["packedDouble"] = msg.packedDouble; + } + if (msg.packedBool?.length) { + json["packedBool"] = msg.packedBool; + } + if (msg.packedNestedEnum?.length) { + json["packedNestedEnum"] = msg.packedNestedEnum; + } + if (msg.unpackedInt32?.length) { + json["unpackedInt32"] = msg.unpackedInt32; + } + if (msg.unpackedInt64?.length) { + json["unpackedInt64"] = msg.unpackedInt64.map((x) => x.toString()); + } + if (msg.unpackedUint32?.length) { + json["unpackedUint32"] = msg.unpackedUint32; + } + if (msg.unpackedUint64?.length) { + json["unpackedUint64"] = msg.unpackedUint64.map((x) => x.toString()); + } + if (msg.unpackedSint32?.length) { + json["unpackedSint32"] = msg.unpackedSint32; + } + if (msg.unpackedSint64?.length) { + json["unpackedSint64"] = msg.unpackedSint64.map((x) => x.toString()); + } + if (msg.unpackedFixed32?.length) { + json["unpackedFixed32"] = msg.unpackedFixed32; + } + if (msg.unpackedFixed64?.length) { + json["unpackedFixed64"] = msg.unpackedFixed64.map((x) => x.toString()); + } + if (msg.unpackedSfixed32?.length) { + json["unpackedSfixed32"] = msg.unpackedSfixed32; + } + if (msg.unpackedSfixed64?.length) { + json["unpackedSfixed64"] = msg.unpackedSfixed64.map((x) => x.toString()); + } + if (msg.unpackedFloat?.length) { + json["unpackedFloat"] = msg.unpackedFloat; + } + if (msg.unpackedDouble?.length) { + json["unpackedDouble"] = msg.unpackedDouble; + } + if (msg.unpackedBool?.length) { + json["unpackedBool"] = msg.unpackedBool; + } + if (msg.unpackedNestedEnum?.length) { + json["unpackedNestedEnum"] = msg.unpackedNestedEnum; + } + if (msg.mapInt32Int32) { + const _mapInt32Int32_ = Object.fromEntries( + Object.entries(msg.mapInt32Int32) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapInt32Int32._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapInt32Int32_).length > 0) { + json["mapInt32Int32"] = _mapInt32Int32_; + } + } + if (msg.mapInt64Int64) { + const _mapInt64Int64_ = Object.fromEntries( + Object.entries(msg.mapInt64Int64) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapInt64Int64._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapInt64Int64_).length > 0) { + json["mapInt64Int64"] = _mapInt64Int64_; + } + } + if (msg.mapUint32Uint32) { + const _mapUint32Uint32_ = Object.fromEntries( + Object.entries(msg.mapUint32Uint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapUint32Uint32._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapUint32Uint32_).length > 0) { + json["mapUint32Uint32"] = _mapUint32Uint32_; + } + } + if (msg.mapUint64Uint64) { + const _mapUint64Uint64_ = Object.fromEntries( + Object.entries(msg.mapUint64Uint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapUint64Uint64._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapUint64Uint64_).length > 0) { + json["mapUint64Uint64"] = _mapUint64Uint64_; + } + } + if (msg.mapSint32Sint32) { + const _mapSint32Sint32_ = Object.fromEntries( + Object.entries(msg.mapSint32Sint32) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapSint32Sint32._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapSint32Sint32_).length > 0) { + json["mapSint32Sint32"] = _mapSint32Sint32_; + } + } + if (msg.mapSint64Sint64) { + const _mapSint64Sint64_ = Object.fromEntries( + Object.entries(msg.mapSint64Sint64) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapSint64Sint64._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapSint64Sint64_).length > 0) { + json["mapSint64Sint64"] = _mapSint64Sint64_; + } + } + if (msg.mapFixed32Fixed32) { + const _mapFixed32Fixed32_ = Object.fromEntries( + Object.entries(msg.mapFixed32Fixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapFixed32Fixed32._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapFixed32Fixed32_).length > 0) { + json["mapFixed32Fixed32"] = _mapFixed32Fixed32_; + } + } + if (msg.mapFixed64Fixed64) { + const _mapFixed64Fixed64_ = Object.fromEntries( + Object.entries(msg.mapFixed64Fixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapFixed64Fixed64._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapFixed64Fixed64_).length > 0) { + json["mapFixed64Fixed64"] = _mapFixed64Fixed64_; + } + } + if (msg.mapSfixed32Sfixed32) { + const _mapSfixed32Sfixed32_ = Object.fromEntries( + Object.entries(msg.mapSfixed32Sfixed32) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapSfixed32Sfixed32._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapSfixed32Sfixed32_).length > 0) { + json["mapSfixed32Sfixed32"] = _mapSfixed32Sfixed32_; + } + } + if (msg.mapSfixed64Sfixed64) { + const _mapSfixed64Sfixed64_ = Object.fromEntries( + Object.entries(msg.mapSfixed64Sfixed64) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapSfixed64Sfixed64._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapSfixed64Sfixed64_).length > 0) { + json["mapSfixed64Sfixed64"] = _mapSfixed64Sfixed64_; + } + } + if (msg.mapInt32Float) { + const _mapInt32Float_ = Object.fromEntries( + Object.entries(msg.mapInt32Float) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapInt32Float._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapInt32Float_).length > 0) { + json["mapInt32Float"] = _mapInt32Float_; + } + } + if (msg.mapInt32Double) { + const _mapInt32Double_ = Object.fromEntries( + Object.entries(msg.mapInt32Double) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapInt32Double._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapInt32Double_).length > 0) { + json["mapInt32Double"] = _mapInt32Double_; + } + } + if (msg.mapBoolBool) { + const _mapBoolBool_ = Object.fromEntries( + Object.entries(msg.mapBoolBool) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapBoolBool._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapBoolBool_).length > 0) { + json["mapBoolBool"] = _mapBoolBool_; + } + } + if (msg.mapStringString) { + const _mapStringString_ = Object.fromEntries( + Object.entries(msg.mapStringString) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapStringString._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapStringString_).length > 0) { + json["mapStringString"] = _mapStringString_; + } + } + if (msg.mapStringBytes) { + const _mapStringBytes_ = Object.fromEntries( + Object.entries(msg.mapStringBytes) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapStringBytes._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapStringBytes_).length > 0) { + json["mapStringBytes"] = _mapStringBytes_; + } + } + if (msg.mapStringNestedMessage) { + const _mapStringNestedMessage_ = Object.fromEntries( + Object.entries(msg.mapStringNestedMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapStringNestedMessage._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapStringNestedMessage_).length > 0) { + json["mapStringNestedMessage"] = _mapStringNestedMessage_; + } + } + if (msg.mapStringForeignMessage) { + const _mapStringForeignMessage_ = Object.fromEntries( + Object.entries(msg.mapStringForeignMessage) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapStringForeignMessage._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapStringForeignMessage_).length > 0) { + json["mapStringForeignMessage"] = _mapStringForeignMessage_; + } + } + if (msg.mapStringNestedEnum) { + const _mapStringNestedEnum_ = Object.fromEntries( + Object.entries(msg.mapStringNestedEnum) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapStringNestedEnum._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapStringNestedEnum_).length > 0) { + json["mapStringNestedEnum"] = _mapStringNestedEnum_; + } + } + if (msg.mapStringForeignEnum) { + const _mapStringForeignEnum_ = Object.fromEntries( + Object.entries(msg.mapStringForeignEnum) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapStringForeignEnum._writeMessage) + .map(({ key, value }) => [key, value]) + ); + if (Object.keys(_mapStringForeignEnum_).length > 0) { + json["mapStringForeignEnum"] = _mapStringForeignEnum_; + } + } + if (msg.oneofUint32 != undefined) { + json["oneofUint32"] = msg.oneofUint32; + } + if (msg.oneofNestedMessage != undefined) { + const _oneofNestedMessage_ = + TestAllTypesProto3JSON.NestedMessage._writeMessage( + msg.oneofNestedMessage + ); + json["oneofNestedMessage"] = _oneofNestedMessage_; + } + if (msg.oneofString != undefined) { + json["oneofString"] = msg.oneofString; + } + if (msg.oneofBytes?.length) { + json["oneofBytes"] = encodeBase64Bytes(msg.oneofBytes); + } + if (msg.oneofBool != undefined) { + json["oneofBool"] = msg.oneofBool; + } + if (msg.oneofUint64 != undefined) { + json["oneofUint64"] = msg.oneofUint64.toString(); + } + if (msg.oneofFloat != undefined) { + json["oneofFloat"] = msg.oneofFloat; + } + if (msg.oneofDouble != undefined) { + json["oneofDouble"] = msg.oneofDouble; + } + if (msg.oneofEnum != undefined) { + json["oneofEnum"] = msg.oneofEnum; + } + if (msg.oneofNullValue != undefined) { + json["oneofNullValue"] = msg.oneofNullValue; + } + if (msg.optionalBoolWrapper) { + const _optionalBoolWrapper_ = protoscript.BoolValueJSON._writeMessage( + msg.optionalBoolWrapper + ); + if (Object.keys(_optionalBoolWrapper_).length > 0) { + json["optionalBoolWrapper"] = _optionalBoolWrapper_; + } + } + if (msg.optionalInt32Wrapper) { + const _optionalInt32Wrapper_ = protoscript.Int32ValueJSON._writeMessage( + msg.optionalInt32Wrapper + ); + if (Object.keys(_optionalInt32Wrapper_).length > 0) { + json["optionalInt32Wrapper"] = _optionalInt32Wrapper_; + } + } + if (msg.optionalInt64Wrapper) { + const _optionalInt64Wrapper_ = protoscript.Int64ValueJSON._writeMessage( + msg.optionalInt64Wrapper + ); + if (Object.keys(_optionalInt64Wrapper_).length > 0) { + json["optionalInt64Wrapper"] = _optionalInt64Wrapper_; + } + } + if (msg.optionalUint32Wrapper) { + const _optionalUint32Wrapper_ = protoscript.UInt32ValueJSON._writeMessage( + msg.optionalUint32Wrapper + ); + if (Object.keys(_optionalUint32Wrapper_).length > 0) { + json["optionalUint32Wrapper"] = _optionalUint32Wrapper_; + } + } + if (msg.optionalUint64Wrapper) { + const _optionalUint64Wrapper_ = protoscript.UInt64ValueJSON._writeMessage( + msg.optionalUint64Wrapper + ); + if (Object.keys(_optionalUint64Wrapper_).length > 0) { + json["optionalUint64Wrapper"] = _optionalUint64Wrapper_; + } + } + if (msg.optionalFloatWrapper) { + const _optionalFloatWrapper_ = protoscript.FloatValueJSON._writeMessage( + msg.optionalFloatWrapper + ); + if (Object.keys(_optionalFloatWrapper_).length > 0) { + json["optionalFloatWrapper"] = _optionalFloatWrapper_; + } + } + if (msg.optionalDoubleWrapper) { + const _optionalDoubleWrapper_ = protoscript.DoubleValueJSON._writeMessage( + msg.optionalDoubleWrapper + ); + if (Object.keys(_optionalDoubleWrapper_).length > 0) { + json["optionalDoubleWrapper"] = _optionalDoubleWrapper_; + } + } + if (msg.optionalStringWrapper) { + const _optionalStringWrapper_ = protoscript.StringValueJSON._writeMessage( + msg.optionalStringWrapper + ); + if (Object.keys(_optionalStringWrapper_).length > 0) { + json["optionalStringWrapper"] = _optionalStringWrapper_; + } + } + if (msg.optionalBytesWrapper) { + const _optionalBytesWrapper_ = protoscript.BytesValueJSON._writeMessage( + msg.optionalBytesWrapper + ); + if (Object.keys(_optionalBytesWrapper_).length > 0) { + json["optionalBytesWrapper"] = _optionalBytesWrapper_; + } + } + if (msg.repeatedBoolWrapper?.length) { + json["repeatedBoolWrapper"] = msg.repeatedBoolWrapper.map( + protoscript.BoolValueJSON._writeMessage + ); + } + if (msg.repeatedInt32Wrapper?.length) { + json["repeatedInt32Wrapper"] = msg.repeatedInt32Wrapper.map( + protoscript.Int32ValueJSON._writeMessage + ); + } + if (msg.repeatedInt64Wrapper?.length) { + json["repeatedInt64Wrapper"] = msg.repeatedInt64Wrapper.map( + protoscript.Int64ValueJSON._writeMessage + ); + } + if (msg.repeatedUint32Wrapper?.length) { + json["repeatedUint32Wrapper"] = msg.repeatedUint32Wrapper.map( + protoscript.UInt32ValueJSON._writeMessage + ); + } + if (msg.repeatedUint64Wrapper?.length) { + json["repeatedUint64Wrapper"] = msg.repeatedUint64Wrapper.map( + protoscript.UInt64ValueJSON._writeMessage + ); + } + if (msg.repeatedFloatWrapper?.length) { + json["repeatedFloatWrapper"] = msg.repeatedFloatWrapper.map( + protoscript.FloatValueJSON._writeMessage + ); + } + if (msg.repeatedDoubleWrapper?.length) { + json["repeatedDoubleWrapper"] = msg.repeatedDoubleWrapper.map( + protoscript.DoubleValueJSON._writeMessage + ); + } + if (msg.repeatedStringWrapper?.length) { + json["repeatedStringWrapper"] = msg.repeatedStringWrapper.map( + protoscript.StringValueJSON._writeMessage + ); + } + if (msg.repeatedBytesWrapper?.length) { + json["repeatedBytesWrapper"] = msg.repeatedBytesWrapper.map( + protoscript.BytesValueJSON._writeMessage + ); + } + if (msg.optionalDuration) { + const _optionalDuration_ = protoscript.DurationJSON._writeMessage( + msg.optionalDuration + ); + if (Object.keys(_optionalDuration_).length > 0) { + json["optionalDuration"] = _optionalDuration_; + } + } + if (msg.optionalTimestamp) { + const _optionalTimestamp_ = protoscript.TimestampJSON._writeMessage( + msg.optionalTimestamp + ); + if (Object.keys(_optionalTimestamp_).length > 0) { + json["optionalTimestamp"] = _optionalTimestamp_; + } + } + if (msg.optionalFieldMask) { + const _optionalFieldMask_ = protoscript.FieldMaskJSON._writeMessage( + msg.optionalFieldMask + ); + if (Object.keys(_optionalFieldMask_).length > 0) { + json["optionalFieldMask"] = _optionalFieldMask_; + } + } + if (msg.optionalStruct) { + const _optionalStruct_ = protoscript.StructJSON._writeMessage( + msg.optionalStruct + ); + if (Object.keys(_optionalStruct_).length > 0) { + json["optionalStruct"] = _optionalStruct_; + } + } + if (msg.optionalAny) { + const _optionalAny_ = protoscript.AnyJSON._writeMessage(msg.optionalAny); + if (Object.keys(_optionalAny_).length > 0) { + json["optionalAny"] = _optionalAny_; + } + } + if (msg.optionalValue) { + const _optionalValue_ = protoscript.ValueJSON._writeMessage( + msg.optionalValue + ); + if (Object.keys(_optionalValue_).length > 0) { + json["optionalValue"] = _optionalValue_; + } + } + if ( + msg.optionalNullValue && + protoscript.NullValueJSON._toInt(msg.optionalNullValue) + ) { + json["optionalNullValue"] = msg.optionalNullValue; + } + if (msg.repeatedDuration?.length) { + json["repeatedDuration"] = msg.repeatedDuration.map( + protoscript.DurationJSON._writeMessage + ); + } + if (msg.repeatedTimestamp?.length) { + json["repeatedTimestamp"] = msg.repeatedTimestamp.map( + protoscript.TimestampJSON._writeMessage + ); + } + if (msg.repeatedFieldmask?.length) { + json["repeatedFieldmask"] = msg.repeatedFieldmask.map( + protoscript.FieldMaskJSON._writeMessage + ); + } + if (msg.repeatedStruct?.length) { + json["repeatedStruct"] = msg.repeatedStruct.map( + protoscript.StructJSON._writeMessage + ); + } + if (msg.repeatedAny?.length) { + json["repeatedAny"] = msg.repeatedAny.map( + protoscript.AnyJSON._writeMessage + ); + } + if (msg.repeatedValue?.length) { + json["repeatedValue"] = msg.repeatedValue.map( + protoscript.ValueJSON._writeMessage + ); + } + if (msg.repeatedListValue?.length) { + json["repeatedListValue"] = msg.repeatedListValue.map( + protoscript.ListValueJSON._writeMessage + ); + } + if (msg.fieldname1) { + json["fieldname1"] = msg.fieldname1; + } + if (msg.fieldName2) { + json["fieldName2"] = msg.fieldName2; + } + if (msg.fieldName3) { + json["FieldName3"] = msg.fieldName3; + } + if (msg.fieldName4) { + json["fieldName4"] = msg.fieldName4; + } + if (msg.field0name5) { + json["field0name5"] = msg.field0name5; + } + if (msg.field0Name6) { + json["field0Name6"] = msg.field0Name6; + } + if (msg.fieldName7) { + json["fieldName7"] = msg.fieldName7; + } + if (msg.FieldName8) { + json["FieldName8"] = msg.FieldName8; + } + if (msg.fieldName9) { + json["fieldName9"] = msg.fieldName9; + } + if (msg.FieldName10) { + json["FieldName10"] = msg.FieldName10; + } + if (msg.FIELDNAME11) { + json["FIELDNAME11"] = msg.FIELDNAME11; + } + if (msg.FIELDName12) { + json["FIELDName12"] = msg.FIELDName12; + } + if (msg.fieldName13) { + json["FieldName13"] = msg.fieldName13; + } + if (msg.FieldName14) { + json["FieldName14"] = msg.FieldName14; + } + if (msg.fieldName15) { + json["fieldName15"] = msg.fieldName15; + } + if (msg.fieldName16) { + json["fieldName16"] = msg.fieldName16; + } + if (msg.fieldName17) { + json["fieldName17"] = msg.fieldName17; + } + if (msg.FieldName18) { + json["FieldName18"] = msg.FieldName18; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3, + json: any + ): TestAllTypesProto3 { + const _optionalInt32_ = json["optionalInt32"] ?? json["optional_int32"]; + if (_optionalInt32_) { + msg.optionalInt32 = _optionalInt32_; + } + const _optionalInt64_ = json["optionalInt64"] ?? json["optional_int64"]; + if (_optionalInt64_) { + msg.optionalInt64 = BigInt(_optionalInt64_); + } + const _optionalUint32_ = json["optionalUint32"] ?? json["optional_uint32"]; + if (_optionalUint32_) { + msg.optionalUint32 = _optionalUint32_; + } + const _optionalUint64_ = json["optionalUint64"] ?? json["optional_uint64"]; + if (_optionalUint64_) { + msg.optionalUint64 = BigInt(_optionalUint64_); + } + const _optionalSint32_ = json["optionalSint32"] ?? json["optional_sint32"]; + if (_optionalSint32_) { + msg.optionalSint32 = _optionalSint32_; + } + const _optionalSint64_ = json["optionalSint64"] ?? json["optional_sint64"]; + if (_optionalSint64_) { + msg.optionalSint64 = BigInt(_optionalSint64_); + } + const _optionalFixed32_ = + json["optionalFixed32"] ?? json["optional_fixed32"]; + if (_optionalFixed32_) { + msg.optionalFixed32 = _optionalFixed32_; + } + const _optionalFixed64_ = + json["optionalFixed64"] ?? json["optional_fixed64"]; + if (_optionalFixed64_) { + msg.optionalFixed64 = BigInt(_optionalFixed64_); + } + const _optionalSfixed32_ = + json["optionalSfixed32"] ?? json["optional_sfixed32"]; + if (_optionalSfixed32_) { + msg.optionalSfixed32 = _optionalSfixed32_; + } + const _optionalSfixed64_ = + json["optionalSfixed64"] ?? json["optional_sfixed64"]; + if (_optionalSfixed64_) { + msg.optionalSfixed64 = BigInt(_optionalSfixed64_); + } + const _optionalFloat_ = json["optionalFloat"] ?? json["optional_float"]; + if (_optionalFloat_) { + msg.optionalFloat = _optionalFloat_; + } + const _optionalDouble_ = json["optionalDouble"] ?? json["optional_double"]; + if (_optionalDouble_) { + msg.optionalDouble = _optionalDouble_; + } + const _optionalBool_ = json["optionalBool"] ?? json["optional_bool"]; + if (_optionalBool_) { + msg.optionalBool = _optionalBool_; + } + const _optionalString_ = json["optionalString"] ?? json["optional_string"]; + if (_optionalString_) { + msg.optionalString = _optionalString_; + } + const _optionalBytes_ = json["optionalBytes"] ?? json["optional_bytes"]; + if (_optionalBytes_) { + msg.optionalBytes = decodeBase64Bytes(_optionalBytes_); + } + const _optionalNestedMessage_ = + json["optionalNestedMessage"] ?? json["optional_nested_message"]; + if (_optionalNestedMessage_) { + const m = TestAllTypesProto3JSON.NestedMessage.initialize(); + TestAllTypesProto3JSON.NestedMessage._readMessage( + m, + _optionalNestedMessage_ + ); + msg.optionalNestedMessage = m; + } + const _optionalForeignMessage_ = + json["optionalForeignMessage"] ?? json["optional_foreign_message"]; + if (_optionalForeignMessage_) { + const m = ForeignMessageJSON.initialize(); + ForeignMessageJSON._readMessage(m, _optionalForeignMessage_); + msg.optionalForeignMessage = m; + } + const _optionalNestedEnum_ = + json["optionalNestedEnum"] ?? json["optional_nested_enum"]; + if (_optionalNestedEnum_) { + msg.optionalNestedEnum = _optionalNestedEnum_; + } + const _optionalForeignEnum_ = + json["optionalForeignEnum"] ?? json["optional_foreign_enum"]; + if (_optionalForeignEnum_) { + msg.optionalForeignEnum = _optionalForeignEnum_; + } + const _optionalAliasedEnum_ = + json["optionalAliasedEnum"] ?? json["optional_aliased_enum"]; + if (_optionalAliasedEnum_) { + msg.optionalAliasedEnum = _optionalAliasedEnum_; + } + const _optionalStringPiece_ = + json["optionalStringPiece"] ?? json["optional_string_piece"]; + if (_optionalStringPiece_) { + msg.optionalStringPiece = _optionalStringPiece_; + } + const _optionalCord_ = json["optionalCord"] ?? json["optional_cord"]; + if (_optionalCord_) { + msg.optionalCord = _optionalCord_; + } + const _recursiveMessage_ = + json["recursiveMessage"] ?? json["recursive_message"]; + if (_recursiveMessage_) { + const m = TestAllTypesProto3JSON.initialize(); + TestAllTypesProto3JSON._readMessage(m, _recursiveMessage_); + msg.recursiveMessage = m; + } + const _repeatedInt32_ = json["repeatedInt32"] ?? json["repeated_int32"]; + if (_repeatedInt32_) { + msg.repeatedInt32 = _repeatedInt32_; + } + const _repeatedInt64_ = json["repeatedInt64"] ?? json["repeated_int64"]; + if (_repeatedInt64_) { + msg.repeatedInt64 = _repeatedInt64_.map(BigInt); + } + const _repeatedUint32_ = json["repeatedUint32"] ?? json["repeated_uint32"]; + if (_repeatedUint32_) { + msg.repeatedUint32 = _repeatedUint32_; + } + const _repeatedUint64_ = json["repeatedUint64"] ?? json["repeated_uint64"]; + if (_repeatedUint64_) { + msg.repeatedUint64 = _repeatedUint64_.map(BigInt); + } + const _repeatedSint32_ = json["repeatedSint32"] ?? json["repeated_sint32"]; + if (_repeatedSint32_) { + msg.repeatedSint32 = _repeatedSint32_; + } + const _repeatedSint64_ = json["repeatedSint64"] ?? json["repeated_sint64"]; + if (_repeatedSint64_) { + msg.repeatedSint64 = _repeatedSint64_.map(BigInt); + } + const _repeatedFixed32_ = + json["repeatedFixed32"] ?? json["repeated_fixed32"]; + if (_repeatedFixed32_) { + msg.repeatedFixed32 = _repeatedFixed32_; + } + const _repeatedFixed64_ = + json["repeatedFixed64"] ?? json["repeated_fixed64"]; + if (_repeatedFixed64_) { + msg.repeatedFixed64 = _repeatedFixed64_.map(BigInt); + } + const _repeatedSfixed32_ = + json["repeatedSfixed32"] ?? json["repeated_sfixed32"]; + if (_repeatedSfixed32_) { + msg.repeatedSfixed32 = _repeatedSfixed32_; + } + const _repeatedSfixed64_ = + json["repeatedSfixed64"] ?? json["repeated_sfixed64"]; + if (_repeatedSfixed64_) { + msg.repeatedSfixed64 = _repeatedSfixed64_.map(BigInt); + } + const _repeatedFloat_ = json["repeatedFloat"] ?? json["repeated_float"]; + if (_repeatedFloat_) { + msg.repeatedFloat = _repeatedFloat_; + } + const _repeatedDouble_ = json["repeatedDouble"] ?? json["repeated_double"]; + if (_repeatedDouble_) { + msg.repeatedDouble = _repeatedDouble_; + } + const _repeatedBool_ = json["repeatedBool"] ?? json["repeated_bool"]; + if (_repeatedBool_) { + msg.repeatedBool = _repeatedBool_; + } + const _repeatedString_ = json["repeatedString"] ?? json["repeated_string"]; + if (_repeatedString_) { + msg.repeatedString = _repeatedString_; + } + const _repeatedBytes_ = json["repeatedBytes"] ?? json["repeated_bytes"]; + if (_repeatedBytes_) { + msg.repeatedBytes = _repeatedBytes_.map(decodeBase64Bytes); + } + const _repeatedNestedMessage_ = + json["repeatedNestedMessage"] ?? json["repeated_nested_message"]; + if (_repeatedNestedMessage_) { + for (const item of _repeatedNestedMessage_) { + const m = TestAllTypesProto3JSON.NestedMessage.initialize(); + TestAllTypesProto3JSON.NestedMessage._readMessage(m, item); + msg.repeatedNestedMessage.push(m); + } + } + const _repeatedForeignMessage_ = + json["repeatedForeignMessage"] ?? json["repeated_foreign_message"]; + if (_repeatedForeignMessage_) { + for (const item of _repeatedForeignMessage_) { + const m = ForeignMessageJSON.initialize(); + ForeignMessageJSON._readMessage(m, item); + msg.repeatedForeignMessage.push(m); + } + } + const _repeatedNestedEnum_ = + json["repeatedNestedEnum"] ?? json["repeated_nested_enum"]; + if (_repeatedNestedEnum_) { + msg.repeatedNestedEnum = _repeatedNestedEnum_; + } + const _repeatedForeignEnum_ = + json["repeatedForeignEnum"] ?? json["repeated_foreign_enum"]; + if (_repeatedForeignEnum_) { + msg.repeatedForeignEnum = _repeatedForeignEnum_; + } + const _repeatedStringPiece_ = + json["repeatedStringPiece"] ?? json["repeated_string_piece"]; + if (_repeatedStringPiece_) { + msg.repeatedStringPiece = _repeatedStringPiece_; + } + const _repeatedCord_ = json["repeatedCord"] ?? json["repeated_cord"]; + if (_repeatedCord_) { + msg.repeatedCord = _repeatedCord_; + } + const _packedInt32_ = json["packedInt32"] ?? json["packed_int32"]; + if (_packedInt32_) { + msg.packedInt32 = _packedInt32_; + } + const _packedInt64_ = json["packedInt64"] ?? json["packed_int64"]; + if (_packedInt64_) { + msg.packedInt64 = _packedInt64_.map(BigInt); + } + const _packedUint32_ = json["packedUint32"] ?? json["packed_uint32"]; + if (_packedUint32_) { + msg.packedUint32 = _packedUint32_; + } + const _packedUint64_ = json["packedUint64"] ?? json["packed_uint64"]; + if (_packedUint64_) { + msg.packedUint64 = _packedUint64_.map(BigInt); + } + const _packedSint32_ = json["packedSint32"] ?? json["packed_sint32"]; + if (_packedSint32_) { + msg.packedSint32 = _packedSint32_; + } + const _packedSint64_ = json["packedSint64"] ?? json["packed_sint64"]; + if (_packedSint64_) { + msg.packedSint64 = _packedSint64_.map(BigInt); + } + const _packedFixed32_ = json["packedFixed32"] ?? json["packed_fixed32"]; + if (_packedFixed32_) { + msg.packedFixed32 = _packedFixed32_; + } + const _packedFixed64_ = json["packedFixed64"] ?? json["packed_fixed64"]; + if (_packedFixed64_) { + msg.packedFixed64 = _packedFixed64_.map(BigInt); + } + const _packedSfixed32_ = json["packedSfixed32"] ?? json["packed_sfixed32"]; + if (_packedSfixed32_) { + msg.packedSfixed32 = _packedSfixed32_; + } + const _packedSfixed64_ = json["packedSfixed64"] ?? json["packed_sfixed64"]; + if (_packedSfixed64_) { + msg.packedSfixed64 = _packedSfixed64_.map(BigInt); + } + const _packedFloat_ = json["packedFloat"] ?? json["packed_float"]; + if (_packedFloat_) { + msg.packedFloat = _packedFloat_; + } + const _packedDouble_ = json["packedDouble"] ?? json["packed_double"]; + if (_packedDouble_) { + msg.packedDouble = _packedDouble_; + } + const _packedBool_ = json["packedBool"] ?? json["packed_bool"]; + if (_packedBool_) { + msg.packedBool = _packedBool_; + } + const _packedNestedEnum_ = + json["packedNestedEnum"] ?? json["packed_nested_enum"]; + if (_packedNestedEnum_) { + msg.packedNestedEnum = _packedNestedEnum_; + } + const _unpackedInt32_ = json["unpackedInt32"] ?? json["unpacked_int32"]; + if (_unpackedInt32_) { + msg.unpackedInt32 = _unpackedInt32_; + } + const _unpackedInt64_ = json["unpackedInt64"] ?? json["unpacked_int64"]; + if (_unpackedInt64_) { + msg.unpackedInt64 = _unpackedInt64_.map(BigInt); + } + const _unpackedUint32_ = json["unpackedUint32"] ?? json["unpacked_uint32"]; + if (_unpackedUint32_) { + msg.unpackedUint32 = _unpackedUint32_; + } + const _unpackedUint64_ = json["unpackedUint64"] ?? json["unpacked_uint64"]; + if (_unpackedUint64_) { + msg.unpackedUint64 = _unpackedUint64_.map(BigInt); + } + const _unpackedSint32_ = json["unpackedSint32"] ?? json["unpacked_sint32"]; + if (_unpackedSint32_) { + msg.unpackedSint32 = _unpackedSint32_; + } + const _unpackedSint64_ = json["unpackedSint64"] ?? json["unpacked_sint64"]; + if (_unpackedSint64_) { + msg.unpackedSint64 = _unpackedSint64_.map(BigInt); + } + const _unpackedFixed32_ = + json["unpackedFixed32"] ?? json["unpacked_fixed32"]; + if (_unpackedFixed32_) { + msg.unpackedFixed32 = _unpackedFixed32_; + } + const _unpackedFixed64_ = + json["unpackedFixed64"] ?? json["unpacked_fixed64"]; + if (_unpackedFixed64_) { + msg.unpackedFixed64 = _unpackedFixed64_.map(BigInt); + } + const _unpackedSfixed32_ = + json["unpackedSfixed32"] ?? json["unpacked_sfixed32"]; + if (_unpackedSfixed32_) { + msg.unpackedSfixed32 = _unpackedSfixed32_; + } + const _unpackedSfixed64_ = + json["unpackedSfixed64"] ?? json["unpacked_sfixed64"]; + if (_unpackedSfixed64_) { + msg.unpackedSfixed64 = _unpackedSfixed64_.map(BigInt); + } + const _unpackedFloat_ = json["unpackedFloat"] ?? json["unpacked_float"]; + if (_unpackedFloat_) { + msg.unpackedFloat = _unpackedFloat_; + } + const _unpackedDouble_ = json["unpackedDouble"] ?? json["unpacked_double"]; + if (_unpackedDouble_) { + msg.unpackedDouble = _unpackedDouble_; + } + const _unpackedBool_ = json["unpackedBool"] ?? json["unpacked_bool"]; + if (_unpackedBool_) { + msg.unpackedBool = _unpackedBool_; + } + const _unpackedNestedEnum_ = + json["unpackedNestedEnum"] ?? json["unpacked_nested_enum"]; + if (_unpackedNestedEnum_) { + msg.unpackedNestedEnum = _unpackedNestedEnum_; + } + const _mapInt32Int32_ = json["mapInt32Int32"] ?? json["map_int32_int32"]; + if (_mapInt32Int32_) { + msg.mapInt32Int32 = Object.fromEntries( + Object.entries(_mapInt32Int32_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapInt32Int32._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapInt64Int64_ = json["mapInt64Int64"] ?? json["map_int64_int64"]; + if (_mapInt64Int64_) { + msg.mapInt64Int64 = Object.fromEntries( + Object.entries(_mapInt64Int64_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapInt64Int64._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapUint32Uint32_ = + json["mapUint32Uint32"] ?? json["map_uint32_uint32"]; + if (_mapUint32Uint32_) { + msg.mapUint32Uint32 = Object.fromEntries( + Object.entries(_mapUint32Uint32_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapUint32Uint32._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapUint64Uint64_ = + json["mapUint64Uint64"] ?? json["map_uint64_uint64"]; + if (_mapUint64Uint64_) { + msg.mapUint64Uint64 = Object.fromEntries( + Object.entries(_mapUint64Uint64_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapUint64Uint64._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapSint32Sint32_ = + json["mapSint32Sint32"] ?? json["map_sint32_sint32"]; + if (_mapSint32Sint32_) { + msg.mapSint32Sint32 = Object.fromEntries( + Object.entries(_mapSint32Sint32_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapSint32Sint32._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapSint64Sint64_ = + json["mapSint64Sint64"] ?? json["map_sint64_sint64"]; + if (_mapSint64Sint64_) { + msg.mapSint64Sint64 = Object.fromEntries( + Object.entries(_mapSint64Sint64_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapSint64Sint64._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapFixed32Fixed32_ = + json["mapFixed32Fixed32"] ?? json["map_fixed32_fixed32"]; + if (_mapFixed32Fixed32_) { + msg.mapFixed32Fixed32 = Object.fromEntries( + Object.entries(_mapFixed32Fixed32_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapFixed32Fixed32._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapFixed64Fixed64_ = + json["mapFixed64Fixed64"] ?? json["map_fixed64_fixed64"]; + if (_mapFixed64Fixed64_) { + msg.mapFixed64Fixed64 = Object.fromEntries( + Object.entries(_mapFixed64Fixed64_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapFixed64Fixed64._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapSfixed32Sfixed32_ = + json["mapSfixed32Sfixed32"] ?? json["map_sfixed32_sfixed32"]; + if (_mapSfixed32Sfixed32_) { + msg.mapSfixed32Sfixed32 = Object.fromEntries( + Object.entries(_mapSfixed32Sfixed32_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapSfixed32Sfixed32._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapSfixed64Sfixed64_ = + json["mapSfixed64Sfixed64"] ?? json["map_sfixed64_sfixed64"]; + if (_mapSfixed64Sfixed64_) { + msg.mapSfixed64Sfixed64 = Object.fromEntries( + Object.entries(_mapSfixed64Sfixed64_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapSfixed64Sfixed64._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapInt32Float_ = json["mapInt32Float"] ?? json["map_int32_float"]; + if (_mapInt32Float_) { + msg.mapInt32Float = Object.fromEntries( + Object.entries(_mapInt32Float_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapInt32Float._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapInt32Double_ = json["mapInt32Double"] ?? json["map_int32_double"]; + if (_mapInt32Double_) { + msg.mapInt32Double = Object.fromEntries( + Object.entries(_mapInt32Double_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapInt32Double._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapBoolBool_ = json["mapBoolBool"] ?? json["map_bool_bool"]; + if (_mapBoolBool_) { + msg.mapBoolBool = Object.fromEntries( + Object.entries(_mapBoolBool_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapBoolBool._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapStringString_ = + json["mapStringString"] ?? json["map_string_string"]; + if (_mapStringString_) { + msg.mapStringString = Object.fromEntries( + Object.entries(_mapStringString_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapStringString._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapStringBytes_ = json["mapStringBytes"] ?? json["map_string_bytes"]; + if (_mapStringBytes_) { + msg.mapStringBytes = Object.fromEntries( + Object.entries(_mapStringBytes_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapStringBytes._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapStringNestedMessage_ = + json["mapStringNestedMessage"] ?? json["map_string_nested_message"]; + if (_mapStringNestedMessage_) { + msg.mapStringNestedMessage = Object.fromEntries( + Object.entries(_mapStringNestedMessage_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapStringNestedMessage._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapStringForeignMessage_ = + json["mapStringForeignMessage"] ?? json["map_string_foreign_message"]; + if (_mapStringForeignMessage_) { + msg.mapStringForeignMessage = Object.fromEntries( + Object.entries(_mapStringForeignMessage_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapStringForeignMessage._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapStringNestedEnum_ = + json["mapStringNestedEnum"] ?? json["map_string_nested_enum"]; + if (_mapStringNestedEnum_) { + msg.mapStringNestedEnum = Object.fromEntries( + Object.entries(_mapStringNestedEnum_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapStringNestedEnum._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _mapStringForeignEnum_ = + json["mapStringForeignEnum"] ?? json["map_string_foreign_enum"]; + if (_mapStringForeignEnum_) { + msg.mapStringForeignEnum = Object.fromEntries( + Object.entries(_mapStringForeignEnum_) + .map(([key, value]) => ({ key: key as any, value: value as any })) + .map(TestAllTypesProto3JSON.MapStringForeignEnum._readMessage) + .map(({ key, value }) => [key, value]) + ); + } + const _oneofUint32_ = json["oneofUint32"] ?? json["oneof_uint32"]; + if (_oneofUint32_) { + msg.oneofUint32 = _oneofUint32_; + } + const _oneofNestedMessage_ = + json["oneofNestedMessage"] ?? json["oneof_nested_message"]; + if (_oneofNestedMessage_) { + const m = TestAllTypesProto3JSON.NestedMessage.initialize(); + TestAllTypesProto3JSON.NestedMessage._readMessage( + m, + _oneofNestedMessage_ + ); + msg.oneofNestedMessage = m; + } + const _oneofString_ = json["oneofString"] ?? json["oneof_string"]; + if (_oneofString_) { + msg.oneofString = _oneofString_; + } + const _oneofBytes_ = json["oneofBytes"] ?? json["oneof_bytes"]; + if (_oneofBytes_) { + msg.oneofBytes = decodeBase64Bytes(_oneofBytes_); + } + const _oneofBool_ = json["oneofBool"] ?? json["oneof_bool"]; + if (_oneofBool_) { + msg.oneofBool = _oneofBool_; + } + const _oneofUint64_ = json["oneofUint64"] ?? json["oneof_uint64"]; + if (_oneofUint64_) { + msg.oneofUint64 = BigInt(_oneofUint64_); + } + const _oneofFloat_ = json["oneofFloat"] ?? json["oneof_float"]; + if (_oneofFloat_) { + msg.oneofFloat = _oneofFloat_; + } + const _oneofDouble_ = json["oneofDouble"] ?? json["oneof_double"]; + if (_oneofDouble_) { + msg.oneofDouble = _oneofDouble_; + } + const _oneofEnum_ = json["oneofEnum"] ?? json["oneof_enum"]; + if (_oneofEnum_) { + msg.oneofEnum = _oneofEnum_; + } + const _oneofNullValue_ = json["oneofNullValue"] ?? json["oneof_null_value"]; + if (_oneofNullValue_) { + msg.oneofNullValue = _oneofNullValue_; + } + const _optionalBoolWrapper_ = + json["optionalBoolWrapper"] ?? json["optional_bool_wrapper"]; + if (_optionalBoolWrapper_) { + const m = protoscript.BoolValueJSON.initialize(); + protoscript.BoolValueJSON._readMessage(m, _optionalBoolWrapper_); + msg.optionalBoolWrapper = m; + } + const _optionalInt32Wrapper_ = + json["optionalInt32Wrapper"] ?? json["optional_int32_wrapper"]; + if (_optionalInt32Wrapper_) { + const m = protoscript.Int32ValueJSON.initialize(); + protoscript.Int32ValueJSON._readMessage(m, _optionalInt32Wrapper_); + msg.optionalInt32Wrapper = m; + } + const _optionalInt64Wrapper_ = + json["optionalInt64Wrapper"] ?? json["optional_int64_wrapper"]; + if (_optionalInt64Wrapper_) { + const m = protoscript.Int64ValueJSON.initialize(); + protoscript.Int64ValueJSON._readMessage(m, _optionalInt64Wrapper_); + msg.optionalInt64Wrapper = m; + } + const _optionalUint32Wrapper_ = + json["optionalUint32Wrapper"] ?? json["optional_uint32_wrapper"]; + if (_optionalUint32Wrapper_) { + const m = protoscript.UInt32ValueJSON.initialize(); + protoscript.UInt32ValueJSON._readMessage(m, _optionalUint32Wrapper_); + msg.optionalUint32Wrapper = m; + } + const _optionalUint64Wrapper_ = + json["optionalUint64Wrapper"] ?? json["optional_uint64_wrapper"]; + if (_optionalUint64Wrapper_) { + const m = protoscript.UInt64ValueJSON.initialize(); + protoscript.UInt64ValueJSON._readMessage(m, _optionalUint64Wrapper_); + msg.optionalUint64Wrapper = m; + } + const _optionalFloatWrapper_ = + json["optionalFloatWrapper"] ?? json["optional_float_wrapper"]; + if (_optionalFloatWrapper_) { + const m = protoscript.FloatValueJSON.initialize(); + protoscript.FloatValueJSON._readMessage(m, _optionalFloatWrapper_); + msg.optionalFloatWrapper = m; + } + const _optionalDoubleWrapper_ = + json["optionalDoubleWrapper"] ?? json["optional_double_wrapper"]; + if (_optionalDoubleWrapper_) { + const m = protoscript.DoubleValueJSON.initialize(); + protoscript.DoubleValueJSON._readMessage(m, _optionalDoubleWrapper_); + msg.optionalDoubleWrapper = m; + } + const _optionalStringWrapper_ = + json["optionalStringWrapper"] ?? json["optional_string_wrapper"]; + if (_optionalStringWrapper_) { + const m = protoscript.StringValueJSON.initialize(); + protoscript.StringValueJSON._readMessage(m, _optionalStringWrapper_); + msg.optionalStringWrapper = m; + } + const _optionalBytesWrapper_ = + json["optionalBytesWrapper"] ?? json["optional_bytes_wrapper"]; + if (_optionalBytesWrapper_) { + const m = protoscript.BytesValueJSON.initialize(); + protoscript.BytesValueJSON._readMessage(m, _optionalBytesWrapper_); + msg.optionalBytesWrapper = m; + } + const _repeatedBoolWrapper_ = + json["repeatedBoolWrapper"] ?? json["repeated_bool_wrapper"]; + if (_repeatedBoolWrapper_) { + for (const item of _repeatedBoolWrapper_) { + const m = protoscript.BoolValueJSON.initialize(); + protoscript.BoolValueJSON._readMessage(m, item); + msg.repeatedBoolWrapper.push(m); + } + } + const _repeatedInt32Wrapper_ = + json["repeatedInt32Wrapper"] ?? json["repeated_int32_wrapper"]; + if (_repeatedInt32Wrapper_) { + for (const item of _repeatedInt32Wrapper_) { + const m = protoscript.Int32ValueJSON.initialize(); + protoscript.Int32ValueJSON._readMessage(m, item); + msg.repeatedInt32Wrapper.push(m); + } + } + const _repeatedInt64Wrapper_ = + json["repeatedInt64Wrapper"] ?? json["repeated_int64_wrapper"]; + if (_repeatedInt64Wrapper_) { + for (const item of _repeatedInt64Wrapper_) { + const m = protoscript.Int64ValueJSON.initialize(); + protoscript.Int64ValueJSON._readMessage(m, item); + msg.repeatedInt64Wrapper.push(m); + } + } + const _repeatedUint32Wrapper_ = + json["repeatedUint32Wrapper"] ?? json["repeated_uint32_wrapper"]; + if (_repeatedUint32Wrapper_) { + for (const item of _repeatedUint32Wrapper_) { + const m = protoscript.UInt32ValueJSON.initialize(); + protoscript.UInt32ValueJSON._readMessage(m, item); + msg.repeatedUint32Wrapper.push(m); + } + } + const _repeatedUint64Wrapper_ = + json["repeatedUint64Wrapper"] ?? json["repeated_uint64_wrapper"]; + if (_repeatedUint64Wrapper_) { + for (const item of _repeatedUint64Wrapper_) { + const m = protoscript.UInt64ValueJSON.initialize(); + protoscript.UInt64ValueJSON._readMessage(m, item); + msg.repeatedUint64Wrapper.push(m); + } + } + const _repeatedFloatWrapper_ = + json["repeatedFloatWrapper"] ?? json["repeated_float_wrapper"]; + if (_repeatedFloatWrapper_) { + for (const item of _repeatedFloatWrapper_) { + const m = protoscript.FloatValueJSON.initialize(); + protoscript.FloatValueJSON._readMessage(m, item); + msg.repeatedFloatWrapper.push(m); + } + } + const _repeatedDoubleWrapper_ = + json["repeatedDoubleWrapper"] ?? json["repeated_double_wrapper"]; + if (_repeatedDoubleWrapper_) { + for (const item of _repeatedDoubleWrapper_) { + const m = protoscript.DoubleValueJSON.initialize(); + protoscript.DoubleValueJSON._readMessage(m, item); + msg.repeatedDoubleWrapper.push(m); + } + } + const _repeatedStringWrapper_ = + json["repeatedStringWrapper"] ?? json["repeated_string_wrapper"]; + if (_repeatedStringWrapper_) { + for (const item of _repeatedStringWrapper_) { + const m = protoscript.StringValueJSON.initialize(); + protoscript.StringValueJSON._readMessage(m, item); + msg.repeatedStringWrapper.push(m); + } + } + const _repeatedBytesWrapper_ = + json["repeatedBytesWrapper"] ?? json["repeated_bytes_wrapper"]; + if (_repeatedBytesWrapper_) { + for (const item of _repeatedBytesWrapper_) { + const m = protoscript.BytesValueJSON.initialize(); + protoscript.BytesValueJSON._readMessage(m, item); + msg.repeatedBytesWrapper.push(m); + } + } + const _optionalDuration_ = + json["optionalDuration"] ?? json["optional_duration"]; + if (_optionalDuration_) { + const m = protoscript.DurationJSON.initialize(); + protoscript.DurationJSON._readMessage(m, _optionalDuration_); + msg.optionalDuration = m; + } + const _optionalTimestamp_ = + json["optionalTimestamp"] ?? json["optional_timestamp"]; + if (_optionalTimestamp_) { + const m = protoscript.TimestampJSON.initialize(); + protoscript.TimestampJSON._readMessage(m, _optionalTimestamp_); + msg.optionalTimestamp = m; + } + const _optionalFieldMask_ = + json["optionalFieldMask"] ?? json["optional_field_mask"]; + if (_optionalFieldMask_) { + const m = protoscript.FieldMaskJSON.initialize(); + protoscript.FieldMaskJSON._readMessage(m, _optionalFieldMask_); + msg.optionalFieldMask = m; + } + const _optionalStruct_ = json["optionalStruct"] ?? json["optional_struct"]; + if (_optionalStruct_) { + const m = protoscript.StructJSON.initialize(); + protoscript.StructJSON._readMessage(m, _optionalStruct_); + msg.optionalStruct = m; + } + const _optionalAny_ = json["optionalAny"] ?? json["optional_any"]; + if (_optionalAny_) { + const m = protoscript.AnyJSON.initialize(); + protoscript.AnyJSON._readMessage(m, _optionalAny_); + msg.optionalAny = m; + } + const _optionalValue_ = json["optionalValue"] ?? json["optional_value"]; + if (_optionalValue_) { + const m = protoscript.ValueJSON.initialize(); + protoscript.ValueJSON._readMessage(m, _optionalValue_); + msg.optionalValue = m; + } + const _optionalNullValue_ = + json["optionalNullValue"] ?? json["optional_null_value"]; + if (_optionalNullValue_) { + msg.optionalNullValue = _optionalNullValue_; + } + const _repeatedDuration_ = + json["repeatedDuration"] ?? json["repeated_duration"]; + if (_repeatedDuration_) { + for (const item of _repeatedDuration_) { + const m = protoscript.DurationJSON.initialize(); + protoscript.DurationJSON._readMessage(m, item); + msg.repeatedDuration.push(m); + } + } + const _repeatedTimestamp_ = + json["repeatedTimestamp"] ?? json["repeated_timestamp"]; + if (_repeatedTimestamp_) { + for (const item of _repeatedTimestamp_) { + const m = protoscript.TimestampJSON.initialize(); + protoscript.TimestampJSON._readMessage(m, item); + msg.repeatedTimestamp.push(m); + } + } + const _repeatedFieldmask_ = + json["repeatedFieldmask"] ?? json["repeated_fieldmask"]; + if (_repeatedFieldmask_) { + for (const item of _repeatedFieldmask_) { + const m = protoscript.FieldMaskJSON.initialize(); + protoscript.FieldMaskJSON._readMessage(m, item); + msg.repeatedFieldmask.push(m); + } + } + const _repeatedStruct_ = json["repeatedStruct"] ?? json["repeated_struct"]; + if (_repeatedStruct_) { + for (const item of _repeatedStruct_) { + const m = protoscript.StructJSON.initialize(); + protoscript.StructJSON._readMessage(m, item); + msg.repeatedStruct.push(m); + } + } + const _repeatedAny_ = json["repeatedAny"] ?? json["repeated_any"]; + if (_repeatedAny_) { + for (const item of _repeatedAny_) { + const m = protoscript.AnyJSON.initialize(); + protoscript.AnyJSON._readMessage(m, item); + msg.repeatedAny.push(m); + } + } + const _repeatedValue_ = json["repeatedValue"] ?? json["repeated_value"]; + if (_repeatedValue_) { + for (const item of _repeatedValue_) { + const m = protoscript.ValueJSON.initialize(); + protoscript.ValueJSON._readMessage(m, item); + msg.repeatedValue.push(m); + } + } + const _repeatedListValue_ = + json["repeatedListValue"] ?? json["repeated_list_value"]; + if (_repeatedListValue_) { + for (const item of _repeatedListValue_) { + const m = protoscript.ListValueJSON.initialize(); + protoscript.ListValueJSON._readMessage(m, item); + msg.repeatedListValue.push(m); + } + } + const _fieldname1_ = json["fieldname1"]; + if (_fieldname1_) { + msg.fieldname1 = _fieldname1_; + } + const _fieldName2_ = json["fieldName2"] ?? json["field_name2"]; + if (_fieldName2_) { + msg.fieldName2 = _fieldName2_; + } + const _fieldName3_ = + json["FieldName3"] ?? json["fieldName3"] ?? json["_field_name3"]; + if (_fieldName3_) { + msg.fieldName3 = _fieldName3_; + } + const _fieldName4_ = json["fieldName4"] ?? json["field__name4_"]; + if (_fieldName4_) { + msg.fieldName4 = _fieldName4_; + } + const _field0name5_ = json["field0name5"]; + if (_field0name5_) { + msg.field0name5 = _field0name5_; + } + const _field0Name6_ = json["field0Name6"] ?? json["field_0_name6"]; + if (_field0Name6_) { + msg.field0Name6 = _field0Name6_; + } + const _fieldName7_ = json["fieldName7"]; + if (_fieldName7_) { + msg.fieldName7 = _fieldName7_; + } + const _FieldName8_ = json["FieldName8"]; + if (_FieldName8_) { + msg.FieldName8 = _FieldName8_; + } + const _fieldName9_ = json["fieldName9"] ?? json["field_Name9"]; + if (_fieldName9_) { + msg.fieldName9 = _fieldName9_; + } + const _FieldName10_ = json["FieldName10"] ?? json["Field_Name10"]; + if (_FieldName10_) { + msg.FieldName10 = _FieldName10_; + } + const _FIELDNAME11_ = json["FIELDNAME11"] ?? json["FIELD_NAME11"]; + if (_FIELDNAME11_) { + msg.FIELDNAME11 = _FIELDNAME11_; + } + const _FIELDName12_ = json["FIELDName12"] ?? json["FIELD_name12"]; + if (_FIELDName12_) { + msg.FIELDName12 = _FIELDName12_; + } + const _fieldName13_ = + json["FieldName13"] ?? json["fieldName13"] ?? json["__field_name13"]; + if (_fieldName13_) { + msg.fieldName13 = _fieldName13_; + } + const _FieldName14_ = json["FieldName14"] ?? json["__Field_name14"]; + if (_FieldName14_) { + msg.FieldName14 = _FieldName14_; + } + const _fieldName15_ = json["fieldName15"] ?? json["field__name15"]; + if (_fieldName15_) { + msg.fieldName15 = _fieldName15_; + } + const _fieldName16_ = json["fieldName16"] ?? json["field__Name16"]; + if (_fieldName16_) { + msg.fieldName16 = _fieldName16_; + } + const _fieldName17_ = json["fieldName17"] ?? json["field_name17__"]; + if (_fieldName17_) { + msg.fieldName17 = _fieldName17_; + } + const _FieldName18_ = json["FieldName18"] ?? json["Field_name18__"]; + if (_FieldName18_) { + msg.FieldName18 = _FieldName18_; + } + return msg; + }, + + NestedEnum: { + FOO: "FOO", + BAR: "BAR", + BAZ: "BAZ", + NEG: "NEG", + /** + * @private + */ + _fromInt: function (i: number): TestAllTypesProto3.NestedEnum { + switch (i) { + case 0: { + return "FOO"; + } + case 1: { + return "BAR"; + } + case 2: { + return "BAZ"; + } + case -1: { + return "NEG"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as TestAllTypesProto3.NestedEnum; + } + } + }, + /** + * @private + */ + _toInt: function (i: TestAllTypesProto3.NestedEnum): number { + switch (i) { + case "FOO": { + return 0; + } + case "BAR": { + return 1; + } + case "BAZ": { + return 2; + } + case "NEG": { + return -1; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, + } as const, + + AliasedEnum: { + ALIAS_FOO: "ALIAS_FOO", + ALIAS_BAR: "ALIAS_BAR", + ALIAS_BAZ: "ALIAS_BAZ", + MOO: "MOO", + moo: "moo", + bAz: "bAz", + /** + * @private + */ + _fromInt: function (i: number): TestAllTypesProto3.AliasedEnum { + switch (i) { + case 0: { + return "ALIAS_FOO"; + } + case 1: { + return "ALIAS_BAR"; + } + case 2: { + return "ALIAS_BAZ"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as TestAllTypesProto3.AliasedEnum; + } + } + }, + /** + * @private + */ + _toInt: function (i: TestAllTypesProto3.AliasedEnum): number { + switch (i) { + case "ALIAS_FOO": { + return 0; + } + case "ALIAS_BAR": { + return 1; + } + case "ALIAS_BAZ": { + return 2; + } + case "MOO": { + return 2; + } + case "moo": { + return 2; + } + case "bAz": { + return 2; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, + } as const, + + NestedMessage: { + /** + * Serializes TestAllTypesProto3.NestedMessage to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify( + TestAllTypesProto3JSON.NestedMessage._writeMessage(msg) + ); + }, + + /** + * Deserializes TestAllTypesProto3.NestedMessage from JSON. + */ + decode: function (json: string): TestAllTypesProto3.NestedMessage { + return TestAllTypesProto3JSON.NestedMessage._readMessage( + TestAllTypesProto3JSON.NestedMessage.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes TestAllTypesProto3.NestedMessage with all fields set to their default value. + */ + initialize: function (): TestAllTypesProto3.NestedMessage { + return { + a: 0, + corecursive: TestAllTypesProto3JSON.initialize(), + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.a) { + json["a"] = msg.a; + } + if (msg.corecursive) { + const _corecursive_ = TestAllTypesProto3JSON._writeMessage( + msg.corecursive + ); + if (Object.keys(_corecursive_).length > 0) { + json["corecursive"] = _corecursive_; + } + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.NestedMessage, + json: any + ): TestAllTypesProto3.NestedMessage { + const _a_ = json["a"]; + if (_a_) { + msg.a = _a_; + } + const _corecursive_ = json["corecursive"]; + if (_corecursive_) { + const m = TestAllTypesProto3JSON.initialize(); + TestAllTypesProto3JSON._readMessage(m, _corecursive_); + msg.corecursive = m; + } + return msg; + }, + }, + + MapInt32Int32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapInt32Int32, + json: any + ): TestAllTypesProto3.MapInt32Int32 { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapInt64Int64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key.toString(); + } + if (msg.value) { + json["value"] = msg.value.toString(); + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapInt64Int64, + json: any + ): TestAllTypesProto3.MapInt64Int64 { + const _key_ = json["key"]; + if (_key_) { + msg.key = BigInt(_key_); + } + const _value_ = json["value"]; + if (_value_) { + msg.value = BigInt(_value_); + } + return msg; + }, + }, + + MapUint32Uint32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapUint32Uint32, + json: any + ): TestAllTypesProto3.MapUint32Uint32 { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapUint64Uint64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key.toString(); + } + if (msg.value) { + json["value"] = msg.value.toString(); + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapUint64Uint64, + json: any + ): TestAllTypesProto3.MapUint64Uint64 { + const _key_ = json["key"]; + if (_key_) { + msg.key = BigInt(_key_); + } + const _value_ = json["value"]; + if (_value_) { + msg.value = BigInt(_value_); + } + return msg; + }, + }, + + MapSint32Sint32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapSint32Sint32, + json: any + ): TestAllTypesProto3.MapSint32Sint32 { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapSint64Sint64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key.toString(); + } + if (msg.value) { + json["value"] = msg.value.toString(); + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapSint64Sint64, + json: any + ): TestAllTypesProto3.MapSint64Sint64 { + const _key_ = json["key"]; + if (_key_) { + msg.key = BigInt(_key_); + } + const _value_ = json["value"]; + if (_value_) { + msg.value = BigInt(_value_); + } + return msg; + }, + }, + + MapFixed32Fixed32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapFixed32Fixed32, + json: any + ): TestAllTypesProto3.MapFixed32Fixed32 { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapFixed64Fixed64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key.toString(); + } + if (msg.value) { + json["value"] = msg.value.toString(); + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapFixed64Fixed64, + json: any + ): TestAllTypesProto3.MapFixed64Fixed64 { + const _key_ = json["key"]; + if (_key_) { + msg.key = BigInt(_key_); + } + const _value_ = json["value"]; + if (_value_) { + msg.value = BigInt(_value_); + } + return msg; + }, + }, + + MapSfixed32Sfixed32: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapSfixed32Sfixed32, + json: any + ): TestAllTypesProto3.MapSfixed32Sfixed32 { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapSfixed64Sfixed64: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key.toString(); + } + if (msg.value) { + json["value"] = msg.value.toString(); + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapSfixed64Sfixed64, + json: any + ): TestAllTypesProto3.MapSfixed64Sfixed64 { + const _key_ = json["key"]; + if (_key_) { + msg.key = BigInt(_key_); + } + const _value_ = json["value"]; + if (_value_) { + msg.value = BigInt(_value_); + } + return msg; + }, + }, + + MapInt32Float: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapInt32Float, + json: any + ): TestAllTypesProto3.MapInt32Float { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapInt32Double: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapInt32Double, + json: any + ): TestAllTypesProto3.MapInt32Double { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapBoolBool: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapBoolBool, + json: any + ): TestAllTypesProto3.MapBoolBool { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapStringString: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapStringString, + json: any + ): TestAllTypesProto3.MapStringString { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapStringBytes: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value?.length) { + json["value"] = encodeBase64Bytes(msg.value); + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapStringBytes, + json: any + ): TestAllTypesProto3.MapStringBytes { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = decodeBase64Bytes(_value_); + } + return msg; + }, + }, + + MapStringNestedMessage: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + const _value_ = TestAllTypesProto3JSON.NestedMessage._writeMessage( + msg.value + ); + if (Object.keys(_value_).length > 0) { + json["value"] = _value_; + } + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapStringNestedMessage, + json: any + ): TestAllTypesProto3.MapStringNestedMessage { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + const m = TestAllTypesProto3JSON.NestedMessage.initialize(); + TestAllTypesProto3JSON.NestedMessage._readMessage(m, _value_); + msg.value = m; + } + return msg; + }, + }, + + MapStringForeignMessage: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value) { + const _value_ = ForeignMessageJSON._writeMessage(msg.value); + if (Object.keys(_value_).length > 0) { + json["value"] = _value_; + } + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapStringForeignMessage, + json: any + ): TestAllTypesProto3.MapStringForeignMessage { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + const m = ForeignMessageJSON.initialize(); + ForeignMessageJSON._readMessage(m, _value_); + msg.value = m; + } + return msg; + }, + }, + + MapStringNestedEnum: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value && TestAllTypesProto3JSON.NestedEnum._toInt(msg.value)) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapStringNestedEnum, + json: any + ): TestAllTypesProto3.MapStringNestedEnum { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, + + MapStringForeignEnum: { + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.key) { + json["key"] = msg.key; + } + if (msg.value && ForeignEnumJSON._toInt(msg.value)) { + json["value"] = msg.value; + } + return json; + }, + + /** + * @private + */ + _readMessage: function ( + msg: TestAllTypesProto3.MapStringForeignEnum, + json: any + ): TestAllTypesProto3.MapStringForeignEnum { + const _key_ = json["key"]; + if (_key_) { + msg.key = _key_; + } + const _value_ = json["value"]; + if (_value_) { + msg.value = _value_; + } + return msg; + }, + }, +}; + +export const ForeignMessageJSON = { + /** + * Serializes ForeignMessage to JSON. + */ + encode: function (msg: Partial): string { + return JSON.stringify(ForeignMessageJSON._writeMessage(msg)); + }, + + /** + * Deserializes ForeignMessage from JSON. + */ + decode: function (json: string): ForeignMessage { + return ForeignMessageJSON._readMessage( + ForeignMessageJSON.initialize(), + JSON.parse(json) + ); + }, + + /** + * Initializes ForeignMessage with all fields set to their default value. + */ + initialize: function (): ForeignMessage { + return { + c: 0, + }; + }, + + /** + * @private + */ + _writeMessage: function ( + msg: Partial + ): Record { + const json: Record = {}; + if (msg.c) { + json["c"] = msg.c; + } + return json; + }, + + /** + * @private + */ + _readMessage: function (msg: ForeignMessage, json: any): ForeignMessage { + const _c_ = json["c"]; + if (_c_) { + msg.c = _c_; + } + return msg; + }, +}; + +export const NullHypothesisProto3JSON = { + /** + * Serializes NullHypothesisProto3 to JSON. + */ + encode: function (_msg?: Partial): string { + return "{}"; + }, + + /** + * Deserializes NullHypothesisProto3 from JSON. + */ + decode: function (_json?: string): NullHypothesisProto3 { + return {}; + }, + + /** + * Initializes NullHypothesisProto3 with all fields set to their default value. + */ + initialize: function (): NullHypothesisProto3 { + return {}; + }, + + /** + * @private + */ + _writeMessage: function ( + _msg: Partial + ): Record { + return {}; + }, + + /** + * @private + */ + _readMessage: function ( + msg: NullHypothesisProto3, + _json: any + ): NullHypothesisProto3 { + return msg; + }, +}; + +export const EnumOnlyProto3JSON = { + /** + * Serializes EnumOnlyProto3 to JSON. + */ + encode: function (_msg?: Partial): string { + return "{}"; + }, + + /** + * Deserializes EnumOnlyProto3 from JSON. + */ + decode: function (_json?: string): EnumOnlyProto3 { + return {}; + }, + + /** + * Initializes EnumOnlyProto3 with all fields set to their default value. + */ + initialize: function (): EnumOnlyProto3 { + return {}; + }, + + /** + * @private + */ + _writeMessage: function ( + _msg: Partial + ): Record { + return {}; + }, + + /** + * @private + */ + _readMessage: function (msg: EnumOnlyProto3, _json: any): EnumOnlyProto3 { + return msg; + }, + + Bool: { + kFalse: "kFalse", + kTrue: "kTrue", + /** + * @private + */ + _fromInt: function (i: number): EnumOnlyProto3.Bool { + switch (i) { + case 0: { + return "kFalse"; + } + case 1: { + return "kTrue"; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as EnumOnlyProto3.Bool; + } + } + }, + /** + * @private + */ + _toInt: function (i: EnumOnlyProto3.Bool): number { + switch (i) { + case "kFalse": { + return 0; + } + case "kTrue": { + return 1; + } + // unknown values are preserved as numbers. this occurs when new enum values are introduced and the generated code is out of date. + default: { + return i as unknown as number; + } + } + }, + } as const, +}; diff --git a/impl/protoscript/nonexistent_tests.txt b/impl/protoscript/nonexistent_tests.txt new file mode 100644 index 00000000..4e9b0d5a --- /dev/null +++ b/impl/protoscript/nonexistent_tests.txt @@ -0,0 +1,112 @@ +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.ProtobufOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.TextFormatOutput +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes +Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes +Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString +Required.Proto2.TextFormatInput.GroupFieldEmpty.ProtobufOutput +Required.Proto2.TextFormatInput.GroupFieldEmpty.TextFormatOutput +Required.Proto2.TextFormatInput.GroupFieldNoColon.ProtobufOutput +Required.Proto2.TextFormatInput.GroupFieldNoColon.TextFormatOutput +Required.Proto2.TextFormatInput.GroupFieldWithColon.ProtobufOutput +Required.Proto2.TextFormatInput.GroupFieldWithColon.TextFormatOutput +Required.Proto3.TextFormatInput.AlphabeticallySortedMapBoolKeys.ProtobufOutput +Required.Proto3.TextFormatInput.AlphabeticallySortedMapBoolKeys.TextFormatOutput +Required.Proto3.TextFormatInput.AlphabeticallySortedMapIntKeys.ProtobufOutput +Required.Proto3.TextFormatInput.AlphabeticallySortedMapIntKeys.TextFormatOutput +Required.Proto3.TextFormatInput.AlphabeticallySortedMapStringKeys.ProtobufOutput +Required.Proto3.TextFormatInput.AlphabeticallySortedMapStringKeys.TextFormatOutput +Required.Proto3.TextFormatInput.AnyField.ProtobufOutput +Required.Proto3.TextFormatInput.AnyField.TextFormatOutput +Required.Proto3.TextFormatInput.AnyFieldWithInvalidType +Required.Proto3.TextFormatInput.AnyFieldWithRawBytes.ProtobufOutput +Required.Proto3.TextFormatInput.AnyFieldWithRawBytes.TextFormatOutput +Required.Proto3.TextFormatInput.BytesFieldBadUTF8Hex.ProtobufOutput +Required.Proto3.TextFormatInput.BytesFieldBadUTF8Hex.TextFormatOutput +Required.Proto3.TextFormatInput.BytesFieldBadUTF8Octal.ProtobufOutput +Required.Proto3.TextFormatInput.BytesFieldBadUTF8Octal.TextFormatOutput +Required.Proto3.TextFormatInput.DuplicateMapKey.ProtobufOutput +Required.Proto3.TextFormatInput.FloatField.ProtobufOutput +Required.Proto3.TextFormatInput.FloatField.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldMaxValue.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldMaxValue.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldMinValue.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldMinValue.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldNaNValue.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldNaNValue.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldNegInfValue.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldNegInfValue.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldPosInfValue.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldPosInfValue.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldTooLarge.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldTooLarge.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldTooSmall.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldTooSmall.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldWithInt32Max.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldWithInt32Max.TextFormatOutput +Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber.ProtobufOutput +Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber.TextFormatOutput +Required.Proto3.TextFormatInput.HelloWorld.ProtobufOutput +Required.Proto3.TextFormatInput.HelloWorld.TextFormatOutput +Required.Proto3.TextFormatInput.Int32FieldMaxValue.ProtobufOutput +Required.Proto3.TextFormatInput.Int32FieldMaxValue.TextFormatOutput +Required.Proto3.TextFormatInput.Int32FieldMinValue.ProtobufOutput +Required.Proto3.TextFormatInput.Int32FieldMinValue.TextFormatOutput +Required.Proto3.TextFormatInput.Int32FieldTooLarge +Required.Proto3.TextFormatInput.Int32FieldTooSmall +Required.Proto3.TextFormatInput.Int64FieldMaxValue.ProtobufOutput +Required.Proto3.TextFormatInput.Int64FieldMaxValue.TextFormatOutput +Required.Proto3.TextFormatInput.Int64FieldMinValue.ProtobufOutput +Required.Proto3.TextFormatInput.Int64FieldMinValue.TextFormatOutput +Required.Proto3.TextFormatInput.Int64FieldTooLarge +Required.Proto3.TextFormatInput.Int64FieldTooSmall +Required.Proto3.TextFormatInput.StringFieldBadUTF8Hex +Required.Proto3.TextFormatInput.StringFieldBadUTF8Octal +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralConcatBytes.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralConcatBytes.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralConcatString.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralConcatString.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralHexEscapesBytes.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralHexEscapesBytes.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralHexEscapesString.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralHexEscapesString.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralIncludesLFBytes +Required.Proto3.TextFormatInput.StringLiteralIncludesLFString +Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeBytes +Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeString +Required.Proto3.TextFormatInput.StringLiteralOctalEscapesBytes.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralOctalEscapesBytes.TextFormatOutput +Required.Proto3.TextFormatInput.StringLiteralOctalEscapesString.ProtobufOutput +Required.Proto3.TextFormatInput.StringLiteralOctalEscapesString.TextFormatOutput +Required.Proto3.TextFormatInput.Uint32FieldMaxValue.ProtobufOutput +Required.Proto3.TextFormatInput.Uint32FieldMaxValue.TextFormatOutput +Required.Proto3.TextFormatInput.Uint32FieldTooLarge +Required.Proto3.TextFormatInput.Uint64FieldMaxValue.ProtobufOutput +Required.Proto3.TextFormatInput.Uint64FieldMaxValue.TextFormatOutput +Required.Proto3.TextFormatInput.Uint64FieldTooLarge diff --git a/impl/protoscript/package-lock.json b/impl/protoscript/package-lock.json new file mode 100644 index 00000000..8a8ea9d5 --- /dev/null +++ b/impl/protoscript/package-lock.json @@ -0,0 +1,1042 @@ +{ + "name": "protoscript-conformance", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "protoscript-conformance", + "dependencies": { + "protoscript": "file:vendor/ProtoScript-0.0.14/dist" + }, + "devDependencies": { + "@bufbuild/buf": "^1.15.0", + "@types/node": "^18.14.2", + "protoscript": "0.0.15", + "tsx": "^3.12.3", + "typescript": "^4.9.5" + } + }, + "node_modules/@bufbuild/buf": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf/-/buf-1.15.0.tgz", + "integrity": "sha512-HX6AjKiI8TVFJKWdDGIUC/zZQG/8sf5FbmU5VdbK/U8tbfCwBADkJ6I+qP6HnDDtSU4obS164J0sibdGhAJKqg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "buf": "bin/buf", + "protoc-gen-buf-breaking": "bin/protoc-gen-buf-breaking", + "protoc-gen-buf-lint": "bin/protoc-gen-buf-lint" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@bufbuild/buf-darwin-arm64": "1.15.0", + "@bufbuild/buf-darwin-x64": "1.15.0", + "@bufbuild/buf-linux-aarch64": "1.15.0", + "@bufbuild/buf-linux-x64": "1.15.0", + "@bufbuild/buf-win32-arm64": "1.15.0", + "@bufbuild/buf-win32-x64": "1.15.0" + } + }, + "node_modules/@bufbuild/buf-darwin-arm64": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-arm64/-/buf-darwin-arm64-1.15.0.tgz", + "integrity": "sha512-sLN6uGc8sIBALa7Q4fB6rW9NM0MXK32pH6RRDUdl7aDrp/3A6TLKKBGiHcY81axUyxDTUNFb8dOwhHTI2H8FzQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-darwin-x64": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-x64/-/buf-darwin-x64-1.15.0.tgz", + "integrity": "sha512-iHml29I/hOl7ORyp9ohiV7fC1WqPbM5UjogwVpA8j06o5SgxRhp42nd80XRAXCM+65ecwiu5JVuspicGzQFOgg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-linux-aarch64": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-aarch64/-/buf-linux-aarch64-1.15.0.tgz", + "integrity": "sha512-YQHXqV1HhdpmIUrYg+gZNWCf43XHJJO5TlJT+pzXB/92PoN8gNP3KdxeRaM2sExcCs91G6zy1/Ms9N6DpeidUQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-linux-x64": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-x64/-/buf-linux-x64-1.15.0.tgz", + "integrity": "sha512-DD2OcsfofawRPQKXLFMqV2GSzi4WyE7kKE1PvXBtJy7sombv5TM26vgdb+DQv4T4Z2i7vhKshnflNkfd3QXtXA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-win32-arm64": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-arm64/-/buf-win32-arm64-1.15.0.tgz", + "integrity": "sha512-wk65iDXWRicfrt/9Gb1voAn9eGP2giQfKMrKOoEyytnDHFolMSmQimKH6iQ1uS5Vn0gI/BVp582cF1m9YsbXEg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@bufbuild/buf-win32-x64": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-x64/-/buf-win32-x64-1.15.0.tgz", + "integrity": "sha512-KVoMj52ghYfLwGjQ+t19XZiQy8jGSGUYIe/yVZz08rsm5msXHGYOt++Bk3wr48rcv8gts8jo2/h1Ebkj+F6emw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild-kit/cjs-loader": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.2.tgz", + "integrity": "sha512-BDXFbYOJzT/NBEtp71cvsrGPwGAMGRB/349rwKuoxNSiKjPraNNnlK6MIIabViCjqZugu6j+xeMDlEkWdHHJSg==", + "dev": true, + "dependencies": { + "@esbuild-kit/core-utils": "^3.0.0", + "get-tsconfig": "^4.4.0" + } + }, + "node_modules/@esbuild-kit/core-utils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.1.0.tgz", + "integrity": "sha512-Uuk8RpCg/7fdHSceR1M6XbSZFSuMrxcePFuGgyvsBn+u339dk5OeL4jv2EojwTN2st/unJGsVm4qHWjWNmJ/tw==", + "dev": true, + "dependencies": { + "esbuild": "~0.17.6", + "source-map-support": "^0.5.21" + } + }, + "node_modules/@esbuild-kit/esm-loader": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.5.5.tgz", + "integrity": "sha512-Qwfvj/qoPbClxCRNuac1Du01r9gvNOT+pMYtJDapfB1eoGN1YlJ1BixLyL9WVENRx5RXgNLdfYdx/CuswlGhMw==", + "dev": true, + "dependencies": { + "@esbuild-kit/core-utils": "^3.0.0", + "get-tsconfig": "^4.4.0" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.8.tgz", + "integrity": "sha512-0/rb91GYKhrtbeglJXOhAv9RuYimgI8h623TplY2X+vA4EXnk3Zj1fXZreJ0J3OJJu1bwmb0W7g+2cT/d8/l/w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.8.tgz", + "integrity": "sha512-oa/N5j6v1svZQs7EIRPqR8f+Bf8g6HBDjD/xHC02radE/NjKHK7oQmtmLxPs1iVwYyvE+Kolo6lbpfEQ9xnhxQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.8.tgz", + "integrity": "sha512-bTliMLqD7pTOoPg4zZkXqCDuzIUguEWLpeqkNfC41ODBHwoUgZ2w5JBeYimv4oP6TDVocoYmEhZrCLQTrH89bg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.8.tgz", + "integrity": "sha512-ghAbV3ia2zybEefXRRm7+lx8J/rnupZT0gp9CaGy/3iolEXkJ6LYRq4IpQVI9zR97ID80KJVoUlo3LSeA/sMAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.8.tgz", + "integrity": "sha512-n5WOpyvZ9TIdv2V1K3/iIkkJeKmUpKaCTdun9buhGRWfH//osmUjlv4Z5mmWdPWind/VGcVxTHtLfLCOohsOXw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.8.tgz", + "integrity": "sha512-a/SATTaOhPIPFWvHZDoZYgxaZRVHn0/LX1fHLGfZ6C13JqFUZ3K6SMD6/HCtwOQ8HnsNaEeokdiDSFLuizqv5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.8.tgz", + "integrity": "sha512-xpFJb08dfXr5+rZc4E+ooZmayBW6R3q59daCpKZ/cDU96/kvDM+vkYzNeTJCGd8rtO6fHWMq5Rcv/1cY6p6/0Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.8.tgz", + "integrity": "sha512-6Ij8gfuGszcEwZpi5jQIJCVIACLS8Tz2chnEBfYjlmMzVsfqBP1iGmHQPp7JSnZg5xxK9tjCc+pJ2WtAmPRFVA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.8.tgz", + "integrity": "sha512-v3iwDQuDljLTxpsqQDl3fl/yihjPAyOguxuloON9kFHYwopeJEf1BkDXODzYyXEI19gisEsQlG1bM65YqKSIww==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.8.tgz", + "integrity": "sha512-8svILYKhE5XetuFk/B6raFYIyIqydQi+GngEXJgdPdI7OMKUbSd7uzR02wSY4kb53xBrClLkhH4Xs8P61Q2BaA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.8.tgz", + "integrity": "sha512-B6FyMeRJeV0NpyEOYlm5qtQfxbdlgmiGdD+QsipzKfFky0K5HW5Td6dyK3L3ypu1eY4kOmo7wW0o94SBqlqBSA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.8.tgz", + "integrity": "sha512-CCb67RKahNobjm/eeEqeD/oJfJlrWyw29fgiyB6vcgyq97YAf3gCOuP6qMShYSPXgnlZe/i4a8WFHBw6N8bYAA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.8.tgz", + "integrity": "sha512-bytLJOi55y55+mGSdgwZ5qBm0K9WOCh0rx+vavVPx+gqLLhxtSFU0XbeYy/dsAAD6xECGEv4IQeFILaSS2auXw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.8.tgz", + "integrity": "sha512-2YpRyQJmKVBEHSBLa8kBAtbhucaclb6ex4wchfY0Tj3Kg39kpjeJ9vhRU7x4mUpq8ISLXRXH1L0dBYjAeqzZAw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.8.tgz", + "integrity": "sha512-QgbNY/V3IFXvNf11SS6exkpVcX0LJcob+0RWCgV9OiDAmVElnxciHIisoSix9uzYzScPmS6dJFbZULdSAEkQVw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.8.tgz", + "integrity": "sha512-mM/9S0SbAFDBc4OPoyP6SEOo5324LpUxdpeIUUSrSTOfhHU9hEfqRngmKgqILqwx/0DVJBzeNW7HmLEWp9vcOA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.8.tgz", + "integrity": "sha512-eKUYcWaWTaYr9zbj8GertdVtlt1DTS1gNBWov+iQfWuWyuu59YN6gSEJvFzC5ESJ4kMcKR0uqWThKUn5o8We6Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.8.tgz", + "integrity": "sha512-Vc9J4dXOboDyMXKD0eCeW0SIeEzr8K9oTHJU+Ci1mZc5njPfhKAqkRt3B/fUNU7dP+mRyralPu8QUkiaQn7iIg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.8.tgz", + "integrity": "sha512-0xvOTNuPXI7ft1LYUgiaXtpCEjp90RuBBYovdd2lqAFxje4sEucurg30M1WIm03+3jxByd3mfo+VUmPtRSVuOw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.8.tgz", + "integrity": "sha512-G0JQwUI5WdEFEnYNKzklxtBheCPkuDdu1YrtRrjuQv30WsYbkkoixKxLLv8qhJmNI+ATEWquZe/N0d0rpr55Mg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.8.tgz", + "integrity": "sha512-Fqy63515xl20OHGFykjJsMnoIWS+38fqfg88ClvPXyDbLtgXal2DTlhb1TfTX34qWi3u4I7Cq563QcHpqgLx8w==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.8.tgz", + "integrity": "sha512-1iuezdyDNngPnz8rLRDO2C/ZZ/emJLb72OsZeqQ6gL6Avko/XCXZw+NuxBSNhBAP13Hie418V7VMt9et1FMvpg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@types/node": { + "version": "18.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.2.tgz", + "integrity": "sha512-1uEQxww3DaghA0RxqHx0O0ppVlo43pJhepY51OxuQIKHpjbnYLA7vcdwioNPzIqmC2u3I/dmylcqjlh0e7AyUA==", + "dev": true + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/esbuild": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.8.tgz", + "integrity": "sha512-g24ybC3fWhZddZK6R3uD2iF/RIPnRpwJAqLov6ouX3hMbY4+tKolP0VMF3zuIYCaXun+yHwS5IPQ91N2BT191g==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.17.8", + "@esbuild/android-arm64": "0.17.8", + "@esbuild/android-x64": "0.17.8", + "@esbuild/darwin-arm64": "0.17.8", + "@esbuild/darwin-x64": "0.17.8", + "@esbuild/freebsd-arm64": "0.17.8", + "@esbuild/freebsd-x64": "0.17.8", + "@esbuild/linux-arm": "0.17.8", + "@esbuild/linux-arm64": "0.17.8", + "@esbuild/linux-ia32": "0.17.8", + "@esbuild/linux-loong64": "0.17.8", + "@esbuild/linux-mips64el": "0.17.8", + "@esbuild/linux-ppc64": "0.17.8", + "@esbuild/linux-riscv64": "0.17.8", + "@esbuild/linux-s390x": "0.17.8", + "@esbuild/linux-x64": "0.17.8", + "@esbuild/netbsd-x64": "0.17.8", + "@esbuild/openbsd-x64": "0.17.8", + "@esbuild/sunos-x64": "0.17.8", + "@esbuild/win32-arm64": "0.17.8", + "@esbuild/win32-ia32": "0.17.8", + "@esbuild/win32-x64": "0.17.8" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-tsconfig": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.4.0.tgz", + "integrity": "sha512-0Gdjo/9+FzsYhXCEFueo2aY1z1tpXrxWZzP7k8ul9qt1U5o8rYJwTJYmaeHdrVosYIVYkOy2iwCJ9FdpocJhPQ==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/google-protobuf": { + "version": "3.21.2", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.2.tgz", + "integrity": "sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA==", + "dev": true + }, + "node_modules/prettier": { + "version": "2.8.7", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz", + "integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/protoscript": { + "version": "0.0.15", + "resolved": "https://registry.npmjs.org/protoscript/-/protoscript-0.0.15.tgz", + "integrity": "sha512-CwXpfO0jdQ7VOc7UYm6dLPfQfcjk2TSwvYk0h2LdgjZ1NJePAXI85o1iL9LyDMGtijHR4CbAKCpm4VizGyunXA==", + "dev": true, + "dependencies": { + "google-protobuf": "^3.21.0", + "prettier": "^2.7.1" + }, + "bin": { + "protoscript": "cli/index.js" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/tsx": { + "version": "3.12.3", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-3.12.3.tgz", + "integrity": "sha512-Wc5BFH1xccYTXaQob+lEcimkcb/Pq+0en2s+ruiX0VEIC80nV7/0s7XRahx8NnsoCnpCVUPz8wrqVSPi760LkA==", + "dev": true, + "dependencies": { + "@esbuild-kit/cjs-loader": "^2.4.2", + "@esbuild-kit/core-utils": "^3.0.0", + "@esbuild-kit/esm-loader": "^2.5.5" + }, + "bin": { + "tsx": "dist/cli.js" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "vendor/protoscript/dist": { + "name": "protoscript", + "version": "0.0.14", + "extraneous": true, + "license": "MIT", + "dependencies": { + "google-protobuf": "^3.21.0", + "prettier": "^2.7.1" + }, + "bin": { + "protoscript": "cli/index.js" + } + } + }, + "dependencies": { + "@bufbuild/buf": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf/-/buf-1.15.0.tgz", + "integrity": "sha512-HX6AjKiI8TVFJKWdDGIUC/zZQG/8sf5FbmU5VdbK/U8tbfCwBADkJ6I+qP6HnDDtSU4obS164J0sibdGhAJKqg==", + "dev": true, + "requires": { + "@bufbuild/buf-darwin-arm64": "1.15.0", + "@bufbuild/buf-darwin-x64": "1.15.0", + "@bufbuild/buf-linux-aarch64": "1.15.0", + "@bufbuild/buf-linux-x64": "1.15.0", + "@bufbuild/buf-win32-arm64": "1.15.0", + "@bufbuild/buf-win32-x64": "1.15.0" + } + }, + "@bufbuild/buf-darwin-arm64": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-arm64/-/buf-darwin-arm64-1.15.0.tgz", + "integrity": "sha512-sLN6uGc8sIBALa7Q4fB6rW9NM0MXK32pH6RRDUdl7aDrp/3A6TLKKBGiHcY81axUyxDTUNFb8dOwhHTI2H8FzQ==", + "dev": true, + "optional": true + }, + "@bufbuild/buf-darwin-x64": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-darwin-x64/-/buf-darwin-x64-1.15.0.tgz", + "integrity": "sha512-iHml29I/hOl7ORyp9ohiV7fC1WqPbM5UjogwVpA8j06o5SgxRhp42nd80XRAXCM+65ecwiu5JVuspicGzQFOgg==", + "dev": true, + "optional": true + }, + "@bufbuild/buf-linux-aarch64": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-aarch64/-/buf-linux-aarch64-1.15.0.tgz", + "integrity": "sha512-YQHXqV1HhdpmIUrYg+gZNWCf43XHJJO5TlJT+pzXB/92PoN8gNP3KdxeRaM2sExcCs91G6zy1/Ms9N6DpeidUQ==", + "dev": true, + "optional": true + }, + "@bufbuild/buf-linux-x64": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-linux-x64/-/buf-linux-x64-1.15.0.tgz", + "integrity": "sha512-DD2OcsfofawRPQKXLFMqV2GSzi4WyE7kKE1PvXBtJy7sombv5TM26vgdb+DQv4T4Z2i7vhKshnflNkfd3QXtXA==", + "dev": true, + "optional": true + }, + "@bufbuild/buf-win32-arm64": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-arm64/-/buf-win32-arm64-1.15.0.tgz", + "integrity": "sha512-wk65iDXWRicfrt/9Gb1voAn9eGP2giQfKMrKOoEyytnDHFolMSmQimKH6iQ1uS5Vn0gI/BVp582cF1m9YsbXEg==", + "dev": true, + "optional": true + }, + "@bufbuild/buf-win32-x64": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@bufbuild/buf-win32-x64/-/buf-win32-x64-1.15.0.tgz", + "integrity": "sha512-KVoMj52ghYfLwGjQ+t19XZiQy8jGSGUYIe/yVZz08rsm5msXHGYOt++Bk3wr48rcv8gts8jo2/h1Ebkj+F6emw==", + "dev": true, + "optional": true + }, + "@esbuild-kit/cjs-loader": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.2.tgz", + "integrity": "sha512-BDXFbYOJzT/NBEtp71cvsrGPwGAMGRB/349rwKuoxNSiKjPraNNnlK6MIIabViCjqZugu6j+xeMDlEkWdHHJSg==", + "dev": true, + "requires": { + "@esbuild-kit/core-utils": "^3.0.0", + "get-tsconfig": "^4.4.0" + } + }, + "@esbuild-kit/core-utils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.1.0.tgz", + "integrity": "sha512-Uuk8RpCg/7fdHSceR1M6XbSZFSuMrxcePFuGgyvsBn+u339dk5OeL4jv2EojwTN2st/unJGsVm4qHWjWNmJ/tw==", + "dev": true, + "requires": { + "esbuild": "~0.17.6", + "source-map-support": "^0.5.21" + } + }, + "@esbuild-kit/esm-loader": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.5.5.tgz", + "integrity": "sha512-Qwfvj/qoPbClxCRNuac1Du01r9gvNOT+pMYtJDapfB1eoGN1YlJ1BixLyL9WVENRx5RXgNLdfYdx/CuswlGhMw==", + "dev": true, + "requires": { + "@esbuild-kit/core-utils": "^3.0.0", + "get-tsconfig": "^4.4.0" + } + }, + "@esbuild/android-arm": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.8.tgz", + "integrity": "sha512-0/rb91GYKhrtbeglJXOhAv9RuYimgI8h623TplY2X+vA4EXnk3Zj1fXZreJ0J3OJJu1bwmb0W7g+2cT/d8/l/w==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.8.tgz", + "integrity": "sha512-oa/N5j6v1svZQs7EIRPqR8f+Bf8g6HBDjD/xHC02radE/NjKHK7oQmtmLxPs1iVwYyvE+Kolo6lbpfEQ9xnhxQ==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.8.tgz", + "integrity": "sha512-bTliMLqD7pTOoPg4zZkXqCDuzIUguEWLpeqkNfC41ODBHwoUgZ2w5JBeYimv4oP6TDVocoYmEhZrCLQTrH89bg==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.8.tgz", + "integrity": "sha512-ghAbV3ia2zybEefXRRm7+lx8J/rnupZT0gp9CaGy/3iolEXkJ6LYRq4IpQVI9zR97ID80KJVoUlo3LSeA/sMAg==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.8.tgz", + "integrity": "sha512-n5WOpyvZ9TIdv2V1K3/iIkkJeKmUpKaCTdun9buhGRWfH//osmUjlv4Z5mmWdPWind/VGcVxTHtLfLCOohsOXw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.8.tgz", + "integrity": "sha512-a/SATTaOhPIPFWvHZDoZYgxaZRVHn0/LX1fHLGfZ6C13JqFUZ3K6SMD6/HCtwOQ8HnsNaEeokdiDSFLuizqv5A==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.8.tgz", + "integrity": "sha512-xpFJb08dfXr5+rZc4E+ooZmayBW6R3q59daCpKZ/cDU96/kvDM+vkYzNeTJCGd8rtO6fHWMq5Rcv/1cY6p6/0Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.8.tgz", + "integrity": "sha512-6Ij8gfuGszcEwZpi5jQIJCVIACLS8Tz2chnEBfYjlmMzVsfqBP1iGmHQPp7JSnZg5xxK9tjCc+pJ2WtAmPRFVA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.8.tgz", + "integrity": "sha512-v3iwDQuDljLTxpsqQDl3fl/yihjPAyOguxuloON9kFHYwopeJEf1BkDXODzYyXEI19gisEsQlG1bM65YqKSIww==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.8.tgz", + "integrity": "sha512-8svILYKhE5XetuFk/B6raFYIyIqydQi+GngEXJgdPdI7OMKUbSd7uzR02wSY4kb53xBrClLkhH4Xs8P61Q2BaA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.8.tgz", + "integrity": "sha512-B6FyMeRJeV0NpyEOYlm5qtQfxbdlgmiGdD+QsipzKfFky0K5HW5Td6dyK3L3ypu1eY4kOmo7wW0o94SBqlqBSA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.8.tgz", + "integrity": "sha512-CCb67RKahNobjm/eeEqeD/oJfJlrWyw29fgiyB6vcgyq97YAf3gCOuP6qMShYSPXgnlZe/i4a8WFHBw6N8bYAA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.8.tgz", + "integrity": "sha512-bytLJOi55y55+mGSdgwZ5qBm0K9WOCh0rx+vavVPx+gqLLhxtSFU0XbeYy/dsAAD6xECGEv4IQeFILaSS2auXw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.8.tgz", + "integrity": "sha512-2YpRyQJmKVBEHSBLa8kBAtbhucaclb6ex4wchfY0Tj3Kg39kpjeJ9vhRU7x4mUpq8ISLXRXH1L0dBYjAeqzZAw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.8.tgz", + "integrity": "sha512-QgbNY/V3IFXvNf11SS6exkpVcX0LJcob+0RWCgV9OiDAmVElnxciHIisoSix9uzYzScPmS6dJFbZULdSAEkQVw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.8.tgz", + "integrity": "sha512-mM/9S0SbAFDBc4OPoyP6SEOo5324LpUxdpeIUUSrSTOfhHU9hEfqRngmKgqILqwx/0DVJBzeNW7HmLEWp9vcOA==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.8.tgz", + "integrity": "sha512-eKUYcWaWTaYr9zbj8GertdVtlt1DTS1gNBWov+iQfWuWyuu59YN6gSEJvFzC5ESJ4kMcKR0uqWThKUn5o8We6Q==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.8.tgz", + "integrity": "sha512-Vc9J4dXOboDyMXKD0eCeW0SIeEzr8K9oTHJU+Ci1mZc5njPfhKAqkRt3B/fUNU7dP+mRyralPu8QUkiaQn7iIg==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.8.tgz", + "integrity": "sha512-0xvOTNuPXI7ft1LYUgiaXtpCEjp90RuBBYovdd2lqAFxje4sEucurg30M1WIm03+3jxByd3mfo+VUmPtRSVuOw==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.8.tgz", + "integrity": "sha512-G0JQwUI5WdEFEnYNKzklxtBheCPkuDdu1YrtRrjuQv30WsYbkkoixKxLLv8qhJmNI+ATEWquZe/N0d0rpr55Mg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.8.tgz", + "integrity": "sha512-Fqy63515xl20OHGFykjJsMnoIWS+38fqfg88ClvPXyDbLtgXal2DTlhb1TfTX34qWi3u4I7Cq563QcHpqgLx8w==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.8.tgz", + "integrity": "sha512-1iuezdyDNngPnz8rLRDO2C/ZZ/emJLb72OsZeqQ6gL6Avko/XCXZw+NuxBSNhBAP13Hie418V7VMt9et1FMvpg==", + "dev": true, + "optional": true + }, + "@types/node": { + "version": "18.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.2.tgz", + "integrity": "sha512-1uEQxww3DaghA0RxqHx0O0ppVlo43pJhepY51OxuQIKHpjbnYLA7vcdwioNPzIqmC2u3I/dmylcqjlh0e7AyUA==", + "dev": true + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "esbuild": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.8.tgz", + "integrity": "sha512-g24ybC3fWhZddZK6R3uD2iF/RIPnRpwJAqLov6ouX3hMbY4+tKolP0VMF3zuIYCaXun+yHwS5IPQ91N2BT191g==", + "dev": true, + "requires": { + "@esbuild/android-arm": "0.17.8", + "@esbuild/android-arm64": "0.17.8", + "@esbuild/android-x64": "0.17.8", + "@esbuild/darwin-arm64": "0.17.8", + "@esbuild/darwin-x64": "0.17.8", + "@esbuild/freebsd-arm64": "0.17.8", + "@esbuild/freebsd-x64": "0.17.8", + "@esbuild/linux-arm": "0.17.8", + "@esbuild/linux-arm64": "0.17.8", + "@esbuild/linux-ia32": "0.17.8", + "@esbuild/linux-loong64": "0.17.8", + "@esbuild/linux-mips64el": "0.17.8", + "@esbuild/linux-ppc64": "0.17.8", + "@esbuild/linux-riscv64": "0.17.8", + "@esbuild/linux-s390x": "0.17.8", + "@esbuild/linux-x64": "0.17.8", + "@esbuild/netbsd-x64": "0.17.8", + "@esbuild/openbsd-x64": "0.17.8", + "@esbuild/sunos-x64": "0.17.8", + "@esbuild/win32-arm64": "0.17.8", + "@esbuild/win32-ia32": "0.17.8", + "@esbuild/win32-x64": "0.17.8" + } + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "get-tsconfig": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.4.0.tgz", + "integrity": "sha512-0Gdjo/9+FzsYhXCEFueo2aY1z1tpXrxWZzP7k8ul9qt1U5o8rYJwTJYmaeHdrVosYIVYkOy2iwCJ9FdpocJhPQ==", + "dev": true + }, + "google-protobuf": { + "version": "3.21.2", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.2.tgz", + "integrity": "sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA==", + "dev": true + }, + "prettier": { + "version": "2.8.7", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz", + "integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==", + "dev": true + }, + "protoscript": { + "version": "0.0.15", + "resolved": "https://registry.npmjs.org/protoscript/-/protoscript-0.0.15.tgz", + "integrity": "sha512-CwXpfO0jdQ7VOc7UYm6dLPfQfcjk2TSwvYk0h2LdgjZ1NJePAXI85o1iL9LyDMGtijHR4CbAKCpm4VizGyunXA==", + "dev": true, + "requires": { + "google-protobuf": "^3.21.0", + "prettier": "^2.7.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "tsx": { + "version": "3.12.3", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-3.12.3.tgz", + "integrity": "sha512-Wc5BFH1xccYTXaQob+lEcimkcb/Pq+0en2s+ruiX0VEIC80nV7/0s7XRahx8NnsoCnpCVUPz8wrqVSPi760LkA==", + "dev": true, + "requires": { + "@esbuild-kit/cjs-loader": "^2.4.2", + "@esbuild-kit/core-utils": "^3.0.0", + "@esbuild-kit/esm-loader": "^2.5.5", + "fsevents": "~2.3.2" + } + }, + "typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true + } + } +} diff --git a/impl/protoscript/package.json b/impl/protoscript/package.json new file mode 100644 index 00000000..a34b0310 --- /dev/null +++ b/impl/protoscript/package.json @@ -0,0 +1,15 @@ +{ + "name": "protoscript-conformance", + "private": true, + "type": "module", + "dependencies": { + "protoscript": "file:vendor/ProtoScript-0.0.14/dist" + }, + "devDependencies": { + "@bufbuild/buf": "^1.15.0", + "@types/node": "^18.14.2", + "protoscript": "0.0.15", + "tsx": "^3.12.3", + "typescript": "^4.9.5" + } +} diff --git a/impl/protoscript/runner.ts b/impl/protoscript/runner.ts new file mode 100755 index 00000000..ec0053a8 --- /dev/null +++ b/impl/protoscript/runner.ts @@ -0,0 +1,184 @@ +#!/usr/bin/env -S npx tsx + +import { + ConformanceRequest, + ConformanceResponse, + FailureSet, + WireFormat, +} from "./gen/conformance/conformance.pb.js"; +import { TestAllTypesProto2, TestAllTypesProto2JSON } from "./gen/google/protobuf/test_messages_proto2.pb.js"; +import { TestAllTypesProto3, TestAllTypesProto3JSON } from "./gen/google/protobuf/test_messages_proto3.pb.js"; +import { readSync, writeSync } from "fs"; + +const proto2serializer = { + decodeProtobuf: TestAllTypesProto2.decode.bind(TestAllTypesProto2), + decodeJson: TestAllTypesProto2JSON.decode.bind(TestAllTypesProto2JSON), + encodeProtobuf: TestAllTypesProto2.encode.bind(TestAllTypesProto2), + encodeJson: TestAllTypesProto2JSON.encode.bind(TestAllTypesProto2JSON), +} + +const proto3serializer = { + decodeProtobuf: TestAllTypesProto3.decode.bind(TestAllTypesProto3), + decodeJson: TestAllTypesProto3JSON.decode.bind(TestAllTypesProto3JSON), + encodeProtobuf: TestAllTypesProto3.encode.bind(TestAllTypesProto3), + encodeJson: TestAllTypesProto3JSON.encode.bind(TestAllTypesProto3JSON), +} + +function main() { + let testCount = 0; + try { + while (testIo(test)) { + testCount += 1; + } + } catch (e) { + process.stderr.write( + `conformance.ts: exiting after ${testCount} tests: ${String(e)}` + ); + process.exit(1); + } +} + +function test(request: ConformanceRequest): ConformanceResponse { + if (request.messageType === "conformance.FailureSet") { + // > The conformance runner will request a list of failures as the first request. + // > This will be known by message_type == "conformance.FailureSet", a conformance + // > test should return a serialized FailureSet in protobuf_payload. + return { + protobufPayload: FailureSet.encode({}) + }; + } + + const serializer = request.messageType === "protobuf_test_messages.proto3.TestAllTypesProto3" + ? proto3serializer + : request.messageType === "protobuf_test_messages.proto2.TestAllTypesProto2" + ? proto2serializer + : undefined; + + if (!serializer) { + return { runtimeError: `unknown request message type ${request.messageType}` }; + } + + let testMessage: object; + try { + if (request.protobufPayload) { + testMessage = serializer.decodeProtobuf( + request.protobufPayload + ); + } else if (request.jsonPayload) { + testMessage = serializer.decodeJson( + request.jsonPayload + ); + } else { + // We use a failure list instead of skipping, because that is more transparent. + return { runtimeError: `${request} not supported` }; + } + } catch (err) { + // > This string should be set to indicate parsing failed. The string can + // > provide more information about the parse error if it is available. + // > + // > Setting this string does not necessarily mean the testee failed the + // > test. Some of the test cases are intentionally invalid input. + return { parseError: String(err) }; + } + + try { + switch (request.requestedOutputFormat) { + case WireFormat.PROTOBUF: + return { protobufPayload: serializer.encodeProtobuf(testMessage) }; + + case WireFormat.JSON: + return { jsonPayload: serializer.encodeJson(testMessage) }; + + case WireFormat.JSPB: + return { skipped: "JSPB not supported." }; + + case WireFormat.TEXT_FORMAT: + return { skipped: "Text format not supported." }; + + default: + return { runtimeError: `unknown requested output format ${request.requestedOutputFormat}` }; + } + } catch (err) { + // > If the input was successfully parsed but errors occurred when + // > serializing it to the requested output format, set the error message in + // > this field. + return { serializeError: String(err) }; + } +} + +// Returns true if the test ran successfully, false on legitimate EOF. +// If EOF is encountered in an unexpected place, raises IOError. +function testIo( + test: (request: ConformanceRequest) => ConformanceResponse +): boolean { + setBlockingStdout(); + + const requestLengthBuf = readBuffer(4); + if (requestLengthBuf === "EOF") { + return false; + } + + const requestLength = requestLengthBuf.readInt32LE(0); + const serializedRequest = readBuffer(requestLength); + if (serializedRequest === "EOF") { + throw "Failed to read request."; + } + + const request = ConformanceRequest.decode(serializedRequest); + const response = test(request); + + const serializedResponse = ConformanceResponse.encode(response); + const responseLengthBuf = Buffer.alloc(4); + responseLengthBuf.writeInt32LE(serializedResponse.length, 0); + writeBuffer(responseLengthBuf); + writeBuffer(Buffer.from(serializedResponse)); + + return true; +} + +// Read a buffer of N bytes from stdin. +function readBuffer(bytes: number): Buffer | "EOF" { + const buf = Buffer.alloc(bytes); + let read = 0; + try { + read = readSync(0, buf, 0, bytes, null); + } catch (e) { + throw `failed to read from stdin: ${String(e)}`; + } + if (read !== bytes) { + if (read === 0) { + return "EOF"; + } + throw "premature EOF on stdin."; + } + return buf; +} + +// Write a buffer to stdout. +function writeBuffer(buffer: Buffer): void { + let totalWritten = 0; + while (totalWritten < buffer.length) { + totalWritten += writeSync( + 1, + buffer, + totalWritten, + buffer.length - totalWritten + ); + } +} + +// Fixes https://github.com/timostamm/protobuf-ts/issues/134 +// Node is buffering chunks to stdout, meaning that for big generated +// files the CodeGeneratorResponse will not reach protoc completely. +// To fix this, we set stdout to block using the internal private +// method setBlocking(true) +function setBlockingStdout(): void { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-assignment + const stdoutHandle = (process.stdout as any)._handle; + if (stdoutHandle !== undefined) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access + stdoutHandle.setBlocking(true); + } +} + +main(); diff --git a/impl/protoscript/succeeding_tests.txt b/impl/protoscript/succeeding_tests.txt new file mode 100644 index 00000000..89d219f0 --- /dev/null +++ b/impl/protoscript/succeeding_tests.txt @@ -0,0 +1,271 @@ +Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedFalse +Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedTrue +Recommended.Proto3.JsonInput.BoolFieldIntegerOne +Recommended.Proto3.JsonInput.BoolFieldIntegerZero +Recommended.Proto3.JsonInput.MapFieldValueIsNull +Recommended.Proto3.JsonInput.RejectUnknownEnumStringValueInMapValue +Recommended.Proto3.JsonInput.RejectUnknownEnumStringValueInOptionalField +Recommended.Proto3.JsonInput.RejectUnknownEnumStringValueInRepeatedField +Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull +Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder +Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate +Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate +Recommended.Proto3.ProtobufInput.OneofZeroBool.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroDouble.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroEnum.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroFloat.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroMessage.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroMessageSetTwice.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroString.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint32.JsonOutput +Recommended.Proto3.ProtobufInput.OneofZeroUint64.JsonOutput +Required.Proto3.JsonInput.DoubleFieldTooSmall +Required.Proto3.JsonInput.FloatFieldTooLarge +Required.Proto3.JsonInput.FloatFieldTooSmall +Required.Proto3.JsonInput.Int32FieldLeadingSpace +Required.Proto3.JsonInput.Int32FieldNotInteger +Required.Proto3.JsonInput.Int32FieldNotNumber +Required.Proto3.JsonInput.Int32FieldTooLarge +Required.Proto3.JsonInput.Int32FieldTooSmall +Required.Proto3.JsonInput.Int32FieldTrailingSpace +Required.Proto3.JsonInput.Int64FieldTooLarge +Required.Proto3.JsonInput.Int64FieldTooSmall +Required.Proto3.JsonInput.OneofFieldDuplicate +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotMessage +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotString +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotBool +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotInt +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotString +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt +Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotMessage +Required.Proto3.JsonInput.StringFieldNotAString +Required.Proto3.JsonInput.Uint32FieldNotInteger +Required.Proto3.JsonInput.Uint32FieldNotNumber +Required.Proto3.JsonInput.Uint32FieldTooLarge +Required.Proto3.JsonInput.Uint64FieldTooLarge +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.DOUBLE.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.FLOAT.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT32.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.INT64.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED32.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SFIXED64.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT32.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.SINT64.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.STRING.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT32.JsonOutput +Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT64.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.BOOL.BOOL.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED32.FIXED32.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.FIXED64.FIXED64.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.DOUBLE.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.FLOAT.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT32.INT32.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.INT64.INT64.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED32.SFIXED32.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SFIXED64.SFIXED64.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT32.SINT32.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.SINT64.SINT64.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.BYTES.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.ENUM.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.STRING.STRING.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT32.UINT32.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.DuplicateKey.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.DuplicateKeyInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.DuplicateValueInMapEntry.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.NonDefault.JsonOutput +Required.Proto3.ProtobufInput.ValidDataMap.UINT64.UINT64.Unordered.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BOOL.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.DOUBLE.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.ENUM.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.FLOAT.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.STRING.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT32.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.DefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.MultipleValuesForSameField.JsonOutput +Required.Proto3.ProtobufInput.ValidDataOneof.UINT64.NonDefaultValue.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.MESSAGE.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.STRING.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BOOL[5].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BYTES[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BYTES[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.BYTES[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.DOUBLE[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.ENUM[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED32[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED32[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED32[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED64[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED64[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FIXED64[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[4].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[4].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[5].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[6].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[8].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT32[9].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.INT64[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.MESSAGE[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED32[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SFIXED64[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT32[4].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.SINT64[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[4].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[5].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.STRING[6].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[2].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[3].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[4].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[5].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[6].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[7].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT32[9].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT64[0].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT64[1].JsonOutput +Required.Proto3.ProtobufInput.ValidDataScalar.UINT64[2].JsonOutput diff --git a/impl/protoscript/test.sh b/impl/protoscript/test.sh new file mode 100755 index 00000000..d35ecdf5 --- /dev/null +++ b/impl/protoscript/test.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euo pipefail + +# install dependencies +npm ci + +# generate code +rm -rf gen/ +npx buf generate ../../proto + +# finally, run the tests +conformance_test_runner --enforce_recommended \ + --failure_list failing_tests.txt \ + --text_format_failure_list failing_tests_text_format.txt \ + --output_dir . runner.ts diff --git a/impl/protoscript/tsconfig.json b/impl/protoscript/tsconfig.json new file mode 100644 index 00000000..7de9cfaa --- /dev/null +++ b/impl/protoscript/tsconfig.json @@ -0,0 +1,33 @@ +{ + "include": [ + "**/*.ts" + ], + "exclude": [ + "vendor", + ], + "compilerOptions": { + "esModuleInterop": true, + "target": "es2020", + "importsNotUsedAsValues": "error", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "strictBindCallApply": true, + "strictPropertyInitialization": true, + "noImplicitThis": true, + "useUnknownInCatchVariables": true, + "noUnusedLocals": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "moduleResolution": "Node", + "skipLibCheck": false, + "lib": [ + "ES2016", + // ES2020.BigInt for the bigint representation of 64-bit integers + "ES2020.BigInt" + ] + } +} \ No newline at end of file diff --git a/report.js b/report.js index 346c882e..29cb08d3 100644 --- a/report.js +++ b/report.js @@ -22,6 +22,7 @@ const protobufJs = countFailures("impl/protobuf.js/failing_tests.txt"); const protobufTs = countFailures("impl/protobuf-ts/failing_tests.txt"); const tsProto = countFailures("impl/ts-proto/failing_tests.txt"); const protocGenTs = countFailures("impl/protoc-gen-ts/failing_tests.txt"); +const protoscript = countFailures("impl/protoscript/failing_tests.txt"); const percentages = (property) => (failures, base) => { const total = base[property]; @@ -51,6 +52,7 @@ const table = ` |-----------------------------------------|:------------------:|:------------------:|:------------------:|:-------------------------------------:|:----------------------------------------:| | [Protobuf-ES](impl/protobuf-es) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | ${required(protobufEs, baseline)} | ${recommended(protobufEs, baseline)} | | [protobuf-ts](impl/protobuf-ts) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | ${required(protobufTs, baseline)} | ${recommended(protobufTs, baseline)} | +| [protoscript](impl/protoscript) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | ${required(protoscript, baseline)} | ${recommended(protoscript, baseline)} | | [google-protobuf](impl/google-protobuf) | :heavy_check_mark: | :x: | :heavy_check_mark: | ${required(googleProtobuf, baseline)} | ${recommended(googleProtobuf, baseline)} | | [protobuf.js](impl/protobuf.js) | :heavy_check_mark: | :heavy_check_mark: | :x: | ${required(protobufJs, baseline)} | ${recommended(protobufJs, baseline)} | | [protoc-gen-ts](impl/protoc-gen-ts) | :x: | :heavy_check_mark: | :heavy_check_mark: | ${required(protocGenTs, baseline)} | ${recommended(protocGenTs, baseline)} |