diff --git a/Makefile b/Makefile index b85b95573..b50d45459 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,8 @@ GOOGLE_PROTOBUF_CHECKOUT?=../protobuf # previously installed one), we use a custom output name (-tfiws_out). PROTOC_GEN_SWIFT=.build/debug/protoc-gen-swift GENERATE_SRCS_BASE=${PROTOC} --plugin=protoc-gen-tfiws=${PROTOC_GEN_SWIFT} -GENERATE_SRCS=${GENERATE_SRCS_BASE} -I Protos +# Search 'Protos/SwiftProtobuf/' so the WKTs can be found (google/protobuf/*). +GENERATE_SRCS=${GENERATE_SRCS_BASE} -I Protos/SwiftProtobuf # Where to find the Swift conformance test runner executable. SWIFT_CONFORMANCE_PLUGIN=.build/debug/Conformance @@ -61,114 +62,9 @@ SWIFT_CONFORMANCE_PLUGIN=.build/debug/Conformance # override this value. CONFORMANCE_TEST_RUNNER?=${GOOGLE_PROTOBUF_CHECKOUT}/conformance_test_runner -# NOTE: TEST_PROTOS, LIBRARY_PROTOS, and PLUGIN_PROTOS are all full paths so -# eventually we might be able to do proper dependencies and use them as inputs -# for other rules (we'll also likely need outputs). -# -# But since plugin is also Swift code using the runtime, there's a bit of -# recursion that doesn't lend itself to easily being resolved; as the build -# could create a new plugin that in turn could cause new sources need to -# generated, which in turns means the plugin needs to be rebuilt... -# -# It might be easier in the long run to give up on make, and instead have a -# script that does the build and then generation and checks to see if generated -# source change, and if it doesn't errors out to have the developer restart -# the process so they stabilize. - -# Protos used for the unit and functional tests -TEST_PROTOS= \ - Protos/generated_swift_names_enums.proto \ - Protos/generated_swift_names_enum_cases.proto \ - Protos/generated_swift_names_fields.proto \ - Protos/generated_swift_names_messages.proto \ - Protos/google/protobuf/any_test.proto \ - Protos/google/protobuf/map_proto2_unittest.proto \ - Protos/google/protobuf/map_unittest.proto \ - Protos/google/protobuf/test_messages_proto3.proto \ - Protos/google/protobuf/unittest.proto \ - Protos/google/protobuf/unittest_arena.proto \ - Protos/google/protobuf/unittest_custom_options.proto \ - Protos/google/protobuf/unittest_drop_unknown_fields.proto \ - Protos/google/protobuf/unittest_embed_optimize_for.proto \ - Protos/google/protobuf/unittest_empty.proto \ - Protos/google/protobuf/unittest_import.proto \ - Protos/google/protobuf/unittest_import_lite.proto \ - Protos/google/protobuf/unittest_import_public.proto \ - Protos/google/protobuf/unittest_import_public_lite.proto \ - Protos/google/protobuf/unittest_lite.proto \ - Protos/google/protobuf/unittest_lite_imports_nonlite.proto \ - Protos/google/protobuf/unittest_mset.proto \ - Protos/google/protobuf/unittest_mset_wire_format.proto \ - Protos/google/protobuf/unittest_no_field_presence.proto \ - Protos/google/protobuf/unittest_no_generic_services.proto \ - Protos/google/protobuf/unittest_optimize_for.proto \ - Protos/google/protobuf/unittest_preserve_unknown_enum.proto \ - Protos/google/protobuf/unittest_preserve_unknown_enum2.proto \ - Protos/google/protobuf/unittest_proto3.proto \ - Protos/google/protobuf/unittest_proto3_arena.proto \ - Protos/google/protobuf/unittest_proto3_optional.proto \ - Protos/google/protobuf/unittest_well_known_types.proto \ - Protos/fuzz_testing.proto \ - Protos/unittest_swift_all_required_types.proto \ - Protos/unittest_swift_cycle.proto \ - Protos/unittest_swift_enum.proto \ - Protos/unittest_swift_enum_optional_default.proto \ - Protos/unittest_swift_enum_proto3.proto \ - Protos/unittest_swift_extension.proto \ - Protos/unittest_swift_extension2.proto \ - Protos/unittest_swift_extension3.proto \ - Protos/unittest_swift_extension4.proto \ - Protos/unittest_swift_fieldorder.proto \ - Protos/unittest_swift_groups.proto \ - Protos/unittest_swift_json.proto \ - Protos/unittest_swift_naming.proto \ - Protos/unittest_swift_naming_no_prefix.proto \ - Protos/unittest_swift_naming_number_prefix.proto \ - Protos/unittest_swift_oneof_all_required.proto \ - Protos/unittest_swift_oneof_merging.proto \ - Protos/unittest_swift_performance.proto \ - Protos/unittest_swift_reserved.proto \ - Protos/unittest_swift_reserved_ext.proto \ - Protos/unittest_swift_runtime_proto2.proto \ - Protos/unittest_swift_runtime_proto3.proto \ - Protos/unittest_swift_startup.proto - -# TODO: The library and plugin Protos come directly from google sources. -# There should be an easy way to copy the Google versions from a protobuf -# checkout into this project. - -# Protos that are embedded into the SwiftProtobuf runtime library module -LIBRARY_PROTOS= \ - Protos/google/protobuf/any.proto \ - Protos/google/protobuf/api.proto \ - Protos/google/protobuf/descriptor.proto \ - Protos/google/protobuf/duration.proto \ - Protos/google/protobuf/empty.proto \ - Protos/google/protobuf/field_mask.proto \ - Protos/google/protobuf/source_context.proto \ - Protos/google/protobuf/struct.proto \ - Protos/google/protobuf/timestamp.proto \ - Protos/google/protobuf/type.proto \ - Protos/google/protobuf/wrappers.proto - -# Protos that are used internally by the plugin -PLUGIN_PROTOS= \ - Protos/google/protobuf/compiler/plugin.proto \ - Protos/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto - -# Protos that are used by the conformance test runner. -CONFORMANCE_PROTOS= \ - Protos/conformance/conformance.proto \ - Protos/google/protobuf/test_messages_proto2.proto \ - Protos/google/protobuf/test_messages_proto3.proto - -SWIFT_PLUGINLIB_DESCRIPTOR_TEST_PROTOS= \ - Protos/pluginlib_descriptor_test.proto \ - Protos/pluginlib_descriptor_test2.proto \ - ${PLUGIN_PROTOS} - -SWIFT_PLUGIN_DESCRIPTOR_TEST_PROTOS= \ - Protos/plugin_descriptor_test.proto +# The directories within Protos/ with the exception of "upstream". Use for the +# maintenance of the 'Reference' target and test-plugin. +PROTOS_DIRS=Conformance protoc-gen-swiftTests SwiftProtobuf SwiftProtobufPluginLibrary SwiftProtobufPluginLibraryTests SwiftProtobufTests .PHONY: \ all \ @@ -268,9 +164,20 @@ test-runtime: build # can't be done in a single protoc/proto-gen-swift invoke and have to be done # one at a time instead. test-plugin: build ${PROTOC_GEN_SWIFT} - @rm -rf _test && mkdir _test - for p in `find Protos/ -type f -name '*.proto'`; do \ - ${GENERATE_SRCS} --tfiws_out=_test $$p || exit 1; \ + @rm -rf _test && mkdir -p _test/upstream + for p in `find Protos/upstream -type f -name '*.proto'`; do \ + ${GENERATE_SRCS_BASE} \ + -I Protos/upstream \ + --tfiws_out=_test/upstream $$p || exit 1; \ + done + for d in ${PROTOS_DIRS}; do \ + mkdir _test/$$d ; \ + ${GENERATE_SRCS_BASE} \ + -I Protos/SwiftProtobuf \ + -I Protos/SwiftProtobufPluginLibrary \ + -I Protos/$$d \ + --tfiws_out=_test/$$d \ + `find Protos/$$d -type f -name "*.proto"` || exit 1; \ done diff -ru _test Reference @@ -278,20 +185,30 @@ test-plugin: build ${PROTOC_GEN_SWIFT} test-spm-plugin: env PROTOC_PATH=$(shell realpath ${PROTOC}) swift test --package-path PluginExamples -# # Rebuild the reference files by running the local version of protoc-gen-swift # against our menagerie of sample protos. # # If you do this, you MUST MANUALLY verify these files before checking them in, # since the new checkin will become the new main reference. # -# Note: Some of these protos define the same package.(message|enum)s, so they -# can't be done in a single protoc/proto-gen-swift invoke and have to be done -# one at a time instead. +# Note: Some of the upstream protos define the same package.(message|enum)s, so +# they can't be done in a single protoc/proto-gen-swift invoke and have to be +# done one at a time instead. reference: build ${PROTOC_GEN_SWIFT} - @rm -rf Reference && mkdir Reference - for p in `find Protos/ -type f -name '*.proto'`; do \ - ${GENERATE_SRCS} --tfiws_out=Reference $$p || exit 1; \ + @rm -rf Reference && mkdir -p Reference/upstream + for p in `find Protos/upstream -type f -name '*.proto'`; do \ + ${GENERATE_SRCS_BASE} \ + -I Protos/upstream \ + --tfiws_out=Reference/upstream $$p || exit 1; \ + done + for d in ${PROTOS_DIRS}; do \ + mkdir Reference/$$d ; \ + ${GENERATE_SRCS_BASE} \ + -I Protos/SwiftProtobuf \ + -I Protos/SwiftProtobufPluginLibrary \ + -I Protos/$$d \ + --tfiws_out=Reference/$$d \ + `find Protos/$$d -type f -name "*.proto"` || exit 1; \ done # @@ -313,48 +230,63 @@ regenerate: \ Tests/SwiftProtobufPluginLibraryTests/DescriptorTestData.swift # Rebuild just the protos included in the runtime library +# NOTE: dependencies doesn't include the source .proto files, should fix that; +# would also need to list all the outputs. regenerate-library-protos: build ${PROTOC_GEN_SWIFT} find Sources/SwiftProtobuf -name "*.pb.swift" -exec rm -f {} \; ${GENERATE_SRCS} \ --tfiws_opt=FileNaming=DropPath \ --tfiws_opt=Visibility=Public \ --tfiws_out=Sources/SwiftProtobuf \ - ${LIBRARY_PROTOS} + `find Protos/SwiftProtobuf -type f -name "*.proto"` # Rebuild just the protos used by the plugin +# NOTE: dependencies doesn't include the source .proto files, should fix that; +# would also need to list all the outputs. regenerate-plugin-protos: build ${PROTOC_GEN_SWIFT} find Sources/SwiftProtobufPluginLibrary -name "*.pb.swift" -exec rm -f {} \; ${GENERATE_SRCS} \ + -I Protos/SwiftProtobufPluginLibrary \ --tfiws_opt=FileNaming=DropPath \ --tfiws_opt=Visibility=Public \ --tfiws_out=Sources/SwiftProtobufPluginLibrary \ - ${PLUGIN_PROTOS} + `find Protos/SwiftProtobufPluginLibrary -type f -name "*.proto"` # Rebuild just the protos used by the runtime test suite -# Note: Some of these protos define the same package.(message|enum)s, so they -# can't be done in a single protoc/proto-gen-swift invoke and have to be done -# one at a time instead. -regenerate-test-protos: build ${PROTOC_GEN_SWIFT} Protos/generated_swift_names_enums.proto Protos/generated_swift_names_enum_cases.proto Protos/generated_swift_names_fields.proto Protos/generated_swift_names_messages.proto +# NOTE: dependencies doesn't include the source .proto files, should fix that; +# would also need to list all the outputs. +regenerate-test-protos: build ${PROTOC_GEN_SWIFT} Protos/SwiftProtobufTests/generated_swift_names_enums.proto Protos/SwiftProtobufTests/generated_swift_names_enum_cases.proto Protos/SwiftProtobufTests/generated_swift_names_fields.proto Protos/SwiftProtobufTests/generated_swift_names_messages.proto find Tests/SwiftProtobufTests -name "*.pb.swift" -exec rm -f {} \; ${GENERATE_SRCS} \ + -I Protos/SwiftProtobufTests \ --tfiws_opt=FileNaming=DropPath \ --tfiws_out=Tests/SwiftProtobufTests \ - ${TEST_PROTOS} + `find Protos/SwiftProtobufTests -type f -name "*.proto"` -# Rebuild just the protos used by the plugin +# Rebuild the protos for FuzzTesting/Sources/FuzzCommon, the file lives in the +# Protos/SwiftProtobufTests to have just one copy. regenerate-fuzz-protos: build ${PROTOC_GEN_SWIFT} find FuzzTesting/Sources/FuzzCommon -name "*.pb.swift" -exec rm -f {} \; ${GENERATE_SRCS} \ + -I Protos/SwiftProtobufTests \ --tfiws_opt=FileNaming=DropPath \ --tfiws_opt=Visibility=Public \ --tfiws_out=FuzzTesting/Sources/FuzzCommon \ - Protos/fuzz_testing.proto + Protos/SwiftProtobufTests/fuzz_testing.proto + +SWIFT_PLUGINLIB_DESCRIPTOR_TEST_PROTOS= \ + Protos/SwiftProtobufPluginLibraryTests/pluginlib_descriptor_test.proto \ + Protos/SwiftProtobufPluginLibraryTests/pluginlib_descriptor_test2.proto \ + Protos/SwiftProtobufPluginLibrary/google/protobuf/compiler/plugin.proto \ + Protos/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto Tests/SwiftProtobufPluginLibraryTests/DescriptorTestData.swift: build ${PROTOC_GEN_SWIFT} ${SWIFT_PLUGINLIB_DESCRIPTOR_TEST_PROTOS} @${PROTOC} \ --include_imports \ --descriptor_set_out=PluginLibDescriptorTestData.bin \ - -I Protos \ + -I Protos/SwiftProtobuf \ + -I Protos/SwiftProtobufPluginLibrary \ + -I Protos/SwiftProtobufPluginLibraryTests \ ${SWIFT_PLUGINLIB_DESCRIPTOR_TEST_PROTOS} @rm -f $@ @echo '// See Makefile how this is generated.' >> $@ @@ -365,11 +297,14 @@ Tests/SwiftProtobufPluginLibraryTests/DescriptorTestData.swift: build ${PROTOC_G @echo ']' >> $@ @echo 'let fileDescriptorSetData = Data(fileDescriptorSetBytes)' >> $@ +SWIFT_PLUGIN_DESCRIPTOR_TEST_PROTOS= \ + Protos/protoc-gen-swiftTests/plugin_descriptor_test.proto + Tests/protoc-gen-swiftTests/DescriptorTestData.swift: build ${PROTOC_GEN_SWIFT} ${SWIFT_PLUGIN_DESCRIPTOR_TEST_PROTOS} @${PROTOC} \ --include_imports \ --descriptor_set_out=PluginDescriptorTestData.bin \ - -I Protos \ + -I Protos/protoc-gen-swiftTests \ ${SWIFT_PLUGIN_DESCRIPTOR_TEST_PROTOS} @rm -f $@ @echo '// See Makefile how this is generated.' >> $@ @@ -423,7 +358,7 @@ Protos/mined_words.txt: Sources/SwiftProtobuf/*.swift # might cause problems. Failures compiling this indicate weaknesses # in protoc-gen-swift's name sanitization logic. # -Protos/generated_swift_names_fields.proto: Protos/mined_words.txt +Protos/SwiftProtobufTests/generated_swift_names_fields.proto: Protos/mined_words.txt @echo Building $@ @rm $@ @echo '// See Makefile for the logic that generates this' >> $@ @@ -435,7 +370,7 @@ Protos/generated_swift_names_fields.proto: Protos/mined_words.txt @cat Protos/mined_words.txt | awk 'BEGIN{n = 1} {print " int32 " $$1 " = " n ";"; n += 1 }' >> $@ @echo '}' >> $@ -Protos/generated_swift_names_enum_cases.proto: Protos/mined_words.txt +Protos/SwiftProtobufTests/generated_swift_names_enum_cases.proto: Protos/mined_words.txt @echo Building $@ @rm $@ @echo '// See Makefile for the logic that generates this' >> $@ @@ -448,7 +383,7 @@ Protos/generated_swift_names_enum_cases.proto: Protos/mined_words.txt @cat Protos/mined_words.txt | awk 'BEGIN{n = 1} {print " " $$1 " = " n ";"; n += 1 }' >> $@ @echo '}' >> $@ -Protos/generated_swift_names_messages.proto: Protos/mined_words.txt +Protos/SwiftProtobufTests/generated_swift_names_messages.proto: Protos/mined_words.txt @echo Building $@ @rm $@ @echo '// See Makefile for the logic that generates this' >> $@ @@ -460,7 +395,7 @@ Protos/generated_swift_names_messages.proto: Protos/mined_words.txt @cat Protos/mined_words.txt | awk '{print " message " $$1 " { int32 " $$1 " = 1; }"}' >> $@ @echo '}' >> $@ -Protos/generated_swift_names_enums.proto: Protos/mined_words.txt +Protos/SwiftProtobufTests/generated_swift_names_enums.proto: Protos/mined_words.txt @echo Building $@ @rm $@ @echo '// See Makefile for the logic that generates this' >> $@ @@ -476,9 +411,10 @@ Protos/generated_swift_names_enums.proto: Protos/mined_words.txt regenerate-conformance-protos: build ${PROTOC_GEN_SWIFT} find Sources/Conformance -name "*.pb.swift" -exec rm -f {} \; ${GENERATE_SRCS} \ + -I Protos/Conformance \ --tfiws_opt=FileNaming=DropPath \ --tfiws_out=Sources/Conformance \ - ${CONFORMANCE_PROTOS} + `find Protos/Conformance -type f -name "*.proto"` # Helper to check if there is a protobuf checkout as expected. check-for-protobuf-checkout: @@ -493,26 +429,51 @@ check-for-protobuf-checkout: # Helper to update the .proto files copied from the protocolbuffers/protobuf distro. # update-proto-files: check-for-protobuf-checkout - @rm -rf Protos/conformance && mkdir Protos/conformance - @cp -v "${GOOGLE_PROTOBUF_CHECKOUT}"/conformance/*.proto Protos/conformance/ - @rm -rf Protos/google && mkdir -p Protos/google/protobuf/compiler - @cp -v "${GOOGLE_PROTOBUF_CHECKOUT}"/src/google/protobuf/*.proto Protos/google/protobuf/ - @cp -v "${GOOGLE_PROTOBUF_CHECKOUT}"/src/google/protobuf/compiler/*.proto Protos/google/protobuf/compiler/ + @rm -rf Protos/upstream + @mkdir -p Protos/upstream/conformance Protos/upstream/google/protobuf/compiler + @cp -v "${GOOGLE_PROTOBUF_CHECKOUT}"/conformance/*.proto Protos/upstream/conformance/ + @mkdir -p Protos/upstream/google/protobuf/compiler + @cp -v "${GOOGLE_PROTOBUF_CHECKOUT}"/src/google/protobuf/*.proto Protos/upstream/google/protobuf/ + @cp -v "${GOOGLE_PROTOBUF_CHECKOUT}"/src/google/protobuf/compiler/*.proto Protos/upstream/google/protobuf/compiler/ + # Now copy into the Proto directories for the local targets. + @rm -rf Protos/Conformance/conformance && mkdir -p Protos/Conformance/conformance + @cp -v Protos/upstream/conformance/*.proto Protos/Conformance/conformance + @rm -rf Protos/Conformance/google && mkdir -p Protos/Conformance/google/protobuf + @cp -v \ + Protos/upstream/google/protobuf/test_messages_proto2.proto \ + Protos/upstream/google/protobuf/test_messages_proto3.proto \ + Protos/Conformance/google/protobuf/ + @rm -rf Protos/SwiftProtobuf/google && mkdir -p Protos/SwiftProtobuf/google/protobuf + @cp -v \ + Protos/upstream/google/protobuf/timestamp.proto \ + Protos/upstream/google/protobuf/field_mask.proto \ + Protos/upstream/google/protobuf/api.proto \ + Protos/upstream/google/protobuf/duration.proto \ + Protos/upstream/google/protobuf/struct.proto \ + Protos/upstream/google/protobuf/wrappers.proto \ + Protos/upstream/google/protobuf/source_context.proto \ + Protos/upstream/google/protobuf/any.proto \ + Protos/upstream/google/protobuf/type.proto \ + Protos/upstream/google/protobuf/empty.proto \ + Protos/upstream/google/protobuf/descriptor.proto \ + Protos/SwiftProtobuf/google/protobuf + @rm -rf Protos/SwiftProtobufPluginLibrary/google && mkdir -p Protos/SwiftProtobufPluginLibrary/google/protobuf/compiler + @cp -v Protos/upstream/google/protobuf/compiler/*.proto Protos/SwiftProtobufPluginLibrary/google/protobuf/compiler # # Helper to see if update-proto-files should be done # check-proto-files: check-for-protobuf-checkout @for p in `cd ${GOOGLE_PROTOBUF_CHECKOUT} && ls conformance/*.proto`; do \ - diff -u "Protos/$$p" "${GOOGLE_PROTOBUF_CHECKOUT}/$$p" \ + diff -u "Protos/upstream/$$p" "${GOOGLE_PROTOBUF_CHECKOUT}/$$p" \ || (echo "ERROR: Time to do a 'make update-proto-files'" && exit 1); \ done @for p in `cd ${GOOGLE_PROTOBUF_CHECKOUT}/src && ls google/protobuf/*.proto | grep -v test`; do \ - diff -u "Protos/$$p" "${GOOGLE_PROTOBUF_CHECKOUT}/src/$$p" \ + diff -u "Protos/upstream/$$p" "${GOOGLE_PROTOBUF_CHECKOUT}/src/$$p" \ || (echo "ERROR: Time to do a 'make update-proto-files'" && exit 1); \ done @for p in `cd ${GOOGLE_PROTOBUF_CHECKOUT}/src && ls google/protobuf/compiler/*.proto`; do \ - diff -u "Protos/$$p" "${GOOGLE_PROTOBUF_CHECKOUT}/src/$$p" \ + diff -u "Protos/upstream/$$p" "${GOOGLE_PROTOBUF_CHECKOUT}/src/$$p" \ || (echo "ERROR: Time to do a 'make update-proto-files'" && exit 1); \ done diff --git a/Protos/conformance/conformance.proto b/Protos/Conformance/conformance/conformance.proto similarity index 100% rename from Protos/conformance/conformance.proto rename to Protos/Conformance/conformance/conformance.proto diff --git a/Protos/google/protobuf/test_messages_proto2.proto b/Protos/Conformance/google/protobuf/test_messages_proto2.proto similarity index 100% rename from Protos/google/protobuf/test_messages_proto2.proto rename to Protos/Conformance/google/protobuf/test_messages_proto2.proto diff --git a/Protos/google/protobuf/test_messages_proto3.proto b/Protos/Conformance/google/protobuf/test_messages_proto3.proto similarity index 100% rename from Protos/google/protobuf/test_messages_proto3.proto rename to Protos/Conformance/google/protobuf/test_messages_proto3.proto diff --git a/Protos/google/protobuf/any.proto b/Protos/SwiftProtobuf/google/protobuf/any.proto similarity index 100% rename from Protos/google/protobuf/any.proto rename to Protos/SwiftProtobuf/google/protobuf/any.proto diff --git a/Protos/google/protobuf/api.proto b/Protos/SwiftProtobuf/google/protobuf/api.proto similarity index 100% rename from Protos/google/protobuf/api.proto rename to Protos/SwiftProtobuf/google/protobuf/api.proto diff --git a/Protos/google/protobuf/descriptor.proto b/Protos/SwiftProtobuf/google/protobuf/descriptor.proto similarity index 100% rename from Protos/google/protobuf/descriptor.proto rename to Protos/SwiftProtobuf/google/protobuf/descriptor.proto diff --git a/Protos/google/protobuf/duration.proto b/Protos/SwiftProtobuf/google/protobuf/duration.proto similarity index 100% rename from Protos/google/protobuf/duration.proto rename to Protos/SwiftProtobuf/google/protobuf/duration.proto diff --git a/Protos/google/protobuf/empty.proto b/Protos/SwiftProtobuf/google/protobuf/empty.proto similarity index 100% rename from Protos/google/protobuf/empty.proto rename to Protos/SwiftProtobuf/google/protobuf/empty.proto diff --git a/Protos/google/protobuf/field_mask.proto b/Protos/SwiftProtobuf/google/protobuf/field_mask.proto similarity index 100% rename from Protos/google/protobuf/field_mask.proto rename to Protos/SwiftProtobuf/google/protobuf/field_mask.proto diff --git a/Protos/google/protobuf/source_context.proto b/Protos/SwiftProtobuf/google/protobuf/source_context.proto similarity index 100% rename from Protos/google/protobuf/source_context.proto rename to Protos/SwiftProtobuf/google/protobuf/source_context.proto diff --git a/Protos/google/protobuf/struct.proto b/Protos/SwiftProtobuf/google/protobuf/struct.proto similarity index 100% rename from Protos/google/protobuf/struct.proto rename to Protos/SwiftProtobuf/google/protobuf/struct.proto diff --git a/Protos/google/protobuf/timestamp.proto b/Protos/SwiftProtobuf/google/protobuf/timestamp.proto similarity index 100% rename from Protos/google/protobuf/timestamp.proto rename to Protos/SwiftProtobuf/google/protobuf/timestamp.proto diff --git a/Protos/google/protobuf/type.proto b/Protos/SwiftProtobuf/google/protobuf/type.proto similarity index 100% rename from Protos/google/protobuf/type.proto rename to Protos/SwiftProtobuf/google/protobuf/type.proto diff --git a/Protos/google/protobuf/wrappers.proto b/Protos/SwiftProtobuf/google/protobuf/wrappers.proto similarity index 100% rename from Protos/google/protobuf/wrappers.proto rename to Protos/SwiftProtobuf/google/protobuf/wrappers.proto diff --git a/Protos/google/protobuf/compiler/plugin.proto b/Protos/SwiftProtobufPluginLibrary/google/protobuf/compiler/plugin.proto similarity index 100% rename from Protos/google/protobuf/compiler/plugin.proto rename to Protos/SwiftProtobufPluginLibrary/google/protobuf/compiler/plugin.proto diff --git a/Protos/pluginlib_descriptor_test.proto b/Protos/SwiftProtobufPluginLibraryTests/pluginlib_descriptor_test.proto similarity index 100% rename from Protos/pluginlib_descriptor_test.proto rename to Protos/SwiftProtobufPluginLibraryTests/pluginlib_descriptor_test.proto diff --git a/Protos/pluginlib_descriptor_test2.proto b/Protos/SwiftProtobufPluginLibraryTests/pluginlib_descriptor_test2.proto similarity index 100% rename from Protos/pluginlib_descriptor_test2.proto rename to Protos/SwiftProtobufPluginLibraryTests/pluginlib_descriptor_test2.proto diff --git a/Protos/google/protobuf/any_test.proto b/Protos/SwiftProtobufTests/any_test.proto similarity index 100% rename from Protos/google/protobuf/any_test.proto rename to Protos/SwiftProtobufTests/any_test.proto diff --git a/Protos/fuzz_testing.proto b/Protos/SwiftProtobufTests/fuzz_testing.proto similarity index 100% rename from Protos/fuzz_testing.proto rename to Protos/SwiftProtobufTests/fuzz_testing.proto diff --git a/Protos/generated_swift_names_enum_cases.proto b/Protos/SwiftProtobufTests/generated_swift_names_enum_cases.proto similarity index 100% rename from Protos/generated_swift_names_enum_cases.proto rename to Protos/SwiftProtobufTests/generated_swift_names_enum_cases.proto diff --git a/Protos/generated_swift_names_enums.proto b/Protos/SwiftProtobufTests/generated_swift_names_enums.proto similarity index 100% rename from Protos/generated_swift_names_enums.proto rename to Protos/SwiftProtobufTests/generated_swift_names_enums.proto diff --git a/Protos/generated_swift_names_fields.proto b/Protos/SwiftProtobufTests/generated_swift_names_fields.proto similarity index 100% rename from Protos/generated_swift_names_fields.proto rename to Protos/SwiftProtobufTests/generated_swift_names_fields.proto diff --git a/Protos/generated_swift_names_messages.proto b/Protos/SwiftProtobufTests/generated_swift_names_messages.proto similarity index 100% rename from Protos/generated_swift_names_messages.proto rename to Protos/SwiftProtobufTests/generated_swift_names_messages.proto diff --git a/Protos/SwiftProtobufTests/map_proto2_unittest.proto b/Protos/SwiftProtobufTests/map_proto2_unittest.proto new file mode 100644 index 000000000..9bab23107 --- /dev/null +++ b/Protos/SwiftProtobufTests/map_proto2_unittest.proto @@ -0,0 +1,125 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto2"; + +import "unittest_import.proto"; + +option cc_enable_arenas = true; + +// We don't put this in a package within proto2 because we need to make sure +// that the generated code doesn't depend on being in the proto2 namespace. +// In map_test_util.h we do "using namespace unittest = protobuf_unittest". +package protobuf_unittest; + +enum Proto2MapEnum { + PROTO2_MAP_ENUM_FOO = 0; + PROTO2_MAP_ENUM_BAR = 1; + PROTO2_MAP_ENUM_BAZ = 2; +} + +enum Proto2MapEnumPlusExtra { + E_PROTO2_MAP_ENUM_FOO = 0; + E_PROTO2_MAP_ENUM_BAR = 1; + E_PROTO2_MAP_ENUM_BAZ = 2; + E_PROTO2_MAP_ENUM_EXTRA = 3; +} + +message TestEnumMap { + map known_map_field = 101; + map unknown_map_field = 102; + + // Other maps with all key types to test the unknown entry serialization + map unknown_map_field_int64 = 200; + map unknown_map_field_uint64 = 201; + map unknown_map_field_int32 = 202; + map unknown_map_field_uint32 = 203; + map unknown_map_field_fixed32 = 204; + map unknown_map_field_fixed64 = 205; + map unknown_map_field_bool = 206; + map unknown_map_field_string = 207; + map unknown_map_field_sint32 = 208; + map unknown_map_field_sint64 = 209; + map unknown_map_field_sfixed32 = 210; + map unknown_map_field_sfixed64 = 211; +} + +message TestEnumMapPlusExtra { + map known_map_field = 101; + map unknown_map_field = 102; + + // Other maps with all key types to test the unknown entry serialization + map unknown_map_field_int64 = 200; + map unknown_map_field_uint64 = 201; + map unknown_map_field_int32 = 202; + map unknown_map_field_uint32 = 203; + map unknown_map_field_fixed32 = 204; + map unknown_map_field_fixed64 = 205; + map unknown_map_field_bool = 206; + map unknown_map_field_string = 207; + map unknown_map_field_sint32 = 208; + map unknown_map_field_sint64 = 209; + map unknown_map_field_sfixed32 = 210; + map unknown_map_field_sfixed64 = 211; +} + +message TestImportEnumMap { + map import_enum_amp = 1; +} + +message TestIntIntMap { + map m = 1; +} + +// Test all key types: string, plus the non-floating-point scalars. +message TestMaps { + map m_int32 = 1; + map m_int64 = 2; + map m_uint32 = 3; + map m_uint64 = 4; + map m_sint32 = 5; + map m_sint64 = 6; + map m_fixed32 = 7; + map m_fixed64 = 8; + map m_sfixed32 = 9; + map m_sfixed64 = 10; + map m_bool = 11; + map m_string = 12; +} + +// Test maps in submessages. +message TestSubmessageMaps { + optional TestMaps m = 1; +} + +message TestProto2BytesMap { + map map_bytes = 1; + map map_string = 2; +} diff --git a/Protos/SwiftProtobufTests/map_unittest.proto b/Protos/SwiftProtobufTests/map_unittest.proto new file mode 100644 index 000000000..f7fd20fb2 --- /dev/null +++ b/Protos/SwiftProtobufTests/map_unittest.proto @@ -0,0 +1,126 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +option cc_enable_arenas = true; + +import "unittest.proto"; + +// We don't put this in a package within proto2 because we need to make sure +// that the generated code doesn't depend on being in the proto2 namespace. +// In map_test_util.h we do "using namespace unittest = protobuf_unittest". +package protobuf_unittest; + +// Tests maps. +message TestMap { + map map_int32_int32 = 1; + map map_int64_int64 = 2; + map map_uint32_uint32 = 3; + map map_uint64_uint64 = 4; + map map_sint32_sint32 = 5; + map map_sint64_sint64 = 6; + map map_fixed32_fixed32 = 7; + map map_fixed64_fixed64 = 8; + map map_sfixed32_sfixed32 = 9; + map map_sfixed64_sfixed64 = 10; + map map_int32_float = 11; + map map_int32_double = 12; + map map_bool_bool = 13; + map map_string_string = 14; + map map_int32_bytes = 15; + map map_int32_enum = 16; + map map_int32_foreign_message = 17; + map map_string_foreign_message = 18; + map map_int32_all_types = 19; +} + +message TestMapSubmessage { + TestMap test_map = 1; +} + +message TestMessageMap { + map map_int32_message = 1; +} + +// Two map fields share the same entry default instance. +message TestSameTypeMap { + map map1 = 1; + map map2 = 2; +} + +enum MapEnum { + MAP_ENUM_FOO = 0; + MAP_ENUM_BAR = 1; + MAP_ENUM_BAZ = 2; +} + +// Test embedded message with required fields +message TestRequiredMessageMap { + map map_field = 1; +} + +message TestArenaMap { + map map_int32_int32 = 1; + map map_int64_int64 = 2; + map map_uint32_uint32 = 3; + map map_uint64_uint64 = 4; + map map_sint32_sint32 = 5; + map map_sint64_sint64 = 6; + map map_fixed32_fixed32 = 7; + map map_fixed64_fixed64 = 8; + map map_sfixed32_sfixed32 = 9; + map map_sfixed64_sfixed64 = 10; + map map_int32_float = 11; + map map_int32_double = 12; + map map_bool_bool = 13; + map map_string_string = 14; + map map_int32_bytes = 15; + map map_int32_enum = 16; + map map_int32_foreign_message = 17; +} + +// Previously, message containing enum called Type cannot be used as value of +// map field. +message MessageContainingEnumCalledType { + enum Type { + TYPE_FOO = 0; + } + map type = 1; +} + +// Previously, message cannot contain map field called "entry". +message MessageContainingMapCalledEntry { + map entry = 1; +} + +message TestRecursiveMapMessage { + map a = 1; +} diff --git a/Protos/SwiftProtobufTests/test_messages_proto3.proto b/Protos/SwiftProtobufTests/test_messages_proto3.proto new file mode 100644 index 000000000..1e1285eab --- /dev/null +++ b/Protos/SwiftProtobufTests/test_messages_proto3.proto @@ -0,0 +1,288 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Test schema for proto3 messages. This test schema is used by: +// +// - benchmarks +// - fuzz tests +// - conformance tests +// + +syntax = "proto3"; + +package protobuf_test_messages.proto3; + +option java_package = "com.google.protobuf_test_messages.proto3"; +option objc_class_prefix = "Proto3"; + +// This is the default, but we specify it here explicitly. +option optimize_for = SPEED; + +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option cc_enable_arenas = true; + +// 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. +message TestAllTypesProto3 { + message NestedMessage { + int32 a = 1; + TestAllTypesProto3 corecursive = 2; + } + + enum NestedEnum { + FOO = 0; + BAR = 1; + BAZ = 2; + NEG = -1; // Intentionally negative. + } + + enum AliasedEnum { + option allow_alias = true; + + ALIAS_FOO = 0; + ALIAS_BAR = 1; + ALIAS_BAZ = 2; + MOO = 2; + moo = 2; + bAz = 2; + } + + // Singular + int32 optional_int32 = 1; + int64 optional_int64 = 2; + uint32 optional_uint32 = 3; + uint64 optional_uint64 = 4; + sint32 optional_sint32 = 5; + sint64 optional_sint64 = 6; + fixed32 optional_fixed32 = 7; + fixed64 optional_fixed64 = 8; + sfixed32 optional_sfixed32 = 9; + sfixed64 optional_sfixed64 = 10; + float optional_float = 11; + double optional_double = 12; + bool optional_bool = 13; + string optional_string = 14; + bytes optional_bytes = 15; + + NestedMessage optional_nested_message = 18; + ForeignMessage optional_foreign_message = 19; + + NestedEnum optional_nested_enum = 21; + ForeignEnum optional_foreign_enum = 22; + AliasedEnum optional_aliased_enum = 23; + + string optional_string_piece = 24 [ctype = STRING_PIECE]; + string optional_cord = 25 [ctype = CORD]; + + TestAllTypesProto3 recursive_message = 27; + + // Repeated + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; + repeated sfixed32 repeated_sfixed32 = 39; + repeated sfixed64 repeated_sfixed64 = 40; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; + + repeated NestedMessage repeated_nested_message = 48; + repeated ForeignMessage repeated_foreign_message = 49; + + repeated NestedEnum repeated_nested_enum = 51; + repeated ForeignEnum repeated_foreign_enum = 52; + + repeated string repeated_string_piece = 54 [ctype = STRING_PIECE]; + repeated string repeated_cord = 55 [ctype = CORD]; + + // Packed + repeated int32 packed_int32 = 75 [packed = true]; + repeated int64 packed_int64 = 76 [packed = true]; + repeated uint32 packed_uint32 = 77 [packed = true]; + repeated uint64 packed_uint64 = 78 [packed = true]; + repeated sint32 packed_sint32 = 79 [packed = true]; + repeated sint64 packed_sint64 = 80 [packed = true]; + repeated fixed32 packed_fixed32 = 81 [packed = true]; + repeated fixed64 packed_fixed64 = 82 [packed = true]; + repeated sfixed32 packed_sfixed32 = 83 [packed = true]; + repeated sfixed64 packed_sfixed64 = 84 [packed = true]; + repeated float packed_float = 85 [packed = true]; + repeated double packed_double = 86 [packed = true]; + repeated bool packed_bool = 87 [packed = true]; + repeated NestedEnum packed_nested_enum = 88 [packed = true]; + + // Unpacked + repeated int32 unpacked_int32 = 89 [packed = false]; + repeated int64 unpacked_int64 = 90 [packed = false]; + repeated uint32 unpacked_uint32 = 91 [packed = false]; + repeated uint64 unpacked_uint64 = 92 [packed = false]; + repeated sint32 unpacked_sint32 = 93 [packed = false]; + repeated sint64 unpacked_sint64 = 94 [packed = false]; + repeated fixed32 unpacked_fixed32 = 95 [packed = false]; + repeated fixed64 unpacked_fixed64 = 96 [packed = false]; + repeated sfixed32 unpacked_sfixed32 = 97 [packed = false]; + repeated sfixed64 unpacked_sfixed64 = 98 [packed = false]; + repeated float unpacked_float = 99 [packed = false]; + repeated double unpacked_double = 100 [packed = false]; + repeated bool unpacked_bool = 101 [packed = false]; + repeated NestedEnum unpacked_nested_enum = 102 [packed = false]; + + // Map + map map_int32_int32 = 56; + map map_int64_int64 = 57; + map map_uint32_uint32 = 58; + map map_uint64_uint64 = 59; + map map_sint32_sint32 = 60; + map map_sint64_sint64 = 61; + map map_fixed32_fixed32 = 62; + map map_fixed64_fixed64 = 63; + map map_sfixed32_sfixed32 = 64; + map map_sfixed64_sfixed64 = 65; + map map_int32_float = 66; + map map_int32_double = 67; + map map_bool_bool = 68; + map map_string_string = 69; + map map_string_bytes = 70; + map map_string_nested_message = 71; + map map_string_foreign_message = 72; + map map_string_nested_enum = 73; + map map_string_foreign_enum = 74; + + oneof oneof_field { + uint32 oneof_uint32 = 111; + NestedMessage oneof_nested_message = 112; + string oneof_string = 113; + bytes oneof_bytes = 114; + bool oneof_bool = 115; + uint64 oneof_uint64 = 116; + float oneof_float = 117; + double oneof_double = 118; + NestedEnum oneof_enum = 119; + google.protobuf.NullValue oneof_null_value = 120; + } + + // Well-known types + google.protobuf.BoolValue optional_bool_wrapper = 201; + google.protobuf.Int32Value optional_int32_wrapper = 202; + google.protobuf.Int64Value optional_int64_wrapper = 203; + google.protobuf.UInt32Value optional_uint32_wrapper = 204; + google.protobuf.UInt64Value optional_uint64_wrapper = 205; + google.protobuf.FloatValue optional_float_wrapper = 206; + google.protobuf.DoubleValue optional_double_wrapper = 207; + google.protobuf.StringValue optional_string_wrapper = 208; + google.protobuf.BytesValue optional_bytes_wrapper = 209; + + repeated google.protobuf.BoolValue repeated_bool_wrapper = 211; + repeated google.protobuf.Int32Value repeated_int32_wrapper = 212; + repeated google.protobuf.Int64Value repeated_int64_wrapper = 213; + repeated google.protobuf.UInt32Value repeated_uint32_wrapper = 214; + repeated google.protobuf.UInt64Value repeated_uint64_wrapper = 215; + repeated google.protobuf.FloatValue repeated_float_wrapper = 216; + repeated google.protobuf.DoubleValue repeated_double_wrapper = 217; + repeated google.protobuf.StringValue repeated_string_wrapper = 218; + repeated google.protobuf.BytesValue repeated_bytes_wrapper = 219; + + google.protobuf.Duration optional_duration = 301; + google.protobuf.Timestamp optional_timestamp = 302; + google.protobuf.FieldMask optional_field_mask = 303; + google.protobuf.Struct optional_struct = 304; + google.protobuf.Any optional_any = 305; + google.protobuf.Value optional_value = 306; + google.protobuf.NullValue optional_null_value = 307; + + repeated google.protobuf.Duration repeated_duration = 311; + repeated google.protobuf.Timestamp repeated_timestamp = 312; + repeated google.protobuf.FieldMask repeated_fieldmask = 313; + repeated google.protobuf.Struct repeated_struct = 324; + repeated google.protobuf.Any repeated_any = 315; + repeated google.protobuf.Value repeated_value = 316; + repeated google.protobuf.ListValue repeated_list_value = 317; + + // Test field-name-to-JSON-name convention. + // (protobuf says names can be any valid C/C++ identifier.) + int32 fieldname1 = 401; + int32 field_name2 = 402; + int32 _field_name3 = 403; + int32 field__name4_ = 404; + int32 field0name5 = 405; + int32 field_0_name6 = 406; + int32 fieldName7 = 407; + int32 FieldName8 = 408; + int32 field_Name9 = 409; + int32 Field_Name10 = 410; + int32 FIELD_NAME11 = 411; + int32 FIELD_name12 = 412; + int32 __field_name13 = 413; + int32 __Field_name14 = 414; + int32 field__name15 = 415; + int32 field__Name16 = 416; + int32 field_name17__ = 417; + int32 Field_name18__ = 418; + + // Reserved for testing unknown fields + reserved 501 to 510; +} + +message ForeignMessage { + int32 c = 1; +} + +enum ForeignEnum { + FOREIGN_FOO = 0; + FOREIGN_BAR = 1; + FOREIGN_BAZ = 2; +} + +message NullHypothesisProto3 {} + +message EnumOnlyProto3 { + enum Bool { + kFalse = 0; + kTrue = 1; + } +} diff --git a/Protos/SwiftProtobufTests/unittest.proto b/Protos/SwiftProtobufTests/unittest.proto new file mode 100644 index 000000000..877d5322e --- /dev/null +++ b/Protos/SwiftProtobufTests/unittest.proto @@ -0,0 +1,1701 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// A proto file we will use for unit testing. +// +// LINT: ALLOW_GROUPS, LEGACY_NAMES + +syntax = "proto2"; + +// Some generic_services option(s) added automatically. +// See: http://go/proto2-generic-services-default +option cc_generic_services = true; // auto-added +option java_generic_services = true; // auto-added +option py_generic_services = true; // auto-added +option cc_enable_arenas = true; + +import "unittest_import.proto"; + +// We don't put this in a package within proto2 because we need to make sure +// that the generated code doesn't depend on being in the proto2 namespace. +// In test_util.h we do "using namespace unittest = protobuf_unittest". +package protobuf_unittest; + +// Protos optimized for SPEED use a strict superset of the generated code +// of equivalent ones optimized for CODE_SIZE, so we should optimize all our +// tests for speed unless explicitly testing code size optimization. +option optimize_for = SPEED; + +option java_outer_classname = "UnittestProto"; + +// This proto includes every type of field in both singular and repeated +// forms. +message TestAllTypes { + message NestedMessage { + // The field name "b" fails to compile in proto1 because it conflicts with + // a local variable named "b" in one of the generated methods. Doh. + // This file needs to compile in proto1 to test backwards-compatibility. + optional int32 bb = 1; + } + + enum NestedEnum { + FOO = 1; + BAR = 2; + BAZ = 3; + NEG = -1; // Intentionally negative. + } + + // Singular + optional int32 optional_int32 = 1; + optional int64 optional_int64 = 2; + optional uint32 optional_uint32 = 3; + optional uint64 optional_uint64 = 4; + optional sint32 optional_sint32 = 5; + optional sint64 optional_sint64 = 6; + optional fixed32 optional_fixed32 = 7; + optional fixed64 optional_fixed64 = 8; + optional sfixed32 optional_sfixed32 = 9; + optional sfixed64 optional_sfixed64 = 10; + optional float optional_float = 11; + optional double optional_double = 12; + optional bool optional_bool = 13; + optional string optional_string = 14; + optional bytes optional_bytes = 15; + + optional group OptionalGroup = 16 { + optional int32 a = 17; + } + + optional NestedMessage optional_nested_message = 18; + optional ForeignMessage optional_foreign_message = 19; + optional protobuf_unittest_import.ImportMessage optional_import_message = 20; + + optional NestedEnum optional_nested_enum = 21; + optional ForeignEnum optional_foreign_enum = 22; + optional protobuf_unittest_import.ImportEnum optional_import_enum = 23; + + optional string optional_string_piece = 24 [ctype=STRING_PIECE]; + optional string optional_cord = 25 [ctype=CORD]; + + // Defined in unittest_import_public.proto + optional protobuf_unittest_import.PublicImportMessage + optional_public_import_message = 26; + + optional NestedMessage optional_lazy_message = 27 [lazy=true]; + optional NestedMessage optional_unverified_lazy_message = 28 [unverified_lazy=true]; + + // Repeated + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; + repeated sfixed32 repeated_sfixed32 = 39; + repeated sfixed64 repeated_sfixed64 = 40; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; + + repeated group RepeatedGroup = 46 { + optional int32 a = 47; + } + + repeated NestedMessage repeated_nested_message = 48; + repeated ForeignMessage repeated_foreign_message = 49; + repeated protobuf_unittest_import.ImportMessage repeated_import_message = 50; + + repeated NestedEnum repeated_nested_enum = 51; + repeated ForeignEnum repeated_foreign_enum = 52; + repeated protobuf_unittest_import.ImportEnum repeated_import_enum = 53; + + repeated string repeated_string_piece = 54 [ctype=STRING_PIECE]; + repeated string repeated_cord = 55 [ctype=CORD]; + + repeated NestedMessage repeated_lazy_message = 57 [lazy=true]; + + // Singular with defaults + optional int32 default_int32 = 61 [default = 41 ]; + optional int64 default_int64 = 62 [default = 42 ]; + optional uint32 default_uint32 = 63 [default = 43 ]; + optional uint64 default_uint64 = 64 [default = 44 ]; + optional sint32 default_sint32 = 65 [default = -45 ]; + optional sint64 default_sint64 = 66 [default = 46 ]; + optional fixed32 default_fixed32 = 67 [default = 47 ]; + optional fixed64 default_fixed64 = 68 [default = 48 ]; + optional sfixed32 default_sfixed32 = 69 [default = 49 ]; + optional sfixed64 default_sfixed64 = 70 [default = -50 ]; + optional float default_float = 71 [default = 51.5 ]; + optional double default_double = 72 [default = 52e3 ]; + optional bool default_bool = 73 [default = true ]; + optional string default_string = 74 [default = "hello"]; + optional bytes default_bytes = 75 [default = "world"]; + + optional NestedEnum default_nested_enum = 81 [default = BAR ]; + optional ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR]; + optional protobuf_unittest_import.ImportEnum + default_import_enum = 83 [default = IMPORT_BAR]; + + optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"]; + optional string default_cord = 85 [ctype=CORD,default="123"]; + + // For oneof test + oneof oneof_field { + uint32 oneof_uint32 = 111; + NestedMessage oneof_nested_message = 112; + string oneof_string = 113; + bytes oneof_bytes = 114; + } +} + +// This proto includes a recursively nested message. +message NestedTestAllTypes { + optional NestedTestAllTypes child = 1; + optional TestAllTypes payload = 2; + repeated NestedTestAllTypes repeated_child = 3; + optional NestedTestAllTypes lazy_child = 4 [lazy=true]; + optional TestAllTypes eager_child = 5 [lazy=false]; +} + +message TestDeprecatedFields { + optional int32 deprecated_int32 = 1 [deprecated=true]; + repeated string deprecated_repeated_string = 4 [deprecated=true]; + optional TestAllTypes.NestedMessage deprecated_message = 3 [deprecated=true]; + oneof oneof_fields { + int32 deprecated_int32_in_oneof = 2 [deprecated=true]; + } + optional TestDeprecatedFields nested = 5; +} + +message TestDeprecatedMessage { + option deprecated = true; +} + +// Define these after TestAllTypes to make sure the compiler can handle +// that. +message ForeignMessage { + optional int32 c = 1; + optional int32 d = 2; +} + +enum ForeignEnum { + FOREIGN_FOO = 4; + FOREIGN_BAR = 5; + FOREIGN_BAZ = 6; +} + +message TestReservedFields { + reserved 2, 15, 9 to 11; + reserved "bar", "baz"; +} + +enum TestReservedEnumFields { + UNKNOWN = 0; + reserved 2, 15, 9 to 11; + reserved "bar", "baz"; +} + +message TestAllExtensions { + extensions 1 to max; +} + +extend TestAllExtensions { + // Singular + optional int32 optional_int32_extension = 1; + optional int64 optional_int64_extension = 2; + optional uint32 optional_uint32_extension = 3; + optional uint64 optional_uint64_extension = 4; + optional sint32 optional_sint32_extension = 5; + optional sint64 optional_sint64_extension = 6; + optional fixed32 optional_fixed32_extension = 7; + optional fixed64 optional_fixed64_extension = 8; + optional sfixed32 optional_sfixed32_extension = 9; + optional sfixed64 optional_sfixed64_extension = 10; + optional float optional_float_extension = 11; + optional double optional_double_extension = 12; + optional bool optional_bool_extension = 13; + optional string optional_string_extension = 14; + optional bytes optional_bytes_extension = 15; + + optional group OptionalGroup_extension = 16 { + optional int32 a = 17; + } + + optional TestAllTypes.NestedMessage optional_nested_message_extension = 18; + optional ForeignMessage optional_foreign_message_extension = 19; + optional protobuf_unittest_import.ImportMessage + optional_import_message_extension = 20; + + optional TestAllTypes.NestedEnum optional_nested_enum_extension = 21; + optional ForeignEnum optional_foreign_enum_extension = 22; + optional protobuf_unittest_import.ImportEnum + optional_import_enum_extension = 23; + + optional string optional_string_piece_extension = 24 [ctype=STRING_PIECE]; + optional string optional_cord_extension = 25 [ctype=CORD]; + + optional protobuf_unittest_import.PublicImportMessage + optional_public_import_message_extension = 26; + + optional TestAllTypes.NestedMessage + optional_lazy_message_extension = 27 [lazy=true]; + optional TestAllTypes.NestedMessage + optional_unverified_lazy_message_extension = 28 [unverified_lazy=true]; + + // Repeated + repeated int32 repeated_int32_extension = 31; + repeated int64 repeated_int64_extension = 32; + repeated uint32 repeated_uint32_extension = 33; + repeated uint64 repeated_uint64_extension = 34; + repeated sint32 repeated_sint32_extension = 35; + repeated sint64 repeated_sint64_extension = 36; + repeated fixed32 repeated_fixed32_extension = 37; + repeated fixed64 repeated_fixed64_extension = 38; + repeated sfixed32 repeated_sfixed32_extension = 39; + repeated sfixed64 repeated_sfixed64_extension = 40; + repeated float repeated_float_extension = 41; + repeated double repeated_double_extension = 42; + repeated bool repeated_bool_extension = 43; + repeated string repeated_string_extension = 44; + repeated bytes repeated_bytes_extension = 45; + + repeated group RepeatedGroup_extension = 46 { + optional int32 a = 47; + } + + repeated TestAllTypes.NestedMessage repeated_nested_message_extension = 48; + repeated ForeignMessage repeated_foreign_message_extension = 49; + repeated protobuf_unittest_import.ImportMessage + repeated_import_message_extension = 50; + + repeated TestAllTypes.NestedEnum repeated_nested_enum_extension = 51; + repeated ForeignEnum repeated_foreign_enum_extension = 52; + repeated protobuf_unittest_import.ImportEnum + repeated_import_enum_extension = 53; + + repeated string repeated_string_piece_extension = 54 [ctype=STRING_PIECE]; + repeated string repeated_cord_extension = 55 [ctype=CORD]; + + repeated TestAllTypes.NestedMessage + repeated_lazy_message_extension = 57 [lazy=true]; + + // Singular with defaults + optional int32 default_int32_extension = 61 [default = 41 ]; + optional int64 default_int64_extension = 62 [default = 42 ]; + optional uint32 default_uint32_extension = 63 [default = 43 ]; + optional uint64 default_uint64_extension = 64 [default = 44 ]; + optional sint32 default_sint32_extension = 65 [default = -45 ]; + optional sint64 default_sint64_extension = 66 [default = 46 ]; + optional fixed32 default_fixed32_extension = 67 [default = 47 ]; + optional fixed64 default_fixed64_extension = 68 [default = 48 ]; + optional sfixed32 default_sfixed32_extension = 69 [default = 49 ]; + optional sfixed64 default_sfixed64_extension = 70 [default = -50 ]; + optional float default_float_extension = 71 [default = 51.5 ]; + optional double default_double_extension = 72 [default = 52e3 ]; + optional bool default_bool_extension = 73 [default = true ]; + optional string default_string_extension = 74 [default = "hello"]; + optional bytes default_bytes_extension = 75 [default = "world"]; + + optional TestAllTypes.NestedEnum + default_nested_enum_extension = 81 [default = BAR]; + optional ForeignEnum + default_foreign_enum_extension = 82 [default = FOREIGN_BAR]; + optional protobuf_unittest_import.ImportEnum + default_import_enum_extension = 83 [default = IMPORT_BAR]; + + optional string default_string_piece_extension = 84 [ctype=STRING_PIECE, + default="abc"]; + optional string default_cord_extension = 85 [ctype=CORD, default="123"]; + + // For oneof test + optional uint32 oneof_uint32_extension = 111; + optional TestAllTypes.NestedMessage oneof_nested_message_extension = 112; + optional string oneof_string_extension = 113; + optional bytes oneof_bytes_extension = 114; +} + +message TestMixedFieldsAndExtensions { + optional int32 a = 1; + repeated fixed32 b = 3; + extensions 2, 4; + extend TestMixedFieldsAndExtensions { + optional int32 c = 2; + repeated fixed32 d = 4; + } +} + +message TestGroup { + optional group OptionalGroup = 16 { + optional int32 a = 17; + optional int32 zz = 89; // fast table size must be at least 16, for this + // field to be parsed by the fast parser, since + // 89 - 17 = 72 is a multiple of 8. + } + optional ForeignEnum optional_foreign_enum = 22; +} + +message TestGroupExtension { + extensions 1 to max; +} + +message TestNestedExtension { + extend TestAllExtensions { + // Check for bug where string extensions declared in tested scope did not + // compile. + optional string test = 1002 [default="test"]; + // Used to test if generated extension name is correct when there are + // underscores. + optional string nested_string_extension = 1003; + } + + extend TestGroupExtension { + optional group OptionalGroup_extension = 16 { + optional int32 a = 17; + } + optional ForeignEnum optional_foreign_enum_extension = 22; + } +} + +message TestChildExtension { + optional string a = 1; + optional string b = 2; + optional TestAllExtensions optional_extension = 3; +} + +// Emulates wireformat data of TestChildExtension with dynamic extension +// (DynamicExtension). +message TestChildExtensionData { + message NestedTestAllExtensionsData { + message NestedDynamicExtensions { + optional int32 a = 1; + optional int32 b = 2; + } + optional NestedDynamicExtensions dynamic = 409707008; + } + optional string a = 1; + optional string b = 2; + optional NestedTestAllExtensionsData optional_extension = 3; +} + +message TestNestedChildExtension { + optional int32 a = 1; + optional TestChildExtension child = 2; +} + +// Emulates wireformat data of TestNestedChildExtension with dynamic extension +// (DynamicExtension). +message TestNestedChildExtensionData { + optional int32 a = 1; + optional TestChildExtensionData child = 2; +} + +// We have separate messages for testing required fields because it's +// annoying to have to fill in required fields in TestProto in order to +// do anything with it. Note that we don't need to test every type of +// required filed because the code output is basically identical to +// optional fields for all types. +message TestRequired { + required int32 a = 1; + optional int32 dummy2 = 2; + required int32 b = 3; + + extend TestAllExtensions { + optional TestRequired single = 1000; + repeated TestRequired multi = 1001; + } + + // Pad the field count to 32 so that we can test that IsInitialized() + // properly checks multiple elements of has_bits_. + optional int32 dummy4 = 4; + optional int32 dummy5 = 5; + optional int32 dummy6 = 6; + optional int32 dummy7 = 7; + optional int32 dummy8 = 8; + optional int32 dummy9 = 9; + optional int32 dummy10 = 10; + optional int32 dummy11 = 11; + optional int32 dummy12 = 12; + optional int32 dummy13 = 13; + optional int32 dummy14 = 14; + optional int32 dummy15 = 15; + optional int32 dummy16 = 16; + optional int32 dummy17 = 17; + optional int32 dummy18 = 18; + optional int32 dummy19 = 19; + optional int32 dummy20 = 20; + optional int32 dummy21 = 21; + optional int32 dummy22 = 22; + optional int32 dummy23 = 23; + optional int32 dummy24 = 24; + optional int32 dummy25 = 25; + optional int32 dummy26 = 26; + optional int32 dummy27 = 27; + optional int32 dummy28 = 28; + optional int32 dummy29 = 29; + optional int32 dummy30 = 30; + optional int32 dummy31 = 31; + optional int32 dummy32 = 32; + + required int32 c = 33; + + // Add an optional child message to make this non-trivial for go/pdlazy. + optional ForeignMessage optional_foreign = 34; +} + +message TestRequiredForeign { + optional TestRequired optional_message = 1; + repeated TestRequired repeated_message = 2; + optional int32 dummy = 3; + + // Missing required fields must not affect verification of child messages. + optional NestedTestAllTypes optional_lazy_message = 4 [lazy = true]; +} + +message TestRequiredMessage { + optional TestRequired optional_message = 1; + repeated TestRequired repeated_message = 2; + required TestRequired required_message = 3; +} + +message TestNestedRequiredForeign { + optional TestNestedRequiredForeign child = 1; + optional TestRequiredForeign payload = 2; + optional int32 dummy = 3; +} + +// Test that we can use NestedMessage from outside TestAllTypes. +message TestForeignNested { + optional TestAllTypes.NestedMessage foreign_nested = 1; +} + +// TestEmptyMessage is used to test unknown field support. +message TestEmptyMessage { +} + +// Like above, but declare all field numbers as potential extensions. No +// actual extensions should ever be defined for this type. +message TestEmptyMessageWithExtensions { + extensions 1 to max; +} + +// Needed for a Python test. +message TestPickleNestedMessage { + message NestedMessage { + optional int32 bb = 1; + message NestedNestedMessage { + optional int32 cc = 1; + } + } +} + +message TestMultipleExtensionRanges { + extensions 42; + extensions 4143 to 4243; + extensions 65536 to max; +} + +// Test that really large tag numbers don't break anything. +message TestReallyLargeTagNumber { + // The largest possible tag number is 2^28 - 1, since the wire format uses + // three bits to communicate wire type. + optional int32 a = 1; + optional int32 bb = 268435455; +} + +message TestRecursiveMessage { + optional TestRecursiveMessage a = 1; + optional int32 i = 2; +} + +// Test that mutual recursion works. +message TestMutualRecursionA { + message SubMessage { + optional TestMutualRecursionB b = 1; + } + optional TestMutualRecursionB bb = 1; + optional group SubGroup = 2 { + optional SubMessage sub_message = 3; // Needed because of bug in javatest + optional TestAllTypes not_in_this_scc = 4; + } + repeated group SubGroupR = 5 { + optional TestAllTypes payload = 6; + } +} + +message TestMutualRecursionB { + optional TestMutualRecursionA a = 1; + optional int32 optional_int32 = 2; +} + +message TestIsInitialized { + message SubMessage { + optional group SubGroup = 1 { + required int32 i = 2; + } + } + optional SubMessage sub_message = 1; +} + +// Test that groups have disjoint field numbers from their siblings and +// parents. This is NOT possible in proto1; only google.protobuf. When attempting +// to compile with proto1, this will emit an error; so we only include it +// in protobuf_unittest_proto. +message TestDupFieldNumber { // NO_PROTO1 + optional int32 a = 1; // NO_PROTO1 + optional group Foo = 2 { optional int32 a = 1; } // NO_PROTO1 + optional group Bar = 3 { optional int32 a = 1; } // NO_PROTO1 +} // NO_PROTO1 + +// Additional messages for testing lazy fields. +message TestEagerMessage { + optional TestAllTypes sub_message = 1 [lazy=false]; +} +message TestLazyMessage { + optional TestAllTypes sub_message = 1 [lazy=true]; +} +message TestLazyMessageRepeated { + repeated TestLazyMessage repeated_message = 1; +} +message TestEagerMaybeLazy { + message NestedMessage { + optional TestPackedTypes packed = 1; + } + optional TestAllTypes message_foo = 1; + optional TestAllTypes message_bar = 2; + optional NestedMessage message_baz = 3; +} +// Needed for a Python test. +message TestNestedMessageHasBits { + message NestedMessage { + repeated int32 nestedmessage_repeated_int32 = 1; + repeated ForeignMessage nestedmessage_repeated_foreignmessage = 2; + } + optional NestedMessage optional_nested_message = 1; +} + + +// Test an enum that has multiple values with the same number. +enum TestEnumWithDupValue { + option allow_alias = true; + + FOO1 = 1; + BAR1 = 2; + BAZ = 3; + FOO2 = 1; + BAR2 = 2; +} + +// Test an enum with large, unordered values. +enum TestSparseEnum { + SPARSE_A = 123; + SPARSE_B = 62374; + SPARSE_C = 12589234; + SPARSE_D = -15; + SPARSE_E = -53452; + SPARSE_F = 0; + SPARSE_G = 2; +} + +// Test message with CamelCase field names. This violates Protocol Buffer +// standard style. +message TestCamelCaseFieldNames { + optional int32 PrimitiveField = 1; + optional string StringField = 2; + optional ForeignEnum EnumField = 3; + optional ForeignMessage MessageField = 4; + optional string StringPieceField = 5 [ctype=STRING_PIECE]; + optional string CordField = 6 [ctype=CORD]; + + repeated int32 RepeatedPrimitiveField = 7; + repeated string RepeatedStringField = 8; + repeated ForeignEnum RepeatedEnumField = 9; + repeated ForeignMessage RepeatedMessageField = 10; + repeated string RepeatedStringPieceField = 11 [ctype=STRING_PIECE]; + repeated string RepeatedCordField = 12 [ctype=CORD]; +} + + +// We list fields out of order, to ensure that we're using field number and not +// field index to determine serialization order. +message TestFieldOrderings { + optional string my_string = 11; + extensions 2 to 10; + optional int64 my_int = 1; + extensions 12 to 100; + optional float my_float = 101; + message NestedMessage { + optional int64 oo = 2; + // The field name "b" fails to compile in proto1 because it conflicts with + // a local variable named "b" in one of the generated methods. Doh. + // This file needs to compile in proto1 to test backwards-compatibility. + optional int32 bb = 1; + } + + optional NestedMessage optional_nested_message = 200; +} + +extend TestFieldOrderings { + optional string my_extension_string = 50; + optional int32 my_extension_int = 5; +} + +message TestExtensionOrderings1 { + extend TestFieldOrderings { + optional TestExtensionOrderings1 test_ext_orderings1 = 13; + } + optional string my_string = 1; +} + +message TestExtensionOrderings2 { + extend TestFieldOrderings { + optional TestExtensionOrderings2 test_ext_orderings2 = 12; + } + message TestExtensionOrderings3 { + extend TestFieldOrderings { + optional TestExtensionOrderings3 test_ext_orderings3 = 14; + } + optional string my_string = 1; + } + optional string my_string = 1; +} + +message TestExtremeDefaultValues { + optional bytes escaped_bytes = 1 [default = "\0\001\a\b\f\n\r\t\v\\\'\"\xfe"]; + optional uint32 large_uint32 = 2 [default = 0xFFFFFFFF]; + optional uint64 large_uint64 = 3 [default = 0xFFFFFFFFFFFFFFFF]; + optional int32 small_int32 = 4 [default = -0x7FFFFFFF]; + optional int64 small_int64 = 5 [default = -0x7FFFFFFFFFFFFFFF]; + optional int32 really_small_int32 = 21 [default = -0x80000000]; + optional int64 really_small_int64 = 22 [default = -0x8000000000000000]; + + // The default value here is UTF-8 for "\u1234". (We could also just type + // the UTF-8 text directly into this text file rather than escape it, but + // lots of people use editors that would be confused by this.) + optional string utf8_string = 6 [default = "\341\210\264"]; + + // Tests for single-precision floating-point values. + optional float zero_float = 7 [default = 0]; + optional float one_float = 8 [default = 1]; + optional float small_float = 9 [default = 1.5]; + optional float negative_one_float = 10 [default = -1]; + optional float negative_float = 11 [default = -1.5]; + // Using exponents + optional float large_float = 12 [default = 2E8]; + optional float small_negative_float = 13 [default = -8e-28]; + + // Text for nonfinite floating-point values. + optional double inf_double = 14 [default = inf]; + optional double neg_inf_double = 15 [default = -inf]; + optional double nan_double = 16 [default = nan]; + optional float inf_float = 17 [default = inf]; + optional float neg_inf_float = 18 [default = -inf]; + optional float nan_float = 19 [default = nan]; + + // Tests for C++ trigraphs. + // Trigraphs should be escaped in C++ generated files, but they should not be + // escaped for other languages. + // Note that in .proto file, "\?" is a valid way to escape ? in string + // literals. + optional string cpp_trigraph = 20 [default = "? \? ?? \?? \??? ??/ ?\?-"]; + + // String defaults containing the character '\000' + optional string string_with_zero = 23 [default = "hel\000lo"]; + optional bytes bytes_with_zero = 24 [default = "wor\000ld"]; + optional string string_piece_with_zero = 25 [ctype=STRING_PIECE, + default="ab\000c"]; + optional string cord_with_zero = 26 [ctype=CORD, + default="12\0003"]; + optional string replacement_string = 27 [default="${unknown}"]; +} + +message SparseEnumMessage { + optional TestSparseEnum sparse_enum = 1; +} + +// Test String and Bytes: string is for valid UTF-8 strings +message OneString { + optional string data = 1; +} + +message MoreString { + repeated string data = 1; +} + +message OneBytes { + optional bytes data = 1; +} + +message MoreBytes { + repeated bytes data = 1; +} + +message ManyOptionalString { + optional string str1 = 1; + optional string str2 = 2; + optional string str3 = 3; + optional string str4 = 4; + optional string str5 = 5; + optional string str6 = 6; + optional string str7 = 7; + optional string str8 = 8; + optional string str9 = 9; + optional string str10 = 10; + optional string str11 = 11; + optional string str12 = 12; + optional string str13 = 13; + optional string str14 = 14; + optional string str15 = 15; + optional string str16 = 16; + optional string str17 = 17; + optional string str18 = 18; + optional string str19 = 19; + optional string str20 = 20; + optional string str21 = 21; + optional string str22 = 22; + optional string str23 = 23; + optional string str24 = 24; + optional string str25 = 25; + optional string str26 = 26; + optional string str27 = 27; + optional string str28 = 28; + optional string str29 = 29; + optional string str30 = 30; + optional string str31 = 31; + optional string str32 = 32; +} + +// Test int32, uint32, int64, uint64, and bool are all compatible +message Int32Message { + optional int32 data = 1; +} + +message Uint32Message { + optional uint32 data = 1; +} + +message Int64Message { + optional int64 data = 1; +} + +message Uint64Message { + optional uint64 data = 1; +} + +message BoolMessage { + optional bool data = 1; +} + +// Test oneofs. +message TestOneof { + oneof foo { + int32 foo_int = 1; + string foo_string = 2; + TestAllTypes foo_message = 3; + group FooGroup = 4 { + optional int32 a = 5; + optional string b = 6; + } + } +} + +message TestOneofBackwardsCompatible { + optional int32 foo_int = 1; + optional string foo_string = 2; + optional TestAllTypes foo_message = 3; + optional group FooGroup = 4 { + optional int32 a = 5; + optional string b = 6; + } +} + +message TestOneof2 { + oneof foo { + int32 foo_int = 1; + string foo_string = 2; + string foo_cord = 3 [ctype=CORD]; + string foo_string_piece = 4 [ctype=STRING_PIECE]; + bytes foo_bytes = 5; + NestedEnum foo_enum = 6; + NestedMessage foo_message = 7; + group FooGroup = 8 { + optional int32 a = 9; + optional string b = 10; + } + NestedMessage foo_lazy_message = 11 [lazy=true]; + bytes foo_bytes_cord = 30 [ctype=CORD]; + } + + oneof bar { + int32 bar_int = 12 [default = 5]; + string bar_string = 13 [default = "STRING"]; + string bar_cord = 14 [ctype=CORD, default = "CORD"]; + string bar_string_piece = 15 [ctype=STRING_PIECE, default = "SPIECE"]; + bytes bar_bytes = 16 [default = "BYTES"]; + NestedEnum bar_enum = 17 [default = BAR]; + string bar_string_with_empty_default = 20 [default = ""]; + string bar_cord_with_empty_default = 21 [ctype=CORD, default = ""]; + string bar_string_piece_with_empty_default = 22 [ctype=STRING_PIECE, default = ""]; + bytes bar_bytes_with_empty_default = 23 [default = ""]; + } + + optional int32 baz_int = 18; + optional string baz_string = 19 [default = "BAZ"]; + + message NestedMessage { + optional int64 moo_int = 1; + repeated int32 corge_int = 2; + } + + enum NestedEnum { + FOO = 1; + BAR = 2; + BAZ = 3; + } +} + +message TestRequiredOneof { + oneof foo { + int32 foo_int = 1; + string foo_string = 2; + NestedMessage foo_message = 3; + NestedMessage foo_lazy_message = 4 [lazy = true]; + } + message NestedMessage { + required double required_double = 1; + } +} + +// Test messages for packed fields + +message TestPackedTypes { + repeated int32 packed_int32 = 90 [packed = true]; + repeated int64 packed_int64 = 91 [packed = true]; + repeated uint32 packed_uint32 = 92 [packed = true]; + repeated uint64 packed_uint64 = 93 [packed = true]; + repeated sint32 packed_sint32 = 94 [packed = true]; + repeated sint64 packed_sint64 = 95 [packed = true]; + repeated fixed32 packed_fixed32 = 96 [packed = true]; + repeated fixed64 packed_fixed64 = 97 [packed = true]; + repeated sfixed32 packed_sfixed32 = 98 [packed = true]; + repeated sfixed64 packed_sfixed64 = 99 [packed = true]; + repeated float packed_float = 100 [packed = true]; + repeated double packed_double = 101 [packed = true]; + repeated bool packed_bool = 102 [packed = true]; + repeated ForeignEnum packed_enum = 103 [packed = true]; +} + +// A message with the same fields as TestPackedTypes, but without packing. Used +// to test packed <-> unpacked wire compatibility. +message TestUnpackedTypes { + repeated int32 unpacked_int32 = 90 [packed = false]; + repeated int64 unpacked_int64 = 91 [packed = false]; + repeated uint32 unpacked_uint32 = 92 [packed = false]; + repeated uint64 unpacked_uint64 = 93 [packed = false]; + repeated sint32 unpacked_sint32 = 94 [packed = false]; + repeated sint64 unpacked_sint64 = 95 [packed = false]; + repeated fixed32 unpacked_fixed32 = 96 [packed = false]; + repeated fixed64 unpacked_fixed64 = 97 [packed = false]; + repeated sfixed32 unpacked_sfixed32 = 98 [packed = false]; + repeated sfixed64 unpacked_sfixed64 = 99 [packed = false]; + repeated float unpacked_float = 100 [packed = false]; + repeated double unpacked_double = 101 [packed = false]; + repeated bool unpacked_bool = 102 [packed = false]; + repeated ForeignEnum unpacked_enum = 103 [packed = false]; +} + +message TestPackedExtensions { + extensions 1 to max; +} + +extend TestPackedExtensions { + repeated int32 packed_int32_extension = 90 [packed = true]; + repeated int64 packed_int64_extension = 91 [packed = true]; + repeated uint32 packed_uint32_extension = 92 [packed = true]; + repeated uint64 packed_uint64_extension = 93 [packed = true]; + repeated sint32 packed_sint32_extension = 94 [packed = true]; + repeated sint64 packed_sint64_extension = 95 [packed = true]; + repeated fixed32 packed_fixed32_extension = 96 [packed = true]; + repeated fixed64 packed_fixed64_extension = 97 [packed = true]; + repeated sfixed32 packed_sfixed32_extension = 98 [packed = true]; + repeated sfixed64 packed_sfixed64_extension = 99 [packed = true]; + repeated float packed_float_extension = 100 [packed = true]; + repeated double packed_double_extension = 101 [packed = true]; + repeated bool packed_bool_extension = 102 [packed = true]; + repeated ForeignEnum packed_enum_extension = 103 [packed = true]; +} + +message TestUnpackedExtensions { + extensions 1 to max; +} + +extend TestUnpackedExtensions { + repeated int32 unpacked_int32_extension = 90 [packed = false]; + repeated int64 unpacked_int64_extension = 91 [packed = false]; + repeated uint32 unpacked_uint32_extension = 92 [packed = false]; + repeated uint64 unpacked_uint64_extension = 93 [packed = false]; + repeated sint32 unpacked_sint32_extension = 94 [packed = false]; + repeated sint64 unpacked_sint64_extension = 95 [packed = false]; + repeated fixed32 unpacked_fixed32_extension = 96 [packed = false]; + repeated fixed64 unpacked_fixed64_extension = 97 [packed = false]; + repeated sfixed32 unpacked_sfixed32_extension = 98 [packed = false]; + repeated sfixed64 unpacked_sfixed64_extension = 99 [packed = false]; + repeated float unpacked_float_extension = 100 [packed = false]; + repeated double unpacked_double_extension = 101 [packed = false]; + repeated bool unpacked_bool_extension = 102 [packed = false]; + repeated ForeignEnum unpacked_enum_extension = 103 [packed = false]; +} + +// Used by ExtensionSetTest/DynamicExtensions. The test actually builds +// a set of extensions to TestAllExtensions dynamically, based on the fields +// of this message type. +message TestDynamicExtensions { + enum DynamicEnumType { + DYNAMIC_FOO = 2200; + DYNAMIC_BAR = 2201; + DYNAMIC_BAZ = 2202; + } + message DynamicMessageType { + optional int32 dynamic_field = 2100; + } + + optional fixed32 scalar_extension = 2000; + optional ForeignEnum enum_extension = 2001; + optional DynamicEnumType dynamic_enum_extension = 2002; + + optional ForeignMessage message_extension = 2003; + optional DynamicMessageType dynamic_message_extension = 2004; + + repeated string repeated_extension = 2005; + repeated sint32 packed_extension = 2006 [packed = true]; +} + +message TestRepeatedString { + repeated string repeated_string1 = 1; + repeated string repeated_string2 = 2; + + repeated bytes repeated_bytes11 = 11; + repeated bytes repeated_bytes12 = 12; +} + +message TestRepeatedScalarDifferentTagSizes { + // Parsing repeated fixed size values used to fail. This message needs to be + // used in order to get a tag of the right size; all of the repeated fields + // in TestAllTypes didn't trigger the check. + repeated fixed32 repeated_fixed32 = 12; + // Check for a varint type, just for good measure. + repeated int32 repeated_int32 = 13; + + // These have two-byte tags. + repeated fixed64 repeated_fixed64 = 2046; + repeated int64 repeated_int64 = 2047; + + // Three byte tags. + repeated float repeated_float = 262142; + repeated uint64 repeated_uint64 = 262143; +} + +// Test that if an optional or required message/group field appears multiple +// times in the input, they need to be merged. +message TestParsingMerge { + // RepeatedFieldsGenerator defines matching field types as TestParsingMerge, + // except that all fields are repeated. In the tests, we will serialize the + // RepeatedFieldsGenerator to bytes, and parse the bytes to TestParsingMerge. + // Repeated fields in RepeatedFieldsGenerator are expected to be merged into + // the corresponding required/optional fields in TestParsingMerge. + message RepeatedFieldsGenerator { + repeated TestAllTypes field1 = 1; + repeated TestAllTypes field2 = 2; + repeated TestAllTypes field3 = 3; + repeated group Group1 = 10 { + optional TestAllTypes field1 = 11; + } + repeated group Group2 = 20 { + optional TestAllTypes field1 = 21; + } + repeated TestAllTypes ext1 = 1000; + repeated TestAllTypes ext2 = 1001; + } + required TestAllTypes required_all_types = 1; + optional TestAllTypes optional_all_types = 2; + repeated TestAllTypes repeated_all_types = 3; + optional group OptionalGroup = 10 { + optional TestAllTypes optional_group_all_types = 11; + } + repeated group RepeatedGroup = 20 { + optional TestAllTypes repeated_group_all_types = 21; + } + extensions 1000 to max; + extend TestParsingMerge { + optional TestAllTypes optional_ext = 1000; + repeated TestAllTypes repeated_ext = 1001; + } +} + +// Test that the correct exception is thrown by parseFrom in a corner case +// involving merging, extensions, and required fields. +message TestMergeException { + optional TestAllExtensions all_extensions = 1; +} + +message TestCommentInjectionMessage { + // */ <- This should not close the generated doc comment + optional string a = 1 [default="*/ <- Neither should this."]; +} + +// Used to check that the c++ code generator re-orders messages to reduce +// padding. +message TestMessageSize { + optional bool m1 = 1; + optional int64 m2 = 2; + optional bool m3 = 3; + optional string m4 = 4; + optional int32 m5 = 5; + optional int64 m6 = 6; +} + +// Test that RPC services work. +message FooRequest {} +message FooResponse {} + +message FooClientMessage {} +message FooServerMessage{} + +service TestService { + rpc Foo(FooRequest) returns (FooResponse); + rpc Bar(BarRequest) returns (BarResponse); +} + +message BarRequest {} +message BarResponse {} + +message TestJsonName { + optional int32 field_name1 = 1; + optional int32 fieldName2 = 2; + optional int32 FieldName3 = 3; + optional int32 _field_name4 = 4; + optional int32 FIELD_NAME5 = 5; + optional int32 field_name6 = 6 [json_name = "@type"]; + optional int32 fieldname7 = 7; +} + +message TestHugeFieldNumbers { + optional int32 optional_int32 = 536870000; + optional int32 fixed_32 = 536870001; + repeated int32 repeated_int32 = 536870002 [packed = false]; + repeated int32 packed_int32 = 536870003 [packed = true]; + + optional ForeignEnum optional_enum = 536870004; + optional string optional_string = 536870005; + optional bytes optional_bytes = 536870006; + optional ForeignMessage optional_message = 536870007; + + optional group OptionalGroup = 536870008 { + optional int32 group_a = 536870009; + } + + map string_string_map = 536870010; + + oneof oneof_field { + uint32 oneof_uint32 = 536870011; + TestAllTypes oneof_test_all_types = 536870012; + string oneof_string = 536870013; + bytes oneof_bytes = 536870014; + } + + extensions 536860000 to 536869999 [declaration = { + number: 536860000 + full_name: ".protobuf_unittest.test_all_types" + type: ".protobuf_unittest.TestAllTypes" + }]; +} + +extend TestHugeFieldNumbers { + optional TestAllTypes test_all_types = 536860000; +} + +message TestExtensionInsideTable { + optional int32 field1 = 1; + optional int32 field2 = 2; + optional int32 field3 = 3; + optional int32 field4 = 4; + extensions 5 to 5; + optional int32 field6 = 6; + optional int32 field7 = 7; + optional int32 field8 = 8; + optional int32 field9 = 9; + optional int32 field10 = 10; +} + +extend TestExtensionInsideTable { + optional int32 test_extension_inside_table_extension = 5; +} + +// NOTE(b/202996544): Intentionally nested to mirror go/glep. +message TestNestedGroupExtensionOuter { + optional group Layer1OptionalGroup = 1 { + repeated group Layer2RepeatedGroup = 2 { + extensions 3 + // NOTE: extension metadata is not supported due to targets such as + // `//third_party/protobuf_legacy_opensource/src:shell_scripts_test`, + // eee https://screenshot.googleplex.com/Axz2QD8nxjdpyFF + //[metadata = { + // NOTE: can't write type there due to some clever build gen code at + // http://google3/net/proto2/internal/BUILD;l=1247;rcl=411090862 + // type: "protobuf_unittest.TestNestedGroupExtensionInnerExtension", + // name: "inner", + // }] + ; + optional string another_field = 6; + } + repeated group Layer2AnotherOptionalRepeatedGroup = 4 { + optional string but_why_tho = 5; + } + } +} + +message TestNestedGroupExtensionInnerExtension { + optional string inner_name= 1; +} + +extend TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2RepeatedGroup { + optional TestNestedGroupExtensionInnerExtension inner = 3; +} + +enum VeryLargeEnum { + ENUM_LABEL_DEFAULT = 0; + ENUM_LABEL_1 = 1; + ENUM_LABEL_2 = 2; + ENUM_LABEL_3 = 3; + ENUM_LABEL_4 = 4; + ENUM_LABEL_5 = 5; + ENUM_LABEL_6 = 6; + ENUM_LABEL_7 = 7; + ENUM_LABEL_8 = 8; + ENUM_LABEL_9 = 9; + ENUM_LABEL_10 = 10; + ENUM_LABEL_11 = 11; + ENUM_LABEL_12 = 12; + ENUM_LABEL_13 = 13; + ENUM_LABEL_14 = 14; + ENUM_LABEL_15 = 15; + ENUM_LABEL_16 = 16; + ENUM_LABEL_17 = 17; + ENUM_LABEL_18 = 18; + ENUM_LABEL_19 = 19; + ENUM_LABEL_20 = 20; + ENUM_LABEL_21 = 21; + ENUM_LABEL_22 = 22; + ENUM_LABEL_23 = 23; + ENUM_LABEL_24 = 24; + ENUM_LABEL_25 = 25; + ENUM_LABEL_26 = 26; + ENUM_LABEL_27 = 27; + ENUM_LABEL_28 = 28; + ENUM_LABEL_29 = 29; + ENUM_LABEL_30 = 30; + ENUM_LABEL_31 = 31; + ENUM_LABEL_32 = 32; + ENUM_LABEL_33 = 33; + ENUM_LABEL_34 = 34; + ENUM_LABEL_35 = 35; + ENUM_LABEL_36 = 36; + ENUM_LABEL_37 = 37; + ENUM_LABEL_38 = 38; + ENUM_LABEL_39 = 39; + ENUM_LABEL_40 = 40; + ENUM_LABEL_41 = 41; + ENUM_LABEL_42 = 42; + ENUM_LABEL_43 = 43; + ENUM_LABEL_44 = 44; + ENUM_LABEL_45 = 45; + ENUM_LABEL_46 = 46; + ENUM_LABEL_47 = 47; + ENUM_LABEL_48 = 48; + ENUM_LABEL_49 = 49; + ENUM_LABEL_50 = 50; + ENUM_LABEL_51 = 51; + ENUM_LABEL_52 = 52; + ENUM_LABEL_53 = 53; + ENUM_LABEL_54 = 54; + ENUM_LABEL_55 = 55; + ENUM_LABEL_56 = 56; + ENUM_LABEL_57 = 57; + ENUM_LABEL_58 = 58; + ENUM_LABEL_59 = 59; + ENUM_LABEL_60 = 60; + ENUM_LABEL_61 = 61; + ENUM_LABEL_62 = 62; + ENUM_LABEL_63 = 63; + ENUM_LABEL_64 = 64; + ENUM_LABEL_65 = 65; + ENUM_LABEL_66 = 66; + ENUM_LABEL_67 = 67; + ENUM_LABEL_68 = 68; + ENUM_LABEL_69 = 69; + ENUM_LABEL_70 = 70; + ENUM_LABEL_71 = 71; + ENUM_LABEL_72 = 72; + ENUM_LABEL_73 = 73; + ENUM_LABEL_74 = 74; + ENUM_LABEL_75 = 75; + ENUM_LABEL_76 = 76; + ENUM_LABEL_77 = 77; + ENUM_LABEL_78 = 78; + ENUM_LABEL_79 = 79; + ENUM_LABEL_80 = 80; + ENUM_LABEL_81 = 81; + ENUM_LABEL_82 = 82; + ENUM_LABEL_83 = 83; + ENUM_LABEL_84 = 84; + ENUM_LABEL_85 = 85; + ENUM_LABEL_86 = 86; + ENUM_LABEL_87 = 87; + ENUM_LABEL_88 = 88; + ENUM_LABEL_89 = 89; + ENUM_LABEL_90 = 90; + ENUM_LABEL_91 = 91; + ENUM_LABEL_92 = 92; + ENUM_LABEL_93 = 93; + ENUM_LABEL_94 = 94; + ENUM_LABEL_95 = 95; + ENUM_LABEL_96 = 96; + ENUM_LABEL_97 = 97; + ENUM_LABEL_98 = 98; + ENUM_LABEL_99 = 99; + ENUM_LABEL_100 = 100; +}; + +message TestExtensionRangeSerialize { + optional int32 foo_one = 1; + + extensions 2 to 2; + extensions 3 to 4; + + optional int32 foo_two = 6; + optional int32 foo_three = 7; + + extensions 9 to 10; + + optional int32 foo_four = 13; + + extensions 15 to 15; + extensions 17 to 17; + extensions 19 to 19; + + extend TestExtensionRangeSerialize { + optional int32 bar_one = 2; + optional int32 bar_two = 4; + + optional int32 bar_three = 10; + + optional int32 bar_four = 15; + optional int32 bar_five = 19; + } +} + +message TestVerifyInt32Simple { + optional int32 optional_int32_1 = 1; + optional int32 optional_int32_2 = 2; + optional int32 optional_int32_63 = 63; + optional int32 optional_int32_64 = 64; +} + +message TestVerifyInt32 { + optional int32 optional_int32_1 = 1; + optional int32 optional_int32_2 = 2; + optional int32 optional_int32_63 = 63; + optional int32 optional_int32_64 = 64; + + optional TestAllTypes optional_all_types = 9; + repeated TestAllTypes repeated_all_types = 10; +} + +message TestVerifyMostlyInt32 { + optional int64 optional_int64_30 = 30; + + optional int32 optional_int32_1 = 1; + optional int32 optional_int32_2 = 2; + optional int32 optional_int32_3 = 3; + optional int32 optional_int32_4 = 4; + optional int32 optional_int32_63 = 63; + optional int32 optional_int32_64 = 64; + + optional TestAllTypes optional_all_types = 9; + repeated TestAllTypes repeated_all_types = 10; +} + +message TestVerifyMostlyInt32BigFieldNumber { + optional int64 optional_int64_30 = 30; + optional int32 optional_int32_300 = 300; + + optional int32 optional_int32_1 = 1; + optional int32 optional_int32_2 = 2; + optional int32 optional_int32_3 = 3; + optional int32 optional_int32_4 = 4; + optional int32 optional_int32_63 = 63; + optional int32 optional_int32_64 = 64; + + optional TestAllTypes optional_all_types = 9; + repeated TestAllTypes repeated_all_types = 10; +} + +message TestVerifyUint32Simple { + optional uint32 optional_uint32_1 = 1; + optional uint32 optional_uint32_2 = 2; + optional uint32 optional_uint32_63 = 63; + optional uint32 optional_uint32_64 = 64; +} + +message TestVerifyUint32 { + optional uint32 optional_uint32_1 = 1; + optional uint32 optional_uint32_2 = 2; + optional uint32 optional_uint32_63 = 63; + optional uint32 optional_uint32_64 = 64; + + optional TestAllTypes optional_all_types = 9; + repeated TestAllTypes repeated_all_types = 10; +} + +message TestVerifyOneUint32 { + optional uint32 optional_uint32_1 = 1; + optional int32 optional_int32_2 = 2; + optional int32 optional_int32_63 = 63; + optional int32 optional_int32_64 = 64; + + optional TestAllTypes optional_all_types = 9; + repeated TestAllTypes repeated_all_types = 10; +} + +message TestVerifyOneInt32BigFieldNumber { + optional int32 optional_int32_65 = 65; + + optional int64 optional_int64_1 = 1; + optional int64 optional_int64_2 = 2; + optional int64 optional_int64_63 = 63; + optional int64 optional_int64_64 = 64; + + optional TestAllTypes optional_all_types = 9; + repeated TestAllTypes repeated_all_types = 10; +} + +message TestVerifyInt32BigFieldNumber { + optional int32 optional_int32_1000 = 1000; + optional int32 optional_int32_65 = 65; + + optional int32 optional_int32_1 = 1; + optional int32 optional_int32_2 = 2; + optional int32 optional_int32_63 = 63; + optional int32 optional_int32_64 = 64; + + optional TestAllTypes optional_all_types = 9; + repeated TestAllTypes repeated_all_types = 10; +} + +message TestVerifyUint32BigFieldNumber { + optional uint32 optional_uint32_1000 = 1000; + optional uint32 optional_uint32_65 = 65; + + optional uint32 optional_uint32_1 = 1; + optional uint32 optional_uint32_2 = 2; + optional uint32 optional_uint32_63 = 63; + optional uint32 optional_uint32_64 = 64; + + optional TestAllTypes optional_all_types = 9; + repeated TestAllTypes repeated_all_types = 10; +} + +message TestVerifyBigFieldNumberUint32 { + message Nested { + optional uint32 optional_uint32_5000 = 5000; + optional uint32 optional_uint32_1000 = 1000; + optional uint32 optional_uint32_66 = 66; + optional uint32 optional_uint32_65 = 65; + + optional uint32 optional_uint32_1 = 1; + optional uint32 optional_uint32_2 = 2; + optional uint32 optional_uint32_63 = 63; + optional uint32 optional_uint32_64 = 64; + + optional Nested optional_nested = 9; + repeated Nested repeated_nested = 10; + } + optional Nested optional_nested = 1; +} + +// This message contains different kind of enums to exercise the different +// parsers in table-driven. +message EnumParseTester { + enum SeqSmall0 { + SEQ_SMALL_0_DEFAULT = 0; + SEQ_SMALL_0_1 = 1; + SEQ_SMALL_0_2 = 2; + }; + optional SeqSmall0 optional_seq_small_0_lowfield = 1; + optional SeqSmall0 optional_seq_small_0_midfield = 1001; + optional SeqSmall0 optional_seq_small_0_hifield = 1000001; + repeated SeqSmall0 repeated_seq_small_0_lowfield = 2; + repeated SeqSmall0 repeated_seq_small_0_midfield = 1002; + repeated SeqSmall0 repeated_seq_small_0_hifield = 1000002; + repeated SeqSmall0 packed_seq_small_0_lowfield = 3 [packed = true]; + repeated SeqSmall0 packed_seq_small_0_midfield = 1003 [packed = true]; + repeated SeqSmall0 packed_seq_small_0_hifield = 1000003 [packed = true]; + + enum SeqSmall1 { + SEQ_SMALL_1_DEFAULT = 1; + SEQ_SMALL_1_2 = 2; + SEQ_SMALL_1_3 = 3; + }; + optional SeqSmall1 optional_seq_small_1_lowfield = 4; + optional SeqSmall1 optional_seq_small_1_midfield = 1004; + optional SeqSmall1 optional_seq_small_1_hifield = 1000004; + repeated SeqSmall1 repeated_seq_small_1_lowfield = 5; + repeated SeqSmall1 repeated_seq_small_1_midfield = 1005; + repeated SeqSmall1 repeated_seq_small_1_hifield = 1000005; + repeated SeqSmall1 packed_seq_small_1_lowfield = 6 [packed = true]; + repeated SeqSmall1 packed_seq_small_1_midfield = 1006 [packed = true]; + repeated SeqSmall1 packed_seq_small_1_hifield = 1000006 [packed = true]; + + enum SeqLarge { + SEQ_LARGE_DEFAULT = -1; + SEQ_LARGE_0 = 0; + SEQ_LARGE_1 = 1; + SEQ_LARGE_2 = 2; + SEQ_LARGE_3 = 3; + SEQ_LARGE_4 = 4; + SEQ_LARGE_5 = 5; + SEQ_LARGE_6 = 6; + SEQ_LARGE_7 = 7; + SEQ_LARGE_8 = 8; + SEQ_LARGE_9 = 9; + SEQ_LARGE_10 = 10; + SEQ_LARGE_11 = 11; + SEQ_LARGE_12 = 12; + SEQ_LARGE_13 = 13; + SEQ_LARGE_14 = 14; + SEQ_LARGE_15 = 15; + SEQ_LARGE_16 = 16; + SEQ_LARGE_17 = 17; + SEQ_LARGE_18 = 18; + SEQ_LARGE_19 = 19; + SEQ_LARGE_20 = 20; + SEQ_LARGE_21 = 21; + SEQ_LARGE_22 = 22; + SEQ_LARGE_23 = 23; + SEQ_LARGE_24 = 24; + SEQ_LARGE_25 = 25; + SEQ_LARGE_26 = 26; + SEQ_LARGE_27 = 27; + SEQ_LARGE_28 = 28; + SEQ_LARGE_29 = 29; + SEQ_LARGE_30 = 30; + SEQ_LARGE_31 = 31; + SEQ_LARGE_32 = 32; + SEQ_LARGE_33 = 33; + }; + optional SeqLarge optional_seq_large_lowfield = 7; + optional SeqLarge optional_seq_large_midfield = 1007; + optional SeqLarge optional_seq_large_hifield = 1000007; + repeated SeqLarge repeated_seq_large_lowfield = 8; + repeated SeqLarge repeated_seq_large_midfield = 1008; + repeated SeqLarge repeated_seq_large_hifield = 1000008; + repeated SeqLarge packed_seq_large_lowfield = 9 [packed = true]; + repeated SeqLarge packed_seq_large_midfield = 1009 [packed = true]; + repeated SeqLarge packed_seq_large_hifield = 1000009 [packed = true]; + + enum Arbitrary { + ARBITRARY_DEFAULT = -123123; + ARBITRARY_1 = -123; + ARBITRARY_2 = 213; + ARBITRARY_3 = 213213; + ARBITRARY_MIN = -2147483648; + ARBITRARY_MAX = 2147483647; + }; + optional Arbitrary optional_arbitrary_lowfield = 10; + optional Arbitrary optional_arbitrary_midfield = 1010; + optional Arbitrary optional_arbitrary_hifield = 1000010; + repeated Arbitrary repeated_arbitrary_lowfield = 11; + repeated Arbitrary repeated_arbitrary_midfield = 1011; + repeated Arbitrary repeated_arbitrary_hifield = 1000011; + repeated Arbitrary packed_arbitrary_lowfield = 12 [packed = true]; + repeated Arbitrary packed_arbitrary_midfield = 1012 [packed = true]; + repeated Arbitrary packed_arbitrary_hifield = 1000012 [packed = true]; + + extensions 2000000 to max; + extend EnumParseTester { + optional Arbitrary optional_arbitrary_ext = 2000000; + repeated Arbitrary repeated_arbitrary_ext = 2000001; + repeated Arbitrary packed_arbitrary_ext = 2000002 [packed = true]; + } + + // An arbitrary field we can append to to break the runs of repeated fields. + optional int32 other_field = 99; +} + +// This message contains different kind of bool fields to exercise the different +// parsers in table-drived. +message BoolParseTester { + optional bool optional_bool_lowfield = 1; + optional bool optional_bool_midfield = 1001; + optional bool optional_bool_hifield = 1000001; + repeated bool repeated_bool_lowfield = 2; + repeated bool repeated_bool_midfield = 1002; + repeated bool repeated_bool_hifield = 1000002; + repeated bool packed_bool_lowfield = 3 [packed = true]; + repeated bool packed_bool_midfield = 1003 [packed = true]; + repeated bool packed_bool_hifield = 1000003 [packed = true]; + + extensions 2000000 to max; + extend BoolParseTester { + optional bool optional_bool_ext = 2000000; + repeated bool repeated_bool_ext = 2000001; + repeated bool packed_bool_ext = 2000002 [packed = true]; + } + + // An arbitrary field we can append to to break the runs of repeated fields. + optional int32 other_field = 99; +} + +message Int32ParseTester { + optional int32 optional_int32_lowfield = 1; + optional int32 optional_int32_midfield = 1001; + optional int32 optional_int32_hifield = 1000001; + repeated int32 repeated_int32_lowfield = 2; + repeated int32 repeated_int32_midfield = 1002; + repeated int32 repeated_int32_hifield = 1000002; + repeated int32 packed_int32_lowfield = 3 [packed = true]; + repeated int32 packed_int32_midfield = 1003 [packed = true]; + repeated int32 packed_int32_hifield = 1000003 [packed = true]; + + extensions 2000000 to max; + extend Int32ParseTester { + optional int32 optional_int32_ext = 2000000; + repeated int32 repeated_int32_ext = 2000001; + repeated int32 packed_int32_ext = 2000002 [packed = true]; + } + + // An arbitrary field we can append to to break the runs of repeated fields. + optional int32 other_field = 99; +} + +message Int64ParseTester { + optional int64 optional_int64_lowfield = 1; + optional int64 optional_int64_midfield = 1001; + optional int64 optional_int64_hifield = 1000001; + repeated int64 repeated_int64_lowfield = 2; + repeated int64 repeated_int64_midfield = 1002; + repeated int64 repeated_int64_hifield = 1000002; + repeated int64 packed_int64_lowfield = 3 [packed = true]; + repeated int64 packed_int64_midfield = 1003 [packed = true]; + repeated int64 packed_int64_hifield = 1000003 [packed = true]; + + extensions 2000000 to max; + extend Int64ParseTester { + optional int64 optional_int64_ext = 2000000; + repeated int64 repeated_int64_ext = 2000001; + repeated int64 packed_int64_ext = 2000002 [packed = true]; + } + + // An arbitrary field we can append to to break the runs of repeated fields. + optional int32 other_field = 99; +} + +message InlinedStringIdxRegressionProto { + // We mix data to make sure aux ids and inlined string idx do not match. + // aux_idx == inlined_string_idx == 1 + optional string str1 = 1; + // aux_idx == 2 + optional InlinedStringIdxRegressionProto sub = 2; + // aux_idx == 3, inlined_string_idx == 2 + optional string str2 = 3; + // aux_idx == 4, inlined_string_idx == 3 + optional bytes str3 = 4; +} + +message StringParseTester { + optional string optional_string_lowfield = 1; + optional string optional_string_midfield = 1001; + optional string optional_string_hifield = 1000001; + repeated string repeated_string_lowfield = 2; + repeated string repeated_string_midfield = 1002; + repeated string repeated_string_hifield = 1000002; + + extensions 2000000 to max; + extend StringParseTester { + optional string optional_string_ext = 2000000; + repeated string repeated_string_ext = 2000001; + } +} + +message BadFieldNames{ + optional int32 OptionalInt32 = 1; + optional int32 for = 2; +} + +message TestNestedMessageRedaction { + optional string optional_unredacted_nested_string = 1; + optional string optional_redacted_nested_string = 2 [debug_redact = true]; +} + +message RedactedFields { + optional string optional_redacted_string = 1 [debug_redact = true]; + optional string optional_unredacted_string = 2; + repeated string repeated_redacted_string = 3 [debug_redact = true]; + repeated string repeated_unredacted_string = 4; + optional TestNestedMessageRedaction optional_redacted_message = 5 [debug_redact = true]; + optional TestNestedMessageRedaction optional_unredacted_message = 6; + repeated TestNestedMessageRedaction repeated_redacted_message = 7 + [debug_redact = true]; + repeated TestNestedMessageRedaction repeated_unredacted_message = 8; + map map_redacted_string = 9 [debug_redact = true]; + map map_unredacted_string = 10; +} + +message TestCord{ + optional bytes optional_bytes_cord = 1 [ctype=CORD]; + optional bytes optional_bytes_cord_default = 2 [ctype=CORD, default = "hello"]; +} + +message TestPackedEnumSmallRange { + enum NestedEnum { + UNSPECIFIED = 0; + FOO = 1; + BAR = 2; + BAZ = 3; + } + repeated NestedEnum vals = 1 [packed = true]; +} diff --git a/Protos/google/protobuf/unittest_arena.proto b/Protos/SwiftProtobufTests/unittest_arena.proto similarity index 100% rename from Protos/google/protobuf/unittest_arena.proto rename to Protos/SwiftProtobufTests/unittest_arena.proto diff --git a/Protos/google/protobuf/unittest_custom_options.proto b/Protos/SwiftProtobufTests/unittest_custom_options.proto similarity index 100% rename from Protos/google/protobuf/unittest_custom_options.proto rename to Protos/SwiftProtobufTests/unittest_custom_options.proto diff --git a/Protos/google/protobuf/unittest_drop_unknown_fields.proto b/Protos/SwiftProtobufTests/unittest_drop_unknown_fields.proto similarity index 100% rename from Protos/google/protobuf/unittest_drop_unknown_fields.proto rename to Protos/SwiftProtobufTests/unittest_drop_unknown_fields.proto diff --git a/Protos/SwiftProtobufTests/unittest_embed_optimize_for.proto b/Protos/SwiftProtobufTests/unittest_embed_optimize_for.proto new file mode 100644 index 000000000..9dc139296 --- /dev/null +++ b/Protos/SwiftProtobufTests/unittest_embed_optimize_for.proto @@ -0,0 +1,52 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// A proto file which imports a proto file that uses optimize_for = CODE_SIZE. + +syntax = "proto2"; + +package protobuf_unittest; + +import "unittest_optimize_for.proto"; + +// We optimize for speed here, but we are importing a proto that is optimized +// for code size. +option optimize_for = SPEED; + +message TestEmbedOptimizedForSize { + // Test that embedding a message which has optimize_for = CODE_SIZE into + // one optimized for speed works. + optional TestOptimizedForSize optional_message = 1; + repeated TestOptimizedForSize repeated_message = 2; +} diff --git a/Protos/google/protobuf/unittest_empty.proto b/Protos/SwiftProtobufTests/unittest_empty.proto similarity index 100% rename from Protos/google/protobuf/unittest_empty.proto rename to Protos/SwiftProtobufTests/unittest_empty.proto diff --git a/Protos/SwiftProtobufTests/unittest_import.proto b/Protos/SwiftProtobufTests/unittest_import.proto new file mode 100644 index 000000000..54b7ff404 --- /dev/null +++ b/Protos/SwiftProtobufTests/unittest_import.proto @@ -0,0 +1,72 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// A proto file which is imported by unittest.proto to test importing. + +syntax = "proto2"; + +// We don't put this in a package within proto2 because we need to make sure +// that the generated code doesn't depend on being in the proto2 namespace. +// In test_util.h we do +// "using namespace unittest_import = protobuf_unittest_import". +package protobuf_unittest_import; + +option optimize_for = SPEED; +option cc_enable_arenas = true; + +// Exercise the java_package option. +option java_package = "com.google.protobuf.test"; + +// Do not set a java_outer_classname here to verify that Proto2 works without +// one. + +// Test public import +import public "unittest_import_public.proto"; + +message ImportMessage { + optional int32 d = 1; +} + +enum ImportEnum { + IMPORT_FOO = 7; + IMPORT_BAR = 8; + IMPORT_BAZ = 9; +} + +// To use an enum in a map, it must has the first value as 0. +enum ImportEnumForMap { + UNKNOWN = 0; + FOO = 1; + BAR = 2; +} diff --git a/Protos/SwiftProtobufTests/unittest_import_lite.proto b/Protos/SwiftProtobufTests/unittest_import_lite.proto new file mode 100644 index 000000000..8eef563e3 --- /dev/null +++ b/Protos/SwiftProtobufTests/unittest_import_lite.proto @@ -0,0 +1,52 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// +// This is like unittest_import.proto but with optimize_for = LITE_RUNTIME. + +syntax = "proto2"; + +package protobuf_unittest_import; + +import public "unittest_import_public_lite.proto"; + +option optimize_for = LITE_RUNTIME; +option java_package = "com.google.protobuf"; + +message ImportMessageLite { + optional int32 d = 1; +} + +enum ImportEnumLite { + IMPORT_LITE_FOO = 7; + IMPORT_LITE_BAR = 8; + IMPORT_LITE_BAZ = 9; +} diff --git a/Protos/google/protobuf/unittest_import_public.proto b/Protos/SwiftProtobufTests/unittest_import_public.proto similarity index 100% rename from Protos/google/protobuf/unittest_import_public.proto rename to Protos/SwiftProtobufTests/unittest_import_public.proto diff --git a/Protos/google/protobuf/unittest_import_public_lite.proto b/Protos/SwiftProtobufTests/unittest_import_public_lite.proto similarity index 100% rename from Protos/google/protobuf/unittest_import_public_lite.proto rename to Protos/SwiftProtobufTests/unittest_import_public_lite.proto diff --git a/Protos/SwiftProtobufTests/unittest_lite.proto b/Protos/SwiftProtobufTests/unittest_lite.proto new file mode 100644 index 000000000..9d0f3a4d2 --- /dev/null +++ b/Protos/SwiftProtobufTests/unittest_lite.proto @@ -0,0 +1,525 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// +// This is like unittest.proto but with optimize_for = LITE_RUNTIME. + +syntax = "proto2"; + +package protobuf_unittest; + +import "unittest_import_lite.proto"; + +option cc_enable_arenas = true; +option optimize_for = LITE_RUNTIME; +option java_package = "com.google.protobuf"; + +// Same as TestAllTypes but with the lite runtime. +message TestAllTypesLite { + message NestedMessage { + optional int32 bb = 1; + optional int64 cc = 2; + repeated int32 dd = 3 [packed = true]; + } + + message NestedMessage2 { + optional int32 dd = 1; + } + + enum NestedEnum { + FOO = 1; + BAR = 2; + BAZ = 3; + } + + // Singular + optional int32 optional_int32 = 1; + optional int64 optional_int64 = 2; + optional uint32 optional_uint32 = 3; + optional uint64 optional_uint64 = 4; + optional sint32 optional_sint32 = 5; + optional sint64 optional_sint64 = 6; + optional fixed32 optional_fixed32 = 7; + optional fixed64 optional_fixed64 = 8; + optional sfixed32 optional_sfixed32 = 9; + optional sfixed64 optional_sfixed64 = 10; + optional float optional_float = 11; + optional double optional_double = 12; + optional bool optional_bool = 13; + optional string optional_string = 14; + optional bytes optional_bytes = 15; + + optional group OptionalGroup = 16 { + optional int32 a = 17; + } + + optional NestedMessage optional_nested_message = 18; + optional ForeignMessageLite optional_foreign_message = 19; + optional protobuf_unittest_import.ImportMessageLite optional_import_message = + 20; + + optional NestedEnum optional_nested_enum = 21; + optional ForeignEnumLite optional_foreign_enum = 22; + optional protobuf_unittest_import.ImportEnumLite optional_import_enum = 23; + + optional string optional_string_piece = 24 [ctype = STRING_PIECE]; + optional string optional_cord = 25 [ctype = CORD]; + + // Defined in unittest_import_public.proto + optional protobuf_unittest_import.PublicImportMessageLite + optional_public_import_message = 26; + + optional NestedMessage optional_lazy_message = 27 [lazy = true]; + optional NestedMessage optional_unverified_lazy_message = 28 + [unverified_lazy = true]; + + // Repeated + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; + repeated sfixed32 repeated_sfixed32 = 39; + repeated sfixed64 repeated_sfixed64 = 40; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; + + repeated group RepeatedGroup = 46 { + optional int32 a = 47; + } + + repeated NestedMessage repeated_nested_message = 48; + repeated ForeignMessageLite repeated_foreign_message = 49; + repeated protobuf_unittest_import.ImportMessageLite repeated_import_message = + 50; + + repeated NestedEnum repeated_nested_enum = 51; + repeated ForeignEnumLite repeated_foreign_enum = 52; + repeated protobuf_unittest_import.ImportEnumLite repeated_import_enum = 53; + + repeated string repeated_string_piece = 54 [ctype = STRING_PIECE]; + repeated string repeated_cord = 55 [ctype = CORD]; + + repeated NestedMessage repeated_lazy_message = 57 [lazy = true]; + + // Singular with defaults + optional int32 default_int32 = 61 [default = 41]; + optional int64 default_int64 = 62 [default = 42]; + optional uint32 default_uint32 = 63 [default = 43]; + optional uint64 default_uint64 = 64 [default = 44]; + optional sint32 default_sint32 = 65 [default = -45]; + optional sint64 default_sint64 = 66 [default = 46]; + optional fixed32 default_fixed32 = 67 [default = 47]; + optional fixed64 default_fixed64 = 68 [default = 48]; + optional sfixed32 default_sfixed32 = 69 [default = 49]; + optional sfixed64 default_sfixed64 = 70 [default = -50]; + optional float default_float = 71 [default = 51.5]; + optional double default_double = 72 [default = 52e3]; + optional bool default_bool = 73 [default = true]; + optional string default_string = 74 [default = "hello"]; + optional bytes default_bytes = 75 [default = "world"]; + + optional NestedEnum default_nested_enum = 81 [default = BAR]; + optional ForeignEnumLite default_foreign_enum = 82 + [default = FOREIGN_LITE_BAR]; + optional protobuf_unittest_import.ImportEnumLite default_import_enum = 83 + [default = IMPORT_LITE_BAR]; + + optional string default_string_piece = 84 + [ctype = STRING_PIECE, default = "abc"]; + optional string default_cord = 85 [ctype = CORD, default = "123"]; + + // For oneof test + oneof oneof_field { + uint32 oneof_uint32 = 111; + NestedMessage oneof_nested_message = 112; + string oneof_string = 113; + bytes oneof_bytes = 114; + NestedMessage oneof_lazy_nested_message = 115 [lazy = true]; + NestedMessage2 oneof_nested_message2 = 117; + } + + // Tests toString for non-repeated fields with a list suffix + optional int32 deceptively_named_list = 116; +} + +message ForeignMessageLite { + optional int32 c = 1; +} + +enum ForeignEnumLite { + FOREIGN_LITE_FOO = 4; + FOREIGN_LITE_BAZ = 6; + FOREIGN_LITE_BAR = 5; +} + +message TestPackedTypesLite { + repeated int32 packed_int32 = 90 [packed = true]; + repeated int64 packed_int64 = 91 [packed = true]; + repeated uint32 packed_uint32 = 92 [packed = true]; + repeated uint64 packed_uint64 = 93 [packed = true]; + repeated sint32 packed_sint32 = 94 [packed = true]; + repeated sint64 packed_sint64 = 95 [packed = true]; + repeated fixed32 packed_fixed32 = 96 [packed = true]; + repeated fixed64 packed_fixed64 = 97 [packed = true]; + repeated sfixed32 packed_sfixed32 = 98 [packed = true]; + repeated sfixed64 packed_sfixed64 = 99 [packed = true]; + repeated float packed_float = 100 [packed = true]; + repeated double packed_double = 101 [packed = true]; + repeated bool packed_bool = 102 [packed = true]; + repeated ForeignEnumLite packed_enum = 103 [packed = true]; +} + +message TestAllExtensionsLite { + extensions 1 to max; +} + +extend TestAllExtensionsLite { + // Singular + optional int32 optional_int32_extension_lite = 1; + optional int64 optional_int64_extension_lite = 2; + optional uint32 optional_uint32_extension_lite = 3; + optional uint64 optional_uint64_extension_lite = 4; + optional sint32 optional_sint32_extension_lite = 5; + optional sint64 optional_sint64_extension_lite = 6; + optional fixed32 optional_fixed32_extension_lite = 7; + optional fixed64 optional_fixed64_extension_lite = 8; + optional sfixed32 optional_sfixed32_extension_lite = 9; + optional sfixed64 optional_sfixed64_extension_lite = 10; + optional float optional_float_extension_lite = 11; + optional double optional_double_extension_lite = 12; + optional bool optional_bool_extension_lite = 13; + optional string optional_string_extension_lite = 14; + optional bytes optional_bytes_extension_lite = 15; + + optional group OptionalGroup_extension_lite = 16 { + optional int32 a = 17; + } + + optional TestAllTypesLite.NestedMessage + optional_nested_message_extension_lite = 18; + optional ForeignMessageLite optional_foreign_message_extension_lite = 19; + optional protobuf_unittest_import.ImportMessageLite + optional_import_message_extension_lite = 20; + + optional TestAllTypesLite.NestedEnum optional_nested_enum_extension_lite = 21; + optional ForeignEnumLite optional_foreign_enum_extension_lite = 22; + optional protobuf_unittest_import.ImportEnumLite + optional_import_enum_extension_lite = 23; + + optional string optional_string_piece_extension_lite = 24 + [ctype = STRING_PIECE]; + optional string optional_cord_extension_lite = 25 [ctype = CORD]; + + optional protobuf_unittest_import.PublicImportMessageLite + optional_public_import_message_extension_lite = 26; + + optional TestAllTypesLite.NestedMessage optional_lazy_message_extension_lite = + 27 [lazy = true]; + optional TestAllTypesLite.NestedMessage + optional_unverified_lazy_message_extension_lite = 28 + [unverified_lazy = true]; + + // Repeated + repeated int32 repeated_int32_extension_lite = 31; + repeated int64 repeated_int64_extension_lite = 32; + repeated uint32 repeated_uint32_extension_lite = 33; + repeated uint64 repeated_uint64_extension_lite = 34; + repeated sint32 repeated_sint32_extension_lite = 35; + repeated sint64 repeated_sint64_extension_lite = 36; + repeated fixed32 repeated_fixed32_extension_lite = 37; + repeated fixed64 repeated_fixed64_extension_lite = 38; + repeated sfixed32 repeated_sfixed32_extension_lite = 39; + repeated sfixed64 repeated_sfixed64_extension_lite = 40; + repeated float repeated_float_extension_lite = 41; + repeated double repeated_double_extension_lite = 42; + repeated bool repeated_bool_extension_lite = 43; + repeated string repeated_string_extension_lite = 44; + repeated bytes repeated_bytes_extension_lite = 45; + + repeated group RepeatedGroup_extension_lite = 46 { + optional int32 a = 47; + } + + repeated TestAllTypesLite.NestedMessage + repeated_nested_message_extension_lite = 48; + repeated ForeignMessageLite repeated_foreign_message_extension_lite = 49; + repeated protobuf_unittest_import.ImportMessageLite + repeated_import_message_extension_lite = 50; + + repeated TestAllTypesLite.NestedEnum repeated_nested_enum_extension_lite = 51; + repeated ForeignEnumLite repeated_foreign_enum_extension_lite = 52; + repeated protobuf_unittest_import.ImportEnumLite + repeated_import_enum_extension_lite = 53; + + repeated string repeated_string_piece_extension_lite = 54 + [ctype = STRING_PIECE]; + repeated string repeated_cord_extension_lite = 55 [ctype = CORD]; + + repeated TestAllTypesLite.NestedMessage repeated_lazy_message_extension_lite = + 57 [lazy = true]; + + // Singular with defaults + optional int32 default_int32_extension_lite = 61 [default = 41]; + optional int64 default_int64_extension_lite = 62 [default = 42]; + optional uint32 default_uint32_extension_lite = 63 [default = 43]; + optional uint64 default_uint64_extension_lite = 64 [default = 44]; + optional sint32 default_sint32_extension_lite = 65 [default = -45]; + optional sint64 default_sint64_extension_lite = 66 [default = 46]; + optional fixed32 default_fixed32_extension_lite = 67 [default = 47]; + optional fixed64 default_fixed64_extension_lite = 68 [default = 48]; + optional sfixed32 default_sfixed32_extension_lite = 69 [default = 49]; + optional sfixed64 default_sfixed64_extension_lite = 70 [default = -50]; + optional float default_float_extension_lite = 71 [default = 51.5]; + optional double default_double_extension_lite = 72 [default = 52e3]; + optional bool default_bool_extension_lite = 73 [default = true]; + optional string default_string_extension_lite = 74 [default = "hello"]; + optional bytes default_bytes_extension_lite = 75 [default = "world"]; + + optional TestAllTypesLite.NestedEnum default_nested_enum_extension_lite = 81 + [default = BAR]; + optional ForeignEnumLite default_foreign_enum_extension_lite = 82 + [default = FOREIGN_LITE_BAR]; + optional protobuf_unittest_import.ImportEnumLite + default_import_enum_extension_lite = 83 [default = IMPORT_LITE_BAR]; + + optional string default_string_piece_extension_lite = 84 + [ctype = STRING_PIECE, default = "abc"]; + optional string default_cord_extension_lite = 85 + [ctype = CORD, default = "123"]; + + // For oneof test + optional uint32 oneof_uint32_extension_lite = 111; + optional TestAllTypesLite.NestedMessage oneof_nested_message_extension_lite = + 112; + optional string oneof_string_extension_lite = 113; + optional bytes oneof_bytes_extension_lite = 114; +} + +message TestPackedExtensionsLite { + extensions 1 to max; +} + +extend TestPackedExtensionsLite { + repeated int32 packed_int32_extension_lite = 90 [packed = true]; + repeated int64 packed_int64_extension_lite = 91 [packed = true]; + repeated uint32 packed_uint32_extension_lite = 92 [packed = true]; + repeated uint64 packed_uint64_extension_lite = 93 [packed = true]; + repeated sint32 packed_sint32_extension_lite = 94 [packed = true]; + repeated sint64 packed_sint64_extension_lite = 95 [packed = true]; + repeated fixed32 packed_fixed32_extension_lite = 96 [packed = true]; + repeated fixed64 packed_fixed64_extension_lite = 97 [packed = true]; + repeated sfixed32 packed_sfixed32_extension_lite = 98 [packed = true]; + repeated sfixed64 packed_sfixed64_extension_lite = 99 [packed = true]; + repeated float packed_float_extension_lite = 100 [packed = true]; + repeated double packed_double_extension_lite = 101 [packed = true]; + repeated bool packed_bool_extension_lite = 102 [packed = true]; + repeated ForeignEnumLite packed_enum_extension_lite = 103 [packed = true]; +} + +message TestNestedExtensionLite { + extend TestAllExtensionsLite { + optional int32 nested_extension = 12345; + } +} + +// Test that deprecated fields work. We only verify that they compile (at one +// point this failed). +message TestDeprecatedLite { + optional int32 deprecated_field = 1 [deprecated = true]; + required int32 deprecated_field2 = 2 [deprecated = true]; + optional string deprecated_field3 = 3 [deprecated = true]; + optional TestDeprecatedLite deprecated_field4 = 4 [deprecated = true]; +} + +// See the comments of the same type in unittest.proto. +message TestParsingMergeLite { + message RepeatedFieldsGenerator { + repeated TestAllTypesLite field1 = 1; + repeated TestAllTypesLite field2 = 2; + repeated TestAllTypesLite field3 = 3; + repeated group Group1 = 10 { + optional TestAllTypesLite field1 = 11; + } + repeated group Group2 = 20 { + optional TestAllTypesLite field1 = 21; + } + repeated TestAllTypesLite ext1 = 1000; + repeated TestAllTypesLite ext2 = 1001; + } + required TestAllTypesLite required_all_types = 1; + optional TestAllTypesLite optional_all_types = 2; + repeated TestAllTypesLite repeated_all_types = 3; + optional group OptionalGroup = 10 { + optional TestAllTypesLite optional_group_all_types = 11; + } + repeated group RepeatedGroup = 20 { + optional TestAllTypesLite repeated_group_all_types = 21; + } + extensions 1000 to max; + extend TestParsingMergeLite { + optional TestAllTypesLite optional_ext = 1000; + repeated TestAllTypesLite repeated_ext = 1001; + } +} + +// Test that the correct exception is thrown by parseFrom in a corner case +// involving merging, extensions, and required fields. +message TestMergeExceptionLite { + optional TestAllExtensionsLite all_extensions = 1; +} + +// TestEmptyMessageLite is used to test unknown fields support in lite mode. +message TestEmptyMessageLite {} + +// Like above, but declare all field numbers as potential extensions. No +// actual extensions should ever be defined for this type. +message TestEmptyMessageWithExtensionsLite { + extensions 1 to max; +} + +enum V1EnumLite { + V1_FIRST = 1; +} + +enum V2EnumLite { + V2_FIRST = 1; + V2_SECOND = 2; +} + +message V1MessageLite { + required int32 int_field = 1; + optional V1EnumLite enum_field = 2 [default = V1_FIRST]; +} + +message V2MessageLite { + required int32 int_field = 1; + optional V2EnumLite enum_field = 2 [default = V2_FIRST]; +} + +message TestHugeFieldNumbersLite { + optional int32 optional_int32 = 536870000; + optional int32 fixed_32 = 536870001; + repeated int32 repeated_int32 = 536870002 [packed = false]; + repeated int32 packed_int32 = 536870003 [packed = true]; + + optional ForeignEnumLite optional_enum = 536870004; + optional string optional_string = 536870005; + optional bytes optional_bytes = 536870006; + optional ForeignMessageLite optional_message = 536870007; + + optional group OptionalGroup = 536870008 { + optional int32 group_a = 536870009; + } + + map string_string_map = 536870010; + + oneof oneof_field { + uint32 oneof_uint32 = 536870011; + TestAllTypesLite oneof_test_all_types = 536870012; + string oneof_string = 536870013; + bytes oneof_bytes = 536870014; + } + + extensions 536860000 to 536869999 [declaration = { + number: 536860000 + full_name: ".protobuf_unittest.test_all_types_lite" + type: ".protobuf_unittest.TestAllTypesLite" + }]; +} + +extend TestHugeFieldNumbersLite { + optional TestAllTypesLite test_all_types_lite = 536860000; +} + +message TestOneofParsingLite { + oneof oneof_field { + int32 oneof_int32 = 1; + TestAllTypesLite oneof_submessage = 2; + string oneof_string = 3; + bytes oneof_bytes = 4 [default = "default bytes"]; + string oneof_string_cord = 5 [ctype = CORD, default = "default Cord"]; + bytes oneof_bytes_cord = 6 [ctype = CORD]; + string oneof_string_string_piece = 7 [ctype = STRING_PIECE]; + bytes oneof_bytes_string_piece = 8 + [ctype = STRING_PIECE, default = "default StringPiece"]; + V2EnumLite oneof_enum = 9; + } +} + +message TestMessageSetLite { + option message_set_wire_format = true; + + extensions 100 to max; +} + +// The following four messages are set up to test for wire compatibility between +// packed and non-packed repeated fields. We use the field number 2048, because +// that is large enough to require a 3-byte varint for the tag. +message PackedInt32 { + repeated int32 repeated_int32 = 2048 [packed = true]; +} + +message NonPackedInt32 { + repeated int32 repeated_int32 = 2048; +} + +message PackedFixed32 { + repeated fixed32 repeated_fixed32 = 2048 [packed = true]; +} + +message NonPackedFixed32 { + repeated fixed32 repeated_fixed32 = 2048; +} + +// Test an enum that has multiple values with the same number. +message DupEnum { + enum TestEnumWithDupValueLite { + option allow_alias = true; + + FOO1 = 1; + BAR1 = 2; + BAZ = 3; + FOO2 = 1; + BAR2 = 2; + } +} + +message RecursiveMessage { + optional RecursiveMessage recurse = 1; + optional bytes payload = 2; +} diff --git a/Protos/SwiftProtobufTests/unittest_lite_imports_nonlite.proto b/Protos/SwiftProtobufTests/unittest_lite_imports_nonlite.proto new file mode 100644 index 000000000..9041df682 --- /dev/null +++ b/Protos/SwiftProtobufTests/unittest_lite_imports_nonlite.proto @@ -0,0 +1,48 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// +// Tests that a "lite" message can import a regular message. + +syntax = "proto2"; + +package protobuf_unittest; + +import "unittest.proto"; + +option optimize_for = LITE_RUNTIME; + +message TestLiteImportsNonlite { + optional TestAllTypes message = 1; + + // Verifies that transitive required fields generates valid code. + optional TestRequired message_with_required = 2; +} diff --git a/Protos/SwiftProtobufTests/unittest_mset.proto b/Protos/SwiftProtobufTests/unittest_mset.proto new file mode 100644 index 000000000..090870f74 --- /dev/null +++ b/Protos/SwiftProtobufTests/unittest_mset.proto @@ -0,0 +1,103 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// This file is similar to unittest_mset_wire_format.proto, but does not +// have a TestMessageSet, so it can be downgraded to proto1. + +syntax = "proto2"; + +import "unittest_mset_wire_format.proto"; + +package protobuf_unittest; + +option cc_enable_arenas = true; +option optimize_for = SPEED; + +message TestMessageSetContainer { + optional proto2_wireformat_unittest.TestMessageSet message_set = 1; +} + +message NestedTestMessageSetContainer { + optional TestMessageSetContainer container = 1; + optional NestedTestMessageSetContainer child = 2; +} + +message NestedTestInt { + optional fixed32 a = 1; + optional int32 b = 3; + optional NestedTestInt child = 2; +} + +message TestMessageSetExtension1 { + extend proto2_wireformat_unittest.TestMessageSet { + optional TestMessageSetExtension1 message_set_extension = 1545008; + } + optional int32 i = 15; + optional proto2_wireformat_unittest.TestMessageSet recursive = 16; + optional string test_aliasing = 17 [ctype = STRING_PIECE]; +} + +message TestMessageSetExtension2 { + extend proto2_wireformat_unittest.TestMessageSet { + optional TestMessageSetExtension2 message_set_extension = 1547769; + } + optional string str = 25; +} + +message TestMessageSetExtension3 { + extend proto2_wireformat_unittest.TestMessageSet { + optional TestMessageSetExtension3 message_set_extension = 195273129; + } + optional NestedTestInt msg = 35; + required int32 required_int = 36; +} + +// This message was used to generate +// //net/proto2/python/internal/testdata/message_set_message, but is commented +// out since it must not actually exist in code, to simulate an "unknown" +// extension. +// message TestMessageSetUnknownExtension { +// extend TestMessageSet { +// optional TestMessageSetUnknownExtension message_set_extension = 56141421; +// } +// optional int64 a = 1; +// } + +// MessageSet wire format is equivalent to this. +message RawMessageSet { + repeated group Item = 1 { + required int32 type_id = 2; + required bytes message = 3; + } +} diff --git a/Protos/google/protobuf/unittest_mset_wire_format.proto b/Protos/SwiftProtobufTests/unittest_mset_wire_format.proto similarity index 100% rename from Protos/google/protobuf/unittest_mset_wire_format.proto rename to Protos/SwiftProtobufTests/unittest_mset_wire_format.proto diff --git a/Protos/SwiftProtobufTests/unittest_no_field_presence.proto b/Protos/SwiftProtobufTests/unittest_no_field_presence.proto new file mode 100644 index 000000000..86f743836 --- /dev/null +++ b/Protos/SwiftProtobufTests/unittest_no_field_presence.proto @@ -0,0 +1,139 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// A proto file used to test a message type with no explicit field presence. + +syntax = "proto3"; + +// We want to test embedded proto2 messages, so include some proto2 types. +package proto2_nofieldpresence_unittest; + +import "unittest.proto"; + +// This proto includes every type of field in both singular and repeated +// forms. +message TestAllTypes { + message NestedMessage { + int32 bb = 1; + } + + enum NestedEnum { + FOO = 0; + BAR = 1; + BAZ = 2; + } + + // Singular + // TODO: remove 'optional' labels as soon as CL 69188077 is LGTM'd to make + // 'optional' optional. + int32 optional_int32 = 1; + int64 optional_int64 = 2; + uint32 optional_uint32 = 3; + uint64 optional_uint64 = 4; + sint32 optional_sint32 = 5; + sint64 optional_sint64 = 6; + fixed32 optional_fixed32 = 7; + fixed64 optional_fixed64 = 8; + sfixed32 optional_sfixed32 = 9; + sfixed64 optional_sfixed64 = 10; + float optional_float = 11; + double optional_double = 12; + bool optional_bool = 13; + string optional_string = 14; + bytes optional_bytes = 15; + + NestedMessage optional_nested_message = 18; + ForeignMessage optional_foreign_message = 19; + protobuf_unittest.TestAllTypes optional_proto2_message = 20; + + NestedEnum optional_nested_enum = 21; + ForeignEnum optional_foreign_enum = 22; + // N.B.: proto2-enum-type fields not allowed, because their default values + // might not be zero. + // optional protobuf_unittest.ForeignEnum optional_proto2_enum = + // 23; + + string optional_string_piece = 24 [ctype = STRING_PIECE]; + string optional_cord = 25 [ctype = CORD]; + + NestedMessage optional_lazy_message = 30 [lazy = true]; + + // Repeated + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; + repeated sfixed32 repeated_sfixed32 = 39; + repeated sfixed64 repeated_sfixed64 = 40; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; + + repeated NestedMessage repeated_nested_message = 48; + repeated ForeignMessage repeated_foreign_message = 49; + repeated protobuf_unittest.TestAllTypes repeated_proto2_message = 50; + + repeated NestedEnum repeated_nested_enum = 51; + repeated ForeignEnum repeated_foreign_enum = 52; + + repeated string repeated_string_piece = 54 [ctype = STRING_PIECE]; + repeated string repeated_cord = 55 [ctype = CORD]; + + repeated NestedMessage repeated_lazy_message = 57 [lazy = true]; + + oneof oneof_field { + uint32 oneof_uint32 = 111; + NestedMessage oneof_nested_message = 112; + string oneof_string = 113; + NestedEnum oneof_enum = 114; + } +} + +message TestProto2Required { + protobuf_unittest.TestRequired proto2 = 1; +} + +// Define these after TestAllTypes to make sure the compiler can handle +// that. +message ForeignMessage { + int32 c = 1; +} + +enum ForeignEnum { + FOREIGN_FOO = 0; + FOREIGN_BAR = 1; + FOREIGN_BAZ = 2; +} diff --git a/Protos/google/protobuf/unittest_no_generic_services.proto b/Protos/SwiftProtobufTests/unittest_no_generic_services.proto similarity index 100% rename from Protos/google/protobuf/unittest_no_generic_services.proto rename to Protos/SwiftProtobufTests/unittest_no_generic_services.proto diff --git a/Protos/SwiftProtobufTests/unittest_optimize_for.proto b/Protos/SwiftProtobufTests/unittest_optimize_for.proto new file mode 100644 index 000000000..d9a47da6c --- /dev/null +++ b/Protos/SwiftProtobufTests/unittest_optimize_for.proto @@ -0,0 +1,68 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// A proto file which uses optimize_for = CODE_SIZE. + +syntax = "proto2"; + +package protobuf_unittest; + +import "unittest.proto"; + +option optimize_for = CODE_SIZE; + +message TestOptimizedForSize { + optional int32 i = 1; + optional ForeignMessage msg = 19; + + extensions 1000 to max; + + extend TestOptimizedForSize { + optional int32 test_extension = 1234; + optional TestRequiredOptimizedForSize test_extension2 = 1235; + } + + oneof foo { + int32 integer_field = 2; + string string_field = 3; + } +} + +message TestRequiredOptimizedForSize { + required int32 x = 1; +} + +message TestOptionalOptimizedForSize { + optional TestRequiredOptimizedForSize o = 1; +} diff --git a/Protos/google/protobuf/unittest_preserve_unknown_enum.proto b/Protos/SwiftProtobufTests/unittest_preserve_unknown_enum.proto similarity index 100% rename from Protos/google/protobuf/unittest_preserve_unknown_enum.proto rename to Protos/SwiftProtobufTests/unittest_preserve_unknown_enum.proto diff --git a/Protos/google/protobuf/unittest_preserve_unknown_enum2.proto b/Protos/SwiftProtobufTests/unittest_preserve_unknown_enum2.proto similarity index 100% rename from Protos/google/protobuf/unittest_preserve_unknown_enum2.proto rename to Protos/SwiftProtobufTests/unittest_preserve_unknown_enum2.proto diff --git a/Protos/SwiftProtobufTests/unittest_proto3.proto b/Protos/SwiftProtobufTests/unittest_proto3.proto new file mode 100644 index 000000000..7e49d625e --- /dev/null +++ b/Protos/SwiftProtobufTests/unittest_proto3.proto @@ -0,0 +1,229 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package proto3_unittest; + +import "unittest_import.proto"; + +option optimize_for = SPEED; + +// This proto includes every type of field in both singular and repeated +// forms. +message TestAllTypes { + message NestedMessage { + // The field name "b" fails to compile in proto1 because it conflicts with + // a local variable named "b" in one of the generated methods. Doh. + // This file needs to compile in proto1 to test backwards-compatibility. + int32 bb = 1; + } + + enum NestedEnum { + ZERO = 0; + FOO = 1; + BAR = 2; + BAZ = 3; + NEG = -1; // Intentionally negative. + } + + // Singular + int32 optional_int32 = 1; + int64 optional_int64 = 2; + uint32 optional_uint32 = 3; + uint64 optional_uint64 = 4; + sint32 optional_sint32 = 5; + sint64 optional_sint64 = 6; + fixed32 optional_fixed32 = 7; + fixed64 optional_fixed64 = 8; + sfixed32 optional_sfixed32 = 9; + sfixed64 optional_sfixed64 = 10; + float optional_float = 11; + double optional_double = 12; + bool optional_bool = 13; + string optional_string = 14; + bytes optional_bytes = 15; + + // Groups are not allowed in proto3. + // optional group OptionalGroup = 16 { + // optional int32 a = 17; + // } + + optional NestedMessage optional_nested_message = 18; + ForeignMessage optional_foreign_message = 19; + protobuf_unittest_import.ImportMessage optional_import_message = 20; + + NestedEnum optional_nested_enum = 21; + ForeignEnum optional_foreign_enum = 22; + + // Omitted (compared to unittest.proto) because proto2 enums are not allowed + // inside proto2 messages. + // + // optional protobuf_unittest_import.ImportEnum optional_import_enum = 23; + + string optional_string_piece = 24 [ctype = STRING_PIECE]; + string optional_cord = 25 [ctype = CORD]; + + // Defined in unittest_import_public.proto + protobuf_unittest_import.PublicImportMessage optional_public_import_message = + 26; + + NestedMessage optional_lazy_message = 27 [lazy = true]; + NestedMessage optional_unverified_lazy_message = 28 [unverified_lazy = true]; + protobuf_unittest_import.ImportMessage optional_lazy_import_message = 115 + [lazy = true]; + + // Repeated + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; + repeated sfixed32 repeated_sfixed32 = 39; + repeated sfixed64 repeated_sfixed64 = 40; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; + + // Groups are not allowed in proto3. + // repeated group RepeatedGroup = 46 { + // optional int32 a = 47; + // } + + repeated NestedMessage repeated_nested_message = 48; + repeated ForeignMessage repeated_foreign_message = 49; + repeated protobuf_unittest_import.ImportMessage repeated_import_message = 50; + + repeated NestedEnum repeated_nested_enum = 51; + repeated ForeignEnum repeated_foreign_enum = 52; + + // Omitted (compared to unittest.proto) because proto2 enums are not allowed + // inside proto2 messages. + // + // repeated protobuf_unittest_import.ImportEnum repeated_import_enum = 53; + + repeated string repeated_string_piece = 54 [ctype = STRING_PIECE]; + repeated string repeated_cord = 55 [ctype = CORD]; + + repeated NestedMessage repeated_lazy_message = 57 [lazy = true]; + + oneof oneof_field { + uint32 oneof_uint32 = 111; + NestedMessage oneof_nested_message = 112; + string oneof_string = 113; + bytes oneof_bytes = 114; + } +} + +// Test messages for packed fields + +message TestPackedTypes { + repeated int32 packed_int32 = 90 [packed = true]; + repeated int64 packed_int64 = 91 [packed = true]; + repeated uint32 packed_uint32 = 92 [packed = true]; + repeated uint64 packed_uint64 = 93 [packed = true]; + repeated sint32 packed_sint32 = 94 [packed = true]; + repeated sint64 packed_sint64 = 95 [packed = true]; + repeated fixed32 packed_fixed32 = 96 [packed = true]; + repeated fixed64 packed_fixed64 = 97 [packed = true]; + repeated sfixed32 packed_sfixed32 = 98 [packed = true]; + repeated sfixed64 packed_sfixed64 = 99 [packed = true]; + repeated float packed_float = 100 [packed = true]; + repeated double packed_double = 101 [packed = true]; + repeated bool packed_bool = 102 [packed = true]; + repeated ForeignEnum packed_enum = 103 [packed = true]; +} + +// Explicitly set packed to false +message TestUnpackedTypes { + repeated int32 repeated_int32 = 1 [packed = false]; + repeated int64 repeated_int64 = 2 [packed = false]; + repeated uint32 repeated_uint32 = 3 [packed = false]; + repeated uint64 repeated_uint64 = 4 [packed = false]; + repeated sint32 repeated_sint32 = 5 [packed = false]; + repeated sint64 repeated_sint64 = 6 [packed = false]; + repeated fixed32 repeated_fixed32 = 7 [packed = false]; + repeated fixed64 repeated_fixed64 = 8 [packed = false]; + repeated sfixed32 repeated_sfixed32 = 9 [packed = false]; + repeated sfixed64 repeated_sfixed64 = 10 [packed = false]; + repeated float repeated_float = 11 [packed = false]; + repeated double repeated_double = 12 [packed = false]; + repeated bool repeated_bool = 13 [packed = false]; + repeated TestAllTypes.NestedEnum repeated_nested_enum = 14 [packed = false]; +} + +// This proto includes a recursively nested message. +message NestedTestAllTypes { + NestedTestAllTypes child = 1; + TestAllTypes payload = 2; +} + +// Define these after TestAllTypes to make sure the compiler can handle +// that. +message ForeignMessage { + int32 c = 1; +} + +enum ForeignEnum { + FOREIGN_ZERO = 0; + FOREIGN_FOO = 4; + FOREIGN_BAR = 5; + FOREIGN_BAZ = 6; +} + +// TestEmptyMessage is used to test behavior of unknown fields. +message TestEmptyMessage {} + +// TestMessageWithDummy is also used to test behavior of unknown fields. +message TestMessageWithDummy { + // This field is only here for triggering copy-on-write; it's not intended to + // be serialized. + bool dummy = 536870911; +} + +// Same layout as TestOneof2 in unittest.proto to test unknown enum value +// parsing behavior in oneof. +message TestOneof2 { + oneof foo { + NestedEnum foo_enum = 6; + } + + enum NestedEnum { + UNKNOWN = 0; + FOO = 1; + BAR = 2; + BAZ = 3; + } +} diff --git a/Protos/SwiftProtobufTests/unittest_proto3_arena.proto b/Protos/SwiftProtobufTests/unittest_proto3_arena.proto new file mode 100644 index 000000000..b099e3c3e --- /dev/null +++ b/Protos/SwiftProtobufTests/unittest_proto3_arena.proto @@ -0,0 +1,237 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +option cc_enable_arenas = true; + +import "unittest_import.proto"; + +package proto3_arena_unittest; + +// This proto includes every type of field in both singular and repeated +// forms. +message TestAllTypes { + message NestedMessage { + // The field name "b" fails to compile in proto1 because it conflicts with + // a local variable named "b" in one of the generated methods. Doh. + // This file needs to compile in proto1 to test backwards-compatibility. + int32 bb = 1; + } + + enum NestedEnum { + ZERO = 0; + FOO = 1; + BAR = 2; + BAZ = 3; + NEG = -1; // Intentionally negative. + } + + // Singular + int32 optional_int32 = 1; + int64 optional_int64 = 2; + uint32 optional_uint32 = 3; + uint64 optional_uint64 = 4; + sint32 optional_sint32 = 5; + sint64 optional_sint64 = 6; + fixed32 optional_fixed32 = 7; + fixed64 optional_fixed64 = 8; + sfixed32 optional_sfixed32 = 9; + sfixed64 optional_sfixed64 = 10; + float optional_float = 11; + double optional_double = 12; + bool optional_bool = 13; + string optional_string = 14; + bytes optional_bytes = 15; + + // Groups are not allowed in proto3. + // optional group OptionalGroup = 16 { + // optional int32 a = 17; + // } + + NestedMessage optional_nested_message = 18; + ForeignMessage optional_foreign_message = 19; + protobuf_unittest_import.ImportMessage optional_import_message = 20; + + NestedEnum optional_nested_enum = 21; + ForeignEnum optional_foreign_enum = 22; + + // Omitted (compared to unittest.proto) because proto2 enums are not allowed + // inside proto2 messages. + // + // optional protobuf_unittest_import.ImportEnum optional_import_enum = 23; + + string optional_string_piece = 24 [ctype=STRING_PIECE]; + string optional_cord = 25 [ctype=CORD]; + + // Defined in unittest_import_public.proto + protobuf_unittest_import.PublicImportMessage + optional_public_import_message = 26; + + NestedMessage optional_lazy_message = 27 [lazy=true]; + NestedMessage optional_unverified_lazy_message = 28 [unverified_lazy=true]; + protobuf_unittest_import.ImportMessage optional_lazy_import_message = 115 + [lazy = true]; + + // Repeated + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; + repeated sfixed32 repeated_sfixed32 = 39; + repeated sfixed64 repeated_sfixed64 = 40; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; + + // Optional + optional int32 proto3_optional_int32 = 116; + optional int64 proto3_optional_int64 = 117; + optional uint32 proto3_optional_uint32 = 118; + optional uint64 proto3_optional_uint64 = 119; + optional sint32 proto3_optional_sint32 = 120; + optional sint64 proto3_optional_sint64 = 121; + optional fixed32 proto3_optional_fixed32 = 122; + optional fixed64 proto3_optional_fixed64 = 123; + optional sfixed32 proto3_optional_sfixed32 = 124; + optional sfixed64 proto3_optional_sfixed64 = 125; + optional float proto3_optional_float = 126; + optional double proto3_optional_double = 127; + optional bool proto3_optional_bool = 128; + optional string proto3_optional_string = 129; + optional bytes proto3_optional_bytes = 130; + + // Groups are not allowed in proto3. + // repeated group RepeatedGroup = 46 { + // optional int32 a = 47; + // } + + repeated NestedMessage repeated_nested_message = 48; + repeated ForeignMessage repeated_foreign_message = 49; + repeated protobuf_unittest_import.ImportMessage repeated_import_message = 50; + + repeated NestedEnum repeated_nested_enum = 51; + repeated ForeignEnum repeated_foreign_enum = 52; + + // Omitted (compared to unittest.proto) because proto2 enums are not allowed + // inside proto2 messages. + // + // repeated protobuf_unittest_import.ImportEnum repeated_import_enum = 53; + + repeated string repeated_string_piece = 54 [ctype=STRING_PIECE]; + repeated string repeated_cord = 55 [ctype=CORD]; + + repeated NestedMessage repeated_lazy_message = 57 [lazy=true]; + + oneof oneof_field { + uint32 oneof_uint32 = 111; + NestedMessage oneof_nested_message = 112; + string oneof_string = 113; + bytes oneof_bytes = 114; + } +} + +// Test messages for packed fields + +message TestPackedTypes { + repeated int32 packed_int32 = 90 [packed = true]; + repeated int64 packed_int64 = 91 [packed = true]; + repeated uint32 packed_uint32 = 92 [packed = true]; + repeated uint64 packed_uint64 = 93 [packed = true]; + repeated sint32 packed_sint32 = 94 [packed = true]; + repeated sint64 packed_sint64 = 95 [packed = true]; + repeated fixed32 packed_fixed32 = 96 [packed = true]; + repeated fixed64 packed_fixed64 = 97 [packed = true]; + repeated sfixed32 packed_sfixed32 = 98 [packed = true]; + repeated sfixed64 packed_sfixed64 = 99 [packed = true]; + repeated float packed_float = 100 [packed = true]; + repeated double packed_double = 101 [packed = true]; + repeated bool packed_bool = 102 [packed = true]; + repeated ForeignEnum packed_enum = 103 [packed = true]; +} + +// Explicitly set packed to false +message TestUnpackedTypes { + repeated int32 repeated_int32 = 1 [packed = false]; + repeated int64 repeated_int64 = 2 [packed = false]; + repeated uint32 repeated_uint32 = 3 [packed = false]; + repeated uint64 repeated_uint64 = 4 [packed = false]; + repeated sint32 repeated_sint32 = 5 [packed = false]; + repeated sint64 repeated_sint64 = 6 [packed = false]; + repeated fixed32 repeated_fixed32 = 7 [packed = false]; + repeated fixed64 repeated_fixed64 = 8 [packed = false]; + repeated sfixed32 repeated_sfixed32 = 9 [packed = false]; + repeated sfixed64 repeated_sfixed64 = 10 [packed = false]; + repeated float repeated_float = 11 [packed = false]; + repeated double repeated_double = 12 [packed = false]; + repeated bool repeated_bool = 13 [packed = false]; + repeated TestAllTypes.NestedEnum repeated_nested_enum = 14 [packed = false]; +} + +// This proto includes a recursively nested message. +message NestedTestAllTypes { + NestedTestAllTypes child = 1; + TestAllTypes payload = 2; + repeated NestedTestAllTypes repeated_child = 3; + TestAllTypes lazy_payload = 4 [lazy = true]; +} + +// Define these after TestAllTypes to make sure the compiler can handle +// that. +message ForeignMessage { + int32 c = 1; +} + +enum ForeignEnum { + FOREIGN_ZERO = 0; + FOREIGN_FOO = 4; + FOREIGN_BAR = 5; + FOREIGN_BAZ = 6; +} + +// TestEmptyMessage is used to test behavior of unknown fields. +message TestEmptyMessage { +} + +// Needed for a Python test. +message TestPickleNestedMessage { + message NestedMessage { + int32 bb = 1; + message NestedNestedMessage { + int32 cc = 1; + } + } +} diff --git a/Protos/google/protobuf/unittest_proto3_optional.proto b/Protos/SwiftProtobufTests/unittest_proto3_optional.proto similarity index 100% rename from Protos/google/protobuf/unittest_proto3_optional.proto rename to Protos/SwiftProtobufTests/unittest_proto3_optional.proto diff --git a/Protos/unittest_swift_all_required_types.proto b/Protos/SwiftProtobufTests/unittest_swift_all_required_types.proto similarity index 98% rename from Protos/unittest_swift_all_required_types.proto rename to Protos/SwiftProtobufTests/unittest_swift_all_required_types.proto index 47e0860dc..f19175d46 100644 --- a/Protos/unittest_swift_all_required_types.proto +++ b/Protos/SwiftProtobufTests/unittest_swift_all_required_types.proto @@ -31,8 +31,8 @@ // An addition to unittest.proto syntax = "proto2"; -import "google/protobuf/unittest_import.proto"; -import "google/protobuf/unittest.proto"; +import "unittest_import.proto"; +import "unittest.proto"; package protobuf_unittest; @@ -137,4 +137,4 @@ message TestSomeRequiredTypes { required bytes required_bytes = 5; required NestedEnum required_nested_enum = 6; -} \ No newline at end of file +} diff --git a/Protos/unittest_swift_cycle.proto b/Protos/SwiftProtobufTests/unittest_swift_cycle.proto similarity index 100% rename from Protos/unittest_swift_cycle.proto rename to Protos/SwiftProtobufTests/unittest_swift_cycle.proto diff --git a/Protos/unittest_swift_enum.proto b/Protos/SwiftProtobufTests/unittest_swift_enum.proto similarity index 100% rename from Protos/unittest_swift_enum.proto rename to Protos/SwiftProtobufTests/unittest_swift_enum.proto diff --git a/Protos/unittest_swift_enum_optional_default.proto b/Protos/SwiftProtobufTests/unittest_swift_enum_optional_default.proto similarity index 100% rename from Protos/unittest_swift_enum_optional_default.proto rename to Protos/SwiftProtobufTests/unittest_swift_enum_optional_default.proto diff --git a/Protos/unittest_swift_enum_proto3.proto b/Protos/SwiftProtobufTests/unittest_swift_enum_proto3.proto similarity index 100% rename from Protos/unittest_swift_enum_proto3.proto rename to Protos/SwiftProtobufTests/unittest_swift_enum_proto3.proto diff --git a/Protos/unittest_swift_extension.proto b/Protos/SwiftProtobufTests/unittest_swift_extension.proto similarity index 100% rename from Protos/unittest_swift_extension.proto rename to Protos/SwiftProtobufTests/unittest_swift_extension.proto diff --git a/Protos/unittest_swift_extension2.proto b/Protos/SwiftProtobufTests/unittest_swift_extension2.proto similarity index 100% rename from Protos/unittest_swift_extension2.proto rename to Protos/SwiftProtobufTests/unittest_swift_extension2.proto diff --git a/Protos/unittest_swift_extension3.proto b/Protos/SwiftProtobufTests/unittest_swift_extension3.proto similarity index 100% rename from Protos/unittest_swift_extension3.proto rename to Protos/SwiftProtobufTests/unittest_swift_extension3.proto diff --git a/Protos/unittest_swift_extension4.proto b/Protos/SwiftProtobufTests/unittest_swift_extension4.proto similarity index 100% rename from Protos/unittest_swift_extension4.proto rename to Protos/SwiftProtobufTests/unittest_swift_extension4.proto diff --git a/Protos/unittest_swift_fieldorder.proto b/Protos/SwiftProtobufTests/unittest_swift_fieldorder.proto similarity index 100% rename from Protos/unittest_swift_fieldorder.proto rename to Protos/SwiftProtobufTests/unittest_swift_fieldorder.proto diff --git a/Protos/unittest_swift_groups.proto b/Protos/SwiftProtobufTests/unittest_swift_groups.proto similarity index 100% rename from Protos/unittest_swift_groups.proto rename to Protos/SwiftProtobufTests/unittest_swift_groups.proto diff --git a/Protos/unittest_swift_json.proto b/Protos/SwiftProtobufTests/unittest_swift_json.proto similarity index 100% rename from Protos/unittest_swift_json.proto rename to Protos/SwiftProtobufTests/unittest_swift_json.proto diff --git a/Protos/unittest_swift_naming.proto b/Protos/SwiftProtobufTests/unittest_swift_naming.proto similarity index 100% rename from Protos/unittest_swift_naming.proto rename to Protos/SwiftProtobufTests/unittest_swift_naming.proto diff --git a/Protos/unittest_swift_naming_no_prefix.proto b/Protos/SwiftProtobufTests/unittest_swift_naming_no_prefix.proto similarity index 100% rename from Protos/unittest_swift_naming_no_prefix.proto rename to Protos/SwiftProtobufTests/unittest_swift_naming_no_prefix.proto diff --git a/Protos/unittest_swift_naming_number_prefix.proto b/Protos/SwiftProtobufTests/unittest_swift_naming_number_prefix.proto similarity index 100% rename from Protos/unittest_swift_naming_number_prefix.proto rename to Protos/SwiftProtobufTests/unittest_swift_naming_number_prefix.proto diff --git a/Protos/unittest_swift_oneof_all_required.proto b/Protos/SwiftProtobufTests/unittest_swift_oneof_all_required.proto similarity index 100% rename from Protos/unittest_swift_oneof_all_required.proto rename to Protos/SwiftProtobufTests/unittest_swift_oneof_all_required.proto diff --git a/Protos/unittest_swift_oneof_merging.proto b/Protos/SwiftProtobufTests/unittest_swift_oneof_merging.proto similarity index 100% rename from Protos/unittest_swift_oneof_merging.proto rename to Protos/SwiftProtobufTests/unittest_swift_oneof_merging.proto diff --git a/Protos/unittest_swift_performance.proto b/Protos/SwiftProtobufTests/unittest_swift_performance.proto similarity index 100% rename from Protos/unittest_swift_performance.proto rename to Protos/SwiftProtobufTests/unittest_swift_performance.proto diff --git a/Protos/unittest_swift_reserved.proto b/Protos/SwiftProtobufTests/unittest_swift_reserved.proto similarity index 100% rename from Protos/unittest_swift_reserved.proto rename to Protos/SwiftProtobufTests/unittest_swift_reserved.proto diff --git a/Protos/unittest_swift_reserved_ext.proto b/Protos/SwiftProtobufTests/unittest_swift_reserved_ext.proto similarity index 100% rename from Protos/unittest_swift_reserved_ext.proto rename to Protos/SwiftProtobufTests/unittest_swift_reserved_ext.proto diff --git a/Protos/unittest_swift_runtime_proto2.proto b/Protos/SwiftProtobufTests/unittest_swift_runtime_proto2.proto similarity index 100% rename from Protos/unittest_swift_runtime_proto2.proto rename to Protos/SwiftProtobufTests/unittest_swift_runtime_proto2.proto diff --git a/Protos/unittest_swift_runtime_proto3.proto b/Protos/SwiftProtobufTests/unittest_swift_runtime_proto3.proto similarity index 100% rename from Protos/unittest_swift_runtime_proto3.proto rename to Protos/SwiftProtobufTests/unittest_swift_runtime_proto3.proto diff --git a/Protos/unittest_swift_startup.proto b/Protos/SwiftProtobufTests/unittest_swift_startup.proto similarity index 100% rename from Protos/unittest_swift_startup.proto rename to Protos/SwiftProtobufTests/unittest_swift_startup.proto diff --git a/Protos/google/protobuf/unittest_well_known_types.proto b/Protos/SwiftProtobufTests/unittest_well_known_types.proto similarity index 100% rename from Protos/google/protobuf/unittest_well_known_types.proto rename to Protos/SwiftProtobufTests/unittest_well_known_types.proto diff --git a/Protos/plugin_descriptor_test.proto b/Protos/protoc-gen-swiftTests/plugin_descriptor_test.proto similarity index 100% rename from Protos/plugin_descriptor_test.proto rename to Protos/protoc-gen-swiftTests/plugin_descriptor_test.proto diff --git a/Protos/upstream/conformance/conformance.proto b/Protos/upstream/conformance/conformance.proto new file mode 100644 index 000000000..bee04d160 --- /dev/null +++ b/Protos/upstream/conformance/conformance.proto @@ -0,0 +1,180 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package conformance; + +option java_package = "com.google.protobuf.conformance"; +option objc_class_prefix = "Conformance"; + +// This defines the conformance testing protocol. This protocol exists between +// the conformance test suite itself and the code being tested. For each test, +// the suite will send a ConformanceRequest message and expect a +// ConformanceResponse message. +// +// You can either run the tests in two different ways: +// +// 1. in-process (using the interface in conformance_test.h). +// +// 2. as a sub-process communicating over a pipe. Information about how to +// do this is in conformance_test_runner.cc. +// +// Pros/cons of the two approaches: +// +// - running as a sub-process is much simpler for languages other than C/C++. +// +// - running as a sub-process may be more tricky in unusual environments like +// iOS apps, where fork/stdin/stdout are not available. + +enum WireFormat { + UNSPECIFIED = 0; + PROTOBUF = 1; + JSON = 2; + JSPB = 3; // Only used inside Google. Opensource testees just skip it. + TEXT_FORMAT = 4; +} + +enum TestCategory { + UNSPECIFIED_TEST = 0; + BINARY_TEST = 1; // Test binary wire format. + JSON_TEST = 2; // Test json wire format. + // 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 = 3; + // Test jspb wire format. Only used inside Google. Opensource testees just + // skip it. + JSPB_TEST = 4; + // 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 = 5; +} + +// 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. +message FailureSet { + repeated string failure = 1; +} + +// 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. +message ConformanceRequest { + // The payload (whether protobuf of JSON) is always for a + // protobuf_test_messages.proto3.TestAllTypes proto (as defined in + // src/google/protobuf/proto3_test_messages.proto). + oneof payload { + bytes protobuf_payload = 1; + string json_payload = 2; + // Only used inside Google. Opensource testees just skip it. + string jspb_payload = 7; + string text_payload = 8; + } + + // Which format should the testee serialize its message to? + WireFormat requested_output_format = 3; + + // 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. + string message_type = 4; + + // 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 test_category = 5; + + // Specify details for how to encode jspb. + JspbEncodingConfig jspb_encoding_options = 6; + + // This can be used in json and text format. If true, testee should print + // unknown fields instead of ignore. This feature is optional. + bool print_unknown_fields = 9; +} + +// Represents a single test case's output. +message ConformanceResponse { + oneof result { + // 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. + string parse_error = 1; + + // If the input was successfully parsed but errors occurred when + // serializing it to the requested output format, set the error message in + // this field. + string serialize_error = 6; + + // 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. + string timeout_error = 9; + + // 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. + string runtime_error = 2; + + // If the input was successfully parsed and the requested output was + // protobuf, serialize it to protobuf and set it in this field. + bytes protobuf_payload = 3; + + // If the input was successfully parsed and the requested output was JSON, + // serialize to JSON and set it in this field. + string json_payload = 4; + + // For when the testee skipped the test, likely because a certain feature + // wasn't supported, like JSON input/output. + string skipped = 5; + + // 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. + string jspb_payload = 7; + + // If the input was successfully parsed and the requested output was + // TEXT_FORMAT, serialize to TEXT_FORMAT and set it in this field. + string text_payload = 8; + } +} + +// Encoding options for jspb format. +message JspbEncodingConfig { + // Encode the value field of Any as jspb array if true, otherwise binary. + bool use_jspb_array_any_format = 1; +} diff --git a/Protos/upstream/google/protobuf/any.proto b/Protos/upstream/google/protobuf/any.proto new file mode 100644 index 000000000..eff44e509 --- /dev/null +++ b/Protos/upstream/google/protobuf/any.proto @@ -0,0 +1,162 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/known/anypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "AnyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// // or ... +// if (any.isSameTypeAs(Foo.getDefaultInstance())) { +// foo = any.unpack(Foo.getDefaultInstance()); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := anypb.New(foo) +// if err != nil { +// ... +// } +// ... +// foo := &pb.Foo{} +// if err := any.UnmarshalTo(foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// JSON +// ==== +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +// +message Any { + // A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). + // + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: + // + // * If no scheme is provided, `https` is assumed. + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. As of May 2023, there are no widely used type server + // implementations and no plans to implement one. + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + // + string type_url = 1; + + // Must be a valid serialized protocol buffer of the above specified type. + bytes value = 2; +} diff --git a/Protos/upstream/google/protobuf/any_test.proto b/Protos/upstream/google/protobuf/any_test.proto new file mode 100644 index 000000000..256035b44 --- /dev/null +++ b/Protos/upstream/google/protobuf/any_test.proto @@ -0,0 +1,44 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package protobuf_unittest; + +import "google/protobuf/any.proto"; + +option java_outer_classname = "TestAnyProto"; + +message TestAny { + int32 int32_value = 1; + google.protobuf.Any any_value = 2; + repeated google.protobuf.Any repeated_any_value = 3; + string text = 4; +} diff --git a/Protos/upstream/google/protobuf/api.proto b/Protos/upstream/google/protobuf/api.proto new file mode 100644 index 000000000..422235167 --- /dev/null +++ b/Protos/upstream/google/protobuf/api.proto @@ -0,0 +1,207 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/source_context.proto"; +import "google/protobuf/type.proto"; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "ApiProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/apipb"; + +// Api is a light-weight descriptor for an API Interface. +// +// Interfaces are also described as "protocol buffer services" in some contexts, +// such as by the "service" keyword in a .proto file, but they are different +// from API Services, which represent a concrete implementation of an interface +// as opposed to simply a description of methods and bindings. They are also +// sometimes simply referred to as "APIs" in other contexts, such as the name of +// this message itself. See https://cloud.google.com/apis/design/glossary for +// detailed terminology. +message Api { + // The fully qualified name of this interface, including package name + // followed by the interface's simple name. + string name = 1; + + // The methods of this interface, in unspecified order. + repeated Method methods = 2; + + // Any metadata attached to the interface. + repeated Option options = 3; + + // A version string for this interface. If specified, must have the form + // `major-version.minor-version`, as in `1.10`. If the minor version is + // omitted, it defaults to zero. If the entire version field is empty, the + // major version is derived from the package name, as outlined below. If the + // field is not empty, the version in the package name will be verified to be + // consistent with what is provided here. + // + // The versioning schema uses [semantic + // versioning](http://semver.org) where the major version number + // indicates a breaking change and the minor version an additive, + // non-breaking change. Both version numbers are signals to users + // what to expect from different versions, and should be carefully + // chosen based on the product plan. + // + // The major version is also reflected in the package name of the + // interface, which must end in `v`, as in + // `google.feature.v1`. For major versions 0 and 1, the suffix can + // be omitted. Zero major versions must only be used for + // experimental, non-GA interfaces. + // + string version = 4; + + // Source context for the protocol buffer service represented by this + // message. + SourceContext source_context = 5; + + // Included interfaces. See [Mixin][]. + repeated Mixin mixins = 6; + + // The source syntax of the service. + Syntax syntax = 7; +} + +// Method represents a method of an API interface. +message Method { + // The simple name of this method. + string name = 1; + + // A URL of the input message type. + string request_type_url = 2; + + // If true, the request is streamed. + bool request_streaming = 3; + + // The URL of the output message type. + string response_type_url = 4; + + // If true, the response is streamed. + bool response_streaming = 5; + + // Any metadata attached to the method. + repeated Option options = 6; + + // The source syntax of this method. + Syntax syntax = 7; +} + +// Declares an API Interface to be included in this interface. The including +// interface must redeclare all the methods from the included interface, but +// documentation and options are inherited as follows: +// +// - If after comment and whitespace stripping, the documentation +// string of the redeclared method is empty, it will be inherited +// from the original method. +// +// - Each annotation belonging to the service config (http, +// visibility) which is not set in the redeclared method will be +// inherited. +// +// - If an http annotation is inherited, the path pattern will be +// modified as follows. Any version prefix will be replaced by the +// version of the including interface plus the [root][] path if +// specified. +// +// Example of a simple mixin: +// +// package google.acl.v1; +// service AccessControl { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v1/{resource=**}:getAcl"; +// } +// } +// +// package google.storage.v2; +// service Storage { +// rpc GetAcl(GetAclRequest) returns (Acl); +// +// // Get a data record. +// rpc GetData(GetDataRequest) returns (Data) { +// option (google.api.http).get = "/v2/{resource=**}"; +// } +// } +// +// Example of a mixin configuration: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// +// The mixin construct implies that all methods in `AccessControl` are +// also declared with same name and request/response types in +// `Storage`. A documentation generator or annotation processor will +// see the effective `Storage.GetAcl` method after inherting +// documentation and annotations as follows: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/{resource=**}:getAcl"; +// } +// ... +// } +// +// Note how the version in the path pattern changed from `v1` to `v2`. +// +// If the `root` field in the mixin is specified, it should be a +// relative path under which inherited HTTP paths are placed. Example: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// root: acls +// +// This implies the following inherited HTTP annotation: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; +// } +// ... +// } +message Mixin { + // The fully qualified name of the interface which is included. + string name = 1; + + // If non-empty specifies a path under which inherited HTTP paths + // are rooted. + string root = 2; +} diff --git a/Protos/upstream/google/protobuf/compiler/plugin.proto b/Protos/upstream/google/protobuf/compiler/plugin.proto new file mode 100644 index 000000000..ba07c8f6e --- /dev/null +++ b/Protos/upstream/google/protobuf/compiler/plugin.proto @@ -0,0 +1,190 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// +// protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is +// just a program that reads a CodeGeneratorRequest from stdin and writes a +// CodeGeneratorResponse to stdout. +// +// Plugins written using C++ can use google/protobuf/compiler/plugin.h instead +// of dealing with the raw protocol defined here. +// +// A plugin executable needs only to be placed somewhere in the path. The +// plugin should be named "protoc-gen-$NAME", and will then be used when the +// flag "--${NAME}_out" is passed to protoc. + +syntax = "proto2"; + +package google.protobuf.compiler; +option java_package = "com.google.protobuf.compiler"; +option java_outer_classname = "PluginProtos"; + +option csharp_namespace = "Google.Protobuf.Compiler"; +option go_package = "google.golang.org/protobuf/types/pluginpb"; + +import "google/protobuf/descriptor.proto"; + +// The version number of protocol compiler. +message Version { + optional int32 major = 1; + optional int32 minor = 2; + optional int32 patch = 3; + // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should + // be empty for mainline stable releases. + optional string suffix = 4; +} + +// An encoded CodeGeneratorRequest is written to the plugin's stdin. +message CodeGeneratorRequest { + // The .proto files that were explicitly listed on the command-line. The + // code generator should generate code only for these files. Each file's + // descriptor will be included in proto_file, below. + repeated string file_to_generate = 1; + + // The generator parameter passed on the command-line. + optional string parameter = 2; + + // FileDescriptorProtos for all files in files_to_generate and everything + // they import. The files will appear in topological order, so each file + // appears before any file that imports it. + // + // Note: the files listed in files_to_generate will include runtime-retention + // options only, but all other files will include source-retention options. + // The source_file_descriptors field below is available in case you need + // source-retention options for files_to_generate. + // + // protoc guarantees that all proto_files will be written after + // the fields above, even though this is not technically guaranteed by the + // protobuf wire format. This theoretically could allow a plugin to stream + // in the FileDescriptorProtos and handle them one by one rather than read + // the entire set into memory at once. However, as of this writing, this + // is not similarly optimized on protoc's end -- it will store all fields in + // memory at once before sending them to the plugin. + // + // Type names of fields and extensions in the FileDescriptorProto are always + // fully qualified. + repeated FileDescriptorProto proto_file = 15; + + // File descriptors with all options, including source-retention options. + // These descriptors are only provided for the files listed in + // files_to_generate. + repeated FileDescriptorProto source_file_descriptors = 17; + + // The version number of protocol compiler. + optional Version compiler_version = 3; +} + +// The plugin writes an encoded CodeGeneratorResponse to stdout. +message CodeGeneratorResponse { + // Error message. If non-empty, code generation failed. The plugin process + // should exit with status code zero even if it reports an error in this way. + // + // This should be used to indicate errors in .proto files which prevent the + // code generator from generating correct code. Errors which indicate a + // problem in protoc itself -- such as the input CodeGeneratorRequest being + // unparseable -- should be reported by writing a message to stderr and + // exiting with a non-zero status code. + optional string error = 1; + + // A bitmask of supported features that the code generator supports. + // This is a bitwise "or" of values from the Feature enum. + optional uint64 supported_features = 2; + + // Sync with code_generator.h. + enum Feature { + FEATURE_NONE = 0; + FEATURE_PROTO3_OPTIONAL = 1; + } + + // Represents a single generated file. + message File { + // The file name, relative to the output directory. The name must not + // contain "." or ".." components and must be relative, not be absolute (so, + // the file cannot lie outside the output directory). "/" must be used as + // the path separator, not "\". + // + // If the name is omitted, the content will be appended to the previous + // file. This allows the generator to break large files into small chunks, + // and allows the generated text to be streamed back to protoc so that large + // files need not reside completely in memory at one time. Note that as of + // this writing protoc does not optimize for this -- it will read the entire + // CodeGeneratorResponse before writing files to disk. + optional string name = 1; + + // If non-empty, indicates that the named file should already exist, and the + // content here is to be inserted into that file at a defined insertion + // point. This feature allows a code generator to extend the output + // produced by another code generator. The original generator may provide + // insertion points by placing special annotations in the file that look + // like: + // @@protoc_insertion_point(NAME) + // The annotation can have arbitrary text before and after it on the line, + // which allows it to be placed in a comment. NAME should be replaced with + // an identifier naming the point -- this is what other generators will use + // as the insertion_point. Code inserted at this point will be placed + // immediately above the line containing the insertion point (thus multiple + // insertions to the same point will come out in the order they were added). + // The double-@ is intended to make it unlikely that the generated code + // could contain things that look like insertion points by accident. + // + // For example, the C++ code generator places the following line in the + // .pb.h files that it generates: + // // @@protoc_insertion_point(namespace_scope) + // This line appears within the scope of the file's package namespace, but + // outside of any particular class. Another plugin can then specify the + // insertion_point "namespace_scope" to generate additional classes or + // other declarations that should be placed in this scope. + // + // Note that if the line containing the insertion point begins with + // whitespace, the same whitespace will be added to every line of the + // inserted text. This is useful for languages like Python, where + // indentation matters. In these languages, the insertion point comment + // should be indented the same amount as any inserted code will need to be + // in order to work correctly in that context. + // + // The code generator that generates the initial file and the one which + // inserts into it must both run as part of a single invocation of protoc. + // Code generators are executed in the order in which they appear on the + // command line. + // + // If |insertion_point| is present, |name| must also be present. + optional string insertion_point = 2; + + // The file contents. + optional string content = 15; + + // Information describing the file content being inserted. If an insertion + // point is used, this information will be appropriately offset and inserted + // into the code generation metadata for the generated files. + optional GeneratedCodeInfo generated_code_info = 16; + } + repeated File file = 15; +} diff --git a/Protos/upstream/google/protobuf/descriptor.proto b/Protos/upstream/google/protobuf/descriptor.proto new file mode 100644 index 000000000..b29eaf46c --- /dev/null +++ b/Protos/upstream/google/protobuf/descriptor.proto @@ -0,0 +1,1033 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). + +syntax = "proto2"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/descriptorpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DescriptorProtos"; +option csharp_namespace = "Google.Protobuf.Reflection"; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// descriptor.proto must be optimized for speed because reflection-based +// algorithms don't work during bootstrapping. +option optimize_for = SPEED; + +// The protocol compiler can output a FileDescriptorSet containing the .proto +// files it parses. +message FileDescriptorSet { + repeated FileDescriptorProto file = 1; +} + +// Describes a complete .proto file. +message FileDescriptorProto { + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. + + // Names of files imported by this file. + repeated string dependency = 3; + // Indexes of the public imported files in the dependency list above. + repeated int32 public_dependency = 10; + // Indexes of the weak imported files in the dependency list. + // For Google-internal migration only. Do not use. + repeated int32 weak_dependency = 11; + + // All top-level definitions in this file. + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + + optional FileOptions options = 8; + + // This field contains optional information about the original source code. + // You may safely remove this entire field without harming runtime + // functionality of the descriptors -- the information is needed only by + // development tools. + optional SourceCodeInfo source_code_info = 9; + + // The syntax of the proto file. + // The supported values are "proto2", "proto3", and "editions". + // + // If `edition` is present, this value must be "editions". + optional string syntax = 12; + + // The edition of the proto file, which is an opaque string. + optional string edition = 13; +} + +// Describes a message type. +message DescriptorProto { + optional string name = 1; + + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + + message ExtensionRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + + optional ExtensionRangeOptions options = 3; + } + repeated ExtensionRange extension_range = 5; + + repeated OneofDescriptorProto oneof_decl = 8; + + optional MessageOptions options = 7; + + // Range of reserved tag numbers. Reserved tag numbers may not be used by + // fields or extension ranges in the same message. Reserved ranges may + // not overlap. + message ReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + } + repeated ReservedRange reserved_range = 9; + // Reserved field names, which may not be used by fields in the same message. + // A given name may only be reserved once. + repeated string reserved_name = 10; +} + +message ExtensionRangeOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + message Declaration { + // The extension number declared within the extension range. + optional int32 number = 1; + + // The fully-qualified name of the extension field. There must be a leading + // dot in front of the full name. + optional string full_name = 2; + + // The fully-qualified type name of the extension field. Unlike + // Metadata.type, Declaration.type must have a leading dot for messages + // and enums. + optional string type = 3; + + // Deprecated. Please use "repeated". + optional bool is_repeated = 4 [deprecated = true]; + + // If true, indicates that the number is reserved in the extension range, + // and any extension field with the number will fail to compile. Set this + // when a declared extension field is deleted. + optional bool reserved = 5; + + // If true, indicates that the extension must be defined as repeated. + // Otherwise the extension must be defined as optional. + optional bool repeated = 6; + } + + // For external users: DO NOT USE. We are in the process of open sourcing + // extension declaration and executing internal cleanups before it can be + // used externally. + repeated Declaration declaration = 2 [retention = RETENTION_SOURCE]; + + // The verification state of the extension range. + enum VerificationState { + // All the extensions of the range must be declared. + DECLARATION = 0; + UNVERIFIED = 1; + } + + // The verification state of the range. + // TODO(b/278783756): flip the default to DECLARATION once all empty ranges + // are marked as UNVERIFIED. + optional VerificationState verification = 3 [default = UNVERIFIED]; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// Describes a field within a message. +message FieldDescriptorProto { + enum Type { + // 0 is reserved for errors. + // Order is weird for historical reasons. + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + // Tag-delimited aggregate. + // Group type is deprecated and not supported in proto3. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. + + // New in version 2. + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + } + + enum Label { + // 0 is reserved for errors + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + } + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + + // If type_name is set, this need not be set. If both this and type_name + // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + optional Type type = 5; + + // For message and enum types, this is the name of the type. If the name + // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + // rules are used to find the type (i.e. first the nested types within this + // message are searched, then within the parent, on up to the root + // namespace). + optional string type_name = 6; + + // For extensions, this is the name of the type being extended. It is + // resolved in the same manner as type_name. + optional string extendee = 2; + + // For numeric types, contains the original text representation of the value. + // For booleans, "true" or "false". + // For strings, contains the default text contents (not escaped in any way). + // For bytes, contains the C escaped value. All bytes >= 128 are escaped. + optional string default_value = 7; + + // If set, gives the index of a oneof in the containing type's oneof_decl + // list. This field is a member of that oneof. + optional int32 oneof_index = 9; + + // JSON name of this field. The value is set by protocol compiler. If the + // user has set a "json_name" option on this field, that option's value + // will be used. Otherwise, it's deduced from the field's name by converting + // it to camelCase. + optional string json_name = 10; + + optional FieldOptions options = 8; + + // If true, this is a proto3 "optional". When a proto3 field is optional, it + // tracks presence regardless of field type. + // + // When proto3_optional is true, this field must be belong to a oneof to + // signal to old proto3 clients that presence is tracked for this field. This + // oneof is known as a "synthetic" oneof, and this field must be its sole + // member (each proto3 optional field gets its own synthetic oneof). Synthetic + // oneofs exist in the descriptor only, and do not generate any API. Synthetic + // oneofs must be ordered after all "real" oneofs. + // + // For message fields, proto3_optional doesn't create any semantic change, + // since non-repeated message fields always track presence. However it still + // indicates the semantic detail of whether the user wrote "optional" or not. + // This can be useful for round-tripping the .proto file. For consistency we + // give message fields a synthetic oneof also, even though it is not required + // to track presence. This is especially important because the parser can't + // tell if a field is a message or an enum, so it must always create a + // synthetic oneof. + // + // Proto2 optional fields do not set this flag, because they already indicate + // optional with `LABEL_OPTIONAL`. + optional bool proto3_optional = 17; +} + +// Describes a oneof. +message OneofDescriptorProto { + optional string name = 1; + optional OneofOptions options = 2; +} + +// Describes an enum type. +message EnumDescriptorProto { + optional string name = 1; + + repeated EnumValueDescriptorProto value = 2; + + optional EnumOptions options = 3; + + // Range of reserved numeric values. Reserved values may not be used by + // entries in the same enum. Reserved ranges may not overlap. + // + // Note that this is distinct from DescriptorProto.ReservedRange in that it + // is inclusive such that it can appropriately represent the entire int32 + // domain. + message EnumReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. + } + + // Range of reserved numeric values. Reserved numeric values may not be used + // by enum values in the same enum declaration. Reserved ranges may not + // overlap. + repeated EnumReservedRange reserved_range = 4; + + // Reserved enum value names, which may not be reused. A given name may only + // be reserved once. + repeated string reserved_name = 5; +} + +// Describes a value within an enum. +message EnumValueDescriptorProto { + optional string name = 1; + optional int32 number = 2; + + optional EnumValueOptions options = 3; +} + +// Describes a service. +message ServiceDescriptorProto { + optional string name = 1; + repeated MethodDescriptorProto method = 2; + + optional ServiceOptions options = 3; +} + +// Describes a method of a service. +message MethodDescriptorProto { + optional string name = 1; + + // Input and output type names. These are resolved in the same way as + // FieldDescriptorProto.type_name, but must refer to a message type. + optional string input_type = 2; + optional string output_type = 3; + + optional MethodOptions options = 4; + + // Identifies if client streams multiple client messages + optional bool client_streaming = 5 [default = false]; + // Identifies if server streams multiple server messages + optional bool server_streaming = 6 [default = false]; +} + +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. + +message FileOptions { + + // Sets the Java package where classes generated from this .proto will be + // placed. By default, the proto package is used, but this is often + // inappropriate because proto packages do not normally start with backwards + // domain names. + optional string java_package = 1; + + // Controls the name of the wrapper Java class generated for the .proto file. + // That class will always contain the .proto file's getDescriptor() method as + // well as any top-level extensions defined in the .proto file. + // If java_multiple_files is disabled, then all the other classes from the + // .proto file will be nested inside the single wrapper outer class. + optional string java_outer_classname = 8; + + // If enabled, then the Java code generator will generate a separate .java + // file for each top-level message, enum, and service defined in the .proto + // file. Thus, these types will *not* be nested inside the wrapper class + // named by java_outer_classname. However, the wrapper class will still be + // generated to contain the file's getDescriptor() method as well as any + // top-level extensions defined in the file. + optional bool java_multiple_files = 10 [default = false]; + + // This option does nothing. + optional bool java_generate_equals_and_hash = 20 [deprecated=true]; + + // If set true, then the Java2 code generator will generate code that + // throws an exception whenever an attempt is made to assign a non-UTF-8 + // byte sequence to a string field. + // Message reflection will do the same. + // However, an extension field still accepts non-UTF-8 byte sequences. + // This option has no effect on when used with the lite runtime. + optional bool java_string_check_utf8 = 27 [default = false]; + + // Generated classes can be optimized for speed or code size. + enum OptimizeMode { + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + } + optional OptimizeMode optimize_for = 9 [default = SPEED]; + + // Sets the Go package where structs generated from this .proto will be + // placed. If omitted, the Go package will be derived from the following: + // - The basename of the package import path, if provided. + // - Otherwise, the package statement in the .proto file, if present. + // - Otherwise, the basename of the .proto file, without extension. + optional string go_package = 11; + + // Should generic services be generated in each language? "Generic" services + // are not specific to any particular RPC system. They are generated by the + // main code generators in each language (without additional plugins). + // Generic services were the only kind of service generation supported by + // early versions of google.protobuf. + // + // Generic services are now considered deprecated in favor of using plugins + // that generate code specific to your particular RPC system. Therefore, + // these default to false. Old code which depends on generic services should + // explicitly set them to true. + optional bool cc_generic_services = 16 [default = false]; + optional bool java_generic_services = 17 [default = false]; + optional bool py_generic_services = 18 [default = false]; + optional bool php_generic_services = 42 [default = false]; + + // Is this file deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for everything in the file, or it will be completely ignored; in the very + // least, this is a formalization for deprecating files. + optional bool deprecated = 23 [default = false]; + + // Enables the use of arenas for the proto messages in this file. This applies + // only to generated classes for C++. + optional bool cc_enable_arenas = 31 [default = true]; + + // Sets the objective c class prefix which is prepended to all objective c + // generated classes from this .proto. There is no default. + optional string objc_class_prefix = 36; + + // Namespace for generated classes; defaults to the package. + optional string csharp_namespace = 37; + + // By default Swift generators will take the proto package and CamelCase it + // replacing '.' with underscore and use that to prefix the types/symbols + // defined. When this options is provided, they will use this value instead + // to prefix the types/symbols defined. + optional string swift_prefix = 39; + + // Sets the php class prefix which is prepended to all php generated classes + // from this .proto. Default is empty. + optional string php_class_prefix = 40; + + // Use this option to change the namespace of php generated classes. Default + // is empty. When this option is empty, the package name will be used for + // determining the namespace. + optional string php_namespace = 41; + + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. + optional string php_metadata_namespace = 44; + + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + optional string ruby_package = 45; + + // The parser stores options it doesn't recognize here. + // See the documentation for the "Options" section above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. + // See the documentation for the "Options" section above. + extensions 1000 to max; + + reserved 38; +} + +message MessageOptions { + // Set true to use the old proto1 MessageSet wire format for extensions. + // This is provided for backwards-compatibility with the MessageSet wire + // format. You should not use this for any other reason: It's less + // efficient, has fewer features, and is more complicated. + // + // The message must be defined exactly as follows: + // message Foo { + // option message_set_wire_format = true; + // extensions 4 to max; + // } + // Note that the message cannot have any defined fields; MessageSets only + // have extensions. + // + // All extensions of your type must be singular messages; e.g. they cannot + // be int32s, enums, or repeated messages. + // + // Because this is an option, the above two restrictions are not enforced by + // the protocol compiler. + optional bool message_set_wire_format = 1 [default = false]; + + // Disables the generation of the standard "descriptor()" accessor, which can + // conflict with a field of the same name. This is meant to make migration + // from proto1 easier; new code should avoid fields named "descriptor". + optional bool no_standard_descriptor_accessor = 2 [default = false]; + + // Is this message deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the message, or it will be completely ignored; in the very least, + // this is a formalization for deprecating messages. + optional bool deprecated = 3 [default = false]; + + reserved 4, 5, 6; + + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + // + // Whether the message is an automatically generated map entry type for the + // maps field. + // + // For maps fields: + // map map_field = 1; + // The parsed descriptor looks like: + // message MapFieldEntry { + // option map_entry = true; + // optional KeyType key = 1; + // optional ValueType value = 2; + // } + // repeated MapFieldEntry map_field = 1; + // + // Implementations may choose not to generate the map_entry=true message, but + // use a native map in the target language to hold the keys and values. + // The reflection APIs in such implementations still need to work as + // if the field is a repeated message field. + optional bool map_entry = 7; + + reserved 8; // javalite_serializable + reserved 9; // javanano_as_lite + + // Enable the legacy handling of JSON field name conflicts. This lowercases + // and strips underscored from the fields before comparison in proto3 only. + // The new behavior takes `json_name` into account and applies to proto2 as + // well. + // + // This should only be used as a temporary measure against broken builds due + // to the change in behavior for JSON field name conflicts. + // + // TODO(b/261750190) This is legacy behavior we plan to remove once downstream + // teams have had time to migrate. + optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message FieldOptions { + // The ctype option instructs the C++ code generator to use a different + // representation of the field than it normally would. See the specific + // options below. This option is only implemented to support use of + // [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + // type "bytes" in the open source release -- sorry, we'll try to include + // other types in a future version! + optional CType ctype = 1 [default = STRING]; + enum CType { + // Default mode. + STRING = 0; + + // The option [ctype=CORD] may be applied to a non-repeated field of type + // "bytes". It indicates that in C++, the data should be stored in a Cord + // instead of a string. For very large strings, this may reduce memory + // fragmentation. It may also allow better performance when parsing from a + // Cord, or when parsing with aliasing enabled, as the parsed Cord may then + // alias the original buffer. + CORD = 1; + + STRING_PIECE = 2; + } + // The packed option can be enabled for repeated primitive fields to enable + // a more efficient representation on the wire. Rather than repeatedly + // writing the tag and type for each element, the entire array is encoded as + // a single length-delimited blob. In proto3, only explicit setting it to + // false will avoid using packed encoding. + optional bool packed = 2; + + // The jstype option determines the JavaScript type used for values of the + // field. The option is permitted only for 64 bit integral and fixed types + // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + // is represented as JavaScript string, which avoids loss of precision that + // can happen when a large value is converted to a floating point JavaScript. + // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + // use the JavaScript "number" type. The behavior of the default option + // JS_NORMAL is implementation dependent. + // + // This option is an enum to permit additional types to be added, e.g. + // goog.math.Integer. + optional JSType jstype = 6 [default = JS_NORMAL]; + enum JSType { + // Use the default type. + JS_NORMAL = 0; + + // Use JavaScript strings. + JS_STRING = 1; + + // Use JavaScript numbers. + JS_NUMBER = 2; + } + + // Should this field be parsed lazily? Lazy applies only to message-type + // fields. It means that when the outer message is initially parsed, the + // inner message's contents will not be parsed but instead stored in encoded + // form. The inner message will actually be parsed when it is first accessed. + // + // This is only a hint. Implementations are free to choose whether to use + // eager or lazy parsing regardless of the value of this option. However, + // setting this option true suggests that the protocol author believes that + // using lazy parsing on this field is worth the additional bookkeeping + // overhead typically needed to implement it. + // + // This option does not affect the public interface of any generated code; + // all method signatures remain the same. Furthermore, thread-safety of the + // interface is not affected by this option; const methods remain safe to + // call from multiple threads concurrently, while non-const methods continue + // to require exclusive access. + // + // Note that implementations may choose not to check required fields within + // a lazy sub-message. That is, calling IsInitialized() on the outer message + // may return true even if the inner message has missing required fields. + // This is necessary because otherwise the inner message would have to be + // parsed in order to perform the check, defeating the purpose of lazy + // parsing. An implementation which chooses not to check required fields + // must be consistent about it. That is, for any particular sub-message, the + // implementation must either *always* check its required fields, or *never* + // check its required fields, regardless of whether or not the message has + // been parsed. + // + // As of May 2022, lazy verifies the contents of the byte stream during + // parsing. An invalid byte stream will cause the overall parsing to fail. + optional bool lazy = 5 [default = false]; + + // unverified_lazy does no correctness checks on the byte stream. This should + // only be used where lazy with verification is prohibitive for performance + // reasons. + optional bool unverified_lazy = 15 [default = false]; + + // Is this field deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for accessors, or it will be completely ignored; in the very least, this + // is a formalization for deprecating fields. + optional bool deprecated = 3 [default = false]; + + // For Google-internal migration only. Do not use. + optional bool weak = 10 [default = false]; + + // Indicate that the field value should not be printed out when using debug + // formats, e.g. when the field contains sensitive credentials. + optional bool debug_redact = 16 [default = false]; + + // If set to RETENTION_SOURCE, the option will be omitted from the binary. + // Note: as of January 2023, support for this is in progress and does not yet + // have an effect (b/264593489). + enum OptionRetention { + RETENTION_UNKNOWN = 0; + RETENTION_RUNTIME = 1; + RETENTION_SOURCE = 2; + } + + optional OptionRetention retention = 17; + + // This indicates the types of entities that the field may apply to when used + // as an option. If it is unset, then the field may be freely used as an + // option on any kind of entity. Note: as of January 2023, support for this is + // in progress and does not yet have an effect (b/264593489). + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0; + TARGET_TYPE_FILE = 1; + TARGET_TYPE_EXTENSION_RANGE = 2; + TARGET_TYPE_MESSAGE = 3; + TARGET_TYPE_FIELD = 4; + TARGET_TYPE_ONEOF = 5; + TARGET_TYPE_ENUM = 6; + TARGET_TYPE_ENUM_ENTRY = 7; + TARGET_TYPE_SERVICE = 8; + TARGET_TYPE_METHOD = 9; + } + + repeated OptionTargetType targets = 19; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; + + reserved 4; // removed jtype + optional OptionTargetType target_obsolete_do_not_use = 18 [deprecated = true]; +} + +message OneofOptions { + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumOptions { + + // Set this option to true to allow mapping different tag names to the same + // value. + optional bool allow_alias = 2; + + // Is this enum deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum, or it will be completely ignored; in the very least, this + // is a formalization for deprecating enums. + optional bool deprecated = 3 [default = false]; + + reserved 5; // javanano_as_lite + + // Enable the legacy handling of JSON field name conflicts. This lowercases + // and strips underscored from the fields before comparison in proto3 only. + // The new behavior takes `json_name` into account and applies to proto2 as + // well. + // TODO(b/261750190) Remove this legacy behavior once downstream teams have + // had time to migrate. + optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumValueOptions { + // Is this enum value deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum value, or it will be completely ignored; in the very least, + // this is a formalization for deprecating enum values. + optional bool deprecated = 1 [default = false]; + + // Indicate that fields annotated with this enum value should not be printed + // out when using debug formats, e.g. when the field contains sensitive + // credentials. + optional bool debug_redact = 3 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message ServiceOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this service deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the service, or it will be completely ignored; in the very least, + // this is a formalization for deprecating services. + optional bool deprecated = 33 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message MethodOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this method deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the method, or it will be completely ignored; in the very least, + // this is a formalization for deprecating methods. + optional bool deprecated = 33 [default = false]; + + // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + // or neither? HTTP based RPC implementation may choose GET verb for safe + // methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0; + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects + } + optional IdempotencyLevel idempotency_level = 34 + [default = IDEMPOTENCY_UNKNOWN]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// A message representing a option the parser does not recognize. This only +// appears in options protos created by the compiler::Parser class. +// DescriptorPool resolves these when building Descriptor objects. Therefore, +// options protos in descriptor objects (e.g. returned by Descriptor::options(), +// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +// in them. +message UninterpretedOption { + // The name of the uninterpreted option. Each string represents a segment in + // a dot-separated name. is_extension is true iff a segment represents an + // extension (denoted with parentheses in options specs in .proto files). + // E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + // "foo.(bar.baz).moo". + message NamePart { + required string name_part = 1; + required bool is_extension = 2; + } + repeated NamePart name = 2; + + // The value of the uninterpreted option, in whatever type the tokenizer + // identified it as during parsing. Exactly one of these should be set. + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; +} + +// =================================================================== +// Optional source code info + +// Encapsulates information about the original source file from which a +// FileDescriptorProto was generated. +message SourceCodeInfo { + // A Location identifies a piece of source code in a .proto file which + // corresponds to a particular definition. This information is intended + // to be useful to IDEs, code indexers, documentation generators, and similar + // tools. + // + // For example, say we have a file like: + // message Foo { + // optional string foo = 1; + // } + // Let's look at just the field definition: + // optional string foo = 1; + // ^ ^^ ^^ ^ ^^^ + // a bc de f ghi + // We have the following locations: + // span path represents + // [a,i) [ 4, 0, 2, 0 ] The whole field definition. + // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + // + // Notes: + // - A location may refer to a repeated field itself (i.e. not to any + // particular index within it). This is used whenever a set of elements are + // logically enclosed in a single code segment. For example, an entire + // extend block (possibly containing multiple extension definitions) will + // have an outer location whose path refers to the "extensions" repeated + // field without an index. + // - Multiple locations may have the same path. This happens when a single + // logical declaration is spread out across multiple places. The most + // obvious example is the "extend" block again -- there may be multiple + // extend blocks in the same scope, each of which will have the same path. + // - A location's span is not always a subset of its parent's span. For + // example, the "extendee" of an extension declaration appears at the + // beginning of the "extend" block and is shared by all extensions within + // the block. + // - Just because a location's span is a subset of some other location's span + // does not mean that it is a descendant. For example, a "group" defines + // both a type and a field in a single declaration. Thus, the locations + // corresponding to the type and field and their components will overlap. + // - Code which tries to interpret locations should probably be designed to + // ignore those that it doesn't understand, as more types of locations could + // be recorded in the future. + repeated Location location = 1; + message Location { + // Identifies which part of the FileDescriptorProto was defined at this + // location. + // + // Each element is a field number or an index. They form a path from + // the root FileDescriptorProto to the place where the definition occurs. + // For example, this path: + // [ 4, 3, 2, 7, 1 ] + // refers to: + // file.message_type(3) // 4, 3 + // .field(7) // 2, 7 + // .name() // 1 + // This is because FileDescriptorProto.message_type has field number 4: + // repeated DescriptorProto message_type = 4; + // and DescriptorProto.field has field number 2: + // repeated FieldDescriptorProto field = 2; + // and FieldDescriptorProto.name has field number 1: + // optional string name = 1; + // + // Thus, the above path gives the location of a field name. If we removed + // the last element: + // [ 4, 3, 2, 7 ] + // this path refers to the whole field declaration (from the beginning + // of the label to the terminating semicolon). + repeated int32 path = 1 [packed = true]; + + // Always has exactly three or four elements: start line, start column, + // end line (optional, otherwise assumed same as start line), end column. + // These are packed into a single field for efficiency. Note that line + // and column numbers are zero-based -- typically you will want to add + // 1 to each before displaying to a user. + repeated int32 span = 2 [packed = true]; + + // If this SourceCodeInfo represents a complete declaration, these are any + // comments appearing before and after the declaration which appear to be + // attached to the declaration. + // + // A series of line comments appearing on consecutive lines, with no other + // tokens appearing on those lines, will be treated as a single comment. + // + // leading_detached_comments will keep paragraphs of comments that appear + // before (but not connected to) the current element. Each paragraph, + // separated by empty lines, will be one comment element in the repeated + // field. + // + // Only the comment content is provided; comment markers (e.g. //) are + // stripped out. For block comments, leading whitespace and an asterisk + // will be stripped from the beginning of each line other than the first. + // Newlines are included in the output. + // + // Examples: + // + // optional int32 foo = 1; // Comment attached to foo. + // // Comment attached to bar. + // optional int32 bar = 2; + // + // optional string baz = 3; + // // Comment attached to baz. + // // Another line attached to baz. + // + // // Comment attached to moo. + // // + // // Another line attached to moo. + // optional double moo = 4; + // + // // Detached comment for corge. This is not leading or trailing comments + // // to moo or corge because there are blank lines separating it from + // // both. + // + // // Detached comment for corge paragraph 2. + // + // optional string corge = 5; + // /* Block comment attached + // * to corge. Leading asterisks + // * will be removed. */ + // /* Block comment attached to + // * grault. */ + // optional int32 grault = 6; + // + // // ignored detached comments. + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +message GeneratedCodeInfo { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + repeated Annotation annotation = 1; + message Annotation { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + repeated int32 path = 1 [packed = true]; + + // Identifies the filesystem path to the original source .proto. + optional string source_file = 2; + + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + optional int32 begin = 3; + + // Identifies the ending offset in bytes in the generated code that + // relates to the identified object. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + optional int32 end = 4; + + // Represents the identified object's effect on the element in the original + // .proto file. + enum Semantic { + // There is no effect or the effect is indescribable. + NONE = 0; + // The element is set or otherwise mutated. + SET = 1; + // An alias to the element is returned. + ALIAS = 2; + } + optional Semantic semantic = 5; + } +} diff --git a/Protos/upstream/google/protobuf/duration.proto b/Protos/upstream/google/protobuf/duration.proto new file mode 100644 index 000000000..41f40c222 --- /dev/null +++ b/Protos/upstream/google/protobuf/duration.proto @@ -0,0 +1,115 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/durationpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DurationProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// A Duration represents a signed, fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". It is related to Timestamp in that the difference between +// two Timestamp values is a Duration and it can be added or subtracted +// from a Timestamp. Range is approximately +-10,000 years. +// +// # Examples +// +// Example 1: Compute Duration from two Timestamps in pseudo code. +// +// Timestamp start = ...; +// Timestamp end = ...; +// Duration duration = ...; +// +// duration.seconds = end.seconds - start.seconds; +// duration.nanos = end.nanos - start.nanos; +// +// if (duration.seconds < 0 && duration.nanos > 0) { +// duration.seconds += 1; +// duration.nanos -= 1000000000; +// } else if (duration.seconds > 0 && duration.nanos < 0) { +// duration.seconds -= 1; +// duration.nanos += 1000000000; +// } +// +// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. +// +// Timestamp start = ...; +// Duration duration = ...; +// Timestamp end = ...; +// +// end.seconds = start.seconds + duration.seconds; +// end.nanos = start.nanos + duration.nanos; +// +// if (end.nanos < 0) { +// end.seconds -= 1; +// end.nanos += 1000000000; +// } else if (end.nanos >= 1000000000) { +// end.seconds += 1; +// end.nanos -= 1000000000; +// } +// +// Example 3: Compute Duration from datetime.timedelta in Python. +// +// td = datetime.timedelta(days=3, minutes=10) +// duration = Duration() +// duration.FromTimedelta(td) +// +// # JSON Mapping +// +// In JSON format, the Duration type is encoded as a string rather than an +// object, where the string ends in the suffix "s" (indicating seconds) and +// is preceded by the number of seconds, with nanoseconds expressed as +// fractional seconds. For example, 3 seconds with 0 nanoseconds should be +// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should +// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 +// microsecond should be expressed in JSON format as "3.000001s". +// +message Duration { + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. Note: these bounds are computed from: + // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + int64 seconds = 1; + + // Signed fractions of a second at nanosecond resolution of the span + // of time. Durations less than one second are represented with a 0 + // `seconds` field and a positive or negative `nanos` field. For durations + // of one second or more, a non-zero value for the `nanos` field must be + // of the same sign as the `seconds` field. Must be from -999,999,999 + // to +999,999,999 inclusive. + int32 nanos = 2; +} diff --git a/Protos/upstream/google/protobuf/empty.proto b/Protos/upstream/google/protobuf/empty.proto new file mode 100644 index 000000000..b87c89dcf --- /dev/null +++ b/Protos/upstream/google/protobuf/empty.proto @@ -0,0 +1,51 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/known/emptypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "EmptyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; + +// A generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +message Empty {} diff --git a/Protos/upstream/google/protobuf/field_mask.proto b/Protos/upstream/google/protobuf/field_mask.proto new file mode 100644 index 000000000..b28334b94 --- /dev/null +++ b/Protos/upstream/google/protobuf/field_mask.proto @@ -0,0 +1,245 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "FieldMaskProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb"; +option cc_enable_arenas = true; + +// `FieldMask` represents a set of symbolic field paths, for example: +// +// paths: "f.a" +// paths: "f.b.d" +// +// Here `f` represents a field in some root message, `a` and `b` +// fields in the message found in `f`, and `d` a field found in the +// message in `f.b`. +// +// Field masks are used to specify a subset of fields that should be +// returned by a get operation or modified by an update operation. +// Field masks also have a custom JSON encoding (see below). +// +// # Field Masks in Projections +// +// When used in the context of a projection, a response message or +// sub-message is filtered by the API to only contain those fields as +// specified in the mask. For example, if the mask in the previous +// example is applied to a response message as follows: +// +// f { +// a : 22 +// b { +// d : 1 +// x : 2 +// } +// y : 13 +// } +// z: 8 +// +// The result will not contain specific values for fields x,y and z +// (their value will be set to the default, and omitted in proto text +// output): +// +// +// f { +// a : 22 +// b { +// d : 1 +// } +// } +// +// A repeated field is not allowed except at the last position of a +// paths string. +// +// If a FieldMask object is not present in a get operation, the +// operation applies to all fields (as if a FieldMask of all fields +// had been specified). +// +// Note that a field mask does not necessarily apply to the +// top-level response message. In case of a REST get operation, the +// field mask applies directly to the response, but in case of a REST +// list operation, the mask instead applies to each individual message +// in the returned resource list. In case of a REST custom method, +// other definitions may be used. Where the mask applies will be +// clearly documented together with its declaration in the API. In +// any case, the effect on the returned resource/resources is required +// behavior for APIs. +// +// # Field Masks in Update Operations +// +// A field mask in update operations specifies which fields of the +// targeted resource are going to be updated. The API is required +// to only change the values of the fields as specified in the mask +// and leave the others untouched. If a resource is passed in to +// describe the updated values, the API ignores the values of all +// fields not covered by the mask. +// +// If a repeated field is specified for an update operation, new values will +// be appended to the existing repeated field in the target resource. Note that +// a repeated field is only allowed in the last position of a `paths` string. +// +// If a sub-message is specified in the last position of the field mask for an +// update operation, then new value will be merged into the existing sub-message +// in the target resource. +// +// For example, given the target message: +// +// f { +// b { +// d: 1 +// x: 2 +// } +// c: [1] +// } +// +// And an update message: +// +// f { +// b { +// d: 10 +// } +// c: [2] +// } +// +// then if the field mask is: +// +// paths: ["f.b", "f.c"] +// +// then the result will be: +// +// f { +// b { +// d: 10 +// x: 2 +// } +// c: [1, 2] +// } +// +// An implementation may provide options to override this default behavior for +// repeated and message fields. +// +// In order to reset a field's value to the default, the field must +// be in the mask and set to the default value in the provided resource. +// Hence, in order to reset all fields of a resource, provide a default +// instance of the resource and set all fields in the mask, or do +// not provide a mask as described below. +// +// If a field mask is not present on update, the operation applies to +// all fields (as if a field mask of all fields has been specified). +// Note that in the presence of schema evolution, this may mean that +// fields the client does not know and has therefore not filled into +// the request will be reset to their default. If this is unwanted +// behavior, a specific service may require a client to always specify +// a field mask, producing an error if not. +// +// As with get operations, the location of the resource which +// describes the updated values in the request message depends on the +// operation kind. In any case, the effect of the field mask is +// required to be honored by the API. +// +// ## Considerations for HTTP REST +// +// The HTTP kind of an update operation which uses a field mask must +// be set to PATCH instead of PUT in order to satisfy HTTP semantics +// (PUT must only be used for full updates). +// +// # JSON Encoding of Field Masks +// +// In JSON, a field mask is encoded as a single string where paths are +// separated by a comma. Fields name in each path are converted +// to/from lower-camel naming conventions. +// +// As an example, consider the following message declarations: +// +// message Profile { +// User user = 1; +// Photo photo = 2; +// } +// message User { +// string display_name = 1; +// string address = 2; +// } +// +// In proto a field mask for `Profile` may look as such: +// +// mask { +// paths: "user.display_name" +// paths: "photo" +// } +// +// In JSON, the same mask is represented as below: +// +// { +// mask: "user.displayName,photo" +// } +// +// # Field Masks and Oneof Fields +// +// Field masks treat fields in oneofs just as regular fields. Consider the +// following message: +// +// message SampleMessage { +// oneof test_oneof { +// string name = 4; +// SubMessage sub_message = 9; +// } +// } +// +// The field mask can be: +// +// mask { +// paths: "name" +// } +// +// Or: +// +// mask { +// paths: "sub_message" +// } +// +// Note that oneof type names ("test_oneof" in this case) cannot be used in +// paths. +// +// ## Field Mask Verification +// +// The implementation of any API method which has a FieldMask type field in the +// request should verify the included field paths, and return an +// `INVALID_ARGUMENT` error if any path is unmappable. +message FieldMask { + // The set of field mask paths. + repeated string paths = 1; +} diff --git a/Protos/google/protobuf/map_lite_unittest.proto b/Protos/upstream/google/protobuf/map_lite_unittest.proto similarity index 100% rename from Protos/google/protobuf/map_lite_unittest.proto rename to Protos/upstream/google/protobuf/map_lite_unittest.proto diff --git a/Protos/google/protobuf/map_proto2_unittest.proto b/Protos/upstream/google/protobuf/map_proto2_unittest.proto similarity index 100% rename from Protos/google/protobuf/map_proto2_unittest.proto rename to Protos/upstream/google/protobuf/map_proto2_unittest.proto diff --git a/Protos/google/protobuf/map_proto3_unittest.proto b/Protos/upstream/google/protobuf/map_proto3_unittest.proto similarity index 100% rename from Protos/google/protobuf/map_proto3_unittest.proto rename to Protos/upstream/google/protobuf/map_proto3_unittest.proto diff --git a/Protos/google/protobuf/map_unittest.proto b/Protos/upstream/google/protobuf/map_unittest.proto similarity index 100% rename from Protos/google/protobuf/map_unittest.proto rename to Protos/upstream/google/protobuf/map_unittest.proto diff --git a/Protos/upstream/google/protobuf/source_context.proto b/Protos/upstream/google/protobuf/source_context.proto new file mode 100644 index 000000000..135f50fea --- /dev/null +++ b/Protos/upstream/google/protobuf/source_context.proto @@ -0,0 +1,48 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "SourceContextProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb"; + +// `SourceContext` represents information about the source of a +// protobuf element, like the file in which it is defined. +message SourceContext { + // The path-qualified name of the .proto file that contained the associated + // protobuf element. For example: `"google/protobuf/source_context.proto"`. + string file_name = 1; +} diff --git a/Protos/upstream/google/protobuf/struct.proto b/Protos/upstream/google/protobuf/struct.proto new file mode 100644 index 000000000..1bf0c1ad9 --- /dev/null +++ b/Protos/upstream/google/protobuf/struct.proto @@ -0,0 +1,95 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/structpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "StructProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// `Struct` represents a structured data value, consisting of fields +// which map to dynamically typed values. In some languages, `Struct` +// might be supported by a native representation. For example, in +// scripting languages like JS a struct is represented as an +// object. The details of that representation are described together +// with the proto support for the language. +// +// The JSON representation for `Struct` is JSON object. +message Struct { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either +// null, a number, a string, a boolean, a recursive struct value, or a +// list of values. A producer of value is expected to set one of these +// variants. Absence of any variant indicates an error. +// +// The JSON representation for `Value` is JSON value. +message Value { + // The kind of value. + oneof kind { + // Represents a null value. + NullValue null_value = 1; + // Represents a double value. + double number_value = 2; + // Represents a string value. + string string_value = 3; + // Represents a boolean value. + bool bool_value = 4; + // Represents a structured value. + Struct struct_value = 5; + // Represents a repeated `Value`. + ListValue list_value = 6; + } +} + +// `NullValue` is a singleton enumeration to represent the null value for the +// `Value` type union. +// +// The JSON representation for `NullValue` is JSON `null`. +enum NullValue { + // Null value. + NULL_VALUE = 0; +} + +// `ListValue` is a wrapper around a repeated field of values. +// +// The JSON representation for `ListValue` is JSON array. +message ListValue { + // Repeated field of dynamically typed values. + repeated Value values = 1; +} diff --git a/Protos/upstream/google/protobuf/test_messages_proto2.proto b/Protos/upstream/google/protobuf/test_messages_proto2.proto new file mode 100644 index 000000000..088bfa792 --- /dev/null +++ b/Protos/upstream/google/protobuf/test_messages_proto2.proto @@ -0,0 +1,397 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Test schema for proto2 messages. This test schema is used by: +// +// - conformance tests +// + +// LINT: ALLOW_GROUPS + +syntax = "proto2"; + +package protobuf_test_messages.proto2; + +option java_package = "com.google.protobuf_test_messages.proto2"; +option objc_class_prefix = "Proto2"; + +// This is the default, but we specify it here explicitly. +option optimize_for = SPEED; + +option cc_enable_arenas = true; + +// 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. +message TestAllTypesProto2 { + message NestedMessage { + optional int32 a = 1; + optional TestAllTypesProto2 corecursive = 2; + } + + enum NestedEnum { + FOO = 0; + BAR = 1; + BAZ = 2; + NEG = -1; // Intentionally negative. + } + + // Singular + optional int32 optional_int32 = 1; + optional int64 optional_int64 = 2; + optional uint32 optional_uint32 = 3; + optional uint64 optional_uint64 = 4; + optional sint32 optional_sint32 = 5; + optional sint64 optional_sint64 = 6; + optional fixed32 optional_fixed32 = 7; + optional fixed64 optional_fixed64 = 8; + optional sfixed32 optional_sfixed32 = 9; + optional sfixed64 optional_sfixed64 = 10; + optional float optional_float = 11; + optional double optional_double = 12; + optional bool optional_bool = 13; + optional string optional_string = 14; + optional bytes optional_bytes = 15; + + optional NestedMessage optional_nested_message = 18; + optional ForeignMessageProto2 optional_foreign_message = 19; + + optional NestedEnum optional_nested_enum = 21; + optional ForeignEnumProto2 optional_foreign_enum = 22; + + optional string optional_string_piece = 24 [ctype = STRING_PIECE]; + optional string optional_cord = 25 [ctype = CORD]; + + optional TestAllTypesProto2 recursive_message = 27; + + // Repeated + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; + repeated sfixed32 repeated_sfixed32 = 39; + repeated sfixed64 repeated_sfixed64 = 40; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; + + repeated NestedMessage repeated_nested_message = 48; + repeated ForeignMessageProto2 repeated_foreign_message = 49; + + repeated NestedEnum repeated_nested_enum = 51; + repeated ForeignEnumProto2 repeated_foreign_enum = 52; + + repeated string repeated_string_piece = 54 [ctype = STRING_PIECE]; + repeated string repeated_cord = 55 [ctype = CORD]; + + // Packed + repeated int32 packed_int32 = 75 [packed = true]; + repeated int64 packed_int64 = 76 [packed = true]; + repeated uint32 packed_uint32 = 77 [packed = true]; + repeated uint64 packed_uint64 = 78 [packed = true]; + repeated sint32 packed_sint32 = 79 [packed = true]; + repeated sint64 packed_sint64 = 80 [packed = true]; + repeated fixed32 packed_fixed32 = 81 [packed = true]; + repeated fixed64 packed_fixed64 = 82 [packed = true]; + repeated sfixed32 packed_sfixed32 = 83 [packed = true]; + repeated sfixed64 packed_sfixed64 = 84 [packed = true]; + repeated float packed_float = 85 [packed = true]; + repeated double packed_double = 86 [packed = true]; + repeated bool packed_bool = 87 [packed = true]; + repeated NestedEnum packed_nested_enum = 88 [packed = true]; + + // Unpacked + repeated int32 unpacked_int32 = 89 [packed = false]; + repeated int64 unpacked_int64 = 90 [packed = false]; + repeated uint32 unpacked_uint32 = 91 [packed = false]; + repeated uint64 unpacked_uint64 = 92 [packed = false]; + repeated sint32 unpacked_sint32 = 93 [packed = false]; + repeated sint64 unpacked_sint64 = 94 [packed = false]; + repeated fixed32 unpacked_fixed32 = 95 [packed = false]; + repeated fixed64 unpacked_fixed64 = 96 [packed = false]; + repeated sfixed32 unpacked_sfixed32 = 97 [packed = false]; + repeated sfixed64 unpacked_sfixed64 = 98 [packed = false]; + repeated float unpacked_float = 99 [packed = false]; + repeated double unpacked_double = 100 [packed = false]; + repeated bool unpacked_bool = 101 [packed = false]; + repeated NestedEnum unpacked_nested_enum = 102 [packed = false]; + + // Map + map map_int32_int32 = 56; + map map_int64_int64 = 57; + map map_uint32_uint32 = 58; + map map_uint64_uint64 = 59; + map map_sint32_sint32 = 60; + map map_sint64_sint64 = 61; + map map_fixed32_fixed32 = 62; + map map_fixed64_fixed64 = 63; + map map_sfixed32_sfixed32 = 64; + map map_sfixed64_sfixed64 = 65; + map map_int32_float = 66; + map map_int32_double = 67; + map map_bool_bool = 68; + map map_string_string = 69; + map map_string_bytes = 70; + map map_string_nested_message = 71; + map map_string_foreign_message = 72; + map map_string_nested_enum = 73; + map map_string_foreign_enum = 74; + + oneof oneof_field { + uint32 oneof_uint32 = 111; + NestedMessage oneof_nested_message = 112; + string oneof_string = 113; + bytes oneof_bytes = 114; + bool oneof_bool = 115; + uint64 oneof_uint64 = 116; + float oneof_float = 117; + double oneof_double = 118; + NestedEnum oneof_enum = 119; + } + + // extensions + extensions 120 to 200; + + // groups + optional group Data = 201 { + optional int32 group_int32 = 202; + optional uint32 group_uint32 = 203; + } + + // default values + optional int32 default_int32 = 241 [default = -123456789]; + optional int64 default_int64 = 242 [default = -9123456789123456789]; + optional uint32 default_uint32 = 243 [default = 2123456789]; + optional uint64 default_uint64 = 244 [default = 10123456789123456789]; + optional sint32 default_sint32 = 245 [default = -123456789]; + optional sint64 default_sint64 = 246 [default = -9123456789123456789]; + optional fixed32 default_fixed32 = 247 [default = 2123456789]; + optional fixed64 default_fixed64 = 248 [default = 10123456789123456789]; + optional sfixed32 default_sfixed32 = 249 [default = -123456789]; + optional sfixed64 default_sfixed64 = 250 [default = -9123456789123456789]; + optional float default_float = 251 [default = 9e9]; + optional double default_double = 252 [default = 7e22]; + optional bool default_bool = 253 [default = true]; + optional string default_string = 254 [default = "Rosebud"]; + optional bytes default_bytes = 255 [default = "joshua"]; + + // Test field-name-to-JSON-name convention. + // (protobuf says names can be any valid C/C++ identifier.) + optional int32 fieldname1 = 401; + optional int32 field_name2 = 402; + optional int32 _field_name3 = 403; + optional int32 field__name4_ = 404; + optional int32 field0name5 = 405; + optional int32 field_0_name6 = 406; + optional int32 fieldName7 = 407; + optional int32 FieldName8 = 408; + optional int32 field_Name9 = 409; + optional int32 Field_Name10 = 410; + optional int32 FIELD_NAME11 = 411; + optional int32 FIELD_name12 = 412; + optional int32 __field_name13 = 413; + optional int32 __Field_name14 = 414; + optional int32 field__name15 = 415; + optional int32 field__Name16 = 416; + optional int32 field_name17__ = 417; + optional int32 Field_name18__ = 418; + + // Reserved for unknown fields test. + reserved 1000 to 9999; + + // message_set test case. + message MessageSetCorrect { + option message_set_wire_format = true; + + extensions 4 to max; + } + + message MessageSetCorrectExtension1 { + extend MessageSetCorrect { + optional MessageSetCorrectExtension1 message_set_extension = 1547769; + } + optional string str = 25; + } + + message MessageSetCorrectExtension2 { + extend MessageSetCorrect { + optional MessageSetCorrectExtension2 message_set_extension = 4135312; + } + optional int32 i = 9; + } +} + +message ForeignMessageProto2 { + optional int32 c = 1; +} + +enum ForeignEnumProto2 { + FOREIGN_FOO = 0; + FOREIGN_BAR = 1; + FOREIGN_BAZ = 2; +} + +extend TestAllTypesProto2 { + optional int32 extension_int32 = 120; +} + +message UnknownToTestAllTypes { + optional int32 optional_int32 = 1001; + optional string optional_string = 1002; + optional ForeignMessageProto2 nested_message = 1003; + optional group OptionalGroup = 1004 { + optional int32 a = 1; + } + optional bool optional_bool = 1006; + repeated int32 repeated_int32 = 1011; +} + +message NullHypothesisProto2 {} + +message EnumOnlyProto2 { + enum Bool { + kFalse = 0; + kTrue = 1; + } +} + +message OneStringProto2 { + optional string data = 1; +} + +message ProtoWithKeywords { + optional int32 inline = 1; + optional string concept = 2; + repeated string requires = 3; +} + +message TestAllRequiredTypesProto2 { + message NestedMessage { + required int32 a = 1; + required TestAllRequiredTypesProto2 corecursive = 2; + optional TestAllRequiredTypesProto2 optional_corecursive = 3; + } + + enum NestedEnum { + FOO = 0; + BAR = 1; + BAZ = 2; + NEG = -1; // Intentionally negative. + } + + // Singular + required int32 required_int32 = 1; + required int64 required_int64 = 2; + required uint32 required_uint32 = 3; + required uint64 required_uint64 = 4; + required sint32 required_sint32 = 5; + required sint64 required_sint64 = 6; + required fixed32 required_fixed32 = 7; + required fixed64 required_fixed64 = 8; + required sfixed32 required_sfixed32 = 9; + required sfixed64 required_sfixed64 = 10; + required float required_float = 11; + required double required_double = 12; + required bool required_bool = 13; + required string required_string = 14; + required bytes required_bytes = 15; + + required NestedMessage required_nested_message = 18; + required ForeignMessageProto2 required_foreign_message = 19; + + required NestedEnum required_nested_enum = 21; + required ForeignEnumProto2 required_foreign_enum = 22; + + required string required_string_piece = 24 [ctype = STRING_PIECE]; + required string required_cord = 25 [ctype = CORD]; + + required TestAllRequiredTypesProto2 recursive_message = 27; + optional TestAllRequiredTypesProto2 optional_recursive_message = 28; + + // extensions + extensions 120 to 200; + + // groups + required group Data = 201 { + required int32 group_int32 = 202; + required uint32 group_uint32 = 203; + } + + // default values + required int32 default_int32 = 241 [default = -123456789]; + required int64 default_int64 = 242 [default = -9123456789123456789]; + required uint32 default_uint32 = 243 [default = 2123456789]; + required uint64 default_uint64 = 244 [default = 10123456789123456789]; + required sint32 default_sint32 = 245 [default = -123456789]; + required sint64 default_sint64 = 246 [default = -9123456789123456789]; + required fixed32 default_fixed32 = 247 [default = 2123456789]; + required fixed64 default_fixed64 = 248 [default = 10123456789123456789]; + required sfixed32 default_sfixed32 = 249 [default = -123456789]; + required sfixed64 default_sfixed64 = 250 [default = -9123456789123456789]; + required float default_float = 251 [default = 9e9]; + required double default_double = 252 [default = 7e22]; + required bool default_bool = 253 [default = true]; + required string default_string = 254 [default = "Rosebud"]; + required bytes default_bytes = 255 [default = "joshua"]; + + // Reserved for unknown fields test. + reserved 1000 to 9999; + + // message_set test case. + message MessageSetCorrect { + option message_set_wire_format = true; + + extensions 4 to max; + } + + message MessageSetCorrectExtension1 { + extend MessageSetCorrect { + optional MessageSetCorrectExtension1 message_set_extension = 1547769; + } + required string str = 25; + } + + message MessageSetCorrectExtension2 { + extend MessageSetCorrect { + optional MessageSetCorrectExtension2 message_set_extension = 4135312; + } + required int32 i = 9; + } +} diff --git a/Protos/upstream/google/protobuf/test_messages_proto3.proto b/Protos/upstream/google/protobuf/test_messages_proto3.proto new file mode 100644 index 000000000..1e1285eab --- /dev/null +++ b/Protos/upstream/google/protobuf/test_messages_proto3.proto @@ -0,0 +1,288 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Test schema for proto3 messages. This test schema is used by: +// +// - benchmarks +// - fuzz tests +// - conformance tests +// + +syntax = "proto3"; + +package protobuf_test_messages.proto3; + +option java_package = "com.google.protobuf_test_messages.proto3"; +option objc_class_prefix = "Proto3"; + +// This is the default, but we specify it here explicitly. +option optimize_for = SPEED; + +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option cc_enable_arenas = true; + +// 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. +message TestAllTypesProto3 { + message NestedMessage { + int32 a = 1; + TestAllTypesProto3 corecursive = 2; + } + + enum NestedEnum { + FOO = 0; + BAR = 1; + BAZ = 2; + NEG = -1; // Intentionally negative. + } + + enum AliasedEnum { + option allow_alias = true; + + ALIAS_FOO = 0; + ALIAS_BAR = 1; + ALIAS_BAZ = 2; + MOO = 2; + moo = 2; + bAz = 2; + } + + // Singular + int32 optional_int32 = 1; + int64 optional_int64 = 2; + uint32 optional_uint32 = 3; + uint64 optional_uint64 = 4; + sint32 optional_sint32 = 5; + sint64 optional_sint64 = 6; + fixed32 optional_fixed32 = 7; + fixed64 optional_fixed64 = 8; + sfixed32 optional_sfixed32 = 9; + sfixed64 optional_sfixed64 = 10; + float optional_float = 11; + double optional_double = 12; + bool optional_bool = 13; + string optional_string = 14; + bytes optional_bytes = 15; + + NestedMessage optional_nested_message = 18; + ForeignMessage optional_foreign_message = 19; + + NestedEnum optional_nested_enum = 21; + ForeignEnum optional_foreign_enum = 22; + AliasedEnum optional_aliased_enum = 23; + + string optional_string_piece = 24 [ctype = STRING_PIECE]; + string optional_cord = 25 [ctype = CORD]; + + TestAllTypesProto3 recursive_message = 27; + + // Repeated + repeated int32 repeated_int32 = 31; + repeated int64 repeated_int64 = 32; + repeated uint32 repeated_uint32 = 33; + repeated uint64 repeated_uint64 = 34; + repeated sint32 repeated_sint32 = 35; + repeated sint64 repeated_sint64 = 36; + repeated fixed32 repeated_fixed32 = 37; + repeated fixed64 repeated_fixed64 = 38; + repeated sfixed32 repeated_sfixed32 = 39; + repeated sfixed64 repeated_sfixed64 = 40; + repeated float repeated_float = 41; + repeated double repeated_double = 42; + repeated bool repeated_bool = 43; + repeated string repeated_string = 44; + repeated bytes repeated_bytes = 45; + + repeated NestedMessage repeated_nested_message = 48; + repeated ForeignMessage repeated_foreign_message = 49; + + repeated NestedEnum repeated_nested_enum = 51; + repeated ForeignEnum repeated_foreign_enum = 52; + + repeated string repeated_string_piece = 54 [ctype = STRING_PIECE]; + repeated string repeated_cord = 55 [ctype = CORD]; + + // Packed + repeated int32 packed_int32 = 75 [packed = true]; + repeated int64 packed_int64 = 76 [packed = true]; + repeated uint32 packed_uint32 = 77 [packed = true]; + repeated uint64 packed_uint64 = 78 [packed = true]; + repeated sint32 packed_sint32 = 79 [packed = true]; + repeated sint64 packed_sint64 = 80 [packed = true]; + repeated fixed32 packed_fixed32 = 81 [packed = true]; + repeated fixed64 packed_fixed64 = 82 [packed = true]; + repeated sfixed32 packed_sfixed32 = 83 [packed = true]; + repeated sfixed64 packed_sfixed64 = 84 [packed = true]; + repeated float packed_float = 85 [packed = true]; + repeated double packed_double = 86 [packed = true]; + repeated bool packed_bool = 87 [packed = true]; + repeated NestedEnum packed_nested_enum = 88 [packed = true]; + + // Unpacked + repeated int32 unpacked_int32 = 89 [packed = false]; + repeated int64 unpacked_int64 = 90 [packed = false]; + repeated uint32 unpacked_uint32 = 91 [packed = false]; + repeated uint64 unpacked_uint64 = 92 [packed = false]; + repeated sint32 unpacked_sint32 = 93 [packed = false]; + repeated sint64 unpacked_sint64 = 94 [packed = false]; + repeated fixed32 unpacked_fixed32 = 95 [packed = false]; + repeated fixed64 unpacked_fixed64 = 96 [packed = false]; + repeated sfixed32 unpacked_sfixed32 = 97 [packed = false]; + repeated sfixed64 unpacked_sfixed64 = 98 [packed = false]; + repeated float unpacked_float = 99 [packed = false]; + repeated double unpacked_double = 100 [packed = false]; + repeated bool unpacked_bool = 101 [packed = false]; + repeated NestedEnum unpacked_nested_enum = 102 [packed = false]; + + // Map + map map_int32_int32 = 56; + map map_int64_int64 = 57; + map map_uint32_uint32 = 58; + map map_uint64_uint64 = 59; + map map_sint32_sint32 = 60; + map map_sint64_sint64 = 61; + map map_fixed32_fixed32 = 62; + map map_fixed64_fixed64 = 63; + map map_sfixed32_sfixed32 = 64; + map map_sfixed64_sfixed64 = 65; + map map_int32_float = 66; + map map_int32_double = 67; + map map_bool_bool = 68; + map map_string_string = 69; + map map_string_bytes = 70; + map map_string_nested_message = 71; + map map_string_foreign_message = 72; + map map_string_nested_enum = 73; + map map_string_foreign_enum = 74; + + oneof oneof_field { + uint32 oneof_uint32 = 111; + NestedMessage oneof_nested_message = 112; + string oneof_string = 113; + bytes oneof_bytes = 114; + bool oneof_bool = 115; + uint64 oneof_uint64 = 116; + float oneof_float = 117; + double oneof_double = 118; + NestedEnum oneof_enum = 119; + google.protobuf.NullValue oneof_null_value = 120; + } + + // Well-known types + google.protobuf.BoolValue optional_bool_wrapper = 201; + google.protobuf.Int32Value optional_int32_wrapper = 202; + google.protobuf.Int64Value optional_int64_wrapper = 203; + google.protobuf.UInt32Value optional_uint32_wrapper = 204; + google.protobuf.UInt64Value optional_uint64_wrapper = 205; + google.protobuf.FloatValue optional_float_wrapper = 206; + google.protobuf.DoubleValue optional_double_wrapper = 207; + google.protobuf.StringValue optional_string_wrapper = 208; + google.protobuf.BytesValue optional_bytes_wrapper = 209; + + repeated google.protobuf.BoolValue repeated_bool_wrapper = 211; + repeated google.protobuf.Int32Value repeated_int32_wrapper = 212; + repeated google.protobuf.Int64Value repeated_int64_wrapper = 213; + repeated google.protobuf.UInt32Value repeated_uint32_wrapper = 214; + repeated google.protobuf.UInt64Value repeated_uint64_wrapper = 215; + repeated google.protobuf.FloatValue repeated_float_wrapper = 216; + repeated google.protobuf.DoubleValue repeated_double_wrapper = 217; + repeated google.protobuf.StringValue repeated_string_wrapper = 218; + repeated google.protobuf.BytesValue repeated_bytes_wrapper = 219; + + google.protobuf.Duration optional_duration = 301; + google.protobuf.Timestamp optional_timestamp = 302; + google.protobuf.FieldMask optional_field_mask = 303; + google.protobuf.Struct optional_struct = 304; + google.protobuf.Any optional_any = 305; + google.protobuf.Value optional_value = 306; + google.protobuf.NullValue optional_null_value = 307; + + repeated google.protobuf.Duration repeated_duration = 311; + repeated google.protobuf.Timestamp repeated_timestamp = 312; + repeated google.protobuf.FieldMask repeated_fieldmask = 313; + repeated google.protobuf.Struct repeated_struct = 324; + repeated google.protobuf.Any repeated_any = 315; + repeated google.protobuf.Value repeated_value = 316; + repeated google.protobuf.ListValue repeated_list_value = 317; + + // Test field-name-to-JSON-name convention. + // (protobuf says names can be any valid C/C++ identifier.) + int32 fieldname1 = 401; + int32 field_name2 = 402; + int32 _field_name3 = 403; + int32 field__name4_ = 404; + int32 field0name5 = 405; + int32 field_0_name6 = 406; + int32 fieldName7 = 407; + int32 FieldName8 = 408; + int32 field_Name9 = 409; + int32 Field_Name10 = 410; + int32 FIELD_NAME11 = 411; + int32 FIELD_name12 = 412; + int32 __field_name13 = 413; + int32 __Field_name14 = 414; + int32 field__name15 = 415; + int32 field__Name16 = 416; + int32 field_name17__ = 417; + int32 Field_name18__ = 418; + + // Reserved for testing unknown fields + reserved 501 to 510; +} + +message ForeignMessage { + int32 c = 1; +} + +enum ForeignEnum { + FOREIGN_FOO = 0; + FOREIGN_BAR = 1; + FOREIGN_BAZ = 2; +} + +message NullHypothesisProto3 {} + +message EnumOnlyProto3 { + enum Bool { + kFalse = 0; + kTrue = 1; + } +} diff --git a/Protos/upstream/google/protobuf/timestamp.proto b/Protos/upstream/google/protobuf/timestamp.proto new file mode 100644 index 000000000..fd0bc07dc --- /dev/null +++ b/Protos/upstream/google/protobuf/timestamp.proto @@ -0,0 +1,144 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/timestamppb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TimestampProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// A Timestamp represents a point in time independent of any time zone or local +// calendar, encoded as a count of seconds and fractions of seconds at +// nanosecond resolution. The count is relative to an epoch at UTC midnight on +// January 1, 1970, in the proleptic Gregorian calendar which extends the +// Gregorian calendar backwards to year one. +// +// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +// second table is needed for interpretation, using a [24-hour linear +// smear](https://developers.google.com/time/smear). +// +// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +// restricting to that range, we ensure that we can convert to and from [RFC +// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. +// +// # Examples +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// Example 5: Compute Timestamp from Java `Instant.now()`. +// +// Instant now = Instant.now(); +// +// Timestamp timestamp = +// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) +// .setNanos(now.getNano()).build(); +// +// Example 6: Compute Timestamp from current time in Python. +// +// timestamp = Timestamp() +// timestamp.GetCurrentTime() +// +// # JSON Mapping +// +// In JSON format, the Timestamp type is encoded as a string in the +// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +// where {year} is always expressed using four digits while {month}, {day}, +// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). +// +// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +// 01:30 UTC on January 15, 2017. +// +// In JavaScript, one can convert a Date object to this format using the +// standard +// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) +// method. In Python, a standard `datetime.datetime` object can be converted +// to this format using +// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() +// ) to obtain a formatter capable of generating timestamps in this format. +// +message Timestamp { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +} diff --git a/Protos/upstream/google/protobuf/type.proto b/Protos/upstream/google/protobuf/type.proto new file mode 100644 index 000000000..48cb11e75 --- /dev/null +++ b/Protos/upstream/google/protobuf/type.proto @@ -0,0 +1,193 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/any.proto"; +import "google/protobuf/source_context.proto"; + +option cc_enable_arenas = true; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TypeProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/typepb"; + +// A protocol buffer message type. +message Type { + // The fully qualified message name. + string name = 1; + // The list of fields. + repeated Field fields = 2; + // The list of types appearing in `oneof` definitions in this type. + repeated string oneofs = 3; + // The protocol buffer options. + repeated Option options = 4; + // The source context. + SourceContext source_context = 5; + // The source syntax. + Syntax syntax = 6; + // The source edition string, only valid when syntax is SYNTAX_EDITIONS. + string edition = 7; +} + +// A single field of a message type. +message Field { + // Basic field types. + enum Kind { + // Field type unknown. + TYPE_UNKNOWN = 0; + // Field type double. + TYPE_DOUBLE = 1; + // Field type float. + TYPE_FLOAT = 2; + // Field type int64. + TYPE_INT64 = 3; + // Field type uint64. + TYPE_UINT64 = 4; + // Field type int32. + TYPE_INT32 = 5; + // Field type fixed64. + TYPE_FIXED64 = 6; + // Field type fixed32. + TYPE_FIXED32 = 7; + // Field type bool. + TYPE_BOOL = 8; + // Field type string. + TYPE_STRING = 9; + // Field type group. Proto2 syntax only, and deprecated. + TYPE_GROUP = 10; + // Field type message. + TYPE_MESSAGE = 11; + // Field type bytes. + TYPE_BYTES = 12; + // Field type uint32. + TYPE_UINT32 = 13; + // Field type enum. + TYPE_ENUM = 14; + // Field type sfixed32. + TYPE_SFIXED32 = 15; + // Field type sfixed64. + TYPE_SFIXED64 = 16; + // Field type sint32. + TYPE_SINT32 = 17; + // Field type sint64. + TYPE_SINT64 = 18; + } + + // Whether a field is optional, required, or repeated. + enum Cardinality { + // For fields with unknown cardinality. + CARDINALITY_UNKNOWN = 0; + // For optional fields. + CARDINALITY_OPTIONAL = 1; + // For required fields. Proto2 syntax only. + CARDINALITY_REQUIRED = 2; + // For repeated fields. + CARDINALITY_REPEATED = 3; + } + + // The field type. + Kind kind = 1; + // The field cardinality. + Cardinality cardinality = 2; + // The field number. + int32 number = 3; + // The field name. + string name = 4; + // The field type URL, without the scheme, for message or enumeration + // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + string type_url = 6; + // The index of the field type in `Type.oneofs`, for message or enumeration + // types. The first type has index 1; zero means the type is not in the list. + int32 oneof_index = 7; + // Whether to use alternative packed wire representation. + bool packed = 8; + // The protocol buffer options. + repeated Option options = 9; + // The field JSON name. + string json_name = 10; + // The string value of the default value of this field. Proto2 syntax only. + string default_value = 11; +} + +// Enum type definition. +message Enum { + // Enum type name. + string name = 1; + // Enum value definitions. + repeated EnumValue enumvalue = 2; + // Protocol buffer options. + repeated Option options = 3; + // The source context. + SourceContext source_context = 4; + // The source syntax. + Syntax syntax = 5; + // The source edition string, only valid when syntax is SYNTAX_EDITIONS. + string edition = 6; +} + +// Enum value definition. +message EnumValue { + // Enum value name. + string name = 1; + // Enum value number. + int32 number = 2; + // Protocol buffer options. + repeated Option options = 3; +} + +// A protocol buffer option, which can be attached to a message, field, +// enumeration, etc. +message Option { + // The option's name. For protobuf built-in options (options defined in + // descriptor.proto), this is the short name. For example, `"map_entry"`. + // For custom options, it should be the fully-qualified name. For example, + // `"google.api.http"`. + string name = 1; + // The option's value packed in an Any message. If the value is a primitive, + // the corresponding wrapper type defined in google/protobuf/wrappers.proto + // should be used. If the value is an enum, it should be stored as an int32 + // value using the google.protobuf.Int32Value type. + Any value = 2; +} + +// The syntax in which a protocol buffer element is defined. +enum Syntax { + // Syntax `proto2`. + SYNTAX_PROTO2 = 0; + // Syntax `proto3`. + SYNTAX_PROTO3 = 1; + // Syntax `editions`. + SYNTAX_EDITIONS = 2; +} diff --git a/Protos/google/protobuf/unittest.proto b/Protos/upstream/google/protobuf/unittest.proto similarity index 100% rename from Protos/google/protobuf/unittest.proto rename to Protos/upstream/google/protobuf/unittest.proto diff --git a/Protos/upstream/google/protobuf/unittest_arena.proto b/Protos/upstream/google/protobuf/unittest_arena.proto new file mode 100644 index 000000000..7b3173996 --- /dev/null +++ b/Protos/upstream/google/protobuf/unittest_arena.proto @@ -0,0 +1,43 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto2"; + +package proto2_arena_unittest; + +option cc_enable_arenas = true; + +message NestedMessage { + optional int32 d = 1; +} + +message ArenaMessage { + repeated NestedMessage repeated_nested_message = 1; +} diff --git a/Protos/upstream/google/protobuf/unittest_custom_options.proto b/Protos/upstream/google/protobuf/unittest_custom_options.proto new file mode 100644 index 000000000..d7416619c --- /dev/null +++ b/Protos/upstream/google/protobuf/unittest_custom_options.proto @@ -0,0 +1,466 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: benjy@google.com (Benjy Weinberger) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// A proto file used to test the "custom options" feature of google.protobuf. + +syntax = "proto2"; + +// Some generic_services option(s) added automatically. +// See: http://go/proto2-generic-services-default +option cc_generic_services = true; // auto-added +option java_generic_services = true; // auto-added +option py_generic_services = true; + +// A custom file option (defined below). +option (file_opt1) = 9876543210; + +import "google/protobuf/any.proto"; +import "google/protobuf/descriptor.proto"; + +// We don't put this in a package within proto2 because we need to make sure +// that the generated code doesn't depend on being in the proto2 namespace. +package protobuf_unittest; + +// Some simple test custom options of various types. + +extend google.protobuf.FileOptions { + optional uint64 file_opt1 = 7736974; +} + +extend google.protobuf.MessageOptions { + optional int32 message_opt1 = 7739036; +} + +extend google.protobuf.FieldOptions { + optional fixed64 field_opt1 = 7740936; + // This is useful for testing that we correctly register default values for + // extension options. + optional int32 field_opt2 = 7753913 [default = 42]; +} + +extend google.protobuf.OneofOptions { + optional int32 oneof_opt1 = 7740111; +} + +extend google.protobuf.EnumOptions { + optional sfixed32 enum_opt1 = 7753576; +} + +extend google.protobuf.EnumValueOptions { + optional int32 enum_value_opt1 = 1560678; +} + +extend google.protobuf.ServiceOptions { + optional sint64 service_opt1 = 7887650; +} + +enum MethodOpt1 { + METHODOPT1_VAL1 = 1; + METHODOPT1_VAL2 = 2; +} + +extend google.protobuf.MethodOptions { + optional MethodOpt1 method_opt1 = 7890860; +} + +// A test message with custom options at all possible locations (and also some +// regular options, to make sure they interact nicely). +message TestMessageWithCustomOptions { + option message_set_wire_format = false; + option (message_opt1) = -56; + + optional string field1 = 1 [ctype = CORD, (field_opt1) = 8765432109]; + + oneof AnOneof { + option (oneof_opt1) = -99; + + int32 oneof_field = 2; + } + + map map_field = 3 [(field_opt1) = 12345]; + + enum AnEnum { + option (enum_opt1) = -789; + + ANENUM_VAL1 = 1; + ANENUM_VAL2 = 2 [(enum_value_opt1) = 123]; + } +} + +// A test RPC service with custom options at all possible locations (and also +// some regular options, to make sure they interact nicely). +message CustomOptionFooRequest {} + +message CustomOptionFooResponse {} + +message CustomOptionFooClientMessage {} + +message CustomOptionFooServerMessage {} + +service TestServiceWithCustomOptions { + option (service_opt1) = -9876543210; + + rpc Foo(CustomOptionFooRequest) returns (CustomOptionFooResponse) { + option (method_opt1) = METHODOPT1_VAL2; + } +} + +// Options of every possible field type, so we can test them all exhaustively. + +message DummyMessageContainingEnum { + enum TestEnumType { + TEST_OPTION_ENUM_TYPE1 = 22; + TEST_OPTION_ENUM_TYPE2 = -23; + } +} + +message DummyMessageInvalidAsOptionType {} + +extend google.protobuf.MessageOptions { + optional bool bool_opt = 7706090; + optional int32 int32_opt = 7705709; + optional int64 int64_opt = 7705542; + optional uint32 uint32_opt = 7704880; + optional uint64 uint64_opt = 7702367; + optional sint32 sint32_opt = 7701568; + optional sint64 sint64_opt = 7700863; + optional fixed32 fixed32_opt = 7700307; + optional fixed64 fixed64_opt = 7700194; + optional sfixed32 sfixed32_opt = 7698645; + optional sfixed64 sfixed64_opt = 7685475; + optional float float_opt = 7675390; + optional double double_opt = 7673293; + optional string string_opt = 7673285; + optional bytes bytes_opt = 7673238; + optional DummyMessageContainingEnum.TestEnumType enum_opt = 7673233; + optional DummyMessageInvalidAsOptionType message_type_opt = 7665967; +} + +message CustomOptionMinIntegerValues { + option (bool_opt) = false; + option (int32_opt) = -0x80000000; + option (int64_opt) = -0x8000000000000000; + option (uint32_opt) = 0; + option (uint64_opt) = 0; + option (sint32_opt) = -0x80000000; + option (sint64_opt) = -0x8000000000000000; + option (fixed32_opt) = 0; + option (fixed64_opt) = 0; + option (sfixed32_opt) = -0x80000000; + option (sfixed64_opt) = -0x8000000000000000; +} + +message CustomOptionMaxIntegerValues { + option (bool_opt) = true; + option (int32_opt) = 0x7FFFFFFF; + option (int64_opt) = 0x7FFFFFFFFFFFFFFF; + option (uint32_opt) = 0xFFFFFFFF; + option (uint64_opt) = 0xFFFFFFFFFFFFFFFF; + option (sint32_opt) = 0x7FFFFFFF; + option (sint64_opt) = 0x7FFFFFFFFFFFFFFF; + option (fixed32_opt) = 0xFFFFFFFF; + option (fixed64_opt) = 0xFFFFFFFFFFFFFFFF; + option (sfixed32_opt) = 0x7FFFFFFF; + option (sfixed64_opt) = 0x7FFFFFFFFFFFFFFF; +} + +message CustomOptionOtherValues { + option (int32_opt) = -100; // To test sign-extension. + option (float_opt) = 12.3456789; + option (double_opt) = 1.234567890123456789; + option (string_opt) = "Hello, \"World\""; + option (bytes_opt) = "Hello\0World"; + option (enum_opt) = TEST_OPTION_ENUM_TYPE2; +} + +message SettingRealsFromPositiveInts { + option (float_opt) = 12; + option (double_opt) = 154; +} + +message SettingRealsFromNegativeInts { + option (float_opt) = -12; + option (double_opt) = -154; +} + +// Options of complex message types, themselves combined and extended in +// various ways. + +message ComplexOptionType1 { + optional int32 foo = 1; + optional int32 foo2 = 2; + optional int32 foo3 = 3; + repeated int32 foo4 = 4; + + extensions 100 to max; +} + +message ComplexOptionType2 { + optional ComplexOptionType1 bar = 1; + optional int32 baz = 2; + + message ComplexOptionType4 { + optional int32 waldo = 1; + + extend google.protobuf.MessageOptions { + optional ComplexOptionType4 complex_opt4 = 7633546; + } + } + + optional ComplexOptionType4 fred = 3; + repeated ComplexOptionType4 barney = 4; + + extensions 100 to max; +} + +message ComplexOptionType3 { + optional int32 moo = 1; + + optional group ComplexOptionType5 = 2 { + optional int32 plugh = 3; + } +} + +extend ComplexOptionType1 { + optional int32 mooo = 7663707; + optional ComplexOptionType3 corge = 7663442; +} + +extend ComplexOptionType2 { + optional int32 grault = 7650927; + optional ComplexOptionType1 garply = 7649992; +} + +extend google.protobuf.MessageOptions { + optional protobuf_unittest.ComplexOptionType1 complex_opt1 = 7646756; + optional ComplexOptionType2 complex_opt2 = 7636949; + optional ComplexOptionType3 complex_opt3 = 7636463; + optional group ComplexOpt6 = 7595468 { + optional int32 xyzzy = 7593951; + } +} + +// Note that we try various different ways of naming the same extension. +message VariousComplexOptions { + option (.protobuf_unittest.complex_opt1).foo = 42; + option (protobuf_unittest.complex_opt1).(.protobuf_unittest.mooo) = 324; + option (.protobuf_unittest.complex_opt1).(protobuf_unittest.corge).moo = 876; + option (protobuf_unittest.complex_opt1).foo4 = 99; + option (protobuf_unittest.complex_opt1).foo4 = 88; + option (complex_opt2).baz = 987; + option (complex_opt2).(grault) = 654; + option (complex_opt2).bar.foo = 743; + option (complex_opt2).bar.(mooo) = 1999; + option (complex_opt2).bar.(protobuf_unittest.corge).moo = 2008; + option (complex_opt2).(garply).foo = 741; + option (complex_opt2).(garply).(.protobuf_unittest.mooo) = 1998; + option (complex_opt2).(protobuf_unittest.garply).(corge).moo = 2121; + option (ComplexOptionType2.ComplexOptionType4.complex_opt4).waldo = 1971; + option (complex_opt2).fred.waldo = 321; + option (complex_opt2).barney = { + waldo: 101 + }; + option (complex_opt2).barney = { + waldo: 212 + }; + option (protobuf_unittest.complex_opt3).moo = 9; + option (complex_opt3).complexoptiontype5.plugh = 22; + option (complexopt6).xyzzy = 24; +} + +// ------------------------------------------------------ +// Definitions for testing aggregate option parsing. +// See descriptor_unittest.cc. + +message AggregateMessageSet { + option message_set_wire_format = true; + + extensions 4 to max; +} + +message AggregateMessageSetElement { + extend AggregateMessageSet { + optional AggregateMessageSetElement message_set_extension = 15447542; + } + optional string s = 1; +} + +// A helper type used to test aggregate option parsing +message Aggregate { + optional int32 i = 1; + optional string s = 2; + + // A nested object + optional Aggregate sub = 3; + + // To test the parsing of extensions inside aggregate values + optional google.protobuf.FileOptions file = 4; + extend google.protobuf.FileOptions { + optional Aggregate nested = 15476903; + } + + // An embedded message set + optional AggregateMessageSet mset = 5; + + // An any + optional google.protobuf.Any any = 6; +} + +// Allow Aggregate to be used as an option at all possible locations +// in the .proto grammar. +extend google.protobuf.FileOptions { + optional Aggregate fileopt = 15478479; +} +extend google.protobuf.MessageOptions { + optional Aggregate msgopt = 15480088; +} +extend google.protobuf.FieldOptions { + optional Aggregate fieldopt = 15481374; +} +extend google.protobuf.EnumOptions { + optional Aggregate enumopt = 15483218; +} +extend google.protobuf.EnumValueOptions { + optional Aggregate enumvalopt = 15486921; +} +extend google.protobuf.ServiceOptions { + optional Aggregate serviceopt = 15497145; +} +extend google.protobuf.MethodOptions { + optional Aggregate methodopt = 15512713; +} + +// Try using AggregateOption at different points in the proto grammar +option (fileopt) = { + s: 'FileAnnotation' + // Also test the handling of comments + /* of both types */ + i: 100 + + sub { s: 'NestedFileAnnotation' } + + // Include a google.protobuf.FileOptions and recursively extend it with + // another fileopt. + file { + [protobuf_unittest.fileopt] { s: 'FileExtensionAnnotation' } + } + + // A message set inside an option value + mset { + [protobuf_unittest.AggregateMessageSetElement.message_set_extension] { + s: 'EmbeddedMessageSetElement' + } + } + + any { + [type.googleapis.com/protobuf_unittest.AggregateMessageSetElement] { + s: 'EmbeddedMessageSetElement' + } + } +}; + +message AggregateMessage { + option (msgopt) = { + i: 101 + s: 'MessageAnnotation' + }; + + optional int32 fieldname = 1 [(fieldopt) = { s: 'FieldAnnotation' }]; +} + +service AggregateService { + option (serviceopt) = { + s: 'ServiceAnnotation' + }; + + rpc Method(AggregateMessage) returns (AggregateMessage) { + option (methodopt) = { + s: 'MethodAnnotation' + }; + } +} + +enum AggregateEnum { + option (enumopt) = { + s: 'EnumAnnotation' + }; + + VALUE = 1 [(enumvalopt) = { s: 'EnumValueAnnotation' }]; +} + +// Test custom options for nested type. +message NestedOptionType { + message NestedMessage { + option (message_opt1) = 1001; + + optional int32 nested_field = 1 [(field_opt1) = 1002]; + } + enum NestedEnum { + option (enum_opt1) = 1003; + + NESTED_ENUM_VALUE = 1 [(enum_value_opt1) = 1004]; + } + extend google.protobuf.FileOptions { + optional int32 nested_extension = 7912573 [(field_opt2) = 1005]; + } +} + +// Custom message option that has a required enum field. +// WARNING: this is strongly discouraged! +message OldOptionType { + enum TestEnum { + OLD_VALUE = 0; + } + required TestEnum value = 1; +} + +// Updated version of the custom option above. +message NewOptionType { + enum TestEnum { + OLD_VALUE = 0; + NEW_VALUE = 1; + } + required TestEnum value = 1; +} + +extend google.protobuf.MessageOptions { + optional OldOptionType required_enum_opt = 106161807; +} + +// Test message using the "required_enum_opt" option defined above. +message TestMessageWithRequiredEnumOption { + option (required_enum_opt) = { + value: OLD_VALUE + }; +} diff --git a/Protos/upstream/google/protobuf/unittest_drop_unknown_fields.proto b/Protos/upstream/google/protobuf/unittest_drop_unknown_fields.proto new file mode 100644 index 000000000..a8a98ad39 --- /dev/null +++ b/Protos/upstream/google/protobuf/unittest_drop_unknown_fields.proto @@ -0,0 +1,58 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package unittest_drop_unknown_fields; + +option objc_class_prefix = "DropUnknowns"; +option csharp_namespace = "Google.Protobuf.TestProtos"; + +message Foo { + enum NestedEnum { + FOO = 0; + BAR = 1; + BAZ = 2; + } + int32 int32_value = 1; + NestedEnum enum_value = 2; +} + +message FooWithExtraFields { + enum NestedEnum { + FOO = 0; + BAR = 1; + BAZ = 2; + MOO = 3; + } + int32 int32_value = 1; + NestedEnum enum_value = 2; + int32 extra_int32_value = 3; +} diff --git a/Protos/google/protobuf/unittest_embed_optimize_for.proto b/Protos/upstream/google/protobuf/unittest_embed_optimize_for.proto similarity index 100% rename from Protos/google/protobuf/unittest_embed_optimize_for.proto rename to Protos/upstream/google/protobuf/unittest_embed_optimize_for.proto diff --git a/Protos/upstream/google/protobuf/unittest_empty.proto b/Protos/upstream/google/protobuf/unittest_empty.proto new file mode 100644 index 000000000..632cc041e --- /dev/null +++ b/Protos/upstream/google/protobuf/unittest_empty.proto @@ -0,0 +1,41 @@ +// NOLINT(no_package_specified): Test proto with no package + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// This file intentionally left blank. (At one point this wouldn't compile +// correctly.) + +syntax = "proto2"; + diff --git a/Protos/google/protobuf/unittest_enormous_descriptor.proto b/Protos/upstream/google/protobuf/unittest_enormous_descriptor.proto similarity index 100% rename from Protos/google/protobuf/unittest_enormous_descriptor.proto rename to Protos/upstream/google/protobuf/unittest_enormous_descriptor.proto diff --git a/Protos/google/protobuf/unittest_import.proto b/Protos/upstream/google/protobuf/unittest_import.proto similarity index 100% rename from Protos/google/protobuf/unittest_import.proto rename to Protos/upstream/google/protobuf/unittest_import.proto diff --git a/Protos/google/protobuf/unittest_import_lite.proto b/Protos/upstream/google/protobuf/unittest_import_lite.proto similarity index 100% rename from Protos/google/protobuf/unittest_import_lite.proto rename to Protos/upstream/google/protobuf/unittest_import_lite.proto diff --git a/Protos/upstream/google/protobuf/unittest_import_public.proto b/Protos/upstream/google/protobuf/unittest_import_public.proto new file mode 100644 index 000000000..ffaf77369 --- /dev/null +++ b/Protos/upstream/google/protobuf/unittest_import_public.proto @@ -0,0 +1,41 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: liujisi@google.com (Pherl Liu) + +syntax = "proto2"; + +package protobuf_unittest_import; + +option java_package = "com.google.protobuf.test"; + +message PublicImportMessage { + optional int32 e = 1; +} diff --git a/Protos/upstream/google/protobuf/unittest_import_public_lite.proto b/Protos/upstream/google/protobuf/unittest_import_public_lite.proto new file mode 100644 index 000000000..b64e7f866 --- /dev/null +++ b/Protos/upstream/google/protobuf/unittest_import_public_lite.proto @@ -0,0 +1,42 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: liujisi@google.com (Pherl Liu) + +syntax = "proto2"; + +package protobuf_unittest_import; + +option optimize_for = LITE_RUNTIME; +option java_package = "com.google.protobuf"; + +message PublicImportMessageLite { + optional int32 e = 1; +} diff --git a/Protos/google/protobuf/unittest_lazy_dependencies.proto b/Protos/upstream/google/protobuf/unittest_lazy_dependencies.proto similarity index 100% rename from Protos/google/protobuf/unittest_lazy_dependencies.proto rename to Protos/upstream/google/protobuf/unittest_lazy_dependencies.proto diff --git a/Protos/google/protobuf/unittest_lazy_dependencies_custom_option.proto b/Protos/upstream/google/protobuf/unittest_lazy_dependencies_custom_option.proto similarity index 100% rename from Protos/google/protobuf/unittest_lazy_dependencies_custom_option.proto rename to Protos/upstream/google/protobuf/unittest_lazy_dependencies_custom_option.proto diff --git a/Protos/google/protobuf/unittest_lazy_dependencies_enum.proto b/Protos/upstream/google/protobuf/unittest_lazy_dependencies_enum.proto similarity index 100% rename from Protos/google/protobuf/unittest_lazy_dependencies_enum.proto rename to Protos/upstream/google/protobuf/unittest_lazy_dependencies_enum.proto diff --git a/Protos/google/protobuf/unittest_lite.proto b/Protos/upstream/google/protobuf/unittest_lite.proto similarity index 100% rename from Protos/google/protobuf/unittest_lite.proto rename to Protos/upstream/google/protobuf/unittest_lite.proto diff --git a/Protos/google/protobuf/unittest_lite_imports_nonlite.proto b/Protos/upstream/google/protobuf/unittest_lite_imports_nonlite.proto similarity index 100% rename from Protos/google/protobuf/unittest_lite_imports_nonlite.proto rename to Protos/upstream/google/protobuf/unittest_lite_imports_nonlite.proto diff --git a/Protos/google/protobuf/unittest_mset.proto b/Protos/upstream/google/protobuf/unittest_mset.proto similarity index 100% rename from Protos/google/protobuf/unittest_mset.proto rename to Protos/upstream/google/protobuf/unittest_mset.proto diff --git a/Protos/upstream/google/protobuf/unittest_mset_wire_format.proto b/Protos/upstream/google/protobuf/unittest_mset_wire_format.proto new file mode 100644 index 000000000..022868e4f --- /dev/null +++ b/Protos/upstream/google/protobuf/unittest_mset_wire_format.proto @@ -0,0 +1,61 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// This file contains messages for testing message_set_wire_format. + +syntax = "proto2"; + +package proto2_wireformat_unittest; + +option cc_enable_arenas = true; +option optimize_for = SPEED; +option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; + +// A message with message_set_wire_format. +message TestMessageSet { + option message_set_wire_format = true; + + extensions 4 to 529999999; + + extensions 530000000 to max + [declaration = { + number: 1952731290, + full_name: ".protobuf_unittest_v1api.TestMessageSetExtension3.message_set_extension", + type: ".protobuf_unittest_v1api.TestMessageSetExtension3" + }]; +} + +message TestMessageSetWireFormatContainer { + optional TestMessageSet message_set = 1; +} diff --git a/Protos/google/protobuf/unittest_no_field_presence.proto b/Protos/upstream/google/protobuf/unittest_no_field_presence.proto similarity index 100% rename from Protos/google/protobuf/unittest_no_field_presence.proto rename to Protos/upstream/google/protobuf/unittest_no_field_presence.proto diff --git a/Protos/upstream/google/protobuf/unittest_no_generic_services.proto b/Protos/upstream/google/protobuf/unittest_no_generic_services.proto new file mode 100644 index 000000000..7b18aaf4a --- /dev/null +++ b/Protos/upstream/google/protobuf/unittest_no_generic_services.proto @@ -0,0 +1,55 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) + +syntax = "proto2"; + +package protobuf_unittest.no_generic_services_test; + + +// *_generic_services are false by default. + +message TestMessage { + optional int32 a = 1; + extensions 1000 to max; +} + +enum TestEnum { + FOO = 1; +} + +extend TestMessage { + optional int32 test_extension = 1000; +} + +service TestService { + rpc Foo(TestMessage) returns (TestMessage); +} diff --git a/Protos/google/protobuf/unittest_optimize_for.proto b/Protos/upstream/google/protobuf/unittest_optimize_for.proto similarity index 100% rename from Protos/google/protobuf/unittest_optimize_for.proto rename to Protos/upstream/google/protobuf/unittest_optimize_for.proto diff --git a/Protos/upstream/google/protobuf/unittest_preserve_unknown_enum.proto b/Protos/upstream/google/protobuf/unittest_preserve_unknown_enum.proto new file mode 100644 index 000000000..ab51c001e --- /dev/null +++ b/Protos/upstream/google/protobuf/unittest_preserve_unknown_enum.proto @@ -0,0 +1,71 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package proto3_preserve_unknown_enum_unittest; + +option objc_class_prefix = "UnknownEnums"; +option csharp_namespace = "Google.Protobuf.TestProtos"; + +enum MyEnum { + FOO = 0; + BAR = 1; + BAZ = 2; +} + +enum MyEnumPlusExtra { + E_FOO = 0; + E_BAR = 1; + E_BAZ = 2; + E_EXTRA = 3; +} + +message MyMessage { + MyEnum e = 1; + repeated MyEnum repeated_e = 2; + repeated MyEnum repeated_packed_e = 3 [packed = true]; + repeated MyEnumPlusExtra repeated_packed_unexpected_e = 4; // not packed + oneof o { + MyEnum oneof_e_1 = 5; + MyEnum oneof_e_2 = 6; + } +} + +message MyMessagePlusExtra { + MyEnumPlusExtra e = 1; + repeated MyEnumPlusExtra repeated_e = 2; + repeated MyEnumPlusExtra repeated_packed_e = 3 [packed = true]; + repeated MyEnumPlusExtra repeated_packed_unexpected_e = 4 [packed = true]; + oneof o { + MyEnumPlusExtra oneof_e_1 = 5; + MyEnumPlusExtra oneof_e_2 = 6; + } +} diff --git a/Protos/upstream/google/protobuf/unittest_preserve_unknown_enum2.proto b/Protos/upstream/google/protobuf/unittest_preserve_unknown_enum2.proto new file mode 100644 index 000000000..dfce0e06b --- /dev/null +++ b/Protos/upstream/google/protobuf/unittest_preserve_unknown_enum2.proto @@ -0,0 +1,50 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto2"; + +package proto2_preserve_unknown_enum_unittest; + +enum MyEnum { + FOO = 0; + BAR = 1; + BAZ = 2; +} + +message MyMessage { + optional MyEnum e = 1; + repeated MyEnum repeated_e = 2; + repeated MyEnum repeated_packed_e = 3 [packed = true]; + repeated MyEnum repeated_packed_unexpected_e = 4; // not packed + oneof o { + MyEnum oneof_e_1 = 5; + MyEnum oneof_e_2 = 6; + } +} diff --git a/Protos/google/protobuf/unittest_proto3.proto b/Protos/upstream/google/protobuf/unittest_proto3.proto similarity index 100% rename from Protos/google/protobuf/unittest_proto3.proto rename to Protos/upstream/google/protobuf/unittest_proto3.proto diff --git a/Protos/google/protobuf/unittest_proto3_arena.proto b/Protos/upstream/google/protobuf/unittest_proto3_arena.proto similarity index 100% rename from Protos/google/protobuf/unittest_proto3_arena.proto rename to Protos/upstream/google/protobuf/unittest_proto3_arena.proto diff --git a/Protos/google/protobuf/unittest_proto3_arena_lite.proto b/Protos/upstream/google/protobuf/unittest_proto3_arena_lite.proto similarity index 100% rename from Protos/google/protobuf/unittest_proto3_arena_lite.proto rename to Protos/upstream/google/protobuf/unittest_proto3_arena_lite.proto diff --git a/Protos/google/protobuf/unittest_proto3_bad_macros.proto b/Protos/upstream/google/protobuf/unittest_proto3_bad_macros.proto similarity index 100% rename from Protos/google/protobuf/unittest_proto3_bad_macros.proto rename to Protos/upstream/google/protobuf/unittest_proto3_bad_macros.proto diff --git a/Protos/google/protobuf/unittest_proto3_lite.proto b/Protos/upstream/google/protobuf/unittest_proto3_lite.proto similarity index 100% rename from Protos/google/protobuf/unittest_proto3_lite.proto rename to Protos/upstream/google/protobuf/unittest_proto3_lite.proto diff --git a/Protos/upstream/google/protobuf/unittest_proto3_optional.proto b/Protos/upstream/google/protobuf/unittest_proto3_optional.proto new file mode 100644 index 000000000..7085c79e4 --- /dev/null +++ b/Protos/upstream/google/protobuf/unittest_proto3_optional.proto @@ -0,0 +1,101 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package protobuf_unittest; + +import "google/protobuf/descriptor.proto"; + +option csharp_namespace = "ProtobufUnittest"; +option java_multiple_files = true; +option java_package = "com.google.protobuf.testing.proto"; + +message TestProto3Optional { + message NestedMessage { + // The field name "b" fails to compile in proto1 because it conflicts with + // a local variable named "b" in one of the generated methods. Doh. + // This file needs to compile in proto1 to test backwards-compatibility. + optional int32 bb = 1; + } + + enum NestedEnum { + UNSPECIFIED = 0; + FOO = 1; + BAR = 2; + BAZ = 3; + NEG = -1; // Intentionally negative. + } + + // Singular + optional int32 optional_int32 = 1; + optional int64 optional_int64 = 2; + optional uint32 optional_uint32 = 3; + optional uint64 optional_uint64 = 4; + optional sint32 optional_sint32 = 5; + optional sint64 optional_sint64 = 6; + optional fixed32 optional_fixed32 = 7; + optional fixed64 optional_fixed64 = 8; + optional sfixed32 optional_sfixed32 = 9; + optional sfixed64 optional_sfixed64 = 10; + optional float optional_float = 11; + optional double optional_double = 12; + optional bool optional_bool = 13; + optional string optional_string = 14; + optional bytes optional_bytes = 15; + optional string optional_cord = 16 [ctype = CORD]; + + optional NestedMessage optional_nested_message = 18; + optional NestedMessage lazy_nested_message = 19 [lazy = true]; + optional NestedEnum optional_nested_enum = 21; + + // Add some non-optional fields to verify we can mix them. + int32 singular_int32 = 22; + int64 singular_int64 = 23; +} + +message TestProto3OptionalMessage { + message NestedMessage { + string s = 1; + } + + NestedMessage nested_message = 1; + optional NestedMessage optional_nested_message = 2; +} + +message Proto3OptionalExtensions { + option (protobuf_unittest.Proto3OptionalExtensions.ext_no_optional) = 8; + option (protobuf_unittest.Proto3OptionalExtensions.ext_with_optional) = 16; + + extend google.protobuf.MessageOptions { + int32 ext_no_optional = 355886728; + optional int32 ext_with_optional = 355886729; + } +} diff --git a/Protos/google/protobuf/unittest_retention.proto b/Protos/upstream/google/protobuf/unittest_retention.proto similarity index 100% rename from Protos/google/protobuf/unittest_retention.proto rename to Protos/upstream/google/protobuf/unittest_retention.proto diff --git a/Protos/upstream/google/protobuf/unittest_well_known_types.proto b/Protos/upstream/google/protobuf/unittest_well_known_types.proto new file mode 100644 index 000000000..f03070022 --- /dev/null +++ b/Protos/upstream/google/protobuf/unittest_well_known_types.proto @@ -0,0 +1,144 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package protobuf_unittest; + +option csharp_namespace = "Google.Protobuf.TestProtos"; +option java_multiple_files = true; +option java_package = "com.google.protobuf.test"; + +import "google/protobuf/any.proto"; +import "google/protobuf/api.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/source_context.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/type.proto"; +import "google/protobuf/wrappers.proto"; + +// Test that we can include all well-known types. +// Each wrapper type is included separately, as languages +// map handle different wrappers in different ways. +message TestWellKnownTypes { + google.protobuf.Any any_field = 1; + google.protobuf.Api api_field = 2; + google.protobuf.Duration duration_field = 3; + google.protobuf.Empty empty_field = 4; + google.protobuf.FieldMask field_mask_field = 5; + google.protobuf.SourceContext source_context_field = 6; + google.protobuf.Struct struct_field = 7; + google.protobuf.Timestamp timestamp_field = 8; + google.protobuf.Type type_field = 9; + google.protobuf.DoubleValue double_field = 10; + google.protobuf.FloatValue float_field = 11; + google.protobuf.Int64Value int64_field = 12; + google.protobuf.UInt64Value uint64_field = 13; + google.protobuf.Int32Value int32_field = 14; + google.protobuf.UInt32Value uint32_field = 15; + google.protobuf.BoolValue bool_field = 16; + google.protobuf.StringValue string_field = 17; + google.protobuf.BytesValue bytes_field = 18; + // Part of struct, but useful to be able to test separately + google.protobuf.Value value_field = 19; +} + +// A repeated field for each well-known type. +message RepeatedWellKnownTypes { + repeated google.protobuf.Any any_field = 1; + repeated google.protobuf.Api api_field = 2; + repeated google.protobuf.Duration duration_field = 3; + repeated google.protobuf.Empty empty_field = 4; + repeated google.protobuf.FieldMask field_mask_field = 5; + repeated google.protobuf.SourceContext source_context_field = 6; + repeated google.protobuf.Struct struct_field = 7; + repeated google.protobuf.Timestamp timestamp_field = 8; + repeated google.protobuf.Type type_field = 9; + // These don't actually make a lot of sense, but they're not prohibited... + repeated google.protobuf.DoubleValue double_field = 10; + repeated google.protobuf.FloatValue float_field = 11; + repeated google.protobuf.Int64Value int64_field = 12; + repeated google.protobuf.UInt64Value uint64_field = 13; + repeated google.protobuf.Int32Value int32_field = 14; + repeated google.protobuf.UInt32Value uint32_field = 15; + repeated google.protobuf.BoolValue bool_field = 16; + repeated google.protobuf.StringValue string_field = 17; + repeated google.protobuf.BytesValue bytes_field = 18; +} + +message OneofWellKnownTypes { + oneof oneof_field { + google.protobuf.Any any_field = 1; + google.protobuf.Api api_field = 2; + google.protobuf.Duration duration_field = 3; + google.protobuf.Empty empty_field = 4; + google.protobuf.FieldMask field_mask_field = 5; + google.protobuf.SourceContext source_context_field = 6; + google.protobuf.Struct struct_field = 7; + google.protobuf.Timestamp timestamp_field = 8; + google.protobuf.Type type_field = 9; + google.protobuf.DoubleValue double_field = 10; + google.protobuf.FloatValue float_field = 11; + google.protobuf.Int64Value int64_field = 12; + google.protobuf.UInt64Value uint64_field = 13; + google.protobuf.Int32Value int32_field = 14; + google.protobuf.UInt32Value uint32_field = 15; + google.protobuf.BoolValue bool_field = 16; + google.protobuf.StringValue string_field = 17; + google.protobuf.BytesValue bytes_field = 18; + } +} + +// A map field for each well-known type. We only +// need to worry about the value part of the map being the +// well-known types, as messages can't be map keys. +message MapWellKnownTypes { + map any_field = 1; + map api_field = 2; + map duration_field = 3; + map empty_field = 4; + map field_mask_field = 5; + map source_context_field = 6; + map struct_field = 7; + map timestamp_field = 8; + map type_field = 9; + map double_field = 10; + map float_field = 11; + map int64_field = 12; + map uint64_field = 13; + map int32_field = 14; + map uint32_field = 15; + map bool_field = 16; + map string_field = 17; + map bytes_field = 18; +} diff --git a/Protos/upstream/google/protobuf/wrappers.proto b/Protos/upstream/google/protobuf/wrappers.proto new file mode 100644 index 000000000..1959fa55a --- /dev/null +++ b/Protos/upstream/google/protobuf/wrappers.proto @@ -0,0 +1,123 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Wrappers for primitive (non-message) types. These types are useful +// for embedding primitives in the `google.protobuf.Any` type and for places +// where we need to distinguish between the absence of a primitive +// typed field and its default value. +// +// These wrappers have no meaningful use within repeated fields as they lack +// the ability to detect presence on individual elements. +// These wrappers have no meaningful use within a map or a oneof since +// individual entries of a map or fields of a oneof can already detect presence. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/wrapperspb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "WrappersProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// Wrapper message for `double`. +// +// The JSON representation for `DoubleValue` is JSON number. +message DoubleValue { + // The double value. + double value = 1; +} + +// Wrapper message for `float`. +// +// The JSON representation for `FloatValue` is JSON number. +message FloatValue { + // The float value. + float value = 1; +} + +// Wrapper message for `int64`. +// +// The JSON representation for `Int64Value` is JSON string. +message Int64Value { + // The int64 value. + int64 value = 1; +} + +// Wrapper message for `uint64`. +// +// The JSON representation for `UInt64Value` is JSON string. +message UInt64Value { + // The uint64 value. + uint64 value = 1; +} + +// Wrapper message for `int32`. +// +// The JSON representation for `Int32Value` is JSON number. +message Int32Value { + // The int32 value. + int32 value = 1; +} + +// Wrapper message for `uint32`. +// +// The JSON representation for `UInt32Value` is JSON number. +message UInt32Value { + // The uint32 value. + uint32 value = 1; +} + +// Wrapper message for `bool`. +// +// The JSON representation for `BoolValue` is JSON `true` and `false`. +message BoolValue { + // The bool value. + bool value = 1; +} + +// Wrapper message for `string`. +// +// The JSON representation for `StringValue` is JSON string. +message StringValue { + // The string value. + string value = 1; +} + +// Wrapper message for `bytes`. +// +// The JSON representation for `BytesValue` is JSON string. +message BytesValue { + // The bytes value. + bytes value = 1; +} diff --git a/Reference/conformance/conformance.pb.swift b/Reference/Conformance/conformance/conformance.pb.swift similarity index 100% rename from Reference/conformance/conformance.pb.swift rename to Reference/Conformance/conformance/conformance.pb.swift diff --git a/Reference/google/protobuf/test_messages_proto2.pb.swift b/Reference/Conformance/google/protobuf/test_messages_proto2.pb.swift similarity index 100% rename from Reference/google/protobuf/test_messages_proto2.pb.swift rename to Reference/Conformance/google/protobuf/test_messages_proto2.pb.swift diff --git a/Reference/google/protobuf/test_messages_proto3.pb.swift b/Reference/Conformance/google/protobuf/test_messages_proto3.pb.swift similarity index 100% rename from Reference/google/protobuf/test_messages_proto3.pb.swift rename to Reference/Conformance/google/protobuf/test_messages_proto3.pb.swift diff --git a/Reference/google/protobuf/any.pb.swift b/Reference/SwiftProtobuf/google/protobuf/any.pb.swift similarity index 100% rename from Reference/google/protobuf/any.pb.swift rename to Reference/SwiftProtobuf/google/protobuf/any.pb.swift diff --git a/Reference/google/protobuf/api.pb.swift b/Reference/SwiftProtobuf/google/protobuf/api.pb.swift similarity index 100% rename from Reference/google/protobuf/api.pb.swift rename to Reference/SwiftProtobuf/google/protobuf/api.pb.swift diff --git a/Reference/google/protobuf/descriptor.pb.swift b/Reference/SwiftProtobuf/google/protobuf/descriptor.pb.swift similarity index 100% rename from Reference/google/protobuf/descriptor.pb.swift rename to Reference/SwiftProtobuf/google/protobuf/descriptor.pb.swift diff --git a/Reference/google/protobuf/duration.pb.swift b/Reference/SwiftProtobuf/google/protobuf/duration.pb.swift similarity index 100% rename from Reference/google/protobuf/duration.pb.swift rename to Reference/SwiftProtobuf/google/protobuf/duration.pb.swift diff --git a/Reference/google/protobuf/empty.pb.swift b/Reference/SwiftProtobuf/google/protobuf/empty.pb.swift similarity index 100% rename from Reference/google/protobuf/empty.pb.swift rename to Reference/SwiftProtobuf/google/protobuf/empty.pb.swift diff --git a/Reference/google/protobuf/field_mask.pb.swift b/Reference/SwiftProtobuf/google/protobuf/field_mask.pb.swift similarity index 100% rename from Reference/google/protobuf/field_mask.pb.swift rename to Reference/SwiftProtobuf/google/protobuf/field_mask.pb.swift diff --git a/Reference/google/protobuf/source_context.pb.swift b/Reference/SwiftProtobuf/google/protobuf/source_context.pb.swift similarity index 100% rename from Reference/google/protobuf/source_context.pb.swift rename to Reference/SwiftProtobuf/google/protobuf/source_context.pb.swift diff --git a/Reference/google/protobuf/struct.pb.swift b/Reference/SwiftProtobuf/google/protobuf/struct.pb.swift similarity index 100% rename from Reference/google/protobuf/struct.pb.swift rename to Reference/SwiftProtobuf/google/protobuf/struct.pb.swift diff --git a/Reference/google/protobuf/timestamp.pb.swift b/Reference/SwiftProtobuf/google/protobuf/timestamp.pb.swift similarity index 100% rename from Reference/google/protobuf/timestamp.pb.swift rename to Reference/SwiftProtobuf/google/protobuf/timestamp.pb.swift diff --git a/Reference/google/protobuf/type.pb.swift b/Reference/SwiftProtobuf/google/protobuf/type.pb.swift similarity index 100% rename from Reference/google/protobuf/type.pb.swift rename to Reference/SwiftProtobuf/google/protobuf/type.pb.swift diff --git a/Reference/google/protobuf/wrappers.pb.swift b/Reference/SwiftProtobuf/google/protobuf/wrappers.pb.swift similarity index 100% rename from Reference/google/protobuf/wrappers.pb.swift rename to Reference/SwiftProtobuf/google/protobuf/wrappers.pb.swift diff --git a/Reference/google/protobuf/compiler/plugin.pb.swift b/Reference/SwiftProtobufPluginLibrary/google/protobuf/compiler/plugin.pb.swift similarity index 100% rename from Reference/google/protobuf/compiler/plugin.pb.swift rename to Reference/SwiftProtobufPluginLibrary/google/protobuf/compiler/plugin.pb.swift diff --git a/Reference/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.pb.swift b/Reference/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.pb.swift index 2ab607f7b..d651cddcc 100644 --- a/Reference/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.pb.swift +++ b/Reference/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto +// Source: swift_protobuf_module_mappings.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Reference/pluginlib_descriptor_test.pb.swift b/Reference/SwiftProtobufPluginLibraryTests/pluginlib_descriptor_test.pb.swift similarity index 100% rename from Reference/pluginlib_descriptor_test.pb.swift rename to Reference/SwiftProtobufPluginLibraryTests/pluginlib_descriptor_test.pb.swift diff --git a/Reference/pluginlib_descriptor_test2.pb.swift b/Reference/SwiftProtobufPluginLibraryTests/pluginlib_descriptor_test2.pb.swift similarity index 100% rename from Reference/pluginlib_descriptor_test2.pb.swift rename to Reference/SwiftProtobufPluginLibraryTests/pluginlib_descriptor_test2.pb.swift diff --git a/Reference/SwiftProtobufTests/any_test.pb.swift b/Reference/SwiftProtobufTests/any_test.pb.swift new file mode 100644 index 000000000..07d97e762 --- /dev/null +++ b/Reference/SwiftProtobufTests/any_test.pb.swift @@ -0,0 +1,140 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: any_test.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +struct ProtobufUnittest_TestAny { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var int32Value: Int32 = 0 + + var anyValue: SwiftProtobuf.Google_Protobuf_Any { + get {return _anyValue ?? SwiftProtobuf.Google_Protobuf_Any()} + set {_anyValue = newValue} + } + /// Returns true if `anyValue` has been explicitly set. + var hasAnyValue: Bool {return self._anyValue != nil} + /// Clears the value of `anyValue`. Subsequent reads from it will return its default value. + mutating func clearAnyValue() {self._anyValue = nil} + + var repeatedAnyValue: [SwiftProtobuf.Google_Protobuf_Any] = [] + + var text: String = String() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _anyValue: SwiftProtobuf.Google_Protobuf_Any? = nil +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittest_TestAny: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest" + +extension ProtobufUnittest_TestAny: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestAny" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "int32_value"), + 2: .standard(proto: "any_value"), + 3: .standard(proto: "repeated_any_value"), + 4: .same(proto: "text"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.int32Value) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._anyValue) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedAnyValue) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.text) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.int32Value != 0 { + try visitor.visitSingularInt32Field(value: self.int32Value, fieldNumber: 1) + } + try { if let v = self._anyValue { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if !self.repeatedAnyValue.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedAnyValue, fieldNumber: 3) + } + if !self.text.isEmpty { + try visitor.visitSingularStringField(value: self.text, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestAny, rhs: ProtobufUnittest_TestAny) -> Bool { + if lhs.int32Value != rhs.int32Value {return false} + if lhs._anyValue != rhs._anyValue {return false} + if lhs.repeatedAnyValue != rhs.repeatedAnyValue {return false} + if lhs.text != rhs.text {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/fuzz_testing.pb.swift b/Reference/SwiftProtobufTests/fuzz_testing.pb.swift similarity index 100% rename from Reference/fuzz_testing.pb.swift rename to Reference/SwiftProtobufTests/fuzz_testing.pb.swift diff --git a/Reference/generated_swift_names_enum_cases.pb.swift b/Reference/SwiftProtobufTests/generated_swift_names_enum_cases.pb.swift similarity index 100% rename from Reference/generated_swift_names_enum_cases.pb.swift rename to Reference/SwiftProtobufTests/generated_swift_names_enum_cases.pb.swift diff --git a/Reference/generated_swift_names_enums.pb.swift b/Reference/SwiftProtobufTests/generated_swift_names_enums.pb.swift similarity index 100% rename from Reference/generated_swift_names_enums.pb.swift rename to Reference/SwiftProtobufTests/generated_swift_names_enums.pb.swift diff --git a/Reference/generated_swift_names_fields.pb.swift b/Reference/SwiftProtobufTests/generated_swift_names_fields.pb.swift similarity index 100% rename from Reference/generated_swift_names_fields.pb.swift rename to Reference/SwiftProtobufTests/generated_swift_names_fields.pb.swift diff --git a/Reference/generated_swift_names_messages.pb.swift b/Reference/SwiftProtobufTests/generated_swift_names_messages.pb.swift similarity index 100% rename from Reference/generated_swift_names_messages.pb.swift rename to Reference/SwiftProtobufTests/generated_swift_names_messages.pb.swift diff --git a/Reference/SwiftProtobufTests/map_proto2_unittest.pb.swift b/Reference/SwiftProtobufTests/map_proto2_unittest.pb.swift new file mode 100644 index 000000000..65258eeb1 --- /dev/null +++ b/Reference/SwiftProtobufTests/map_proto2_unittest.pb.swift @@ -0,0 +1,772 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: map_proto2_unittest.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum ProtobufUnittest_Proto2MapEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 0 + case bar // = 1 + case baz // = 2 + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .foo + case 1: self = .bar + case 2: self = .baz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .foo: return 0 + case .bar: return 1 + case .baz: return 2 + } + } + +} + +enum ProtobufUnittest_Proto2MapEnumPlusExtra: SwiftProtobuf.Enum { + typealias RawValue = Int + case eProto2MapEnumFoo // = 0 + case eProto2MapEnumBar // = 1 + case eProto2MapEnumBaz // = 2 + case eProto2MapEnumExtra // = 3 + + init() { + self = .eProto2MapEnumFoo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .eProto2MapEnumFoo + case 1: self = .eProto2MapEnumBar + case 2: self = .eProto2MapEnumBaz + case 3: self = .eProto2MapEnumExtra + default: return nil + } + } + + var rawValue: Int { + switch self { + case .eProto2MapEnumFoo: return 0 + case .eProto2MapEnumBar: return 1 + case .eProto2MapEnumBaz: return 2 + case .eProto2MapEnumExtra: return 3 + } + } + +} + +struct ProtobufUnittest_TestEnumMap { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var knownMapField: Dictionary = [:] + + var unknownMapField: Dictionary = [:] + + /// Other maps with all key types to test the unknown entry serialization + var unknownMapFieldInt64: Dictionary = [:] + + var unknownMapFieldUint64: Dictionary = [:] + + var unknownMapFieldInt32: Dictionary = [:] + + var unknownMapFieldUint32: Dictionary = [:] + + var unknownMapFieldFixed32: Dictionary = [:] + + var unknownMapFieldFixed64: Dictionary = [:] + + var unknownMapFieldBool: Dictionary = [:] + + var unknownMapFieldString: Dictionary = [:] + + var unknownMapFieldSint32: Dictionary = [:] + + var unknownMapFieldSint64: Dictionary = [:] + + var unknownMapFieldSfixed32: Dictionary = [:] + + var unknownMapFieldSfixed64: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_TestEnumMapPlusExtra { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var knownMapField: Dictionary = [:] + + var unknownMapField: Dictionary = [:] + + /// Other maps with all key types to test the unknown entry serialization + var unknownMapFieldInt64: Dictionary = [:] + + var unknownMapFieldUint64: Dictionary = [:] + + var unknownMapFieldInt32: Dictionary = [:] + + var unknownMapFieldUint32: Dictionary = [:] + + var unknownMapFieldFixed32: Dictionary = [:] + + var unknownMapFieldFixed64: Dictionary = [:] + + var unknownMapFieldBool: Dictionary = [:] + + var unknownMapFieldString: Dictionary = [:] + + var unknownMapFieldSint32: Dictionary = [:] + + var unknownMapFieldSint64: Dictionary = [:] + + var unknownMapFieldSfixed32: Dictionary = [:] + + var unknownMapFieldSfixed64: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_TestImportEnumMap { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var importEnumAmp: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_TestIntIntMap { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var m: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Test all key types: string, plus the non-floating-point scalars. +struct ProtobufUnittest_TestMaps { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var mInt32: Dictionary = [:] + + var mInt64: Dictionary = [:] + + var mUint32: Dictionary = [:] + + var mUint64: Dictionary = [:] + + var mSint32: Dictionary = [:] + + var mSint64: Dictionary = [:] + + var mFixed32: Dictionary = [:] + + var mFixed64: Dictionary = [:] + + var mSfixed32: Dictionary = [:] + + var mSfixed64: Dictionary = [:] + + var mBool: Dictionary = [:] + + var mString: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Test maps in submessages. +struct ProtobufUnittest_TestSubmessageMaps { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var m: ProtobufUnittest_TestMaps { + get {return _m ?? ProtobufUnittest_TestMaps()} + set {_m = newValue} + } + /// Returns true if `m` has been explicitly set. + var hasM: Bool {return self._m != nil} + /// Clears the value of `m`. Subsequent reads from it will return its default value. + mutating func clearM() {self._m = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _m: ProtobufUnittest_TestMaps? = nil +} + +struct ProtobufUnittest_TestProto2BytesMap { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var mapBytes: Dictionary = [:] + + var mapString: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittest_TestEnumMap: @unchecked Sendable {} +extension ProtobufUnittest_TestEnumMapPlusExtra: @unchecked Sendable {} +extension ProtobufUnittest_TestImportEnumMap: @unchecked Sendable {} +extension ProtobufUnittest_TestIntIntMap: @unchecked Sendable {} +extension ProtobufUnittest_TestMaps: @unchecked Sendable {} +extension ProtobufUnittest_TestSubmessageMaps: @unchecked Sendable {} +extension ProtobufUnittest_TestProto2BytesMap: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest" + +extension ProtobufUnittest_Proto2MapEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "PROTO2_MAP_ENUM_FOO"), + 1: .same(proto: "PROTO2_MAP_ENUM_BAR"), + 2: .same(proto: "PROTO2_MAP_ENUM_BAZ"), + ] +} + +extension ProtobufUnittest_Proto2MapEnumPlusExtra: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "E_PROTO2_MAP_ENUM_FOO"), + 1: .same(proto: "E_PROTO2_MAP_ENUM_BAR"), + 2: .same(proto: "E_PROTO2_MAP_ENUM_BAZ"), + 3: .same(proto: "E_PROTO2_MAP_ENUM_EXTRA"), + ] +} + +extension ProtobufUnittest_TestEnumMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestEnumMap" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 101: .standard(proto: "known_map_field"), + 102: .standard(proto: "unknown_map_field"), + 200: .standard(proto: "unknown_map_field_int64"), + 201: .standard(proto: "unknown_map_field_uint64"), + 202: .standard(proto: "unknown_map_field_int32"), + 203: .standard(proto: "unknown_map_field_uint32"), + 204: .standard(proto: "unknown_map_field_fixed32"), + 205: .standard(proto: "unknown_map_field_fixed64"), + 206: .standard(proto: "unknown_map_field_bool"), + 207: .standard(proto: "unknown_map_field_string"), + 208: .standard(proto: "unknown_map_field_sint32"), + 209: .standard(proto: "unknown_map_field_sint64"), + 210: .standard(proto: "unknown_map_field_sfixed32"), + 211: .standard(proto: "unknown_map_field_sfixed64"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 101: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.knownMapField) }() + case 102: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapField) }() + case 200: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldInt64) }() + case 201: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldUint64) }() + case 202: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldInt32) }() + case 203: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldUint32) }() + case 204: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldFixed32) }() + case 205: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldFixed64) }() + case 206: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldBool) }() + case 207: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldString) }() + case 208: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldSint32) }() + case 209: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldSint64) }() + case 210: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldSfixed32) }() + case 211: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldSfixed64) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.knownMapField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.knownMapField, fieldNumber: 101) + } + if !self.unknownMapField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapField, fieldNumber: 102) + } + if !self.unknownMapFieldInt64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldInt64, fieldNumber: 200) + } + if !self.unknownMapFieldUint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldUint64, fieldNumber: 201) + } + if !self.unknownMapFieldInt32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldInt32, fieldNumber: 202) + } + if !self.unknownMapFieldUint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldUint32, fieldNumber: 203) + } + if !self.unknownMapFieldFixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldFixed32, fieldNumber: 204) + } + if !self.unknownMapFieldFixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldFixed64, fieldNumber: 205) + } + if !self.unknownMapFieldBool.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldBool, fieldNumber: 206) + } + if !self.unknownMapFieldString.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldString, fieldNumber: 207) + } + if !self.unknownMapFieldSint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldSint32, fieldNumber: 208) + } + if !self.unknownMapFieldSint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldSint64, fieldNumber: 209) + } + if !self.unknownMapFieldSfixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldSfixed32, fieldNumber: 210) + } + if !self.unknownMapFieldSfixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldSfixed64, fieldNumber: 211) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestEnumMap, rhs: ProtobufUnittest_TestEnumMap) -> Bool { + if lhs.knownMapField != rhs.knownMapField {return false} + if lhs.unknownMapField != rhs.unknownMapField {return false} + if lhs.unknownMapFieldInt64 != rhs.unknownMapFieldInt64 {return false} + if lhs.unknownMapFieldUint64 != rhs.unknownMapFieldUint64 {return false} + if lhs.unknownMapFieldInt32 != rhs.unknownMapFieldInt32 {return false} + if lhs.unknownMapFieldUint32 != rhs.unknownMapFieldUint32 {return false} + if lhs.unknownMapFieldFixed32 != rhs.unknownMapFieldFixed32 {return false} + if lhs.unknownMapFieldFixed64 != rhs.unknownMapFieldFixed64 {return false} + if lhs.unknownMapFieldBool != rhs.unknownMapFieldBool {return false} + if lhs.unknownMapFieldString != rhs.unknownMapFieldString {return false} + if lhs.unknownMapFieldSint32 != rhs.unknownMapFieldSint32 {return false} + if lhs.unknownMapFieldSint64 != rhs.unknownMapFieldSint64 {return false} + if lhs.unknownMapFieldSfixed32 != rhs.unknownMapFieldSfixed32 {return false} + if lhs.unknownMapFieldSfixed64 != rhs.unknownMapFieldSfixed64 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestEnumMapPlusExtra: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestEnumMapPlusExtra" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 101: .standard(proto: "known_map_field"), + 102: .standard(proto: "unknown_map_field"), + 200: .standard(proto: "unknown_map_field_int64"), + 201: .standard(proto: "unknown_map_field_uint64"), + 202: .standard(proto: "unknown_map_field_int32"), + 203: .standard(proto: "unknown_map_field_uint32"), + 204: .standard(proto: "unknown_map_field_fixed32"), + 205: .standard(proto: "unknown_map_field_fixed64"), + 206: .standard(proto: "unknown_map_field_bool"), + 207: .standard(proto: "unknown_map_field_string"), + 208: .standard(proto: "unknown_map_field_sint32"), + 209: .standard(proto: "unknown_map_field_sint64"), + 210: .standard(proto: "unknown_map_field_sfixed32"), + 211: .standard(proto: "unknown_map_field_sfixed64"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 101: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.knownMapField) }() + case 102: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapField) }() + case 200: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldInt64) }() + case 201: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldUint64) }() + case 202: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldInt32) }() + case 203: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldUint32) }() + case 204: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldFixed32) }() + case 205: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldFixed64) }() + case 206: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldBool) }() + case 207: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldString) }() + case 208: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldSint32) }() + case 209: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldSint64) }() + case 210: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldSfixed32) }() + case 211: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.unknownMapFieldSfixed64) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.knownMapField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.knownMapField, fieldNumber: 101) + } + if !self.unknownMapField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapField, fieldNumber: 102) + } + if !self.unknownMapFieldInt64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldInt64, fieldNumber: 200) + } + if !self.unknownMapFieldUint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldUint64, fieldNumber: 201) + } + if !self.unknownMapFieldInt32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldInt32, fieldNumber: 202) + } + if !self.unknownMapFieldUint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldUint32, fieldNumber: 203) + } + if !self.unknownMapFieldFixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldFixed32, fieldNumber: 204) + } + if !self.unknownMapFieldFixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldFixed64, fieldNumber: 205) + } + if !self.unknownMapFieldBool.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldBool, fieldNumber: 206) + } + if !self.unknownMapFieldString.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldString, fieldNumber: 207) + } + if !self.unknownMapFieldSint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldSint32, fieldNumber: 208) + } + if !self.unknownMapFieldSint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldSint64, fieldNumber: 209) + } + if !self.unknownMapFieldSfixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldSfixed32, fieldNumber: 210) + } + if !self.unknownMapFieldSfixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.unknownMapFieldSfixed64, fieldNumber: 211) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestEnumMapPlusExtra, rhs: ProtobufUnittest_TestEnumMapPlusExtra) -> Bool { + if lhs.knownMapField != rhs.knownMapField {return false} + if lhs.unknownMapField != rhs.unknownMapField {return false} + if lhs.unknownMapFieldInt64 != rhs.unknownMapFieldInt64 {return false} + if lhs.unknownMapFieldUint64 != rhs.unknownMapFieldUint64 {return false} + if lhs.unknownMapFieldInt32 != rhs.unknownMapFieldInt32 {return false} + if lhs.unknownMapFieldUint32 != rhs.unknownMapFieldUint32 {return false} + if lhs.unknownMapFieldFixed32 != rhs.unknownMapFieldFixed32 {return false} + if lhs.unknownMapFieldFixed64 != rhs.unknownMapFieldFixed64 {return false} + if lhs.unknownMapFieldBool != rhs.unknownMapFieldBool {return false} + if lhs.unknownMapFieldString != rhs.unknownMapFieldString {return false} + if lhs.unknownMapFieldSint32 != rhs.unknownMapFieldSint32 {return false} + if lhs.unknownMapFieldSint64 != rhs.unknownMapFieldSint64 {return false} + if lhs.unknownMapFieldSfixed32 != rhs.unknownMapFieldSfixed32 {return false} + if lhs.unknownMapFieldSfixed64 != rhs.unknownMapFieldSfixed64 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestImportEnumMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestImportEnumMap" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "import_enum_amp"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &self.importEnumAmp) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.importEnumAmp.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: self.importEnumAmp, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestImportEnumMap, rhs: ProtobufUnittest_TestImportEnumMap) -> Bool { + if lhs.importEnumAmp != rhs.importEnumAmp {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestIntIntMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestIntIntMap" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "m"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.m) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.m.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.m, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestIntIntMap, rhs: ProtobufUnittest_TestIntIntMap) -> Bool { + if lhs.m != rhs.m {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMaps: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMaps" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "m_int32"), + 2: .standard(proto: "m_int64"), + 3: .standard(proto: "m_uint32"), + 4: .standard(proto: "m_uint64"), + 5: .standard(proto: "m_sint32"), + 6: .standard(proto: "m_sint64"), + 7: .standard(proto: "m_fixed32"), + 8: .standard(proto: "m_fixed64"), + 9: .standard(proto: "m_sfixed32"), + 10: .standard(proto: "m_sfixed64"), + 11: .standard(proto: "m_bool"), + 12: .standard(proto: "m_string"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.mInt32) }() + case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.mInt64) }() + case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.mUint32) }() + case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.mUint64) }() + case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.mSint32) }() + case 6: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.mSint64) }() + case 7: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.mFixed32) }() + case 8: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.mFixed64) }() + case 9: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.mSfixed32) }() + case 10: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.mSfixed64) }() + case 11: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.mBool) }() + case 12: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.mString) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.mInt32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.mInt32, fieldNumber: 1) + } + if !self.mInt64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.mInt64, fieldNumber: 2) + } + if !self.mUint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.mUint32, fieldNumber: 3) + } + if !self.mUint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.mUint64, fieldNumber: 4) + } + if !self.mSint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.mSint32, fieldNumber: 5) + } + if !self.mSint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.mSint64, fieldNumber: 6) + } + if !self.mFixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.mFixed32, fieldNumber: 7) + } + if !self.mFixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.mFixed64, fieldNumber: 8) + } + if !self.mSfixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.mSfixed32, fieldNumber: 9) + } + if !self.mSfixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.mSfixed64, fieldNumber: 10) + } + if !self.mBool.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.mBool, fieldNumber: 11) + } + if !self.mString.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.mString, fieldNumber: 12) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMaps, rhs: ProtobufUnittest_TestMaps) -> Bool { + if lhs.mInt32 != rhs.mInt32 {return false} + if lhs.mInt64 != rhs.mInt64 {return false} + if lhs.mUint32 != rhs.mUint32 {return false} + if lhs.mUint64 != rhs.mUint64 {return false} + if lhs.mSint32 != rhs.mSint32 {return false} + if lhs.mSint64 != rhs.mSint64 {return false} + if lhs.mFixed32 != rhs.mFixed32 {return false} + if lhs.mFixed64 != rhs.mFixed64 {return false} + if lhs.mSfixed32 != rhs.mSfixed32 {return false} + if lhs.mSfixed64 != rhs.mSfixed64 {return false} + if lhs.mBool != rhs.mBool {return false} + if lhs.mString != rhs.mString {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestSubmessageMaps: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestSubmessageMaps" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "m"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._m) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._m { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestSubmessageMaps, rhs: ProtobufUnittest_TestSubmessageMaps) -> Bool { + if lhs._m != rhs._m {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestProto2BytesMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestProto2BytesMap" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "map_bytes"), + 2: .standard(proto: "map_string"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.mapBytes) }() + case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.mapString) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.mapBytes.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.mapBytes, fieldNumber: 1) + } + if !self.mapString.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.mapString, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestProto2BytesMap, rhs: ProtobufUnittest_TestProto2BytesMap) -> Bool { + if lhs.mapBytes != rhs.mapBytes {return false} + if lhs.mapString != rhs.mapString {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/map_unittest.pb.swift b/Reference/SwiftProtobufTests/map_unittest.pb.swift new file mode 100644 index 000000000..61a1b4faa --- /dev/null +++ b/Reference/SwiftProtobufTests/map_unittest.pb.swift @@ -0,0 +1,1093 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: map_unittest.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum ProtobufUnittest_MapEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 0 + case bar // = 1 + case baz // = 2 + case UNRECOGNIZED(Int) + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .foo + case 1: self = .bar + case 2: self = .baz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .foo: return 0 + case .bar: return 1 + case .baz: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [ProtobufUnittest_MapEnum] = [ + .foo, + .bar, + .baz, + ] + +} + +/// Tests maps. +struct ProtobufUnittest_TestMap { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var mapInt32Int32: Dictionary { + get {return _storage._mapInt32Int32} + set {_uniqueStorage()._mapInt32Int32 = newValue} + } + + var mapInt64Int64: Dictionary { + get {return _storage._mapInt64Int64} + set {_uniqueStorage()._mapInt64Int64 = newValue} + } + + var mapUint32Uint32: Dictionary { + get {return _storage._mapUint32Uint32} + set {_uniqueStorage()._mapUint32Uint32 = newValue} + } + + var mapUint64Uint64: Dictionary { + get {return _storage._mapUint64Uint64} + set {_uniqueStorage()._mapUint64Uint64 = newValue} + } + + var mapSint32Sint32: Dictionary { + get {return _storage._mapSint32Sint32} + set {_uniqueStorage()._mapSint32Sint32 = newValue} + } + + var mapSint64Sint64: Dictionary { + get {return _storage._mapSint64Sint64} + set {_uniqueStorage()._mapSint64Sint64 = newValue} + } + + var mapFixed32Fixed32: Dictionary { + get {return _storage._mapFixed32Fixed32} + set {_uniqueStorage()._mapFixed32Fixed32 = newValue} + } + + var mapFixed64Fixed64: Dictionary { + get {return _storage._mapFixed64Fixed64} + set {_uniqueStorage()._mapFixed64Fixed64 = newValue} + } + + var mapSfixed32Sfixed32: Dictionary { + get {return _storage._mapSfixed32Sfixed32} + set {_uniqueStorage()._mapSfixed32Sfixed32 = newValue} + } + + var mapSfixed64Sfixed64: Dictionary { + get {return _storage._mapSfixed64Sfixed64} + set {_uniqueStorage()._mapSfixed64Sfixed64 = newValue} + } + + var mapInt32Float: Dictionary { + get {return _storage._mapInt32Float} + set {_uniqueStorage()._mapInt32Float = newValue} + } + + var mapInt32Double: Dictionary { + get {return _storage._mapInt32Double} + set {_uniqueStorage()._mapInt32Double = newValue} + } + + var mapBoolBool: Dictionary { + get {return _storage._mapBoolBool} + set {_uniqueStorage()._mapBoolBool = newValue} + } + + var mapStringString: Dictionary { + get {return _storage._mapStringString} + set {_uniqueStorage()._mapStringString = newValue} + } + + var mapInt32Bytes: Dictionary { + get {return _storage._mapInt32Bytes} + set {_uniqueStorage()._mapInt32Bytes = newValue} + } + + var mapInt32Enum: Dictionary { + get {return _storage._mapInt32Enum} + set {_uniqueStorage()._mapInt32Enum = newValue} + } + + var mapInt32ForeignMessage: Dictionary { + get {return _storage._mapInt32ForeignMessage} + set {_uniqueStorage()._mapInt32ForeignMessage = newValue} + } + + var mapStringForeignMessage: Dictionary { + get {return _storage._mapStringForeignMessage} + set {_uniqueStorage()._mapStringForeignMessage = newValue} + } + + var mapInt32AllTypes: Dictionary { + get {return _storage._mapInt32AllTypes} + set {_uniqueStorage()._mapInt32AllTypes = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufUnittest_TestMapSubmessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var testMap: ProtobufUnittest_TestMap { + get {return _testMap ?? ProtobufUnittest_TestMap()} + set {_testMap = newValue} + } + /// Returns true if `testMap` has been explicitly set. + var hasTestMap: Bool {return self._testMap != nil} + /// Clears the value of `testMap`. Subsequent reads from it will return its default value. + mutating func clearTestMap() {self._testMap = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _testMap: ProtobufUnittest_TestMap? = nil +} + +struct ProtobufUnittest_TestMessageMap { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var mapInt32Message: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Two map fields share the same entry default instance. +struct ProtobufUnittest_TestSameTypeMap { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var map1: Dictionary = [:] + + var map2: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Test embedded message with required fields +struct ProtobufUnittest_TestRequiredMessageMap { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var mapField: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_TestArenaMap { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var mapInt32Int32: Dictionary { + get {return _storage._mapInt32Int32} + set {_uniqueStorage()._mapInt32Int32 = newValue} + } + + var mapInt64Int64: Dictionary { + get {return _storage._mapInt64Int64} + set {_uniqueStorage()._mapInt64Int64 = newValue} + } + + var mapUint32Uint32: Dictionary { + get {return _storage._mapUint32Uint32} + set {_uniqueStorage()._mapUint32Uint32 = newValue} + } + + var mapUint64Uint64: Dictionary { + get {return _storage._mapUint64Uint64} + set {_uniqueStorage()._mapUint64Uint64 = newValue} + } + + var mapSint32Sint32: Dictionary { + get {return _storage._mapSint32Sint32} + set {_uniqueStorage()._mapSint32Sint32 = newValue} + } + + var mapSint64Sint64: Dictionary { + get {return _storage._mapSint64Sint64} + set {_uniqueStorage()._mapSint64Sint64 = newValue} + } + + var mapFixed32Fixed32: Dictionary { + get {return _storage._mapFixed32Fixed32} + set {_uniqueStorage()._mapFixed32Fixed32 = newValue} + } + + var mapFixed64Fixed64: Dictionary { + get {return _storage._mapFixed64Fixed64} + set {_uniqueStorage()._mapFixed64Fixed64 = newValue} + } + + var mapSfixed32Sfixed32: Dictionary { + get {return _storage._mapSfixed32Sfixed32} + set {_uniqueStorage()._mapSfixed32Sfixed32 = newValue} + } + + var mapSfixed64Sfixed64: Dictionary { + get {return _storage._mapSfixed64Sfixed64} + set {_uniqueStorage()._mapSfixed64Sfixed64 = newValue} + } + + var mapInt32Float: Dictionary { + get {return _storage._mapInt32Float} + set {_uniqueStorage()._mapInt32Float = newValue} + } + + var mapInt32Double: Dictionary { + get {return _storage._mapInt32Double} + set {_uniqueStorage()._mapInt32Double = newValue} + } + + var mapBoolBool: Dictionary { + get {return _storage._mapBoolBool} + set {_uniqueStorage()._mapBoolBool = newValue} + } + + var mapStringString: Dictionary { + get {return _storage._mapStringString} + set {_uniqueStorage()._mapStringString = newValue} + } + + var mapInt32Bytes: Dictionary { + get {return _storage._mapInt32Bytes} + set {_uniqueStorage()._mapInt32Bytes = newValue} + } + + var mapInt32Enum: Dictionary { + get {return _storage._mapInt32Enum} + set {_uniqueStorage()._mapInt32Enum = newValue} + } + + var mapInt32ForeignMessage: Dictionary { + get {return _storage._mapInt32ForeignMessage} + set {_uniqueStorage()._mapInt32ForeignMessage = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +/// Previously, message containing enum called Type cannot be used as value of +/// map field. +struct ProtobufUnittest_MessageContainingEnumCalledType { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var type: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum TypeEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 0 + case UNRECOGNIZED(Int) + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .foo + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .foo: return 0 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [ProtobufUnittest_MessageContainingEnumCalledType.TypeEnum] = [ + .foo, + ] + + } + + init() {} +} + +/// Previously, message cannot contain map field called "entry". +struct ProtobufUnittest_MessageContainingMapCalledEntry { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var entry: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_TestRecursiveMapMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittest_TestMap: @unchecked Sendable {} +extension ProtobufUnittest_TestMapSubmessage: @unchecked Sendable {} +extension ProtobufUnittest_TestMessageMap: @unchecked Sendable {} +extension ProtobufUnittest_TestSameTypeMap: @unchecked Sendable {} +extension ProtobufUnittest_TestRequiredMessageMap: @unchecked Sendable {} +extension ProtobufUnittest_TestArenaMap: @unchecked Sendable {} +extension ProtobufUnittest_MessageContainingEnumCalledType: @unchecked Sendable {} +extension ProtobufUnittest_MessageContainingMapCalledEntry: @unchecked Sendable {} +extension ProtobufUnittest_TestRecursiveMapMessage: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest" + +extension ProtobufUnittest_MapEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "MAP_ENUM_FOO"), + 1: .same(proto: "MAP_ENUM_BAR"), + 2: .same(proto: "MAP_ENUM_BAZ"), + ] +} + +extension ProtobufUnittest_TestMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMap" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "map_int32_int32"), + 2: .standard(proto: "map_int64_int64"), + 3: .standard(proto: "map_uint32_uint32"), + 4: .standard(proto: "map_uint64_uint64"), + 5: .standard(proto: "map_sint32_sint32"), + 6: .standard(proto: "map_sint64_sint64"), + 7: .standard(proto: "map_fixed32_fixed32"), + 8: .standard(proto: "map_fixed64_fixed64"), + 9: .standard(proto: "map_sfixed32_sfixed32"), + 10: .standard(proto: "map_sfixed64_sfixed64"), + 11: .standard(proto: "map_int32_float"), + 12: .standard(proto: "map_int32_double"), + 13: .standard(proto: "map_bool_bool"), + 14: .standard(proto: "map_string_string"), + 15: .standard(proto: "map_int32_bytes"), + 16: .standard(proto: "map_int32_enum"), + 17: .standard(proto: "map_int32_foreign_message"), + 18: .standard(proto: "map_string_foreign_message"), + 19: .standard(proto: "map_int32_all_types"), + ] + + fileprivate class _StorageClass { + var _mapInt32Int32: Dictionary = [:] + var _mapInt64Int64: Dictionary = [:] + var _mapUint32Uint32: Dictionary = [:] + var _mapUint64Uint64: Dictionary = [:] + var _mapSint32Sint32: Dictionary = [:] + var _mapSint64Sint64: Dictionary = [:] + var _mapFixed32Fixed32: Dictionary = [:] + var _mapFixed64Fixed64: Dictionary = [:] + var _mapSfixed32Sfixed32: Dictionary = [:] + var _mapSfixed64Sfixed64: Dictionary = [:] + var _mapInt32Float: Dictionary = [:] + var _mapInt32Double: Dictionary = [:] + var _mapBoolBool: Dictionary = [:] + var _mapStringString: Dictionary = [:] + var _mapInt32Bytes: Dictionary = [:] + var _mapInt32Enum: Dictionary = [:] + var _mapInt32ForeignMessage: Dictionary = [:] + var _mapStringForeignMessage: Dictionary = [:] + var _mapInt32AllTypes: Dictionary = [:] + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _mapInt32Int32 = source._mapInt32Int32 + _mapInt64Int64 = source._mapInt64Int64 + _mapUint32Uint32 = source._mapUint32Uint32 + _mapUint64Uint64 = source._mapUint64Uint64 + _mapSint32Sint32 = source._mapSint32Sint32 + _mapSint64Sint64 = source._mapSint64Sint64 + _mapFixed32Fixed32 = source._mapFixed32Fixed32 + _mapFixed64Fixed64 = source._mapFixed64Fixed64 + _mapSfixed32Sfixed32 = source._mapSfixed32Sfixed32 + _mapSfixed64Sfixed64 = source._mapSfixed64Sfixed64 + _mapInt32Float = source._mapInt32Float + _mapInt32Double = source._mapInt32Double + _mapBoolBool = source._mapBoolBool + _mapStringString = source._mapStringString + _mapInt32Bytes = source._mapInt32Bytes + _mapInt32Enum = source._mapInt32Enum + _mapInt32ForeignMessage = source._mapInt32ForeignMessage + _mapStringForeignMessage = source._mapStringForeignMessage + _mapInt32AllTypes = source._mapInt32AllTypes + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Int32) }() + case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt64Int64) }() + case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapUint32Uint32) }() + case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapUint64Uint64) }() + case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSint32Sint32) }() + case 6: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSint64Sint64) }() + case 7: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapFixed32Fixed32) }() + case 8: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapFixed64Fixed64) }() + case 9: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSfixed32Sfixed32) }() + case 10: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSfixed64Sfixed64) }() + case 11: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Float) }() + case 12: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Double) }() + case 13: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapBoolBool) }() + case 14: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapStringString) }() + case 15: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Bytes) }() + case 16: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &_storage._mapInt32Enum) }() + case 17: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._mapInt32ForeignMessage) }() + case 18: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._mapStringForeignMessage) }() + case 19: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._mapInt32AllTypes) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._mapInt32Int32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Int32, fieldNumber: 1) + } + if !_storage._mapInt64Int64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt64Int64, fieldNumber: 2) + } + if !_storage._mapUint32Uint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapUint32Uint32, fieldNumber: 3) + } + if !_storage._mapUint64Uint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapUint64Uint64, fieldNumber: 4) + } + if !_storage._mapSint32Sint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSint32Sint32, fieldNumber: 5) + } + if !_storage._mapSint64Sint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSint64Sint64, fieldNumber: 6) + } + if !_storage._mapFixed32Fixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapFixed32Fixed32, fieldNumber: 7) + } + if !_storage._mapFixed64Fixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapFixed64Fixed64, fieldNumber: 8) + } + if !_storage._mapSfixed32Sfixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSfixed32Sfixed32, fieldNumber: 9) + } + if !_storage._mapSfixed64Sfixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSfixed64Sfixed64, fieldNumber: 10) + } + if !_storage._mapInt32Float.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Float, fieldNumber: 11) + } + if !_storage._mapInt32Double.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Double, fieldNumber: 12) + } + if !_storage._mapBoolBool.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapBoolBool, fieldNumber: 13) + } + if !_storage._mapStringString.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapStringString, fieldNumber: 14) + } + if !_storage._mapInt32Bytes.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Bytes, fieldNumber: 15) + } + if !_storage._mapInt32Enum.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: _storage._mapInt32Enum, fieldNumber: 16) + } + if !_storage._mapInt32ForeignMessage.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._mapInt32ForeignMessage, fieldNumber: 17) + } + if !_storage._mapStringForeignMessage.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._mapStringForeignMessage, fieldNumber: 18) + } + if !_storage._mapInt32AllTypes.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._mapInt32AllTypes, fieldNumber: 19) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMap, rhs: ProtobufUnittest_TestMap) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._mapInt32Int32 != rhs_storage._mapInt32Int32 {return false} + if _storage._mapInt64Int64 != rhs_storage._mapInt64Int64 {return false} + if _storage._mapUint32Uint32 != rhs_storage._mapUint32Uint32 {return false} + if _storage._mapUint64Uint64 != rhs_storage._mapUint64Uint64 {return false} + if _storage._mapSint32Sint32 != rhs_storage._mapSint32Sint32 {return false} + if _storage._mapSint64Sint64 != rhs_storage._mapSint64Sint64 {return false} + if _storage._mapFixed32Fixed32 != rhs_storage._mapFixed32Fixed32 {return false} + if _storage._mapFixed64Fixed64 != rhs_storage._mapFixed64Fixed64 {return false} + if _storage._mapSfixed32Sfixed32 != rhs_storage._mapSfixed32Sfixed32 {return false} + if _storage._mapSfixed64Sfixed64 != rhs_storage._mapSfixed64Sfixed64 {return false} + if _storage._mapInt32Float != rhs_storage._mapInt32Float {return false} + if _storage._mapInt32Double != rhs_storage._mapInt32Double {return false} + if _storage._mapBoolBool != rhs_storage._mapBoolBool {return false} + if _storage._mapStringString != rhs_storage._mapStringString {return false} + if _storage._mapInt32Bytes != rhs_storage._mapInt32Bytes {return false} + if _storage._mapInt32Enum != rhs_storage._mapInt32Enum {return false} + if _storage._mapInt32ForeignMessage != rhs_storage._mapInt32ForeignMessage {return false} + if _storage._mapStringForeignMessage != rhs_storage._mapStringForeignMessage {return false} + if _storage._mapInt32AllTypes != rhs_storage._mapInt32AllTypes {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMapSubmessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMapSubmessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "test_map"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._testMap) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._testMap { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMapSubmessage, rhs: ProtobufUnittest_TestMapSubmessage) -> Bool { + if lhs._testMap != rhs._testMap {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMessageMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMessageMap" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "map_int32_message"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.mapInt32Message) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.mapInt32Message.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.mapInt32Message, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMessageMap, rhs: ProtobufUnittest_TestMessageMap) -> Bool { + if lhs.mapInt32Message != rhs.mapInt32Message {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestSameTypeMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestSameTypeMap" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "map1"), + 2: .same(proto: "map2"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.map1) }() + case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.map2) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.map1.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.map1, fieldNumber: 1) + } + if !self.map2.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.map2, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestSameTypeMap, rhs: ProtobufUnittest_TestSameTypeMap) -> Bool { + if lhs.map1 != rhs.map1 {return false} + if lhs.map2 != rhs.map2 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestRequiredMessageMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestRequiredMessageMap" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "map_field"), + ] + + public var isInitialized: Bool { + if !SwiftProtobuf.Internal.areAllInitialized(self.mapField) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.mapField) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.mapField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.mapField, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestRequiredMessageMap, rhs: ProtobufUnittest_TestRequiredMessageMap) -> Bool { + if lhs.mapField != rhs.mapField {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestArenaMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestArenaMap" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "map_int32_int32"), + 2: .standard(proto: "map_int64_int64"), + 3: .standard(proto: "map_uint32_uint32"), + 4: .standard(proto: "map_uint64_uint64"), + 5: .standard(proto: "map_sint32_sint32"), + 6: .standard(proto: "map_sint64_sint64"), + 7: .standard(proto: "map_fixed32_fixed32"), + 8: .standard(proto: "map_fixed64_fixed64"), + 9: .standard(proto: "map_sfixed32_sfixed32"), + 10: .standard(proto: "map_sfixed64_sfixed64"), + 11: .standard(proto: "map_int32_float"), + 12: .standard(proto: "map_int32_double"), + 13: .standard(proto: "map_bool_bool"), + 14: .standard(proto: "map_string_string"), + 15: .standard(proto: "map_int32_bytes"), + 16: .standard(proto: "map_int32_enum"), + 17: .standard(proto: "map_int32_foreign_message"), + ] + + fileprivate class _StorageClass { + var _mapInt32Int32: Dictionary = [:] + var _mapInt64Int64: Dictionary = [:] + var _mapUint32Uint32: Dictionary = [:] + var _mapUint64Uint64: Dictionary = [:] + var _mapSint32Sint32: Dictionary = [:] + var _mapSint64Sint64: Dictionary = [:] + var _mapFixed32Fixed32: Dictionary = [:] + var _mapFixed64Fixed64: Dictionary = [:] + var _mapSfixed32Sfixed32: Dictionary = [:] + var _mapSfixed64Sfixed64: Dictionary = [:] + var _mapInt32Float: Dictionary = [:] + var _mapInt32Double: Dictionary = [:] + var _mapBoolBool: Dictionary = [:] + var _mapStringString: Dictionary = [:] + var _mapInt32Bytes: Dictionary = [:] + var _mapInt32Enum: Dictionary = [:] + var _mapInt32ForeignMessage: Dictionary = [:] + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _mapInt32Int32 = source._mapInt32Int32 + _mapInt64Int64 = source._mapInt64Int64 + _mapUint32Uint32 = source._mapUint32Uint32 + _mapUint64Uint64 = source._mapUint64Uint64 + _mapSint32Sint32 = source._mapSint32Sint32 + _mapSint64Sint64 = source._mapSint64Sint64 + _mapFixed32Fixed32 = source._mapFixed32Fixed32 + _mapFixed64Fixed64 = source._mapFixed64Fixed64 + _mapSfixed32Sfixed32 = source._mapSfixed32Sfixed32 + _mapSfixed64Sfixed64 = source._mapSfixed64Sfixed64 + _mapInt32Float = source._mapInt32Float + _mapInt32Double = source._mapInt32Double + _mapBoolBool = source._mapBoolBool + _mapStringString = source._mapStringString + _mapInt32Bytes = source._mapInt32Bytes + _mapInt32Enum = source._mapInt32Enum + _mapInt32ForeignMessage = source._mapInt32ForeignMessage + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Int32) }() + case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt64Int64) }() + case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapUint32Uint32) }() + case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapUint64Uint64) }() + case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSint32Sint32) }() + case 6: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSint64Sint64) }() + case 7: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapFixed32Fixed32) }() + case 8: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapFixed64Fixed64) }() + case 9: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSfixed32Sfixed32) }() + case 10: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSfixed64Sfixed64) }() + case 11: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Float) }() + case 12: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Double) }() + case 13: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapBoolBool) }() + case 14: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapStringString) }() + case 15: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Bytes) }() + case 16: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &_storage._mapInt32Enum) }() + case 17: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._mapInt32ForeignMessage) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._mapInt32Int32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Int32, fieldNumber: 1) + } + if !_storage._mapInt64Int64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt64Int64, fieldNumber: 2) + } + if !_storage._mapUint32Uint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapUint32Uint32, fieldNumber: 3) + } + if !_storage._mapUint64Uint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapUint64Uint64, fieldNumber: 4) + } + if !_storage._mapSint32Sint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSint32Sint32, fieldNumber: 5) + } + if !_storage._mapSint64Sint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSint64Sint64, fieldNumber: 6) + } + if !_storage._mapFixed32Fixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapFixed32Fixed32, fieldNumber: 7) + } + if !_storage._mapFixed64Fixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapFixed64Fixed64, fieldNumber: 8) + } + if !_storage._mapSfixed32Sfixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSfixed32Sfixed32, fieldNumber: 9) + } + if !_storage._mapSfixed64Sfixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSfixed64Sfixed64, fieldNumber: 10) + } + if !_storage._mapInt32Float.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Float, fieldNumber: 11) + } + if !_storage._mapInt32Double.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Double, fieldNumber: 12) + } + if !_storage._mapBoolBool.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapBoolBool, fieldNumber: 13) + } + if !_storage._mapStringString.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapStringString, fieldNumber: 14) + } + if !_storage._mapInt32Bytes.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Bytes, fieldNumber: 15) + } + if !_storage._mapInt32Enum.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: _storage._mapInt32Enum, fieldNumber: 16) + } + if !_storage._mapInt32ForeignMessage.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._mapInt32ForeignMessage, fieldNumber: 17) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestArenaMap, rhs: ProtobufUnittest_TestArenaMap) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._mapInt32Int32 != rhs_storage._mapInt32Int32 {return false} + if _storage._mapInt64Int64 != rhs_storage._mapInt64Int64 {return false} + if _storage._mapUint32Uint32 != rhs_storage._mapUint32Uint32 {return false} + if _storage._mapUint64Uint64 != rhs_storage._mapUint64Uint64 {return false} + if _storage._mapSint32Sint32 != rhs_storage._mapSint32Sint32 {return false} + if _storage._mapSint64Sint64 != rhs_storage._mapSint64Sint64 {return false} + if _storage._mapFixed32Fixed32 != rhs_storage._mapFixed32Fixed32 {return false} + if _storage._mapFixed64Fixed64 != rhs_storage._mapFixed64Fixed64 {return false} + if _storage._mapSfixed32Sfixed32 != rhs_storage._mapSfixed32Sfixed32 {return false} + if _storage._mapSfixed64Sfixed64 != rhs_storage._mapSfixed64Sfixed64 {return false} + if _storage._mapInt32Float != rhs_storage._mapInt32Float {return false} + if _storage._mapInt32Double != rhs_storage._mapInt32Double {return false} + if _storage._mapBoolBool != rhs_storage._mapBoolBool {return false} + if _storage._mapStringString != rhs_storage._mapStringString {return false} + if _storage._mapInt32Bytes != rhs_storage._mapInt32Bytes {return false} + if _storage._mapInt32Enum != rhs_storage._mapInt32Enum {return false} + if _storage._mapInt32ForeignMessage != rhs_storage._mapInt32ForeignMessage {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_MessageContainingEnumCalledType: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MessageContainingEnumCalledType" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "type"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.type) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.type.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.type, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_MessageContainingEnumCalledType, rhs: ProtobufUnittest_MessageContainingEnumCalledType) -> Bool { + if lhs.type != rhs.type {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_MessageContainingEnumCalledType.TypeEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "TYPE_FOO"), + ] +} + +extension ProtobufUnittest_MessageContainingMapCalledEntry: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MessageContainingMapCalledEntry" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "entry"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.entry) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.entry.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.entry, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_MessageContainingMapCalledEntry, rhs: ProtobufUnittest_MessageContainingMapCalledEntry) -> Bool { + if lhs.entry != rhs.entry {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestRecursiveMapMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestRecursiveMapMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.a) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.a.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.a, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestRecursiveMapMessage, rhs: ProtobufUnittest_TestRecursiveMapMessage) -> Bool { + if lhs.a != rhs.a {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/test_messages_proto3.pb.swift b/Reference/SwiftProtobufTests/test_messages_proto3.pb.swift new file mode 100644 index 000000000..551e04128 --- /dev/null +++ b/Reference/SwiftProtobufTests/test_messages_proto3.pb.swift @@ -0,0 +1,2694 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: test_messages_proto3.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Test schema for proto3 messages. This test schema is used by: +// +// - benchmarks +// - fuzz tests +// - conformance tests + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum ProtobufTestMessages_Proto3_ForeignEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foreignFoo // = 0 + case foreignBar // = 1 + case foreignBaz // = 2 + case UNRECOGNIZED(Int) + + init() { + self = .foreignFoo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .foreignFoo + case 1: self = .foreignBar + case 2: self = .foreignBaz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .foreignFoo: return 0 + case .foreignBar: return 1 + case .foreignBaz: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [ProtobufTestMessages_Proto3_ForeignEnum] = [ + .foreignFoo, + .foreignBar, + .foreignBaz, + ] + +} + +/// 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. +struct ProtobufTestMessages_Proto3_TestAllTypesProto3 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Singular + var optionalInt32: Int32 { + get {return _storage._optionalInt32} + set {_uniqueStorage()._optionalInt32 = newValue} + } + + var optionalInt64: Int64 { + get {return _storage._optionalInt64} + set {_uniqueStorage()._optionalInt64 = newValue} + } + + var optionalUint32: UInt32 { + get {return _storage._optionalUint32} + set {_uniqueStorage()._optionalUint32 = newValue} + } + + var optionalUint64: UInt64 { + get {return _storage._optionalUint64} + set {_uniqueStorage()._optionalUint64 = newValue} + } + + var optionalSint32: Int32 { + get {return _storage._optionalSint32} + set {_uniqueStorage()._optionalSint32 = newValue} + } + + var optionalSint64: Int64 { + get {return _storage._optionalSint64} + set {_uniqueStorage()._optionalSint64 = newValue} + } + + var optionalFixed32: UInt32 { + get {return _storage._optionalFixed32} + set {_uniqueStorage()._optionalFixed32 = newValue} + } + + var optionalFixed64: UInt64 { + get {return _storage._optionalFixed64} + set {_uniqueStorage()._optionalFixed64 = newValue} + } + + var optionalSfixed32: Int32 { + get {return _storage._optionalSfixed32} + set {_uniqueStorage()._optionalSfixed32 = newValue} + } + + var optionalSfixed64: Int64 { + get {return _storage._optionalSfixed64} + set {_uniqueStorage()._optionalSfixed64 = newValue} + } + + var optionalFloat: Float { + get {return _storage._optionalFloat} + set {_uniqueStorage()._optionalFloat = newValue} + } + + var optionalDouble: Double { + get {return _storage._optionalDouble} + set {_uniqueStorage()._optionalDouble = newValue} + } + + var optionalBool: Bool { + get {return _storage._optionalBool} + set {_uniqueStorage()._optionalBool = newValue} + } + + var optionalString: String { + get {return _storage._optionalString} + set {_uniqueStorage()._optionalString = newValue} + } + + var optionalBytes: Data { + get {return _storage._optionalBytes} + set {_uniqueStorage()._optionalBytes = newValue} + } + + var optionalNestedMessage: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage { + get {return _storage._optionalNestedMessage ?? ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage()} + set {_uniqueStorage()._optionalNestedMessage = newValue} + } + /// Returns true if `optionalNestedMessage` has been explicitly set. + var hasOptionalNestedMessage: Bool {return _storage._optionalNestedMessage != nil} + /// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedMessage() {_uniqueStorage()._optionalNestedMessage = nil} + + var optionalForeignMessage: ProtobufTestMessages_Proto3_ForeignMessage { + get {return _storage._optionalForeignMessage ?? ProtobufTestMessages_Proto3_ForeignMessage()} + set {_uniqueStorage()._optionalForeignMessage = newValue} + } + /// Returns true if `optionalForeignMessage` has been explicitly set. + var hasOptionalForeignMessage: Bool {return _storage._optionalForeignMessage != nil} + /// Clears the value of `optionalForeignMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalForeignMessage() {_uniqueStorage()._optionalForeignMessage = nil} + + var optionalNestedEnum: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum { + get {return _storage._optionalNestedEnum} + set {_uniqueStorage()._optionalNestedEnum = newValue} + } + + var optionalForeignEnum: ProtobufTestMessages_Proto3_ForeignEnum { + get {return _storage._optionalForeignEnum} + set {_uniqueStorage()._optionalForeignEnum = newValue} + } + + var optionalAliasedEnum: ProtobufTestMessages_Proto3_TestAllTypesProto3.AliasedEnum { + get {return _storage._optionalAliasedEnum} + set {_uniqueStorage()._optionalAliasedEnum = newValue} + } + + var optionalStringPiece: String { + get {return _storage._optionalStringPiece} + set {_uniqueStorage()._optionalStringPiece = newValue} + } + + var optionalCord: String { + get {return _storage._optionalCord} + set {_uniqueStorage()._optionalCord = newValue} + } + + var recursiveMessage: ProtobufTestMessages_Proto3_TestAllTypesProto3 { + get {return _storage._recursiveMessage ?? ProtobufTestMessages_Proto3_TestAllTypesProto3()} + set {_uniqueStorage()._recursiveMessage = newValue} + } + /// Returns true if `recursiveMessage` has been explicitly set. + var hasRecursiveMessage: Bool {return _storage._recursiveMessage != nil} + /// Clears the value of `recursiveMessage`. Subsequent reads from it will return its default value. + mutating func clearRecursiveMessage() {_uniqueStorage()._recursiveMessage = nil} + + /// Repeated + var repeatedInt32: [Int32] { + get {return _storage._repeatedInt32} + set {_uniqueStorage()._repeatedInt32 = newValue} + } + + var repeatedInt64: [Int64] { + get {return _storage._repeatedInt64} + set {_uniqueStorage()._repeatedInt64 = newValue} + } + + var repeatedUint32: [UInt32] { + get {return _storage._repeatedUint32} + set {_uniqueStorage()._repeatedUint32 = newValue} + } + + var repeatedUint64: [UInt64] { + get {return _storage._repeatedUint64} + set {_uniqueStorage()._repeatedUint64 = newValue} + } + + var repeatedSint32: [Int32] { + get {return _storage._repeatedSint32} + set {_uniqueStorage()._repeatedSint32 = newValue} + } + + var repeatedSint64: [Int64] { + get {return _storage._repeatedSint64} + set {_uniqueStorage()._repeatedSint64 = newValue} + } + + var repeatedFixed32: [UInt32] { + get {return _storage._repeatedFixed32} + set {_uniqueStorage()._repeatedFixed32 = newValue} + } + + var repeatedFixed64: [UInt64] { + get {return _storage._repeatedFixed64} + set {_uniqueStorage()._repeatedFixed64 = newValue} + } + + var repeatedSfixed32: [Int32] { + get {return _storage._repeatedSfixed32} + set {_uniqueStorage()._repeatedSfixed32 = newValue} + } + + var repeatedSfixed64: [Int64] { + get {return _storage._repeatedSfixed64} + set {_uniqueStorage()._repeatedSfixed64 = newValue} + } + + var repeatedFloat: [Float] { + get {return _storage._repeatedFloat} + set {_uniqueStorage()._repeatedFloat = newValue} + } + + var repeatedDouble: [Double] { + get {return _storage._repeatedDouble} + set {_uniqueStorage()._repeatedDouble = newValue} + } + + var repeatedBool: [Bool] { + get {return _storage._repeatedBool} + set {_uniqueStorage()._repeatedBool = newValue} + } + + var repeatedString: [String] { + get {return _storage._repeatedString} + set {_uniqueStorage()._repeatedString = newValue} + } + + var repeatedBytes: [Data] { + get {return _storage._repeatedBytes} + set {_uniqueStorage()._repeatedBytes = newValue} + } + + var repeatedNestedMessage: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage] { + get {return _storage._repeatedNestedMessage} + set {_uniqueStorage()._repeatedNestedMessage = newValue} + } + + var repeatedForeignMessage: [ProtobufTestMessages_Proto3_ForeignMessage] { + get {return _storage._repeatedForeignMessage} + set {_uniqueStorage()._repeatedForeignMessage = newValue} + } + + var repeatedNestedEnum: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum] { + get {return _storage._repeatedNestedEnum} + set {_uniqueStorage()._repeatedNestedEnum = newValue} + } + + var repeatedForeignEnum: [ProtobufTestMessages_Proto3_ForeignEnum] { + get {return _storage._repeatedForeignEnum} + set {_uniqueStorage()._repeatedForeignEnum = newValue} + } + + var repeatedStringPiece: [String] { + get {return _storage._repeatedStringPiece} + set {_uniqueStorage()._repeatedStringPiece = newValue} + } + + var repeatedCord: [String] { + get {return _storage._repeatedCord} + set {_uniqueStorage()._repeatedCord = newValue} + } + + /// Packed + var packedInt32: [Int32] { + get {return _storage._packedInt32} + set {_uniqueStorage()._packedInt32 = newValue} + } + + var packedInt64: [Int64] { + get {return _storage._packedInt64} + set {_uniqueStorage()._packedInt64 = newValue} + } + + var packedUint32: [UInt32] { + get {return _storage._packedUint32} + set {_uniqueStorage()._packedUint32 = newValue} + } + + var packedUint64: [UInt64] { + get {return _storage._packedUint64} + set {_uniqueStorage()._packedUint64 = newValue} + } + + var packedSint32: [Int32] { + get {return _storage._packedSint32} + set {_uniqueStorage()._packedSint32 = newValue} + } + + var packedSint64: [Int64] { + get {return _storage._packedSint64} + set {_uniqueStorage()._packedSint64 = newValue} + } + + var packedFixed32: [UInt32] { + get {return _storage._packedFixed32} + set {_uniqueStorage()._packedFixed32 = newValue} + } + + var packedFixed64: [UInt64] { + get {return _storage._packedFixed64} + set {_uniqueStorage()._packedFixed64 = newValue} + } + + var packedSfixed32: [Int32] { + get {return _storage._packedSfixed32} + set {_uniqueStorage()._packedSfixed32 = newValue} + } + + var packedSfixed64: [Int64] { + get {return _storage._packedSfixed64} + set {_uniqueStorage()._packedSfixed64 = newValue} + } + + var packedFloat: [Float] { + get {return _storage._packedFloat} + set {_uniqueStorage()._packedFloat = newValue} + } + + var packedDouble: [Double] { + get {return _storage._packedDouble} + set {_uniqueStorage()._packedDouble = newValue} + } + + var packedBool: [Bool] { + get {return _storage._packedBool} + set {_uniqueStorage()._packedBool = newValue} + } + + var packedNestedEnum: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum] { + get {return _storage._packedNestedEnum} + set {_uniqueStorage()._packedNestedEnum = newValue} + } + + /// Unpacked + var unpackedInt32: [Int32] { + get {return _storage._unpackedInt32} + set {_uniqueStorage()._unpackedInt32 = newValue} + } + + var unpackedInt64: [Int64] { + get {return _storage._unpackedInt64} + set {_uniqueStorage()._unpackedInt64 = newValue} + } + + var unpackedUint32: [UInt32] { + get {return _storage._unpackedUint32} + set {_uniqueStorage()._unpackedUint32 = newValue} + } + + var unpackedUint64: [UInt64] { + get {return _storage._unpackedUint64} + set {_uniqueStorage()._unpackedUint64 = newValue} + } + + var unpackedSint32: [Int32] { + get {return _storage._unpackedSint32} + set {_uniqueStorage()._unpackedSint32 = newValue} + } + + var unpackedSint64: [Int64] { + get {return _storage._unpackedSint64} + set {_uniqueStorage()._unpackedSint64 = newValue} + } + + var unpackedFixed32: [UInt32] { + get {return _storage._unpackedFixed32} + set {_uniqueStorage()._unpackedFixed32 = newValue} + } + + var unpackedFixed64: [UInt64] { + get {return _storage._unpackedFixed64} + set {_uniqueStorage()._unpackedFixed64 = newValue} + } + + var unpackedSfixed32: [Int32] { + get {return _storage._unpackedSfixed32} + set {_uniqueStorage()._unpackedSfixed32 = newValue} + } + + var unpackedSfixed64: [Int64] { + get {return _storage._unpackedSfixed64} + set {_uniqueStorage()._unpackedSfixed64 = newValue} + } + + var unpackedFloat: [Float] { + get {return _storage._unpackedFloat} + set {_uniqueStorage()._unpackedFloat = newValue} + } + + var unpackedDouble: [Double] { + get {return _storage._unpackedDouble} + set {_uniqueStorage()._unpackedDouble = newValue} + } + + var unpackedBool: [Bool] { + get {return _storage._unpackedBool} + set {_uniqueStorage()._unpackedBool = newValue} + } + + var unpackedNestedEnum: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum] { + get {return _storage._unpackedNestedEnum} + set {_uniqueStorage()._unpackedNestedEnum = newValue} + } + + /// Map + var mapInt32Int32: Dictionary { + get {return _storage._mapInt32Int32} + set {_uniqueStorage()._mapInt32Int32 = newValue} + } + + var mapInt64Int64: Dictionary { + get {return _storage._mapInt64Int64} + set {_uniqueStorage()._mapInt64Int64 = newValue} + } + + var mapUint32Uint32: Dictionary { + get {return _storage._mapUint32Uint32} + set {_uniqueStorage()._mapUint32Uint32 = newValue} + } + + var mapUint64Uint64: Dictionary { + get {return _storage._mapUint64Uint64} + set {_uniqueStorage()._mapUint64Uint64 = newValue} + } + + var mapSint32Sint32: Dictionary { + get {return _storage._mapSint32Sint32} + set {_uniqueStorage()._mapSint32Sint32 = newValue} + } + + var mapSint64Sint64: Dictionary { + get {return _storage._mapSint64Sint64} + set {_uniqueStorage()._mapSint64Sint64 = newValue} + } + + var mapFixed32Fixed32: Dictionary { + get {return _storage._mapFixed32Fixed32} + set {_uniqueStorage()._mapFixed32Fixed32 = newValue} + } + + var mapFixed64Fixed64: Dictionary { + get {return _storage._mapFixed64Fixed64} + set {_uniqueStorage()._mapFixed64Fixed64 = newValue} + } + + var mapSfixed32Sfixed32: Dictionary { + get {return _storage._mapSfixed32Sfixed32} + set {_uniqueStorage()._mapSfixed32Sfixed32 = newValue} + } + + var mapSfixed64Sfixed64: Dictionary { + get {return _storage._mapSfixed64Sfixed64} + set {_uniqueStorage()._mapSfixed64Sfixed64 = newValue} + } + + var mapInt32Float: Dictionary { + get {return _storage._mapInt32Float} + set {_uniqueStorage()._mapInt32Float = newValue} + } + + var mapInt32Double: Dictionary { + get {return _storage._mapInt32Double} + set {_uniqueStorage()._mapInt32Double = newValue} + } + + var mapBoolBool: Dictionary { + get {return _storage._mapBoolBool} + set {_uniqueStorage()._mapBoolBool = newValue} + } + + var mapStringString: Dictionary { + get {return _storage._mapStringString} + set {_uniqueStorage()._mapStringString = newValue} + } + + var mapStringBytes: Dictionary { + get {return _storage._mapStringBytes} + set {_uniqueStorage()._mapStringBytes = newValue} + } + + var mapStringNestedMessage: Dictionary { + get {return _storage._mapStringNestedMessage} + set {_uniqueStorage()._mapStringNestedMessage = newValue} + } + + var mapStringForeignMessage: Dictionary { + get {return _storage._mapStringForeignMessage} + set {_uniqueStorage()._mapStringForeignMessage = newValue} + } + + var mapStringNestedEnum: Dictionary { + get {return _storage._mapStringNestedEnum} + set {_uniqueStorage()._mapStringNestedEnum = newValue} + } + + var mapStringForeignEnum: Dictionary { + get {return _storage._mapStringForeignEnum} + set {_uniqueStorage()._mapStringForeignEnum = newValue} + } + + var oneofField: OneOf_OneofField? { + get {return _storage._oneofField} + set {_uniqueStorage()._oneofField = newValue} + } + + var oneofUint32: UInt32 { + get { + if case .oneofUint32(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofUint32(newValue)} + } + + var oneofNestedMessage: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage { + get { + if case .oneofNestedMessage(let v)? = _storage._oneofField {return v} + return ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage() + } + set {_uniqueStorage()._oneofField = .oneofNestedMessage(newValue)} + } + + var oneofString: String { + get { + if case .oneofString(let v)? = _storage._oneofField {return v} + return String() + } + set {_uniqueStorage()._oneofField = .oneofString(newValue)} + } + + var oneofBytes: Data { + get { + if case .oneofBytes(let v)? = _storage._oneofField {return v} + return Data() + } + set {_uniqueStorage()._oneofField = .oneofBytes(newValue)} + } + + var oneofBool: Bool { + get { + if case .oneofBool(let v)? = _storage._oneofField {return v} + return false + } + set {_uniqueStorage()._oneofField = .oneofBool(newValue)} + } + + var oneofUint64: UInt64 { + get { + if case .oneofUint64(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofUint64(newValue)} + } + + var oneofFloat: Float { + get { + if case .oneofFloat(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofFloat(newValue)} + } + + var oneofDouble: Double { + get { + if case .oneofDouble(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofDouble(newValue)} + } + + var oneofEnum: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum { + get { + if case .oneofEnum(let v)? = _storage._oneofField {return v} + return .foo + } + set {_uniqueStorage()._oneofField = .oneofEnum(newValue)} + } + + var oneofNullValue: SwiftProtobuf.Google_Protobuf_NullValue { + get { + if case .oneofNullValue(let v)? = _storage._oneofField {return v} + return .nullValue + } + set {_uniqueStorage()._oneofField = .oneofNullValue(newValue)} + } + + /// Well-known types + var optionalBoolWrapper: SwiftProtobuf.Google_Protobuf_BoolValue { + get {return _storage._optionalBoolWrapper ?? SwiftProtobuf.Google_Protobuf_BoolValue()} + set {_uniqueStorage()._optionalBoolWrapper = newValue} + } + /// Returns true if `optionalBoolWrapper` has been explicitly set. + var hasOptionalBoolWrapper: Bool {return _storage._optionalBoolWrapper != nil} + /// Clears the value of `optionalBoolWrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalBoolWrapper() {_uniqueStorage()._optionalBoolWrapper = nil} + + var optionalInt32Wrapper: SwiftProtobuf.Google_Protobuf_Int32Value { + get {return _storage._optionalInt32Wrapper ?? SwiftProtobuf.Google_Protobuf_Int32Value()} + set {_uniqueStorage()._optionalInt32Wrapper = newValue} + } + /// Returns true if `optionalInt32Wrapper` has been explicitly set. + var hasOptionalInt32Wrapper: Bool {return _storage._optionalInt32Wrapper != nil} + /// Clears the value of `optionalInt32Wrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt32Wrapper() {_uniqueStorage()._optionalInt32Wrapper = nil} + + var optionalInt64Wrapper: SwiftProtobuf.Google_Protobuf_Int64Value { + get {return _storage._optionalInt64Wrapper ?? SwiftProtobuf.Google_Protobuf_Int64Value()} + set {_uniqueStorage()._optionalInt64Wrapper = newValue} + } + /// Returns true if `optionalInt64Wrapper` has been explicitly set. + var hasOptionalInt64Wrapper: Bool {return _storage._optionalInt64Wrapper != nil} + /// Clears the value of `optionalInt64Wrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt64Wrapper() {_uniqueStorage()._optionalInt64Wrapper = nil} + + var optionalUint32Wrapper: SwiftProtobuf.Google_Protobuf_UInt32Value { + get {return _storage._optionalUint32Wrapper ?? SwiftProtobuf.Google_Protobuf_UInt32Value()} + set {_uniqueStorage()._optionalUint32Wrapper = newValue} + } + /// Returns true if `optionalUint32Wrapper` has been explicitly set. + var hasOptionalUint32Wrapper: Bool {return _storage._optionalUint32Wrapper != nil} + /// Clears the value of `optionalUint32Wrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint32Wrapper() {_uniqueStorage()._optionalUint32Wrapper = nil} + + var optionalUint64Wrapper: SwiftProtobuf.Google_Protobuf_UInt64Value { + get {return _storage._optionalUint64Wrapper ?? SwiftProtobuf.Google_Protobuf_UInt64Value()} + set {_uniqueStorage()._optionalUint64Wrapper = newValue} + } + /// Returns true if `optionalUint64Wrapper` has been explicitly set. + var hasOptionalUint64Wrapper: Bool {return _storage._optionalUint64Wrapper != nil} + /// Clears the value of `optionalUint64Wrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint64Wrapper() {_uniqueStorage()._optionalUint64Wrapper = nil} + + var optionalFloatWrapper: SwiftProtobuf.Google_Protobuf_FloatValue { + get {return _storage._optionalFloatWrapper ?? SwiftProtobuf.Google_Protobuf_FloatValue()} + set {_uniqueStorage()._optionalFloatWrapper = newValue} + } + /// Returns true if `optionalFloatWrapper` has been explicitly set. + var hasOptionalFloatWrapper: Bool {return _storage._optionalFloatWrapper != nil} + /// Clears the value of `optionalFloatWrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalFloatWrapper() {_uniqueStorage()._optionalFloatWrapper = nil} + + var optionalDoubleWrapper: SwiftProtobuf.Google_Protobuf_DoubleValue { + get {return _storage._optionalDoubleWrapper ?? SwiftProtobuf.Google_Protobuf_DoubleValue()} + set {_uniqueStorage()._optionalDoubleWrapper = newValue} + } + /// Returns true if `optionalDoubleWrapper` has been explicitly set. + var hasOptionalDoubleWrapper: Bool {return _storage._optionalDoubleWrapper != nil} + /// Clears the value of `optionalDoubleWrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalDoubleWrapper() {_uniqueStorage()._optionalDoubleWrapper = nil} + + var optionalStringWrapper: SwiftProtobuf.Google_Protobuf_StringValue { + get {return _storage._optionalStringWrapper ?? SwiftProtobuf.Google_Protobuf_StringValue()} + set {_uniqueStorage()._optionalStringWrapper = newValue} + } + /// Returns true if `optionalStringWrapper` has been explicitly set. + var hasOptionalStringWrapper: Bool {return _storage._optionalStringWrapper != nil} + /// Clears the value of `optionalStringWrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalStringWrapper() {_uniqueStorage()._optionalStringWrapper = nil} + + var optionalBytesWrapper: SwiftProtobuf.Google_Protobuf_BytesValue { + get {return _storage._optionalBytesWrapper ?? SwiftProtobuf.Google_Protobuf_BytesValue()} + set {_uniqueStorage()._optionalBytesWrapper = newValue} + } + /// Returns true if `optionalBytesWrapper` has been explicitly set. + var hasOptionalBytesWrapper: Bool {return _storage._optionalBytesWrapper != nil} + /// Clears the value of `optionalBytesWrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalBytesWrapper() {_uniqueStorage()._optionalBytesWrapper = nil} + + var repeatedBoolWrapper: [SwiftProtobuf.Google_Protobuf_BoolValue] { + get {return _storage._repeatedBoolWrapper} + set {_uniqueStorage()._repeatedBoolWrapper = newValue} + } + + var repeatedInt32Wrapper: [SwiftProtobuf.Google_Protobuf_Int32Value] { + get {return _storage._repeatedInt32Wrapper} + set {_uniqueStorage()._repeatedInt32Wrapper = newValue} + } + + var repeatedInt64Wrapper: [SwiftProtobuf.Google_Protobuf_Int64Value] { + get {return _storage._repeatedInt64Wrapper} + set {_uniqueStorage()._repeatedInt64Wrapper = newValue} + } + + var repeatedUint32Wrapper: [SwiftProtobuf.Google_Protobuf_UInt32Value] { + get {return _storage._repeatedUint32Wrapper} + set {_uniqueStorage()._repeatedUint32Wrapper = newValue} + } + + var repeatedUint64Wrapper: [SwiftProtobuf.Google_Protobuf_UInt64Value] { + get {return _storage._repeatedUint64Wrapper} + set {_uniqueStorage()._repeatedUint64Wrapper = newValue} + } + + var repeatedFloatWrapper: [SwiftProtobuf.Google_Protobuf_FloatValue] { + get {return _storage._repeatedFloatWrapper} + set {_uniqueStorage()._repeatedFloatWrapper = newValue} + } + + var repeatedDoubleWrapper: [SwiftProtobuf.Google_Protobuf_DoubleValue] { + get {return _storage._repeatedDoubleWrapper} + set {_uniqueStorage()._repeatedDoubleWrapper = newValue} + } + + var repeatedStringWrapper: [SwiftProtobuf.Google_Protobuf_StringValue] { + get {return _storage._repeatedStringWrapper} + set {_uniqueStorage()._repeatedStringWrapper = newValue} + } + + var repeatedBytesWrapper: [SwiftProtobuf.Google_Protobuf_BytesValue] { + get {return _storage._repeatedBytesWrapper} + set {_uniqueStorage()._repeatedBytesWrapper = newValue} + } + + var optionalDuration: SwiftProtobuf.Google_Protobuf_Duration { + get {return _storage._optionalDuration ?? SwiftProtobuf.Google_Protobuf_Duration()} + set {_uniqueStorage()._optionalDuration = newValue} + } + /// Returns true if `optionalDuration` has been explicitly set. + var hasOptionalDuration: Bool {return _storage._optionalDuration != nil} + /// Clears the value of `optionalDuration`. Subsequent reads from it will return its default value. + mutating func clearOptionalDuration() {_uniqueStorage()._optionalDuration = nil} + + var optionalTimestamp: SwiftProtobuf.Google_Protobuf_Timestamp { + get {return _storage._optionalTimestamp ?? SwiftProtobuf.Google_Protobuf_Timestamp()} + set {_uniqueStorage()._optionalTimestamp = newValue} + } + /// Returns true if `optionalTimestamp` has been explicitly set. + var hasOptionalTimestamp: Bool {return _storage._optionalTimestamp != nil} + /// Clears the value of `optionalTimestamp`. Subsequent reads from it will return its default value. + mutating func clearOptionalTimestamp() {_uniqueStorage()._optionalTimestamp = nil} + + var optionalFieldMask: SwiftProtobuf.Google_Protobuf_FieldMask { + get {return _storage._optionalFieldMask ?? SwiftProtobuf.Google_Protobuf_FieldMask()} + set {_uniqueStorage()._optionalFieldMask = newValue} + } + /// Returns true if `optionalFieldMask` has been explicitly set. + var hasOptionalFieldMask: Bool {return _storage._optionalFieldMask != nil} + /// Clears the value of `optionalFieldMask`. Subsequent reads from it will return its default value. + mutating func clearOptionalFieldMask() {_uniqueStorage()._optionalFieldMask = nil} + + var optionalStruct: SwiftProtobuf.Google_Protobuf_Struct { + get {return _storage._optionalStruct ?? SwiftProtobuf.Google_Protobuf_Struct()} + set {_uniqueStorage()._optionalStruct = newValue} + } + /// Returns true if `optionalStruct` has been explicitly set. + var hasOptionalStruct: Bool {return _storage._optionalStruct != nil} + /// Clears the value of `optionalStruct`. Subsequent reads from it will return its default value. + mutating func clearOptionalStruct() {_uniqueStorage()._optionalStruct = nil} + + var optionalAny: SwiftProtobuf.Google_Protobuf_Any { + get {return _storage._optionalAny ?? SwiftProtobuf.Google_Protobuf_Any()} + set {_uniqueStorage()._optionalAny = newValue} + } + /// Returns true if `optionalAny` has been explicitly set. + var hasOptionalAny: Bool {return _storage._optionalAny != nil} + /// Clears the value of `optionalAny`. Subsequent reads from it will return its default value. + mutating func clearOptionalAny() {_uniqueStorage()._optionalAny = nil} + + var optionalValue: SwiftProtobuf.Google_Protobuf_Value { + get {return _storage._optionalValue ?? SwiftProtobuf.Google_Protobuf_Value()} + set {_uniqueStorage()._optionalValue = newValue} + } + /// Returns true if `optionalValue` has been explicitly set. + var hasOptionalValue: Bool {return _storage._optionalValue != nil} + /// Clears the value of `optionalValue`. Subsequent reads from it will return its default value. + mutating func clearOptionalValue() {_uniqueStorage()._optionalValue = nil} + + var optionalNullValue: SwiftProtobuf.Google_Protobuf_NullValue { + get {return _storage._optionalNullValue} + set {_uniqueStorage()._optionalNullValue = newValue} + } + + var repeatedDuration: [SwiftProtobuf.Google_Protobuf_Duration] { + get {return _storage._repeatedDuration} + set {_uniqueStorage()._repeatedDuration = newValue} + } + + var repeatedTimestamp: [SwiftProtobuf.Google_Protobuf_Timestamp] { + get {return _storage._repeatedTimestamp} + set {_uniqueStorage()._repeatedTimestamp = newValue} + } + + var repeatedFieldmask: [SwiftProtobuf.Google_Protobuf_FieldMask] { + get {return _storage._repeatedFieldmask} + set {_uniqueStorage()._repeatedFieldmask = newValue} + } + + var repeatedStruct: [SwiftProtobuf.Google_Protobuf_Struct] { + get {return _storage._repeatedStruct} + set {_uniqueStorage()._repeatedStruct = newValue} + } + + var repeatedAny: [SwiftProtobuf.Google_Protobuf_Any] { + get {return _storage._repeatedAny} + set {_uniqueStorage()._repeatedAny = newValue} + } + + var repeatedValue: [SwiftProtobuf.Google_Protobuf_Value] { + get {return _storage._repeatedValue} + set {_uniqueStorage()._repeatedValue = newValue} + } + + var repeatedListValue: [SwiftProtobuf.Google_Protobuf_ListValue] { + get {return _storage._repeatedListValue} + set {_uniqueStorage()._repeatedListValue = newValue} + } + + /// Test field-name-to-JSON-name convention. + /// (protobuf says names can be any valid C/C++ identifier.) + var fieldname1: Int32 { + get {return _storage._fieldname1} + set {_uniqueStorage()._fieldname1 = newValue} + } + + var fieldName2: Int32 { + get {return _storage._fieldName2} + set {_uniqueStorage()._fieldName2 = newValue} + } + + var fieldName3: Int32 { + get {return _storage._fieldName3} + set {_uniqueStorage()._fieldName3 = newValue} + } + + var field_Name4_: Int32 { + get {return _storage._field_Name4_} + set {_uniqueStorage()._field_Name4_ = newValue} + } + + var field0Name5: Int32 { + get {return _storage._field0Name5} + set {_uniqueStorage()._field0Name5 = newValue} + } + + var field0Name6: Int32 { + get {return _storage._field0Name6} + set {_uniqueStorage()._field0Name6 = newValue} + } + + var fieldName7: Int32 { + get {return _storage._fieldName7} + set {_uniqueStorage()._fieldName7 = newValue} + } + + var fieldName8: Int32 { + get {return _storage._fieldName8} + set {_uniqueStorage()._fieldName8 = newValue} + } + + var fieldName9: Int32 { + get {return _storage._fieldName9} + set {_uniqueStorage()._fieldName9 = newValue} + } + + var fieldName10: Int32 { + get {return _storage._fieldName10} + set {_uniqueStorage()._fieldName10 = newValue} + } + + var fieldName11: Int32 { + get {return _storage._fieldName11} + set {_uniqueStorage()._fieldName11 = newValue} + } + + var fieldName12: Int32 { + get {return _storage._fieldName12} + set {_uniqueStorage()._fieldName12 = newValue} + } + + var _FieldName13: Int32 { + get {return _storage.__FieldName13} + set {_uniqueStorage().__FieldName13 = newValue} + } + + var _FieldName14: Int32 { + get {return _storage.__FieldName14} + set {_uniqueStorage().__FieldName14 = newValue} + } + + var field_Name15: Int32 { + get {return _storage._field_Name15} + set {_uniqueStorage()._field_Name15 = newValue} + } + + var field_Name16: Int32 { + get {return _storage._field_Name16} + set {_uniqueStorage()._field_Name16 = newValue} + } + + var fieldName17__: Int32 { + get {return _storage._fieldName17__} + set {_uniqueStorage()._fieldName17__ = newValue} + } + + var fieldName18__: Int32 { + get {return _storage._fieldName18__} + set {_uniqueStorage()._fieldName18__ = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_OneofField: Equatable { + case oneofUint32(UInt32) + case oneofNestedMessage(ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage) + case oneofString(String) + case oneofBytes(Data) + case oneofBool(Bool) + case oneofUint64(UInt64) + case oneofFloat(Float) + case oneofDouble(Double) + case oneofEnum(ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum) + case oneofNullValue(SwiftProtobuf.Google_Protobuf_NullValue) + + } + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 0 + case bar // = 1 + case baz // = 2 + + /// Intentionally negative. + case neg // = -1 + case UNRECOGNIZED(Int) + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case -1: self = .neg + case 0: self = .foo + case 1: self = .bar + case 2: self = .baz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .neg: return -1 + case .foo: return 0 + case .bar: return 1 + case .baz: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum] = [ + .foo, + .bar, + .baz, + .neg, + ] + + } + + enum AliasedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case aliasFoo // = 0 + case aliasBar // = 1 + case aliasBaz // = 2 + static let moo = aliasBaz + static let bAz = aliasBaz + case UNRECOGNIZED(Int) + + init() { + self = .aliasFoo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .aliasFoo + case 1: self = .aliasBar + case 2: self = .aliasBaz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .aliasFoo: return 0 + case .aliasBar: return 1 + case .aliasBaz: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [ProtobufTestMessages_Proto3_TestAllTypesProto3.AliasedEnum] = [ + .aliasFoo, + .aliasBar, + .aliasBaz, + ] + + } + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _storage._a} + set {_uniqueStorage()._a = newValue} + } + + var corecursive: ProtobufTestMessages_Proto3_TestAllTypesProto3 { + get {return _storage._corecursive ?? ProtobufTestMessages_Proto3_TestAllTypesProto3()} + set {_uniqueStorage()._corecursive = newValue} + } + /// Returns true if `corecursive` has been explicitly set. + var hasCorecursive: Bool {return _storage._corecursive != nil} + /// Clears the value of `corecursive`. Subsequent reads from it will return its default value. + mutating func clearCorecursive() {_uniqueStorage()._corecursive = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufTestMessages_Proto3_ForeignMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var c: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufTestMessages_Proto3_NullHypothesisProto3 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufTestMessages_Proto3_EnumOnlyProto3 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum BoolEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case kFalse // = 0 + case kTrue // = 1 + case UNRECOGNIZED(Int) + + init() { + self = .kFalse + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .kFalse + case 1: self = .kTrue + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .kFalse: return 0 + case .kTrue: return 1 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [ProtobufTestMessages_Proto3_EnumOnlyProto3.BoolEnum] = [ + .kFalse, + .kTrue, + ] + + } + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufTestMessages_Proto3_TestAllTypesProto3: @unchecked Sendable {} +extension ProtobufTestMessages_Proto3_TestAllTypesProto3.OneOf_OneofField: @unchecked Sendable {} +extension ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage: @unchecked Sendable {} +extension ProtobufTestMessages_Proto3_ForeignMessage: @unchecked Sendable {} +extension ProtobufTestMessages_Proto3_NullHypothesisProto3: @unchecked Sendable {} +extension ProtobufTestMessages_Proto3_EnumOnlyProto3: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_test_messages.proto3" + +extension ProtobufTestMessages_Proto3_ForeignEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FOREIGN_FOO"), + 1: .same(proto: "FOREIGN_BAR"), + 2: .same(proto: "FOREIGN_BAZ"), + ] +} + +extension ProtobufTestMessages_Proto3_TestAllTypesProto3: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestAllTypesProto3" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_int32"), + 2: .standard(proto: "optional_int64"), + 3: .standard(proto: "optional_uint32"), + 4: .standard(proto: "optional_uint64"), + 5: .standard(proto: "optional_sint32"), + 6: .standard(proto: "optional_sint64"), + 7: .standard(proto: "optional_fixed32"), + 8: .standard(proto: "optional_fixed64"), + 9: .standard(proto: "optional_sfixed32"), + 10: .standard(proto: "optional_sfixed64"), + 11: .standard(proto: "optional_float"), + 12: .standard(proto: "optional_double"), + 13: .standard(proto: "optional_bool"), + 14: .standard(proto: "optional_string"), + 15: .standard(proto: "optional_bytes"), + 18: .standard(proto: "optional_nested_message"), + 19: .standard(proto: "optional_foreign_message"), + 21: .standard(proto: "optional_nested_enum"), + 22: .standard(proto: "optional_foreign_enum"), + 23: .standard(proto: "optional_aliased_enum"), + 24: .standard(proto: "optional_string_piece"), + 25: .standard(proto: "optional_cord"), + 27: .standard(proto: "recursive_message"), + 31: .standard(proto: "repeated_int32"), + 32: .standard(proto: "repeated_int64"), + 33: .standard(proto: "repeated_uint32"), + 34: .standard(proto: "repeated_uint64"), + 35: .standard(proto: "repeated_sint32"), + 36: .standard(proto: "repeated_sint64"), + 37: .standard(proto: "repeated_fixed32"), + 38: .standard(proto: "repeated_fixed64"), + 39: .standard(proto: "repeated_sfixed32"), + 40: .standard(proto: "repeated_sfixed64"), + 41: .standard(proto: "repeated_float"), + 42: .standard(proto: "repeated_double"), + 43: .standard(proto: "repeated_bool"), + 44: .standard(proto: "repeated_string"), + 45: .standard(proto: "repeated_bytes"), + 48: .standard(proto: "repeated_nested_message"), + 49: .standard(proto: "repeated_foreign_message"), + 51: .standard(proto: "repeated_nested_enum"), + 52: .standard(proto: "repeated_foreign_enum"), + 54: .standard(proto: "repeated_string_piece"), + 55: .standard(proto: "repeated_cord"), + 75: .standard(proto: "packed_int32"), + 76: .standard(proto: "packed_int64"), + 77: .standard(proto: "packed_uint32"), + 78: .standard(proto: "packed_uint64"), + 79: .standard(proto: "packed_sint32"), + 80: .standard(proto: "packed_sint64"), + 81: .standard(proto: "packed_fixed32"), + 82: .standard(proto: "packed_fixed64"), + 83: .standard(proto: "packed_sfixed32"), + 84: .standard(proto: "packed_sfixed64"), + 85: .standard(proto: "packed_float"), + 86: .standard(proto: "packed_double"), + 87: .standard(proto: "packed_bool"), + 88: .standard(proto: "packed_nested_enum"), + 89: .standard(proto: "unpacked_int32"), + 90: .standard(proto: "unpacked_int64"), + 91: .standard(proto: "unpacked_uint32"), + 92: .standard(proto: "unpacked_uint64"), + 93: .standard(proto: "unpacked_sint32"), + 94: .standard(proto: "unpacked_sint64"), + 95: .standard(proto: "unpacked_fixed32"), + 96: .standard(proto: "unpacked_fixed64"), + 97: .standard(proto: "unpacked_sfixed32"), + 98: .standard(proto: "unpacked_sfixed64"), + 99: .standard(proto: "unpacked_float"), + 100: .standard(proto: "unpacked_double"), + 101: .standard(proto: "unpacked_bool"), + 102: .standard(proto: "unpacked_nested_enum"), + 56: .standard(proto: "map_int32_int32"), + 57: .standard(proto: "map_int64_int64"), + 58: .standard(proto: "map_uint32_uint32"), + 59: .standard(proto: "map_uint64_uint64"), + 60: .standard(proto: "map_sint32_sint32"), + 61: .standard(proto: "map_sint64_sint64"), + 62: .standard(proto: "map_fixed32_fixed32"), + 63: .standard(proto: "map_fixed64_fixed64"), + 64: .standard(proto: "map_sfixed32_sfixed32"), + 65: .standard(proto: "map_sfixed64_sfixed64"), + 66: .standard(proto: "map_int32_float"), + 67: .standard(proto: "map_int32_double"), + 68: .standard(proto: "map_bool_bool"), + 69: .standard(proto: "map_string_string"), + 70: .standard(proto: "map_string_bytes"), + 71: .standard(proto: "map_string_nested_message"), + 72: .standard(proto: "map_string_foreign_message"), + 73: .standard(proto: "map_string_nested_enum"), + 74: .standard(proto: "map_string_foreign_enum"), + 111: .standard(proto: "oneof_uint32"), + 112: .standard(proto: "oneof_nested_message"), + 113: .standard(proto: "oneof_string"), + 114: .standard(proto: "oneof_bytes"), + 115: .standard(proto: "oneof_bool"), + 116: .standard(proto: "oneof_uint64"), + 117: .standard(proto: "oneof_float"), + 118: .standard(proto: "oneof_double"), + 119: .standard(proto: "oneof_enum"), + 120: .standard(proto: "oneof_null_value"), + 201: .standard(proto: "optional_bool_wrapper"), + 202: .standard(proto: "optional_int32_wrapper"), + 203: .standard(proto: "optional_int64_wrapper"), + 204: .standard(proto: "optional_uint32_wrapper"), + 205: .standard(proto: "optional_uint64_wrapper"), + 206: .standard(proto: "optional_float_wrapper"), + 207: .standard(proto: "optional_double_wrapper"), + 208: .standard(proto: "optional_string_wrapper"), + 209: .standard(proto: "optional_bytes_wrapper"), + 211: .standard(proto: "repeated_bool_wrapper"), + 212: .standard(proto: "repeated_int32_wrapper"), + 213: .standard(proto: "repeated_int64_wrapper"), + 214: .standard(proto: "repeated_uint32_wrapper"), + 215: .standard(proto: "repeated_uint64_wrapper"), + 216: .standard(proto: "repeated_float_wrapper"), + 217: .standard(proto: "repeated_double_wrapper"), + 218: .standard(proto: "repeated_string_wrapper"), + 219: .standard(proto: "repeated_bytes_wrapper"), + 301: .standard(proto: "optional_duration"), + 302: .standard(proto: "optional_timestamp"), + 303: .standard(proto: "optional_field_mask"), + 304: .standard(proto: "optional_struct"), + 305: .standard(proto: "optional_any"), + 306: .standard(proto: "optional_value"), + 307: .standard(proto: "optional_null_value"), + 311: .standard(proto: "repeated_duration"), + 312: .standard(proto: "repeated_timestamp"), + 313: .standard(proto: "repeated_fieldmask"), + 324: .standard(proto: "repeated_struct"), + 315: .standard(proto: "repeated_any"), + 316: .standard(proto: "repeated_value"), + 317: .standard(proto: "repeated_list_value"), + 401: .same(proto: "fieldname1"), + 402: .standard(proto: "field_name2"), + 403: .standard(proto: "_field_name3"), + 404: .standard(proto: "field__name4_"), + 405: .same(proto: "field0name5"), + 406: .standard(proto: "field_0_name6"), + 407: .same(proto: "fieldName7"), + 408: .same(proto: "FieldName8"), + 409: .standard(proto: "field_Name9"), + 410: .standard(proto: "Field_Name10"), + 411: .standard(proto: "FIELD_NAME11"), + 412: .standard(proto: "FIELD_name12"), + 413: .standard(proto: "__field_name13"), + 414: .standard(proto: "__Field_name14"), + 415: .standard(proto: "field__name15"), + 416: .standard(proto: "field__Name16"), + 417: .standard(proto: "field_name17__"), + 418: .standard(proto: "Field_name18__"), + ] + + fileprivate class _StorageClass { + var _optionalInt32: Int32 = 0 + var _optionalInt64: Int64 = 0 + var _optionalUint32: UInt32 = 0 + var _optionalUint64: UInt64 = 0 + var _optionalSint32: Int32 = 0 + var _optionalSint64: Int64 = 0 + var _optionalFixed32: UInt32 = 0 + var _optionalFixed64: UInt64 = 0 + var _optionalSfixed32: Int32 = 0 + var _optionalSfixed64: Int64 = 0 + var _optionalFloat: Float = 0 + var _optionalDouble: Double = 0 + var _optionalBool: Bool = false + var _optionalString: String = String() + var _optionalBytes: Data = Data() + var _optionalNestedMessage: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage? = nil + var _optionalForeignMessage: ProtobufTestMessages_Proto3_ForeignMessage? = nil + var _optionalNestedEnum: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum = .foo + var _optionalForeignEnum: ProtobufTestMessages_Proto3_ForeignEnum = .foreignFoo + var _optionalAliasedEnum: ProtobufTestMessages_Proto3_TestAllTypesProto3.AliasedEnum = .aliasFoo + var _optionalStringPiece: String = String() + var _optionalCord: String = String() + var _recursiveMessage: ProtobufTestMessages_Proto3_TestAllTypesProto3? = nil + var _repeatedInt32: [Int32] = [] + var _repeatedInt64: [Int64] = [] + var _repeatedUint32: [UInt32] = [] + var _repeatedUint64: [UInt64] = [] + var _repeatedSint32: [Int32] = [] + var _repeatedSint64: [Int64] = [] + var _repeatedFixed32: [UInt32] = [] + var _repeatedFixed64: [UInt64] = [] + var _repeatedSfixed32: [Int32] = [] + var _repeatedSfixed64: [Int64] = [] + var _repeatedFloat: [Float] = [] + var _repeatedDouble: [Double] = [] + var _repeatedBool: [Bool] = [] + var _repeatedString: [String] = [] + var _repeatedBytes: [Data] = [] + var _repeatedNestedMessage: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage] = [] + var _repeatedForeignMessage: [ProtobufTestMessages_Proto3_ForeignMessage] = [] + var _repeatedNestedEnum: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum] = [] + var _repeatedForeignEnum: [ProtobufTestMessages_Proto3_ForeignEnum] = [] + var _repeatedStringPiece: [String] = [] + var _repeatedCord: [String] = [] + var _packedInt32: [Int32] = [] + var _packedInt64: [Int64] = [] + var _packedUint32: [UInt32] = [] + var _packedUint64: [UInt64] = [] + var _packedSint32: [Int32] = [] + var _packedSint64: [Int64] = [] + var _packedFixed32: [UInt32] = [] + var _packedFixed64: [UInt64] = [] + var _packedSfixed32: [Int32] = [] + var _packedSfixed64: [Int64] = [] + var _packedFloat: [Float] = [] + var _packedDouble: [Double] = [] + var _packedBool: [Bool] = [] + var _packedNestedEnum: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum] = [] + var _unpackedInt32: [Int32] = [] + var _unpackedInt64: [Int64] = [] + var _unpackedUint32: [UInt32] = [] + var _unpackedUint64: [UInt64] = [] + var _unpackedSint32: [Int32] = [] + var _unpackedSint64: [Int64] = [] + var _unpackedFixed32: [UInt32] = [] + var _unpackedFixed64: [UInt64] = [] + var _unpackedSfixed32: [Int32] = [] + var _unpackedSfixed64: [Int64] = [] + var _unpackedFloat: [Float] = [] + var _unpackedDouble: [Double] = [] + var _unpackedBool: [Bool] = [] + var _unpackedNestedEnum: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum] = [] + var _mapInt32Int32: Dictionary = [:] + var _mapInt64Int64: Dictionary = [:] + var _mapUint32Uint32: Dictionary = [:] + var _mapUint64Uint64: Dictionary = [:] + var _mapSint32Sint32: Dictionary = [:] + var _mapSint64Sint64: Dictionary = [:] + var _mapFixed32Fixed32: Dictionary = [:] + var _mapFixed64Fixed64: Dictionary = [:] + var _mapSfixed32Sfixed32: Dictionary = [:] + var _mapSfixed64Sfixed64: Dictionary = [:] + var _mapInt32Float: Dictionary = [:] + var _mapInt32Double: Dictionary = [:] + var _mapBoolBool: Dictionary = [:] + var _mapStringString: Dictionary = [:] + var _mapStringBytes: Dictionary = [:] + var _mapStringNestedMessage: Dictionary = [:] + var _mapStringForeignMessage: Dictionary = [:] + var _mapStringNestedEnum: Dictionary = [:] + var _mapStringForeignEnum: Dictionary = [:] + var _oneofField: ProtobufTestMessages_Proto3_TestAllTypesProto3.OneOf_OneofField? + var _optionalBoolWrapper: SwiftProtobuf.Google_Protobuf_BoolValue? = nil + var _optionalInt32Wrapper: SwiftProtobuf.Google_Protobuf_Int32Value? = nil + var _optionalInt64Wrapper: SwiftProtobuf.Google_Protobuf_Int64Value? = nil + var _optionalUint32Wrapper: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil + var _optionalUint64Wrapper: SwiftProtobuf.Google_Protobuf_UInt64Value? = nil + var _optionalFloatWrapper: SwiftProtobuf.Google_Protobuf_FloatValue? = nil + var _optionalDoubleWrapper: SwiftProtobuf.Google_Protobuf_DoubleValue? = nil + var _optionalStringWrapper: SwiftProtobuf.Google_Protobuf_StringValue? = nil + var _optionalBytesWrapper: SwiftProtobuf.Google_Protobuf_BytesValue? = nil + var _repeatedBoolWrapper: [SwiftProtobuf.Google_Protobuf_BoolValue] = [] + var _repeatedInt32Wrapper: [SwiftProtobuf.Google_Protobuf_Int32Value] = [] + var _repeatedInt64Wrapper: [SwiftProtobuf.Google_Protobuf_Int64Value] = [] + var _repeatedUint32Wrapper: [SwiftProtobuf.Google_Protobuf_UInt32Value] = [] + var _repeatedUint64Wrapper: [SwiftProtobuf.Google_Protobuf_UInt64Value] = [] + var _repeatedFloatWrapper: [SwiftProtobuf.Google_Protobuf_FloatValue] = [] + var _repeatedDoubleWrapper: [SwiftProtobuf.Google_Protobuf_DoubleValue] = [] + var _repeatedStringWrapper: [SwiftProtobuf.Google_Protobuf_StringValue] = [] + var _repeatedBytesWrapper: [SwiftProtobuf.Google_Protobuf_BytesValue] = [] + var _optionalDuration: SwiftProtobuf.Google_Protobuf_Duration? = nil + var _optionalTimestamp: SwiftProtobuf.Google_Protobuf_Timestamp? = nil + var _optionalFieldMask: SwiftProtobuf.Google_Protobuf_FieldMask? = nil + var _optionalStruct: SwiftProtobuf.Google_Protobuf_Struct? = nil + var _optionalAny: SwiftProtobuf.Google_Protobuf_Any? = nil + var _optionalValue: SwiftProtobuf.Google_Protobuf_Value? = nil + var _optionalNullValue: SwiftProtobuf.Google_Protobuf_NullValue = .nullValue + var _repeatedDuration: [SwiftProtobuf.Google_Protobuf_Duration] = [] + var _repeatedTimestamp: [SwiftProtobuf.Google_Protobuf_Timestamp] = [] + var _repeatedFieldmask: [SwiftProtobuf.Google_Protobuf_FieldMask] = [] + var _repeatedStruct: [SwiftProtobuf.Google_Protobuf_Struct] = [] + var _repeatedAny: [SwiftProtobuf.Google_Protobuf_Any] = [] + var _repeatedValue: [SwiftProtobuf.Google_Protobuf_Value] = [] + var _repeatedListValue: [SwiftProtobuf.Google_Protobuf_ListValue] = [] + var _fieldname1: Int32 = 0 + var _fieldName2: Int32 = 0 + var _fieldName3: Int32 = 0 + var _field_Name4_: Int32 = 0 + var _field0Name5: Int32 = 0 + var _field0Name6: Int32 = 0 + var _fieldName7: Int32 = 0 + var _fieldName8: Int32 = 0 + var _fieldName9: Int32 = 0 + var _fieldName10: Int32 = 0 + var _fieldName11: Int32 = 0 + var _fieldName12: Int32 = 0 + var __FieldName13: Int32 = 0 + var __FieldName14: Int32 = 0 + var _field_Name15: Int32 = 0 + var _field_Name16: Int32 = 0 + var _fieldName17__: Int32 = 0 + var _fieldName18__: Int32 = 0 + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _optionalInt32 = source._optionalInt32 + _optionalInt64 = source._optionalInt64 + _optionalUint32 = source._optionalUint32 + _optionalUint64 = source._optionalUint64 + _optionalSint32 = source._optionalSint32 + _optionalSint64 = source._optionalSint64 + _optionalFixed32 = source._optionalFixed32 + _optionalFixed64 = source._optionalFixed64 + _optionalSfixed32 = source._optionalSfixed32 + _optionalSfixed64 = source._optionalSfixed64 + _optionalFloat = source._optionalFloat + _optionalDouble = source._optionalDouble + _optionalBool = source._optionalBool + _optionalString = source._optionalString + _optionalBytes = source._optionalBytes + _optionalNestedMessage = source._optionalNestedMessage + _optionalForeignMessage = source._optionalForeignMessage + _optionalNestedEnum = source._optionalNestedEnum + _optionalForeignEnum = source._optionalForeignEnum + _optionalAliasedEnum = source._optionalAliasedEnum + _optionalStringPiece = source._optionalStringPiece + _optionalCord = source._optionalCord + _recursiveMessage = source._recursiveMessage + _repeatedInt32 = source._repeatedInt32 + _repeatedInt64 = source._repeatedInt64 + _repeatedUint32 = source._repeatedUint32 + _repeatedUint64 = source._repeatedUint64 + _repeatedSint32 = source._repeatedSint32 + _repeatedSint64 = source._repeatedSint64 + _repeatedFixed32 = source._repeatedFixed32 + _repeatedFixed64 = source._repeatedFixed64 + _repeatedSfixed32 = source._repeatedSfixed32 + _repeatedSfixed64 = source._repeatedSfixed64 + _repeatedFloat = source._repeatedFloat + _repeatedDouble = source._repeatedDouble + _repeatedBool = source._repeatedBool + _repeatedString = source._repeatedString + _repeatedBytes = source._repeatedBytes + _repeatedNestedMessage = source._repeatedNestedMessage + _repeatedForeignMessage = source._repeatedForeignMessage + _repeatedNestedEnum = source._repeatedNestedEnum + _repeatedForeignEnum = source._repeatedForeignEnum + _repeatedStringPiece = source._repeatedStringPiece + _repeatedCord = source._repeatedCord + _packedInt32 = source._packedInt32 + _packedInt64 = source._packedInt64 + _packedUint32 = source._packedUint32 + _packedUint64 = source._packedUint64 + _packedSint32 = source._packedSint32 + _packedSint64 = source._packedSint64 + _packedFixed32 = source._packedFixed32 + _packedFixed64 = source._packedFixed64 + _packedSfixed32 = source._packedSfixed32 + _packedSfixed64 = source._packedSfixed64 + _packedFloat = source._packedFloat + _packedDouble = source._packedDouble + _packedBool = source._packedBool + _packedNestedEnum = source._packedNestedEnum + _unpackedInt32 = source._unpackedInt32 + _unpackedInt64 = source._unpackedInt64 + _unpackedUint32 = source._unpackedUint32 + _unpackedUint64 = source._unpackedUint64 + _unpackedSint32 = source._unpackedSint32 + _unpackedSint64 = source._unpackedSint64 + _unpackedFixed32 = source._unpackedFixed32 + _unpackedFixed64 = source._unpackedFixed64 + _unpackedSfixed32 = source._unpackedSfixed32 + _unpackedSfixed64 = source._unpackedSfixed64 + _unpackedFloat = source._unpackedFloat + _unpackedDouble = source._unpackedDouble + _unpackedBool = source._unpackedBool + _unpackedNestedEnum = source._unpackedNestedEnum + _mapInt32Int32 = source._mapInt32Int32 + _mapInt64Int64 = source._mapInt64Int64 + _mapUint32Uint32 = source._mapUint32Uint32 + _mapUint64Uint64 = source._mapUint64Uint64 + _mapSint32Sint32 = source._mapSint32Sint32 + _mapSint64Sint64 = source._mapSint64Sint64 + _mapFixed32Fixed32 = source._mapFixed32Fixed32 + _mapFixed64Fixed64 = source._mapFixed64Fixed64 + _mapSfixed32Sfixed32 = source._mapSfixed32Sfixed32 + _mapSfixed64Sfixed64 = source._mapSfixed64Sfixed64 + _mapInt32Float = source._mapInt32Float + _mapInt32Double = source._mapInt32Double + _mapBoolBool = source._mapBoolBool + _mapStringString = source._mapStringString + _mapStringBytes = source._mapStringBytes + _mapStringNestedMessage = source._mapStringNestedMessage + _mapStringForeignMessage = source._mapStringForeignMessage + _mapStringNestedEnum = source._mapStringNestedEnum + _mapStringForeignEnum = source._mapStringForeignEnum + _oneofField = source._oneofField + _optionalBoolWrapper = source._optionalBoolWrapper + _optionalInt32Wrapper = source._optionalInt32Wrapper + _optionalInt64Wrapper = source._optionalInt64Wrapper + _optionalUint32Wrapper = source._optionalUint32Wrapper + _optionalUint64Wrapper = source._optionalUint64Wrapper + _optionalFloatWrapper = source._optionalFloatWrapper + _optionalDoubleWrapper = source._optionalDoubleWrapper + _optionalStringWrapper = source._optionalStringWrapper + _optionalBytesWrapper = source._optionalBytesWrapper + _repeatedBoolWrapper = source._repeatedBoolWrapper + _repeatedInt32Wrapper = source._repeatedInt32Wrapper + _repeatedInt64Wrapper = source._repeatedInt64Wrapper + _repeatedUint32Wrapper = source._repeatedUint32Wrapper + _repeatedUint64Wrapper = source._repeatedUint64Wrapper + _repeatedFloatWrapper = source._repeatedFloatWrapper + _repeatedDoubleWrapper = source._repeatedDoubleWrapper + _repeatedStringWrapper = source._repeatedStringWrapper + _repeatedBytesWrapper = source._repeatedBytesWrapper + _optionalDuration = source._optionalDuration + _optionalTimestamp = source._optionalTimestamp + _optionalFieldMask = source._optionalFieldMask + _optionalStruct = source._optionalStruct + _optionalAny = source._optionalAny + _optionalValue = source._optionalValue + _optionalNullValue = source._optionalNullValue + _repeatedDuration = source._repeatedDuration + _repeatedTimestamp = source._repeatedTimestamp + _repeatedFieldmask = source._repeatedFieldmask + _repeatedStruct = source._repeatedStruct + _repeatedAny = source._repeatedAny + _repeatedValue = source._repeatedValue + _repeatedListValue = source._repeatedListValue + _fieldname1 = source._fieldname1 + _fieldName2 = source._fieldName2 + _fieldName3 = source._fieldName3 + _field_Name4_ = source._field_Name4_ + _field0Name5 = source._field0Name5 + _field0Name6 = source._field0Name6 + _fieldName7 = source._fieldName7 + _fieldName8 = source._fieldName8 + _fieldName9 = source._fieldName9 + _fieldName10 = source._fieldName10 + _fieldName11 = source._fieldName11 + _fieldName12 = source._fieldName12 + __FieldName13 = source.__FieldName13 + __FieldName14 = source.__FieldName14 + _field_Name15 = source._field_Name15 + _field_Name16 = source._field_Name16 + _fieldName17__ = source._fieldName17__ + _fieldName18__ = source._fieldName18__ + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._optionalInt32) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._optionalInt64) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint32) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._optionalUint64) }() + case 5: try { try decoder.decodeSingularSInt32Field(value: &_storage._optionalSint32) }() + case 6: try { try decoder.decodeSingularSInt64Field(value: &_storage._optionalSint64) }() + case 7: try { try decoder.decodeSingularFixed32Field(value: &_storage._optionalFixed32) }() + case 8: try { try decoder.decodeSingularFixed64Field(value: &_storage._optionalFixed64) }() + case 9: try { try decoder.decodeSingularSFixed32Field(value: &_storage._optionalSfixed32) }() + case 10: try { try decoder.decodeSingularSFixed64Field(value: &_storage._optionalSfixed64) }() + case 11: try { try decoder.decodeSingularFloatField(value: &_storage._optionalFloat) }() + case 12: try { try decoder.decodeSingularDoubleField(value: &_storage._optionalDouble) }() + case 13: try { try decoder.decodeSingularBoolField(value: &_storage._optionalBool) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._optionalString) }() + case 15: try { try decoder.decodeSingularBytesField(value: &_storage._optionalBytes) }() + case 18: try { try decoder.decodeSingularMessageField(value: &_storage._optionalNestedMessage) }() + case 19: try { try decoder.decodeSingularMessageField(value: &_storage._optionalForeignMessage) }() + case 21: try { try decoder.decodeSingularEnumField(value: &_storage._optionalNestedEnum) }() + case 22: try { try decoder.decodeSingularEnumField(value: &_storage._optionalForeignEnum) }() + case 23: try { try decoder.decodeSingularEnumField(value: &_storage._optionalAliasedEnum) }() + case 24: try { try decoder.decodeSingularStringField(value: &_storage._optionalStringPiece) }() + case 25: try { try decoder.decodeSingularStringField(value: &_storage._optionalCord) }() + case 27: try { try decoder.decodeSingularMessageField(value: &_storage._recursiveMessage) }() + case 31: try { try decoder.decodeRepeatedInt32Field(value: &_storage._repeatedInt32) }() + case 32: try { try decoder.decodeRepeatedInt64Field(value: &_storage._repeatedInt64) }() + case 33: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._repeatedUint32) }() + case 34: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._repeatedUint64) }() + case 35: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._repeatedSint32) }() + case 36: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._repeatedSint64) }() + case 37: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._repeatedFixed32) }() + case 38: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._repeatedFixed64) }() + case 39: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._repeatedSfixed32) }() + case 40: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._repeatedSfixed64) }() + case 41: try { try decoder.decodeRepeatedFloatField(value: &_storage._repeatedFloat) }() + case 42: try { try decoder.decodeRepeatedDoubleField(value: &_storage._repeatedDouble) }() + case 43: try { try decoder.decodeRepeatedBoolField(value: &_storage._repeatedBool) }() + case 44: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedString) }() + case 45: try { try decoder.decodeRepeatedBytesField(value: &_storage._repeatedBytes) }() + case 48: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedNestedMessage) }() + case 49: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedForeignMessage) }() + case 51: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedNestedEnum) }() + case 52: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedForeignEnum) }() + case 54: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedStringPiece) }() + case 55: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedCord) }() + case 56: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Int32) }() + case 57: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt64Int64) }() + case 58: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapUint32Uint32) }() + case 59: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapUint64Uint64) }() + case 60: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSint32Sint32) }() + case 61: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSint64Sint64) }() + case 62: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapFixed32Fixed32) }() + case 63: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapFixed64Fixed64) }() + case 64: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSfixed32Sfixed32) }() + case 65: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSfixed64Sfixed64) }() + case 66: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Float) }() + case 67: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Double) }() + case 68: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapBoolBool) }() + case 69: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapStringString) }() + case 70: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapStringBytes) }() + case 71: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._mapStringNestedMessage) }() + case 72: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._mapStringForeignMessage) }() + case 73: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &_storage._mapStringNestedEnum) }() + case 74: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &_storage._mapStringForeignEnum) }() + case 75: try { try decoder.decodeRepeatedInt32Field(value: &_storage._packedInt32) }() + case 76: try { try decoder.decodeRepeatedInt64Field(value: &_storage._packedInt64) }() + case 77: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._packedUint32) }() + case 78: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._packedUint64) }() + case 79: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._packedSint32) }() + case 80: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._packedSint64) }() + case 81: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._packedFixed32) }() + case 82: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._packedFixed64) }() + case 83: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._packedSfixed32) }() + case 84: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._packedSfixed64) }() + case 85: try { try decoder.decodeRepeatedFloatField(value: &_storage._packedFloat) }() + case 86: try { try decoder.decodeRepeatedDoubleField(value: &_storage._packedDouble) }() + case 87: try { try decoder.decodeRepeatedBoolField(value: &_storage._packedBool) }() + case 88: try { try decoder.decodeRepeatedEnumField(value: &_storage._packedNestedEnum) }() + case 89: try { try decoder.decodeRepeatedInt32Field(value: &_storage._unpackedInt32) }() + case 90: try { try decoder.decodeRepeatedInt64Field(value: &_storage._unpackedInt64) }() + case 91: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._unpackedUint32) }() + case 92: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._unpackedUint64) }() + case 93: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._unpackedSint32) }() + case 94: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._unpackedSint64) }() + case 95: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._unpackedFixed32) }() + case 96: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._unpackedFixed64) }() + case 97: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._unpackedSfixed32) }() + case 98: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._unpackedSfixed64) }() + case 99: try { try decoder.decodeRepeatedFloatField(value: &_storage._unpackedFloat) }() + case 100: try { try decoder.decodeRepeatedDoubleField(value: &_storage._unpackedDouble) }() + case 101: try { try decoder.decodeRepeatedBoolField(value: &_storage._unpackedBool) }() + case 102: try { try decoder.decodeRepeatedEnumField(value: &_storage._unpackedNestedEnum) }() + case 111: try { + var v: UInt32? + try decoder.decodeSingularUInt32Field(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofUint32(v) + } + }() + case 112: try { + var v: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage? + var hadOneofValue = false + if let current = _storage._oneofField { + hadOneofValue = true + if case .oneofNestedMessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofNestedMessage(v) + } + }() + case 113: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofString(v) + } + }() + case 114: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofBytes(v) + } + }() + case 115: try { + var v: Bool? + try decoder.decodeSingularBoolField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofBool(v) + } + }() + case 116: try { + var v: UInt64? + try decoder.decodeSingularUInt64Field(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofUint64(v) + } + }() + case 117: try { + var v: Float? + try decoder.decodeSingularFloatField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofFloat(v) + } + }() + case 118: try { + var v: Double? + try decoder.decodeSingularDoubleField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofDouble(v) + } + }() + case 119: try { + var v: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofEnum(v) + } + }() + case 120: try { + var v: SwiftProtobuf.Google_Protobuf_NullValue? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofNullValue(v) + } + }() + case 201: try { try decoder.decodeSingularMessageField(value: &_storage._optionalBoolWrapper) }() + case 202: try { try decoder.decodeSingularMessageField(value: &_storage._optionalInt32Wrapper) }() + case 203: try { try decoder.decodeSingularMessageField(value: &_storage._optionalInt64Wrapper) }() + case 204: try { try decoder.decodeSingularMessageField(value: &_storage._optionalUint32Wrapper) }() + case 205: try { try decoder.decodeSingularMessageField(value: &_storage._optionalUint64Wrapper) }() + case 206: try { try decoder.decodeSingularMessageField(value: &_storage._optionalFloatWrapper) }() + case 207: try { try decoder.decodeSingularMessageField(value: &_storage._optionalDoubleWrapper) }() + case 208: try { try decoder.decodeSingularMessageField(value: &_storage._optionalStringWrapper) }() + case 209: try { try decoder.decodeSingularMessageField(value: &_storage._optionalBytesWrapper) }() + case 211: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedBoolWrapper) }() + case 212: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedInt32Wrapper) }() + case 213: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedInt64Wrapper) }() + case 214: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedUint32Wrapper) }() + case 215: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedUint64Wrapper) }() + case 216: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedFloatWrapper) }() + case 217: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedDoubleWrapper) }() + case 218: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedStringWrapper) }() + case 219: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedBytesWrapper) }() + case 301: try { try decoder.decodeSingularMessageField(value: &_storage._optionalDuration) }() + case 302: try { try decoder.decodeSingularMessageField(value: &_storage._optionalTimestamp) }() + case 303: try { try decoder.decodeSingularMessageField(value: &_storage._optionalFieldMask) }() + case 304: try { try decoder.decodeSingularMessageField(value: &_storage._optionalStruct) }() + case 305: try { try decoder.decodeSingularMessageField(value: &_storage._optionalAny) }() + case 306: try { try decoder.decodeSingularMessageField(value: &_storage._optionalValue) }() + case 307: try { try decoder.decodeSingularEnumField(value: &_storage._optionalNullValue) }() + case 311: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedDuration) }() + case 312: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedTimestamp) }() + case 313: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedFieldmask) }() + case 315: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedAny) }() + case 316: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedValue) }() + case 317: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedListValue) }() + case 324: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedStruct) }() + case 401: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldname1) }() + case 402: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName2) }() + case 403: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName3) }() + case 404: try { try decoder.decodeSingularInt32Field(value: &_storage._field_Name4_) }() + case 405: try { try decoder.decodeSingularInt32Field(value: &_storage._field0Name5) }() + case 406: try { try decoder.decodeSingularInt32Field(value: &_storage._field0Name6) }() + case 407: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName7) }() + case 408: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName8) }() + case 409: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName9) }() + case 410: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName10) }() + case 411: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName11) }() + case 412: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName12) }() + case 413: try { try decoder.decodeSingularInt32Field(value: &_storage.__FieldName13) }() + case 414: try { try decoder.decodeSingularInt32Field(value: &_storage.__FieldName14) }() + case 415: try { try decoder.decodeSingularInt32Field(value: &_storage._field_Name15) }() + case 416: try { try decoder.decodeSingularInt32Field(value: &_storage._field_Name16) }() + case 417: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName17__) }() + case 418: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName18__) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if _storage._optionalInt32 != 0 { + try visitor.visitSingularInt32Field(value: _storage._optionalInt32, fieldNumber: 1) + } + if _storage._optionalInt64 != 0 { + try visitor.visitSingularInt64Field(value: _storage._optionalInt64, fieldNumber: 2) + } + if _storage._optionalUint32 != 0 { + try visitor.visitSingularUInt32Field(value: _storage._optionalUint32, fieldNumber: 3) + } + if _storage._optionalUint64 != 0 { + try visitor.visitSingularUInt64Field(value: _storage._optionalUint64, fieldNumber: 4) + } + if _storage._optionalSint32 != 0 { + try visitor.visitSingularSInt32Field(value: _storage._optionalSint32, fieldNumber: 5) + } + if _storage._optionalSint64 != 0 { + try visitor.visitSingularSInt64Field(value: _storage._optionalSint64, fieldNumber: 6) + } + if _storage._optionalFixed32 != 0 { + try visitor.visitSingularFixed32Field(value: _storage._optionalFixed32, fieldNumber: 7) + } + if _storage._optionalFixed64 != 0 { + try visitor.visitSingularFixed64Field(value: _storage._optionalFixed64, fieldNumber: 8) + } + if _storage._optionalSfixed32 != 0 { + try visitor.visitSingularSFixed32Field(value: _storage._optionalSfixed32, fieldNumber: 9) + } + if _storage._optionalSfixed64 != 0 { + try visitor.visitSingularSFixed64Field(value: _storage._optionalSfixed64, fieldNumber: 10) + } + if _storage._optionalFloat != 0 { + try visitor.visitSingularFloatField(value: _storage._optionalFloat, fieldNumber: 11) + } + if _storage._optionalDouble != 0 { + try visitor.visitSingularDoubleField(value: _storage._optionalDouble, fieldNumber: 12) + } + if _storage._optionalBool != false { + try visitor.visitSingularBoolField(value: _storage._optionalBool, fieldNumber: 13) + } + if !_storage._optionalString.isEmpty { + try visitor.visitSingularStringField(value: _storage._optionalString, fieldNumber: 14) + } + if !_storage._optionalBytes.isEmpty { + try visitor.visitSingularBytesField(value: _storage._optionalBytes, fieldNumber: 15) + } + try { if let v = _storage._optionalNestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._optionalForeignMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + } }() + if _storage._optionalNestedEnum != .foo { + try visitor.visitSingularEnumField(value: _storage._optionalNestedEnum, fieldNumber: 21) + } + if _storage._optionalForeignEnum != .foreignFoo { + try visitor.visitSingularEnumField(value: _storage._optionalForeignEnum, fieldNumber: 22) + } + if _storage._optionalAliasedEnum != .aliasFoo { + try visitor.visitSingularEnumField(value: _storage._optionalAliasedEnum, fieldNumber: 23) + } + if !_storage._optionalStringPiece.isEmpty { + try visitor.visitSingularStringField(value: _storage._optionalStringPiece, fieldNumber: 24) + } + if !_storage._optionalCord.isEmpty { + try visitor.visitSingularStringField(value: _storage._optionalCord, fieldNumber: 25) + } + try { if let v = _storage._recursiveMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 27) + } }() + if !_storage._repeatedInt32.isEmpty { + try visitor.visitPackedInt32Field(value: _storage._repeatedInt32, fieldNumber: 31) + } + if !_storage._repeatedInt64.isEmpty { + try visitor.visitPackedInt64Field(value: _storage._repeatedInt64, fieldNumber: 32) + } + if !_storage._repeatedUint32.isEmpty { + try visitor.visitPackedUInt32Field(value: _storage._repeatedUint32, fieldNumber: 33) + } + if !_storage._repeatedUint64.isEmpty { + try visitor.visitPackedUInt64Field(value: _storage._repeatedUint64, fieldNumber: 34) + } + if !_storage._repeatedSint32.isEmpty { + try visitor.visitPackedSInt32Field(value: _storage._repeatedSint32, fieldNumber: 35) + } + if !_storage._repeatedSint64.isEmpty { + try visitor.visitPackedSInt64Field(value: _storage._repeatedSint64, fieldNumber: 36) + } + if !_storage._repeatedFixed32.isEmpty { + try visitor.visitPackedFixed32Field(value: _storage._repeatedFixed32, fieldNumber: 37) + } + if !_storage._repeatedFixed64.isEmpty { + try visitor.visitPackedFixed64Field(value: _storage._repeatedFixed64, fieldNumber: 38) + } + if !_storage._repeatedSfixed32.isEmpty { + try visitor.visitPackedSFixed32Field(value: _storage._repeatedSfixed32, fieldNumber: 39) + } + if !_storage._repeatedSfixed64.isEmpty { + try visitor.visitPackedSFixed64Field(value: _storage._repeatedSfixed64, fieldNumber: 40) + } + if !_storage._repeatedFloat.isEmpty { + try visitor.visitPackedFloatField(value: _storage._repeatedFloat, fieldNumber: 41) + } + if !_storage._repeatedDouble.isEmpty { + try visitor.visitPackedDoubleField(value: _storage._repeatedDouble, fieldNumber: 42) + } + if !_storage._repeatedBool.isEmpty { + try visitor.visitPackedBoolField(value: _storage._repeatedBool, fieldNumber: 43) + } + if !_storage._repeatedString.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedString, fieldNumber: 44) + } + if !_storage._repeatedBytes.isEmpty { + try visitor.visitRepeatedBytesField(value: _storage._repeatedBytes, fieldNumber: 45) + } + if !_storage._repeatedNestedMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedNestedMessage, fieldNumber: 48) + } + if !_storage._repeatedForeignMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedForeignMessage, fieldNumber: 49) + } + if !_storage._repeatedNestedEnum.isEmpty { + try visitor.visitPackedEnumField(value: _storage._repeatedNestedEnum, fieldNumber: 51) + } + if !_storage._repeatedForeignEnum.isEmpty { + try visitor.visitPackedEnumField(value: _storage._repeatedForeignEnum, fieldNumber: 52) + } + if !_storage._repeatedStringPiece.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedStringPiece, fieldNumber: 54) + } + if !_storage._repeatedCord.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedCord, fieldNumber: 55) + } + if !_storage._mapInt32Int32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Int32, fieldNumber: 56) + } + if !_storage._mapInt64Int64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt64Int64, fieldNumber: 57) + } + if !_storage._mapUint32Uint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapUint32Uint32, fieldNumber: 58) + } + if !_storage._mapUint64Uint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapUint64Uint64, fieldNumber: 59) + } + if !_storage._mapSint32Sint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSint32Sint32, fieldNumber: 60) + } + if !_storage._mapSint64Sint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSint64Sint64, fieldNumber: 61) + } + if !_storage._mapFixed32Fixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapFixed32Fixed32, fieldNumber: 62) + } + if !_storage._mapFixed64Fixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapFixed64Fixed64, fieldNumber: 63) + } + if !_storage._mapSfixed32Sfixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSfixed32Sfixed32, fieldNumber: 64) + } + if !_storage._mapSfixed64Sfixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSfixed64Sfixed64, fieldNumber: 65) + } + if !_storage._mapInt32Float.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Float, fieldNumber: 66) + } + if !_storage._mapInt32Double.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Double, fieldNumber: 67) + } + if !_storage._mapBoolBool.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapBoolBool, fieldNumber: 68) + } + if !_storage._mapStringString.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapStringString, fieldNumber: 69) + } + if !_storage._mapStringBytes.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapStringBytes, fieldNumber: 70) + } + if !_storage._mapStringNestedMessage.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._mapStringNestedMessage, fieldNumber: 71) + } + if !_storage._mapStringForeignMessage.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._mapStringForeignMessage, fieldNumber: 72) + } + if !_storage._mapStringNestedEnum.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: _storage._mapStringNestedEnum, fieldNumber: 73) + } + if !_storage._mapStringForeignEnum.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: _storage._mapStringForeignEnum, fieldNumber: 74) + } + if !_storage._packedInt32.isEmpty { + try visitor.visitPackedInt32Field(value: _storage._packedInt32, fieldNumber: 75) + } + if !_storage._packedInt64.isEmpty { + try visitor.visitPackedInt64Field(value: _storage._packedInt64, fieldNumber: 76) + } + if !_storage._packedUint32.isEmpty { + try visitor.visitPackedUInt32Field(value: _storage._packedUint32, fieldNumber: 77) + } + if !_storage._packedUint64.isEmpty { + try visitor.visitPackedUInt64Field(value: _storage._packedUint64, fieldNumber: 78) + } + if !_storage._packedSint32.isEmpty { + try visitor.visitPackedSInt32Field(value: _storage._packedSint32, fieldNumber: 79) + } + if !_storage._packedSint64.isEmpty { + try visitor.visitPackedSInt64Field(value: _storage._packedSint64, fieldNumber: 80) + } + if !_storage._packedFixed32.isEmpty { + try visitor.visitPackedFixed32Field(value: _storage._packedFixed32, fieldNumber: 81) + } + if !_storage._packedFixed64.isEmpty { + try visitor.visitPackedFixed64Field(value: _storage._packedFixed64, fieldNumber: 82) + } + if !_storage._packedSfixed32.isEmpty { + try visitor.visitPackedSFixed32Field(value: _storage._packedSfixed32, fieldNumber: 83) + } + if !_storage._packedSfixed64.isEmpty { + try visitor.visitPackedSFixed64Field(value: _storage._packedSfixed64, fieldNumber: 84) + } + if !_storage._packedFloat.isEmpty { + try visitor.visitPackedFloatField(value: _storage._packedFloat, fieldNumber: 85) + } + if !_storage._packedDouble.isEmpty { + try visitor.visitPackedDoubleField(value: _storage._packedDouble, fieldNumber: 86) + } + if !_storage._packedBool.isEmpty { + try visitor.visitPackedBoolField(value: _storage._packedBool, fieldNumber: 87) + } + if !_storage._packedNestedEnum.isEmpty { + try visitor.visitPackedEnumField(value: _storage._packedNestedEnum, fieldNumber: 88) + } + if !_storage._unpackedInt32.isEmpty { + try visitor.visitRepeatedInt32Field(value: _storage._unpackedInt32, fieldNumber: 89) + } + if !_storage._unpackedInt64.isEmpty { + try visitor.visitRepeatedInt64Field(value: _storage._unpackedInt64, fieldNumber: 90) + } + if !_storage._unpackedUint32.isEmpty { + try visitor.visitRepeatedUInt32Field(value: _storage._unpackedUint32, fieldNumber: 91) + } + if !_storage._unpackedUint64.isEmpty { + try visitor.visitRepeatedUInt64Field(value: _storage._unpackedUint64, fieldNumber: 92) + } + if !_storage._unpackedSint32.isEmpty { + try visitor.visitRepeatedSInt32Field(value: _storage._unpackedSint32, fieldNumber: 93) + } + if !_storage._unpackedSint64.isEmpty { + try visitor.visitRepeatedSInt64Field(value: _storage._unpackedSint64, fieldNumber: 94) + } + if !_storage._unpackedFixed32.isEmpty { + try visitor.visitRepeatedFixed32Field(value: _storage._unpackedFixed32, fieldNumber: 95) + } + if !_storage._unpackedFixed64.isEmpty { + try visitor.visitRepeatedFixed64Field(value: _storage._unpackedFixed64, fieldNumber: 96) + } + if !_storage._unpackedSfixed32.isEmpty { + try visitor.visitRepeatedSFixed32Field(value: _storage._unpackedSfixed32, fieldNumber: 97) + } + if !_storage._unpackedSfixed64.isEmpty { + try visitor.visitRepeatedSFixed64Field(value: _storage._unpackedSfixed64, fieldNumber: 98) + } + if !_storage._unpackedFloat.isEmpty { + try visitor.visitRepeatedFloatField(value: _storage._unpackedFloat, fieldNumber: 99) + } + if !_storage._unpackedDouble.isEmpty { + try visitor.visitRepeatedDoubleField(value: _storage._unpackedDouble, fieldNumber: 100) + } + if !_storage._unpackedBool.isEmpty { + try visitor.visitRepeatedBoolField(value: _storage._unpackedBool, fieldNumber: 101) + } + if !_storage._unpackedNestedEnum.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._unpackedNestedEnum, fieldNumber: 102) + } + switch _storage._oneofField { + case .oneofUint32?: try { + guard case .oneofUint32(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 111) + }() + case .oneofNestedMessage?: try { + guard case .oneofNestedMessage(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 112) + }() + case .oneofString?: try { + guard case .oneofString(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 113) + }() + case .oneofBytes?: try { + guard case .oneofBytes(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 114) + }() + case .oneofBool?: try { + guard case .oneofBool(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularBoolField(value: v, fieldNumber: 115) + }() + case .oneofUint64?: try { + guard case .oneofUint64(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 116) + }() + case .oneofFloat?: try { + guard case .oneofFloat(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularFloatField(value: v, fieldNumber: 117) + }() + case .oneofDouble?: try { + guard case .oneofDouble(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularDoubleField(value: v, fieldNumber: 118) + }() + case .oneofEnum?: try { + guard case .oneofEnum(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 119) + }() + case .oneofNullValue?: try { + guard case .oneofNullValue(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 120) + }() + case nil: break + } + try { if let v = _storage._optionalBoolWrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 201) + } }() + try { if let v = _storage._optionalInt32Wrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 202) + } }() + try { if let v = _storage._optionalInt64Wrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 203) + } }() + try { if let v = _storage._optionalUint32Wrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 204) + } }() + try { if let v = _storage._optionalUint64Wrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 205) + } }() + try { if let v = _storage._optionalFloatWrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 206) + } }() + try { if let v = _storage._optionalDoubleWrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 207) + } }() + try { if let v = _storage._optionalStringWrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 208) + } }() + try { if let v = _storage._optionalBytesWrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 209) + } }() + if !_storage._repeatedBoolWrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedBoolWrapper, fieldNumber: 211) + } + if !_storage._repeatedInt32Wrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedInt32Wrapper, fieldNumber: 212) + } + if !_storage._repeatedInt64Wrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedInt64Wrapper, fieldNumber: 213) + } + if !_storage._repeatedUint32Wrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedUint32Wrapper, fieldNumber: 214) + } + if !_storage._repeatedUint64Wrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedUint64Wrapper, fieldNumber: 215) + } + if !_storage._repeatedFloatWrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedFloatWrapper, fieldNumber: 216) + } + if !_storage._repeatedDoubleWrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedDoubleWrapper, fieldNumber: 217) + } + if !_storage._repeatedStringWrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedStringWrapper, fieldNumber: 218) + } + if !_storage._repeatedBytesWrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedBytesWrapper, fieldNumber: 219) + } + try { if let v = _storage._optionalDuration { + try visitor.visitSingularMessageField(value: v, fieldNumber: 301) + } }() + try { if let v = _storage._optionalTimestamp { + try visitor.visitSingularMessageField(value: v, fieldNumber: 302) + } }() + try { if let v = _storage._optionalFieldMask { + try visitor.visitSingularMessageField(value: v, fieldNumber: 303) + } }() + try { if let v = _storage._optionalStruct { + try visitor.visitSingularMessageField(value: v, fieldNumber: 304) + } }() + try { if let v = _storage._optionalAny { + try visitor.visitSingularMessageField(value: v, fieldNumber: 305) + } }() + try { if let v = _storage._optionalValue { + try visitor.visitSingularMessageField(value: v, fieldNumber: 306) + } }() + if _storage._optionalNullValue != .nullValue { + try visitor.visitSingularEnumField(value: _storage._optionalNullValue, fieldNumber: 307) + } + if !_storage._repeatedDuration.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedDuration, fieldNumber: 311) + } + if !_storage._repeatedTimestamp.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedTimestamp, fieldNumber: 312) + } + if !_storage._repeatedFieldmask.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedFieldmask, fieldNumber: 313) + } + if !_storage._repeatedAny.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedAny, fieldNumber: 315) + } + if !_storage._repeatedValue.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedValue, fieldNumber: 316) + } + if !_storage._repeatedListValue.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedListValue, fieldNumber: 317) + } + if !_storage._repeatedStruct.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedStruct, fieldNumber: 324) + } + if _storage._fieldname1 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldname1, fieldNumber: 401) + } + if _storage._fieldName2 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName2, fieldNumber: 402) + } + if _storage._fieldName3 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName3, fieldNumber: 403) + } + if _storage._field_Name4_ != 0 { + try visitor.visitSingularInt32Field(value: _storage._field_Name4_, fieldNumber: 404) + } + if _storage._field0Name5 != 0 { + try visitor.visitSingularInt32Field(value: _storage._field0Name5, fieldNumber: 405) + } + if _storage._field0Name6 != 0 { + try visitor.visitSingularInt32Field(value: _storage._field0Name6, fieldNumber: 406) + } + if _storage._fieldName7 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName7, fieldNumber: 407) + } + if _storage._fieldName8 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName8, fieldNumber: 408) + } + if _storage._fieldName9 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName9, fieldNumber: 409) + } + if _storage._fieldName10 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName10, fieldNumber: 410) + } + if _storage._fieldName11 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName11, fieldNumber: 411) + } + if _storage._fieldName12 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName12, fieldNumber: 412) + } + if _storage.__FieldName13 != 0 { + try visitor.visitSingularInt32Field(value: _storage.__FieldName13, fieldNumber: 413) + } + if _storage.__FieldName14 != 0 { + try visitor.visitSingularInt32Field(value: _storage.__FieldName14, fieldNumber: 414) + } + if _storage._field_Name15 != 0 { + try visitor.visitSingularInt32Field(value: _storage._field_Name15, fieldNumber: 415) + } + if _storage._field_Name16 != 0 { + try visitor.visitSingularInt32Field(value: _storage._field_Name16, fieldNumber: 416) + } + if _storage._fieldName17__ != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName17__, fieldNumber: 417) + } + if _storage._fieldName18__ != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName18__, fieldNumber: 418) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto3_TestAllTypesProto3, rhs: ProtobufTestMessages_Proto3_TestAllTypesProto3) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._optionalInt32 != rhs_storage._optionalInt32 {return false} + if _storage._optionalInt64 != rhs_storage._optionalInt64 {return false} + if _storage._optionalUint32 != rhs_storage._optionalUint32 {return false} + if _storage._optionalUint64 != rhs_storage._optionalUint64 {return false} + if _storage._optionalSint32 != rhs_storage._optionalSint32 {return false} + if _storage._optionalSint64 != rhs_storage._optionalSint64 {return false} + if _storage._optionalFixed32 != rhs_storage._optionalFixed32 {return false} + if _storage._optionalFixed64 != rhs_storage._optionalFixed64 {return false} + if _storage._optionalSfixed32 != rhs_storage._optionalSfixed32 {return false} + if _storage._optionalSfixed64 != rhs_storage._optionalSfixed64 {return false} + if _storage._optionalFloat != rhs_storage._optionalFloat {return false} + if _storage._optionalDouble != rhs_storage._optionalDouble {return false} + if _storage._optionalBool != rhs_storage._optionalBool {return false} + if _storage._optionalString != rhs_storage._optionalString {return false} + if _storage._optionalBytes != rhs_storage._optionalBytes {return false} + if _storage._optionalNestedMessage != rhs_storage._optionalNestedMessage {return false} + if _storage._optionalForeignMessage != rhs_storage._optionalForeignMessage {return false} + if _storage._optionalNestedEnum != rhs_storage._optionalNestedEnum {return false} + if _storage._optionalForeignEnum != rhs_storage._optionalForeignEnum {return false} + if _storage._optionalAliasedEnum != rhs_storage._optionalAliasedEnum {return false} + if _storage._optionalStringPiece != rhs_storage._optionalStringPiece {return false} + if _storage._optionalCord != rhs_storage._optionalCord {return false} + if _storage._recursiveMessage != rhs_storage._recursiveMessage {return false} + if _storage._repeatedInt32 != rhs_storage._repeatedInt32 {return false} + if _storage._repeatedInt64 != rhs_storage._repeatedInt64 {return false} + if _storage._repeatedUint32 != rhs_storage._repeatedUint32 {return false} + if _storage._repeatedUint64 != rhs_storage._repeatedUint64 {return false} + if _storage._repeatedSint32 != rhs_storage._repeatedSint32 {return false} + if _storage._repeatedSint64 != rhs_storage._repeatedSint64 {return false} + if _storage._repeatedFixed32 != rhs_storage._repeatedFixed32 {return false} + if _storage._repeatedFixed64 != rhs_storage._repeatedFixed64 {return false} + if _storage._repeatedSfixed32 != rhs_storage._repeatedSfixed32 {return false} + if _storage._repeatedSfixed64 != rhs_storage._repeatedSfixed64 {return false} + if _storage._repeatedFloat != rhs_storage._repeatedFloat {return false} + if _storage._repeatedDouble != rhs_storage._repeatedDouble {return false} + if _storage._repeatedBool != rhs_storage._repeatedBool {return false} + if _storage._repeatedString != rhs_storage._repeatedString {return false} + if _storage._repeatedBytes != rhs_storage._repeatedBytes {return false} + if _storage._repeatedNestedMessage != rhs_storage._repeatedNestedMessage {return false} + if _storage._repeatedForeignMessage != rhs_storage._repeatedForeignMessage {return false} + if _storage._repeatedNestedEnum != rhs_storage._repeatedNestedEnum {return false} + if _storage._repeatedForeignEnum != rhs_storage._repeatedForeignEnum {return false} + if _storage._repeatedStringPiece != rhs_storage._repeatedStringPiece {return false} + if _storage._repeatedCord != rhs_storage._repeatedCord {return false} + if _storage._packedInt32 != rhs_storage._packedInt32 {return false} + if _storage._packedInt64 != rhs_storage._packedInt64 {return false} + if _storage._packedUint32 != rhs_storage._packedUint32 {return false} + if _storage._packedUint64 != rhs_storage._packedUint64 {return false} + if _storage._packedSint32 != rhs_storage._packedSint32 {return false} + if _storage._packedSint64 != rhs_storage._packedSint64 {return false} + if _storage._packedFixed32 != rhs_storage._packedFixed32 {return false} + if _storage._packedFixed64 != rhs_storage._packedFixed64 {return false} + if _storage._packedSfixed32 != rhs_storage._packedSfixed32 {return false} + if _storage._packedSfixed64 != rhs_storage._packedSfixed64 {return false} + if _storage._packedFloat != rhs_storage._packedFloat {return false} + if _storage._packedDouble != rhs_storage._packedDouble {return false} + if _storage._packedBool != rhs_storage._packedBool {return false} + if _storage._packedNestedEnum != rhs_storage._packedNestedEnum {return false} + if _storage._unpackedInt32 != rhs_storage._unpackedInt32 {return false} + if _storage._unpackedInt64 != rhs_storage._unpackedInt64 {return false} + if _storage._unpackedUint32 != rhs_storage._unpackedUint32 {return false} + if _storage._unpackedUint64 != rhs_storage._unpackedUint64 {return false} + if _storage._unpackedSint32 != rhs_storage._unpackedSint32 {return false} + if _storage._unpackedSint64 != rhs_storage._unpackedSint64 {return false} + if _storage._unpackedFixed32 != rhs_storage._unpackedFixed32 {return false} + if _storage._unpackedFixed64 != rhs_storage._unpackedFixed64 {return false} + if _storage._unpackedSfixed32 != rhs_storage._unpackedSfixed32 {return false} + if _storage._unpackedSfixed64 != rhs_storage._unpackedSfixed64 {return false} + if _storage._unpackedFloat != rhs_storage._unpackedFloat {return false} + if _storage._unpackedDouble != rhs_storage._unpackedDouble {return false} + if _storage._unpackedBool != rhs_storage._unpackedBool {return false} + if _storage._unpackedNestedEnum != rhs_storage._unpackedNestedEnum {return false} + if _storage._mapInt32Int32 != rhs_storage._mapInt32Int32 {return false} + if _storage._mapInt64Int64 != rhs_storage._mapInt64Int64 {return false} + if _storage._mapUint32Uint32 != rhs_storage._mapUint32Uint32 {return false} + if _storage._mapUint64Uint64 != rhs_storage._mapUint64Uint64 {return false} + if _storage._mapSint32Sint32 != rhs_storage._mapSint32Sint32 {return false} + if _storage._mapSint64Sint64 != rhs_storage._mapSint64Sint64 {return false} + if _storage._mapFixed32Fixed32 != rhs_storage._mapFixed32Fixed32 {return false} + if _storage._mapFixed64Fixed64 != rhs_storage._mapFixed64Fixed64 {return false} + if _storage._mapSfixed32Sfixed32 != rhs_storage._mapSfixed32Sfixed32 {return false} + if _storage._mapSfixed64Sfixed64 != rhs_storage._mapSfixed64Sfixed64 {return false} + if _storage._mapInt32Float != rhs_storage._mapInt32Float {return false} + if _storage._mapInt32Double != rhs_storage._mapInt32Double {return false} + if _storage._mapBoolBool != rhs_storage._mapBoolBool {return false} + if _storage._mapStringString != rhs_storage._mapStringString {return false} + if _storage._mapStringBytes != rhs_storage._mapStringBytes {return false} + if _storage._mapStringNestedMessage != rhs_storage._mapStringNestedMessage {return false} + if _storage._mapStringForeignMessage != rhs_storage._mapStringForeignMessage {return false} + if _storage._mapStringNestedEnum != rhs_storage._mapStringNestedEnum {return false} + if _storage._mapStringForeignEnum != rhs_storage._mapStringForeignEnum {return false} + if _storage._oneofField != rhs_storage._oneofField {return false} + if _storage._optionalBoolWrapper != rhs_storage._optionalBoolWrapper {return false} + if _storage._optionalInt32Wrapper != rhs_storage._optionalInt32Wrapper {return false} + if _storage._optionalInt64Wrapper != rhs_storage._optionalInt64Wrapper {return false} + if _storage._optionalUint32Wrapper != rhs_storage._optionalUint32Wrapper {return false} + if _storage._optionalUint64Wrapper != rhs_storage._optionalUint64Wrapper {return false} + if _storage._optionalFloatWrapper != rhs_storage._optionalFloatWrapper {return false} + if _storage._optionalDoubleWrapper != rhs_storage._optionalDoubleWrapper {return false} + if _storage._optionalStringWrapper != rhs_storage._optionalStringWrapper {return false} + if _storage._optionalBytesWrapper != rhs_storage._optionalBytesWrapper {return false} + if _storage._repeatedBoolWrapper != rhs_storage._repeatedBoolWrapper {return false} + if _storage._repeatedInt32Wrapper != rhs_storage._repeatedInt32Wrapper {return false} + if _storage._repeatedInt64Wrapper != rhs_storage._repeatedInt64Wrapper {return false} + if _storage._repeatedUint32Wrapper != rhs_storage._repeatedUint32Wrapper {return false} + if _storage._repeatedUint64Wrapper != rhs_storage._repeatedUint64Wrapper {return false} + if _storage._repeatedFloatWrapper != rhs_storage._repeatedFloatWrapper {return false} + if _storage._repeatedDoubleWrapper != rhs_storage._repeatedDoubleWrapper {return false} + if _storage._repeatedStringWrapper != rhs_storage._repeatedStringWrapper {return false} + if _storage._repeatedBytesWrapper != rhs_storage._repeatedBytesWrapper {return false} + if _storage._optionalDuration != rhs_storage._optionalDuration {return false} + if _storage._optionalTimestamp != rhs_storage._optionalTimestamp {return false} + if _storage._optionalFieldMask != rhs_storage._optionalFieldMask {return false} + if _storage._optionalStruct != rhs_storage._optionalStruct {return false} + if _storage._optionalAny != rhs_storage._optionalAny {return false} + if _storage._optionalValue != rhs_storage._optionalValue {return false} + if _storage._optionalNullValue != rhs_storage._optionalNullValue {return false} + if _storage._repeatedDuration != rhs_storage._repeatedDuration {return false} + if _storage._repeatedTimestamp != rhs_storage._repeatedTimestamp {return false} + if _storage._repeatedFieldmask != rhs_storage._repeatedFieldmask {return false} + if _storage._repeatedStruct != rhs_storage._repeatedStruct {return false} + if _storage._repeatedAny != rhs_storage._repeatedAny {return false} + if _storage._repeatedValue != rhs_storage._repeatedValue {return false} + if _storage._repeatedListValue != rhs_storage._repeatedListValue {return false} + if _storage._fieldname1 != rhs_storage._fieldname1 {return false} + if _storage._fieldName2 != rhs_storage._fieldName2 {return false} + if _storage._fieldName3 != rhs_storage._fieldName3 {return false} + if _storage._field_Name4_ != rhs_storage._field_Name4_ {return false} + if _storage._field0Name5 != rhs_storage._field0Name5 {return false} + if _storage._field0Name6 != rhs_storage._field0Name6 {return false} + if _storage._fieldName7 != rhs_storage._fieldName7 {return false} + if _storage._fieldName8 != rhs_storage._fieldName8 {return false} + if _storage._fieldName9 != rhs_storage._fieldName9 {return false} + if _storage._fieldName10 != rhs_storage._fieldName10 {return false} + if _storage._fieldName11 != rhs_storage._fieldName11 {return false} + if _storage._fieldName12 != rhs_storage._fieldName12 {return false} + if _storage.__FieldName13 != rhs_storage.__FieldName13 {return false} + if _storage.__FieldName14 != rhs_storage.__FieldName14 {return false} + if _storage._field_Name15 != rhs_storage._field_Name15 {return false} + if _storage._field_Name16 != rhs_storage._field_Name16 {return false} + if _storage._fieldName17__ != rhs_storage._fieldName17__ {return false} + if _storage._fieldName18__ != rhs_storage._fieldName18__ {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + -1: .same(proto: "NEG"), + 0: .same(proto: "FOO"), + 1: .same(proto: "BAR"), + 2: .same(proto: "BAZ"), + ] +} + +extension ProtobufTestMessages_Proto3_TestAllTypesProto3.AliasedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "ALIAS_FOO"), + 1: .same(proto: "ALIAS_BAR"), + 2: .aliased(proto: "ALIAS_BAZ", aliases: ["MOO", "moo", "bAz"]), + ] +} + +extension ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufTestMessages_Proto3_TestAllTypesProto3.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 2: .same(proto: "corecursive"), + ] + + fileprivate class _StorageClass { + var _a: Int32 = 0 + var _corecursive: ProtobufTestMessages_Proto3_TestAllTypesProto3? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _a = source._a + _corecursive = source._corecursive + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._a) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._corecursive) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if _storage._a != 0 { + try visitor.visitSingularInt32Field(value: _storage._a, fieldNumber: 1) + } + try { if let v = _storage._corecursive { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage, rhs: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._a != rhs_storage._a {return false} + if _storage._corecursive != rhs_storage._corecursive {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto3_ForeignMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ForeignMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "c"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.c) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.c != 0 { + try visitor.visitSingularInt32Field(value: self.c, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto3_ForeignMessage, rhs: ProtobufTestMessages_Proto3_ForeignMessage) -> Bool { + if lhs.c != rhs.c {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto3_NullHypothesisProto3: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".NullHypothesisProto3" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto3_NullHypothesisProto3, rhs: ProtobufTestMessages_Proto3_NullHypothesisProto3) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto3_EnumOnlyProto3: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".EnumOnlyProto3" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto3_EnumOnlyProto3, rhs: ProtobufTestMessages_Proto3_EnumOnlyProto3) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto3_EnumOnlyProto3.BoolEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "kFalse"), + 1: .same(proto: "kTrue"), + ] +} diff --git a/Reference/SwiftProtobufTests/unittest.pb.swift b/Reference/SwiftProtobufTests/unittest.pb.swift new file mode 100644 index 000000000..7b1d005b7 --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest.pb.swift @@ -0,0 +1,19217 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// A proto file we will use for unit testing. +// +// LINT: ALLOW_GROUPS, LEGACY_NAMES + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum ProtobufUnittest_ForeignEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foreignFoo // = 4 + case foreignBar // = 5 + case foreignBaz // = 6 + + init() { + self = .foreignFoo + } + + init?(rawValue: Int) { + switch rawValue { + case 4: self = .foreignFoo + case 5: self = .foreignBar + case 6: self = .foreignBaz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .foreignFoo: return 4 + case .foreignBar: return 5 + case .foreignBaz: return 6 + } + } + +} + +enum ProtobufUnittest_TestReservedEnumFields: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + } + } + +} + +/// Test an enum that has multiple values with the same number. +enum ProtobufUnittest_TestEnumWithDupValue: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo1 // = 1 + case bar1 // = 2 + case baz // = 3 + static let foo2 = foo1 + static let bar2 = bar1 + + init() { + self = .foo1 + } + + init?(rawValue: Int) { + switch rawValue { + case 1: self = .foo1 + case 2: self = .bar1 + case 3: self = .baz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .foo1: return 1 + case .bar1: return 2 + case .baz: return 3 + } + } + +} + +/// Test an enum with large, unordered values. +enum ProtobufUnittest_TestSparseEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case sparseA // = 123 + case sparseB // = 62374 + case sparseC // = 12589234 + case sparseD // = -15 + case sparseE // = -53452 + case sparseF // = 0 + case sparseG // = 2 + + init() { + self = .sparseA + } + + init?(rawValue: Int) { + switch rawValue { + case -53452: self = .sparseE + case -15: self = .sparseD + case 0: self = .sparseF + case 2: self = .sparseG + case 123: self = .sparseA + case 62374: self = .sparseB + case 12589234: self = .sparseC + default: return nil + } + } + + var rawValue: Int { + switch self { + case .sparseE: return -53452 + case .sparseD: return -15 + case .sparseF: return 0 + case .sparseG: return 2 + case .sparseA: return 123 + case .sparseB: return 62374 + case .sparseC: return 12589234 + } + } + +} + +enum ProtobufUnittest_VeryLargeEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case enumLabelDefault // = 0 + case enumLabel1 // = 1 + case enumLabel2 // = 2 + case enumLabel3 // = 3 + case enumLabel4 // = 4 + case enumLabel5 // = 5 + case enumLabel6 // = 6 + case enumLabel7 // = 7 + case enumLabel8 // = 8 + case enumLabel9 // = 9 + case enumLabel10 // = 10 + case enumLabel11 // = 11 + case enumLabel12 // = 12 + case enumLabel13 // = 13 + case enumLabel14 // = 14 + case enumLabel15 // = 15 + case enumLabel16 // = 16 + case enumLabel17 // = 17 + case enumLabel18 // = 18 + case enumLabel19 // = 19 + case enumLabel20 // = 20 + case enumLabel21 // = 21 + case enumLabel22 // = 22 + case enumLabel23 // = 23 + case enumLabel24 // = 24 + case enumLabel25 // = 25 + case enumLabel26 // = 26 + case enumLabel27 // = 27 + case enumLabel28 // = 28 + case enumLabel29 // = 29 + case enumLabel30 // = 30 + case enumLabel31 // = 31 + case enumLabel32 // = 32 + case enumLabel33 // = 33 + case enumLabel34 // = 34 + case enumLabel35 // = 35 + case enumLabel36 // = 36 + case enumLabel37 // = 37 + case enumLabel38 // = 38 + case enumLabel39 // = 39 + case enumLabel40 // = 40 + case enumLabel41 // = 41 + case enumLabel42 // = 42 + case enumLabel43 // = 43 + case enumLabel44 // = 44 + case enumLabel45 // = 45 + case enumLabel46 // = 46 + case enumLabel47 // = 47 + case enumLabel48 // = 48 + case enumLabel49 // = 49 + case enumLabel50 // = 50 + case enumLabel51 // = 51 + case enumLabel52 // = 52 + case enumLabel53 // = 53 + case enumLabel54 // = 54 + case enumLabel55 // = 55 + case enumLabel56 // = 56 + case enumLabel57 // = 57 + case enumLabel58 // = 58 + case enumLabel59 // = 59 + case enumLabel60 // = 60 + case enumLabel61 // = 61 + case enumLabel62 // = 62 + case enumLabel63 // = 63 + case enumLabel64 // = 64 + case enumLabel65 // = 65 + case enumLabel66 // = 66 + case enumLabel67 // = 67 + case enumLabel68 // = 68 + case enumLabel69 // = 69 + case enumLabel70 // = 70 + case enumLabel71 // = 71 + case enumLabel72 // = 72 + case enumLabel73 // = 73 + case enumLabel74 // = 74 + case enumLabel75 // = 75 + case enumLabel76 // = 76 + case enumLabel77 // = 77 + case enumLabel78 // = 78 + case enumLabel79 // = 79 + case enumLabel80 // = 80 + case enumLabel81 // = 81 + case enumLabel82 // = 82 + case enumLabel83 // = 83 + case enumLabel84 // = 84 + case enumLabel85 // = 85 + case enumLabel86 // = 86 + case enumLabel87 // = 87 + case enumLabel88 // = 88 + case enumLabel89 // = 89 + case enumLabel90 // = 90 + case enumLabel91 // = 91 + case enumLabel92 // = 92 + case enumLabel93 // = 93 + case enumLabel94 // = 94 + case enumLabel95 // = 95 + case enumLabel96 // = 96 + case enumLabel97 // = 97 + case enumLabel98 // = 98 + case enumLabel99 // = 99 + case enumLabel100 // = 100 + + init() { + self = .enumLabelDefault + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .enumLabelDefault + case 1: self = .enumLabel1 + case 2: self = .enumLabel2 + case 3: self = .enumLabel3 + case 4: self = .enumLabel4 + case 5: self = .enumLabel5 + case 6: self = .enumLabel6 + case 7: self = .enumLabel7 + case 8: self = .enumLabel8 + case 9: self = .enumLabel9 + case 10: self = .enumLabel10 + case 11: self = .enumLabel11 + case 12: self = .enumLabel12 + case 13: self = .enumLabel13 + case 14: self = .enumLabel14 + case 15: self = .enumLabel15 + case 16: self = .enumLabel16 + case 17: self = .enumLabel17 + case 18: self = .enumLabel18 + case 19: self = .enumLabel19 + case 20: self = .enumLabel20 + case 21: self = .enumLabel21 + case 22: self = .enumLabel22 + case 23: self = .enumLabel23 + case 24: self = .enumLabel24 + case 25: self = .enumLabel25 + case 26: self = .enumLabel26 + case 27: self = .enumLabel27 + case 28: self = .enumLabel28 + case 29: self = .enumLabel29 + case 30: self = .enumLabel30 + case 31: self = .enumLabel31 + case 32: self = .enumLabel32 + case 33: self = .enumLabel33 + case 34: self = .enumLabel34 + case 35: self = .enumLabel35 + case 36: self = .enumLabel36 + case 37: self = .enumLabel37 + case 38: self = .enumLabel38 + case 39: self = .enumLabel39 + case 40: self = .enumLabel40 + case 41: self = .enumLabel41 + case 42: self = .enumLabel42 + case 43: self = .enumLabel43 + case 44: self = .enumLabel44 + case 45: self = .enumLabel45 + case 46: self = .enumLabel46 + case 47: self = .enumLabel47 + case 48: self = .enumLabel48 + case 49: self = .enumLabel49 + case 50: self = .enumLabel50 + case 51: self = .enumLabel51 + case 52: self = .enumLabel52 + case 53: self = .enumLabel53 + case 54: self = .enumLabel54 + case 55: self = .enumLabel55 + case 56: self = .enumLabel56 + case 57: self = .enumLabel57 + case 58: self = .enumLabel58 + case 59: self = .enumLabel59 + case 60: self = .enumLabel60 + case 61: self = .enumLabel61 + case 62: self = .enumLabel62 + case 63: self = .enumLabel63 + case 64: self = .enumLabel64 + case 65: self = .enumLabel65 + case 66: self = .enumLabel66 + case 67: self = .enumLabel67 + case 68: self = .enumLabel68 + case 69: self = .enumLabel69 + case 70: self = .enumLabel70 + case 71: self = .enumLabel71 + case 72: self = .enumLabel72 + case 73: self = .enumLabel73 + case 74: self = .enumLabel74 + case 75: self = .enumLabel75 + case 76: self = .enumLabel76 + case 77: self = .enumLabel77 + case 78: self = .enumLabel78 + case 79: self = .enumLabel79 + case 80: self = .enumLabel80 + case 81: self = .enumLabel81 + case 82: self = .enumLabel82 + case 83: self = .enumLabel83 + case 84: self = .enumLabel84 + case 85: self = .enumLabel85 + case 86: self = .enumLabel86 + case 87: self = .enumLabel87 + case 88: self = .enumLabel88 + case 89: self = .enumLabel89 + case 90: self = .enumLabel90 + case 91: self = .enumLabel91 + case 92: self = .enumLabel92 + case 93: self = .enumLabel93 + case 94: self = .enumLabel94 + case 95: self = .enumLabel95 + case 96: self = .enumLabel96 + case 97: self = .enumLabel97 + case 98: self = .enumLabel98 + case 99: self = .enumLabel99 + case 100: self = .enumLabel100 + default: return nil + } + } + + var rawValue: Int { + switch self { + case .enumLabelDefault: return 0 + case .enumLabel1: return 1 + case .enumLabel2: return 2 + case .enumLabel3: return 3 + case .enumLabel4: return 4 + case .enumLabel5: return 5 + case .enumLabel6: return 6 + case .enumLabel7: return 7 + case .enumLabel8: return 8 + case .enumLabel9: return 9 + case .enumLabel10: return 10 + case .enumLabel11: return 11 + case .enumLabel12: return 12 + case .enumLabel13: return 13 + case .enumLabel14: return 14 + case .enumLabel15: return 15 + case .enumLabel16: return 16 + case .enumLabel17: return 17 + case .enumLabel18: return 18 + case .enumLabel19: return 19 + case .enumLabel20: return 20 + case .enumLabel21: return 21 + case .enumLabel22: return 22 + case .enumLabel23: return 23 + case .enumLabel24: return 24 + case .enumLabel25: return 25 + case .enumLabel26: return 26 + case .enumLabel27: return 27 + case .enumLabel28: return 28 + case .enumLabel29: return 29 + case .enumLabel30: return 30 + case .enumLabel31: return 31 + case .enumLabel32: return 32 + case .enumLabel33: return 33 + case .enumLabel34: return 34 + case .enumLabel35: return 35 + case .enumLabel36: return 36 + case .enumLabel37: return 37 + case .enumLabel38: return 38 + case .enumLabel39: return 39 + case .enumLabel40: return 40 + case .enumLabel41: return 41 + case .enumLabel42: return 42 + case .enumLabel43: return 43 + case .enumLabel44: return 44 + case .enumLabel45: return 45 + case .enumLabel46: return 46 + case .enumLabel47: return 47 + case .enumLabel48: return 48 + case .enumLabel49: return 49 + case .enumLabel50: return 50 + case .enumLabel51: return 51 + case .enumLabel52: return 52 + case .enumLabel53: return 53 + case .enumLabel54: return 54 + case .enumLabel55: return 55 + case .enumLabel56: return 56 + case .enumLabel57: return 57 + case .enumLabel58: return 58 + case .enumLabel59: return 59 + case .enumLabel60: return 60 + case .enumLabel61: return 61 + case .enumLabel62: return 62 + case .enumLabel63: return 63 + case .enumLabel64: return 64 + case .enumLabel65: return 65 + case .enumLabel66: return 66 + case .enumLabel67: return 67 + case .enumLabel68: return 68 + case .enumLabel69: return 69 + case .enumLabel70: return 70 + case .enumLabel71: return 71 + case .enumLabel72: return 72 + case .enumLabel73: return 73 + case .enumLabel74: return 74 + case .enumLabel75: return 75 + case .enumLabel76: return 76 + case .enumLabel77: return 77 + case .enumLabel78: return 78 + case .enumLabel79: return 79 + case .enumLabel80: return 80 + case .enumLabel81: return 81 + case .enumLabel82: return 82 + case .enumLabel83: return 83 + case .enumLabel84: return 84 + case .enumLabel85: return 85 + case .enumLabel86: return 86 + case .enumLabel87: return 87 + case .enumLabel88: return 88 + case .enumLabel89: return 89 + case .enumLabel90: return 90 + case .enumLabel91: return 91 + case .enumLabel92: return 92 + case .enumLabel93: return 93 + case .enumLabel94: return 94 + case .enumLabel95: return 95 + case .enumLabel96: return 96 + case .enumLabel97: return 97 + case .enumLabel98: return 98 + case .enumLabel99: return 99 + case .enumLabel100: return 100 + } + } + +} + +/// This proto includes every type of field in both singular and repeated +/// forms. +struct ProtobufUnittest_TestAllTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Singular + var optionalInt32: Int32 { + get {return _storage._optionalInt32 ?? 0} + set {_uniqueStorage()._optionalInt32 = newValue} + } + /// Returns true if `optionalInt32` has been explicitly set. + var hasOptionalInt32: Bool {return _storage._optionalInt32 != nil} + /// Clears the value of `optionalInt32`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt32() {_uniqueStorage()._optionalInt32 = nil} + + var optionalInt64: Int64 { + get {return _storage._optionalInt64 ?? 0} + set {_uniqueStorage()._optionalInt64 = newValue} + } + /// Returns true if `optionalInt64` has been explicitly set. + var hasOptionalInt64: Bool {return _storage._optionalInt64 != nil} + /// Clears the value of `optionalInt64`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt64() {_uniqueStorage()._optionalInt64 = nil} + + var optionalUint32: UInt32 { + get {return _storage._optionalUint32 ?? 0} + set {_uniqueStorage()._optionalUint32 = newValue} + } + /// Returns true if `optionalUint32` has been explicitly set. + var hasOptionalUint32: Bool {return _storage._optionalUint32 != nil} + /// Clears the value of `optionalUint32`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint32() {_uniqueStorage()._optionalUint32 = nil} + + var optionalUint64: UInt64 { + get {return _storage._optionalUint64 ?? 0} + set {_uniqueStorage()._optionalUint64 = newValue} + } + /// Returns true if `optionalUint64` has been explicitly set. + var hasOptionalUint64: Bool {return _storage._optionalUint64 != nil} + /// Clears the value of `optionalUint64`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint64() {_uniqueStorage()._optionalUint64 = nil} + + var optionalSint32: Int32 { + get {return _storage._optionalSint32 ?? 0} + set {_uniqueStorage()._optionalSint32 = newValue} + } + /// Returns true if `optionalSint32` has been explicitly set. + var hasOptionalSint32: Bool {return _storage._optionalSint32 != nil} + /// Clears the value of `optionalSint32`. Subsequent reads from it will return its default value. + mutating func clearOptionalSint32() {_uniqueStorage()._optionalSint32 = nil} + + var optionalSint64: Int64 { + get {return _storage._optionalSint64 ?? 0} + set {_uniqueStorage()._optionalSint64 = newValue} + } + /// Returns true if `optionalSint64` has been explicitly set. + var hasOptionalSint64: Bool {return _storage._optionalSint64 != nil} + /// Clears the value of `optionalSint64`. Subsequent reads from it will return its default value. + mutating func clearOptionalSint64() {_uniqueStorage()._optionalSint64 = nil} + + var optionalFixed32: UInt32 { + get {return _storage._optionalFixed32 ?? 0} + set {_uniqueStorage()._optionalFixed32 = newValue} + } + /// Returns true if `optionalFixed32` has been explicitly set. + var hasOptionalFixed32: Bool {return _storage._optionalFixed32 != nil} + /// Clears the value of `optionalFixed32`. Subsequent reads from it will return its default value. + mutating func clearOptionalFixed32() {_uniqueStorage()._optionalFixed32 = nil} + + var optionalFixed64: UInt64 { + get {return _storage._optionalFixed64 ?? 0} + set {_uniqueStorage()._optionalFixed64 = newValue} + } + /// Returns true if `optionalFixed64` has been explicitly set. + var hasOptionalFixed64: Bool {return _storage._optionalFixed64 != nil} + /// Clears the value of `optionalFixed64`. Subsequent reads from it will return its default value. + mutating func clearOptionalFixed64() {_uniqueStorage()._optionalFixed64 = nil} + + var optionalSfixed32: Int32 { + get {return _storage._optionalSfixed32 ?? 0} + set {_uniqueStorage()._optionalSfixed32 = newValue} + } + /// Returns true if `optionalSfixed32` has been explicitly set. + var hasOptionalSfixed32: Bool {return _storage._optionalSfixed32 != nil} + /// Clears the value of `optionalSfixed32`. Subsequent reads from it will return its default value. + mutating func clearOptionalSfixed32() {_uniqueStorage()._optionalSfixed32 = nil} + + var optionalSfixed64: Int64 { + get {return _storage._optionalSfixed64 ?? 0} + set {_uniqueStorage()._optionalSfixed64 = newValue} + } + /// Returns true if `optionalSfixed64` has been explicitly set. + var hasOptionalSfixed64: Bool {return _storage._optionalSfixed64 != nil} + /// Clears the value of `optionalSfixed64`. Subsequent reads from it will return its default value. + mutating func clearOptionalSfixed64() {_uniqueStorage()._optionalSfixed64 = nil} + + var optionalFloat: Float { + get {return _storage._optionalFloat ?? 0} + set {_uniqueStorage()._optionalFloat = newValue} + } + /// Returns true if `optionalFloat` has been explicitly set. + var hasOptionalFloat: Bool {return _storage._optionalFloat != nil} + /// Clears the value of `optionalFloat`. Subsequent reads from it will return its default value. + mutating func clearOptionalFloat() {_uniqueStorage()._optionalFloat = nil} + + var optionalDouble: Double { + get {return _storage._optionalDouble ?? 0} + set {_uniqueStorage()._optionalDouble = newValue} + } + /// Returns true if `optionalDouble` has been explicitly set. + var hasOptionalDouble: Bool {return _storage._optionalDouble != nil} + /// Clears the value of `optionalDouble`. Subsequent reads from it will return its default value. + mutating func clearOptionalDouble() {_uniqueStorage()._optionalDouble = nil} + + var optionalBool: Bool { + get {return _storage._optionalBool ?? false} + set {_uniqueStorage()._optionalBool = newValue} + } + /// Returns true if `optionalBool` has been explicitly set. + var hasOptionalBool: Bool {return _storage._optionalBool != nil} + /// Clears the value of `optionalBool`. Subsequent reads from it will return its default value. + mutating func clearOptionalBool() {_uniqueStorage()._optionalBool = nil} + + var optionalString: String { + get {return _storage._optionalString ?? String()} + set {_uniqueStorage()._optionalString = newValue} + } + /// Returns true if `optionalString` has been explicitly set. + var hasOptionalString: Bool {return _storage._optionalString != nil} + /// Clears the value of `optionalString`. Subsequent reads from it will return its default value. + mutating func clearOptionalString() {_uniqueStorage()._optionalString = nil} + + var optionalBytes: Data { + get {return _storage._optionalBytes ?? Data()} + set {_uniqueStorage()._optionalBytes = newValue} + } + /// Returns true if `optionalBytes` has been explicitly set. + var hasOptionalBytes: Bool {return _storage._optionalBytes != nil} + /// Clears the value of `optionalBytes`. Subsequent reads from it will return its default value. + mutating func clearOptionalBytes() {_uniqueStorage()._optionalBytes = nil} + + var optionalGroup: ProtobufUnittest_TestAllTypes.OptionalGroup { + get {return _storage._optionalGroup ?? ProtobufUnittest_TestAllTypes.OptionalGroup()} + set {_uniqueStorage()._optionalGroup = newValue} + } + /// Returns true if `optionalGroup` has been explicitly set. + var hasOptionalGroup: Bool {return _storage._optionalGroup != nil} + /// Clears the value of `optionalGroup`. Subsequent reads from it will return its default value. + mutating func clearOptionalGroup() {_uniqueStorage()._optionalGroup = nil} + + var optionalNestedMessage: ProtobufUnittest_TestAllTypes.NestedMessage { + get {return _storage._optionalNestedMessage ?? ProtobufUnittest_TestAllTypes.NestedMessage()} + set {_uniqueStorage()._optionalNestedMessage = newValue} + } + /// Returns true if `optionalNestedMessage` has been explicitly set. + var hasOptionalNestedMessage: Bool {return _storage._optionalNestedMessage != nil} + /// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedMessage() {_uniqueStorage()._optionalNestedMessage = nil} + + var optionalForeignMessage: ProtobufUnittest_ForeignMessage { + get {return _storage._optionalForeignMessage ?? ProtobufUnittest_ForeignMessage()} + set {_uniqueStorage()._optionalForeignMessage = newValue} + } + /// Returns true if `optionalForeignMessage` has been explicitly set. + var hasOptionalForeignMessage: Bool {return _storage._optionalForeignMessage != nil} + /// Clears the value of `optionalForeignMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalForeignMessage() {_uniqueStorage()._optionalForeignMessage = nil} + + var optionalImportMessage: ProtobufUnittestImport_ImportMessage { + get {return _storage._optionalImportMessage ?? ProtobufUnittestImport_ImportMessage()} + set {_uniqueStorage()._optionalImportMessage = newValue} + } + /// Returns true if `optionalImportMessage` has been explicitly set. + var hasOptionalImportMessage: Bool {return _storage._optionalImportMessage != nil} + /// Clears the value of `optionalImportMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalImportMessage() {_uniqueStorage()._optionalImportMessage = nil} + + var optionalNestedEnum: ProtobufUnittest_TestAllTypes.NestedEnum { + get {return _storage._optionalNestedEnum ?? .foo} + set {_uniqueStorage()._optionalNestedEnum = newValue} + } + /// Returns true if `optionalNestedEnum` has been explicitly set. + var hasOptionalNestedEnum: Bool {return _storage._optionalNestedEnum != nil} + /// Clears the value of `optionalNestedEnum`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedEnum() {_uniqueStorage()._optionalNestedEnum = nil} + + var optionalForeignEnum: ProtobufUnittest_ForeignEnum { + get {return _storage._optionalForeignEnum ?? .foreignFoo} + set {_uniqueStorage()._optionalForeignEnum = newValue} + } + /// Returns true if `optionalForeignEnum` has been explicitly set. + var hasOptionalForeignEnum: Bool {return _storage._optionalForeignEnum != nil} + /// Clears the value of `optionalForeignEnum`. Subsequent reads from it will return its default value. + mutating func clearOptionalForeignEnum() {_uniqueStorage()._optionalForeignEnum = nil} + + var optionalImportEnum: ProtobufUnittestImport_ImportEnum { + get {return _storage._optionalImportEnum ?? .importFoo} + set {_uniqueStorage()._optionalImportEnum = newValue} + } + /// Returns true if `optionalImportEnum` has been explicitly set. + var hasOptionalImportEnum: Bool {return _storage._optionalImportEnum != nil} + /// Clears the value of `optionalImportEnum`. Subsequent reads from it will return its default value. + mutating func clearOptionalImportEnum() {_uniqueStorage()._optionalImportEnum = nil} + + var optionalStringPiece: String { + get {return _storage._optionalStringPiece ?? String()} + set {_uniqueStorage()._optionalStringPiece = newValue} + } + /// Returns true if `optionalStringPiece` has been explicitly set. + var hasOptionalStringPiece: Bool {return _storage._optionalStringPiece != nil} + /// Clears the value of `optionalStringPiece`. Subsequent reads from it will return its default value. + mutating func clearOptionalStringPiece() {_uniqueStorage()._optionalStringPiece = nil} + + var optionalCord: String { + get {return _storage._optionalCord ?? String()} + set {_uniqueStorage()._optionalCord = newValue} + } + /// Returns true if `optionalCord` has been explicitly set. + var hasOptionalCord: Bool {return _storage._optionalCord != nil} + /// Clears the value of `optionalCord`. Subsequent reads from it will return its default value. + mutating func clearOptionalCord() {_uniqueStorage()._optionalCord = nil} + + /// Defined in unittest_import_public.proto + var optionalPublicImportMessage: ProtobufUnittestImport_PublicImportMessage { + get {return _storage._optionalPublicImportMessage ?? ProtobufUnittestImport_PublicImportMessage()} + set {_uniqueStorage()._optionalPublicImportMessage = newValue} + } + /// Returns true if `optionalPublicImportMessage` has been explicitly set. + var hasOptionalPublicImportMessage: Bool {return _storage._optionalPublicImportMessage != nil} + /// Clears the value of `optionalPublicImportMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalPublicImportMessage() {_uniqueStorage()._optionalPublicImportMessage = nil} + + var optionalLazyMessage: ProtobufUnittest_TestAllTypes.NestedMessage { + get {return _storage._optionalLazyMessage ?? ProtobufUnittest_TestAllTypes.NestedMessage()} + set {_uniqueStorage()._optionalLazyMessage = newValue} + } + /// Returns true if `optionalLazyMessage` has been explicitly set. + var hasOptionalLazyMessage: Bool {return _storage._optionalLazyMessage != nil} + /// Clears the value of `optionalLazyMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalLazyMessage() {_uniqueStorage()._optionalLazyMessage = nil} + + var optionalUnverifiedLazyMessage: ProtobufUnittest_TestAllTypes.NestedMessage { + get {return _storage._optionalUnverifiedLazyMessage ?? ProtobufUnittest_TestAllTypes.NestedMessage()} + set {_uniqueStorage()._optionalUnverifiedLazyMessage = newValue} + } + /// Returns true if `optionalUnverifiedLazyMessage` has been explicitly set. + var hasOptionalUnverifiedLazyMessage: Bool {return _storage._optionalUnverifiedLazyMessage != nil} + /// Clears the value of `optionalUnverifiedLazyMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalUnverifiedLazyMessage() {_uniqueStorage()._optionalUnverifiedLazyMessage = nil} + + /// Repeated + var repeatedInt32: [Int32] { + get {return _storage._repeatedInt32} + set {_uniqueStorage()._repeatedInt32 = newValue} + } + + var repeatedInt64: [Int64] { + get {return _storage._repeatedInt64} + set {_uniqueStorage()._repeatedInt64 = newValue} + } + + var repeatedUint32: [UInt32] { + get {return _storage._repeatedUint32} + set {_uniqueStorage()._repeatedUint32 = newValue} + } + + var repeatedUint64: [UInt64] { + get {return _storage._repeatedUint64} + set {_uniqueStorage()._repeatedUint64 = newValue} + } + + var repeatedSint32: [Int32] { + get {return _storage._repeatedSint32} + set {_uniqueStorage()._repeatedSint32 = newValue} + } + + var repeatedSint64: [Int64] { + get {return _storage._repeatedSint64} + set {_uniqueStorage()._repeatedSint64 = newValue} + } + + var repeatedFixed32: [UInt32] { + get {return _storage._repeatedFixed32} + set {_uniqueStorage()._repeatedFixed32 = newValue} + } + + var repeatedFixed64: [UInt64] { + get {return _storage._repeatedFixed64} + set {_uniqueStorage()._repeatedFixed64 = newValue} + } + + var repeatedSfixed32: [Int32] { + get {return _storage._repeatedSfixed32} + set {_uniqueStorage()._repeatedSfixed32 = newValue} + } + + var repeatedSfixed64: [Int64] { + get {return _storage._repeatedSfixed64} + set {_uniqueStorage()._repeatedSfixed64 = newValue} + } + + var repeatedFloat: [Float] { + get {return _storage._repeatedFloat} + set {_uniqueStorage()._repeatedFloat = newValue} + } + + var repeatedDouble: [Double] { + get {return _storage._repeatedDouble} + set {_uniqueStorage()._repeatedDouble = newValue} + } + + var repeatedBool: [Bool] { + get {return _storage._repeatedBool} + set {_uniqueStorage()._repeatedBool = newValue} + } + + var repeatedString: [String] { + get {return _storage._repeatedString} + set {_uniqueStorage()._repeatedString = newValue} + } + + var repeatedBytes: [Data] { + get {return _storage._repeatedBytes} + set {_uniqueStorage()._repeatedBytes = newValue} + } + + var repeatedGroup: [ProtobufUnittest_TestAllTypes.RepeatedGroup] { + get {return _storage._repeatedGroup} + set {_uniqueStorage()._repeatedGroup = newValue} + } + + var repeatedNestedMessage: [ProtobufUnittest_TestAllTypes.NestedMessage] { + get {return _storage._repeatedNestedMessage} + set {_uniqueStorage()._repeatedNestedMessage = newValue} + } + + var repeatedForeignMessage: [ProtobufUnittest_ForeignMessage] { + get {return _storage._repeatedForeignMessage} + set {_uniqueStorage()._repeatedForeignMessage = newValue} + } + + var repeatedImportMessage: [ProtobufUnittestImport_ImportMessage] { + get {return _storage._repeatedImportMessage} + set {_uniqueStorage()._repeatedImportMessage = newValue} + } + + var repeatedNestedEnum: [ProtobufUnittest_TestAllTypes.NestedEnum] { + get {return _storage._repeatedNestedEnum} + set {_uniqueStorage()._repeatedNestedEnum = newValue} + } + + var repeatedForeignEnum: [ProtobufUnittest_ForeignEnum] { + get {return _storage._repeatedForeignEnum} + set {_uniqueStorage()._repeatedForeignEnum = newValue} + } + + var repeatedImportEnum: [ProtobufUnittestImport_ImportEnum] { + get {return _storage._repeatedImportEnum} + set {_uniqueStorage()._repeatedImportEnum = newValue} + } + + var repeatedStringPiece: [String] { + get {return _storage._repeatedStringPiece} + set {_uniqueStorage()._repeatedStringPiece = newValue} + } + + var repeatedCord: [String] { + get {return _storage._repeatedCord} + set {_uniqueStorage()._repeatedCord = newValue} + } + + var repeatedLazyMessage: [ProtobufUnittest_TestAllTypes.NestedMessage] { + get {return _storage._repeatedLazyMessage} + set {_uniqueStorage()._repeatedLazyMessage = newValue} + } + + /// Singular with defaults + var defaultInt32: Int32 { + get {return _storage._defaultInt32 ?? 41} + set {_uniqueStorage()._defaultInt32 = newValue} + } + /// Returns true if `defaultInt32` has been explicitly set. + var hasDefaultInt32: Bool {return _storage._defaultInt32 != nil} + /// Clears the value of `defaultInt32`. Subsequent reads from it will return its default value. + mutating func clearDefaultInt32() {_uniqueStorage()._defaultInt32 = nil} + + var defaultInt64: Int64 { + get {return _storage._defaultInt64 ?? 42} + set {_uniqueStorage()._defaultInt64 = newValue} + } + /// Returns true if `defaultInt64` has been explicitly set. + var hasDefaultInt64: Bool {return _storage._defaultInt64 != nil} + /// Clears the value of `defaultInt64`. Subsequent reads from it will return its default value. + mutating func clearDefaultInt64() {_uniqueStorage()._defaultInt64 = nil} + + var defaultUint32: UInt32 { + get {return _storage._defaultUint32 ?? 43} + set {_uniqueStorage()._defaultUint32 = newValue} + } + /// Returns true if `defaultUint32` has been explicitly set. + var hasDefaultUint32: Bool {return _storage._defaultUint32 != nil} + /// Clears the value of `defaultUint32`. Subsequent reads from it will return its default value. + mutating func clearDefaultUint32() {_uniqueStorage()._defaultUint32 = nil} + + var defaultUint64: UInt64 { + get {return _storage._defaultUint64 ?? 44} + set {_uniqueStorage()._defaultUint64 = newValue} + } + /// Returns true if `defaultUint64` has been explicitly set. + var hasDefaultUint64: Bool {return _storage._defaultUint64 != nil} + /// Clears the value of `defaultUint64`. Subsequent reads from it will return its default value. + mutating func clearDefaultUint64() {_uniqueStorage()._defaultUint64 = nil} + + var defaultSint32: Int32 { + get {return _storage._defaultSint32 ?? -45} + set {_uniqueStorage()._defaultSint32 = newValue} + } + /// Returns true if `defaultSint32` has been explicitly set. + var hasDefaultSint32: Bool {return _storage._defaultSint32 != nil} + /// Clears the value of `defaultSint32`. Subsequent reads from it will return its default value. + mutating func clearDefaultSint32() {_uniqueStorage()._defaultSint32 = nil} + + var defaultSint64: Int64 { + get {return _storage._defaultSint64 ?? 46} + set {_uniqueStorage()._defaultSint64 = newValue} + } + /// Returns true if `defaultSint64` has been explicitly set. + var hasDefaultSint64: Bool {return _storage._defaultSint64 != nil} + /// Clears the value of `defaultSint64`. Subsequent reads from it will return its default value. + mutating func clearDefaultSint64() {_uniqueStorage()._defaultSint64 = nil} + + var defaultFixed32: UInt32 { + get {return _storage._defaultFixed32 ?? 47} + set {_uniqueStorage()._defaultFixed32 = newValue} + } + /// Returns true if `defaultFixed32` has been explicitly set. + var hasDefaultFixed32: Bool {return _storage._defaultFixed32 != nil} + /// Clears the value of `defaultFixed32`. Subsequent reads from it will return its default value. + mutating func clearDefaultFixed32() {_uniqueStorage()._defaultFixed32 = nil} + + var defaultFixed64: UInt64 { + get {return _storage._defaultFixed64 ?? 48} + set {_uniqueStorage()._defaultFixed64 = newValue} + } + /// Returns true if `defaultFixed64` has been explicitly set. + var hasDefaultFixed64: Bool {return _storage._defaultFixed64 != nil} + /// Clears the value of `defaultFixed64`. Subsequent reads from it will return its default value. + mutating func clearDefaultFixed64() {_uniqueStorage()._defaultFixed64 = nil} + + var defaultSfixed32: Int32 { + get {return _storage._defaultSfixed32 ?? 49} + set {_uniqueStorage()._defaultSfixed32 = newValue} + } + /// Returns true if `defaultSfixed32` has been explicitly set. + var hasDefaultSfixed32: Bool {return _storage._defaultSfixed32 != nil} + /// Clears the value of `defaultSfixed32`. Subsequent reads from it will return its default value. + mutating func clearDefaultSfixed32() {_uniqueStorage()._defaultSfixed32 = nil} + + var defaultSfixed64: Int64 { + get {return _storage._defaultSfixed64 ?? -50} + set {_uniqueStorage()._defaultSfixed64 = newValue} + } + /// Returns true if `defaultSfixed64` has been explicitly set. + var hasDefaultSfixed64: Bool {return _storage._defaultSfixed64 != nil} + /// Clears the value of `defaultSfixed64`. Subsequent reads from it will return its default value. + mutating func clearDefaultSfixed64() {_uniqueStorage()._defaultSfixed64 = nil} + + var defaultFloat: Float { + get {return _storage._defaultFloat ?? 51.5} + set {_uniqueStorage()._defaultFloat = newValue} + } + /// Returns true if `defaultFloat` has been explicitly set. + var hasDefaultFloat: Bool {return _storage._defaultFloat != nil} + /// Clears the value of `defaultFloat`. Subsequent reads from it will return its default value. + mutating func clearDefaultFloat() {_uniqueStorage()._defaultFloat = nil} + + var defaultDouble: Double { + get {return _storage._defaultDouble ?? 52000} + set {_uniqueStorage()._defaultDouble = newValue} + } + /// Returns true if `defaultDouble` has been explicitly set. + var hasDefaultDouble: Bool {return _storage._defaultDouble != nil} + /// Clears the value of `defaultDouble`. Subsequent reads from it will return its default value. + mutating func clearDefaultDouble() {_uniqueStorage()._defaultDouble = nil} + + var defaultBool: Bool { + get {return _storage._defaultBool ?? true} + set {_uniqueStorage()._defaultBool = newValue} + } + /// Returns true if `defaultBool` has been explicitly set. + var hasDefaultBool: Bool {return _storage._defaultBool != nil} + /// Clears the value of `defaultBool`. Subsequent reads from it will return its default value. + mutating func clearDefaultBool() {_uniqueStorage()._defaultBool = nil} + + var defaultString: String { + get {return _storage._defaultString ?? "hello"} + set {_uniqueStorage()._defaultString = newValue} + } + /// Returns true if `defaultString` has been explicitly set. + var hasDefaultString: Bool {return _storage._defaultString != nil} + /// Clears the value of `defaultString`. Subsequent reads from it will return its default value. + mutating func clearDefaultString() {_uniqueStorage()._defaultString = nil} + + var defaultBytes: Data { + get {return _storage._defaultBytes ?? Data([119, 111, 114, 108, 100])} + set {_uniqueStorage()._defaultBytes = newValue} + } + /// Returns true if `defaultBytes` has been explicitly set. + var hasDefaultBytes: Bool {return _storage._defaultBytes != nil} + /// Clears the value of `defaultBytes`. Subsequent reads from it will return its default value. + mutating func clearDefaultBytes() {_uniqueStorage()._defaultBytes = nil} + + var defaultNestedEnum: ProtobufUnittest_TestAllTypes.NestedEnum { + get {return _storage._defaultNestedEnum ?? .bar} + set {_uniqueStorage()._defaultNestedEnum = newValue} + } + /// Returns true if `defaultNestedEnum` has been explicitly set. + var hasDefaultNestedEnum: Bool {return _storage._defaultNestedEnum != nil} + /// Clears the value of `defaultNestedEnum`. Subsequent reads from it will return its default value. + mutating func clearDefaultNestedEnum() {_uniqueStorage()._defaultNestedEnum = nil} + + var defaultForeignEnum: ProtobufUnittest_ForeignEnum { + get {return _storage._defaultForeignEnum ?? .foreignBar} + set {_uniqueStorage()._defaultForeignEnum = newValue} + } + /// Returns true if `defaultForeignEnum` has been explicitly set. + var hasDefaultForeignEnum: Bool {return _storage._defaultForeignEnum != nil} + /// Clears the value of `defaultForeignEnum`. Subsequent reads from it will return its default value. + mutating func clearDefaultForeignEnum() {_uniqueStorage()._defaultForeignEnum = nil} + + var defaultImportEnum: ProtobufUnittestImport_ImportEnum { + get {return _storage._defaultImportEnum ?? .importBar} + set {_uniqueStorage()._defaultImportEnum = newValue} + } + /// Returns true if `defaultImportEnum` has been explicitly set. + var hasDefaultImportEnum: Bool {return _storage._defaultImportEnum != nil} + /// Clears the value of `defaultImportEnum`. Subsequent reads from it will return its default value. + mutating func clearDefaultImportEnum() {_uniqueStorage()._defaultImportEnum = nil} + + var defaultStringPiece: String { + get {return _storage._defaultStringPiece ?? "abc"} + set {_uniqueStorage()._defaultStringPiece = newValue} + } + /// Returns true if `defaultStringPiece` has been explicitly set. + var hasDefaultStringPiece: Bool {return _storage._defaultStringPiece != nil} + /// Clears the value of `defaultStringPiece`. Subsequent reads from it will return its default value. + mutating func clearDefaultStringPiece() {_uniqueStorage()._defaultStringPiece = nil} + + var defaultCord: String { + get {return _storage._defaultCord ?? "123"} + set {_uniqueStorage()._defaultCord = newValue} + } + /// Returns true if `defaultCord` has been explicitly set. + var hasDefaultCord: Bool {return _storage._defaultCord != nil} + /// Clears the value of `defaultCord`. Subsequent reads from it will return its default value. + mutating func clearDefaultCord() {_uniqueStorage()._defaultCord = nil} + + /// For oneof test + var oneofField: OneOf_OneofField? { + get {return _storage._oneofField} + set {_uniqueStorage()._oneofField = newValue} + } + + var oneofUint32: UInt32 { + get { + if case .oneofUint32(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofUint32(newValue)} + } + + var oneofNestedMessage: ProtobufUnittest_TestAllTypes.NestedMessage { + get { + if case .oneofNestedMessage(let v)? = _storage._oneofField {return v} + return ProtobufUnittest_TestAllTypes.NestedMessage() + } + set {_uniqueStorage()._oneofField = .oneofNestedMessage(newValue)} + } + + var oneofString: String { + get { + if case .oneofString(let v)? = _storage._oneofField {return v} + return String() + } + set {_uniqueStorage()._oneofField = .oneofString(newValue)} + } + + var oneofBytes: Data { + get { + if case .oneofBytes(let v)? = _storage._oneofField {return v} + return Data() + } + set {_uniqueStorage()._oneofField = .oneofBytes(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + /// For oneof test + enum OneOf_OneofField: Equatable { + case oneofUint32(UInt32) + case oneofNestedMessage(ProtobufUnittest_TestAllTypes.NestedMessage) + case oneofString(String) + case oneofBytes(Data) + + } + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 1 + case bar // = 2 + case baz // = 3 + + /// Intentionally negative. + case neg // = -1 + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case -1: self = .neg + case 1: self = .foo + case 2: self = .bar + case 3: self = .baz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .neg: return -1 + case .foo: return 1 + case .bar: return 2 + case .baz: return 3 + } + } + + } + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The field name "b" fails to compile in proto1 because it conflicts with + /// a local variable named "b" in one of the generated methods. Doh. + /// This file needs to compile in proto1 to test backwards-compatibility. + var bb: Int32 { + get {return _bb ?? 0} + set {_bb = newValue} + } + /// Returns true if `bb` has been explicitly set. + var hasBb: Bool {return self._bb != nil} + /// Clears the value of `bb`. Subsequent reads from it will return its default value. + mutating func clearBb() {self._bb = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _bb: Int32? = nil + } + + struct OptionalGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + } + + struct RepeatedGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +/// This proto includes a recursively nested message. +struct ProtobufUnittest_NestedTestAllTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var child: ProtobufUnittest_NestedTestAllTypes { + get {return _storage._child ?? ProtobufUnittest_NestedTestAllTypes()} + set {_uniqueStorage()._child = newValue} + } + /// Returns true if `child` has been explicitly set. + var hasChild: Bool {return _storage._child != nil} + /// Clears the value of `child`. Subsequent reads from it will return its default value. + mutating func clearChild() {_uniqueStorage()._child = nil} + + var payload: ProtobufUnittest_TestAllTypes { + get {return _storage._payload ?? ProtobufUnittest_TestAllTypes()} + set {_uniqueStorage()._payload = newValue} + } + /// Returns true if `payload` has been explicitly set. + var hasPayload: Bool {return _storage._payload != nil} + /// Clears the value of `payload`. Subsequent reads from it will return its default value. + mutating func clearPayload() {_uniqueStorage()._payload = nil} + + var repeatedChild: [ProtobufUnittest_NestedTestAllTypes] { + get {return _storage._repeatedChild} + set {_uniqueStorage()._repeatedChild = newValue} + } + + var lazyChild: ProtobufUnittest_NestedTestAllTypes { + get {return _storage._lazyChild ?? ProtobufUnittest_NestedTestAllTypes()} + set {_uniqueStorage()._lazyChild = newValue} + } + /// Returns true if `lazyChild` has been explicitly set. + var hasLazyChild: Bool {return _storage._lazyChild != nil} + /// Clears the value of `lazyChild`. Subsequent reads from it will return its default value. + mutating func clearLazyChild() {_uniqueStorage()._lazyChild = nil} + + var eagerChild: ProtobufUnittest_TestAllTypes { + get {return _storage._eagerChild ?? ProtobufUnittest_TestAllTypes()} + set {_uniqueStorage()._eagerChild = newValue} + } + /// Returns true if `eagerChild` has been explicitly set. + var hasEagerChild: Bool {return _storage._eagerChild != nil} + /// Clears the value of `eagerChild`. Subsequent reads from it will return its default value. + mutating func clearEagerChild() {_uniqueStorage()._eagerChild = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufUnittest_TestDeprecatedFields { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var deprecatedInt32: Int32 { + get {return _storage._deprecatedInt32 ?? 0} + set {_uniqueStorage()._deprecatedInt32 = newValue} + } + /// Returns true if `deprecatedInt32` has been explicitly set. + var hasDeprecatedInt32: Bool {return _storage._deprecatedInt32 != nil} + /// Clears the value of `deprecatedInt32`. Subsequent reads from it will return its default value. + mutating func clearDeprecatedInt32() {_uniqueStorage()._deprecatedInt32 = nil} + + var deprecatedRepeatedString: [String] { + get {return _storage._deprecatedRepeatedString} + set {_uniqueStorage()._deprecatedRepeatedString = newValue} + } + + var deprecatedMessage: ProtobufUnittest_TestAllTypes.NestedMessage { + get {return _storage._deprecatedMessage ?? ProtobufUnittest_TestAllTypes.NestedMessage()} + set {_uniqueStorage()._deprecatedMessage = newValue} + } + /// Returns true if `deprecatedMessage` has been explicitly set. + var hasDeprecatedMessage: Bool {return _storage._deprecatedMessage != nil} + /// Clears the value of `deprecatedMessage`. Subsequent reads from it will return its default value. + mutating func clearDeprecatedMessage() {_uniqueStorage()._deprecatedMessage = nil} + + var oneofFields: OneOf_OneofFields? { + get {return _storage._oneofFields} + set {_uniqueStorage()._oneofFields = newValue} + } + + var deprecatedInt32InOneof: Int32 { + get { + if case .deprecatedInt32InOneof(let v)? = _storage._oneofFields {return v} + return 0 + } + set {_uniqueStorage()._oneofFields = .deprecatedInt32InOneof(newValue)} + } + + var nested: ProtobufUnittest_TestDeprecatedFields { + get {return _storage._nested ?? ProtobufUnittest_TestDeprecatedFields()} + set {_uniqueStorage()._nested = newValue} + } + /// Returns true if `nested` has been explicitly set. + var hasNested: Bool {return _storage._nested != nil} + /// Clears the value of `nested`. Subsequent reads from it will return its default value. + mutating func clearNested() {_uniqueStorage()._nested = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_OneofFields: Equatable { + case deprecatedInt32InOneof(Int32) + + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufUnittest_TestDeprecatedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Define these after TestAllTypes to make sure the compiler can handle +/// that. +struct ProtobufUnittest_ForeignMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var c: Int32 { + get {return _c ?? 0} + set {_c = newValue} + } + /// Returns true if `c` has been explicitly set. + var hasC: Bool {return self._c != nil} + /// Clears the value of `c`. Subsequent reads from it will return its default value. + mutating func clearC() {self._c = nil} + + var d: Int32 { + get {return _d ?? 0} + set {_d = newValue} + } + /// Returns true if `d` has been explicitly set. + var hasD: Bool {return self._d != nil} + /// Clears the value of `d`. Subsequent reads from it will return its default value. + mutating func clearD() {self._d = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _c: Int32? = nil + fileprivate var _d: Int32? = nil +} + +struct ProtobufUnittest_TestReservedFields { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_TestAllExtensions: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() +} + +struct ProtobufUnittest_OptionalGroup_extension { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil +} + +struct ProtobufUnittest_RepeatedGroup_extension { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil +} + +struct ProtobufUnittest_TestMixedFieldsAndExtensions: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var b: [UInt32] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _a: Int32? = nil +} + +struct ProtobufUnittest_TestGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalGroup: ProtobufUnittest_TestGroup.OptionalGroup { + get {return _optionalGroup ?? ProtobufUnittest_TestGroup.OptionalGroup()} + set {_optionalGroup = newValue} + } + /// Returns true if `optionalGroup` has been explicitly set. + var hasOptionalGroup: Bool {return self._optionalGroup != nil} + /// Clears the value of `optionalGroup`. Subsequent reads from it will return its default value. + mutating func clearOptionalGroup() {self._optionalGroup = nil} + + var optionalForeignEnum: ProtobufUnittest_ForeignEnum { + get {return _optionalForeignEnum ?? .foreignFoo} + set {_optionalForeignEnum = newValue} + } + /// Returns true if `optionalForeignEnum` has been explicitly set. + var hasOptionalForeignEnum: Bool {return self._optionalForeignEnum != nil} + /// Clears the value of `optionalForeignEnum`. Subsequent reads from it will return its default value. + mutating func clearOptionalForeignEnum() {self._optionalForeignEnum = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct OptionalGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + /// fast table size must be at least 16, for this + var zz: Int32 { + get {return _zz ?? 0} + set {_zz = newValue} + } + /// Returns true if `zz` has been explicitly set. + var hasZz: Bool {return self._zz != nil} + /// Clears the value of `zz`. Subsequent reads from it will return its default value. + mutating func clearZz() {self._zz = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + fileprivate var _zz: Int32? = nil + } + + init() {} + + fileprivate var _optionalGroup: ProtobufUnittest_TestGroup.OptionalGroup? = nil + fileprivate var _optionalForeignEnum: ProtobufUnittest_ForeignEnum? = nil +} + +struct ProtobufUnittest_TestGroupExtension: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() +} + +struct ProtobufUnittest_TestNestedExtension { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct OptionalGroup_extension { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + } + + init() {} +} + +struct ProtobufUnittest_TestChildExtension { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: String { + get {return _a ?? String()} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var b: String { + get {return _b ?? String()} + set {_b = newValue} + } + /// Returns true if `b` has been explicitly set. + var hasB: Bool {return self._b != nil} + /// Clears the value of `b`. Subsequent reads from it will return its default value. + mutating func clearB() {self._b = nil} + + var optionalExtension: ProtobufUnittest_TestAllExtensions { + get {return _optionalExtension ?? ProtobufUnittest_TestAllExtensions()} + set {_optionalExtension = newValue} + } + /// Returns true if `optionalExtension` has been explicitly set. + var hasOptionalExtension: Bool {return self._optionalExtension != nil} + /// Clears the value of `optionalExtension`. Subsequent reads from it will return its default value. + mutating func clearOptionalExtension() {self._optionalExtension = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: String? = nil + fileprivate var _b: String? = nil + fileprivate var _optionalExtension: ProtobufUnittest_TestAllExtensions? = nil +} + +/// Emulates wireformat data of TestChildExtension with dynamic extension +/// (DynamicExtension). +struct ProtobufUnittest_TestChildExtensionData { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: String { + get {return _a ?? String()} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var b: String { + get {return _b ?? String()} + set {_b = newValue} + } + /// Returns true if `b` has been explicitly set. + var hasB: Bool {return self._b != nil} + /// Clears the value of `b`. Subsequent reads from it will return its default value. + mutating func clearB() {self._b = nil} + + var optionalExtension: ProtobufUnittest_TestChildExtensionData.NestedTestAllExtensionsData { + get {return _optionalExtension ?? ProtobufUnittest_TestChildExtensionData.NestedTestAllExtensionsData()} + set {_optionalExtension = newValue} + } + /// Returns true if `optionalExtension` has been explicitly set. + var hasOptionalExtension: Bool {return self._optionalExtension != nil} + /// Clears the value of `optionalExtension`. Subsequent reads from it will return its default value. + mutating func clearOptionalExtension() {self._optionalExtension = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct NestedTestAllExtensionsData { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var dynamic: ProtobufUnittest_TestChildExtensionData.NestedTestAllExtensionsData.NestedDynamicExtensions { + get {return _dynamic ?? ProtobufUnittest_TestChildExtensionData.NestedTestAllExtensionsData.NestedDynamicExtensions()} + set {_dynamic = newValue} + } + /// Returns true if `dynamic` has been explicitly set. + var hasDynamic: Bool {return self._dynamic != nil} + /// Clears the value of `dynamic`. Subsequent reads from it will return its default value. + mutating func clearDynamic() {self._dynamic = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct NestedDynamicExtensions { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var b: Int32 { + get {return _b ?? 0} + set {_b = newValue} + } + /// Returns true if `b` has been explicitly set. + var hasB: Bool {return self._b != nil} + /// Clears the value of `b`. Subsequent reads from it will return its default value. + mutating func clearB() {self._b = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + fileprivate var _b: Int32? = nil + } + + init() {} + + fileprivate var _dynamic: ProtobufUnittest_TestChildExtensionData.NestedTestAllExtensionsData.NestedDynamicExtensions? = nil + } + + init() {} + + fileprivate var _a: String? = nil + fileprivate var _b: String? = nil + fileprivate var _optionalExtension: ProtobufUnittest_TestChildExtensionData.NestedTestAllExtensionsData? = nil +} + +struct ProtobufUnittest_TestNestedChildExtension { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var child: ProtobufUnittest_TestChildExtension { + get {return _child ?? ProtobufUnittest_TestChildExtension()} + set {_child = newValue} + } + /// Returns true if `child` has been explicitly set. + var hasChild: Bool {return self._child != nil} + /// Clears the value of `child`. Subsequent reads from it will return its default value. + mutating func clearChild() {self._child = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + fileprivate var _child: ProtobufUnittest_TestChildExtension? = nil +} + +/// Emulates wireformat data of TestNestedChildExtension with dynamic extension +/// (DynamicExtension). +struct ProtobufUnittest_TestNestedChildExtensionData { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var child: ProtobufUnittest_TestChildExtensionData { + get {return _child ?? ProtobufUnittest_TestChildExtensionData()} + set {_child = newValue} + } + /// Returns true if `child` has been explicitly set. + var hasChild: Bool {return self._child != nil} + /// Clears the value of `child`. Subsequent reads from it will return its default value. + mutating func clearChild() {self._child = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + fileprivate var _child: ProtobufUnittest_TestChildExtensionData? = nil +} + +/// We have separate messages for testing required fields because it's +/// annoying to have to fill in required fields in TestProto in order to +/// do anything with it. Note that we don't need to test every type of +/// required filed because the code output is basically identical to +/// optional fields for all types. +struct ProtobufUnittest_TestRequired { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _storage._a ?? 0} + set {_uniqueStorage()._a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return _storage._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {_uniqueStorage()._a = nil} + + var dummy2: Int32 { + get {return _storage._dummy2 ?? 0} + set {_uniqueStorage()._dummy2 = newValue} + } + /// Returns true if `dummy2` has been explicitly set. + var hasDummy2: Bool {return _storage._dummy2 != nil} + /// Clears the value of `dummy2`. Subsequent reads from it will return its default value. + mutating func clearDummy2() {_uniqueStorage()._dummy2 = nil} + + var b: Int32 { + get {return _storage._b ?? 0} + set {_uniqueStorage()._b = newValue} + } + /// Returns true if `b` has been explicitly set. + var hasB: Bool {return _storage._b != nil} + /// Clears the value of `b`. Subsequent reads from it will return its default value. + mutating func clearB() {_uniqueStorage()._b = nil} + + /// Pad the field count to 32 so that we can test that IsInitialized() + /// properly checks multiple elements of has_bits_. + var dummy4: Int32 { + get {return _storage._dummy4 ?? 0} + set {_uniqueStorage()._dummy4 = newValue} + } + /// Returns true if `dummy4` has been explicitly set. + var hasDummy4: Bool {return _storage._dummy4 != nil} + /// Clears the value of `dummy4`. Subsequent reads from it will return its default value. + mutating func clearDummy4() {_uniqueStorage()._dummy4 = nil} + + var dummy5: Int32 { + get {return _storage._dummy5 ?? 0} + set {_uniqueStorage()._dummy5 = newValue} + } + /// Returns true if `dummy5` has been explicitly set. + var hasDummy5: Bool {return _storage._dummy5 != nil} + /// Clears the value of `dummy5`. Subsequent reads from it will return its default value. + mutating func clearDummy5() {_uniqueStorage()._dummy5 = nil} + + var dummy6: Int32 { + get {return _storage._dummy6 ?? 0} + set {_uniqueStorage()._dummy6 = newValue} + } + /// Returns true if `dummy6` has been explicitly set. + var hasDummy6: Bool {return _storage._dummy6 != nil} + /// Clears the value of `dummy6`. Subsequent reads from it will return its default value. + mutating func clearDummy6() {_uniqueStorage()._dummy6 = nil} + + var dummy7: Int32 { + get {return _storage._dummy7 ?? 0} + set {_uniqueStorage()._dummy7 = newValue} + } + /// Returns true if `dummy7` has been explicitly set. + var hasDummy7: Bool {return _storage._dummy7 != nil} + /// Clears the value of `dummy7`. Subsequent reads from it will return its default value. + mutating func clearDummy7() {_uniqueStorage()._dummy7 = nil} + + var dummy8: Int32 { + get {return _storage._dummy8 ?? 0} + set {_uniqueStorage()._dummy8 = newValue} + } + /// Returns true if `dummy8` has been explicitly set. + var hasDummy8: Bool {return _storage._dummy8 != nil} + /// Clears the value of `dummy8`. Subsequent reads from it will return its default value. + mutating func clearDummy8() {_uniqueStorage()._dummy8 = nil} + + var dummy9: Int32 { + get {return _storage._dummy9 ?? 0} + set {_uniqueStorage()._dummy9 = newValue} + } + /// Returns true if `dummy9` has been explicitly set. + var hasDummy9: Bool {return _storage._dummy9 != nil} + /// Clears the value of `dummy9`. Subsequent reads from it will return its default value. + mutating func clearDummy9() {_uniqueStorage()._dummy9 = nil} + + var dummy10: Int32 { + get {return _storage._dummy10 ?? 0} + set {_uniqueStorage()._dummy10 = newValue} + } + /// Returns true if `dummy10` has been explicitly set. + var hasDummy10: Bool {return _storage._dummy10 != nil} + /// Clears the value of `dummy10`. Subsequent reads from it will return its default value. + mutating func clearDummy10() {_uniqueStorage()._dummy10 = nil} + + var dummy11: Int32 { + get {return _storage._dummy11 ?? 0} + set {_uniqueStorage()._dummy11 = newValue} + } + /// Returns true if `dummy11` has been explicitly set. + var hasDummy11: Bool {return _storage._dummy11 != nil} + /// Clears the value of `dummy11`. Subsequent reads from it will return its default value. + mutating func clearDummy11() {_uniqueStorage()._dummy11 = nil} + + var dummy12: Int32 { + get {return _storage._dummy12 ?? 0} + set {_uniqueStorage()._dummy12 = newValue} + } + /// Returns true if `dummy12` has been explicitly set. + var hasDummy12: Bool {return _storage._dummy12 != nil} + /// Clears the value of `dummy12`. Subsequent reads from it will return its default value. + mutating func clearDummy12() {_uniqueStorage()._dummy12 = nil} + + var dummy13: Int32 { + get {return _storage._dummy13 ?? 0} + set {_uniqueStorage()._dummy13 = newValue} + } + /// Returns true if `dummy13` has been explicitly set. + var hasDummy13: Bool {return _storage._dummy13 != nil} + /// Clears the value of `dummy13`. Subsequent reads from it will return its default value. + mutating func clearDummy13() {_uniqueStorage()._dummy13 = nil} + + var dummy14: Int32 { + get {return _storage._dummy14 ?? 0} + set {_uniqueStorage()._dummy14 = newValue} + } + /// Returns true if `dummy14` has been explicitly set. + var hasDummy14: Bool {return _storage._dummy14 != nil} + /// Clears the value of `dummy14`. Subsequent reads from it will return its default value. + mutating func clearDummy14() {_uniqueStorage()._dummy14 = nil} + + var dummy15: Int32 { + get {return _storage._dummy15 ?? 0} + set {_uniqueStorage()._dummy15 = newValue} + } + /// Returns true if `dummy15` has been explicitly set. + var hasDummy15: Bool {return _storage._dummy15 != nil} + /// Clears the value of `dummy15`. Subsequent reads from it will return its default value. + mutating func clearDummy15() {_uniqueStorage()._dummy15 = nil} + + var dummy16: Int32 { + get {return _storage._dummy16 ?? 0} + set {_uniqueStorage()._dummy16 = newValue} + } + /// Returns true if `dummy16` has been explicitly set. + var hasDummy16: Bool {return _storage._dummy16 != nil} + /// Clears the value of `dummy16`. Subsequent reads from it will return its default value. + mutating func clearDummy16() {_uniqueStorage()._dummy16 = nil} + + var dummy17: Int32 { + get {return _storage._dummy17 ?? 0} + set {_uniqueStorage()._dummy17 = newValue} + } + /// Returns true if `dummy17` has been explicitly set. + var hasDummy17: Bool {return _storage._dummy17 != nil} + /// Clears the value of `dummy17`. Subsequent reads from it will return its default value. + mutating func clearDummy17() {_uniqueStorage()._dummy17 = nil} + + var dummy18: Int32 { + get {return _storage._dummy18 ?? 0} + set {_uniqueStorage()._dummy18 = newValue} + } + /// Returns true if `dummy18` has been explicitly set. + var hasDummy18: Bool {return _storage._dummy18 != nil} + /// Clears the value of `dummy18`. Subsequent reads from it will return its default value. + mutating func clearDummy18() {_uniqueStorage()._dummy18 = nil} + + var dummy19: Int32 { + get {return _storage._dummy19 ?? 0} + set {_uniqueStorage()._dummy19 = newValue} + } + /// Returns true if `dummy19` has been explicitly set. + var hasDummy19: Bool {return _storage._dummy19 != nil} + /// Clears the value of `dummy19`. Subsequent reads from it will return its default value. + mutating func clearDummy19() {_uniqueStorage()._dummy19 = nil} + + var dummy20: Int32 { + get {return _storage._dummy20 ?? 0} + set {_uniqueStorage()._dummy20 = newValue} + } + /// Returns true if `dummy20` has been explicitly set. + var hasDummy20: Bool {return _storage._dummy20 != nil} + /// Clears the value of `dummy20`. Subsequent reads from it will return its default value. + mutating func clearDummy20() {_uniqueStorage()._dummy20 = nil} + + var dummy21: Int32 { + get {return _storage._dummy21 ?? 0} + set {_uniqueStorage()._dummy21 = newValue} + } + /// Returns true if `dummy21` has been explicitly set. + var hasDummy21: Bool {return _storage._dummy21 != nil} + /// Clears the value of `dummy21`. Subsequent reads from it will return its default value. + mutating func clearDummy21() {_uniqueStorage()._dummy21 = nil} + + var dummy22: Int32 { + get {return _storage._dummy22 ?? 0} + set {_uniqueStorage()._dummy22 = newValue} + } + /// Returns true if `dummy22` has been explicitly set. + var hasDummy22: Bool {return _storage._dummy22 != nil} + /// Clears the value of `dummy22`. Subsequent reads from it will return its default value. + mutating func clearDummy22() {_uniqueStorage()._dummy22 = nil} + + var dummy23: Int32 { + get {return _storage._dummy23 ?? 0} + set {_uniqueStorage()._dummy23 = newValue} + } + /// Returns true if `dummy23` has been explicitly set. + var hasDummy23: Bool {return _storage._dummy23 != nil} + /// Clears the value of `dummy23`. Subsequent reads from it will return its default value. + mutating func clearDummy23() {_uniqueStorage()._dummy23 = nil} + + var dummy24: Int32 { + get {return _storage._dummy24 ?? 0} + set {_uniqueStorage()._dummy24 = newValue} + } + /// Returns true if `dummy24` has been explicitly set. + var hasDummy24: Bool {return _storage._dummy24 != nil} + /// Clears the value of `dummy24`. Subsequent reads from it will return its default value. + mutating func clearDummy24() {_uniqueStorage()._dummy24 = nil} + + var dummy25: Int32 { + get {return _storage._dummy25 ?? 0} + set {_uniqueStorage()._dummy25 = newValue} + } + /// Returns true if `dummy25` has been explicitly set. + var hasDummy25: Bool {return _storage._dummy25 != nil} + /// Clears the value of `dummy25`. Subsequent reads from it will return its default value. + mutating func clearDummy25() {_uniqueStorage()._dummy25 = nil} + + var dummy26: Int32 { + get {return _storage._dummy26 ?? 0} + set {_uniqueStorage()._dummy26 = newValue} + } + /// Returns true if `dummy26` has been explicitly set. + var hasDummy26: Bool {return _storage._dummy26 != nil} + /// Clears the value of `dummy26`. Subsequent reads from it will return its default value. + mutating func clearDummy26() {_uniqueStorage()._dummy26 = nil} + + var dummy27: Int32 { + get {return _storage._dummy27 ?? 0} + set {_uniqueStorage()._dummy27 = newValue} + } + /// Returns true if `dummy27` has been explicitly set. + var hasDummy27: Bool {return _storage._dummy27 != nil} + /// Clears the value of `dummy27`. Subsequent reads from it will return its default value. + mutating func clearDummy27() {_uniqueStorage()._dummy27 = nil} + + var dummy28: Int32 { + get {return _storage._dummy28 ?? 0} + set {_uniqueStorage()._dummy28 = newValue} + } + /// Returns true if `dummy28` has been explicitly set. + var hasDummy28: Bool {return _storage._dummy28 != nil} + /// Clears the value of `dummy28`. Subsequent reads from it will return its default value. + mutating func clearDummy28() {_uniqueStorage()._dummy28 = nil} + + var dummy29: Int32 { + get {return _storage._dummy29 ?? 0} + set {_uniqueStorage()._dummy29 = newValue} + } + /// Returns true if `dummy29` has been explicitly set. + var hasDummy29: Bool {return _storage._dummy29 != nil} + /// Clears the value of `dummy29`. Subsequent reads from it will return its default value. + mutating func clearDummy29() {_uniqueStorage()._dummy29 = nil} + + var dummy30: Int32 { + get {return _storage._dummy30 ?? 0} + set {_uniqueStorage()._dummy30 = newValue} + } + /// Returns true if `dummy30` has been explicitly set. + var hasDummy30: Bool {return _storage._dummy30 != nil} + /// Clears the value of `dummy30`. Subsequent reads from it will return its default value. + mutating func clearDummy30() {_uniqueStorage()._dummy30 = nil} + + var dummy31: Int32 { + get {return _storage._dummy31 ?? 0} + set {_uniqueStorage()._dummy31 = newValue} + } + /// Returns true if `dummy31` has been explicitly set. + var hasDummy31: Bool {return _storage._dummy31 != nil} + /// Clears the value of `dummy31`. Subsequent reads from it will return its default value. + mutating func clearDummy31() {_uniqueStorage()._dummy31 = nil} + + var dummy32: Int32 { + get {return _storage._dummy32 ?? 0} + set {_uniqueStorage()._dummy32 = newValue} + } + /// Returns true if `dummy32` has been explicitly set. + var hasDummy32: Bool {return _storage._dummy32 != nil} + /// Clears the value of `dummy32`. Subsequent reads from it will return its default value. + mutating func clearDummy32() {_uniqueStorage()._dummy32 = nil} + + var c: Int32 { + get {return _storage._c ?? 0} + set {_uniqueStorage()._c = newValue} + } + /// Returns true if `c` has been explicitly set. + var hasC: Bool {return _storage._c != nil} + /// Clears the value of `c`. Subsequent reads from it will return its default value. + mutating func clearC() {_uniqueStorage()._c = nil} + + /// Add an optional child message to make this non-trivial for go/pdlazy. + var optionalForeign: ProtobufUnittest_ForeignMessage { + get {return _storage._optionalForeign ?? ProtobufUnittest_ForeignMessage()} + set {_uniqueStorage()._optionalForeign = newValue} + } + /// Returns true if `optionalForeign` has been explicitly set. + var hasOptionalForeign: Bool {return _storage._optionalForeign != nil} + /// Clears the value of `optionalForeign`. Subsequent reads from it will return its default value. + mutating func clearOptionalForeign() {_uniqueStorage()._optionalForeign = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufUnittest_TestRequiredForeign { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalMessage: ProtobufUnittest_TestRequired { + get {return _optionalMessage ?? ProtobufUnittest_TestRequired()} + set {_optionalMessage = newValue} + } + /// Returns true if `optionalMessage` has been explicitly set. + var hasOptionalMessage: Bool {return self._optionalMessage != nil} + /// Clears the value of `optionalMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalMessage() {self._optionalMessage = nil} + + var repeatedMessage: [ProtobufUnittest_TestRequired] = [] + + var dummy: Int32 { + get {return _dummy ?? 0} + set {_dummy = newValue} + } + /// Returns true if `dummy` has been explicitly set. + var hasDummy: Bool {return self._dummy != nil} + /// Clears the value of `dummy`. Subsequent reads from it will return its default value. + mutating func clearDummy() {self._dummy = nil} + + /// Missing required fields must not affect verification of child messages. + var optionalLazyMessage: ProtobufUnittest_NestedTestAllTypes { + get {return _optionalLazyMessage ?? ProtobufUnittest_NestedTestAllTypes()} + set {_optionalLazyMessage = newValue} + } + /// Returns true if `optionalLazyMessage` has been explicitly set. + var hasOptionalLazyMessage: Bool {return self._optionalLazyMessage != nil} + /// Clears the value of `optionalLazyMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalLazyMessage() {self._optionalLazyMessage = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalMessage: ProtobufUnittest_TestRequired? = nil + fileprivate var _dummy: Int32? = nil + fileprivate var _optionalLazyMessage: ProtobufUnittest_NestedTestAllTypes? = nil +} + +struct ProtobufUnittest_TestRequiredMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalMessage: ProtobufUnittest_TestRequired { + get {return _optionalMessage ?? ProtobufUnittest_TestRequired()} + set {_optionalMessage = newValue} + } + /// Returns true if `optionalMessage` has been explicitly set. + var hasOptionalMessage: Bool {return self._optionalMessage != nil} + /// Clears the value of `optionalMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalMessage() {self._optionalMessage = nil} + + var repeatedMessage: [ProtobufUnittest_TestRequired] = [] + + var requiredMessage: ProtobufUnittest_TestRequired { + get {return _requiredMessage ?? ProtobufUnittest_TestRequired()} + set {_requiredMessage = newValue} + } + /// Returns true if `requiredMessage` has been explicitly set. + var hasRequiredMessage: Bool {return self._requiredMessage != nil} + /// Clears the value of `requiredMessage`. Subsequent reads from it will return its default value. + mutating func clearRequiredMessage() {self._requiredMessage = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalMessage: ProtobufUnittest_TestRequired? = nil + fileprivate var _requiredMessage: ProtobufUnittest_TestRequired? = nil +} + +struct ProtobufUnittest_TestNestedRequiredForeign { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var child: ProtobufUnittest_TestNestedRequiredForeign { + get {return _storage._child ?? ProtobufUnittest_TestNestedRequiredForeign()} + set {_uniqueStorage()._child = newValue} + } + /// Returns true if `child` has been explicitly set. + var hasChild: Bool {return _storage._child != nil} + /// Clears the value of `child`. Subsequent reads from it will return its default value. + mutating func clearChild() {_uniqueStorage()._child = nil} + + var payload: ProtobufUnittest_TestRequiredForeign { + get {return _storage._payload ?? ProtobufUnittest_TestRequiredForeign()} + set {_uniqueStorage()._payload = newValue} + } + /// Returns true if `payload` has been explicitly set. + var hasPayload: Bool {return _storage._payload != nil} + /// Clears the value of `payload`. Subsequent reads from it will return its default value. + mutating func clearPayload() {_uniqueStorage()._payload = nil} + + var dummy: Int32 { + get {return _storage._dummy ?? 0} + set {_uniqueStorage()._dummy = newValue} + } + /// Returns true if `dummy` has been explicitly set. + var hasDummy: Bool {return _storage._dummy != nil} + /// Clears the value of `dummy`. Subsequent reads from it will return its default value. + mutating func clearDummy() {_uniqueStorage()._dummy = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +/// Test that we can use NestedMessage from outside TestAllTypes. +struct ProtobufUnittest_TestForeignNested { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var foreignNested: ProtobufUnittest_TestAllTypes.NestedMessage { + get {return _foreignNested ?? ProtobufUnittest_TestAllTypes.NestedMessage()} + set {_foreignNested = newValue} + } + /// Returns true if `foreignNested` has been explicitly set. + var hasForeignNested: Bool {return self._foreignNested != nil} + /// Clears the value of `foreignNested`. Subsequent reads from it will return its default value. + mutating func clearForeignNested() {self._foreignNested = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _foreignNested: ProtobufUnittest_TestAllTypes.NestedMessage? = nil +} + +/// TestEmptyMessage is used to test unknown field support. +struct ProtobufUnittest_TestEmptyMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Like above, but declare all field numbers as potential extensions. No +/// actual extensions should ever be defined for this type. +struct ProtobufUnittest_TestEmptyMessageWithExtensions: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() +} + +/// Needed for a Python test. +struct ProtobufUnittest_TestPickleNestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var bb: Int32 { + get {return _bb ?? 0} + set {_bb = newValue} + } + /// Returns true if `bb` has been explicitly set. + var hasBb: Bool {return self._bb != nil} + /// Clears the value of `bb`. Subsequent reads from it will return its default value. + mutating func clearBb() {self._bb = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct NestedNestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var cc: Int32 { + get {return _cc ?? 0} + set {_cc = newValue} + } + /// Returns true if `cc` has been explicitly set. + var hasCc: Bool {return self._cc != nil} + /// Clears the value of `cc`. Subsequent reads from it will return its default value. + mutating func clearCc() {self._cc = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _cc: Int32? = nil + } + + init() {} + + fileprivate var _bb: Int32? = nil + } + + init() {} +} + +struct ProtobufUnittest_TestMultipleExtensionRanges: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() +} + +/// Test that really large tag numbers don't break anything. +struct ProtobufUnittest_TestReallyLargeTagNumber { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The largest possible tag number is 2^28 - 1, since the wire format uses + /// three bits to communicate wire type. + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var bb: Int32 { + get {return _bb ?? 0} + set {_bb = newValue} + } + /// Returns true if `bb` has been explicitly set. + var hasBb: Bool {return self._bb != nil} + /// Clears the value of `bb`. Subsequent reads from it will return its default value. + mutating func clearBb() {self._bb = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + fileprivate var _bb: Int32? = nil +} + +struct ProtobufUnittest_TestRecursiveMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: ProtobufUnittest_TestRecursiveMessage { + get {return _storage._a ?? ProtobufUnittest_TestRecursiveMessage()} + set {_uniqueStorage()._a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return _storage._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {_uniqueStorage()._a = nil} + + var i: Int32 { + get {return _storage._i ?? 0} + set {_uniqueStorage()._i = newValue} + } + /// Returns true if `i` has been explicitly set. + var hasI: Bool {return _storage._i != nil} + /// Clears the value of `i`. Subsequent reads from it will return its default value. + mutating func clearI() {_uniqueStorage()._i = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +/// Test that mutual recursion works. +struct ProtobufUnittest_TestMutualRecursionA { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var bb: ProtobufUnittest_TestMutualRecursionB { + get {return _storage._bb ?? ProtobufUnittest_TestMutualRecursionB()} + set {_uniqueStorage()._bb = newValue} + } + /// Returns true if `bb` has been explicitly set. + var hasBb: Bool {return _storage._bb != nil} + /// Clears the value of `bb`. Subsequent reads from it will return its default value. + mutating func clearBb() {_uniqueStorage()._bb = nil} + + var subGroup: ProtobufUnittest_TestMutualRecursionA.SubGroup { + get {return _storage._subGroup ?? ProtobufUnittest_TestMutualRecursionA.SubGroup()} + set {_uniqueStorage()._subGroup = newValue} + } + /// Returns true if `subGroup` has been explicitly set. + var hasSubGroup: Bool {return _storage._subGroup != nil} + /// Clears the value of `subGroup`. Subsequent reads from it will return its default value. + mutating func clearSubGroup() {_uniqueStorage()._subGroup = nil} + + var subGroupR: [ProtobufUnittest_TestMutualRecursionA.SubGroupR] { + get {return _storage._subGroupR} + set {_uniqueStorage()._subGroupR = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct SubMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var b: ProtobufUnittest_TestMutualRecursionB { + get {return _storage._b ?? ProtobufUnittest_TestMutualRecursionB()} + set {_uniqueStorage()._b = newValue} + } + /// Returns true if `b` has been explicitly set. + var hasB: Bool {return _storage._b != nil} + /// Clears the value of `b`. Subsequent reads from it will return its default value. + mutating func clearB() {_uniqueStorage()._b = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance + } + + struct SubGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Needed because of bug in javatest + var subMessage: ProtobufUnittest_TestMutualRecursionA.SubMessage { + get {return _storage._subMessage ?? ProtobufUnittest_TestMutualRecursionA.SubMessage()} + set {_uniqueStorage()._subMessage = newValue} + } + /// Returns true if `subMessage` has been explicitly set. + var hasSubMessage: Bool {return _storage._subMessage != nil} + /// Clears the value of `subMessage`. Subsequent reads from it will return its default value. + mutating func clearSubMessage() {_uniqueStorage()._subMessage = nil} + + var notInThisScc: ProtobufUnittest_TestAllTypes { + get {return _storage._notInThisScc ?? ProtobufUnittest_TestAllTypes()} + set {_uniqueStorage()._notInThisScc = newValue} + } + /// Returns true if `notInThisScc` has been explicitly set. + var hasNotInThisScc: Bool {return _storage._notInThisScc != nil} + /// Clears the value of `notInThisScc`. Subsequent reads from it will return its default value. + mutating func clearNotInThisScc() {_uniqueStorage()._notInThisScc = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance + } + + struct SubGroupR { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var payload: ProtobufUnittest_TestAllTypes { + get {return _payload ?? ProtobufUnittest_TestAllTypes()} + set {_payload = newValue} + } + /// Returns true if `payload` has been explicitly set. + var hasPayload: Bool {return self._payload != nil} + /// Clears the value of `payload`. Subsequent reads from it will return its default value. + mutating func clearPayload() {self._payload = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _payload: ProtobufUnittest_TestAllTypes? = nil + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufUnittest_TestMutualRecursionB { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: ProtobufUnittest_TestMutualRecursionA { + get {return _storage._a ?? ProtobufUnittest_TestMutualRecursionA()} + set {_uniqueStorage()._a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return _storage._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {_uniqueStorage()._a = nil} + + var optionalInt32: Int32 { + get {return _storage._optionalInt32 ?? 0} + set {_uniqueStorage()._optionalInt32 = newValue} + } + /// Returns true if `optionalInt32` has been explicitly set. + var hasOptionalInt32: Bool {return _storage._optionalInt32 != nil} + /// Clears the value of `optionalInt32`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt32() {_uniqueStorage()._optionalInt32 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufUnittest_TestIsInitialized { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var subMessage: ProtobufUnittest_TestIsInitialized.SubMessage { + get {return _subMessage ?? ProtobufUnittest_TestIsInitialized.SubMessage()} + set {_subMessage = newValue} + } + /// Returns true if `subMessage` has been explicitly set. + var hasSubMessage: Bool {return self._subMessage != nil} + /// Clears the value of `subMessage`. Subsequent reads from it will return its default value. + mutating func clearSubMessage() {self._subMessage = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct SubMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var subGroup: ProtobufUnittest_TestIsInitialized.SubMessage.SubGroup { + get {return _subGroup ?? ProtobufUnittest_TestIsInitialized.SubMessage.SubGroup()} + set {_subGroup = newValue} + } + /// Returns true if `subGroup` has been explicitly set. + var hasSubGroup: Bool {return self._subGroup != nil} + /// Clears the value of `subGroup`. Subsequent reads from it will return its default value. + mutating func clearSubGroup() {self._subGroup = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct SubGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var i: Int32 { + get {return _i ?? 0} + set {_i = newValue} + } + /// Returns true if `i` has been explicitly set. + var hasI: Bool {return self._i != nil} + /// Clears the value of `i`. Subsequent reads from it will return its default value. + mutating func clearI() {self._i = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _i: Int32? = nil + } + + init() {} + + fileprivate var _subGroup: ProtobufUnittest_TestIsInitialized.SubMessage.SubGroup? = nil + } + + init() {} + + fileprivate var _subMessage: ProtobufUnittest_TestIsInitialized.SubMessage? = nil +} + +/// Test that groups have disjoint field numbers from their siblings and +/// parents. This is NOT possible in proto1; only google.protobuf. When attempting +/// to compile with proto1, this will emit an error; so we only include it +/// in protobuf_unittest_proto. +struct ProtobufUnittest_TestDupFieldNumber { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// NO_PROTO1 + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var foo: ProtobufUnittest_TestDupFieldNumber.Foo { + get {return _foo ?? ProtobufUnittest_TestDupFieldNumber.Foo()} + set {_foo = newValue} + } + /// Returns true if `foo` has been explicitly set. + var hasFoo: Bool {return self._foo != nil} + /// Clears the value of `foo`. Subsequent reads from it will return its default value. + mutating func clearFoo() {self._foo = nil} + + var bar: ProtobufUnittest_TestDupFieldNumber.Bar { + get {return _bar ?? ProtobufUnittest_TestDupFieldNumber.Bar()} + set {_bar = newValue} + } + /// Returns true if `bar` has been explicitly set. + var hasBar: Bool {return self._bar != nil} + /// Clears the value of `bar`. Subsequent reads from it will return its default value. + mutating func clearBar() {self._bar = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct Foo { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + } + + struct Bar { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + } + + init() {} + + fileprivate var _a: Int32? = nil + fileprivate var _foo: ProtobufUnittest_TestDupFieldNumber.Foo? = nil + fileprivate var _bar: ProtobufUnittest_TestDupFieldNumber.Bar? = nil +} + +/// Additional messages for testing lazy fields. +struct ProtobufUnittest_TestEagerMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var subMessage: ProtobufUnittest_TestAllTypes { + get {return _subMessage ?? ProtobufUnittest_TestAllTypes()} + set {_subMessage = newValue} + } + /// Returns true if `subMessage` has been explicitly set. + var hasSubMessage: Bool {return self._subMessage != nil} + /// Clears the value of `subMessage`. Subsequent reads from it will return its default value. + mutating func clearSubMessage() {self._subMessage = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _subMessage: ProtobufUnittest_TestAllTypes? = nil +} + +struct ProtobufUnittest_TestLazyMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var subMessage: ProtobufUnittest_TestAllTypes { + get {return _subMessage ?? ProtobufUnittest_TestAllTypes()} + set {_subMessage = newValue} + } + /// Returns true if `subMessage` has been explicitly set. + var hasSubMessage: Bool {return self._subMessage != nil} + /// Clears the value of `subMessage`. Subsequent reads from it will return its default value. + mutating func clearSubMessage() {self._subMessage = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _subMessage: ProtobufUnittest_TestAllTypes? = nil +} + +struct ProtobufUnittest_TestLazyMessageRepeated { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var repeatedMessage: [ProtobufUnittest_TestLazyMessage] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_TestEagerMaybeLazy { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var messageFoo: ProtobufUnittest_TestAllTypes { + get {return _messageFoo ?? ProtobufUnittest_TestAllTypes()} + set {_messageFoo = newValue} + } + /// Returns true if `messageFoo` has been explicitly set. + var hasMessageFoo: Bool {return self._messageFoo != nil} + /// Clears the value of `messageFoo`. Subsequent reads from it will return its default value. + mutating func clearMessageFoo() {self._messageFoo = nil} + + var messageBar: ProtobufUnittest_TestAllTypes { + get {return _messageBar ?? ProtobufUnittest_TestAllTypes()} + set {_messageBar = newValue} + } + /// Returns true if `messageBar` has been explicitly set. + var hasMessageBar: Bool {return self._messageBar != nil} + /// Clears the value of `messageBar`. Subsequent reads from it will return its default value. + mutating func clearMessageBar() {self._messageBar = nil} + + var messageBaz: ProtobufUnittest_TestEagerMaybeLazy.NestedMessage { + get {return _messageBaz ?? ProtobufUnittest_TestEagerMaybeLazy.NestedMessage()} + set {_messageBaz = newValue} + } + /// Returns true if `messageBaz` has been explicitly set. + var hasMessageBaz: Bool {return self._messageBaz != nil} + /// Clears the value of `messageBaz`. Subsequent reads from it will return its default value. + mutating func clearMessageBaz() {self._messageBaz = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var packed: ProtobufUnittest_TestPackedTypes { + get {return _packed ?? ProtobufUnittest_TestPackedTypes()} + set {_packed = newValue} + } + /// Returns true if `packed` has been explicitly set. + var hasPacked: Bool {return self._packed != nil} + /// Clears the value of `packed`. Subsequent reads from it will return its default value. + mutating func clearPacked() {self._packed = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _packed: ProtobufUnittest_TestPackedTypes? = nil + } + + init() {} + + fileprivate var _messageFoo: ProtobufUnittest_TestAllTypes? = nil + fileprivate var _messageBar: ProtobufUnittest_TestAllTypes? = nil + fileprivate var _messageBaz: ProtobufUnittest_TestEagerMaybeLazy.NestedMessage? = nil +} + +/// Needed for a Python test. +struct ProtobufUnittest_TestNestedMessageHasBits { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalNestedMessage: ProtobufUnittest_TestNestedMessageHasBits.NestedMessage { + get {return _optionalNestedMessage ?? ProtobufUnittest_TestNestedMessageHasBits.NestedMessage()} + set {_optionalNestedMessage = newValue} + } + /// Returns true if `optionalNestedMessage` has been explicitly set. + var hasOptionalNestedMessage: Bool {return self._optionalNestedMessage != nil} + /// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedMessage() {self._optionalNestedMessage = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var nestedmessageRepeatedInt32: [Int32] = [] + + var nestedmessageRepeatedForeignmessage: [ProtobufUnittest_ForeignMessage] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + + fileprivate var _optionalNestedMessage: ProtobufUnittest_TestNestedMessageHasBits.NestedMessage? = nil +} + +/// Test message with CamelCase field names. This violates Protocol Buffer +/// standard style. +struct ProtobufUnittest_TestCamelCaseFieldNames { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var primitiveField: Int32 { + get {return _primitiveField ?? 0} + set {_primitiveField = newValue} + } + /// Returns true if `primitiveField` has been explicitly set. + var hasPrimitiveField: Bool {return self._primitiveField != nil} + /// Clears the value of `primitiveField`. Subsequent reads from it will return its default value. + mutating func clearPrimitiveField() {self._primitiveField = nil} + + var stringField: String { + get {return _stringField ?? String()} + set {_stringField = newValue} + } + /// Returns true if `stringField` has been explicitly set. + var hasStringField: Bool {return self._stringField != nil} + /// Clears the value of `stringField`. Subsequent reads from it will return its default value. + mutating func clearStringField() {self._stringField = nil} + + var enumField: ProtobufUnittest_ForeignEnum { + get {return _enumField ?? .foreignFoo} + set {_enumField = newValue} + } + /// Returns true if `enumField` has been explicitly set. + var hasEnumField: Bool {return self._enumField != nil} + /// Clears the value of `enumField`. Subsequent reads from it will return its default value. + mutating func clearEnumField() {self._enumField = nil} + + var messageField: ProtobufUnittest_ForeignMessage { + get {return _messageField ?? ProtobufUnittest_ForeignMessage()} + set {_messageField = newValue} + } + /// Returns true if `messageField` has been explicitly set. + var hasMessageField: Bool {return self._messageField != nil} + /// Clears the value of `messageField`. Subsequent reads from it will return its default value. + mutating func clearMessageField() {self._messageField = nil} + + var stringPieceField: String { + get {return _stringPieceField ?? String()} + set {_stringPieceField = newValue} + } + /// Returns true if `stringPieceField` has been explicitly set. + var hasStringPieceField: Bool {return self._stringPieceField != nil} + /// Clears the value of `stringPieceField`. Subsequent reads from it will return its default value. + mutating func clearStringPieceField() {self._stringPieceField = nil} + + var cordField: String { + get {return _cordField ?? String()} + set {_cordField = newValue} + } + /// Returns true if `cordField` has been explicitly set. + var hasCordField: Bool {return self._cordField != nil} + /// Clears the value of `cordField`. Subsequent reads from it will return its default value. + mutating func clearCordField() {self._cordField = nil} + + var repeatedPrimitiveField: [Int32] = [] + + var repeatedStringField: [String] = [] + + var repeatedEnumField: [ProtobufUnittest_ForeignEnum] = [] + + var repeatedMessageField: [ProtobufUnittest_ForeignMessage] = [] + + var repeatedStringPieceField: [String] = [] + + var repeatedCordField: [String] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _primitiveField: Int32? = nil + fileprivate var _stringField: String? = nil + fileprivate var _enumField: ProtobufUnittest_ForeignEnum? = nil + fileprivate var _messageField: ProtobufUnittest_ForeignMessage? = nil + fileprivate var _stringPieceField: String? = nil + fileprivate var _cordField: String? = nil +} + +/// We list fields out of order, to ensure that we're using field number and not +/// field index to determine serialization order. +struct ProtobufUnittest_TestFieldOrderings: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var myString: String { + get {return _myString ?? String()} + set {_myString = newValue} + } + /// Returns true if `myString` has been explicitly set. + var hasMyString: Bool {return self._myString != nil} + /// Clears the value of `myString`. Subsequent reads from it will return its default value. + mutating func clearMyString() {self._myString = nil} + + var myInt: Int64 { + get {return _myInt ?? 0} + set {_myInt = newValue} + } + /// Returns true if `myInt` has been explicitly set. + var hasMyInt: Bool {return self._myInt != nil} + /// Clears the value of `myInt`. Subsequent reads from it will return its default value. + mutating func clearMyInt() {self._myInt = nil} + + var myFloat: Float { + get {return _myFloat ?? 0} + set {_myFloat = newValue} + } + /// Returns true if `myFloat` has been explicitly set. + var hasMyFloat: Bool {return self._myFloat != nil} + /// Clears the value of `myFloat`. Subsequent reads from it will return its default value. + mutating func clearMyFloat() {self._myFloat = nil} + + var optionalNestedMessage: ProtobufUnittest_TestFieldOrderings.NestedMessage { + get {return _optionalNestedMessage ?? ProtobufUnittest_TestFieldOrderings.NestedMessage()} + set {_optionalNestedMessage = newValue} + } + /// Returns true if `optionalNestedMessage` has been explicitly set. + var hasOptionalNestedMessage: Bool {return self._optionalNestedMessage != nil} + /// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedMessage() {self._optionalNestedMessage = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var oo: Int64 { + get {return _oo ?? 0} + set {_oo = newValue} + } + /// Returns true if `oo` has been explicitly set. + var hasOo: Bool {return self._oo != nil} + /// Clears the value of `oo`. Subsequent reads from it will return its default value. + mutating func clearOo() {self._oo = nil} + + /// The field name "b" fails to compile in proto1 because it conflicts with + /// a local variable named "b" in one of the generated methods. Doh. + /// This file needs to compile in proto1 to test backwards-compatibility. + var bb: Int32 { + get {return _bb ?? 0} + set {_bb = newValue} + } + /// Returns true if `bb` has been explicitly set. + var hasBb: Bool {return self._bb != nil} + /// Clears the value of `bb`. Subsequent reads from it will return its default value. + mutating func clearBb() {self._bb = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _oo: Int64? = nil + fileprivate var _bb: Int32? = nil + } + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _myString: String? = nil + fileprivate var _myInt: Int64? = nil + fileprivate var _myFloat: Float? = nil + fileprivate var _optionalNestedMessage: ProtobufUnittest_TestFieldOrderings.NestedMessage? = nil +} + +struct ProtobufUnittest_TestExtensionOrderings1 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var myString: String { + get {return _myString ?? String()} + set {_myString = newValue} + } + /// Returns true if `myString` has been explicitly set. + var hasMyString: Bool {return self._myString != nil} + /// Clears the value of `myString`. Subsequent reads from it will return its default value. + mutating func clearMyString() {self._myString = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _myString: String? = nil +} + +struct ProtobufUnittest_TestExtensionOrderings2 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var myString: String { + get {return _myString ?? String()} + set {_myString = newValue} + } + /// Returns true if `myString` has been explicitly set. + var hasMyString: Bool {return self._myString != nil} + /// Clears the value of `myString`. Subsequent reads from it will return its default value. + mutating func clearMyString() {self._myString = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct TestExtensionOrderings3 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var myString: String { + get {return _myString ?? String()} + set {_myString = newValue} + } + /// Returns true if `myString` has been explicitly set. + var hasMyString: Bool {return self._myString != nil} + /// Clears the value of `myString`. Subsequent reads from it will return its default value. + mutating func clearMyString() {self._myString = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _myString: String? = nil + } + + init() {} + + fileprivate var _myString: String? = nil +} + +struct ProtobufUnittest_TestExtremeDefaultValues { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var escapedBytes: Data { + get {return _storage._escapedBytes ?? Data([0, 1, 7, 8, 12, 10, 13, 9, 11, 92, 39, 34, 254])} + set {_uniqueStorage()._escapedBytes = newValue} + } + /// Returns true if `escapedBytes` has been explicitly set. + var hasEscapedBytes: Bool {return _storage._escapedBytes != nil} + /// Clears the value of `escapedBytes`. Subsequent reads from it will return its default value. + mutating func clearEscapedBytes() {_uniqueStorage()._escapedBytes = nil} + + var largeUint32: UInt32 { + get {return _storage._largeUint32 ?? 4294967295} + set {_uniqueStorage()._largeUint32 = newValue} + } + /// Returns true if `largeUint32` has been explicitly set. + var hasLargeUint32: Bool {return _storage._largeUint32 != nil} + /// Clears the value of `largeUint32`. Subsequent reads from it will return its default value. + mutating func clearLargeUint32() {_uniqueStorage()._largeUint32 = nil} + + var largeUint64: UInt64 { + get {return _storage._largeUint64 ?? 18446744073709551615} + set {_uniqueStorage()._largeUint64 = newValue} + } + /// Returns true if `largeUint64` has been explicitly set. + var hasLargeUint64: Bool {return _storage._largeUint64 != nil} + /// Clears the value of `largeUint64`. Subsequent reads from it will return its default value. + mutating func clearLargeUint64() {_uniqueStorage()._largeUint64 = nil} + + var smallInt32: Int32 { + get {return _storage._smallInt32 ?? -2147483647} + set {_uniqueStorage()._smallInt32 = newValue} + } + /// Returns true if `smallInt32` has been explicitly set. + var hasSmallInt32: Bool {return _storage._smallInt32 != nil} + /// Clears the value of `smallInt32`. Subsequent reads from it will return its default value. + mutating func clearSmallInt32() {_uniqueStorage()._smallInt32 = nil} + + var smallInt64: Int64 { + get {return _storage._smallInt64 ?? -9223372036854775807} + set {_uniqueStorage()._smallInt64 = newValue} + } + /// Returns true if `smallInt64` has been explicitly set. + var hasSmallInt64: Bool {return _storage._smallInt64 != nil} + /// Clears the value of `smallInt64`. Subsequent reads from it will return its default value. + mutating func clearSmallInt64() {_uniqueStorage()._smallInt64 = nil} + + var reallySmallInt32: Int32 { + get {return _storage._reallySmallInt32 ?? -2147483648} + set {_uniqueStorage()._reallySmallInt32 = newValue} + } + /// Returns true if `reallySmallInt32` has been explicitly set. + var hasReallySmallInt32: Bool {return _storage._reallySmallInt32 != nil} + /// Clears the value of `reallySmallInt32`. Subsequent reads from it will return its default value. + mutating func clearReallySmallInt32() {_uniqueStorage()._reallySmallInt32 = nil} + + var reallySmallInt64: Int64 { + get {return _storage._reallySmallInt64 ?? -9223372036854775808} + set {_uniqueStorage()._reallySmallInt64 = newValue} + } + /// Returns true if `reallySmallInt64` has been explicitly set. + var hasReallySmallInt64: Bool {return _storage._reallySmallInt64 != nil} + /// Clears the value of `reallySmallInt64`. Subsequent reads from it will return its default value. + mutating func clearReallySmallInt64() {_uniqueStorage()._reallySmallInt64 = nil} + + /// The default value here is UTF-8 for "\u1234". (We could also just type + /// the UTF-8 text directly into this text file rather than escape it, but + /// lots of people use editors that would be confused by this.) + var utf8String: String { + get {return _storage._utf8String ?? "ሴ"} + set {_uniqueStorage()._utf8String = newValue} + } + /// Returns true if `utf8String` has been explicitly set. + var hasUtf8String: Bool {return _storage._utf8String != nil} + /// Clears the value of `utf8String`. Subsequent reads from it will return its default value. + mutating func clearUtf8String() {_uniqueStorage()._utf8String = nil} + + /// Tests for single-precision floating-point values. + var zeroFloat: Float { + get {return _storage._zeroFloat ?? 0} + set {_uniqueStorage()._zeroFloat = newValue} + } + /// Returns true if `zeroFloat` has been explicitly set. + var hasZeroFloat: Bool {return _storage._zeroFloat != nil} + /// Clears the value of `zeroFloat`. Subsequent reads from it will return its default value. + mutating func clearZeroFloat() {_uniqueStorage()._zeroFloat = nil} + + var oneFloat: Float { + get {return _storage._oneFloat ?? 1} + set {_uniqueStorage()._oneFloat = newValue} + } + /// Returns true if `oneFloat` has been explicitly set. + var hasOneFloat: Bool {return _storage._oneFloat != nil} + /// Clears the value of `oneFloat`. Subsequent reads from it will return its default value. + mutating func clearOneFloat() {_uniqueStorage()._oneFloat = nil} + + var smallFloat: Float { + get {return _storage._smallFloat ?? 1.5} + set {_uniqueStorage()._smallFloat = newValue} + } + /// Returns true if `smallFloat` has been explicitly set. + var hasSmallFloat: Bool {return _storage._smallFloat != nil} + /// Clears the value of `smallFloat`. Subsequent reads from it will return its default value. + mutating func clearSmallFloat() {_uniqueStorage()._smallFloat = nil} + + var negativeOneFloat: Float { + get {return _storage._negativeOneFloat ?? -1} + set {_uniqueStorage()._negativeOneFloat = newValue} + } + /// Returns true if `negativeOneFloat` has been explicitly set. + var hasNegativeOneFloat: Bool {return _storage._negativeOneFloat != nil} + /// Clears the value of `negativeOneFloat`. Subsequent reads from it will return its default value. + mutating func clearNegativeOneFloat() {_uniqueStorage()._negativeOneFloat = nil} + + var negativeFloat: Float { + get {return _storage._negativeFloat ?? -1.5} + set {_uniqueStorage()._negativeFloat = newValue} + } + /// Returns true if `negativeFloat` has been explicitly set. + var hasNegativeFloat: Bool {return _storage._negativeFloat != nil} + /// Clears the value of `negativeFloat`. Subsequent reads from it will return its default value. + mutating func clearNegativeFloat() {_uniqueStorage()._negativeFloat = nil} + + /// Using exponents + var largeFloat: Float { + get {return _storage._largeFloat ?? 2e+08} + set {_uniqueStorage()._largeFloat = newValue} + } + /// Returns true if `largeFloat` has been explicitly set. + var hasLargeFloat: Bool {return _storage._largeFloat != nil} + /// Clears the value of `largeFloat`. Subsequent reads from it will return its default value. + mutating func clearLargeFloat() {_uniqueStorage()._largeFloat = nil} + + var smallNegativeFloat: Float { + get {return _storage._smallNegativeFloat ?? -8e-28} + set {_uniqueStorage()._smallNegativeFloat = newValue} + } + /// Returns true if `smallNegativeFloat` has been explicitly set. + var hasSmallNegativeFloat: Bool {return _storage._smallNegativeFloat != nil} + /// Clears the value of `smallNegativeFloat`. Subsequent reads from it will return its default value. + mutating func clearSmallNegativeFloat() {_uniqueStorage()._smallNegativeFloat = nil} + + /// Text for nonfinite floating-point values. + var infDouble: Double { + get {return _storage._infDouble ?? Double.infinity} + set {_uniqueStorage()._infDouble = newValue} + } + /// Returns true if `infDouble` has been explicitly set. + var hasInfDouble: Bool {return _storage._infDouble != nil} + /// Clears the value of `infDouble`. Subsequent reads from it will return its default value. + mutating func clearInfDouble() {_uniqueStorage()._infDouble = nil} + + var negInfDouble: Double { + get {return _storage._negInfDouble ?? -Double.infinity} + set {_uniqueStorage()._negInfDouble = newValue} + } + /// Returns true if `negInfDouble` has been explicitly set. + var hasNegInfDouble: Bool {return _storage._negInfDouble != nil} + /// Clears the value of `negInfDouble`. Subsequent reads from it will return its default value. + mutating func clearNegInfDouble() {_uniqueStorage()._negInfDouble = nil} + + var nanDouble: Double { + get {return _storage._nanDouble ?? Double.nan} + set {_uniqueStorage()._nanDouble = newValue} + } + /// Returns true if `nanDouble` has been explicitly set. + var hasNanDouble: Bool {return _storage._nanDouble != nil} + /// Clears the value of `nanDouble`. Subsequent reads from it will return its default value. + mutating func clearNanDouble() {_uniqueStorage()._nanDouble = nil} + + var infFloat: Float { + get {return _storage._infFloat ?? Float.infinity} + set {_uniqueStorage()._infFloat = newValue} + } + /// Returns true if `infFloat` has been explicitly set. + var hasInfFloat: Bool {return _storage._infFloat != nil} + /// Clears the value of `infFloat`. Subsequent reads from it will return its default value. + mutating func clearInfFloat() {_uniqueStorage()._infFloat = nil} + + var negInfFloat: Float { + get {return _storage._negInfFloat ?? -Float.infinity} + set {_uniqueStorage()._negInfFloat = newValue} + } + /// Returns true if `negInfFloat` has been explicitly set. + var hasNegInfFloat: Bool {return _storage._negInfFloat != nil} + /// Clears the value of `negInfFloat`. Subsequent reads from it will return its default value. + mutating func clearNegInfFloat() {_uniqueStorage()._negInfFloat = nil} + + var nanFloat: Float { + get {return _storage._nanFloat ?? Float.nan} + set {_uniqueStorage()._nanFloat = newValue} + } + /// Returns true if `nanFloat` has been explicitly set. + var hasNanFloat: Bool {return _storage._nanFloat != nil} + /// Clears the value of `nanFloat`. Subsequent reads from it will return its default value. + mutating func clearNanFloat() {_uniqueStorage()._nanFloat = nil} + + /// Tests for C++ trigraphs. + /// Trigraphs should be escaped in C++ generated files, but they should not be + /// escaped for other languages. + /// Note that in .proto file, "\?" is a valid way to escape ? in string + /// literals. + var cppTrigraph: String { + get {return _storage._cppTrigraph ?? "? ? ?? ?? ??? ??/ ??-"} + set {_uniqueStorage()._cppTrigraph = newValue} + } + /// Returns true if `cppTrigraph` has been explicitly set. + var hasCppTrigraph: Bool {return _storage._cppTrigraph != nil} + /// Clears the value of `cppTrigraph`. Subsequent reads from it will return its default value. + mutating func clearCppTrigraph() {_uniqueStorage()._cppTrigraph = nil} + + /// String defaults containing the character '\000' + var stringWithZero: String { + get {return _storage._stringWithZero ?? "hel\0lo"} + set {_uniqueStorage()._stringWithZero = newValue} + } + /// Returns true if `stringWithZero` has been explicitly set. + var hasStringWithZero: Bool {return _storage._stringWithZero != nil} + /// Clears the value of `stringWithZero`. Subsequent reads from it will return its default value. + mutating func clearStringWithZero() {_uniqueStorage()._stringWithZero = nil} + + var bytesWithZero: Data { + get {return _storage._bytesWithZero ?? Data([119, 111, 114, 0, 108, 100])} + set {_uniqueStorage()._bytesWithZero = newValue} + } + /// Returns true if `bytesWithZero` has been explicitly set. + var hasBytesWithZero: Bool {return _storage._bytesWithZero != nil} + /// Clears the value of `bytesWithZero`. Subsequent reads from it will return its default value. + mutating func clearBytesWithZero() {_uniqueStorage()._bytesWithZero = nil} + + var stringPieceWithZero: String { + get {return _storage._stringPieceWithZero ?? "ab\0c"} + set {_uniqueStorage()._stringPieceWithZero = newValue} + } + /// Returns true if `stringPieceWithZero` has been explicitly set. + var hasStringPieceWithZero: Bool {return _storage._stringPieceWithZero != nil} + /// Clears the value of `stringPieceWithZero`. Subsequent reads from it will return its default value. + mutating func clearStringPieceWithZero() {_uniqueStorage()._stringPieceWithZero = nil} + + var cordWithZero: String { + get {return _storage._cordWithZero ?? "12\03"} + set {_uniqueStorage()._cordWithZero = newValue} + } + /// Returns true if `cordWithZero` has been explicitly set. + var hasCordWithZero: Bool {return _storage._cordWithZero != nil} + /// Clears the value of `cordWithZero`. Subsequent reads from it will return its default value. + mutating func clearCordWithZero() {_uniqueStorage()._cordWithZero = nil} + + var replacementString: String { + get {return _storage._replacementString ?? "${unknown}"} + set {_uniqueStorage()._replacementString = newValue} + } + /// Returns true if `replacementString` has been explicitly set. + var hasReplacementString: Bool {return _storage._replacementString != nil} + /// Clears the value of `replacementString`. Subsequent reads from it will return its default value. + mutating func clearReplacementString() {_uniqueStorage()._replacementString = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufUnittest_SparseEnumMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var sparseEnum: ProtobufUnittest_TestSparseEnum { + get {return _sparseEnum ?? .sparseA} + set {_sparseEnum = newValue} + } + /// Returns true if `sparseEnum` has been explicitly set. + var hasSparseEnum: Bool {return self._sparseEnum != nil} + /// Clears the value of `sparseEnum`. Subsequent reads from it will return its default value. + mutating func clearSparseEnum() {self._sparseEnum = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _sparseEnum: ProtobufUnittest_TestSparseEnum? = nil +} + +/// Test String and Bytes: string is for valid UTF-8 strings +struct ProtobufUnittest_OneString { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var data: String { + get {return _data ?? String()} + set {_data = newValue} + } + /// Returns true if `data` has been explicitly set. + var hasData: Bool {return self._data != nil} + /// Clears the value of `data`. Subsequent reads from it will return its default value. + mutating func clearData() {self._data = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _data: String? = nil +} + +struct ProtobufUnittest_MoreString { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var data: [String] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_OneBytes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var data: Data { + get {return _data ?? Data()} + set {_data = newValue} + } + /// Returns true if `data` has been explicitly set. + var hasData: Bool {return self._data != nil} + /// Clears the value of `data`. Subsequent reads from it will return its default value. + mutating func clearData() {self._data = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _data: Data? = nil +} + +struct ProtobufUnittest_MoreBytes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var data: [Data] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_ManyOptionalString { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var str1: String { + get {return _storage._str1 ?? String()} + set {_uniqueStorage()._str1 = newValue} + } + /// Returns true if `str1` has been explicitly set. + var hasStr1: Bool {return _storage._str1 != nil} + /// Clears the value of `str1`. Subsequent reads from it will return its default value. + mutating func clearStr1() {_uniqueStorage()._str1 = nil} + + var str2: String { + get {return _storage._str2 ?? String()} + set {_uniqueStorage()._str2 = newValue} + } + /// Returns true if `str2` has been explicitly set. + var hasStr2: Bool {return _storage._str2 != nil} + /// Clears the value of `str2`. Subsequent reads from it will return its default value. + mutating func clearStr2() {_uniqueStorage()._str2 = nil} + + var str3: String { + get {return _storage._str3 ?? String()} + set {_uniqueStorage()._str3 = newValue} + } + /// Returns true if `str3` has been explicitly set. + var hasStr3: Bool {return _storage._str3 != nil} + /// Clears the value of `str3`. Subsequent reads from it will return its default value. + mutating func clearStr3() {_uniqueStorage()._str3 = nil} + + var str4: String { + get {return _storage._str4 ?? String()} + set {_uniqueStorage()._str4 = newValue} + } + /// Returns true if `str4` has been explicitly set. + var hasStr4: Bool {return _storage._str4 != nil} + /// Clears the value of `str4`. Subsequent reads from it will return its default value. + mutating func clearStr4() {_uniqueStorage()._str4 = nil} + + var str5: String { + get {return _storage._str5 ?? String()} + set {_uniqueStorage()._str5 = newValue} + } + /// Returns true if `str5` has been explicitly set. + var hasStr5: Bool {return _storage._str5 != nil} + /// Clears the value of `str5`. Subsequent reads from it will return its default value. + mutating func clearStr5() {_uniqueStorage()._str5 = nil} + + var str6: String { + get {return _storage._str6 ?? String()} + set {_uniqueStorage()._str6 = newValue} + } + /// Returns true if `str6` has been explicitly set. + var hasStr6: Bool {return _storage._str6 != nil} + /// Clears the value of `str6`. Subsequent reads from it will return its default value. + mutating func clearStr6() {_uniqueStorage()._str6 = nil} + + var str7: String { + get {return _storage._str7 ?? String()} + set {_uniqueStorage()._str7 = newValue} + } + /// Returns true if `str7` has been explicitly set. + var hasStr7: Bool {return _storage._str7 != nil} + /// Clears the value of `str7`. Subsequent reads from it will return its default value. + mutating func clearStr7() {_uniqueStorage()._str7 = nil} + + var str8: String { + get {return _storage._str8 ?? String()} + set {_uniqueStorage()._str8 = newValue} + } + /// Returns true if `str8` has been explicitly set. + var hasStr8: Bool {return _storage._str8 != nil} + /// Clears the value of `str8`. Subsequent reads from it will return its default value. + mutating func clearStr8() {_uniqueStorage()._str8 = nil} + + var str9: String { + get {return _storage._str9 ?? String()} + set {_uniqueStorage()._str9 = newValue} + } + /// Returns true if `str9` has been explicitly set. + var hasStr9: Bool {return _storage._str9 != nil} + /// Clears the value of `str9`. Subsequent reads from it will return its default value. + mutating func clearStr9() {_uniqueStorage()._str9 = nil} + + var str10: String { + get {return _storage._str10 ?? String()} + set {_uniqueStorage()._str10 = newValue} + } + /// Returns true if `str10` has been explicitly set. + var hasStr10: Bool {return _storage._str10 != nil} + /// Clears the value of `str10`. Subsequent reads from it will return its default value. + mutating func clearStr10() {_uniqueStorage()._str10 = nil} + + var str11: String { + get {return _storage._str11 ?? String()} + set {_uniqueStorage()._str11 = newValue} + } + /// Returns true if `str11` has been explicitly set. + var hasStr11: Bool {return _storage._str11 != nil} + /// Clears the value of `str11`. Subsequent reads from it will return its default value. + mutating func clearStr11() {_uniqueStorage()._str11 = nil} + + var str12: String { + get {return _storage._str12 ?? String()} + set {_uniqueStorage()._str12 = newValue} + } + /// Returns true if `str12` has been explicitly set. + var hasStr12: Bool {return _storage._str12 != nil} + /// Clears the value of `str12`. Subsequent reads from it will return its default value. + mutating func clearStr12() {_uniqueStorage()._str12 = nil} + + var str13: String { + get {return _storage._str13 ?? String()} + set {_uniqueStorage()._str13 = newValue} + } + /// Returns true if `str13` has been explicitly set. + var hasStr13: Bool {return _storage._str13 != nil} + /// Clears the value of `str13`. Subsequent reads from it will return its default value. + mutating func clearStr13() {_uniqueStorage()._str13 = nil} + + var str14: String { + get {return _storage._str14 ?? String()} + set {_uniqueStorage()._str14 = newValue} + } + /// Returns true if `str14` has been explicitly set. + var hasStr14: Bool {return _storage._str14 != nil} + /// Clears the value of `str14`. Subsequent reads from it will return its default value. + mutating func clearStr14() {_uniqueStorage()._str14 = nil} + + var str15: String { + get {return _storage._str15 ?? String()} + set {_uniqueStorage()._str15 = newValue} + } + /// Returns true if `str15` has been explicitly set. + var hasStr15: Bool {return _storage._str15 != nil} + /// Clears the value of `str15`. Subsequent reads from it will return its default value. + mutating func clearStr15() {_uniqueStorage()._str15 = nil} + + var str16: String { + get {return _storage._str16 ?? String()} + set {_uniqueStorage()._str16 = newValue} + } + /// Returns true if `str16` has been explicitly set. + var hasStr16: Bool {return _storage._str16 != nil} + /// Clears the value of `str16`. Subsequent reads from it will return its default value. + mutating func clearStr16() {_uniqueStorage()._str16 = nil} + + var str17: String { + get {return _storage._str17 ?? String()} + set {_uniqueStorage()._str17 = newValue} + } + /// Returns true if `str17` has been explicitly set. + var hasStr17: Bool {return _storage._str17 != nil} + /// Clears the value of `str17`. Subsequent reads from it will return its default value. + mutating func clearStr17() {_uniqueStorage()._str17 = nil} + + var str18: String { + get {return _storage._str18 ?? String()} + set {_uniqueStorage()._str18 = newValue} + } + /// Returns true if `str18` has been explicitly set. + var hasStr18: Bool {return _storage._str18 != nil} + /// Clears the value of `str18`. Subsequent reads from it will return its default value. + mutating func clearStr18() {_uniqueStorage()._str18 = nil} + + var str19: String { + get {return _storage._str19 ?? String()} + set {_uniqueStorage()._str19 = newValue} + } + /// Returns true if `str19` has been explicitly set. + var hasStr19: Bool {return _storage._str19 != nil} + /// Clears the value of `str19`. Subsequent reads from it will return its default value. + mutating func clearStr19() {_uniqueStorage()._str19 = nil} + + var str20: String { + get {return _storage._str20 ?? String()} + set {_uniqueStorage()._str20 = newValue} + } + /// Returns true if `str20` has been explicitly set. + var hasStr20: Bool {return _storage._str20 != nil} + /// Clears the value of `str20`. Subsequent reads from it will return its default value. + mutating func clearStr20() {_uniqueStorage()._str20 = nil} + + var str21: String { + get {return _storage._str21 ?? String()} + set {_uniqueStorage()._str21 = newValue} + } + /// Returns true if `str21` has been explicitly set. + var hasStr21: Bool {return _storage._str21 != nil} + /// Clears the value of `str21`. Subsequent reads from it will return its default value. + mutating func clearStr21() {_uniqueStorage()._str21 = nil} + + var str22: String { + get {return _storage._str22 ?? String()} + set {_uniqueStorage()._str22 = newValue} + } + /// Returns true if `str22` has been explicitly set. + var hasStr22: Bool {return _storage._str22 != nil} + /// Clears the value of `str22`. Subsequent reads from it will return its default value. + mutating func clearStr22() {_uniqueStorage()._str22 = nil} + + var str23: String { + get {return _storage._str23 ?? String()} + set {_uniqueStorage()._str23 = newValue} + } + /// Returns true if `str23` has been explicitly set. + var hasStr23: Bool {return _storage._str23 != nil} + /// Clears the value of `str23`. Subsequent reads from it will return its default value. + mutating func clearStr23() {_uniqueStorage()._str23 = nil} + + var str24: String { + get {return _storage._str24 ?? String()} + set {_uniqueStorage()._str24 = newValue} + } + /// Returns true if `str24` has been explicitly set. + var hasStr24: Bool {return _storage._str24 != nil} + /// Clears the value of `str24`. Subsequent reads from it will return its default value. + mutating func clearStr24() {_uniqueStorage()._str24 = nil} + + var str25: String { + get {return _storage._str25 ?? String()} + set {_uniqueStorage()._str25 = newValue} + } + /// Returns true if `str25` has been explicitly set. + var hasStr25: Bool {return _storage._str25 != nil} + /// Clears the value of `str25`. Subsequent reads from it will return its default value. + mutating func clearStr25() {_uniqueStorage()._str25 = nil} + + var str26: String { + get {return _storage._str26 ?? String()} + set {_uniqueStorage()._str26 = newValue} + } + /// Returns true if `str26` has been explicitly set. + var hasStr26: Bool {return _storage._str26 != nil} + /// Clears the value of `str26`. Subsequent reads from it will return its default value. + mutating func clearStr26() {_uniqueStorage()._str26 = nil} + + var str27: String { + get {return _storage._str27 ?? String()} + set {_uniqueStorage()._str27 = newValue} + } + /// Returns true if `str27` has been explicitly set. + var hasStr27: Bool {return _storage._str27 != nil} + /// Clears the value of `str27`. Subsequent reads from it will return its default value. + mutating func clearStr27() {_uniqueStorage()._str27 = nil} + + var str28: String { + get {return _storage._str28 ?? String()} + set {_uniqueStorage()._str28 = newValue} + } + /// Returns true if `str28` has been explicitly set. + var hasStr28: Bool {return _storage._str28 != nil} + /// Clears the value of `str28`. Subsequent reads from it will return its default value. + mutating func clearStr28() {_uniqueStorage()._str28 = nil} + + var str29: String { + get {return _storage._str29 ?? String()} + set {_uniqueStorage()._str29 = newValue} + } + /// Returns true if `str29` has been explicitly set. + var hasStr29: Bool {return _storage._str29 != nil} + /// Clears the value of `str29`. Subsequent reads from it will return its default value. + mutating func clearStr29() {_uniqueStorage()._str29 = nil} + + var str30: String { + get {return _storage._str30 ?? String()} + set {_uniqueStorage()._str30 = newValue} + } + /// Returns true if `str30` has been explicitly set. + var hasStr30: Bool {return _storage._str30 != nil} + /// Clears the value of `str30`. Subsequent reads from it will return its default value. + mutating func clearStr30() {_uniqueStorage()._str30 = nil} + + var str31: String { + get {return _storage._str31 ?? String()} + set {_uniqueStorage()._str31 = newValue} + } + /// Returns true if `str31` has been explicitly set. + var hasStr31: Bool {return _storage._str31 != nil} + /// Clears the value of `str31`. Subsequent reads from it will return its default value. + mutating func clearStr31() {_uniqueStorage()._str31 = nil} + + var str32: String { + get {return _storage._str32 ?? String()} + set {_uniqueStorage()._str32 = newValue} + } + /// Returns true if `str32` has been explicitly set. + var hasStr32: Bool {return _storage._str32 != nil} + /// Clears the value of `str32`. Subsequent reads from it will return its default value. + mutating func clearStr32() {_uniqueStorage()._str32 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +/// Test int32, uint32, int64, uint64, and bool are all compatible +struct ProtobufUnittest_Int32Message { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var data: Int32 { + get {return _data ?? 0} + set {_data = newValue} + } + /// Returns true if `data` has been explicitly set. + var hasData: Bool {return self._data != nil} + /// Clears the value of `data`. Subsequent reads from it will return its default value. + mutating func clearData() {self._data = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _data: Int32? = nil +} + +struct ProtobufUnittest_Uint32Message { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var data: UInt32 { + get {return _data ?? 0} + set {_data = newValue} + } + /// Returns true if `data` has been explicitly set. + var hasData: Bool {return self._data != nil} + /// Clears the value of `data`. Subsequent reads from it will return its default value. + mutating func clearData() {self._data = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _data: UInt32? = nil +} + +struct ProtobufUnittest_Int64Message { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var data: Int64 { + get {return _data ?? 0} + set {_data = newValue} + } + /// Returns true if `data` has been explicitly set. + var hasData: Bool {return self._data != nil} + /// Clears the value of `data`. Subsequent reads from it will return its default value. + mutating func clearData() {self._data = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _data: Int64? = nil +} + +struct ProtobufUnittest_Uint64Message { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var data: UInt64 { + get {return _data ?? 0} + set {_data = newValue} + } + /// Returns true if `data` has been explicitly set. + var hasData: Bool {return self._data != nil} + /// Clears the value of `data`. Subsequent reads from it will return its default value. + mutating func clearData() {self._data = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _data: UInt64? = nil +} + +struct ProtobufUnittest_BoolMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var data: Bool { + get {return _data ?? false} + set {_data = newValue} + } + /// Returns true if `data` has been explicitly set. + var hasData: Bool {return self._data != nil} + /// Clears the value of `data`. Subsequent reads from it will return its default value. + mutating func clearData() {self._data = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _data: Bool? = nil +} + +/// Test oneofs. +struct ProtobufUnittest_TestOneof { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var foo: ProtobufUnittest_TestOneof.OneOf_Foo? = nil + + var fooInt: Int32 { + get { + if case .fooInt(let v)? = foo {return v} + return 0 + } + set {foo = .fooInt(newValue)} + } + + var fooString: String { + get { + if case .fooString(let v)? = foo {return v} + return String() + } + set {foo = .fooString(newValue)} + } + + var fooMessage: ProtobufUnittest_TestAllTypes { + get { + if case .fooMessage(let v)? = foo {return v} + return ProtobufUnittest_TestAllTypes() + } + set {foo = .fooMessage(newValue)} + } + + var fooGroup: ProtobufUnittest_TestOneof.FooGroup { + get { + if case .fooGroup(let v)? = foo {return v} + return ProtobufUnittest_TestOneof.FooGroup() + } + set {foo = .fooGroup(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_Foo: Equatable { + case fooInt(Int32) + case fooString(String) + case fooMessage(ProtobufUnittest_TestAllTypes) + case fooGroup(ProtobufUnittest_TestOneof.FooGroup) + + } + + struct FooGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var b: String { + get {return _b ?? String()} + set {_b = newValue} + } + /// Returns true if `b` has been explicitly set. + var hasB: Bool {return self._b != nil} + /// Clears the value of `b`. Subsequent reads from it will return its default value. + mutating func clearB() {self._b = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + fileprivate var _b: String? = nil + } + + init() {} +} + +struct ProtobufUnittest_TestOneofBackwardsCompatible { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var fooInt: Int32 { + get {return _fooInt ?? 0} + set {_fooInt = newValue} + } + /// Returns true if `fooInt` has been explicitly set. + var hasFooInt: Bool {return self._fooInt != nil} + /// Clears the value of `fooInt`. Subsequent reads from it will return its default value. + mutating func clearFooInt() {self._fooInt = nil} + + var fooString: String { + get {return _fooString ?? String()} + set {_fooString = newValue} + } + /// Returns true if `fooString` has been explicitly set. + var hasFooString: Bool {return self._fooString != nil} + /// Clears the value of `fooString`. Subsequent reads from it will return its default value. + mutating func clearFooString() {self._fooString = nil} + + var fooMessage: ProtobufUnittest_TestAllTypes { + get {return _fooMessage ?? ProtobufUnittest_TestAllTypes()} + set {_fooMessage = newValue} + } + /// Returns true if `fooMessage` has been explicitly set. + var hasFooMessage: Bool {return self._fooMessage != nil} + /// Clears the value of `fooMessage`. Subsequent reads from it will return its default value. + mutating func clearFooMessage() {self._fooMessage = nil} + + var fooGroup: ProtobufUnittest_TestOneofBackwardsCompatible.FooGroup { + get {return _fooGroup ?? ProtobufUnittest_TestOneofBackwardsCompatible.FooGroup()} + set {_fooGroup = newValue} + } + /// Returns true if `fooGroup` has been explicitly set. + var hasFooGroup: Bool {return self._fooGroup != nil} + /// Clears the value of `fooGroup`. Subsequent reads from it will return its default value. + mutating func clearFooGroup() {self._fooGroup = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct FooGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var b: String { + get {return _b ?? String()} + set {_b = newValue} + } + /// Returns true if `b` has been explicitly set. + var hasB: Bool {return self._b != nil} + /// Clears the value of `b`. Subsequent reads from it will return its default value. + mutating func clearB() {self._b = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + fileprivate var _b: String? = nil + } + + init() {} + + fileprivate var _fooInt: Int32? = nil + fileprivate var _fooString: String? = nil + fileprivate var _fooMessage: ProtobufUnittest_TestAllTypes? = nil + fileprivate var _fooGroup: ProtobufUnittest_TestOneofBackwardsCompatible.FooGroup? = nil +} + +struct ProtobufUnittest_TestOneof2 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var foo: ProtobufUnittest_TestOneof2.OneOf_Foo? = nil + + var fooInt: Int32 { + get { + if case .fooInt(let v)? = foo {return v} + return 0 + } + set {foo = .fooInt(newValue)} + } + + var fooString: String { + get { + if case .fooString(let v)? = foo {return v} + return String() + } + set {foo = .fooString(newValue)} + } + + var fooCord: String { + get { + if case .fooCord(let v)? = foo {return v} + return String() + } + set {foo = .fooCord(newValue)} + } + + var fooStringPiece: String { + get { + if case .fooStringPiece(let v)? = foo {return v} + return String() + } + set {foo = .fooStringPiece(newValue)} + } + + var fooBytes: Data { + get { + if case .fooBytes(let v)? = foo {return v} + return Data() + } + set {foo = .fooBytes(newValue)} + } + + var fooEnum: ProtobufUnittest_TestOneof2.NestedEnum { + get { + if case .fooEnum(let v)? = foo {return v} + return .foo + } + set {foo = .fooEnum(newValue)} + } + + var fooMessage: ProtobufUnittest_TestOneof2.NestedMessage { + get { + if case .fooMessage(let v)? = foo {return v} + return ProtobufUnittest_TestOneof2.NestedMessage() + } + set {foo = .fooMessage(newValue)} + } + + var fooGroup: ProtobufUnittest_TestOneof2.FooGroup { + get { + if case .fooGroup(let v)? = foo {return v} + return ProtobufUnittest_TestOneof2.FooGroup() + } + set {foo = .fooGroup(newValue)} + } + + var fooLazyMessage: ProtobufUnittest_TestOneof2.NestedMessage { + get { + if case .fooLazyMessage(let v)? = foo {return v} + return ProtobufUnittest_TestOneof2.NestedMessage() + } + set {foo = .fooLazyMessage(newValue)} + } + + var fooBytesCord: Data { + get { + if case .fooBytesCord(let v)? = foo {return v} + return Data() + } + set {foo = .fooBytesCord(newValue)} + } + + var bar: ProtobufUnittest_TestOneof2.OneOf_Bar? = nil + + var barInt: Int32 { + get { + if case .barInt(let v)? = bar {return v} + return 5 + } + set {bar = .barInt(newValue)} + } + + var barString: String { + get { + if case .barString(let v)? = bar {return v} + return "STRING" + } + set {bar = .barString(newValue)} + } + + var barCord: String { + get { + if case .barCord(let v)? = bar {return v} + return "CORD" + } + set {bar = .barCord(newValue)} + } + + var barStringPiece: String { + get { + if case .barStringPiece(let v)? = bar {return v} + return "SPIECE" + } + set {bar = .barStringPiece(newValue)} + } + + var barBytes: Data { + get { + if case .barBytes(let v)? = bar {return v} + return Data([66, 89, 84, 69, 83]) + } + set {bar = .barBytes(newValue)} + } + + var barEnum: ProtobufUnittest_TestOneof2.NestedEnum { + get { + if case .barEnum(let v)? = bar {return v} + return .bar + } + set {bar = .barEnum(newValue)} + } + + var barStringWithEmptyDefault: String { + get { + if case .barStringWithEmptyDefault(let v)? = bar {return v} + return String() + } + set {bar = .barStringWithEmptyDefault(newValue)} + } + + var barCordWithEmptyDefault: String { + get { + if case .barCordWithEmptyDefault(let v)? = bar {return v} + return String() + } + set {bar = .barCordWithEmptyDefault(newValue)} + } + + var barStringPieceWithEmptyDefault: String { + get { + if case .barStringPieceWithEmptyDefault(let v)? = bar {return v} + return String() + } + set {bar = .barStringPieceWithEmptyDefault(newValue)} + } + + var barBytesWithEmptyDefault: Data { + get { + if case .barBytesWithEmptyDefault(let v)? = bar {return v} + return Data() + } + set {bar = .barBytesWithEmptyDefault(newValue)} + } + + var bazInt: Int32 { + get {return _bazInt ?? 0} + set {_bazInt = newValue} + } + /// Returns true if `bazInt` has been explicitly set. + var hasBazInt: Bool {return self._bazInt != nil} + /// Clears the value of `bazInt`. Subsequent reads from it will return its default value. + mutating func clearBazInt() {self._bazInt = nil} + + var bazString: String { + get {return _bazString ?? "BAZ"} + set {_bazString = newValue} + } + /// Returns true if `bazString` has been explicitly set. + var hasBazString: Bool {return self._bazString != nil} + /// Clears the value of `bazString`. Subsequent reads from it will return its default value. + mutating func clearBazString() {self._bazString = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_Foo: Equatable { + case fooInt(Int32) + case fooString(String) + case fooCord(String) + case fooStringPiece(String) + case fooBytes(Data) + case fooEnum(ProtobufUnittest_TestOneof2.NestedEnum) + case fooMessage(ProtobufUnittest_TestOneof2.NestedMessage) + case fooGroup(ProtobufUnittest_TestOneof2.FooGroup) + case fooLazyMessage(ProtobufUnittest_TestOneof2.NestedMessage) + case fooBytesCord(Data) + + } + + enum OneOf_Bar: Equatable { + case barInt(Int32) + case barString(String) + case barCord(String) + case barStringPiece(String) + case barBytes(Data) + case barEnum(ProtobufUnittest_TestOneof2.NestedEnum) + case barStringWithEmptyDefault(String) + case barCordWithEmptyDefault(String) + case barStringPieceWithEmptyDefault(String) + case barBytesWithEmptyDefault(Data) + + } + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 1 + case bar // = 2 + case baz // = 3 + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case 1: self = .foo + case 2: self = .bar + case 3: self = .baz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .foo: return 1 + case .bar: return 2 + case .baz: return 3 + } + } + + } + + struct FooGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var b: String { + get {return _b ?? String()} + set {_b = newValue} + } + /// Returns true if `b` has been explicitly set. + var hasB: Bool {return self._b != nil} + /// Clears the value of `b`. Subsequent reads from it will return its default value. + mutating func clearB() {self._b = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + fileprivate var _b: String? = nil + } + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var mooInt: Int64 { + get {return _mooInt ?? 0} + set {_mooInt = newValue} + } + /// Returns true if `mooInt` has been explicitly set. + var hasMooInt: Bool {return self._mooInt != nil} + /// Clears the value of `mooInt`. Subsequent reads from it will return its default value. + mutating func clearMooInt() {self._mooInt = nil} + + var corgeInt: [Int32] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _mooInt: Int64? = nil + } + + init() {} + + fileprivate var _bazInt: Int32? = nil + fileprivate var _bazString: String? = nil +} + +struct ProtobufUnittest_TestRequiredOneof { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var foo: ProtobufUnittest_TestRequiredOneof.OneOf_Foo? = nil + + var fooInt: Int32 { + get { + if case .fooInt(let v)? = foo {return v} + return 0 + } + set {foo = .fooInt(newValue)} + } + + var fooString: String { + get { + if case .fooString(let v)? = foo {return v} + return String() + } + set {foo = .fooString(newValue)} + } + + var fooMessage: ProtobufUnittest_TestRequiredOneof.NestedMessage { + get { + if case .fooMessage(let v)? = foo {return v} + return ProtobufUnittest_TestRequiredOneof.NestedMessage() + } + set {foo = .fooMessage(newValue)} + } + + var fooLazyMessage: ProtobufUnittest_TestRequiredOneof.NestedMessage { + get { + if case .fooLazyMessage(let v)? = foo {return v} + return ProtobufUnittest_TestRequiredOneof.NestedMessage() + } + set {foo = .fooLazyMessage(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_Foo: Equatable { + case fooInt(Int32) + case fooString(String) + case fooMessage(ProtobufUnittest_TestRequiredOneof.NestedMessage) + case fooLazyMessage(ProtobufUnittest_TestRequiredOneof.NestedMessage) + + fileprivate var isInitialized: Bool { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch self { + case .fooMessage: return { + guard case .fooMessage(let v) = self else { preconditionFailure() } + return v.isInitialized + }() + case .fooLazyMessage: return { + guard case .fooLazyMessage(let v) = self else { preconditionFailure() } + return v.isInitialized + }() + default: return true + } + } + + } + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var requiredDouble: Double { + get {return _requiredDouble ?? 0} + set {_requiredDouble = newValue} + } + /// Returns true if `requiredDouble` has been explicitly set. + var hasRequiredDouble: Bool {return self._requiredDouble != nil} + /// Clears the value of `requiredDouble`. Subsequent reads from it will return its default value. + mutating func clearRequiredDouble() {self._requiredDouble = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _requiredDouble: Double? = nil + } + + init() {} +} + +struct ProtobufUnittest_TestPackedTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var packedInt32: [Int32] = [] + + var packedInt64: [Int64] = [] + + var packedUint32: [UInt32] = [] + + var packedUint64: [UInt64] = [] + + var packedSint32: [Int32] = [] + + var packedSint64: [Int64] = [] + + var packedFixed32: [UInt32] = [] + + var packedFixed64: [UInt64] = [] + + var packedSfixed32: [Int32] = [] + + var packedSfixed64: [Int64] = [] + + var packedFloat: [Float] = [] + + var packedDouble: [Double] = [] + + var packedBool: [Bool] = [] + + var packedEnum: [ProtobufUnittest_ForeignEnum] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// A message with the same fields as TestPackedTypes, but without packing. Used +/// to test packed <-> unpacked wire compatibility. +struct ProtobufUnittest_TestUnpackedTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unpackedInt32: [Int32] = [] + + var unpackedInt64: [Int64] = [] + + var unpackedUint32: [UInt32] = [] + + var unpackedUint64: [UInt64] = [] + + var unpackedSint32: [Int32] = [] + + var unpackedSint64: [Int64] = [] + + var unpackedFixed32: [UInt32] = [] + + var unpackedFixed64: [UInt64] = [] + + var unpackedSfixed32: [Int32] = [] + + var unpackedSfixed64: [Int64] = [] + + var unpackedFloat: [Float] = [] + + var unpackedDouble: [Double] = [] + + var unpackedBool: [Bool] = [] + + var unpackedEnum: [ProtobufUnittest_ForeignEnum] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_TestPackedExtensions: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() +} + +struct ProtobufUnittest_TestUnpackedExtensions: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() +} + +/// Used by ExtensionSetTest/DynamicExtensions. The test actually builds +/// a set of extensions to TestAllExtensions dynamically, based on the fields +/// of this message type. +struct ProtobufUnittest_TestDynamicExtensions { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var scalarExtension: UInt32 { + get {return _scalarExtension ?? 0} + set {_scalarExtension = newValue} + } + /// Returns true if `scalarExtension` has been explicitly set. + var hasScalarExtension: Bool {return self._scalarExtension != nil} + /// Clears the value of `scalarExtension`. Subsequent reads from it will return its default value. + mutating func clearScalarExtension() {self._scalarExtension = nil} + + var enumExtension: ProtobufUnittest_ForeignEnum { + get {return _enumExtension ?? .foreignFoo} + set {_enumExtension = newValue} + } + /// Returns true if `enumExtension` has been explicitly set. + var hasEnumExtension: Bool {return self._enumExtension != nil} + /// Clears the value of `enumExtension`. Subsequent reads from it will return its default value. + mutating func clearEnumExtension() {self._enumExtension = nil} + + var dynamicEnumExtension: ProtobufUnittest_TestDynamicExtensions.DynamicEnumType { + get {return _dynamicEnumExtension ?? .dynamicFoo} + set {_dynamicEnumExtension = newValue} + } + /// Returns true if `dynamicEnumExtension` has been explicitly set. + var hasDynamicEnumExtension: Bool {return self._dynamicEnumExtension != nil} + /// Clears the value of `dynamicEnumExtension`. Subsequent reads from it will return its default value. + mutating func clearDynamicEnumExtension() {self._dynamicEnumExtension = nil} + + var messageExtension: ProtobufUnittest_ForeignMessage { + get {return _messageExtension ?? ProtobufUnittest_ForeignMessage()} + set {_messageExtension = newValue} + } + /// Returns true if `messageExtension` has been explicitly set. + var hasMessageExtension: Bool {return self._messageExtension != nil} + /// Clears the value of `messageExtension`. Subsequent reads from it will return its default value. + mutating func clearMessageExtension() {self._messageExtension = nil} + + var dynamicMessageExtension: ProtobufUnittest_TestDynamicExtensions.DynamicMessageType { + get {return _dynamicMessageExtension ?? ProtobufUnittest_TestDynamicExtensions.DynamicMessageType()} + set {_dynamicMessageExtension = newValue} + } + /// Returns true if `dynamicMessageExtension` has been explicitly set. + var hasDynamicMessageExtension: Bool {return self._dynamicMessageExtension != nil} + /// Clears the value of `dynamicMessageExtension`. Subsequent reads from it will return its default value. + mutating func clearDynamicMessageExtension() {self._dynamicMessageExtension = nil} + + var repeatedExtension: [String] = [] + + var packedExtension: [Int32] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum DynamicEnumType: SwiftProtobuf.Enum { + typealias RawValue = Int + case dynamicFoo // = 2200 + case dynamicBar // = 2201 + case dynamicBaz // = 2202 + + init() { + self = .dynamicFoo + } + + init?(rawValue: Int) { + switch rawValue { + case 2200: self = .dynamicFoo + case 2201: self = .dynamicBar + case 2202: self = .dynamicBaz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .dynamicFoo: return 2200 + case .dynamicBar: return 2201 + case .dynamicBaz: return 2202 + } + } + + } + + struct DynamicMessageType { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var dynamicField: Int32 { + get {return _dynamicField ?? 0} + set {_dynamicField = newValue} + } + /// Returns true if `dynamicField` has been explicitly set. + var hasDynamicField: Bool {return self._dynamicField != nil} + /// Clears the value of `dynamicField`. Subsequent reads from it will return its default value. + mutating func clearDynamicField() {self._dynamicField = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _dynamicField: Int32? = nil + } + + init() {} + + fileprivate var _scalarExtension: UInt32? = nil + fileprivate var _enumExtension: ProtobufUnittest_ForeignEnum? = nil + fileprivate var _dynamicEnumExtension: ProtobufUnittest_TestDynamicExtensions.DynamicEnumType? = nil + fileprivate var _messageExtension: ProtobufUnittest_ForeignMessage? = nil + fileprivate var _dynamicMessageExtension: ProtobufUnittest_TestDynamicExtensions.DynamicMessageType? = nil +} + +struct ProtobufUnittest_TestRepeatedString { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var repeatedString1: [String] = [] + + var repeatedString2: [String] = [] + + var repeatedBytes11: [Data] = [] + + var repeatedBytes12: [Data] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_TestRepeatedScalarDifferentTagSizes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Parsing repeated fixed size values used to fail. This message needs to be + /// used in order to get a tag of the right size; all of the repeated fields + /// in TestAllTypes didn't trigger the check. + var repeatedFixed32: [UInt32] = [] + + /// Check for a varint type, just for good measure. + var repeatedInt32: [Int32] = [] + + /// These have two-byte tags. + var repeatedFixed64: [UInt64] = [] + + var repeatedInt64: [Int64] = [] + + /// Three byte tags. + var repeatedFloat: [Float] = [] + + var repeatedUint64: [UInt64] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Test that if an optional or required message/group field appears multiple +/// times in the input, they need to be merged. +struct ProtobufUnittest_TestParsingMerge: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var requiredAllTypes: ProtobufUnittest_TestAllTypes { + get {return _requiredAllTypes ?? ProtobufUnittest_TestAllTypes()} + set {_requiredAllTypes = newValue} + } + /// Returns true if `requiredAllTypes` has been explicitly set. + var hasRequiredAllTypes: Bool {return self._requiredAllTypes != nil} + /// Clears the value of `requiredAllTypes`. Subsequent reads from it will return its default value. + mutating func clearRequiredAllTypes() {self._requiredAllTypes = nil} + + var optionalAllTypes: ProtobufUnittest_TestAllTypes { + get {return _optionalAllTypes ?? ProtobufUnittest_TestAllTypes()} + set {_optionalAllTypes = newValue} + } + /// Returns true if `optionalAllTypes` has been explicitly set. + var hasOptionalAllTypes: Bool {return self._optionalAllTypes != nil} + /// Clears the value of `optionalAllTypes`. Subsequent reads from it will return its default value. + mutating func clearOptionalAllTypes() {self._optionalAllTypes = nil} + + var repeatedAllTypes: [ProtobufUnittest_TestAllTypes] = [] + + var optionalGroup: ProtobufUnittest_TestParsingMerge.OptionalGroup { + get {return _optionalGroup ?? ProtobufUnittest_TestParsingMerge.OptionalGroup()} + set {_optionalGroup = newValue} + } + /// Returns true if `optionalGroup` has been explicitly set. + var hasOptionalGroup: Bool {return self._optionalGroup != nil} + /// Clears the value of `optionalGroup`. Subsequent reads from it will return its default value. + mutating func clearOptionalGroup() {self._optionalGroup = nil} + + var repeatedGroup: [ProtobufUnittest_TestParsingMerge.RepeatedGroup] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + /// RepeatedFieldsGenerator defines matching field types as TestParsingMerge, + /// except that all fields are repeated. In the tests, we will serialize the + /// RepeatedFieldsGenerator to bytes, and parse the bytes to TestParsingMerge. + /// Repeated fields in RepeatedFieldsGenerator are expected to be merged into + /// the corresponding required/optional fields in TestParsingMerge. + struct RepeatedFieldsGenerator { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var field1: [ProtobufUnittest_TestAllTypes] = [] + + var field2: [ProtobufUnittest_TestAllTypes] = [] + + var field3: [ProtobufUnittest_TestAllTypes] = [] + + var group1: [ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator.Group1] = [] + + var group2: [ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator.Group2] = [] + + var ext1: [ProtobufUnittest_TestAllTypes] = [] + + var ext2: [ProtobufUnittest_TestAllTypes] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct Group1 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var field1: ProtobufUnittest_TestAllTypes { + get {return _field1 ?? ProtobufUnittest_TestAllTypes()} + set {_field1 = newValue} + } + /// Returns true if `field1` has been explicitly set. + var hasField1: Bool {return self._field1 != nil} + /// Clears the value of `field1`. Subsequent reads from it will return its default value. + mutating func clearField1() {self._field1 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _field1: ProtobufUnittest_TestAllTypes? = nil + } + + struct Group2 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var field1: ProtobufUnittest_TestAllTypes { + get {return _field1 ?? ProtobufUnittest_TestAllTypes()} + set {_field1 = newValue} + } + /// Returns true if `field1` has been explicitly set. + var hasField1: Bool {return self._field1 != nil} + /// Clears the value of `field1`. Subsequent reads from it will return its default value. + mutating func clearField1() {self._field1 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _field1: ProtobufUnittest_TestAllTypes? = nil + } + + init() {} + } + + struct OptionalGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalGroupAllTypes: ProtobufUnittest_TestAllTypes { + get {return _optionalGroupAllTypes ?? ProtobufUnittest_TestAllTypes()} + set {_optionalGroupAllTypes = newValue} + } + /// Returns true if `optionalGroupAllTypes` has been explicitly set. + var hasOptionalGroupAllTypes: Bool {return self._optionalGroupAllTypes != nil} + /// Clears the value of `optionalGroupAllTypes`. Subsequent reads from it will return its default value. + mutating func clearOptionalGroupAllTypes() {self._optionalGroupAllTypes = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalGroupAllTypes: ProtobufUnittest_TestAllTypes? = nil + } + + struct RepeatedGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var repeatedGroupAllTypes: ProtobufUnittest_TestAllTypes { + get {return _repeatedGroupAllTypes ?? ProtobufUnittest_TestAllTypes()} + set {_repeatedGroupAllTypes = newValue} + } + /// Returns true if `repeatedGroupAllTypes` has been explicitly set. + var hasRepeatedGroupAllTypes: Bool {return self._repeatedGroupAllTypes != nil} + /// Clears the value of `repeatedGroupAllTypes`. Subsequent reads from it will return its default value. + mutating func clearRepeatedGroupAllTypes() {self._repeatedGroupAllTypes = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _repeatedGroupAllTypes: ProtobufUnittest_TestAllTypes? = nil + } + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _requiredAllTypes: ProtobufUnittest_TestAllTypes? = nil + fileprivate var _optionalAllTypes: ProtobufUnittest_TestAllTypes? = nil + fileprivate var _optionalGroup: ProtobufUnittest_TestParsingMerge.OptionalGroup? = nil +} + +/// Test that the correct exception is thrown by parseFrom in a corner case +/// involving merging, extensions, and required fields. +struct ProtobufUnittest_TestMergeException { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var allExtensions: ProtobufUnittest_TestAllExtensions { + get {return _allExtensions ?? ProtobufUnittest_TestAllExtensions()} + set {_allExtensions = newValue} + } + /// Returns true if `allExtensions` has been explicitly set. + var hasAllExtensions: Bool {return self._allExtensions != nil} + /// Clears the value of `allExtensions`. Subsequent reads from it will return its default value. + mutating func clearAllExtensions() {self._allExtensions = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _allExtensions: ProtobufUnittest_TestAllExtensions? = nil +} + +struct ProtobufUnittest_TestCommentInjectionMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// */ <- This should not close the generated doc comment + var a: String { + get {return _a ?? "*/ <- Neither should this."} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: String? = nil +} + +/// Used to check that the c++ code generator re-orders messages to reduce +/// padding. +struct ProtobufUnittest_TestMessageSize { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var m1: Bool { + get {return _m1 ?? false} + set {_m1 = newValue} + } + /// Returns true if `m1` has been explicitly set. + var hasM1: Bool {return self._m1 != nil} + /// Clears the value of `m1`. Subsequent reads from it will return its default value. + mutating func clearM1() {self._m1 = nil} + + var m2: Int64 { + get {return _m2 ?? 0} + set {_m2 = newValue} + } + /// Returns true if `m2` has been explicitly set. + var hasM2: Bool {return self._m2 != nil} + /// Clears the value of `m2`. Subsequent reads from it will return its default value. + mutating func clearM2() {self._m2 = nil} + + var m3: Bool { + get {return _m3 ?? false} + set {_m3 = newValue} + } + /// Returns true if `m3` has been explicitly set. + var hasM3: Bool {return self._m3 != nil} + /// Clears the value of `m3`. Subsequent reads from it will return its default value. + mutating func clearM3() {self._m3 = nil} + + var m4: String { + get {return _m4 ?? String()} + set {_m4 = newValue} + } + /// Returns true if `m4` has been explicitly set. + var hasM4: Bool {return self._m4 != nil} + /// Clears the value of `m4`. Subsequent reads from it will return its default value. + mutating func clearM4() {self._m4 = nil} + + var m5: Int32 { + get {return _m5 ?? 0} + set {_m5 = newValue} + } + /// Returns true if `m5` has been explicitly set. + var hasM5: Bool {return self._m5 != nil} + /// Clears the value of `m5`. Subsequent reads from it will return its default value. + mutating func clearM5() {self._m5 = nil} + + var m6: Int64 { + get {return _m6 ?? 0} + set {_m6 = newValue} + } + /// Returns true if `m6` has been explicitly set. + var hasM6: Bool {return self._m6 != nil} + /// Clears the value of `m6`. Subsequent reads from it will return its default value. + mutating func clearM6() {self._m6 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _m1: Bool? = nil + fileprivate var _m2: Int64? = nil + fileprivate var _m3: Bool? = nil + fileprivate var _m4: String? = nil + fileprivate var _m5: Int32? = nil + fileprivate var _m6: Int64? = nil +} + +/// Test that RPC services work. +struct ProtobufUnittest_FooRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_FooResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_FooClientMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_FooServerMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_BarRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_BarResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_TestJsonName { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var fieldName1: Int32 { + get {return _fieldName1 ?? 0} + set {_fieldName1 = newValue} + } + /// Returns true if `fieldName1` has been explicitly set. + var hasFieldName1: Bool {return self._fieldName1 != nil} + /// Clears the value of `fieldName1`. Subsequent reads from it will return its default value. + mutating func clearFieldName1() {self._fieldName1 = nil} + + var fieldName2: Int32 { + get {return _fieldName2 ?? 0} + set {_fieldName2 = newValue} + } + /// Returns true if `fieldName2` has been explicitly set. + var hasFieldName2: Bool {return self._fieldName2 != nil} + /// Clears the value of `fieldName2`. Subsequent reads from it will return its default value. + mutating func clearFieldName2() {self._fieldName2 = nil} + + var fieldName3: Int32 { + get {return _fieldName3 ?? 0} + set {_fieldName3 = newValue} + } + /// Returns true if `fieldName3` has been explicitly set. + var hasFieldName3: Bool {return self._fieldName3 != nil} + /// Clears the value of `fieldName3`. Subsequent reads from it will return its default value. + mutating func clearFieldName3() {self._fieldName3 = nil} + + var fieldName4: Int32 { + get {return _fieldName4 ?? 0} + set {_fieldName4 = newValue} + } + /// Returns true if `fieldName4` has been explicitly set. + var hasFieldName4: Bool {return self._fieldName4 != nil} + /// Clears the value of `fieldName4`. Subsequent reads from it will return its default value. + mutating func clearFieldName4() {self._fieldName4 = nil} + + var fieldName5: Int32 { + get {return _fieldName5 ?? 0} + set {_fieldName5 = newValue} + } + /// Returns true if `fieldName5` has been explicitly set. + var hasFieldName5: Bool {return self._fieldName5 != nil} + /// Clears the value of `fieldName5`. Subsequent reads from it will return its default value. + mutating func clearFieldName5() {self._fieldName5 = nil} + + var fieldName6: Int32 { + get {return _fieldName6 ?? 0} + set {_fieldName6 = newValue} + } + /// Returns true if `fieldName6` has been explicitly set. + var hasFieldName6: Bool {return self._fieldName6 != nil} + /// Clears the value of `fieldName6`. Subsequent reads from it will return its default value. + mutating func clearFieldName6() {self._fieldName6 = nil} + + var fieldname7: Int32 { + get {return _fieldname7 ?? 0} + set {_fieldname7 = newValue} + } + /// Returns true if `fieldname7` has been explicitly set. + var hasFieldname7: Bool {return self._fieldname7 != nil} + /// Clears the value of `fieldname7`. Subsequent reads from it will return its default value. + mutating func clearFieldname7() {self._fieldname7 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _fieldName1: Int32? = nil + fileprivate var _fieldName2: Int32? = nil + fileprivate var _fieldName3: Int32? = nil + fileprivate var _fieldName4: Int32? = nil + fileprivate var _fieldName5: Int32? = nil + fileprivate var _fieldName6: Int32? = nil + fileprivate var _fieldname7: Int32? = nil +} + +struct ProtobufUnittest_TestHugeFieldNumbers: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalInt32: Int32 { + get {return _optionalInt32 ?? 0} + set {_optionalInt32 = newValue} + } + /// Returns true if `optionalInt32` has been explicitly set. + var hasOptionalInt32: Bool {return self._optionalInt32 != nil} + /// Clears the value of `optionalInt32`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt32() {self._optionalInt32 = nil} + + var fixed32: Int32 { + get {return _fixed32 ?? 0} + set {_fixed32 = newValue} + } + /// Returns true if `fixed32` has been explicitly set. + var hasFixed32: Bool {return self._fixed32 != nil} + /// Clears the value of `fixed32`. Subsequent reads from it will return its default value. + mutating func clearFixed32() {self._fixed32 = nil} + + var repeatedInt32: [Int32] = [] + + var packedInt32: [Int32] = [] + + var optionalEnum: ProtobufUnittest_ForeignEnum { + get {return _optionalEnum ?? .foreignFoo} + set {_optionalEnum = newValue} + } + /// Returns true if `optionalEnum` has been explicitly set. + var hasOptionalEnum: Bool {return self._optionalEnum != nil} + /// Clears the value of `optionalEnum`. Subsequent reads from it will return its default value. + mutating func clearOptionalEnum() {self._optionalEnum = nil} + + var optionalString: String { + get {return _optionalString ?? String()} + set {_optionalString = newValue} + } + /// Returns true if `optionalString` has been explicitly set. + var hasOptionalString: Bool {return self._optionalString != nil} + /// Clears the value of `optionalString`. Subsequent reads from it will return its default value. + mutating func clearOptionalString() {self._optionalString = nil} + + var optionalBytes: Data { + get {return _optionalBytes ?? Data()} + set {_optionalBytes = newValue} + } + /// Returns true if `optionalBytes` has been explicitly set. + var hasOptionalBytes: Bool {return self._optionalBytes != nil} + /// Clears the value of `optionalBytes`. Subsequent reads from it will return its default value. + mutating func clearOptionalBytes() {self._optionalBytes = nil} + + var optionalMessage: ProtobufUnittest_ForeignMessage { + get {return _optionalMessage ?? ProtobufUnittest_ForeignMessage()} + set {_optionalMessage = newValue} + } + /// Returns true if `optionalMessage` has been explicitly set. + var hasOptionalMessage: Bool {return self._optionalMessage != nil} + /// Clears the value of `optionalMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalMessage() {self._optionalMessage = nil} + + var optionalGroup: ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup { + get {return _optionalGroup ?? ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup()} + set {_optionalGroup = newValue} + } + /// Returns true if `optionalGroup` has been explicitly set. + var hasOptionalGroup: Bool {return self._optionalGroup != nil} + /// Clears the value of `optionalGroup`. Subsequent reads from it will return its default value. + mutating func clearOptionalGroup() {self._optionalGroup = nil} + + var stringStringMap: Dictionary = [:] + + var oneofField: ProtobufUnittest_TestHugeFieldNumbers.OneOf_OneofField? = nil + + var oneofUint32: UInt32 { + get { + if case .oneofUint32(let v)? = oneofField {return v} + return 0 + } + set {oneofField = .oneofUint32(newValue)} + } + + var oneofTestAllTypes: ProtobufUnittest_TestAllTypes { + get { + if case .oneofTestAllTypes(let v)? = oneofField {return v} + return ProtobufUnittest_TestAllTypes() + } + set {oneofField = .oneofTestAllTypes(newValue)} + } + + var oneofString: String { + get { + if case .oneofString(let v)? = oneofField {return v} + return String() + } + set {oneofField = .oneofString(newValue)} + } + + var oneofBytes: Data { + get { + if case .oneofBytes(let v)? = oneofField {return v} + return Data() + } + set {oneofField = .oneofBytes(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_OneofField: Equatable { + case oneofUint32(UInt32) + case oneofTestAllTypes(ProtobufUnittest_TestAllTypes) + case oneofString(String) + case oneofBytes(Data) + + } + + struct OptionalGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var groupA: Int32 { + get {return _groupA ?? 0} + set {_groupA = newValue} + } + /// Returns true if `groupA` has been explicitly set. + var hasGroupA: Bool {return self._groupA != nil} + /// Clears the value of `groupA`. Subsequent reads from it will return its default value. + mutating func clearGroupA() {self._groupA = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _groupA: Int32? = nil + } + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _optionalInt32: Int32? = nil + fileprivate var _fixed32: Int32? = nil + fileprivate var _optionalEnum: ProtobufUnittest_ForeignEnum? = nil + fileprivate var _optionalString: String? = nil + fileprivate var _optionalBytes: Data? = nil + fileprivate var _optionalMessage: ProtobufUnittest_ForeignMessage? = nil + fileprivate var _optionalGroup: ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup? = nil +} + +struct ProtobufUnittest_TestExtensionInsideTable: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var field1: Int32 { + get {return _field1 ?? 0} + set {_field1 = newValue} + } + /// Returns true if `field1` has been explicitly set. + var hasField1: Bool {return self._field1 != nil} + /// Clears the value of `field1`. Subsequent reads from it will return its default value. + mutating func clearField1() {self._field1 = nil} + + var field2: Int32 { + get {return _field2 ?? 0} + set {_field2 = newValue} + } + /// Returns true if `field2` has been explicitly set. + var hasField2: Bool {return self._field2 != nil} + /// Clears the value of `field2`. Subsequent reads from it will return its default value. + mutating func clearField2() {self._field2 = nil} + + var field3: Int32 { + get {return _field3 ?? 0} + set {_field3 = newValue} + } + /// Returns true if `field3` has been explicitly set. + var hasField3: Bool {return self._field3 != nil} + /// Clears the value of `field3`. Subsequent reads from it will return its default value. + mutating func clearField3() {self._field3 = nil} + + var field4: Int32 { + get {return _field4 ?? 0} + set {_field4 = newValue} + } + /// Returns true if `field4` has been explicitly set. + var hasField4: Bool {return self._field4 != nil} + /// Clears the value of `field4`. Subsequent reads from it will return its default value. + mutating func clearField4() {self._field4 = nil} + + var field6: Int32 { + get {return _field6 ?? 0} + set {_field6 = newValue} + } + /// Returns true if `field6` has been explicitly set. + var hasField6: Bool {return self._field6 != nil} + /// Clears the value of `field6`. Subsequent reads from it will return its default value. + mutating func clearField6() {self._field6 = nil} + + var field7: Int32 { + get {return _field7 ?? 0} + set {_field7 = newValue} + } + /// Returns true if `field7` has been explicitly set. + var hasField7: Bool {return self._field7 != nil} + /// Clears the value of `field7`. Subsequent reads from it will return its default value. + mutating func clearField7() {self._field7 = nil} + + var field8: Int32 { + get {return _field8 ?? 0} + set {_field8 = newValue} + } + /// Returns true if `field8` has been explicitly set. + var hasField8: Bool {return self._field8 != nil} + /// Clears the value of `field8`. Subsequent reads from it will return its default value. + mutating func clearField8() {self._field8 = nil} + + var field9: Int32 { + get {return _field9 ?? 0} + set {_field9 = newValue} + } + /// Returns true if `field9` has been explicitly set. + var hasField9: Bool {return self._field9 != nil} + /// Clears the value of `field9`. Subsequent reads from it will return its default value. + mutating func clearField9() {self._field9 = nil} + + var field10: Int32 { + get {return _field10 ?? 0} + set {_field10 = newValue} + } + /// Returns true if `field10` has been explicitly set. + var hasField10: Bool {return self._field10 != nil} + /// Clears the value of `field10`. Subsequent reads from it will return its default value. + mutating func clearField10() {self._field10 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _field1: Int32? = nil + fileprivate var _field2: Int32? = nil + fileprivate var _field3: Int32? = nil + fileprivate var _field4: Int32? = nil + fileprivate var _field6: Int32? = nil + fileprivate var _field7: Int32? = nil + fileprivate var _field8: Int32? = nil + fileprivate var _field9: Int32? = nil + fileprivate var _field10: Int32? = nil +} + +/// NOTE(b/202996544): Intentionally nested to mirror go/glep. +struct ProtobufUnittest_TestNestedGroupExtensionOuter { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var layer1OptionalGroup: ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup { + get {return _layer1OptionalGroup ?? ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup()} + set {_layer1OptionalGroup = newValue} + } + /// Returns true if `layer1OptionalGroup` has been explicitly set. + var hasLayer1OptionalGroup: Bool {return self._layer1OptionalGroup != nil} + /// Clears the value of `layer1OptionalGroup`. Subsequent reads from it will return its default value. + mutating func clearLayer1OptionalGroup() {self._layer1OptionalGroup = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct Layer1OptionalGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var layer2RepeatedGroup: [ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2RepeatedGroup] = [] + + var layer2AnotherOptionalRepeatedGroup: [ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2AnotherOptionalRepeatedGroup] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct Layer2RepeatedGroup: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var anotherField: String { + get {return _anotherField ?? String()} + set {_anotherField = newValue} + } + /// Returns true if `anotherField` has been explicitly set. + var hasAnotherField: Bool {return self._anotherField != nil} + /// Clears the value of `anotherField`. Subsequent reads from it will return its default value. + mutating func clearAnotherField() {self._anotherField = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _anotherField: String? = nil + } + + struct Layer2AnotherOptionalRepeatedGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var butWhyTho: String { + get {return _butWhyTho ?? String()} + set {_butWhyTho = newValue} + } + /// Returns true if `butWhyTho` has been explicitly set. + var hasButWhyTho: Bool {return self._butWhyTho != nil} + /// Clears the value of `butWhyTho`. Subsequent reads from it will return its default value. + mutating func clearButWhyTho() {self._butWhyTho = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _butWhyTho: String? = nil + } + + init() {} + } + + init() {} + + fileprivate var _layer1OptionalGroup: ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup? = nil +} + +struct ProtobufUnittest_TestNestedGroupExtensionInnerExtension { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var innerName: String { + get {return _innerName ?? String()} + set {_innerName = newValue} + } + /// Returns true if `innerName` has been explicitly set. + var hasInnerName: Bool {return self._innerName != nil} + /// Clears the value of `innerName`. Subsequent reads from it will return its default value. + mutating func clearInnerName() {self._innerName = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _innerName: String? = nil +} + +struct ProtobufUnittest_TestExtensionRangeSerialize: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var fooOne: Int32 { + get {return _fooOne ?? 0} + set {_fooOne = newValue} + } + /// Returns true if `fooOne` has been explicitly set. + var hasFooOne: Bool {return self._fooOne != nil} + /// Clears the value of `fooOne`. Subsequent reads from it will return its default value. + mutating func clearFooOne() {self._fooOne = nil} + + var fooTwo: Int32 { + get {return _fooTwo ?? 0} + set {_fooTwo = newValue} + } + /// Returns true if `fooTwo` has been explicitly set. + var hasFooTwo: Bool {return self._fooTwo != nil} + /// Clears the value of `fooTwo`. Subsequent reads from it will return its default value. + mutating func clearFooTwo() {self._fooTwo = nil} + + var fooThree: Int32 { + get {return _fooThree ?? 0} + set {_fooThree = newValue} + } + /// Returns true if `fooThree` has been explicitly set. + var hasFooThree: Bool {return self._fooThree != nil} + /// Clears the value of `fooThree`. Subsequent reads from it will return its default value. + mutating func clearFooThree() {self._fooThree = nil} + + var fooFour: Int32 { + get {return _fooFour ?? 0} + set {_fooFour = newValue} + } + /// Returns true if `fooFour` has been explicitly set. + var hasFooFour: Bool {return self._fooFour != nil} + /// Clears the value of `fooFour`. Subsequent reads from it will return its default value. + mutating func clearFooFour() {self._fooFour = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _fooOne: Int32? = nil + fileprivate var _fooTwo: Int32? = nil + fileprivate var _fooThree: Int32? = nil + fileprivate var _fooFour: Int32? = nil +} + +struct ProtobufUnittest_TestVerifyInt32Simple { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalInt321: Int32 { + get {return _optionalInt321 ?? 0} + set {_optionalInt321 = newValue} + } + /// Returns true if `optionalInt321` has been explicitly set. + var hasOptionalInt321: Bool {return self._optionalInt321 != nil} + /// Clears the value of `optionalInt321`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt321() {self._optionalInt321 = nil} + + var optionalInt322: Int32 { + get {return _optionalInt322 ?? 0} + set {_optionalInt322 = newValue} + } + /// Returns true if `optionalInt322` has been explicitly set. + var hasOptionalInt322: Bool {return self._optionalInt322 != nil} + /// Clears the value of `optionalInt322`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt322() {self._optionalInt322 = nil} + + var optionalInt3263: Int32 { + get {return _optionalInt3263 ?? 0} + set {_optionalInt3263 = newValue} + } + /// Returns true if `optionalInt3263` has been explicitly set. + var hasOptionalInt3263: Bool {return self._optionalInt3263 != nil} + /// Clears the value of `optionalInt3263`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt3263() {self._optionalInt3263 = nil} + + var optionalInt3264: Int32 { + get {return _optionalInt3264 ?? 0} + set {_optionalInt3264 = newValue} + } + /// Returns true if `optionalInt3264` has been explicitly set. + var hasOptionalInt3264: Bool {return self._optionalInt3264 != nil} + /// Clears the value of `optionalInt3264`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt3264() {self._optionalInt3264 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalInt321: Int32? = nil + fileprivate var _optionalInt322: Int32? = nil + fileprivate var _optionalInt3263: Int32? = nil + fileprivate var _optionalInt3264: Int32? = nil +} + +struct ProtobufUnittest_TestVerifyInt32 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalInt321: Int32 { + get {return _optionalInt321 ?? 0} + set {_optionalInt321 = newValue} + } + /// Returns true if `optionalInt321` has been explicitly set. + var hasOptionalInt321: Bool {return self._optionalInt321 != nil} + /// Clears the value of `optionalInt321`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt321() {self._optionalInt321 = nil} + + var optionalInt322: Int32 { + get {return _optionalInt322 ?? 0} + set {_optionalInt322 = newValue} + } + /// Returns true if `optionalInt322` has been explicitly set. + var hasOptionalInt322: Bool {return self._optionalInt322 != nil} + /// Clears the value of `optionalInt322`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt322() {self._optionalInt322 = nil} + + var optionalInt3263: Int32 { + get {return _optionalInt3263 ?? 0} + set {_optionalInt3263 = newValue} + } + /// Returns true if `optionalInt3263` has been explicitly set. + var hasOptionalInt3263: Bool {return self._optionalInt3263 != nil} + /// Clears the value of `optionalInt3263`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt3263() {self._optionalInt3263 = nil} + + var optionalInt3264: Int32 { + get {return _optionalInt3264 ?? 0} + set {_optionalInt3264 = newValue} + } + /// Returns true if `optionalInt3264` has been explicitly set. + var hasOptionalInt3264: Bool {return self._optionalInt3264 != nil} + /// Clears the value of `optionalInt3264`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt3264() {self._optionalInt3264 = nil} + + var optionalAllTypes: ProtobufUnittest_TestAllTypes { + get {return _optionalAllTypes ?? ProtobufUnittest_TestAllTypes()} + set {_optionalAllTypes = newValue} + } + /// Returns true if `optionalAllTypes` has been explicitly set. + var hasOptionalAllTypes: Bool {return self._optionalAllTypes != nil} + /// Clears the value of `optionalAllTypes`. Subsequent reads from it will return its default value. + mutating func clearOptionalAllTypes() {self._optionalAllTypes = nil} + + var repeatedAllTypes: [ProtobufUnittest_TestAllTypes] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalInt321: Int32? = nil + fileprivate var _optionalInt322: Int32? = nil + fileprivate var _optionalInt3263: Int32? = nil + fileprivate var _optionalInt3264: Int32? = nil + fileprivate var _optionalAllTypes: ProtobufUnittest_TestAllTypes? = nil +} + +struct ProtobufUnittest_TestVerifyMostlyInt32 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalInt6430: Int64 { + get {return _optionalInt6430 ?? 0} + set {_optionalInt6430 = newValue} + } + /// Returns true if `optionalInt6430` has been explicitly set. + var hasOptionalInt6430: Bool {return self._optionalInt6430 != nil} + /// Clears the value of `optionalInt6430`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt6430() {self._optionalInt6430 = nil} + + var optionalInt321: Int32 { + get {return _optionalInt321 ?? 0} + set {_optionalInt321 = newValue} + } + /// Returns true if `optionalInt321` has been explicitly set. + var hasOptionalInt321: Bool {return self._optionalInt321 != nil} + /// Clears the value of `optionalInt321`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt321() {self._optionalInt321 = nil} + + var optionalInt322: Int32 { + get {return _optionalInt322 ?? 0} + set {_optionalInt322 = newValue} + } + /// Returns true if `optionalInt322` has been explicitly set. + var hasOptionalInt322: Bool {return self._optionalInt322 != nil} + /// Clears the value of `optionalInt322`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt322() {self._optionalInt322 = nil} + + var optionalInt323: Int32 { + get {return _optionalInt323 ?? 0} + set {_optionalInt323 = newValue} + } + /// Returns true if `optionalInt323` has been explicitly set. + var hasOptionalInt323: Bool {return self._optionalInt323 != nil} + /// Clears the value of `optionalInt323`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt323() {self._optionalInt323 = nil} + + var optionalInt324: Int32 { + get {return _optionalInt324 ?? 0} + set {_optionalInt324 = newValue} + } + /// Returns true if `optionalInt324` has been explicitly set. + var hasOptionalInt324: Bool {return self._optionalInt324 != nil} + /// Clears the value of `optionalInt324`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt324() {self._optionalInt324 = nil} + + var optionalInt3263: Int32 { + get {return _optionalInt3263 ?? 0} + set {_optionalInt3263 = newValue} + } + /// Returns true if `optionalInt3263` has been explicitly set. + var hasOptionalInt3263: Bool {return self._optionalInt3263 != nil} + /// Clears the value of `optionalInt3263`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt3263() {self._optionalInt3263 = nil} + + var optionalInt3264: Int32 { + get {return _optionalInt3264 ?? 0} + set {_optionalInt3264 = newValue} + } + /// Returns true if `optionalInt3264` has been explicitly set. + var hasOptionalInt3264: Bool {return self._optionalInt3264 != nil} + /// Clears the value of `optionalInt3264`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt3264() {self._optionalInt3264 = nil} + + var optionalAllTypes: ProtobufUnittest_TestAllTypes { + get {return _optionalAllTypes ?? ProtobufUnittest_TestAllTypes()} + set {_optionalAllTypes = newValue} + } + /// Returns true if `optionalAllTypes` has been explicitly set. + var hasOptionalAllTypes: Bool {return self._optionalAllTypes != nil} + /// Clears the value of `optionalAllTypes`. Subsequent reads from it will return its default value. + mutating func clearOptionalAllTypes() {self._optionalAllTypes = nil} + + var repeatedAllTypes: [ProtobufUnittest_TestAllTypes] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalInt6430: Int64? = nil + fileprivate var _optionalInt321: Int32? = nil + fileprivate var _optionalInt322: Int32? = nil + fileprivate var _optionalInt323: Int32? = nil + fileprivate var _optionalInt324: Int32? = nil + fileprivate var _optionalInt3263: Int32? = nil + fileprivate var _optionalInt3264: Int32? = nil + fileprivate var _optionalAllTypes: ProtobufUnittest_TestAllTypes? = nil +} + +struct ProtobufUnittest_TestVerifyMostlyInt32BigFieldNumber { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalInt6430: Int64 { + get {return _optionalInt6430 ?? 0} + set {_optionalInt6430 = newValue} + } + /// Returns true if `optionalInt6430` has been explicitly set. + var hasOptionalInt6430: Bool {return self._optionalInt6430 != nil} + /// Clears the value of `optionalInt6430`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt6430() {self._optionalInt6430 = nil} + + var optionalInt32300: Int32 { + get {return _optionalInt32300 ?? 0} + set {_optionalInt32300 = newValue} + } + /// Returns true if `optionalInt32300` has been explicitly set. + var hasOptionalInt32300: Bool {return self._optionalInt32300 != nil} + /// Clears the value of `optionalInt32300`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt32300() {self._optionalInt32300 = nil} + + var optionalInt321: Int32 { + get {return _optionalInt321 ?? 0} + set {_optionalInt321 = newValue} + } + /// Returns true if `optionalInt321` has been explicitly set. + var hasOptionalInt321: Bool {return self._optionalInt321 != nil} + /// Clears the value of `optionalInt321`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt321() {self._optionalInt321 = nil} + + var optionalInt322: Int32 { + get {return _optionalInt322 ?? 0} + set {_optionalInt322 = newValue} + } + /// Returns true if `optionalInt322` has been explicitly set. + var hasOptionalInt322: Bool {return self._optionalInt322 != nil} + /// Clears the value of `optionalInt322`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt322() {self._optionalInt322 = nil} + + var optionalInt323: Int32 { + get {return _optionalInt323 ?? 0} + set {_optionalInt323 = newValue} + } + /// Returns true if `optionalInt323` has been explicitly set. + var hasOptionalInt323: Bool {return self._optionalInt323 != nil} + /// Clears the value of `optionalInt323`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt323() {self._optionalInt323 = nil} + + var optionalInt324: Int32 { + get {return _optionalInt324 ?? 0} + set {_optionalInt324 = newValue} + } + /// Returns true if `optionalInt324` has been explicitly set. + var hasOptionalInt324: Bool {return self._optionalInt324 != nil} + /// Clears the value of `optionalInt324`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt324() {self._optionalInt324 = nil} + + var optionalInt3263: Int32 { + get {return _optionalInt3263 ?? 0} + set {_optionalInt3263 = newValue} + } + /// Returns true if `optionalInt3263` has been explicitly set. + var hasOptionalInt3263: Bool {return self._optionalInt3263 != nil} + /// Clears the value of `optionalInt3263`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt3263() {self._optionalInt3263 = nil} + + var optionalInt3264: Int32 { + get {return _optionalInt3264 ?? 0} + set {_optionalInt3264 = newValue} + } + /// Returns true if `optionalInt3264` has been explicitly set. + var hasOptionalInt3264: Bool {return self._optionalInt3264 != nil} + /// Clears the value of `optionalInt3264`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt3264() {self._optionalInt3264 = nil} + + var optionalAllTypes: ProtobufUnittest_TestAllTypes { + get {return _optionalAllTypes ?? ProtobufUnittest_TestAllTypes()} + set {_optionalAllTypes = newValue} + } + /// Returns true if `optionalAllTypes` has been explicitly set. + var hasOptionalAllTypes: Bool {return self._optionalAllTypes != nil} + /// Clears the value of `optionalAllTypes`. Subsequent reads from it will return its default value. + mutating func clearOptionalAllTypes() {self._optionalAllTypes = nil} + + var repeatedAllTypes: [ProtobufUnittest_TestAllTypes] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalInt6430: Int64? = nil + fileprivate var _optionalInt32300: Int32? = nil + fileprivate var _optionalInt321: Int32? = nil + fileprivate var _optionalInt322: Int32? = nil + fileprivate var _optionalInt323: Int32? = nil + fileprivate var _optionalInt324: Int32? = nil + fileprivate var _optionalInt3263: Int32? = nil + fileprivate var _optionalInt3264: Int32? = nil + fileprivate var _optionalAllTypes: ProtobufUnittest_TestAllTypes? = nil +} + +struct ProtobufUnittest_TestVerifyUint32Simple { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalUint321: UInt32 { + get {return _optionalUint321 ?? 0} + set {_optionalUint321 = newValue} + } + /// Returns true if `optionalUint321` has been explicitly set. + var hasOptionalUint321: Bool {return self._optionalUint321 != nil} + /// Clears the value of `optionalUint321`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint321() {self._optionalUint321 = nil} + + var optionalUint322: UInt32 { + get {return _optionalUint322 ?? 0} + set {_optionalUint322 = newValue} + } + /// Returns true if `optionalUint322` has been explicitly set. + var hasOptionalUint322: Bool {return self._optionalUint322 != nil} + /// Clears the value of `optionalUint322`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint322() {self._optionalUint322 = nil} + + var optionalUint3263: UInt32 { + get {return _optionalUint3263 ?? 0} + set {_optionalUint3263 = newValue} + } + /// Returns true if `optionalUint3263` has been explicitly set. + var hasOptionalUint3263: Bool {return self._optionalUint3263 != nil} + /// Clears the value of `optionalUint3263`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint3263() {self._optionalUint3263 = nil} + + var optionalUint3264: UInt32 { + get {return _optionalUint3264 ?? 0} + set {_optionalUint3264 = newValue} + } + /// Returns true if `optionalUint3264` has been explicitly set. + var hasOptionalUint3264: Bool {return self._optionalUint3264 != nil} + /// Clears the value of `optionalUint3264`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint3264() {self._optionalUint3264 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalUint321: UInt32? = nil + fileprivate var _optionalUint322: UInt32? = nil + fileprivate var _optionalUint3263: UInt32? = nil + fileprivate var _optionalUint3264: UInt32? = nil +} + +struct ProtobufUnittest_TestVerifyUint32 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalUint321: UInt32 { + get {return _optionalUint321 ?? 0} + set {_optionalUint321 = newValue} + } + /// Returns true if `optionalUint321` has been explicitly set. + var hasOptionalUint321: Bool {return self._optionalUint321 != nil} + /// Clears the value of `optionalUint321`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint321() {self._optionalUint321 = nil} + + var optionalUint322: UInt32 { + get {return _optionalUint322 ?? 0} + set {_optionalUint322 = newValue} + } + /// Returns true if `optionalUint322` has been explicitly set. + var hasOptionalUint322: Bool {return self._optionalUint322 != nil} + /// Clears the value of `optionalUint322`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint322() {self._optionalUint322 = nil} + + var optionalUint3263: UInt32 { + get {return _optionalUint3263 ?? 0} + set {_optionalUint3263 = newValue} + } + /// Returns true if `optionalUint3263` has been explicitly set. + var hasOptionalUint3263: Bool {return self._optionalUint3263 != nil} + /// Clears the value of `optionalUint3263`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint3263() {self._optionalUint3263 = nil} + + var optionalUint3264: UInt32 { + get {return _optionalUint3264 ?? 0} + set {_optionalUint3264 = newValue} + } + /// Returns true if `optionalUint3264` has been explicitly set. + var hasOptionalUint3264: Bool {return self._optionalUint3264 != nil} + /// Clears the value of `optionalUint3264`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint3264() {self._optionalUint3264 = nil} + + var optionalAllTypes: ProtobufUnittest_TestAllTypes { + get {return _optionalAllTypes ?? ProtobufUnittest_TestAllTypes()} + set {_optionalAllTypes = newValue} + } + /// Returns true if `optionalAllTypes` has been explicitly set. + var hasOptionalAllTypes: Bool {return self._optionalAllTypes != nil} + /// Clears the value of `optionalAllTypes`. Subsequent reads from it will return its default value. + mutating func clearOptionalAllTypes() {self._optionalAllTypes = nil} + + var repeatedAllTypes: [ProtobufUnittest_TestAllTypes] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalUint321: UInt32? = nil + fileprivate var _optionalUint322: UInt32? = nil + fileprivate var _optionalUint3263: UInt32? = nil + fileprivate var _optionalUint3264: UInt32? = nil + fileprivate var _optionalAllTypes: ProtobufUnittest_TestAllTypes? = nil +} + +struct ProtobufUnittest_TestVerifyOneUint32 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalUint321: UInt32 { + get {return _optionalUint321 ?? 0} + set {_optionalUint321 = newValue} + } + /// Returns true if `optionalUint321` has been explicitly set. + var hasOptionalUint321: Bool {return self._optionalUint321 != nil} + /// Clears the value of `optionalUint321`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint321() {self._optionalUint321 = nil} + + var optionalInt322: Int32 { + get {return _optionalInt322 ?? 0} + set {_optionalInt322 = newValue} + } + /// Returns true if `optionalInt322` has been explicitly set. + var hasOptionalInt322: Bool {return self._optionalInt322 != nil} + /// Clears the value of `optionalInt322`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt322() {self._optionalInt322 = nil} + + var optionalInt3263: Int32 { + get {return _optionalInt3263 ?? 0} + set {_optionalInt3263 = newValue} + } + /// Returns true if `optionalInt3263` has been explicitly set. + var hasOptionalInt3263: Bool {return self._optionalInt3263 != nil} + /// Clears the value of `optionalInt3263`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt3263() {self._optionalInt3263 = nil} + + var optionalInt3264: Int32 { + get {return _optionalInt3264 ?? 0} + set {_optionalInt3264 = newValue} + } + /// Returns true if `optionalInt3264` has been explicitly set. + var hasOptionalInt3264: Bool {return self._optionalInt3264 != nil} + /// Clears the value of `optionalInt3264`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt3264() {self._optionalInt3264 = nil} + + var optionalAllTypes: ProtobufUnittest_TestAllTypes { + get {return _optionalAllTypes ?? ProtobufUnittest_TestAllTypes()} + set {_optionalAllTypes = newValue} + } + /// Returns true if `optionalAllTypes` has been explicitly set. + var hasOptionalAllTypes: Bool {return self._optionalAllTypes != nil} + /// Clears the value of `optionalAllTypes`. Subsequent reads from it will return its default value. + mutating func clearOptionalAllTypes() {self._optionalAllTypes = nil} + + var repeatedAllTypes: [ProtobufUnittest_TestAllTypes] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalUint321: UInt32? = nil + fileprivate var _optionalInt322: Int32? = nil + fileprivate var _optionalInt3263: Int32? = nil + fileprivate var _optionalInt3264: Int32? = nil + fileprivate var _optionalAllTypes: ProtobufUnittest_TestAllTypes? = nil +} + +struct ProtobufUnittest_TestVerifyOneInt32BigFieldNumber { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalInt3265: Int32 { + get {return _optionalInt3265 ?? 0} + set {_optionalInt3265 = newValue} + } + /// Returns true if `optionalInt3265` has been explicitly set. + var hasOptionalInt3265: Bool {return self._optionalInt3265 != nil} + /// Clears the value of `optionalInt3265`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt3265() {self._optionalInt3265 = nil} + + var optionalInt641: Int64 { + get {return _optionalInt641 ?? 0} + set {_optionalInt641 = newValue} + } + /// Returns true if `optionalInt641` has been explicitly set. + var hasOptionalInt641: Bool {return self._optionalInt641 != nil} + /// Clears the value of `optionalInt641`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt641() {self._optionalInt641 = nil} + + var optionalInt642: Int64 { + get {return _optionalInt642 ?? 0} + set {_optionalInt642 = newValue} + } + /// Returns true if `optionalInt642` has been explicitly set. + var hasOptionalInt642: Bool {return self._optionalInt642 != nil} + /// Clears the value of `optionalInt642`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt642() {self._optionalInt642 = nil} + + var optionalInt6463: Int64 { + get {return _optionalInt6463 ?? 0} + set {_optionalInt6463 = newValue} + } + /// Returns true if `optionalInt6463` has been explicitly set. + var hasOptionalInt6463: Bool {return self._optionalInt6463 != nil} + /// Clears the value of `optionalInt6463`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt6463() {self._optionalInt6463 = nil} + + var optionalInt6464: Int64 { + get {return _optionalInt6464 ?? 0} + set {_optionalInt6464 = newValue} + } + /// Returns true if `optionalInt6464` has been explicitly set. + var hasOptionalInt6464: Bool {return self._optionalInt6464 != nil} + /// Clears the value of `optionalInt6464`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt6464() {self._optionalInt6464 = nil} + + var optionalAllTypes: ProtobufUnittest_TestAllTypes { + get {return _optionalAllTypes ?? ProtobufUnittest_TestAllTypes()} + set {_optionalAllTypes = newValue} + } + /// Returns true if `optionalAllTypes` has been explicitly set. + var hasOptionalAllTypes: Bool {return self._optionalAllTypes != nil} + /// Clears the value of `optionalAllTypes`. Subsequent reads from it will return its default value. + mutating func clearOptionalAllTypes() {self._optionalAllTypes = nil} + + var repeatedAllTypes: [ProtobufUnittest_TestAllTypes] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalInt3265: Int32? = nil + fileprivate var _optionalInt641: Int64? = nil + fileprivate var _optionalInt642: Int64? = nil + fileprivate var _optionalInt6463: Int64? = nil + fileprivate var _optionalInt6464: Int64? = nil + fileprivate var _optionalAllTypes: ProtobufUnittest_TestAllTypes? = nil +} + +struct ProtobufUnittest_TestVerifyInt32BigFieldNumber { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalInt321000: Int32 { + get {return _optionalInt321000 ?? 0} + set {_optionalInt321000 = newValue} + } + /// Returns true if `optionalInt321000` has been explicitly set. + var hasOptionalInt321000: Bool {return self._optionalInt321000 != nil} + /// Clears the value of `optionalInt321000`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt321000() {self._optionalInt321000 = nil} + + var optionalInt3265: Int32 { + get {return _optionalInt3265 ?? 0} + set {_optionalInt3265 = newValue} + } + /// Returns true if `optionalInt3265` has been explicitly set. + var hasOptionalInt3265: Bool {return self._optionalInt3265 != nil} + /// Clears the value of `optionalInt3265`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt3265() {self._optionalInt3265 = nil} + + var optionalInt321: Int32 { + get {return _optionalInt321 ?? 0} + set {_optionalInt321 = newValue} + } + /// Returns true if `optionalInt321` has been explicitly set. + var hasOptionalInt321: Bool {return self._optionalInt321 != nil} + /// Clears the value of `optionalInt321`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt321() {self._optionalInt321 = nil} + + var optionalInt322: Int32 { + get {return _optionalInt322 ?? 0} + set {_optionalInt322 = newValue} + } + /// Returns true if `optionalInt322` has been explicitly set. + var hasOptionalInt322: Bool {return self._optionalInt322 != nil} + /// Clears the value of `optionalInt322`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt322() {self._optionalInt322 = nil} + + var optionalInt3263: Int32 { + get {return _optionalInt3263 ?? 0} + set {_optionalInt3263 = newValue} + } + /// Returns true if `optionalInt3263` has been explicitly set. + var hasOptionalInt3263: Bool {return self._optionalInt3263 != nil} + /// Clears the value of `optionalInt3263`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt3263() {self._optionalInt3263 = nil} + + var optionalInt3264: Int32 { + get {return _optionalInt3264 ?? 0} + set {_optionalInt3264 = newValue} + } + /// Returns true if `optionalInt3264` has been explicitly set. + var hasOptionalInt3264: Bool {return self._optionalInt3264 != nil} + /// Clears the value of `optionalInt3264`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt3264() {self._optionalInt3264 = nil} + + var optionalAllTypes: ProtobufUnittest_TestAllTypes { + get {return _optionalAllTypes ?? ProtobufUnittest_TestAllTypes()} + set {_optionalAllTypes = newValue} + } + /// Returns true if `optionalAllTypes` has been explicitly set. + var hasOptionalAllTypes: Bool {return self._optionalAllTypes != nil} + /// Clears the value of `optionalAllTypes`. Subsequent reads from it will return its default value. + mutating func clearOptionalAllTypes() {self._optionalAllTypes = nil} + + var repeatedAllTypes: [ProtobufUnittest_TestAllTypes] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalInt321000: Int32? = nil + fileprivate var _optionalInt3265: Int32? = nil + fileprivate var _optionalInt321: Int32? = nil + fileprivate var _optionalInt322: Int32? = nil + fileprivate var _optionalInt3263: Int32? = nil + fileprivate var _optionalInt3264: Int32? = nil + fileprivate var _optionalAllTypes: ProtobufUnittest_TestAllTypes? = nil +} + +struct ProtobufUnittest_TestVerifyUint32BigFieldNumber { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalUint321000: UInt32 { + get {return _optionalUint321000 ?? 0} + set {_optionalUint321000 = newValue} + } + /// Returns true if `optionalUint321000` has been explicitly set. + var hasOptionalUint321000: Bool {return self._optionalUint321000 != nil} + /// Clears the value of `optionalUint321000`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint321000() {self._optionalUint321000 = nil} + + var optionalUint3265: UInt32 { + get {return _optionalUint3265 ?? 0} + set {_optionalUint3265 = newValue} + } + /// Returns true if `optionalUint3265` has been explicitly set. + var hasOptionalUint3265: Bool {return self._optionalUint3265 != nil} + /// Clears the value of `optionalUint3265`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint3265() {self._optionalUint3265 = nil} + + var optionalUint321: UInt32 { + get {return _optionalUint321 ?? 0} + set {_optionalUint321 = newValue} + } + /// Returns true if `optionalUint321` has been explicitly set. + var hasOptionalUint321: Bool {return self._optionalUint321 != nil} + /// Clears the value of `optionalUint321`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint321() {self._optionalUint321 = nil} + + var optionalUint322: UInt32 { + get {return _optionalUint322 ?? 0} + set {_optionalUint322 = newValue} + } + /// Returns true if `optionalUint322` has been explicitly set. + var hasOptionalUint322: Bool {return self._optionalUint322 != nil} + /// Clears the value of `optionalUint322`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint322() {self._optionalUint322 = nil} + + var optionalUint3263: UInt32 { + get {return _optionalUint3263 ?? 0} + set {_optionalUint3263 = newValue} + } + /// Returns true if `optionalUint3263` has been explicitly set. + var hasOptionalUint3263: Bool {return self._optionalUint3263 != nil} + /// Clears the value of `optionalUint3263`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint3263() {self._optionalUint3263 = nil} + + var optionalUint3264: UInt32 { + get {return _optionalUint3264 ?? 0} + set {_optionalUint3264 = newValue} + } + /// Returns true if `optionalUint3264` has been explicitly set. + var hasOptionalUint3264: Bool {return self._optionalUint3264 != nil} + /// Clears the value of `optionalUint3264`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint3264() {self._optionalUint3264 = nil} + + var optionalAllTypes: ProtobufUnittest_TestAllTypes { + get {return _optionalAllTypes ?? ProtobufUnittest_TestAllTypes()} + set {_optionalAllTypes = newValue} + } + /// Returns true if `optionalAllTypes` has been explicitly set. + var hasOptionalAllTypes: Bool {return self._optionalAllTypes != nil} + /// Clears the value of `optionalAllTypes`. Subsequent reads from it will return its default value. + mutating func clearOptionalAllTypes() {self._optionalAllTypes = nil} + + var repeatedAllTypes: [ProtobufUnittest_TestAllTypes] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalUint321000: UInt32? = nil + fileprivate var _optionalUint3265: UInt32? = nil + fileprivate var _optionalUint321: UInt32? = nil + fileprivate var _optionalUint322: UInt32? = nil + fileprivate var _optionalUint3263: UInt32? = nil + fileprivate var _optionalUint3264: UInt32? = nil + fileprivate var _optionalAllTypes: ProtobufUnittest_TestAllTypes? = nil +} + +struct ProtobufUnittest_TestVerifyBigFieldNumberUint32 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalNested: ProtobufUnittest_TestVerifyBigFieldNumberUint32.Nested { + get {return _optionalNested ?? ProtobufUnittest_TestVerifyBigFieldNumberUint32.Nested()} + set {_optionalNested = newValue} + } + /// Returns true if `optionalNested` has been explicitly set. + var hasOptionalNested: Bool {return self._optionalNested != nil} + /// Clears the value of `optionalNested`. Subsequent reads from it will return its default value. + mutating func clearOptionalNested() {self._optionalNested = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct Nested { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalUint325000: UInt32 { + get {return _storage._optionalUint325000 ?? 0} + set {_uniqueStorage()._optionalUint325000 = newValue} + } + /// Returns true if `optionalUint325000` has been explicitly set. + var hasOptionalUint325000: Bool {return _storage._optionalUint325000 != nil} + /// Clears the value of `optionalUint325000`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint325000() {_uniqueStorage()._optionalUint325000 = nil} + + var optionalUint321000: UInt32 { + get {return _storage._optionalUint321000 ?? 0} + set {_uniqueStorage()._optionalUint321000 = newValue} + } + /// Returns true if `optionalUint321000` has been explicitly set. + var hasOptionalUint321000: Bool {return _storage._optionalUint321000 != nil} + /// Clears the value of `optionalUint321000`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint321000() {_uniqueStorage()._optionalUint321000 = nil} + + var optionalUint3266: UInt32 { + get {return _storage._optionalUint3266 ?? 0} + set {_uniqueStorage()._optionalUint3266 = newValue} + } + /// Returns true if `optionalUint3266` has been explicitly set. + var hasOptionalUint3266: Bool {return _storage._optionalUint3266 != nil} + /// Clears the value of `optionalUint3266`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint3266() {_uniqueStorage()._optionalUint3266 = nil} + + var optionalUint3265: UInt32 { + get {return _storage._optionalUint3265 ?? 0} + set {_uniqueStorage()._optionalUint3265 = newValue} + } + /// Returns true if `optionalUint3265` has been explicitly set. + var hasOptionalUint3265: Bool {return _storage._optionalUint3265 != nil} + /// Clears the value of `optionalUint3265`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint3265() {_uniqueStorage()._optionalUint3265 = nil} + + var optionalUint321: UInt32 { + get {return _storage._optionalUint321 ?? 0} + set {_uniqueStorage()._optionalUint321 = newValue} + } + /// Returns true if `optionalUint321` has been explicitly set. + var hasOptionalUint321: Bool {return _storage._optionalUint321 != nil} + /// Clears the value of `optionalUint321`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint321() {_uniqueStorage()._optionalUint321 = nil} + + var optionalUint322: UInt32 { + get {return _storage._optionalUint322 ?? 0} + set {_uniqueStorage()._optionalUint322 = newValue} + } + /// Returns true if `optionalUint322` has been explicitly set. + var hasOptionalUint322: Bool {return _storage._optionalUint322 != nil} + /// Clears the value of `optionalUint322`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint322() {_uniqueStorage()._optionalUint322 = nil} + + var optionalUint3263: UInt32 { + get {return _storage._optionalUint3263 ?? 0} + set {_uniqueStorage()._optionalUint3263 = newValue} + } + /// Returns true if `optionalUint3263` has been explicitly set. + var hasOptionalUint3263: Bool {return _storage._optionalUint3263 != nil} + /// Clears the value of `optionalUint3263`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint3263() {_uniqueStorage()._optionalUint3263 = nil} + + var optionalUint3264: UInt32 { + get {return _storage._optionalUint3264 ?? 0} + set {_uniqueStorage()._optionalUint3264 = newValue} + } + /// Returns true if `optionalUint3264` has been explicitly set. + var hasOptionalUint3264: Bool {return _storage._optionalUint3264 != nil} + /// Clears the value of `optionalUint3264`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint3264() {_uniqueStorage()._optionalUint3264 = nil} + + var optionalNested: ProtobufUnittest_TestVerifyBigFieldNumberUint32.Nested { + get {return _storage._optionalNested ?? ProtobufUnittest_TestVerifyBigFieldNumberUint32.Nested()} + set {_uniqueStorage()._optionalNested = newValue} + } + /// Returns true if `optionalNested` has been explicitly set. + var hasOptionalNested: Bool {return _storage._optionalNested != nil} + /// Clears the value of `optionalNested`. Subsequent reads from it will return its default value. + mutating func clearOptionalNested() {_uniqueStorage()._optionalNested = nil} + + var repeatedNested: [ProtobufUnittest_TestVerifyBigFieldNumberUint32.Nested] { + get {return _storage._repeatedNested} + set {_uniqueStorage()._repeatedNested = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance + } + + init() {} + + fileprivate var _optionalNested: ProtobufUnittest_TestVerifyBigFieldNumberUint32.Nested? = nil +} + +/// This message contains different kind of enums to exercise the different +/// parsers in table-driven. +struct ProtobufUnittest_EnumParseTester: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalSeqSmall0Lowfield: ProtobufUnittest_EnumParseTester.SeqSmall0 { + get {return _storage._optionalSeqSmall0Lowfield ?? .default} + set {_uniqueStorage()._optionalSeqSmall0Lowfield = newValue} + } + /// Returns true if `optionalSeqSmall0Lowfield` has been explicitly set. + var hasOptionalSeqSmall0Lowfield: Bool {return _storage._optionalSeqSmall0Lowfield != nil} + /// Clears the value of `optionalSeqSmall0Lowfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalSeqSmall0Lowfield() {_uniqueStorage()._optionalSeqSmall0Lowfield = nil} + + var optionalSeqSmall0Midfield: ProtobufUnittest_EnumParseTester.SeqSmall0 { + get {return _storage._optionalSeqSmall0Midfield ?? .default} + set {_uniqueStorage()._optionalSeqSmall0Midfield = newValue} + } + /// Returns true if `optionalSeqSmall0Midfield` has been explicitly set. + var hasOptionalSeqSmall0Midfield: Bool {return _storage._optionalSeqSmall0Midfield != nil} + /// Clears the value of `optionalSeqSmall0Midfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalSeqSmall0Midfield() {_uniqueStorage()._optionalSeqSmall0Midfield = nil} + + var optionalSeqSmall0Hifield: ProtobufUnittest_EnumParseTester.SeqSmall0 { + get {return _storage._optionalSeqSmall0Hifield ?? .default} + set {_uniqueStorage()._optionalSeqSmall0Hifield = newValue} + } + /// Returns true if `optionalSeqSmall0Hifield` has been explicitly set. + var hasOptionalSeqSmall0Hifield: Bool {return _storage._optionalSeqSmall0Hifield != nil} + /// Clears the value of `optionalSeqSmall0Hifield`. Subsequent reads from it will return its default value. + mutating func clearOptionalSeqSmall0Hifield() {_uniqueStorage()._optionalSeqSmall0Hifield = nil} + + var repeatedSeqSmall0Lowfield: [ProtobufUnittest_EnumParseTester.SeqSmall0] { + get {return _storage._repeatedSeqSmall0Lowfield} + set {_uniqueStorage()._repeatedSeqSmall0Lowfield = newValue} + } + + var repeatedSeqSmall0Midfield: [ProtobufUnittest_EnumParseTester.SeqSmall0] { + get {return _storage._repeatedSeqSmall0Midfield} + set {_uniqueStorage()._repeatedSeqSmall0Midfield = newValue} + } + + var repeatedSeqSmall0Hifield: [ProtobufUnittest_EnumParseTester.SeqSmall0] { + get {return _storage._repeatedSeqSmall0Hifield} + set {_uniqueStorage()._repeatedSeqSmall0Hifield = newValue} + } + + var packedSeqSmall0Lowfield: [ProtobufUnittest_EnumParseTester.SeqSmall0] { + get {return _storage._packedSeqSmall0Lowfield} + set {_uniqueStorage()._packedSeqSmall0Lowfield = newValue} + } + + var packedSeqSmall0Midfield: [ProtobufUnittest_EnumParseTester.SeqSmall0] { + get {return _storage._packedSeqSmall0Midfield} + set {_uniqueStorage()._packedSeqSmall0Midfield = newValue} + } + + var packedSeqSmall0Hifield: [ProtobufUnittest_EnumParseTester.SeqSmall0] { + get {return _storage._packedSeqSmall0Hifield} + set {_uniqueStorage()._packedSeqSmall0Hifield = newValue} + } + + var optionalSeqSmall1Lowfield: ProtobufUnittest_EnumParseTester.SeqSmall1 { + get {return _storage._optionalSeqSmall1Lowfield ?? .default} + set {_uniqueStorage()._optionalSeqSmall1Lowfield = newValue} + } + /// Returns true if `optionalSeqSmall1Lowfield` has been explicitly set. + var hasOptionalSeqSmall1Lowfield: Bool {return _storage._optionalSeqSmall1Lowfield != nil} + /// Clears the value of `optionalSeqSmall1Lowfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalSeqSmall1Lowfield() {_uniqueStorage()._optionalSeqSmall1Lowfield = nil} + + var optionalSeqSmall1Midfield: ProtobufUnittest_EnumParseTester.SeqSmall1 { + get {return _storage._optionalSeqSmall1Midfield ?? .default} + set {_uniqueStorage()._optionalSeqSmall1Midfield = newValue} + } + /// Returns true if `optionalSeqSmall1Midfield` has been explicitly set. + var hasOptionalSeqSmall1Midfield: Bool {return _storage._optionalSeqSmall1Midfield != nil} + /// Clears the value of `optionalSeqSmall1Midfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalSeqSmall1Midfield() {_uniqueStorage()._optionalSeqSmall1Midfield = nil} + + var optionalSeqSmall1Hifield: ProtobufUnittest_EnumParseTester.SeqSmall1 { + get {return _storage._optionalSeqSmall1Hifield ?? .default} + set {_uniqueStorage()._optionalSeqSmall1Hifield = newValue} + } + /// Returns true if `optionalSeqSmall1Hifield` has been explicitly set. + var hasOptionalSeqSmall1Hifield: Bool {return _storage._optionalSeqSmall1Hifield != nil} + /// Clears the value of `optionalSeqSmall1Hifield`. Subsequent reads from it will return its default value. + mutating func clearOptionalSeqSmall1Hifield() {_uniqueStorage()._optionalSeqSmall1Hifield = nil} + + var repeatedSeqSmall1Lowfield: [ProtobufUnittest_EnumParseTester.SeqSmall1] { + get {return _storage._repeatedSeqSmall1Lowfield} + set {_uniqueStorage()._repeatedSeqSmall1Lowfield = newValue} + } + + var repeatedSeqSmall1Midfield: [ProtobufUnittest_EnumParseTester.SeqSmall1] { + get {return _storage._repeatedSeqSmall1Midfield} + set {_uniqueStorage()._repeatedSeqSmall1Midfield = newValue} + } + + var repeatedSeqSmall1Hifield: [ProtobufUnittest_EnumParseTester.SeqSmall1] { + get {return _storage._repeatedSeqSmall1Hifield} + set {_uniqueStorage()._repeatedSeqSmall1Hifield = newValue} + } + + var packedSeqSmall1Lowfield: [ProtobufUnittest_EnumParseTester.SeqSmall1] { + get {return _storage._packedSeqSmall1Lowfield} + set {_uniqueStorage()._packedSeqSmall1Lowfield = newValue} + } + + var packedSeqSmall1Midfield: [ProtobufUnittest_EnumParseTester.SeqSmall1] { + get {return _storage._packedSeqSmall1Midfield} + set {_uniqueStorage()._packedSeqSmall1Midfield = newValue} + } + + var packedSeqSmall1Hifield: [ProtobufUnittest_EnumParseTester.SeqSmall1] { + get {return _storage._packedSeqSmall1Hifield} + set {_uniqueStorage()._packedSeqSmall1Hifield = newValue} + } + + var optionalSeqLargeLowfield: ProtobufUnittest_EnumParseTester.SeqLarge { + get {return _storage._optionalSeqLargeLowfield ?? .default} + set {_uniqueStorage()._optionalSeqLargeLowfield = newValue} + } + /// Returns true if `optionalSeqLargeLowfield` has been explicitly set. + var hasOptionalSeqLargeLowfield: Bool {return _storage._optionalSeqLargeLowfield != nil} + /// Clears the value of `optionalSeqLargeLowfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalSeqLargeLowfield() {_uniqueStorage()._optionalSeqLargeLowfield = nil} + + var optionalSeqLargeMidfield: ProtobufUnittest_EnumParseTester.SeqLarge { + get {return _storage._optionalSeqLargeMidfield ?? .default} + set {_uniqueStorage()._optionalSeqLargeMidfield = newValue} + } + /// Returns true if `optionalSeqLargeMidfield` has been explicitly set. + var hasOptionalSeqLargeMidfield: Bool {return _storage._optionalSeqLargeMidfield != nil} + /// Clears the value of `optionalSeqLargeMidfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalSeqLargeMidfield() {_uniqueStorage()._optionalSeqLargeMidfield = nil} + + var optionalSeqLargeHifield: ProtobufUnittest_EnumParseTester.SeqLarge { + get {return _storage._optionalSeqLargeHifield ?? .default} + set {_uniqueStorage()._optionalSeqLargeHifield = newValue} + } + /// Returns true if `optionalSeqLargeHifield` has been explicitly set. + var hasOptionalSeqLargeHifield: Bool {return _storage._optionalSeqLargeHifield != nil} + /// Clears the value of `optionalSeqLargeHifield`. Subsequent reads from it will return its default value. + mutating func clearOptionalSeqLargeHifield() {_uniqueStorage()._optionalSeqLargeHifield = nil} + + var repeatedSeqLargeLowfield: [ProtobufUnittest_EnumParseTester.SeqLarge] { + get {return _storage._repeatedSeqLargeLowfield} + set {_uniqueStorage()._repeatedSeqLargeLowfield = newValue} + } + + var repeatedSeqLargeMidfield: [ProtobufUnittest_EnumParseTester.SeqLarge] { + get {return _storage._repeatedSeqLargeMidfield} + set {_uniqueStorage()._repeatedSeqLargeMidfield = newValue} + } + + var repeatedSeqLargeHifield: [ProtobufUnittest_EnumParseTester.SeqLarge] { + get {return _storage._repeatedSeqLargeHifield} + set {_uniqueStorage()._repeatedSeqLargeHifield = newValue} + } + + var packedSeqLargeLowfield: [ProtobufUnittest_EnumParseTester.SeqLarge] { + get {return _storage._packedSeqLargeLowfield} + set {_uniqueStorage()._packedSeqLargeLowfield = newValue} + } + + var packedSeqLargeMidfield: [ProtobufUnittest_EnumParseTester.SeqLarge] { + get {return _storage._packedSeqLargeMidfield} + set {_uniqueStorage()._packedSeqLargeMidfield = newValue} + } + + var packedSeqLargeHifield: [ProtobufUnittest_EnumParseTester.SeqLarge] { + get {return _storage._packedSeqLargeHifield} + set {_uniqueStorage()._packedSeqLargeHifield = newValue} + } + + var optionalArbitraryLowfield: ProtobufUnittest_EnumParseTester.Arbitrary { + get {return _storage._optionalArbitraryLowfield ?? .default} + set {_uniqueStorage()._optionalArbitraryLowfield = newValue} + } + /// Returns true if `optionalArbitraryLowfield` has been explicitly set. + var hasOptionalArbitraryLowfield: Bool {return _storage._optionalArbitraryLowfield != nil} + /// Clears the value of `optionalArbitraryLowfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalArbitraryLowfield() {_uniqueStorage()._optionalArbitraryLowfield = nil} + + var optionalArbitraryMidfield: ProtobufUnittest_EnumParseTester.Arbitrary { + get {return _storage._optionalArbitraryMidfield ?? .default} + set {_uniqueStorage()._optionalArbitraryMidfield = newValue} + } + /// Returns true if `optionalArbitraryMidfield` has been explicitly set. + var hasOptionalArbitraryMidfield: Bool {return _storage._optionalArbitraryMidfield != nil} + /// Clears the value of `optionalArbitraryMidfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalArbitraryMidfield() {_uniqueStorage()._optionalArbitraryMidfield = nil} + + var optionalArbitraryHifield: ProtobufUnittest_EnumParseTester.Arbitrary { + get {return _storage._optionalArbitraryHifield ?? .default} + set {_uniqueStorage()._optionalArbitraryHifield = newValue} + } + /// Returns true if `optionalArbitraryHifield` has been explicitly set. + var hasOptionalArbitraryHifield: Bool {return _storage._optionalArbitraryHifield != nil} + /// Clears the value of `optionalArbitraryHifield`. Subsequent reads from it will return its default value. + mutating func clearOptionalArbitraryHifield() {_uniqueStorage()._optionalArbitraryHifield = nil} + + var repeatedArbitraryLowfield: [ProtobufUnittest_EnumParseTester.Arbitrary] { + get {return _storage._repeatedArbitraryLowfield} + set {_uniqueStorage()._repeatedArbitraryLowfield = newValue} + } + + var repeatedArbitraryMidfield: [ProtobufUnittest_EnumParseTester.Arbitrary] { + get {return _storage._repeatedArbitraryMidfield} + set {_uniqueStorage()._repeatedArbitraryMidfield = newValue} + } + + var repeatedArbitraryHifield: [ProtobufUnittest_EnumParseTester.Arbitrary] { + get {return _storage._repeatedArbitraryHifield} + set {_uniqueStorage()._repeatedArbitraryHifield = newValue} + } + + var packedArbitraryLowfield: [ProtobufUnittest_EnumParseTester.Arbitrary] { + get {return _storage._packedArbitraryLowfield} + set {_uniqueStorage()._packedArbitraryLowfield = newValue} + } + + var packedArbitraryMidfield: [ProtobufUnittest_EnumParseTester.Arbitrary] { + get {return _storage._packedArbitraryMidfield} + set {_uniqueStorage()._packedArbitraryMidfield = newValue} + } + + var packedArbitraryHifield: [ProtobufUnittest_EnumParseTester.Arbitrary] { + get {return _storage._packedArbitraryHifield} + set {_uniqueStorage()._packedArbitraryHifield = newValue} + } + + /// An arbitrary field we can append to to break the runs of repeated fields. + var otherField: Int32 { + get {return _storage._otherField ?? 0} + set {_uniqueStorage()._otherField = newValue} + } + /// Returns true if `otherField` has been explicitly set. + var hasOtherField: Bool {return _storage._otherField != nil} + /// Clears the value of `otherField`. Subsequent reads from it will return its default value. + mutating func clearOtherField() {_uniqueStorage()._otherField = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum SeqSmall0: SwiftProtobuf.Enum { + typealias RawValue = Int + case `default` // = 0 + case seqSmall01 // = 1 + case seqSmall02 // = 2 + + init() { + self = .default + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .default + case 1: self = .seqSmall01 + case 2: self = .seqSmall02 + default: return nil + } + } + + var rawValue: Int { + switch self { + case .default: return 0 + case .seqSmall01: return 1 + case .seqSmall02: return 2 + } + } + + } + + enum SeqSmall1: SwiftProtobuf.Enum { + typealias RawValue = Int + case `default` // = 1 + case seqSmall12 // = 2 + case seqSmall13 // = 3 + + init() { + self = .default + } + + init?(rawValue: Int) { + switch rawValue { + case 1: self = .default + case 2: self = .seqSmall12 + case 3: self = .seqSmall13 + default: return nil + } + } + + var rawValue: Int { + switch self { + case .default: return 1 + case .seqSmall12: return 2 + case .seqSmall13: return 3 + } + } + + } + + enum SeqLarge: SwiftProtobuf.Enum { + typealias RawValue = Int + case `default` // = -1 + case seqLarge0 // = 0 + case seqLarge1 // = 1 + case seqLarge2 // = 2 + case seqLarge3 // = 3 + case seqLarge4 // = 4 + case seqLarge5 // = 5 + case seqLarge6 // = 6 + case seqLarge7 // = 7 + case seqLarge8 // = 8 + case seqLarge9 // = 9 + case seqLarge10 // = 10 + case seqLarge11 // = 11 + case seqLarge12 // = 12 + case seqLarge13 // = 13 + case seqLarge14 // = 14 + case seqLarge15 // = 15 + case seqLarge16 // = 16 + case seqLarge17 // = 17 + case seqLarge18 // = 18 + case seqLarge19 // = 19 + case seqLarge20 // = 20 + case seqLarge21 // = 21 + case seqLarge22 // = 22 + case seqLarge23 // = 23 + case seqLarge24 // = 24 + case seqLarge25 // = 25 + case seqLarge26 // = 26 + case seqLarge27 // = 27 + case seqLarge28 // = 28 + case seqLarge29 // = 29 + case seqLarge30 // = 30 + case seqLarge31 // = 31 + case seqLarge32 // = 32 + case seqLarge33 // = 33 + + init() { + self = .default + } + + init?(rawValue: Int) { + switch rawValue { + case -1: self = .default + case 0: self = .seqLarge0 + case 1: self = .seqLarge1 + case 2: self = .seqLarge2 + case 3: self = .seqLarge3 + case 4: self = .seqLarge4 + case 5: self = .seqLarge5 + case 6: self = .seqLarge6 + case 7: self = .seqLarge7 + case 8: self = .seqLarge8 + case 9: self = .seqLarge9 + case 10: self = .seqLarge10 + case 11: self = .seqLarge11 + case 12: self = .seqLarge12 + case 13: self = .seqLarge13 + case 14: self = .seqLarge14 + case 15: self = .seqLarge15 + case 16: self = .seqLarge16 + case 17: self = .seqLarge17 + case 18: self = .seqLarge18 + case 19: self = .seqLarge19 + case 20: self = .seqLarge20 + case 21: self = .seqLarge21 + case 22: self = .seqLarge22 + case 23: self = .seqLarge23 + case 24: self = .seqLarge24 + case 25: self = .seqLarge25 + case 26: self = .seqLarge26 + case 27: self = .seqLarge27 + case 28: self = .seqLarge28 + case 29: self = .seqLarge29 + case 30: self = .seqLarge30 + case 31: self = .seqLarge31 + case 32: self = .seqLarge32 + case 33: self = .seqLarge33 + default: return nil + } + } + + var rawValue: Int { + switch self { + case .default: return -1 + case .seqLarge0: return 0 + case .seqLarge1: return 1 + case .seqLarge2: return 2 + case .seqLarge3: return 3 + case .seqLarge4: return 4 + case .seqLarge5: return 5 + case .seqLarge6: return 6 + case .seqLarge7: return 7 + case .seqLarge8: return 8 + case .seqLarge9: return 9 + case .seqLarge10: return 10 + case .seqLarge11: return 11 + case .seqLarge12: return 12 + case .seqLarge13: return 13 + case .seqLarge14: return 14 + case .seqLarge15: return 15 + case .seqLarge16: return 16 + case .seqLarge17: return 17 + case .seqLarge18: return 18 + case .seqLarge19: return 19 + case .seqLarge20: return 20 + case .seqLarge21: return 21 + case .seqLarge22: return 22 + case .seqLarge23: return 23 + case .seqLarge24: return 24 + case .seqLarge25: return 25 + case .seqLarge26: return 26 + case .seqLarge27: return 27 + case .seqLarge28: return 28 + case .seqLarge29: return 29 + case .seqLarge30: return 30 + case .seqLarge31: return 31 + case .seqLarge32: return 32 + case .seqLarge33: return 33 + } + } + + } + + enum Arbitrary: SwiftProtobuf.Enum { + typealias RawValue = Int + case `default` // = -123123 + case arbitrary1 // = -123 + case arbitrary2 // = 213 + case arbitrary3 // = 213213 + case min // = -2147483648 + case max // = 2147483647 + + init() { + self = .default + } + + init?(rawValue: Int) { + switch rawValue { + case -2147483648: self = .min + case -123123: self = .default + case -123: self = .arbitrary1 + case 213: self = .arbitrary2 + case 213213: self = .arbitrary3 + case 2147483647: self = .max + default: return nil + } + } + + var rawValue: Int { + switch self { + case .min: return -2147483648 + case .default: return -123123 + case .arbitrary1: return -123 + case .arbitrary2: return 213 + case .arbitrary3: return 213213 + case .max: return 2147483647 + } + } + + } + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _storage = _StorageClass.defaultInstance +} + +/// This message contains different kind of bool fields to exercise the different +/// parsers in table-drived. +struct ProtobufUnittest_BoolParseTester: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalBoolLowfield: Bool { + get {return _optionalBoolLowfield ?? false} + set {_optionalBoolLowfield = newValue} + } + /// Returns true if `optionalBoolLowfield` has been explicitly set. + var hasOptionalBoolLowfield: Bool {return self._optionalBoolLowfield != nil} + /// Clears the value of `optionalBoolLowfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalBoolLowfield() {self._optionalBoolLowfield = nil} + + var optionalBoolMidfield: Bool { + get {return _optionalBoolMidfield ?? false} + set {_optionalBoolMidfield = newValue} + } + /// Returns true if `optionalBoolMidfield` has been explicitly set. + var hasOptionalBoolMidfield: Bool {return self._optionalBoolMidfield != nil} + /// Clears the value of `optionalBoolMidfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalBoolMidfield() {self._optionalBoolMidfield = nil} + + var optionalBoolHifield: Bool { + get {return _optionalBoolHifield ?? false} + set {_optionalBoolHifield = newValue} + } + /// Returns true if `optionalBoolHifield` has been explicitly set. + var hasOptionalBoolHifield: Bool {return self._optionalBoolHifield != nil} + /// Clears the value of `optionalBoolHifield`. Subsequent reads from it will return its default value. + mutating func clearOptionalBoolHifield() {self._optionalBoolHifield = nil} + + var repeatedBoolLowfield: [Bool] = [] + + var repeatedBoolMidfield: [Bool] = [] + + var repeatedBoolHifield: [Bool] = [] + + var packedBoolLowfield: [Bool] = [] + + var packedBoolMidfield: [Bool] = [] + + var packedBoolHifield: [Bool] = [] + + /// An arbitrary field we can append to to break the runs of repeated fields. + var otherField: Int32 { + get {return _otherField ?? 0} + set {_otherField = newValue} + } + /// Returns true if `otherField` has been explicitly set. + var hasOtherField: Bool {return self._otherField != nil} + /// Clears the value of `otherField`. Subsequent reads from it will return its default value. + mutating func clearOtherField() {self._otherField = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _optionalBoolLowfield: Bool? = nil + fileprivate var _optionalBoolMidfield: Bool? = nil + fileprivate var _optionalBoolHifield: Bool? = nil + fileprivate var _otherField: Int32? = nil +} + +struct ProtobufUnittest_Int32ParseTester: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalInt32Lowfield: Int32 { + get {return _optionalInt32Lowfield ?? 0} + set {_optionalInt32Lowfield = newValue} + } + /// Returns true if `optionalInt32Lowfield` has been explicitly set. + var hasOptionalInt32Lowfield: Bool {return self._optionalInt32Lowfield != nil} + /// Clears the value of `optionalInt32Lowfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt32Lowfield() {self._optionalInt32Lowfield = nil} + + var optionalInt32Midfield: Int32 { + get {return _optionalInt32Midfield ?? 0} + set {_optionalInt32Midfield = newValue} + } + /// Returns true if `optionalInt32Midfield` has been explicitly set. + var hasOptionalInt32Midfield: Bool {return self._optionalInt32Midfield != nil} + /// Clears the value of `optionalInt32Midfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt32Midfield() {self._optionalInt32Midfield = nil} + + var optionalInt32Hifield: Int32 { + get {return _optionalInt32Hifield ?? 0} + set {_optionalInt32Hifield = newValue} + } + /// Returns true if `optionalInt32Hifield` has been explicitly set. + var hasOptionalInt32Hifield: Bool {return self._optionalInt32Hifield != nil} + /// Clears the value of `optionalInt32Hifield`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt32Hifield() {self._optionalInt32Hifield = nil} + + var repeatedInt32Lowfield: [Int32] = [] + + var repeatedInt32Midfield: [Int32] = [] + + var repeatedInt32Hifield: [Int32] = [] + + var packedInt32Lowfield: [Int32] = [] + + var packedInt32Midfield: [Int32] = [] + + var packedInt32Hifield: [Int32] = [] + + /// An arbitrary field we can append to to break the runs of repeated fields. + var otherField: Int32 { + get {return _otherField ?? 0} + set {_otherField = newValue} + } + /// Returns true if `otherField` has been explicitly set. + var hasOtherField: Bool {return self._otherField != nil} + /// Clears the value of `otherField`. Subsequent reads from it will return its default value. + mutating func clearOtherField() {self._otherField = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _optionalInt32Lowfield: Int32? = nil + fileprivate var _optionalInt32Midfield: Int32? = nil + fileprivate var _optionalInt32Hifield: Int32? = nil + fileprivate var _otherField: Int32? = nil +} + +struct ProtobufUnittest_Int64ParseTester: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalInt64Lowfield: Int64 { + get {return _optionalInt64Lowfield ?? 0} + set {_optionalInt64Lowfield = newValue} + } + /// Returns true if `optionalInt64Lowfield` has been explicitly set. + var hasOptionalInt64Lowfield: Bool {return self._optionalInt64Lowfield != nil} + /// Clears the value of `optionalInt64Lowfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt64Lowfield() {self._optionalInt64Lowfield = nil} + + var optionalInt64Midfield: Int64 { + get {return _optionalInt64Midfield ?? 0} + set {_optionalInt64Midfield = newValue} + } + /// Returns true if `optionalInt64Midfield` has been explicitly set. + var hasOptionalInt64Midfield: Bool {return self._optionalInt64Midfield != nil} + /// Clears the value of `optionalInt64Midfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt64Midfield() {self._optionalInt64Midfield = nil} + + var optionalInt64Hifield: Int64 { + get {return _optionalInt64Hifield ?? 0} + set {_optionalInt64Hifield = newValue} + } + /// Returns true if `optionalInt64Hifield` has been explicitly set. + var hasOptionalInt64Hifield: Bool {return self._optionalInt64Hifield != nil} + /// Clears the value of `optionalInt64Hifield`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt64Hifield() {self._optionalInt64Hifield = nil} + + var repeatedInt64Lowfield: [Int64] = [] + + var repeatedInt64Midfield: [Int64] = [] + + var repeatedInt64Hifield: [Int64] = [] + + var packedInt64Lowfield: [Int64] = [] + + var packedInt64Midfield: [Int64] = [] + + var packedInt64Hifield: [Int64] = [] + + /// An arbitrary field we can append to to break the runs of repeated fields. + var otherField: Int32 { + get {return _otherField ?? 0} + set {_otherField = newValue} + } + /// Returns true if `otherField` has been explicitly set. + var hasOtherField: Bool {return self._otherField != nil} + /// Clears the value of `otherField`. Subsequent reads from it will return its default value. + mutating func clearOtherField() {self._otherField = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _optionalInt64Lowfield: Int64? = nil + fileprivate var _optionalInt64Midfield: Int64? = nil + fileprivate var _optionalInt64Hifield: Int64? = nil + fileprivate var _otherField: Int32? = nil +} + +struct ProtobufUnittest_InlinedStringIdxRegressionProto { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// We mix data to make sure aux ids and inlined string idx do not match. + /// aux_idx == inlined_string_idx == 1 + var str1: String { + get {return _storage._str1 ?? String()} + set {_uniqueStorage()._str1 = newValue} + } + /// Returns true if `str1` has been explicitly set. + var hasStr1: Bool {return _storage._str1 != nil} + /// Clears the value of `str1`. Subsequent reads from it will return its default value. + mutating func clearStr1() {_uniqueStorage()._str1 = nil} + + /// aux_idx == 2 + var sub: ProtobufUnittest_InlinedStringIdxRegressionProto { + get {return _storage._sub ?? ProtobufUnittest_InlinedStringIdxRegressionProto()} + set {_uniqueStorage()._sub = newValue} + } + /// Returns true if `sub` has been explicitly set. + var hasSub: Bool {return _storage._sub != nil} + /// Clears the value of `sub`. Subsequent reads from it will return its default value. + mutating func clearSub() {_uniqueStorage()._sub = nil} + + /// aux_idx == 3, inlined_string_idx == 2 + var str2: String { + get {return _storage._str2 ?? String()} + set {_uniqueStorage()._str2 = newValue} + } + /// Returns true if `str2` has been explicitly set. + var hasStr2: Bool {return _storage._str2 != nil} + /// Clears the value of `str2`. Subsequent reads from it will return its default value. + mutating func clearStr2() {_uniqueStorage()._str2 = nil} + + /// aux_idx == 4, inlined_string_idx == 3 + var str3: Data { + get {return _storage._str3 ?? Data()} + set {_uniqueStorage()._str3 = newValue} + } + /// Returns true if `str3` has been explicitly set. + var hasStr3: Bool {return _storage._str3 != nil} + /// Clears the value of `str3`. Subsequent reads from it will return its default value. + mutating func clearStr3() {_uniqueStorage()._str3 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufUnittest_StringParseTester: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalStringLowfield: String { + get {return _optionalStringLowfield ?? String()} + set {_optionalStringLowfield = newValue} + } + /// Returns true if `optionalStringLowfield` has been explicitly set. + var hasOptionalStringLowfield: Bool {return self._optionalStringLowfield != nil} + /// Clears the value of `optionalStringLowfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalStringLowfield() {self._optionalStringLowfield = nil} + + var optionalStringMidfield: String { + get {return _optionalStringMidfield ?? String()} + set {_optionalStringMidfield = newValue} + } + /// Returns true if `optionalStringMidfield` has been explicitly set. + var hasOptionalStringMidfield: Bool {return self._optionalStringMidfield != nil} + /// Clears the value of `optionalStringMidfield`. Subsequent reads from it will return its default value. + mutating func clearOptionalStringMidfield() {self._optionalStringMidfield = nil} + + var optionalStringHifield: String { + get {return _optionalStringHifield ?? String()} + set {_optionalStringHifield = newValue} + } + /// Returns true if `optionalStringHifield` has been explicitly set. + var hasOptionalStringHifield: Bool {return self._optionalStringHifield != nil} + /// Clears the value of `optionalStringHifield`. Subsequent reads from it will return its default value. + mutating func clearOptionalStringHifield() {self._optionalStringHifield = nil} + + var repeatedStringLowfield: [String] = [] + + var repeatedStringMidfield: [String] = [] + + var repeatedStringHifield: [String] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _optionalStringLowfield: String? = nil + fileprivate var _optionalStringMidfield: String? = nil + fileprivate var _optionalStringHifield: String? = nil +} + +struct ProtobufUnittest_BadFieldNames { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalInt32: Int32 { + get {return _optionalInt32 ?? 0} + set {_optionalInt32 = newValue} + } + /// Returns true if `optionalInt32` has been explicitly set. + var hasOptionalInt32: Bool {return self._optionalInt32 != nil} + /// Clears the value of `optionalInt32`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt32() {self._optionalInt32 = nil} + + var `for`: Int32 { + get {return _for ?? 0} + set {_for = newValue} + } + /// Returns true if ``for`` has been explicitly set. + var hasFor: Bool {return self._for != nil} + /// Clears the value of ``for``. Subsequent reads from it will return its default value. + mutating func clearFor() {self._for = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalInt32: Int32? = nil + fileprivate var _for: Int32? = nil +} + +struct ProtobufUnittest_TestNestedMessageRedaction { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalUnredactedNestedString: String { + get {return _optionalUnredactedNestedString ?? String()} + set {_optionalUnredactedNestedString = newValue} + } + /// Returns true if `optionalUnredactedNestedString` has been explicitly set. + var hasOptionalUnredactedNestedString: Bool {return self._optionalUnredactedNestedString != nil} + /// Clears the value of `optionalUnredactedNestedString`. Subsequent reads from it will return its default value. + mutating func clearOptionalUnredactedNestedString() {self._optionalUnredactedNestedString = nil} + + var optionalRedactedNestedString: String { + get {return _optionalRedactedNestedString ?? String()} + set {_optionalRedactedNestedString = newValue} + } + /// Returns true if `optionalRedactedNestedString` has been explicitly set. + var hasOptionalRedactedNestedString: Bool {return self._optionalRedactedNestedString != nil} + /// Clears the value of `optionalRedactedNestedString`. Subsequent reads from it will return its default value. + mutating func clearOptionalRedactedNestedString() {self._optionalRedactedNestedString = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalUnredactedNestedString: String? = nil + fileprivate var _optionalRedactedNestedString: String? = nil +} + +struct ProtobufUnittest_RedactedFields { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalRedactedString: String { + get {return _optionalRedactedString ?? String()} + set {_optionalRedactedString = newValue} + } + /// Returns true if `optionalRedactedString` has been explicitly set. + var hasOptionalRedactedString: Bool {return self._optionalRedactedString != nil} + /// Clears the value of `optionalRedactedString`. Subsequent reads from it will return its default value. + mutating func clearOptionalRedactedString() {self._optionalRedactedString = nil} + + var optionalUnredactedString: String { + get {return _optionalUnredactedString ?? String()} + set {_optionalUnredactedString = newValue} + } + /// Returns true if `optionalUnredactedString` has been explicitly set. + var hasOptionalUnredactedString: Bool {return self._optionalUnredactedString != nil} + /// Clears the value of `optionalUnredactedString`. Subsequent reads from it will return its default value. + mutating func clearOptionalUnredactedString() {self._optionalUnredactedString = nil} + + var repeatedRedactedString: [String] = [] + + var repeatedUnredactedString: [String] = [] + + var optionalRedactedMessage: ProtobufUnittest_TestNestedMessageRedaction { + get {return _optionalRedactedMessage ?? ProtobufUnittest_TestNestedMessageRedaction()} + set {_optionalRedactedMessage = newValue} + } + /// Returns true if `optionalRedactedMessage` has been explicitly set. + var hasOptionalRedactedMessage: Bool {return self._optionalRedactedMessage != nil} + /// Clears the value of `optionalRedactedMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalRedactedMessage() {self._optionalRedactedMessage = nil} + + var optionalUnredactedMessage: ProtobufUnittest_TestNestedMessageRedaction { + get {return _optionalUnredactedMessage ?? ProtobufUnittest_TestNestedMessageRedaction()} + set {_optionalUnredactedMessage = newValue} + } + /// Returns true if `optionalUnredactedMessage` has been explicitly set. + var hasOptionalUnredactedMessage: Bool {return self._optionalUnredactedMessage != nil} + /// Clears the value of `optionalUnredactedMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalUnredactedMessage() {self._optionalUnredactedMessage = nil} + + var repeatedRedactedMessage: [ProtobufUnittest_TestNestedMessageRedaction] = [] + + var repeatedUnredactedMessage: [ProtobufUnittest_TestNestedMessageRedaction] = [] + + var mapRedactedString: Dictionary = [:] + + var mapUnredactedString: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalRedactedString: String? = nil + fileprivate var _optionalUnredactedString: String? = nil + fileprivate var _optionalRedactedMessage: ProtobufUnittest_TestNestedMessageRedaction? = nil + fileprivate var _optionalUnredactedMessage: ProtobufUnittest_TestNestedMessageRedaction? = nil +} + +struct ProtobufUnittest_TestCord { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalBytesCord: Data { + get {return _optionalBytesCord ?? Data()} + set {_optionalBytesCord = newValue} + } + /// Returns true if `optionalBytesCord` has been explicitly set. + var hasOptionalBytesCord: Bool {return self._optionalBytesCord != nil} + /// Clears the value of `optionalBytesCord`. Subsequent reads from it will return its default value. + mutating func clearOptionalBytesCord() {self._optionalBytesCord = nil} + + var optionalBytesCordDefault: Data { + get {return _optionalBytesCordDefault ?? Data([104, 101, 108, 108, 111])} + set {_optionalBytesCordDefault = newValue} + } + /// Returns true if `optionalBytesCordDefault` has been explicitly set. + var hasOptionalBytesCordDefault: Bool {return self._optionalBytesCordDefault != nil} + /// Clears the value of `optionalBytesCordDefault`. Subsequent reads from it will return its default value. + mutating func clearOptionalBytesCordDefault() {self._optionalBytesCordDefault = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalBytesCord: Data? = nil + fileprivate var _optionalBytesCordDefault: Data? = nil +} + +struct ProtobufUnittest_TestPackedEnumSmallRange { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var vals: [ProtobufUnittest_TestPackedEnumSmallRange.NestedEnum] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case unspecified // = 0 + case foo // = 1 + case bar // = 2 + case baz // = 3 + + init() { + self = .unspecified + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unspecified + case 1: self = .foo + case 2: self = .bar + case 3: self = .baz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unspecified: return 0 + case .foo: return 1 + case .bar: return 2 + case .baz: return 3 + } + } + + } + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittest_TestAllTypes: @unchecked Sendable {} +extension ProtobufUnittest_TestAllTypes.OneOf_OneofField: @unchecked Sendable {} +extension ProtobufUnittest_TestAllTypes.NestedMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestAllTypes.OptionalGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestAllTypes.RepeatedGroup: @unchecked Sendable {} +extension ProtobufUnittest_NestedTestAllTypes: @unchecked Sendable {} +extension ProtobufUnittest_TestDeprecatedFields: @unchecked Sendable {} +extension ProtobufUnittest_TestDeprecatedFields.OneOf_OneofFields: @unchecked Sendable {} +extension ProtobufUnittest_TestDeprecatedMessage: @unchecked Sendable {} +extension ProtobufUnittest_ForeignMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestReservedFields: @unchecked Sendable {} +extension ProtobufUnittest_TestAllExtensions: @unchecked Sendable {} +extension ProtobufUnittest_OptionalGroup_extension: @unchecked Sendable {} +extension ProtobufUnittest_RepeatedGroup_extension: @unchecked Sendable {} +extension ProtobufUnittest_TestMixedFieldsAndExtensions: @unchecked Sendable {} +extension ProtobufUnittest_TestGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestGroup.OptionalGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestGroupExtension: @unchecked Sendable {} +extension ProtobufUnittest_TestNestedExtension: @unchecked Sendable {} +extension ProtobufUnittest_TestNestedExtension.OptionalGroup_extension: @unchecked Sendable {} +extension ProtobufUnittest_TestChildExtension: @unchecked Sendable {} +extension ProtobufUnittest_TestChildExtensionData: @unchecked Sendable {} +extension ProtobufUnittest_TestChildExtensionData.NestedTestAllExtensionsData: @unchecked Sendable {} +extension ProtobufUnittest_TestChildExtensionData.NestedTestAllExtensionsData.NestedDynamicExtensions: @unchecked Sendable {} +extension ProtobufUnittest_TestNestedChildExtension: @unchecked Sendable {} +extension ProtobufUnittest_TestNestedChildExtensionData: @unchecked Sendable {} +extension ProtobufUnittest_TestRequired: @unchecked Sendable {} +extension ProtobufUnittest_TestRequiredForeign: @unchecked Sendable {} +extension ProtobufUnittest_TestRequiredMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestNestedRequiredForeign: @unchecked Sendable {} +extension ProtobufUnittest_TestForeignNested: @unchecked Sendable {} +extension ProtobufUnittest_TestEmptyMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestEmptyMessageWithExtensions: @unchecked Sendable {} +extension ProtobufUnittest_TestPickleNestedMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestPickleNestedMessage.NestedMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestPickleNestedMessage.NestedMessage.NestedNestedMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestMultipleExtensionRanges: @unchecked Sendable {} +extension ProtobufUnittest_TestReallyLargeTagNumber: @unchecked Sendable {} +extension ProtobufUnittest_TestRecursiveMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestMutualRecursionA: @unchecked Sendable {} +extension ProtobufUnittest_TestMutualRecursionA.SubMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestMutualRecursionA.SubGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestMutualRecursionA.SubGroupR: @unchecked Sendable {} +extension ProtobufUnittest_TestMutualRecursionB: @unchecked Sendable {} +extension ProtobufUnittest_TestIsInitialized: @unchecked Sendable {} +extension ProtobufUnittest_TestIsInitialized.SubMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestIsInitialized.SubMessage.SubGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestDupFieldNumber: @unchecked Sendable {} +extension ProtobufUnittest_TestDupFieldNumber.Foo: @unchecked Sendable {} +extension ProtobufUnittest_TestDupFieldNumber.Bar: @unchecked Sendable {} +extension ProtobufUnittest_TestEagerMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestLazyMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestLazyMessageRepeated: @unchecked Sendable {} +extension ProtobufUnittest_TestEagerMaybeLazy: @unchecked Sendable {} +extension ProtobufUnittest_TestEagerMaybeLazy.NestedMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestNestedMessageHasBits: @unchecked Sendable {} +extension ProtobufUnittest_TestNestedMessageHasBits.NestedMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestCamelCaseFieldNames: @unchecked Sendable {} +extension ProtobufUnittest_TestFieldOrderings: @unchecked Sendable {} +extension ProtobufUnittest_TestFieldOrderings.NestedMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestExtensionOrderings1: @unchecked Sendable {} +extension ProtobufUnittest_TestExtensionOrderings2: @unchecked Sendable {} +extension ProtobufUnittest_TestExtensionOrderings2.TestExtensionOrderings3: @unchecked Sendable {} +extension ProtobufUnittest_TestExtremeDefaultValues: @unchecked Sendable {} +extension ProtobufUnittest_SparseEnumMessage: @unchecked Sendable {} +extension ProtobufUnittest_OneString: @unchecked Sendable {} +extension ProtobufUnittest_MoreString: @unchecked Sendable {} +extension ProtobufUnittest_OneBytes: @unchecked Sendable {} +extension ProtobufUnittest_MoreBytes: @unchecked Sendable {} +extension ProtobufUnittest_ManyOptionalString: @unchecked Sendable {} +extension ProtobufUnittest_Int32Message: @unchecked Sendable {} +extension ProtobufUnittest_Uint32Message: @unchecked Sendable {} +extension ProtobufUnittest_Int64Message: @unchecked Sendable {} +extension ProtobufUnittest_Uint64Message: @unchecked Sendable {} +extension ProtobufUnittest_BoolMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestOneof: @unchecked Sendable {} +extension ProtobufUnittest_TestOneof.OneOf_Foo: @unchecked Sendable {} +extension ProtobufUnittest_TestOneof.FooGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestOneofBackwardsCompatible: @unchecked Sendable {} +extension ProtobufUnittest_TestOneofBackwardsCompatible.FooGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestOneof2: @unchecked Sendable {} +extension ProtobufUnittest_TestOneof2.OneOf_Foo: @unchecked Sendable {} +extension ProtobufUnittest_TestOneof2.OneOf_Bar: @unchecked Sendable {} +extension ProtobufUnittest_TestOneof2.FooGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestOneof2.NestedMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestRequiredOneof: @unchecked Sendable {} +extension ProtobufUnittest_TestRequiredOneof.OneOf_Foo: @unchecked Sendable {} +extension ProtobufUnittest_TestRequiredOneof.NestedMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestPackedTypes: @unchecked Sendable {} +extension ProtobufUnittest_TestUnpackedTypes: @unchecked Sendable {} +extension ProtobufUnittest_TestPackedExtensions: @unchecked Sendable {} +extension ProtobufUnittest_TestUnpackedExtensions: @unchecked Sendable {} +extension ProtobufUnittest_TestDynamicExtensions: @unchecked Sendable {} +extension ProtobufUnittest_TestDynamicExtensions.DynamicMessageType: @unchecked Sendable {} +extension ProtobufUnittest_TestRepeatedString: @unchecked Sendable {} +extension ProtobufUnittest_TestRepeatedScalarDifferentTagSizes: @unchecked Sendable {} +extension ProtobufUnittest_TestParsingMerge: @unchecked Sendable {} +extension ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator: @unchecked Sendable {} +extension ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator.Group1: @unchecked Sendable {} +extension ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator.Group2: @unchecked Sendable {} +extension ProtobufUnittest_TestParsingMerge.OptionalGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestParsingMerge.RepeatedGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestMergeException: @unchecked Sendable {} +extension ProtobufUnittest_TestCommentInjectionMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestMessageSize: @unchecked Sendable {} +extension ProtobufUnittest_FooRequest: @unchecked Sendable {} +extension ProtobufUnittest_FooResponse: @unchecked Sendable {} +extension ProtobufUnittest_FooClientMessage: @unchecked Sendable {} +extension ProtobufUnittest_FooServerMessage: @unchecked Sendable {} +extension ProtobufUnittest_BarRequest: @unchecked Sendable {} +extension ProtobufUnittest_BarResponse: @unchecked Sendable {} +extension ProtobufUnittest_TestJsonName: @unchecked Sendable {} +extension ProtobufUnittest_TestHugeFieldNumbers: @unchecked Sendable {} +extension ProtobufUnittest_TestHugeFieldNumbers.OneOf_OneofField: @unchecked Sendable {} +extension ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestExtensionInsideTable: @unchecked Sendable {} +extension ProtobufUnittest_TestNestedGroupExtensionOuter: @unchecked Sendable {} +extension ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2RepeatedGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2AnotherOptionalRepeatedGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestNestedGroupExtensionInnerExtension: @unchecked Sendable {} +extension ProtobufUnittest_TestExtensionRangeSerialize: @unchecked Sendable {} +extension ProtobufUnittest_TestVerifyInt32Simple: @unchecked Sendable {} +extension ProtobufUnittest_TestVerifyInt32: @unchecked Sendable {} +extension ProtobufUnittest_TestVerifyMostlyInt32: @unchecked Sendable {} +extension ProtobufUnittest_TestVerifyMostlyInt32BigFieldNumber: @unchecked Sendable {} +extension ProtobufUnittest_TestVerifyUint32Simple: @unchecked Sendable {} +extension ProtobufUnittest_TestVerifyUint32: @unchecked Sendable {} +extension ProtobufUnittest_TestVerifyOneUint32: @unchecked Sendable {} +extension ProtobufUnittest_TestVerifyOneInt32BigFieldNumber: @unchecked Sendable {} +extension ProtobufUnittest_TestVerifyInt32BigFieldNumber: @unchecked Sendable {} +extension ProtobufUnittest_TestVerifyUint32BigFieldNumber: @unchecked Sendable {} +extension ProtobufUnittest_TestVerifyBigFieldNumberUint32: @unchecked Sendable {} +extension ProtobufUnittest_TestVerifyBigFieldNumberUint32.Nested: @unchecked Sendable {} +extension ProtobufUnittest_EnumParseTester: @unchecked Sendable {} +extension ProtobufUnittest_BoolParseTester: @unchecked Sendable {} +extension ProtobufUnittest_Int32ParseTester: @unchecked Sendable {} +extension ProtobufUnittest_Int64ParseTester: @unchecked Sendable {} +extension ProtobufUnittest_InlinedStringIdxRegressionProto: @unchecked Sendable {} +extension ProtobufUnittest_StringParseTester: @unchecked Sendable {} +extension ProtobufUnittest_BadFieldNames: @unchecked Sendable {} +extension ProtobufUnittest_TestNestedMessageRedaction: @unchecked Sendable {} +extension ProtobufUnittest_RedactedFields: @unchecked Sendable {} +extension ProtobufUnittest_TestCord: @unchecked Sendable {} +extension ProtobufUnittest_TestPackedEnumSmallRange: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Extension support defined in unittest.proto. + +// MARK: - Extension Properties + +// Swift Extensions on the exteneded Messages to add easy access to the declared +// extension fields. The names are based on the extension field name from the proto +// declaration. To avoid naming collisions, the names are prefixed with the name of +// the scope where the extend directive occurs. + +extension ProtobufUnittest_BoolParseTester { + + var ProtobufUnittest_BoolParseTester_optionalBoolExt: Bool { + get {return getExtensionValue(ext: ProtobufUnittest_BoolParseTester.Extensions.optional_bool_ext) ?? false} + set {setExtensionValue(ext: ProtobufUnittest_BoolParseTester.Extensions.optional_bool_ext, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_BoolParseTester.Extensions.optional_bool_ext` + /// has been explicitly set. + var hasProtobufUnittest_BoolParseTester_optionalBoolExt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_BoolParseTester.Extensions.optional_bool_ext) + } + /// Clears the value of extension `ProtobufUnittest_BoolParseTester.Extensions.optional_bool_ext`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_BoolParseTester_optionalBoolExt() { + clearExtensionValue(ext: ProtobufUnittest_BoolParseTester.Extensions.optional_bool_ext) + } + + var ProtobufUnittest_BoolParseTester_repeatedBoolExt: [Bool] { + get {return getExtensionValue(ext: ProtobufUnittest_BoolParseTester.Extensions.repeated_bool_ext) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_BoolParseTester.Extensions.repeated_bool_ext, value: newValue)} + } + + var ProtobufUnittest_BoolParseTester_packedBoolExt: [Bool] { + get {return getExtensionValue(ext: ProtobufUnittest_BoolParseTester.Extensions.packed_bool_ext) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_BoolParseTester.Extensions.packed_bool_ext, value: newValue)} + } +} + +extension ProtobufUnittest_EnumParseTester { + + var ProtobufUnittest_EnumParseTester_optionalArbitraryExt: ProtobufUnittest_EnumParseTester.Arbitrary { + get {return getExtensionValue(ext: ProtobufUnittest_EnumParseTester.Extensions.optional_arbitrary_ext) ?? .default} + set {setExtensionValue(ext: ProtobufUnittest_EnumParseTester.Extensions.optional_arbitrary_ext, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_EnumParseTester.Extensions.optional_arbitrary_ext` + /// has been explicitly set. + var hasProtobufUnittest_EnumParseTester_optionalArbitraryExt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_EnumParseTester.Extensions.optional_arbitrary_ext) + } + /// Clears the value of extension `ProtobufUnittest_EnumParseTester.Extensions.optional_arbitrary_ext`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_EnumParseTester_optionalArbitraryExt() { + clearExtensionValue(ext: ProtobufUnittest_EnumParseTester.Extensions.optional_arbitrary_ext) + } + + var ProtobufUnittest_EnumParseTester_repeatedArbitraryExt: [ProtobufUnittest_EnumParseTester.Arbitrary] { + get {return getExtensionValue(ext: ProtobufUnittest_EnumParseTester.Extensions.repeated_arbitrary_ext) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_EnumParseTester.Extensions.repeated_arbitrary_ext, value: newValue)} + } + + var ProtobufUnittest_EnumParseTester_packedArbitraryExt: [ProtobufUnittest_EnumParseTester.Arbitrary] { + get {return getExtensionValue(ext: ProtobufUnittest_EnumParseTester.Extensions.packed_arbitrary_ext) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_EnumParseTester.Extensions.packed_arbitrary_ext, value: newValue)} + } +} + +extension ProtobufUnittest_Int32ParseTester { + + var ProtobufUnittest_Int32ParseTester_optionalInt32Ext: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Int32ParseTester.Extensions.optional_int32_ext) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Int32ParseTester.Extensions.optional_int32_ext, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Int32ParseTester.Extensions.optional_int32_ext` + /// has been explicitly set. + var hasProtobufUnittest_Int32ParseTester_optionalInt32Ext: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Int32ParseTester.Extensions.optional_int32_ext) + } + /// Clears the value of extension `ProtobufUnittest_Int32ParseTester.Extensions.optional_int32_ext`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_Int32ParseTester_optionalInt32Ext() { + clearExtensionValue(ext: ProtobufUnittest_Int32ParseTester.Extensions.optional_int32_ext) + } + + var ProtobufUnittest_Int32ParseTester_repeatedInt32Ext: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Int32ParseTester.Extensions.repeated_int32_ext) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Int32ParseTester.Extensions.repeated_int32_ext, value: newValue)} + } + + var ProtobufUnittest_Int32ParseTester_packedInt32Ext: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Int32ParseTester.Extensions.packed_int32_ext) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Int32ParseTester.Extensions.packed_int32_ext, value: newValue)} + } +} + +extension ProtobufUnittest_Int64ParseTester { + + var ProtobufUnittest_Int64ParseTester_optionalInt64Ext: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Int64ParseTester.Extensions.optional_int64_ext) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Int64ParseTester.Extensions.optional_int64_ext, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Int64ParseTester.Extensions.optional_int64_ext` + /// has been explicitly set. + var hasProtobufUnittest_Int64ParseTester_optionalInt64Ext: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Int64ParseTester.Extensions.optional_int64_ext) + } + /// Clears the value of extension `ProtobufUnittest_Int64ParseTester.Extensions.optional_int64_ext`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_Int64ParseTester_optionalInt64Ext() { + clearExtensionValue(ext: ProtobufUnittest_Int64ParseTester.Extensions.optional_int64_ext) + } + + var ProtobufUnittest_Int64ParseTester_repeatedInt64Ext: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Int64ParseTester.Extensions.repeated_int64_ext) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Int64ParseTester.Extensions.repeated_int64_ext, value: newValue)} + } + + var ProtobufUnittest_Int64ParseTester_packedInt64Ext: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Int64ParseTester.Extensions.packed_int64_ext) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Int64ParseTester.Extensions.packed_int64_ext, value: newValue)} + } +} + +extension ProtobufUnittest_StringParseTester { + + var ProtobufUnittest_StringParseTester_optionalStringExt: String { + get {return getExtensionValue(ext: ProtobufUnittest_StringParseTester.Extensions.optional_string_ext) ?? String()} + set {setExtensionValue(ext: ProtobufUnittest_StringParseTester.Extensions.optional_string_ext, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_StringParseTester.Extensions.optional_string_ext` + /// has been explicitly set. + var hasProtobufUnittest_StringParseTester_optionalStringExt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_StringParseTester.Extensions.optional_string_ext) + } + /// Clears the value of extension `ProtobufUnittest_StringParseTester.Extensions.optional_string_ext`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_StringParseTester_optionalStringExt() { + clearExtensionValue(ext: ProtobufUnittest_StringParseTester.Extensions.optional_string_ext) + } + + var ProtobufUnittest_StringParseTester_repeatedStringExt: [String] { + get {return getExtensionValue(ext: ProtobufUnittest_StringParseTester.Extensions.repeated_string_ext) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_StringParseTester.Extensions.repeated_string_ext, value: newValue)} + } +} + +extension ProtobufUnittest_TestAllExtensions { + + /// Singular + var ProtobufUnittest_optionalInt32Extension: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_int32_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_int32_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_int32_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalInt32Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_int32_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_int32_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalInt32Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_int32_extension) + } + + var ProtobufUnittest_optionalInt64Extension: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_int64_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_int64_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_int64_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalInt64Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_int64_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_int64_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalInt64Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_int64_extension) + } + + var ProtobufUnittest_optionalUint32Extension: UInt32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint32_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint32_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_uint32_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalUint32Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint32_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_uint32_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalUint32Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint32_extension) + } + + var ProtobufUnittest_optionalUint64Extension: UInt64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint64_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint64_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_uint64_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalUint64Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint64_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_uint64_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalUint64Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint64_extension) + } + + var ProtobufUnittest_optionalSint32Extension: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint32_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint32_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_sint32_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalSint32Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint32_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_sint32_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalSint32Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint32_extension) + } + + var ProtobufUnittest_optionalSint64Extension: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint64_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint64_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_sint64_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalSint64Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint64_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_sint64_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalSint64Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint64_extension) + } + + var ProtobufUnittest_optionalFixed32Extension: UInt32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed32_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed32_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_fixed32_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalFixed32Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed32_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_fixed32_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalFixed32Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed32_extension) + } + + var ProtobufUnittest_optionalFixed64Extension: UInt64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed64_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed64_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_fixed64_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalFixed64Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed64_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_fixed64_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalFixed64Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed64_extension) + } + + var ProtobufUnittest_optionalSfixed32Extension: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed32_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed32_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_sfixed32_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalSfixed32Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed32_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_sfixed32_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalSfixed32Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed32_extension) + } + + var ProtobufUnittest_optionalSfixed64Extension: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed64_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed64_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_sfixed64_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalSfixed64Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed64_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_sfixed64_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalSfixed64Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed64_extension) + } + + var ProtobufUnittest_optionalFloatExtension: Float { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_float_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_float_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_float_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalFloatExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_float_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_float_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalFloatExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_float_extension) + } + + var ProtobufUnittest_optionalDoubleExtension: Double { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_double_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_double_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_double_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalDoubleExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_double_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_double_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalDoubleExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_double_extension) + } + + var ProtobufUnittest_optionalBoolExtension: Bool { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_bool_extension) ?? false} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_bool_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_bool_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalBoolExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_bool_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_bool_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalBoolExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_bool_extension) + } + + var ProtobufUnittest_optionalStringExtension: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_extension) ?? String()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_string_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalStringExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_string_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalStringExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_extension) + } + + var ProtobufUnittest_optionalBytesExtension: Data { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_bytes_extension) ?? Data()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_bytes_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_bytes_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalBytesExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_bytes_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_bytes_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalBytesExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_bytes_extension) + } + + var ProtobufUnittest_optionalGroupExtension: ProtobufUnittest_OptionalGroup_extension { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_OptionalGroup_extension) ?? ProtobufUnittest_OptionalGroup_extension()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_OptionalGroup_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_OptionalGroup_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalGroupExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_OptionalGroup_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_OptionalGroup_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalGroupExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_OptionalGroup_extension) + } + + var ProtobufUnittest_optionalNestedMessageExtension: ProtobufUnittest_TestAllTypes.NestedMessage { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_message_extension) ?? ProtobufUnittest_TestAllTypes.NestedMessage()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_message_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_nested_message_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalNestedMessageExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_message_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_nested_message_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalNestedMessageExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_message_extension) + } + + var ProtobufUnittest_optionalForeignMessageExtension: ProtobufUnittest_ForeignMessage { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_message_extension) ?? ProtobufUnittest_ForeignMessage()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_message_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_foreign_message_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalForeignMessageExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_message_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_foreign_message_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalForeignMessageExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_message_extension) + } + + var ProtobufUnittest_optionalImportMessageExtension: ProtobufUnittestImport_ImportMessage { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_message_extension) ?? ProtobufUnittestImport_ImportMessage()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_message_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_import_message_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalImportMessageExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_message_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_import_message_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalImportMessageExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_message_extension) + } + + var ProtobufUnittest_optionalNestedEnumExtension: ProtobufUnittest_TestAllTypes.NestedEnum { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_enum_extension) ?? .foo} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_enum_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_nested_enum_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalNestedEnumExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_enum_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_nested_enum_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalNestedEnumExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_enum_extension) + } + + var ProtobufUnittest_optionalForeignEnumExtension: ProtobufUnittest_ForeignEnum { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_enum_extension) ?? .foreignFoo} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_enum_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_foreign_enum_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalForeignEnumExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_enum_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_foreign_enum_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalForeignEnumExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_enum_extension) + } + + var ProtobufUnittest_optionalImportEnumExtension: ProtobufUnittestImport_ImportEnum { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_enum_extension) ?? .importFoo} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_enum_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_import_enum_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalImportEnumExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_enum_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_import_enum_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalImportEnumExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_enum_extension) + } + + var ProtobufUnittest_optionalStringPieceExtension: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_piece_extension) ?? String()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_piece_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_string_piece_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalStringPieceExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_piece_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_string_piece_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalStringPieceExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_piece_extension) + } + + var ProtobufUnittest_optionalCordExtension: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_cord_extension) ?? String()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_cord_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_cord_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalCordExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_cord_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_cord_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalCordExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_cord_extension) + } + + var ProtobufUnittest_optionalPublicImportMessageExtension: ProtobufUnittestImport_PublicImportMessage { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_public_import_message_extension) ?? ProtobufUnittestImport_PublicImportMessage()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_public_import_message_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_public_import_message_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalPublicImportMessageExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_public_import_message_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_public_import_message_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalPublicImportMessageExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_public_import_message_extension) + } + + var ProtobufUnittest_optionalLazyMessageExtension: ProtobufUnittest_TestAllTypes.NestedMessage { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_lazy_message_extension) ?? ProtobufUnittest_TestAllTypes.NestedMessage()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_lazy_message_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_lazy_message_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalLazyMessageExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_lazy_message_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_lazy_message_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalLazyMessageExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_lazy_message_extension) + } + + var ProtobufUnittest_optionalUnverifiedLazyMessageExtension: ProtobufUnittest_TestAllTypes.NestedMessage { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension) ?? ProtobufUnittest_TestAllTypes.NestedMessage()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension` + /// has been explicitly set. + var hasProtobufUnittest_optionalUnverifiedLazyMessageExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalUnverifiedLazyMessageExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension) + } + + /// Repeated + var ProtobufUnittest_repeatedInt32Extension: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_int32_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_int32_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedInt64Extension: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_int64_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_int64_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedUint32Extension: [UInt32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_uint32_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_uint32_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedUint64Extension: [UInt64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_uint64_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_uint64_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedSint32Extension: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sint32_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sint32_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedSint64Extension: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sint64_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sint64_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedFixed32Extension: [UInt32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_fixed32_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_fixed32_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedFixed64Extension: [UInt64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_fixed64_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_fixed64_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedSfixed32Extension: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sfixed32_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sfixed32_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedSfixed64Extension: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sfixed64_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sfixed64_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedFloatExtension: [Float] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_float_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_float_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedDoubleExtension: [Double] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_double_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_double_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedBoolExtension: [Bool] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_bool_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_bool_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedStringExtension: [String] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_string_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_string_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedBytesExtension: [Data] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_bytes_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_bytes_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedGroupExtension: [ProtobufUnittest_RepeatedGroup_extension] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_RepeatedGroup_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_RepeatedGroup_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedNestedMessageExtension: [ProtobufUnittest_TestAllTypes.NestedMessage] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_nested_message_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_nested_message_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedForeignMessageExtension: [ProtobufUnittest_ForeignMessage] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_foreign_message_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_foreign_message_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedImportMessageExtension: [ProtobufUnittestImport_ImportMessage] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_import_message_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_import_message_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedNestedEnumExtension: [ProtobufUnittest_TestAllTypes.NestedEnum] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_nested_enum_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_nested_enum_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedForeignEnumExtension: [ProtobufUnittest_ForeignEnum] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_foreign_enum_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_foreign_enum_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedImportEnumExtension: [ProtobufUnittestImport_ImportEnum] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_import_enum_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_import_enum_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedStringPieceExtension: [String] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_string_piece_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_string_piece_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedCordExtension: [String] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_cord_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_cord_extension, value: newValue)} + } + + var ProtobufUnittest_repeatedLazyMessageExtension: [ProtobufUnittest_TestAllTypes.NestedMessage] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_lazy_message_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_lazy_message_extension, value: newValue)} + } + + /// Singular with defaults + var ProtobufUnittest_defaultInt32Extension: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_int32_extension) ?? 41} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_int32_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_int32_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultInt32Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_int32_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_int32_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultInt32Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_int32_extension) + } + + var ProtobufUnittest_defaultInt64Extension: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_int64_extension) ?? 42} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_int64_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_int64_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultInt64Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_int64_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_int64_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultInt64Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_int64_extension) + } + + var ProtobufUnittest_defaultUint32Extension: UInt32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_uint32_extension) ?? 43} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_uint32_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_uint32_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultUint32Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_uint32_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_uint32_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultUint32Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_uint32_extension) + } + + var ProtobufUnittest_defaultUint64Extension: UInt64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_uint64_extension) ?? 44} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_uint64_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_uint64_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultUint64Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_uint64_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_uint64_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultUint64Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_uint64_extension) + } + + var ProtobufUnittest_defaultSint32Extension: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_sint32_extension) ?? -45} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_sint32_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_sint32_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultSint32Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_sint32_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_sint32_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultSint32Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_sint32_extension) + } + + var ProtobufUnittest_defaultSint64Extension: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_sint64_extension) ?? 46} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_sint64_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_sint64_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultSint64Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_sint64_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_sint64_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultSint64Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_sint64_extension) + } + + var ProtobufUnittest_defaultFixed32Extension: UInt32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed32_extension) ?? 47} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed32_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_fixed32_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultFixed32Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed32_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_fixed32_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultFixed32Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed32_extension) + } + + var ProtobufUnittest_defaultFixed64Extension: UInt64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed64_extension) ?? 48} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed64_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_fixed64_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultFixed64Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed64_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_fixed64_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultFixed64Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed64_extension) + } + + var ProtobufUnittest_defaultSfixed32Extension: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed32_extension) ?? 49} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed32_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_sfixed32_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultSfixed32Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed32_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_sfixed32_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultSfixed32Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed32_extension) + } + + var ProtobufUnittest_defaultSfixed64Extension: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed64_extension) ?? -50} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed64_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_sfixed64_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultSfixed64Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed64_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_sfixed64_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultSfixed64Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed64_extension) + } + + var ProtobufUnittest_defaultFloatExtension: Float { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_float_extension) ?? 51.5} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_float_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_float_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultFloatExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_float_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_float_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultFloatExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_float_extension) + } + + var ProtobufUnittest_defaultDoubleExtension: Double { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_double_extension) ?? 52000} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_double_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_double_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultDoubleExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_double_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_double_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultDoubleExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_double_extension) + } + + var ProtobufUnittest_defaultBoolExtension: Bool { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_bool_extension) ?? true} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_bool_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_bool_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultBoolExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_bool_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_bool_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultBoolExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_bool_extension) + } + + var ProtobufUnittest_defaultStringExtension: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_string_extension) ?? "hello"} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_string_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_string_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultStringExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_string_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_string_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultStringExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_string_extension) + } + + var ProtobufUnittest_defaultBytesExtension: Data { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_bytes_extension) ?? Data([119, 111, 114, 108, 100])} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_bytes_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_bytes_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultBytesExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_bytes_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_bytes_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultBytesExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_bytes_extension) + } + + var ProtobufUnittest_defaultNestedEnumExtension: ProtobufUnittest_TestAllTypes.NestedEnum { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_nested_enum_extension) ?? .bar} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_nested_enum_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_nested_enum_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultNestedEnumExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_nested_enum_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_nested_enum_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultNestedEnumExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_nested_enum_extension) + } + + var ProtobufUnittest_defaultForeignEnumExtension: ProtobufUnittest_ForeignEnum { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_foreign_enum_extension) ?? .foreignBar} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_foreign_enum_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_foreign_enum_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultForeignEnumExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_foreign_enum_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_foreign_enum_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultForeignEnumExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_foreign_enum_extension) + } + + var ProtobufUnittest_defaultImportEnumExtension: ProtobufUnittestImport_ImportEnum { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_import_enum_extension) ?? .importBar} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_import_enum_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_import_enum_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultImportEnumExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_import_enum_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_import_enum_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultImportEnumExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_import_enum_extension) + } + + var ProtobufUnittest_defaultStringPieceExtension: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_string_piece_extension) ?? "abc"} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_string_piece_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_string_piece_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultStringPieceExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_string_piece_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_string_piece_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultStringPieceExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_string_piece_extension) + } + + var ProtobufUnittest_defaultCordExtension: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_cord_extension) ?? "123"} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_cord_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_cord_extension` + /// has been explicitly set. + var hasProtobufUnittest_defaultCordExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_cord_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_cord_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultCordExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_cord_extension) + } + + /// For oneof test + var ProtobufUnittest_oneofUint32Extension: UInt32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_oneof_uint32_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_oneof_uint32_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_oneof_uint32_extension` + /// has been explicitly set. + var hasProtobufUnittest_oneofUint32Extension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_oneof_uint32_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_oneof_uint32_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_oneofUint32Extension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_oneof_uint32_extension) + } + + var ProtobufUnittest_oneofNestedMessageExtension: ProtobufUnittest_TestAllTypes.NestedMessage { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_oneof_nested_message_extension) ?? ProtobufUnittest_TestAllTypes.NestedMessage()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_oneof_nested_message_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_oneof_nested_message_extension` + /// has been explicitly set. + var hasProtobufUnittest_oneofNestedMessageExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_oneof_nested_message_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_oneof_nested_message_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_oneofNestedMessageExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_oneof_nested_message_extension) + } + + var ProtobufUnittest_oneofStringExtension: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_oneof_string_extension) ?? String()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_oneof_string_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_oneof_string_extension` + /// has been explicitly set. + var hasProtobufUnittest_oneofStringExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_oneof_string_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_oneof_string_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_oneofStringExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_oneof_string_extension) + } + + var ProtobufUnittest_oneofBytesExtension: Data { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_oneof_bytes_extension) ?? Data()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_oneof_bytes_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_oneof_bytes_extension` + /// has been explicitly set. + var hasProtobufUnittest_oneofBytesExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_oneof_bytes_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_oneof_bytes_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_oneofBytesExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_oneof_bytes_extension) + } + + /// Check for bug where string extensions declared in tested scope did not + /// compile. + var ProtobufUnittest_TestNestedExtension_test: String { + get {return getExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.test) ?? "test"} + set {setExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.test, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestNestedExtension.Extensions.test` + /// has been explicitly set. + var hasProtobufUnittest_TestNestedExtension_test: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.test) + } + /// Clears the value of extension `ProtobufUnittest_TestNestedExtension.Extensions.test`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestNestedExtension_test() { + clearExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.test) + } + + /// Used to test if generated extension name is correct when there are + /// underscores. + var ProtobufUnittest_TestNestedExtension_nestedStringExtension: String { + get {return getExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.nested_string_extension) ?? String()} + set {setExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.nested_string_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestNestedExtension.Extensions.nested_string_extension` + /// has been explicitly set. + var hasProtobufUnittest_TestNestedExtension_nestedStringExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.nested_string_extension) + } + /// Clears the value of extension `ProtobufUnittest_TestNestedExtension.Extensions.nested_string_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestNestedExtension_nestedStringExtension() { + clearExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.nested_string_extension) + } + + var ProtobufUnittest_TestRequired_single: ProtobufUnittest_TestRequired { + get {return getExtensionValue(ext: ProtobufUnittest_TestRequired.Extensions.single) ?? ProtobufUnittest_TestRequired()} + set {setExtensionValue(ext: ProtobufUnittest_TestRequired.Extensions.single, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestRequired.Extensions.single` + /// has been explicitly set. + var hasProtobufUnittest_TestRequired_single: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestRequired.Extensions.single) + } + /// Clears the value of extension `ProtobufUnittest_TestRequired.Extensions.single`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestRequired_single() { + clearExtensionValue(ext: ProtobufUnittest_TestRequired.Extensions.single) + } + + var ProtobufUnittest_TestRequired_multi: [ProtobufUnittest_TestRequired] { + get {return getExtensionValue(ext: ProtobufUnittest_TestRequired.Extensions.multi) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_TestRequired.Extensions.multi, value: newValue)} + } +} + +extension ProtobufUnittest_TestExtensionInsideTable { + + var ProtobufUnittest_testExtensionInsideTableExtension: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_test_extension_inside_table_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_test_extension_inside_table_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_test_extension_inside_table_extension` + /// has been explicitly set. + var hasProtobufUnittest_testExtensionInsideTableExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_test_extension_inside_table_extension) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_test_extension_inside_table_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_testExtensionInsideTableExtension() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_test_extension_inside_table_extension) + } +} + +extension ProtobufUnittest_TestExtensionRangeSerialize { + + var ProtobufUnittest_TestExtensionRangeSerialize_barOne: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_one) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_one, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_one` + /// has been explicitly set. + var hasProtobufUnittest_TestExtensionRangeSerialize_barOne: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_one) + } + /// Clears the value of extension `ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_one`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestExtensionRangeSerialize_barOne() { + clearExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_one) + } + + var ProtobufUnittest_TestExtensionRangeSerialize_barTwo: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_two) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_two, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_two` + /// has been explicitly set. + var hasProtobufUnittest_TestExtensionRangeSerialize_barTwo: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_two) + } + /// Clears the value of extension `ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_two`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestExtensionRangeSerialize_barTwo() { + clearExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_two) + } + + var ProtobufUnittest_TestExtensionRangeSerialize_barThree: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_three) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_three, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_three` + /// has been explicitly set. + var hasProtobufUnittest_TestExtensionRangeSerialize_barThree: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_three) + } + /// Clears the value of extension `ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_three`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestExtensionRangeSerialize_barThree() { + clearExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_three) + } + + var ProtobufUnittest_TestExtensionRangeSerialize_barFour: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_four) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_four, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_four` + /// has been explicitly set. + var hasProtobufUnittest_TestExtensionRangeSerialize_barFour: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_four) + } + /// Clears the value of extension `ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_four`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestExtensionRangeSerialize_barFour() { + clearExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_four) + } + + var ProtobufUnittest_TestExtensionRangeSerialize_barFive: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_five) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_five, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_five` + /// has been explicitly set. + var hasProtobufUnittest_TestExtensionRangeSerialize_barFive: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_five) + } + /// Clears the value of extension `ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_five`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestExtensionRangeSerialize_barFive() { + clearExtensionValue(ext: ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_five) + } +} + +extension ProtobufUnittest_TestFieldOrderings { + + var ProtobufUnittest_myExtensionString: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_my_extension_string) ?? String()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_my_extension_string, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_my_extension_string` + /// has been explicitly set. + var hasProtobufUnittest_myExtensionString: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_my_extension_string) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_my_extension_string`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_myExtensionString() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_my_extension_string) + } + + var ProtobufUnittest_myExtensionInt: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_my_extension_int) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_my_extension_int, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_my_extension_int` + /// has been explicitly set. + var hasProtobufUnittest_myExtensionInt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_my_extension_int) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_my_extension_int`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_myExtensionInt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_my_extension_int) + } + + var ProtobufUnittest_TestExtensionOrderings1_testExtOrderings1: ProtobufUnittest_TestExtensionOrderings1 { + get {return getExtensionValue(ext: ProtobufUnittest_TestExtensionOrderings1.Extensions.test_ext_orderings1) ?? ProtobufUnittest_TestExtensionOrderings1()} + set {setExtensionValue(ext: ProtobufUnittest_TestExtensionOrderings1.Extensions.test_ext_orderings1, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestExtensionOrderings1.Extensions.test_ext_orderings1` + /// has been explicitly set. + var hasProtobufUnittest_TestExtensionOrderings1_testExtOrderings1: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestExtensionOrderings1.Extensions.test_ext_orderings1) + } + /// Clears the value of extension `ProtobufUnittest_TestExtensionOrderings1.Extensions.test_ext_orderings1`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestExtensionOrderings1_testExtOrderings1() { + clearExtensionValue(ext: ProtobufUnittest_TestExtensionOrderings1.Extensions.test_ext_orderings1) + } + + var ProtobufUnittest_TestExtensionOrderings2_testExtOrderings2: ProtobufUnittest_TestExtensionOrderings2 { + get {return getExtensionValue(ext: ProtobufUnittest_TestExtensionOrderings2.Extensions.test_ext_orderings2) ?? ProtobufUnittest_TestExtensionOrderings2()} + set {setExtensionValue(ext: ProtobufUnittest_TestExtensionOrderings2.Extensions.test_ext_orderings2, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestExtensionOrderings2.Extensions.test_ext_orderings2` + /// has been explicitly set. + var hasProtobufUnittest_TestExtensionOrderings2_testExtOrderings2: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestExtensionOrderings2.Extensions.test_ext_orderings2) + } + /// Clears the value of extension `ProtobufUnittest_TestExtensionOrderings2.Extensions.test_ext_orderings2`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestExtensionOrderings2_testExtOrderings2() { + clearExtensionValue(ext: ProtobufUnittest_TestExtensionOrderings2.Extensions.test_ext_orderings2) + } + + var ProtobufUnittest_TestExtensionOrderings2_TestExtensionOrderings3_testExtOrderings3: ProtobufUnittest_TestExtensionOrderings2.TestExtensionOrderings3 { + get {return getExtensionValue(ext: ProtobufUnittest_TestExtensionOrderings2.TestExtensionOrderings3.Extensions.test_ext_orderings3) ?? ProtobufUnittest_TestExtensionOrderings2.TestExtensionOrderings3()} + set {setExtensionValue(ext: ProtobufUnittest_TestExtensionOrderings2.TestExtensionOrderings3.Extensions.test_ext_orderings3, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestExtensionOrderings2.TestExtensionOrderings3.Extensions.test_ext_orderings3` + /// has been explicitly set. + var hasProtobufUnittest_TestExtensionOrderings2_TestExtensionOrderings3_testExtOrderings3: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestExtensionOrderings2.TestExtensionOrderings3.Extensions.test_ext_orderings3) + } + /// Clears the value of extension `ProtobufUnittest_TestExtensionOrderings2.TestExtensionOrderings3.Extensions.test_ext_orderings3`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestExtensionOrderings2_TestExtensionOrderings3_testExtOrderings3() { + clearExtensionValue(ext: ProtobufUnittest_TestExtensionOrderings2.TestExtensionOrderings3.Extensions.test_ext_orderings3) + } +} + +extension ProtobufUnittest_TestGroupExtension { + + var ProtobufUnittest_TestNestedExtension_optionalGroupExtension: ProtobufUnittest_TestNestedExtension.OptionalGroup_extension { + get {return getExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.OptionalGroup_extension) ?? ProtobufUnittest_TestNestedExtension.OptionalGroup_extension()} + set {setExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.OptionalGroup_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestNestedExtension.Extensions.OptionalGroup_extension` + /// has been explicitly set. + var hasProtobufUnittest_TestNestedExtension_optionalGroupExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.OptionalGroup_extension) + } + /// Clears the value of extension `ProtobufUnittest_TestNestedExtension.Extensions.OptionalGroup_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestNestedExtension_optionalGroupExtension() { + clearExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.OptionalGroup_extension) + } + + var ProtobufUnittest_TestNestedExtension_optionalForeignEnumExtension: ProtobufUnittest_ForeignEnum { + get {return getExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.optional_foreign_enum_extension) ?? .foreignFoo} + set {setExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.optional_foreign_enum_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestNestedExtension.Extensions.optional_foreign_enum_extension` + /// has been explicitly set. + var hasProtobufUnittest_TestNestedExtension_optionalForeignEnumExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.optional_foreign_enum_extension) + } + /// Clears the value of extension `ProtobufUnittest_TestNestedExtension.Extensions.optional_foreign_enum_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestNestedExtension_optionalForeignEnumExtension() { + clearExtensionValue(ext: ProtobufUnittest_TestNestedExtension.Extensions.optional_foreign_enum_extension) + } +} + +extension ProtobufUnittest_TestHugeFieldNumbers { + + var ProtobufUnittest_testAllTypes: ProtobufUnittest_TestAllTypes { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_test_all_types) ?? ProtobufUnittest_TestAllTypes()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_test_all_types, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_test_all_types` + /// has been explicitly set. + var hasProtobufUnittest_testAllTypes: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_test_all_types) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_test_all_types`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_testAllTypes() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_test_all_types) + } +} + +extension ProtobufUnittest_TestMixedFieldsAndExtensions { + + var ProtobufUnittest_TestMixedFieldsAndExtensions_c: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_TestMixedFieldsAndExtensions.Extensions.c) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_TestMixedFieldsAndExtensions.Extensions.c, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestMixedFieldsAndExtensions.Extensions.c` + /// has been explicitly set. + var hasProtobufUnittest_TestMixedFieldsAndExtensions_c: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestMixedFieldsAndExtensions.Extensions.c) + } + /// Clears the value of extension `ProtobufUnittest_TestMixedFieldsAndExtensions.Extensions.c`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestMixedFieldsAndExtensions_c() { + clearExtensionValue(ext: ProtobufUnittest_TestMixedFieldsAndExtensions.Extensions.c) + } + + var ProtobufUnittest_TestMixedFieldsAndExtensions_d: [UInt32] { + get {return getExtensionValue(ext: ProtobufUnittest_TestMixedFieldsAndExtensions.Extensions.d) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_TestMixedFieldsAndExtensions.Extensions.d, value: newValue)} + } +} + +extension ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2RepeatedGroup { + + var ProtobufUnittest_inner: ProtobufUnittest_TestNestedGroupExtensionInnerExtension { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_inner) ?? ProtobufUnittest_TestNestedGroupExtensionInnerExtension()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_inner, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_inner` + /// has been explicitly set. + var hasProtobufUnittest_inner: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_inner) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_inner`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_inner() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_inner) + } +} + +extension ProtobufUnittest_TestPackedExtensions { + + var ProtobufUnittest_packedInt32Extension: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_int32_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_int32_extension, value: newValue)} + } + + var ProtobufUnittest_packedInt64Extension: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_int64_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_int64_extension, value: newValue)} + } + + var ProtobufUnittest_packedUint32Extension: [UInt32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_uint32_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_uint32_extension, value: newValue)} + } + + var ProtobufUnittest_packedUint64Extension: [UInt64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_uint64_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_uint64_extension, value: newValue)} + } + + var ProtobufUnittest_packedSint32Extension: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_sint32_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_sint32_extension, value: newValue)} + } + + var ProtobufUnittest_packedSint64Extension: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_sint64_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_sint64_extension, value: newValue)} + } + + var ProtobufUnittest_packedFixed32Extension: [UInt32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_fixed32_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_fixed32_extension, value: newValue)} + } + + var ProtobufUnittest_packedFixed64Extension: [UInt64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_fixed64_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_fixed64_extension, value: newValue)} + } + + var ProtobufUnittest_packedSfixed32Extension: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_sfixed32_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_sfixed32_extension, value: newValue)} + } + + var ProtobufUnittest_packedSfixed64Extension: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_sfixed64_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_sfixed64_extension, value: newValue)} + } + + var ProtobufUnittest_packedFloatExtension: [Float] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_float_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_float_extension, value: newValue)} + } + + var ProtobufUnittest_packedDoubleExtension: [Double] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_double_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_double_extension, value: newValue)} + } + + var ProtobufUnittest_packedBoolExtension: [Bool] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_bool_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_bool_extension, value: newValue)} + } + + var ProtobufUnittest_packedEnumExtension: [ProtobufUnittest_ForeignEnum] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_enum_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_enum_extension, value: newValue)} + } +} + +extension ProtobufUnittest_TestParsingMerge { + + var ProtobufUnittest_TestParsingMerge_optionalExt: ProtobufUnittest_TestAllTypes { + get {return getExtensionValue(ext: ProtobufUnittest_TestParsingMerge.Extensions.optional_ext) ?? ProtobufUnittest_TestAllTypes()} + set {setExtensionValue(ext: ProtobufUnittest_TestParsingMerge.Extensions.optional_ext, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestParsingMerge.Extensions.optional_ext` + /// has been explicitly set. + var hasProtobufUnittest_TestParsingMerge_optionalExt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestParsingMerge.Extensions.optional_ext) + } + /// Clears the value of extension `ProtobufUnittest_TestParsingMerge.Extensions.optional_ext`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestParsingMerge_optionalExt() { + clearExtensionValue(ext: ProtobufUnittest_TestParsingMerge.Extensions.optional_ext) + } + + var ProtobufUnittest_TestParsingMerge_repeatedExt: [ProtobufUnittest_TestAllTypes] { + get {return getExtensionValue(ext: ProtobufUnittest_TestParsingMerge.Extensions.repeated_ext) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_TestParsingMerge.Extensions.repeated_ext, value: newValue)} + } +} + +extension ProtobufUnittest_TestUnpackedExtensions { + + var ProtobufUnittest_unpackedInt32Extension: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_int32_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_int32_extension, value: newValue)} + } + + var ProtobufUnittest_unpackedInt64Extension: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_int64_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_int64_extension, value: newValue)} + } + + var ProtobufUnittest_unpackedUint32Extension: [UInt32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_uint32_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_uint32_extension, value: newValue)} + } + + var ProtobufUnittest_unpackedUint64Extension: [UInt64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_uint64_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_uint64_extension, value: newValue)} + } + + var ProtobufUnittest_unpackedSint32Extension: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_sint32_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_sint32_extension, value: newValue)} + } + + var ProtobufUnittest_unpackedSint64Extension: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_sint64_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_sint64_extension, value: newValue)} + } + + var ProtobufUnittest_unpackedFixed32Extension: [UInt32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_fixed32_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_fixed32_extension, value: newValue)} + } + + var ProtobufUnittest_unpackedFixed64Extension: [UInt64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_fixed64_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_fixed64_extension, value: newValue)} + } + + var ProtobufUnittest_unpackedSfixed32Extension: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_sfixed32_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_sfixed32_extension, value: newValue)} + } + + var ProtobufUnittest_unpackedSfixed64Extension: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_sfixed64_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_sfixed64_extension, value: newValue)} + } + + var ProtobufUnittest_unpackedFloatExtension: [Float] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_float_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_float_extension, value: newValue)} + } + + var ProtobufUnittest_unpackedDoubleExtension: [Double] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_double_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_double_extension, value: newValue)} + } + + var ProtobufUnittest_unpackedBoolExtension: [Bool] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_bool_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_bool_extension, value: newValue)} + } + + var ProtobufUnittest_unpackedEnumExtension: [ProtobufUnittest_ForeignEnum] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_enum_extension) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_unpacked_enum_extension, value: newValue)} + } + +} + +// MARK: - File's ExtensionMap: ProtobufUnittest_Unittest_Extensions + +/// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by +/// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed +/// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create +/// a larger `SwiftProtobuf.SimpleExtensionMap`. +let ProtobufUnittest_Unittest_Extensions: SwiftProtobuf.SimpleExtensionMap = [ + ProtobufUnittest_Extensions_optional_int32_extension, + ProtobufUnittest_Extensions_optional_int64_extension, + ProtobufUnittest_Extensions_optional_uint32_extension, + ProtobufUnittest_Extensions_optional_uint64_extension, + ProtobufUnittest_Extensions_optional_sint32_extension, + ProtobufUnittest_Extensions_optional_sint64_extension, + ProtobufUnittest_Extensions_optional_fixed32_extension, + ProtobufUnittest_Extensions_optional_fixed64_extension, + ProtobufUnittest_Extensions_optional_sfixed32_extension, + ProtobufUnittest_Extensions_optional_sfixed64_extension, + ProtobufUnittest_Extensions_optional_float_extension, + ProtobufUnittest_Extensions_optional_double_extension, + ProtobufUnittest_Extensions_optional_bool_extension, + ProtobufUnittest_Extensions_optional_string_extension, + ProtobufUnittest_Extensions_optional_bytes_extension, + ProtobufUnittest_Extensions_OptionalGroup_extension, + ProtobufUnittest_Extensions_optional_nested_message_extension, + ProtobufUnittest_Extensions_optional_foreign_message_extension, + ProtobufUnittest_Extensions_optional_import_message_extension, + ProtobufUnittest_Extensions_optional_nested_enum_extension, + ProtobufUnittest_Extensions_optional_foreign_enum_extension, + ProtobufUnittest_Extensions_optional_import_enum_extension, + ProtobufUnittest_Extensions_optional_string_piece_extension, + ProtobufUnittest_Extensions_optional_cord_extension, + ProtobufUnittest_Extensions_optional_public_import_message_extension, + ProtobufUnittest_Extensions_optional_lazy_message_extension, + ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension, + ProtobufUnittest_Extensions_repeated_int32_extension, + ProtobufUnittest_Extensions_repeated_int64_extension, + ProtobufUnittest_Extensions_repeated_uint32_extension, + ProtobufUnittest_Extensions_repeated_uint64_extension, + ProtobufUnittest_Extensions_repeated_sint32_extension, + ProtobufUnittest_Extensions_repeated_sint64_extension, + ProtobufUnittest_Extensions_repeated_fixed32_extension, + ProtobufUnittest_Extensions_repeated_fixed64_extension, + ProtobufUnittest_Extensions_repeated_sfixed32_extension, + ProtobufUnittest_Extensions_repeated_sfixed64_extension, + ProtobufUnittest_Extensions_repeated_float_extension, + ProtobufUnittest_Extensions_repeated_double_extension, + ProtobufUnittest_Extensions_repeated_bool_extension, + ProtobufUnittest_Extensions_repeated_string_extension, + ProtobufUnittest_Extensions_repeated_bytes_extension, + ProtobufUnittest_Extensions_RepeatedGroup_extension, + ProtobufUnittest_Extensions_repeated_nested_message_extension, + ProtobufUnittest_Extensions_repeated_foreign_message_extension, + ProtobufUnittest_Extensions_repeated_import_message_extension, + ProtobufUnittest_Extensions_repeated_nested_enum_extension, + ProtobufUnittest_Extensions_repeated_foreign_enum_extension, + ProtobufUnittest_Extensions_repeated_import_enum_extension, + ProtobufUnittest_Extensions_repeated_string_piece_extension, + ProtobufUnittest_Extensions_repeated_cord_extension, + ProtobufUnittest_Extensions_repeated_lazy_message_extension, + ProtobufUnittest_Extensions_default_int32_extension, + ProtobufUnittest_Extensions_default_int64_extension, + ProtobufUnittest_Extensions_default_uint32_extension, + ProtobufUnittest_Extensions_default_uint64_extension, + ProtobufUnittest_Extensions_default_sint32_extension, + ProtobufUnittest_Extensions_default_sint64_extension, + ProtobufUnittest_Extensions_default_fixed32_extension, + ProtobufUnittest_Extensions_default_fixed64_extension, + ProtobufUnittest_Extensions_default_sfixed32_extension, + ProtobufUnittest_Extensions_default_sfixed64_extension, + ProtobufUnittest_Extensions_default_float_extension, + ProtobufUnittest_Extensions_default_double_extension, + ProtobufUnittest_Extensions_default_bool_extension, + ProtobufUnittest_Extensions_default_string_extension, + ProtobufUnittest_Extensions_default_bytes_extension, + ProtobufUnittest_Extensions_default_nested_enum_extension, + ProtobufUnittest_Extensions_default_foreign_enum_extension, + ProtobufUnittest_Extensions_default_import_enum_extension, + ProtobufUnittest_Extensions_default_string_piece_extension, + ProtobufUnittest_Extensions_default_cord_extension, + ProtobufUnittest_Extensions_oneof_uint32_extension, + ProtobufUnittest_Extensions_oneof_nested_message_extension, + ProtobufUnittest_Extensions_oneof_string_extension, + ProtobufUnittest_Extensions_oneof_bytes_extension, + ProtobufUnittest_Extensions_my_extension_string, + ProtobufUnittest_Extensions_my_extension_int, + ProtobufUnittest_Extensions_packed_int32_extension, + ProtobufUnittest_Extensions_packed_int64_extension, + ProtobufUnittest_Extensions_packed_uint32_extension, + ProtobufUnittest_Extensions_packed_uint64_extension, + ProtobufUnittest_Extensions_packed_sint32_extension, + ProtobufUnittest_Extensions_packed_sint64_extension, + ProtobufUnittest_Extensions_packed_fixed32_extension, + ProtobufUnittest_Extensions_packed_fixed64_extension, + ProtobufUnittest_Extensions_packed_sfixed32_extension, + ProtobufUnittest_Extensions_packed_sfixed64_extension, + ProtobufUnittest_Extensions_packed_float_extension, + ProtobufUnittest_Extensions_packed_double_extension, + ProtobufUnittest_Extensions_packed_bool_extension, + ProtobufUnittest_Extensions_packed_enum_extension, + ProtobufUnittest_Extensions_unpacked_int32_extension, + ProtobufUnittest_Extensions_unpacked_int64_extension, + ProtobufUnittest_Extensions_unpacked_uint32_extension, + ProtobufUnittest_Extensions_unpacked_uint64_extension, + ProtobufUnittest_Extensions_unpacked_sint32_extension, + ProtobufUnittest_Extensions_unpacked_sint64_extension, + ProtobufUnittest_Extensions_unpacked_fixed32_extension, + ProtobufUnittest_Extensions_unpacked_fixed64_extension, + ProtobufUnittest_Extensions_unpacked_sfixed32_extension, + ProtobufUnittest_Extensions_unpacked_sfixed64_extension, + ProtobufUnittest_Extensions_unpacked_float_extension, + ProtobufUnittest_Extensions_unpacked_double_extension, + ProtobufUnittest_Extensions_unpacked_bool_extension, + ProtobufUnittest_Extensions_unpacked_enum_extension, + ProtobufUnittest_Extensions_test_all_types, + ProtobufUnittest_Extensions_test_extension_inside_table_extension, + ProtobufUnittest_Extensions_inner, + ProtobufUnittest_TestMixedFieldsAndExtensions.Extensions.c, + ProtobufUnittest_TestMixedFieldsAndExtensions.Extensions.d, + ProtobufUnittest_TestNestedExtension.Extensions.test, + ProtobufUnittest_TestNestedExtension.Extensions.nested_string_extension, + ProtobufUnittest_TestNestedExtension.Extensions.OptionalGroup_extension, + ProtobufUnittest_TestNestedExtension.Extensions.optional_foreign_enum_extension, + ProtobufUnittest_TestRequired.Extensions.single, + ProtobufUnittest_TestRequired.Extensions.multi, + ProtobufUnittest_TestExtensionOrderings1.Extensions.test_ext_orderings1, + ProtobufUnittest_TestExtensionOrderings2.Extensions.test_ext_orderings2, + ProtobufUnittest_TestExtensionOrderings2.TestExtensionOrderings3.Extensions.test_ext_orderings3, + ProtobufUnittest_TestParsingMerge.Extensions.optional_ext, + ProtobufUnittest_TestParsingMerge.Extensions.repeated_ext, + ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_one, + ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_two, + ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_three, + ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_four, + ProtobufUnittest_TestExtensionRangeSerialize.Extensions.bar_five, + ProtobufUnittest_EnumParseTester.Extensions.optional_arbitrary_ext, + ProtobufUnittest_EnumParseTester.Extensions.repeated_arbitrary_ext, + ProtobufUnittest_EnumParseTester.Extensions.packed_arbitrary_ext, + ProtobufUnittest_BoolParseTester.Extensions.optional_bool_ext, + ProtobufUnittest_BoolParseTester.Extensions.repeated_bool_ext, + ProtobufUnittest_BoolParseTester.Extensions.packed_bool_ext, + ProtobufUnittest_Int32ParseTester.Extensions.optional_int32_ext, + ProtobufUnittest_Int32ParseTester.Extensions.repeated_int32_ext, + ProtobufUnittest_Int32ParseTester.Extensions.packed_int32_ext, + ProtobufUnittest_Int64ParseTester.Extensions.optional_int64_ext, + ProtobufUnittest_Int64ParseTester.Extensions.repeated_int64_ext, + ProtobufUnittest_Int64ParseTester.Extensions.packed_int64_ext, + ProtobufUnittest_StringParseTester.Extensions.optional_string_ext, + ProtobufUnittest_StringParseTester.Extensions.repeated_string_ext +] + +// Extension Objects - The only reason these might be needed is when manually +// constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_ +// accessors for the extension fields on the messages directly. + +/// Singular +let ProtobufUnittest_Extensions_optional_int32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 1, + fieldName: "protobuf_unittest.optional_int32_extension" +) + +let ProtobufUnittest_Extensions_optional_int64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 2, + fieldName: "protobuf_unittest.optional_int64_extension" +) + +let ProtobufUnittest_Extensions_optional_uint32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 3, + fieldName: "protobuf_unittest.optional_uint32_extension" +) + +let ProtobufUnittest_Extensions_optional_uint64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 4, + fieldName: "protobuf_unittest.optional_uint64_extension" +) + +let ProtobufUnittest_Extensions_optional_sint32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 5, + fieldName: "protobuf_unittest.optional_sint32_extension" +) + +let ProtobufUnittest_Extensions_optional_sint64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 6, + fieldName: "protobuf_unittest.optional_sint64_extension" +) + +let ProtobufUnittest_Extensions_optional_fixed32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 7, + fieldName: "protobuf_unittest.optional_fixed32_extension" +) + +let ProtobufUnittest_Extensions_optional_fixed64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 8, + fieldName: "protobuf_unittest.optional_fixed64_extension" +) + +let ProtobufUnittest_Extensions_optional_sfixed32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 9, + fieldName: "protobuf_unittest.optional_sfixed32_extension" +) + +let ProtobufUnittest_Extensions_optional_sfixed64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 10, + fieldName: "protobuf_unittest.optional_sfixed64_extension" +) + +let ProtobufUnittest_Extensions_optional_float_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 11, + fieldName: "protobuf_unittest.optional_float_extension" +) + +let ProtobufUnittest_Extensions_optional_double_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 12, + fieldName: "protobuf_unittest.optional_double_extension" +) + +let ProtobufUnittest_Extensions_optional_bool_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 13, + fieldName: "protobuf_unittest.optional_bool_extension" +) + +let ProtobufUnittest_Extensions_optional_string_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 14, + fieldName: "protobuf_unittest.optional_string_extension" +) + +let ProtobufUnittest_Extensions_optional_bytes_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 15, + fieldName: "protobuf_unittest.optional_bytes_extension" +) + +let ProtobufUnittest_Extensions_OptionalGroup_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 16, + fieldName: "protobuf_unittest.optionalgroup_extension" +) + +let ProtobufUnittest_Extensions_optional_nested_message_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 18, + fieldName: "protobuf_unittest.optional_nested_message_extension" +) + +let ProtobufUnittest_Extensions_optional_foreign_message_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 19, + fieldName: "protobuf_unittest.optional_foreign_message_extension" +) + +let ProtobufUnittest_Extensions_optional_import_message_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 20, + fieldName: "protobuf_unittest.optional_import_message_extension" +) + +let ProtobufUnittest_Extensions_optional_nested_enum_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 21, + fieldName: "protobuf_unittest.optional_nested_enum_extension" +) + +let ProtobufUnittest_Extensions_optional_foreign_enum_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 22, + fieldName: "protobuf_unittest.optional_foreign_enum_extension" +) + +let ProtobufUnittest_Extensions_optional_import_enum_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 23, + fieldName: "protobuf_unittest.optional_import_enum_extension" +) + +let ProtobufUnittest_Extensions_optional_string_piece_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 24, + fieldName: "protobuf_unittest.optional_string_piece_extension" +) + +let ProtobufUnittest_Extensions_optional_cord_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 25, + fieldName: "protobuf_unittest.optional_cord_extension" +) + +let ProtobufUnittest_Extensions_optional_public_import_message_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 26, + fieldName: "protobuf_unittest.optional_public_import_message_extension" +) + +let ProtobufUnittest_Extensions_optional_lazy_message_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 27, + fieldName: "protobuf_unittest.optional_lazy_message_extension" +) + +let ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 28, + fieldName: "protobuf_unittest.optional_unverified_lazy_message_extension" +) + +/// Repeated +let ProtobufUnittest_Extensions_repeated_int32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 31, + fieldName: "protobuf_unittest.repeated_int32_extension" +) + +let ProtobufUnittest_Extensions_repeated_int64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 32, + fieldName: "protobuf_unittest.repeated_int64_extension" +) + +let ProtobufUnittest_Extensions_repeated_uint32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 33, + fieldName: "protobuf_unittest.repeated_uint32_extension" +) + +let ProtobufUnittest_Extensions_repeated_uint64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 34, + fieldName: "protobuf_unittest.repeated_uint64_extension" +) + +let ProtobufUnittest_Extensions_repeated_sint32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 35, + fieldName: "protobuf_unittest.repeated_sint32_extension" +) + +let ProtobufUnittest_Extensions_repeated_sint64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 36, + fieldName: "protobuf_unittest.repeated_sint64_extension" +) + +let ProtobufUnittest_Extensions_repeated_fixed32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 37, + fieldName: "protobuf_unittest.repeated_fixed32_extension" +) + +let ProtobufUnittest_Extensions_repeated_fixed64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 38, + fieldName: "protobuf_unittest.repeated_fixed64_extension" +) + +let ProtobufUnittest_Extensions_repeated_sfixed32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 39, + fieldName: "protobuf_unittest.repeated_sfixed32_extension" +) + +let ProtobufUnittest_Extensions_repeated_sfixed64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 40, + fieldName: "protobuf_unittest.repeated_sfixed64_extension" +) + +let ProtobufUnittest_Extensions_repeated_float_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 41, + fieldName: "protobuf_unittest.repeated_float_extension" +) + +let ProtobufUnittest_Extensions_repeated_double_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 42, + fieldName: "protobuf_unittest.repeated_double_extension" +) + +let ProtobufUnittest_Extensions_repeated_bool_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 43, + fieldName: "protobuf_unittest.repeated_bool_extension" +) + +let ProtobufUnittest_Extensions_repeated_string_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 44, + fieldName: "protobuf_unittest.repeated_string_extension" +) + +let ProtobufUnittest_Extensions_repeated_bytes_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 45, + fieldName: "protobuf_unittest.repeated_bytes_extension" +) + +let ProtobufUnittest_Extensions_RepeatedGroup_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 46, + fieldName: "protobuf_unittest.repeatedgroup_extension" +) + +let ProtobufUnittest_Extensions_repeated_nested_message_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 48, + fieldName: "protobuf_unittest.repeated_nested_message_extension" +) + +let ProtobufUnittest_Extensions_repeated_foreign_message_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 49, + fieldName: "protobuf_unittest.repeated_foreign_message_extension" +) + +let ProtobufUnittest_Extensions_repeated_import_message_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 50, + fieldName: "protobuf_unittest.repeated_import_message_extension" +) + +let ProtobufUnittest_Extensions_repeated_nested_enum_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 51, + fieldName: "protobuf_unittest.repeated_nested_enum_extension" +) + +let ProtobufUnittest_Extensions_repeated_foreign_enum_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 52, + fieldName: "protobuf_unittest.repeated_foreign_enum_extension" +) + +let ProtobufUnittest_Extensions_repeated_import_enum_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 53, + fieldName: "protobuf_unittest.repeated_import_enum_extension" +) + +let ProtobufUnittest_Extensions_repeated_string_piece_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 54, + fieldName: "protobuf_unittest.repeated_string_piece_extension" +) + +let ProtobufUnittest_Extensions_repeated_cord_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 55, + fieldName: "protobuf_unittest.repeated_cord_extension" +) + +let ProtobufUnittest_Extensions_repeated_lazy_message_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 57, + fieldName: "protobuf_unittest.repeated_lazy_message_extension" +) + +/// Singular with defaults +let ProtobufUnittest_Extensions_default_int32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 61, + fieldName: "protobuf_unittest.default_int32_extension" +) + +let ProtobufUnittest_Extensions_default_int64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 62, + fieldName: "protobuf_unittest.default_int64_extension" +) + +let ProtobufUnittest_Extensions_default_uint32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 63, + fieldName: "protobuf_unittest.default_uint32_extension" +) + +let ProtobufUnittest_Extensions_default_uint64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 64, + fieldName: "protobuf_unittest.default_uint64_extension" +) + +let ProtobufUnittest_Extensions_default_sint32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 65, + fieldName: "protobuf_unittest.default_sint32_extension" +) + +let ProtobufUnittest_Extensions_default_sint64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 66, + fieldName: "protobuf_unittest.default_sint64_extension" +) + +let ProtobufUnittest_Extensions_default_fixed32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 67, + fieldName: "protobuf_unittest.default_fixed32_extension" +) + +let ProtobufUnittest_Extensions_default_fixed64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 68, + fieldName: "protobuf_unittest.default_fixed64_extension" +) + +let ProtobufUnittest_Extensions_default_sfixed32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 69, + fieldName: "protobuf_unittest.default_sfixed32_extension" +) + +let ProtobufUnittest_Extensions_default_sfixed64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 70, + fieldName: "protobuf_unittest.default_sfixed64_extension" +) + +let ProtobufUnittest_Extensions_default_float_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 71, + fieldName: "protobuf_unittest.default_float_extension" +) + +let ProtobufUnittest_Extensions_default_double_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 72, + fieldName: "protobuf_unittest.default_double_extension" +) + +let ProtobufUnittest_Extensions_default_bool_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 73, + fieldName: "protobuf_unittest.default_bool_extension" +) + +let ProtobufUnittest_Extensions_default_string_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 74, + fieldName: "protobuf_unittest.default_string_extension" +) + +let ProtobufUnittest_Extensions_default_bytes_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 75, + fieldName: "protobuf_unittest.default_bytes_extension" +) + +let ProtobufUnittest_Extensions_default_nested_enum_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 81, + fieldName: "protobuf_unittest.default_nested_enum_extension" +) + +let ProtobufUnittest_Extensions_default_foreign_enum_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 82, + fieldName: "protobuf_unittest.default_foreign_enum_extension" +) + +let ProtobufUnittest_Extensions_default_import_enum_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 83, + fieldName: "protobuf_unittest.default_import_enum_extension" +) + +let ProtobufUnittest_Extensions_default_string_piece_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 84, + fieldName: "protobuf_unittest.default_string_piece_extension" +) + +let ProtobufUnittest_Extensions_default_cord_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 85, + fieldName: "protobuf_unittest.default_cord_extension" +) + +/// For oneof test +let ProtobufUnittest_Extensions_oneof_uint32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 111, + fieldName: "protobuf_unittest.oneof_uint32_extension" +) + +let ProtobufUnittest_Extensions_oneof_nested_message_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 112, + fieldName: "protobuf_unittest.oneof_nested_message_extension" +) + +let ProtobufUnittest_Extensions_oneof_string_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 113, + fieldName: "protobuf_unittest.oneof_string_extension" +) + +let ProtobufUnittest_Extensions_oneof_bytes_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 114, + fieldName: "protobuf_unittest.oneof_bytes_extension" +) + +let ProtobufUnittest_Extensions_my_extension_string = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestFieldOrderings>( + _protobuf_fieldNumber: 50, + fieldName: "protobuf_unittest.my_extension_string" +) + +let ProtobufUnittest_Extensions_my_extension_int = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestFieldOrderings>( + _protobuf_fieldNumber: 5, + fieldName: "protobuf_unittest.my_extension_int" +) + +let ProtobufUnittest_Extensions_packed_int32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensions>( + _protobuf_fieldNumber: 90, + fieldName: "protobuf_unittest.packed_int32_extension" +) + +let ProtobufUnittest_Extensions_packed_int64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensions>( + _protobuf_fieldNumber: 91, + fieldName: "protobuf_unittest.packed_int64_extension" +) + +let ProtobufUnittest_Extensions_packed_uint32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensions>( + _protobuf_fieldNumber: 92, + fieldName: "protobuf_unittest.packed_uint32_extension" +) + +let ProtobufUnittest_Extensions_packed_uint64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensions>( + _protobuf_fieldNumber: 93, + fieldName: "protobuf_unittest.packed_uint64_extension" +) + +let ProtobufUnittest_Extensions_packed_sint32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensions>( + _protobuf_fieldNumber: 94, + fieldName: "protobuf_unittest.packed_sint32_extension" +) + +let ProtobufUnittest_Extensions_packed_sint64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensions>( + _protobuf_fieldNumber: 95, + fieldName: "protobuf_unittest.packed_sint64_extension" +) + +let ProtobufUnittest_Extensions_packed_fixed32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensions>( + _protobuf_fieldNumber: 96, + fieldName: "protobuf_unittest.packed_fixed32_extension" +) + +let ProtobufUnittest_Extensions_packed_fixed64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensions>( + _protobuf_fieldNumber: 97, + fieldName: "protobuf_unittest.packed_fixed64_extension" +) + +let ProtobufUnittest_Extensions_packed_sfixed32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensions>( + _protobuf_fieldNumber: 98, + fieldName: "protobuf_unittest.packed_sfixed32_extension" +) + +let ProtobufUnittest_Extensions_packed_sfixed64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensions>( + _protobuf_fieldNumber: 99, + fieldName: "protobuf_unittest.packed_sfixed64_extension" +) + +let ProtobufUnittest_Extensions_packed_float_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensions>( + _protobuf_fieldNumber: 100, + fieldName: "protobuf_unittest.packed_float_extension" +) + +let ProtobufUnittest_Extensions_packed_double_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensions>( + _protobuf_fieldNumber: 101, + fieldName: "protobuf_unittest.packed_double_extension" +) + +let ProtobufUnittest_Extensions_packed_bool_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensions>( + _protobuf_fieldNumber: 102, + fieldName: "protobuf_unittest.packed_bool_extension" +) + +let ProtobufUnittest_Extensions_packed_enum_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensions>( + _protobuf_fieldNumber: 103, + fieldName: "protobuf_unittest.packed_enum_extension" +) + +let ProtobufUnittest_Extensions_unpacked_int32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestUnpackedExtensions>( + _protobuf_fieldNumber: 90, + fieldName: "protobuf_unittest.unpacked_int32_extension" +) + +let ProtobufUnittest_Extensions_unpacked_int64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestUnpackedExtensions>( + _protobuf_fieldNumber: 91, + fieldName: "protobuf_unittest.unpacked_int64_extension" +) + +let ProtobufUnittest_Extensions_unpacked_uint32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestUnpackedExtensions>( + _protobuf_fieldNumber: 92, + fieldName: "protobuf_unittest.unpacked_uint32_extension" +) + +let ProtobufUnittest_Extensions_unpacked_uint64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestUnpackedExtensions>( + _protobuf_fieldNumber: 93, + fieldName: "protobuf_unittest.unpacked_uint64_extension" +) + +let ProtobufUnittest_Extensions_unpacked_sint32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestUnpackedExtensions>( + _protobuf_fieldNumber: 94, + fieldName: "protobuf_unittest.unpacked_sint32_extension" +) + +let ProtobufUnittest_Extensions_unpacked_sint64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestUnpackedExtensions>( + _protobuf_fieldNumber: 95, + fieldName: "protobuf_unittest.unpacked_sint64_extension" +) + +let ProtobufUnittest_Extensions_unpacked_fixed32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestUnpackedExtensions>( + _protobuf_fieldNumber: 96, + fieldName: "protobuf_unittest.unpacked_fixed32_extension" +) + +let ProtobufUnittest_Extensions_unpacked_fixed64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestUnpackedExtensions>( + _protobuf_fieldNumber: 97, + fieldName: "protobuf_unittest.unpacked_fixed64_extension" +) + +let ProtobufUnittest_Extensions_unpacked_sfixed32_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestUnpackedExtensions>( + _protobuf_fieldNumber: 98, + fieldName: "protobuf_unittest.unpacked_sfixed32_extension" +) + +let ProtobufUnittest_Extensions_unpacked_sfixed64_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestUnpackedExtensions>( + _protobuf_fieldNumber: 99, + fieldName: "protobuf_unittest.unpacked_sfixed64_extension" +) + +let ProtobufUnittest_Extensions_unpacked_float_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestUnpackedExtensions>( + _protobuf_fieldNumber: 100, + fieldName: "protobuf_unittest.unpacked_float_extension" +) + +let ProtobufUnittest_Extensions_unpacked_double_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestUnpackedExtensions>( + _protobuf_fieldNumber: 101, + fieldName: "protobuf_unittest.unpacked_double_extension" +) + +let ProtobufUnittest_Extensions_unpacked_bool_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestUnpackedExtensions>( + _protobuf_fieldNumber: 102, + fieldName: "protobuf_unittest.unpacked_bool_extension" +) + +let ProtobufUnittest_Extensions_unpacked_enum_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestUnpackedExtensions>( + _protobuf_fieldNumber: 103, + fieldName: "protobuf_unittest.unpacked_enum_extension" +) + +let ProtobufUnittest_Extensions_test_all_types = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestHugeFieldNumbers>( + _protobuf_fieldNumber: 536860000, + fieldName: "protobuf_unittest.test_all_types" +) + +let ProtobufUnittest_Extensions_test_extension_inside_table_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestExtensionInsideTable>( + _protobuf_fieldNumber: 5, + fieldName: "protobuf_unittest.test_extension_inside_table_extension" +) + +let ProtobufUnittest_Extensions_inner = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2RepeatedGroup>( + _protobuf_fieldNumber: 3, + fieldName: "protobuf_unittest.inner" +) + +extension ProtobufUnittest_TestMixedFieldsAndExtensions { + enum Extensions { + static let c = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestMixedFieldsAndExtensions>( + _protobuf_fieldNumber: 2, + fieldName: "protobuf_unittest.TestMixedFieldsAndExtensions.c" + ) + + static let d = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestMixedFieldsAndExtensions>( + _protobuf_fieldNumber: 4, + fieldName: "protobuf_unittest.TestMixedFieldsAndExtensions.d" + ) + } +} + +extension ProtobufUnittest_TestNestedExtension { + enum Extensions { + /// Check for bug where string extensions declared in tested scope did not + /// compile. + static let test = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 1002, + fieldName: "protobuf_unittest.TestNestedExtension.test" + ) + + /// Used to test if generated extension name is correct when there are + /// underscores. + static let nested_string_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 1003, + fieldName: "protobuf_unittest.TestNestedExtension.nested_string_extension" + ) + + static let OptionalGroup_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestGroupExtension>( + _protobuf_fieldNumber: 16, + fieldName: "protobuf_unittest.TestNestedExtension.optionalgroup_extension" + ) + + static let optional_foreign_enum_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestGroupExtension>( + _protobuf_fieldNumber: 22, + fieldName: "protobuf_unittest.TestNestedExtension.optional_foreign_enum_extension" + ) + } +} + +extension ProtobufUnittest_TestRequired { + enum Extensions { + static let single = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 1000, + fieldName: "protobuf_unittest.TestRequired.single" + ) + + static let multi = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensions>( + _protobuf_fieldNumber: 1001, + fieldName: "protobuf_unittest.TestRequired.multi" + ) + } +} + +extension ProtobufUnittest_TestExtensionOrderings1 { + enum Extensions { + static let test_ext_orderings1 = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestFieldOrderings>( + _protobuf_fieldNumber: 13, + fieldName: "protobuf_unittest.TestExtensionOrderings1.test_ext_orderings1" + ) + } +} + +extension ProtobufUnittest_TestExtensionOrderings2 { + enum Extensions { + static let test_ext_orderings2 = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestFieldOrderings>( + _protobuf_fieldNumber: 12, + fieldName: "protobuf_unittest.TestExtensionOrderings2.test_ext_orderings2" + ) + } +} + +extension ProtobufUnittest_TestExtensionOrderings2.TestExtensionOrderings3 { + enum Extensions { + static let test_ext_orderings3 = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestFieldOrderings>( + _protobuf_fieldNumber: 14, + fieldName: "protobuf_unittest.TestExtensionOrderings2.TestExtensionOrderings3.test_ext_orderings3" + ) + } +} + +extension ProtobufUnittest_TestParsingMerge { + enum Extensions { + static let optional_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestParsingMerge>( + _protobuf_fieldNumber: 1000, + fieldName: "protobuf_unittest.TestParsingMerge.optional_ext" + ) + + static let repeated_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestParsingMerge>( + _protobuf_fieldNumber: 1001, + fieldName: "protobuf_unittest.TestParsingMerge.repeated_ext" + ) + } +} + +extension ProtobufUnittest_TestExtensionRangeSerialize { + enum Extensions { + static let bar_one = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestExtensionRangeSerialize>( + _protobuf_fieldNumber: 2, + fieldName: "protobuf_unittest.TestExtensionRangeSerialize.bar_one" + ) + + static let bar_two = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestExtensionRangeSerialize>( + _protobuf_fieldNumber: 4, + fieldName: "protobuf_unittest.TestExtensionRangeSerialize.bar_two" + ) + + static let bar_three = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestExtensionRangeSerialize>( + _protobuf_fieldNumber: 10, + fieldName: "protobuf_unittest.TestExtensionRangeSerialize.bar_three" + ) + + static let bar_four = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestExtensionRangeSerialize>( + _protobuf_fieldNumber: 15, + fieldName: "protobuf_unittest.TestExtensionRangeSerialize.bar_four" + ) + + static let bar_five = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestExtensionRangeSerialize>( + _protobuf_fieldNumber: 19, + fieldName: "protobuf_unittest.TestExtensionRangeSerialize.bar_five" + ) + } +} + +extension ProtobufUnittest_EnumParseTester { + enum Extensions { + static let optional_arbitrary_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_EnumParseTester>( + _protobuf_fieldNumber: 2000000, + fieldName: "protobuf_unittest.EnumParseTester.optional_arbitrary_ext" + ) + + static let repeated_arbitrary_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_EnumParseTester>( + _protobuf_fieldNumber: 2000001, + fieldName: "protobuf_unittest.EnumParseTester.repeated_arbitrary_ext" + ) + + static let packed_arbitrary_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_EnumParseTester>( + _protobuf_fieldNumber: 2000002, + fieldName: "protobuf_unittest.EnumParseTester.packed_arbitrary_ext" + ) + } +} + +extension ProtobufUnittest_BoolParseTester { + enum Extensions { + static let optional_bool_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_BoolParseTester>( + _protobuf_fieldNumber: 2000000, + fieldName: "protobuf_unittest.BoolParseTester.optional_bool_ext" + ) + + static let repeated_bool_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_BoolParseTester>( + _protobuf_fieldNumber: 2000001, + fieldName: "protobuf_unittest.BoolParseTester.repeated_bool_ext" + ) + + static let packed_bool_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_BoolParseTester>( + _protobuf_fieldNumber: 2000002, + fieldName: "protobuf_unittest.BoolParseTester.packed_bool_ext" + ) + } +} + +extension ProtobufUnittest_Int32ParseTester { + enum Extensions { + static let optional_int32_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_Int32ParseTester>( + _protobuf_fieldNumber: 2000000, + fieldName: "protobuf_unittest.Int32ParseTester.optional_int32_ext" + ) + + static let repeated_int32_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_Int32ParseTester>( + _protobuf_fieldNumber: 2000001, + fieldName: "protobuf_unittest.Int32ParseTester.repeated_int32_ext" + ) + + static let packed_int32_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_Int32ParseTester>( + _protobuf_fieldNumber: 2000002, + fieldName: "protobuf_unittest.Int32ParseTester.packed_int32_ext" + ) + } +} + +extension ProtobufUnittest_Int64ParseTester { + enum Extensions { + static let optional_int64_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_Int64ParseTester>( + _protobuf_fieldNumber: 2000000, + fieldName: "protobuf_unittest.Int64ParseTester.optional_int64_ext" + ) + + static let repeated_int64_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_Int64ParseTester>( + _protobuf_fieldNumber: 2000001, + fieldName: "protobuf_unittest.Int64ParseTester.repeated_int64_ext" + ) + + static let packed_int64_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_Int64ParseTester>( + _protobuf_fieldNumber: 2000002, + fieldName: "protobuf_unittest.Int64ParseTester.packed_int64_ext" + ) + } +} + +extension ProtobufUnittest_StringParseTester { + enum Extensions { + static let optional_string_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_StringParseTester>( + _protobuf_fieldNumber: 2000000, + fieldName: "protobuf_unittest.StringParseTester.optional_string_ext" + ) + + static let repeated_string_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_StringParseTester>( + _protobuf_fieldNumber: 2000001, + fieldName: "protobuf_unittest.StringParseTester.repeated_string_ext" + ) + } +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest" + +extension ProtobufUnittest_ForeignEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 4: .same(proto: "FOREIGN_FOO"), + 5: .same(proto: "FOREIGN_BAR"), + 6: .same(proto: "FOREIGN_BAZ"), + ] +} + +extension ProtobufUnittest_TestReservedEnumFields: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN"), + ] +} + +extension ProtobufUnittest_TestEnumWithDupValue: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .aliased(proto: "FOO1", aliases: ["FOO2"]), + 2: .aliased(proto: "BAR1", aliases: ["BAR2"]), + 3: .same(proto: "BAZ"), + ] +} + +extension ProtobufUnittest_TestSparseEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + -53452: .same(proto: "SPARSE_E"), + -15: .same(proto: "SPARSE_D"), + 0: .same(proto: "SPARSE_F"), + 2: .same(proto: "SPARSE_G"), + 123: .same(proto: "SPARSE_A"), + 62374: .same(proto: "SPARSE_B"), + 12589234: .same(proto: "SPARSE_C"), + ] +} + +extension ProtobufUnittest_VeryLargeEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "ENUM_LABEL_DEFAULT"), + 1: .same(proto: "ENUM_LABEL_1"), + 2: .same(proto: "ENUM_LABEL_2"), + 3: .same(proto: "ENUM_LABEL_3"), + 4: .same(proto: "ENUM_LABEL_4"), + 5: .same(proto: "ENUM_LABEL_5"), + 6: .same(proto: "ENUM_LABEL_6"), + 7: .same(proto: "ENUM_LABEL_7"), + 8: .same(proto: "ENUM_LABEL_8"), + 9: .same(proto: "ENUM_LABEL_9"), + 10: .same(proto: "ENUM_LABEL_10"), + 11: .same(proto: "ENUM_LABEL_11"), + 12: .same(proto: "ENUM_LABEL_12"), + 13: .same(proto: "ENUM_LABEL_13"), + 14: .same(proto: "ENUM_LABEL_14"), + 15: .same(proto: "ENUM_LABEL_15"), + 16: .same(proto: "ENUM_LABEL_16"), + 17: .same(proto: "ENUM_LABEL_17"), + 18: .same(proto: "ENUM_LABEL_18"), + 19: .same(proto: "ENUM_LABEL_19"), + 20: .same(proto: "ENUM_LABEL_20"), + 21: .same(proto: "ENUM_LABEL_21"), + 22: .same(proto: "ENUM_LABEL_22"), + 23: .same(proto: "ENUM_LABEL_23"), + 24: .same(proto: "ENUM_LABEL_24"), + 25: .same(proto: "ENUM_LABEL_25"), + 26: .same(proto: "ENUM_LABEL_26"), + 27: .same(proto: "ENUM_LABEL_27"), + 28: .same(proto: "ENUM_LABEL_28"), + 29: .same(proto: "ENUM_LABEL_29"), + 30: .same(proto: "ENUM_LABEL_30"), + 31: .same(proto: "ENUM_LABEL_31"), + 32: .same(proto: "ENUM_LABEL_32"), + 33: .same(proto: "ENUM_LABEL_33"), + 34: .same(proto: "ENUM_LABEL_34"), + 35: .same(proto: "ENUM_LABEL_35"), + 36: .same(proto: "ENUM_LABEL_36"), + 37: .same(proto: "ENUM_LABEL_37"), + 38: .same(proto: "ENUM_LABEL_38"), + 39: .same(proto: "ENUM_LABEL_39"), + 40: .same(proto: "ENUM_LABEL_40"), + 41: .same(proto: "ENUM_LABEL_41"), + 42: .same(proto: "ENUM_LABEL_42"), + 43: .same(proto: "ENUM_LABEL_43"), + 44: .same(proto: "ENUM_LABEL_44"), + 45: .same(proto: "ENUM_LABEL_45"), + 46: .same(proto: "ENUM_LABEL_46"), + 47: .same(proto: "ENUM_LABEL_47"), + 48: .same(proto: "ENUM_LABEL_48"), + 49: .same(proto: "ENUM_LABEL_49"), + 50: .same(proto: "ENUM_LABEL_50"), + 51: .same(proto: "ENUM_LABEL_51"), + 52: .same(proto: "ENUM_LABEL_52"), + 53: .same(proto: "ENUM_LABEL_53"), + 54: .same(proto: "ENUM_LABEL_54"), + 55: .same(proto: "ENUM_LABEL_55"), + 56: .same(proto: "ENUM_LABEL_56"), + 57: .same(proto: "ENUM_LABEL_57"), + 58: .same(proto: "ENUM_LABEL_58"), + 59: .same(proto: "ENUM_LABEL_59"), + 60: .same(proto: "ENUM_LABEL_60"), + 61: .same(proto: "ENUM_LABEL_61"), + 62: .same(proto: "ENUM_LABEL_62"), + 63: .same(proto: "ENUM_LABEL_63"), + 64: .same(proto: "ENUM_LABEL_64"), + 65: .same(proto: "ENUM_LABEL_65"), + 66: .same(proto: "ENUM_LABEL_66"), + 67: .same(proto: "ENUM_LABEL_67"), + 68: .same(proto: "ENUM_LABEL_68"), + 69: .same(proto: "ENUM_LABEL_69"), + 70: .same(proto: "ENUM_LABEL_70"), + 71: .same(proto: "ENUM_LABEL_71"), + 72: .same(proto: "ENUM_LABEL_72"), + 73: .same(proto: "ENUM_LABEL_73"), + 74: .same(proto: "ENUM_LABEL_74"), + 75: .same(proto: "ENUM_LABEL_75"), + 76: .same(proto: "ENUM_LABEL_76"), + 77: .same(proto: "ENUM_LABEL_77"), + 78: .same(proto: "ENUM_LABEL_78"), + 79: .same(proto: "ENUM_LABEL_79"), + 80: .same(proto: "ENUM_LABEL_80"), + 81: .same(proto: "ENUM_LABEL_81"), + 82: .same(proto: "ENUM_LABEL_82"), + 83: .same(proto: "ENUM_LABEL_83"), + 84: .same(proto: "ENUM_LABEL_84"), + 85: .same(proto: "ENUM_LABEL_85"), + 86: .same(proto: "ENUM_LABEL_86"), + 87: .same(proto: "ENUM_LABEL_87"), + 88: .same(proto: "ENUM_LABEL_88"), + 89: .same(proto: "ENUM_LABEL_89"), + 90: .same(proto: "ENUM_LABEL_90"), + 91: .same(proto: "ENUM_LABEL_91"), + 92: .same(proto: "ENUM_LABEL_92"), + 93: .same(proto: "ENUM_LABEL_93"), + 94: .same(proto: "ENUM_LABEL_94"), + 95: .same(proto: "ENUM_LABEL_95"), + 96: .same(proto: "ENUM_LABEL_96"), + 97: .same(proto: "ENUM_LABEL_97"), + 98: .same(proto: "ENUM_LABEL_98"), + 99: .same(proto: "ENUM_LABEL_99"), + 100: .same(proto: "ENUM_LABEL_100"), + ] +} + +extension ProtobufUnittest_TestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestAllTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_int32"), + 2: .standard(proto: "optional_int64"), + 3: .standard(proto: "optional_uint32"), + 4: .standard(proto: "optional_uint64"), + 5: .standard(proto: "optional_sint32"), + 6: .standard(proto: "optional_sint64"), + 7: .standard(proto: "optional_fixed32"), + 8: .standard(proto: "optional_fixed64"), + 9: .standard(proto: "optional_sfixed32"), + 10: .standard(proto: "optional_sfixed64"), + 11: .standard(proto: "optional_float"), + 12: .standard(proto: "optional_double"), + 13: .standard(proto: "optional_bool"), + 14: .standard(proto: "optional_string"), + 15: .standard(proto: "optional_bytes"), + 16: .unique(proto: "OptionalGroup", json: "optionalgroup"), + 18: .standard(proto: "optional_nested_message"), + 19: .standard(proto: "optional_foreign_message"), + 20: .standard(proto: "optional_import_message"), + 21: .standard(proto: "optional_nested_enum"), + 22: .standard(proto: "optional_foreign_enum"), + 23: .standard(proto: "optional_import_enum"), + 24: .standard(proto: "optional_string_piece"), + 25: .standard(proto: "optional_cord"), + 26: .standard(proto: "optional_public_import_message"), + 27: .standard(proto: "optional_lazy_message"), + 28: .standard(proto: "optional_unverified_lazy_message"), + 31: .standard(proto: "repeated_int32"), + 32: .standard(proto: "repeated_int64"), + 33: .standard(proto: "repeated_uint32"), + 34: .standard(proto: "repeated_uint64"), + 35: .standard(proto: "repeated_sint32"), + 36: .standard(proto: "repeated_sint64"), + 37: .standard(proto: "repeated_fixed32"), + 38: .standard(proto: "repeated_fixed64"), + 39: .standard(proto: "repeated_sfixed32"), + 40: .standard(proto: "repeated_sfixed64"), + 41: .standard(proto: "repeated_float"), + 42: .standard(proto: "repeated_double"), + 43: .standard(proto: "repeated_bool"), + 44: .standard(proto: "repeated_string"), + 45: .standard(proto: "repeated_bytes"), + 46: .unique(proto: "RepeatedGroup", json: "repeatedgroup"), + 48: .standard(proto: "repeated_nested_message"), + 49: .standard(proto: "repeated_foreign_message"), + 50: .standard(proto: "repeated_import_message"), + 51: .standard(proto: "repeated_nested_enum"), + 52: .standard(proto: "repeated_foreign_enum"), + 53: .standard(proto: "repeated_import_enum"), + 54: .standard(proto: "repeated_string_piece"), + 55: .standard(proto: "repeated_cord"), + 57: .standard(proto: "repeated_lazy_message"), + 61: .standard(proto: "default_int32"), + 62: .standard(proto: "default_int64"), + 63: .standard(proto: "default_uint32"), + 64: .standard(proto: "default_uint64"), + 65: .standard(proto: "default_sint32"), + 66: .standard(proto: "default_sint64"), + 67: .standard(proto: "default_fixed32"), + 68: .standard(proto: "default_fixed64"), + 69: .standard(proto: "default_sfixed32"), + 70: .standard(proto: "default_sfixed64"), + 71: .standard(proto: "default_float"), + 72: .standard(proto: "default_double"), + 73: .standard(proto: "default_bool"), + 74: .standard(proto: "default_string"), + 75: .standard(proto: "default_bytes"), + 81: .standard(proto: "default_nested_enum"), + 82: .standard(proto: "default_foreign_enum"), + 83: .standard(proto: "default_import_enum"), + 84: .standard(proto: "default_string_piece"), + 85: .standard(proto: "default_cord"), + 111: .standard(proto: "oneof_uint32"), + 112: .standard(proto: "oneof_nested_message"), + 113: .standard(proto: "oneof_string"), + 114: .standard(proto: "oneof_bytes"), + ] + + fileprivate class _StorageClass { + var _optionalInt32: Int32? = nil + var _optionalInt64: Int64? = nil + var _optionalUint32: UInt32? = nil + var _optionalUint64: UInt64? = nil + var _optionalSint32: Int32? = nil + var _optionalSint64: Int64? = nil + var _optionalFixed32: UInt32? = nil + var _optionalFixed64: UInt64? = nil + var _optionalSfixed32: Int32? = nil + var _optionalSfixed64: Int64? = nil + var _optionalFloat: Float? = nil + var _optionalDouble: Double? = nil + var _optionalBool: Bool? = nil + var _optionalString: String? = nil + var _optionalBytes: Data? = nil + var _optionalGroup: ProtobufUnittest_TestAllTypes.OptionalGroup? = nil + var _optionalNestedMessage: ProtobufUnittest_TestAllTypes.NestedMessage? = nil + var _optionalForeignMessage: ProtobufUnittest_ForeignMessage? = nil + var _optionalImportMessage: ProtobufUnittestImport_ImportMessage? = nil + var _optionalNestedEnum: ProtobufUnittest_TestAllTypes.NestedEnum? = nil + var _optionalForeignEnum: ProtobufUnittest_ForeignEnum? = nil + var _optionalImportEnum: ProtobufUnittestImport_ImportEnum? = nil + var _optionalStringPiece: String? = nil + var _optionalCord: String? = nil + var _optionalPublicImportMessage: ProtobufUnittestImport_PublicImportMessage? = nil + var _optionalLazyMessage: ProtobufUnittest_TestAllTypes.NestedMessage? = nil + var _optionalUnverifiedLazyMessage: ProtobufUnittest_TestAllTypes.NestedMessage? = nil + var _repeatedInt32: [Int32] = [] + var _repeatedInt64: [Int64] = [] + var _repeatedUint32: [UInt32] = [] + var _repeatedUint64: [UInt64] = [] + var _repeatedSint32: [Int32] = [] + var _repeatedSint64: [Int64] = [] + var _repeatedFixed32: [UInt32] = [] + var _repeatedFixed64: [UInt64] = [] + var _repeatedSfixed32: [Int32] = [] + var _repeatedSfixed64: [Int64] = [] + var _repeatedFloat: [Float] = [] + var _repeatedDouble: [Double] = [] + var _repeatedBool: [Bool] = [] + var _repeatedString: [String] = [] + var _repeatedBytes: [Data] = [] + var _repeatedGroup: [ProtobufUnittest_TestAllTypes.RepeatedGroup] = [] + var _repeatedNestedMessage: [ProtobufUnittest_TestAllTypes.NestedMessage] = [] + var _repeatedForeignMessage: [ProtobufUnittest_ForeignMessage] = [] + var _repeatedImportMessage: [ProtobufUnittestImport_ImportMessage] = [] + var _repeatedNestedEnum: [ProtobufUnittest_TestAllTypes.NestedEnum] = [] + var _repeatedForeignEnum: [ProtobufUnittest_ForeignEnum] = [] + var _repeatedImportEnum: [ProtobufUnittestImport_ImportEnum] = [] + var _repeatedStringPiece: [String] = [] + var _repeatedCord: [String] = [] + var _repeatedLazyMessage: [ProtobufUnittest_TestAllTypes.NestedMessage] = [] + var _defaultInt32: Int32? = nil + var _defaultInt64: Int64? = nil + var _defaultUint32: UInt32? = nil + var _defaultUint64: UInt64? = nil + var _defaultSint32: Int32? = nil + var _defaultSint64: Int64? = nil + var _defaultFixed32: UInt32? = nil + var _defaultFixed64: UInt64? = nil + var _defaultSfixed32: Int32? = nil + var _defaultSfixed64: Int64? = nil + var _defaultFloat: Float? = nil + var _defaultDouble: Double? = nil + var _defaultBool: Bool? = nil + var _defaultString: String? = nil + var _defaultBytes: Data? = nil + var _defaultNestedEnum: ProtobufUnittest_TestAllTypes.NestedEnum? = nil + var _defaultForeignEnum: ProtobufUnittest_ForeignEnum? = nil + var _defaultImportEnum: ProtobufUnittestImport_ImportEnum? = nil + var _defaultStringPiece: String? = nil + var _defaultCord: String? = nil + var _oneofField: ProtobufUnittest_TestAllTypes.OneOf_OneofField? + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _optionalInt32 = source._optionalInt32 + _optionalInt64 = source._optionalInt64 + _optionalUint32 = source._optionalUint32 + _optionalUint64 = source._optionalUint64 + _optionalSint32 = source._optionalSint32 + _optionalSint64 = source._optionalSint64 + _optionalFixed32 = source._optionalFixed32 + _optionalFixed64 = source._optionalFixed64 + _optionalSfixed32 = source._optionalSfixed32 + _optionalSfixed64 = source._optionalSfixed64 + _optionalFloat = source._optionalFloat + _optionalDouble = source._optionalDouble + _optionalBool = source._optionalBool + _optionalString = source._optionalString + _optionalBytes = source._optionalBytes + _optionalGroup = source._optionalGroup + _optionalNestedMessage = source._optionalNestedMessage + _optionalForeignMessage = source._optionalForeignMessage + _optionalImportMessage = source._optionalImportMessage + _optionalNestedEnum = source._optionalNestedEnum + _optionalForeignEnum = source._optionalForeignEnum + _optionalImportEnum = source._optionalImportEnum + _optionalStringPiece = source._optionalStringPiece + _optionalCord = source._optionalCord + _optionalPublicImportMessage = source._optionalPublicImportMessage + _optionalLazyMessage = source._optionalLazyMessage + _optionalUnverifiedLazyMessage = source._optionalUnverifiedLazyMessage + _repeatedInt32 = source._repeatedInt32 + _repeatedInt64 = source._repeatedInt64 + _repeatedUint32 = source._repeatedUint32 + _repeatedUint64 = source._repeatedUint64 + _repeatedSint32 = source._repeatedSint32 + _repeatedSint64 = source._repeatedSint64 + _repeatedFixed32 = source._repeatedFixed32 + _repeatedFixed64 = source._repeatedFixed64 + _repeatedSfixed32 = source._repeatedSfixed32 + _repeatedSfixed64 = source._repeatedSfixed64 + _repeatedFloat = source._repeatedFloat + _repeatedDouble = source._repeatedDouble + _repeatedBool = source._repeatedBool + _repeatedString = source._repeatedString + _repeatedBytes = source._repeatedBytes + _repeatedGroup = source._repeatedGroup + _repeatedNestedMessage = source._repeatedNestedMessage + _repeatedForeignMessage = source._repeatedForeignMessage + _repeatedImportMessage = source._repeatedImportMessage + _repeatedNestedEnum = source._repeatedNestedEnum + _repeatedForeignEnum = source._repeatedForeignEnum + _repeatedImportEnum = source._repeatedImportEnum + _repeatedStringPiece = source._repeatedStringPiece + _repeatedCord = source._repeatedCord + _repeatedLazyMessage = source._repeatedLazyMessage + _defaultInt32 = source._defaultInt32 + _defaultInt64 = source._defaultInt64 + _defaultUint32 = source._defaultUint32 + _defaultUint64 = source._defaultUint64 + _defaultSint32 = source._defaultSint32 + _defaultSint64 = source._defaultSint64 + _defaultFixed32 = source._defaultFixed32 + _defaultFixed64 = source._defaultFixed64 + _defaultSfixed32 = source._defaultSfixed32 + _defaultSfixed64 = source._defaultSfixed64 + _defaultFloat = source._defaultFloat + _defaultDouble = source._defaultDouble + _defaultBool = source._defaultBool + _defaultString = source._defaultString + _defaultBytes = source._defaultBytes + _defaultNestedEnum = source._defaultNestedEnum + _defaultForeignEnum = source._defaultForeignEnum + _defaultImportEnum = source._defaultImportEnum + _defaultStringPiece = source._defaultStringPiece + _defaultCord = source._defaultCord + _oneofField = source._oneofField + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._optionalInt32) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._optionalInt64) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint32) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._optionalUint64) }() + case 5: try { try decoder.decodeSingularSInt32Field(value: &_storage._optionalSint32) }() + case 6: try { try decoder.decodeSingularSInt64Field(value: &_storage._optionalSint64) }() + case 7: try { try decoder.decodeSingularFixed32Field(value: &_storage._optionalFixed32) }() + case 8: try { try decoder.decodeSingularFixed64Field(value: &_storage._optionalFixed64) }() + case 9: try { try decoder.decodeSingularSFixed32Field(value: &_storage._optionalSfixed32) }() + case 10: try { try decoder.decodeSingularSFixed64Field(value: &_storage._optionalSfixed64) }() + case 11: try { try decoder.decodeSingularFloatField(value: &_storage._optionalFloat) }() + case 12: try { try decoder.decodeSingularDoubleField(value: &_storage._optionalDouble) }() + case 13: try { try decoder.decodeSingularBoolField(value: &_storage._optionalBool) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._optionalString) }() + case 15: try { try decoder.decodeSingularBytesField(value: &_storage._optionalBytes) }() + case 16: try { try decoder.decodeSingularGroupField(value: &_storage._optionalGroup) }() + case 18: try { try decoder.decodeSingularMessageField(value: &_storage._optionalNestedMessage) }() + case 19: try { try decoder.decodeSingularMessageField(value: &_storage._optionalForeignMessage) }() + case 20: try { try decoder.decodeSingularMessageField(value: &_storage._optionalImportMessage) }() + case 21: try { try decoder.decodeSingularEnumField(value: &_storage._optionalNestedEnum) }() + case 22: try { try decoder.decodeSingularEnumField(value: &_storage._optionalForeignEnum) }() + case 23: try { try decoder.decodeSingularEnumField(value: &_storage._optionalImportEnum) }() + case 24: try { try decoder.decodeSingularStringField(value: &_storage._optionalStringPiece) }() + case 25: try { try decoder.decodeSingularStringField(value: &_storage._optionalCord) }() + case 26: try { try decoder.decodeSingularMessageField(value: &_storage._optionalPublicImportMessage) }() + case 27: try { try decoder.decodeSingularMessageField(value: &_storage._optionalLazyMessage) }() + case 28: try { try decoder.decodeSingularMessageField(value: &_storage._optionalUnverifiedLazyMessage) }() + case 31: try { try decoder.decodeRepeatedInt32Field(value: &_storage._repeatedInt32) }() + case 32: try { try decoder.decodeRepeatedInt64Field(value: &_storage._repeatedInt64) }() + case 33: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._repeatedUint32) }() + case 34: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._repeatedUint64) }() + case 35: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._repeatedSint32) }() + case 36: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._repeatedSint64) }() + case 37: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._repeatedFixed32) }() + case 38: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._repeatedFixed64) }() + case 39: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._repeatedSfixed32) }() + case 40: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._repeatedSfixed64) }() + case 41: try { try decoder.decodeRepeatedFloatField(value: &_storage._repeatedFloat) }() + case 42: try { try decoder.decodeRepeatedDoubleField(value: &_storage._repeatedDouble) }() + case 43: try { try decoder.decodeRepeatedBoolField(value: &_storage._repeatedBool) }() + case 44: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedString) }() + case 45: try { try decoder.decodeRepeatedBytesField(value: &_storage._repeatedBytes) }() + case 46: try { try decoder.decodeRepeatedGroupField(value: &_storage._repeatedGroup) }() + case 48: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedNestedMessage) }() + case 49: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedForeignMessage) }() + case 50: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedImportMessage) }() + case 51: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedNestedEnum) }() + case 52: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedForeignEnum) }() + case 53: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedImportEnum) }() + case 54: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedStringPiece) }() + case 55: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedCord) }() + case 57: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedLazyMessage) }() + case 61: try { try decoder.decodeSingularInt32Field(value: &_storage._defaultInt32) }() + case 62: try { try decoder.decodeSingularInt64Field(value: &_storage._defaultInt64) }() + case 63: try { try decoder.decodeSingularUInt32Field(value: &_storage._defaultUint32) }() + case 64: try { try decoder.decodeSingularUInt64Field(value: &_storage._defaultUint64) }() + case 65: try { try decoder.decodeSingularSInt32Field(value: &_storage._defaultSint32) }() + case 66: try { try decoder.decodeSingularSInt64Field(value: &_storage._defaultSint64) }() + case 67: try { try decoder.decodeSingularFixed32Field(value: &_storage._defaultFixed32) }() + case 68: try { try decoder.decodeSingularFixed64Field(value: &_storage._defaultFixed64) }() + case 69: try { try decoder.decodeSingularSFixed32Field(value: &_storage._defaultSfixed32) }() + case 70: try { try decoder.decodeSingularSFixed64Field(value: &_storage._defaultSfixed64) }() + case 71: try { try decoder.decodeSingularFloatField(value: &_storage._defaultFloat) }() + case 72: try { try decoder.decodeSingularDoubleField(value: &_storage._defaultDouble) }() + case 73: try { try decoder.decodeSingularBoolField(value: &_storage._defaultBool) }() + case 74: try { try decoder.decodeSingularStringField(value: &_storage._defaultString) }() + case 75: try { try decoder.decodeSingularBytesField(value: &_storage._defaultBytes) }() + case 81: try { try decoder.decodeSingularEnumField(value: &_storage._defaultNestedEnum) }() + case 82: try { try decoder.decodeSingularEnumField(value: &_storage._defaultForeignEnum) }() + case 83: try { try decoder.decodeSingularEnumField(value: &_storage._defaultImportEnum) }() + case 84: try { try decoder.decodeSingularStringField(value: &_storage._defaultStringPiece) }() + case 85: try { try decoder.decodeSingularStringField(value: &_storage._defaultCord) }() + case 111: try { + var v: UInt32? + try decoder.decodeSingularUInt32Field(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofUint32(v) + } + }() + case 112: try { + var v: ProtobufUnittest_TestAllTypes.NestedMessage? + var hadOneofValue = false + if let current = _storage._oneofField { + hadOneofValue = true + if case .oneofNestedMessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofNestedMessage(v) + } + }() + case 113: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofString(v) + } + }() + case 114: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofBytes(v) + } + }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._optionalInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._optionalInt64 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._optionalUint32 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._optionalUint64 { + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._optionalSint32 { + try visitor.visitSingularSInt32Field(value: v, fieldNumber: 5) + } }() + try { if let v = _storage._optionalSint64 { + try visitor.visitSingularSInt64Field(value: v, fieldNumber: 6) + } }() + try { if let v = _storage._optionalFixed32 { + try visitor.visitSingularFixed32Field(value: v, fieldNumber: 7) + } }() + try { if let v = _storage._optionalFixed64 { + try visitor.visitSingularFixed64Field(value: v, fieldNumber: 8) + } }() + try { if let v = _storage._optionalSfixed32 { + try visitor.visitSingularSFixed32Field(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._optionalSfixed64 { + try visitor.visitSingularSFixed64Field(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._optionalFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 11) + } }() + try { if let v = _storage._optionalDouble { + try visitor.visitSingularDoubleField(value: v, fieldNumber: 12) + } }() + try { if let v = _storage._optionalBool { + try visitor.visitSingularBoolField(value: v, fieldNumber: 13) + } }() + try { if let v = _storage._optionalString { + try visitor.visitSingularStringField(value: v, fieldNumber: 14) + } }() + try { if let v = _storage._optionalBytes { + try visitor.visitSingularBytesField(value: v, fieldNumber: 15) + } }() + try { if let v = _storage._optionalGroup { + try visitor.visitSingularGroupField(value: v, fieldNumber: 16) + } }() + try { if let v = _storage._optionalNestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._optionalForeignMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + } }() + try { if let v = _storage._optionalImportMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 20) + } }() + try { if let v = _storage._optionalNestedEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 21) + } }() + try { if let v = _storage._optionalForeignEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 22) + } }() + try { if let v = _storage._optionalImportEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 23) + } }() + try { if let v = _storage._optionalStringPiece { + try visitor.visitSingularStringField(value: v, fieldNumber: 24) + } }() + try { if let v = _storage._optionalCord { + try visitor.visitSingularStringField(value: v, fieldNumber: 25) + } }() + try { if let v = _storage._optionalPublicImportMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 26) + } }() + try { if let v = _storage._optionalLazyMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 27) + } }() + try { if let v = _storage._optionalUnverifiedLazyMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 28) + } }() + if !_storage._repeatedInt32.isEmpty { + try visitor.visitRepeatedInt32Field(value: _storage._repeatedInt32, fieldNumber: 31) + } + if !_storage._repeatedInt64.isEmpty { + try visitor.visitRepeatedInt64Field(value: _storage._repeatedInt64, fieldNumber: 32) + } + if !_storage._repeatedUint32.isEmpty { + try visitor.visitRepeatedUInt32Field(value: _storage._repeatedUint32, fieldNumber: 33) + } + if !_storage._repeatedUint64.isEmpty { + try visitor.visitRepeatedUInt64Field(value: _storage._repeatedUint64, fieldNumber: 34) + } + if !_storage._repeatedSint32.isEmpty { + try visitor.visitRepeatedSInt32Field(value: _storage._repeatedSint32, fieldNumber: 35) + } + if !_storage._repeatedSint64.isEmpty { + try visitor.visitRepeatedSInt64Field(value: _storage._repeatedSint64, fieldNumber: 36) + } + if !_storage._repeatedFixed32.isEmpty { + try visitor.visitRepeatedFixed32Field(value: _storage._repeatedFixed32, fieldNumber: 37) + } + if !_storage._repeatedFixed64.isEmpty { + try visitor.visitRepeatedFixed64Field(value: _storage._repeatedFixed64, fieldNumber: 38) + } + if !_storage._repeatedSfixed32.isEmpty { + try visitor.visitRepeatedSFixed32Field(value: _storage._repeatedSfixed32, fieldNumber: 39) + } + if !_storage._repeatedSfixed64.isEmpty { + try visitor.visitRepeatedSFixed64Field(value: _storage._repeatedSfixed64, fieldNumber: 40) + } + if !_storage._repeatedFloat.isEmpty { + try visitor.visitRepeatedFloatField(value: _storage._repeatedFloat, fieldNumber: 41) + } + if !_storage._repeatedDouble.isEmpty { + try visitor.visitRepeatedDoubleField(value: _storage._repeatedDouble, fieldNumber: 42) + } + if !_storage._repeatedBool.isEmpty { + try visitor.visitRepeatedBoolField(value: _storage._repeatedBool, fieldNumber: 43) + } + if !_storage._repeatedString.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedString, fieldNumber: 44) + } + if !_storage._repeatedBytes.isEmpty { + try visitor.visitRepeatedBytesField(value: _storage._repeatedBytes, fieldNumber: 45) + } + if !_storage._repeatedGroup.isEmpty { + try visitor.visitRepeatedGroupField(value: _storage._repeatedGroup, fieldNumber: 46) + } + if !_storage._repeatedNestedMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedNestedMessage, fieldNumber: 48) + } + if !_storage._repeatedForeignMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedForeignMessage, fieldNumber: 49) + } + if !_storage._repeatedImportMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedImportMessage, fieldNumber: 50) + } + if !_storage._repeatedNestedEnum.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedNestedEnum, fieldNumber: 51) + } + if !_storage._repeatedForeignEnum.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedForeignEnum, fieldNumber: 52) + } + if !_storage._repeatedImportEnum.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedImportEnum, fieldNumber: 53) + } + if !_storage._repeatedStringPiece.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedStringPiece, fieldNumber: 54) + } + if !_storage._repeatedCord.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedCord, fieldNumber: 55) + } + if !_storage._repeatedLazyMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedLazyMessage, fieldNumber: 57) + } + try { if let v = _storage._defaultInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 61) + } }() + try { if let v = _storage._defaultInt64 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 62) + } }() + try { if let v = _storage._defaultUint32 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 63) + } }() + try { if let v = _storage._defaultUint64 { + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 64) + } }() + try { if let v = _storage._defaultSint32 { + try visitor.visitSingularSInt32Field(value: v, fieldNumber: 65) + } }() + try { if let v = _storage._defaultSint64 { + try visitor.visitSingularSInt64Field(value: v, fieldNumber: 66) + } }() + try { if let v = _storage._defaultFixed32 { + try visitor.visitSingularFixed32Field(value: v, fieldNumber: 67) + } }() + try { if let v = _storage._defaultFixed64 { + try visitor.visitSingularFixed64Field(value: v, fieldNumber: 68) + } }() + try { if let v = _storage._defaultSfixed32 { + try visitor.visitSingularSFixed32Field(value: v, fieldNumber: 69) + } }() + try { if let v = _storage._defaultSfixed64 { + try visitor.visitSingularSFixed64Field(value: v, fieldNumber: 70) + } }() + try { if let v = _storage._defaultFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 71) + } }() + try { if let v = _storage._defaultDouble { + try visitor.visitSingularDoubleField(value: v, fieldNumber: 72) + } }() + try { if let v = _storage._defaultBool { + try visitor.visitSingularBoolField(value: v, fieldNumber: 73) + } }() + try { if let v = _storage._defaultString { + try visitor.visitSingularStringField(value: v, fieldNumber: 74) + } }() + try { if let v = _storage._defaultBytes { + try visitor.visitSingularBytesField(value: v, fieldNumber: 75) + } }() + try { if let v = _storage._defaultNestedEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 81) + } }() + try { if let v = _storage._defaultForeignEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 82) + } }() + try { if let v = _storage._defaultImportEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 83) + } }() + try { if let v = _storage._defaultStringPiece { + try visitor.visitSingularStringField(value: v, fieldNumber: 84) + } }() + try { if let v = _storage._defaultCord { + try visitor.visitSingularStringField(value: v, fieldNumber: 85) + } }() + switch _storage._oneofField { + case .oneofUint32?: try { + guard case .oneofUint32(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 111) + }() + case .oneofNestedMessage?: try { + guard case .oneofNestedMessage(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 112) + }() + case .oneofString?: try { + guard case .oneofString(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 113) + }() + case .oneofBytes?: try { + guard case .oneofBytes(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 114) + }() + case nil: break + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestAllTypes, rhs: ProtobufUnittest_TestAllTypes) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._optionalInt32 != rhs_storage._optionalInt32 {return false} + if _storage._optionalInt64 != rhs_storage._optionalInt64 {return false} + if _storage._optionalUint32 != rhs_storage._optionalUint32 {return false} + if _storage._optionalUint64 != rhs_storage._optionalUint64 {return false} + if _storage._optionalSint32 != rhs_storage._optionalSint32 {return false} + if _storage._optionalSint64 != rhs_storage._optionalSint64 {return false} + if _storage._optionalFixed32 != rhs_storage._optionalFixed32 {return false} + if _storage._optionalFixed64 != rhs_storage._optionalFixed64 {return false} + if _storage._optionalSfixed32 != rhs_storage._optionalSfixed32 {return false} + if _storage._optionalSfixed64 != rhs_storage._optionalSfixed64 {return false} + if _storage._optionalFloat != rhs_storage._optionalFloat {return false} + if _storage._optionalDouble != rhs_storage._optionalDouble {return false} + if _storage._optionalBool != rhs_storage._optionalBool {return false} + if _storage._optionalString != rhs_storage._optionalString {return false} + if _storage._optionalBytes != rhs_storage._optionalBytes {return false} + if _storage._optionalGroup != rhs_storage._optionalGroup {return false} + if _storage._optionalNestedMessage != rhs_storage._optionalNestedMessage {return false} + if _storage._optionalForeignMessage != rhs_storage._optionalForeignMessage {return false} + if _storage._optionalImportMessage != rhs_storage._optionalImportMessage {return false} + if _storage._optionalNestedEnum != rhs_storage._optionalNestedEnum {return false} + if _storage._optionalForeignEnum != rhs_storage._optionalForeignEnum {return false} + if _storage._optionalImportEnum != rhs_storage._optionalImportEnum {return false} + if _storage._optionalStringPiece != rhs_storage._optionalStringPiece {return false} + if _storage._optionalCord != rhs_storage._optionalCord {return false} + if _storage._optionalPublicImportMessage != rhs_storage._optionalPublicImportMessage {return false} + if _storage._optionalLazyMessage != rhs_storage._optionalLazyMessage {return false} + if _storage._optionalUnverifiedLazyMessage != rhs_storage._optionalUnverifiedLazyMessage {return false} + if _storage._repeatedInt32 != rhs_storage._repeatedInt32 {return false} + if _storage._repeatedInt64 != rhs_storage._repeatedInt64 {return false} + if _storage._repeatedUint32 != rhs_storage._repeatedUint32 {return false} + if _storage._repeatedUint64 != rhs_storage._repeatedUint64 {return false} + if _storage._repeatedSint32 != rhs_storage._repeatedSint32 {return false} + if _storage._repeatedSint64 != rhs_storage._repeatedSint64 {return false} + if _storage._repeatedFixed32 != rhs_storage._repeatedFixed32 {return false} + if _storage._repeatedFixed64 != rhs_storage._repeatedFixed64 {return false} + if _storage._repeatedSfixed32 != rhs_storage._repeatedSfixed32 {return false} + if _storage._repeatedSfixed64 != rhs_storage._repeatedSfixed64 {return false} + if _storage._repeatedFloat != rhs_storage._repeatedFloat {return false} + if _storage._repeatedDouble != rhs_storage._repeatedDouble {return false} + if _storage._repeatedBool != rhs_storage._repeatedBool {return false} + if _storage._repeatedString != rhs_storage._repeatedString {return false} + if _storage._repeatedBytes != rhs_storage._repeatedBytes {return false} + if _storage._repeatedGroup != rhs_storage._repeatedGroup {return false} + if _storage._repeatedNestedMessage != rhs_storage._repeatedNestedMessage {return false} + if _storage._repeatedForeignMessage != rhs_storage._repeatedForeignMessage {return false} + if _storage._repeatedImportMessage != rhs_storage._repeatedImportMessage {return false} + if _storage._repeatedNestedEnum != rhs_storage._repeatedNestedEnum {return false} + if _storage._repeatedForeignEnum != rhs_storage._repeatedForeignEnum {return false} + if _storage._repeatedImportEnum != rhs_storage._repeatedImportEnum {return false} + if _storage._repeatedStringPiece != rhs_storage._repeatedStringPiece {return false} + if _storage._repeatedCord != rhs_storage._repeatedCord {return false} + if _storage._repeatedLazyMessage != rhs_storage._repeatedLazyMessage {return false} + if _storage._defaultInt32 != rhs_storage._defaultInt32 {return false} + if _storage._defaultInt64 != rhs_storage._defaultInt64 {return false} + if _storage._defaultUint32 != rhs_storage._defaultUint32 {return false} + if _storage._defaultUint64 != rhs_storage._defaultUint64 {return false} + if _storage._defaultSint32 != rhs_storage._defaultSint32 {return false} + if _storage._defaultSint64 != rhs_storage._defaultSint64 {return false} + if _storage._defaultFixed32 != rhs_storage._defaultFixed32 {return false} + if _storage._defaultFixed64 != rhs_storage._defaultFixed64 {return false} + if _storage._defaultSfixed32 != rhs_storage._defaultSfixed32 {return false} + if _storage._defaultSfixed64 != rhs_storage._defaultSfixed64 {return false} + if _storage._defaultFloat != rhs_storage._defaultFloat {return false} + if _storage._defaultDouble != rhs_storage._defaultDouble {return false} + if _storage._defaultBool != rhs_storage._defaultBool {return false} + if _storage._defaultString != rhs_storage._defaultString {return false} + if _storage._defaultBytes != rhs_storage._defaultBytes {return false} + if _storage._defaultNestedEnum != rhs_storage._defaultNestedEnum {return false} + if _storage._defaultForeignEnum != rhs_storage._defaultForeignEnum {return false} + if _storage._defaultImportEnum != rhs_storage._defaultImportEnum {return false} + if _storage._defaultStringPiece != rhs_storage._defaultStringPiece {return false} + if _storage._defaultCord != rhs_storage._defaultCord {return false} + if _storage._oneofField != rhs_storage._oneofField {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestAllTypes.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + -1: .same(proto: "NEG"), + 1: .same(proto: "FOO"), + 2: .same(proto: "BAR"), + 3: .same(proto: "BAZ"), + ] +} + +extension ProtobufUnittest_TestAllTypes.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestAllTypes.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "bb"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._bb) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._bb { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestAllTypes.NestedMessage, rhs: ProtobufUnittest_TestAllTypes.NestedMessage) -> Bool { + if lhs._bb != rhs._bb {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestAllTypes.OptionalGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestAllTypes.protoMessageName + ".OptionalGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 17: .same(proto: "a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 17: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 17) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestAllTypes.OptionalGroup, rhs: ProtobufUnittest_TestAllTypes.OptionalGroup) -> Bool { + if lhs._a != rhs._a {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestAllTypes.RepeatedGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestAllTypes.protoMessageName + ".RepeatedGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 47: .same(proto: "a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 47: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 47) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestAllTypes.RepeatedGroup, rhs: ProtobufUnittest_TestAllTypes.RepeatedGroup) -> Bool { + if lhs._a != rhs._a {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_NestedTestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".NestedTestAllTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "child"), + 2: .same(proto: "payload"), + 3: .standard(proto: "repeated_child"), + 4: .standard(proto: "lazy_child"), + 5: .standard(proto: "eager_child"), + ] + + fileprivate class _StorageClass { + var _child: ProtobufUnittest_NestedTestAllTypes? = nil + var _payload: ProtobufUnittest_TestAllTypes? = nil + var _repeatedChild: [ProtobufUnittest_NestedTestAllTypes] = [] + var _lazyChild: ProtobufUnittest_NestedTestAllTypes? = nil + var _eagerChild: ProtobufUnittest_TestAllTypes? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _child = source._child + _payload = source._payload + _repeatedChild = source._repeatedChild + _lazyChild = source._lazyChild + _eagerChild = source._eagerChild + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._child) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._payload) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedChild) }() + case 4: try { try decoder.decodeSingularMessageField(value: &_storage._lazyChild) }() + case 5: try { try decoder.decodeSingularMessageField(value: &_storage._eagerChild) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._child { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._payload { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if !_storage._repeatedChild.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedChild, fieldNumber: 3) + } + try { if let v = _storage._lazyChild { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._eagerChild { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_NestedTestAllTypes, rhs: ProtobufUnittest_NestedTestAllTypes) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._child != rhs_storage._child {return false} + if _storage._payload != rhs_storage._payload {return false} + if _storage._repeatedChild != rhs_storage._repeatedChild {return false} + if _storage._lazyChild != rhs_storage._lazyChild {return false} + if _storage._eagerChild != rhs_storage._eagerChild {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestDeprecatedFields: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestDeprecatedFields" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "deprecated_int32"), + 4: .standard(proto: "deprecated_repeated_string"), + 3: .standard(proto: "deprecated_message"), + 2: .standard(proto: "deprecated_int32_in_oneof"), + 5: .same(proto: "nested"), + ] + + fileprivate class _StorageClass { + var _deprecatedInt32: Int32? = nil + var _deprecatedRepeatedString: [String] = [] + var _deprecatedMessage: ProtobufUnittest_TestAllTypes.NestedMessage? = nil + var _oneofFields: ProtobufUnittest_TestDeprecatedFields.OneOf_OneofFields? + var _nested: ProtobufUnittest_TestDeprecatedFields? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _deprecatedInt32 = source._deprecatedInt32 + _deprecatedRepeatedString = source._deprecatedRepeatedString + _deprecatedMessage = source._deprecatedMessage + _oneofFields = source._oneofFields + _nested = source._nested + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._deprecatedInt32) }() + case 2: try { + var v: Int32? + try decoder.decodeSingularInt32Field(value: &v) + if let v = v { + if _storage._oneofFields != nil {try decoder.handleConflictingOneOf()} + _storage._oneofFields = .deprecatedInt32InOneof(v) + } + }() + case 3: try { try decoder.decodeSingularMessageField(value: &_storage._deprecatedMessage) }() + case 4: try { try decoder.decodeRepeatedStringField(value: &_storage._deprecatedRepeatedString) }() + case 5: try { try decoder.decodeSingularMessageField(value: &_storage._nested) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._deprecatedInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if case .deprecatedInt32InOneof(let v)? = _storage._oneofFields { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._deprecatedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + if !_storage._deprecatedRepeatedString.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._deprecatedRepeatedString, fieldNumber: 4) + } + try { if let v = _storage._nested { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestDeprecatedFields, rhs: ProtobufUnittest_TestDeprecatedFields) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._deprecatedInt32 != rhs_storage._deprecatedInt32 {return false} + if _storage._deprecatedRepeatedString != rhs_storage._deprecatedRepeatedString {return false} + if _storage._deprecatedMessage != rhs_storage._deprecatedMessage {return false} + if _storage._oneofFields != rhs_storage._oneofFields {return false} + if _storage._nested != rhs_storage._nested {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestDeprecatedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestDeprecatedMessage" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestDeprecatedMessage, rhs: ProtobufUnittest_TestDeprecatedMessage) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_ForeignMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ForeignMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "c"), + 2: .same(proto: "d"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._c) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._d) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._c { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._d { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_ForeignMessage, rhs: ProtobufUnittest_ForeignMessage) -> Bool { + if lhs._c != rhs._c {return false} + if lhs._d != rhs._d {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestReservedFields: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestReservedFields" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestReservedFields, rhs: ProtobufUnittest_TestReservedFields) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestAllExtensions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestAllExtensions" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + if (1 <= fieldNumber && fieldNumber < 536870912) { + try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestAllExtensions.self, fieldNumber: fieldNumber) + } + } + } + + func traverse(visitor: inout V) throws { + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestAllExtensions, rhs: ProtobufUnittest_TestAllExtensions) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_OptionalGroup_extension: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".OptionalGroup_extension" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 17: .same(proto: "a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 17: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 17) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_OptionalGroup_extension, rhs: ProtobufUnittest_OptionalGroup_extension) -> Bool { + if lhs._a != rhs._a {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_RepeatedGroup_extension: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RepeatedGroup_extension" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 47: .same(proto: "a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 47: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 47) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_RepeatedGroup_extension, rhs: ProtobufUnittest_RepeatedGroup_extension) -> Bool { + if lhs._a != rhs._a {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMixedFieldsAndExtensions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMixedFieldsAndExtensions" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 3: .same(proto: "b"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + case 3: try { try decoder.decodeRepeatedFixed32Field(value: &self.b) }() + case 2, 4: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestMixedFieldsAndExtensions.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 2, end: 3) + if !self.b.isEmpty { + try visitor.visitRepeatedFixed32Field(value: self.b, fieldNumber: 3) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 4, end: 5) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMixedFieldsAndExtensions, rhs: ProtobufUnittest_TestMixedFieldsAndExtensions) -> Bool { + if lhs._a != rhs._a {return false} + if lhs.b != rhs.b {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 16: .unique(proto: "OptionalGroup", json: "optionalgroup"), + 22: .standard(proto: "optional_foreign_enum"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 16: try { try decoder.decodeSingularGroupField(value: &self._optionalGroup) }() + case 22: try { try decoder.decodeSingularEnumField(value: &self._optionalForeignEnum) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalGroup { + try visitor.visitSingularGroupField(value: v, fieldNumber: 16) + } }() + try { if let v = self._optionalForeignEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 22) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestGroup, rhs: ProtobufUnittest_TestGroup) -> Bool { + if lhs._optionalGroup != rhs._optionalGroup {return false} + if lhs._optionalForeignEnum != rhs._optionalForeignEnum {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestGroup.OptionalGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestGroup.protoMessageName + ".OptionalGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 17: .same(proto: "a"), + 89: .same(proto: "zz"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 17: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + case 89: try { try decoder.decodeSingularInt32Field(value: &self._zz) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 17) + } }() + try { if let v = self._zz { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 89) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestGroup.OptionalGroup, rhs: ProtobufUnittest_TestGroup.OptionalGroup) -> Bool { + if lhs._a != rhs._a {return false} + if lhs._zz != rhs._zz {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestGroupExtension: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestGroupExtension" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + if (1 <= fieldNumber && fieldNumber < 536870912) { + try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestGroupExtension.self, fieldNumber: fieldNumber) + } + } + } + + func traverse(visitor: inout V) throws { + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestGroupExtension, rhs: ProtobufUnittest_TestGroupExtension) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestNestedExtension: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestNestedExtension" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestNestedExtension, rhs: ProtobufUnittest_TestNestedExtension) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestNestedExtension.OptionalGroup_extension: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestNestedExtension.protoMessageName + ".OptionalGroup_extension" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 17: .same(proto: "a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 17: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 17) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestNestedExtension.OptionalGroup_extension, rhs: ProtobufUnittest_TestNestedExtension.OptionalGroup_extension) -> Bool { + if lhs._a != rhs._a {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestChildExtension: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestChildExtension" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 2: .same(proto: "b"), + 3: .standard(proto: "optional_extension"), + ] + + public var isInitialized: Bool { + if let v = self._optionalExtension, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._a) }() + case 2: try { try decoder.decodeSingularStringField(value: &self._b) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._optionalExtension) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._b { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try { if let v = self._optionalExtension { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestChildExtension, rhs: ProtobufUnittest_TestChildExtension) -> Bool { + if lhs._a != rhs._a {return false} + if lhs._b != rhs._b {return false} + if lhs._optionalExtension != rhs._optionalExtension {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestChildExtensionData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestChildExtensionData" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 2: .same(proto: "b"), + 3: .standard(proto: "optional_extension"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._a) }() + case 2: try { try decoder.decodeSingularStringField(value: &self._b) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._optionalExtension) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._b { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try { if let v = self._optionalExtension { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestChildExtensionData, rhs: ProtobufUnittest_TestChildExtensionData) -> Bool { + if lhs._a != rhs._a {return false} + if lhs._b != rhs._b {return false} + if lhs._optionalExtension != rhs._optionalExtension {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestChildExtensionData.NestedTestAllExtensionsData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestChildExtensionData.protoMessageName + ".NestedTestAllExtensionsData" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 409707008: .same(proto: "dynamic"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 409707008: try { try decoder.decodeSingularMessageField(value: &self._dynamic) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._dynamic { + try visitor.visitSingularMessageField(value: v, fieldNumber: 409707008) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestChildExtensionData.NestedTestAllExtensionsData, rhs: ProtobufUnittest_TestChildExtensionData.NestedTestAllExtensionsData) -> Bool { + if lhs._dynamic != rhs._dynamic {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestChildExtensionData.NestedTestAllExtensionsData.NestedDynamicExtensions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestChildExtensionData.NestedTestAllExtensionsData.protoMessageName + ".NestedDynamicExtensions" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 2: .same(proto: "b"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._b { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestChildExtensionData.NestedTestAllExtensionsData.NestedDynamicExtensions, rhs: ProtobufUnittest_TestChildExtensionData.NestedTestAllExtensionsData.NestedDynamicExtensions) -> Bool { + if lhs._a != rhs._a {return false} + if lhs._b != rhs._b {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestNestedChildExtension: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestNestedChildExtension" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 2: .same(proto: "child"), + ] + + public var isInitialized: Bool { + if let v = self._child, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._child) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._child { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestNestedChildExtension, rhs: ProtobufUnittest_TestNestedChildExtension) -> Bool { + if lhs._a != rhs._a {return false} + if lhs._child != rhs._child {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestNestedChildExtensionData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestNestedChildExtensionData" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 2: .same(proto: "child"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._child) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._child { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestNestedChildExtensionData, rhs: ProtobufUnittest_TestNestedChildExtensionData) -> Bool { + if lhs._a != rhs._a {return false} + if lhs._child != rhs._child {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestRequired: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestRequired" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 2: .same(proto: "dummy2"), + 3: .same(proto: "b"), + 4: .same(proto: "dummy4"), + 5: .same(proto: "dummy5"), + 6: .same(proto: "dummy6"), + 7: .same(proto: "dummy7"), + 8: .same(proto: "dummy8"), + 9: .same(proto: "dummy9"), + 10: .same(proto: "dummy10"), + 11: .same(proto: "dummy11"), + 12: .same(proto: "dummy12"), + 13: .same(proto: "dummy13"), + 14: .same(proto: "dummy14"), + 15: .same(proto: "dummy15"), + 16: .same(proto: "dummy16"), + 17: .same(proto: "dummy17"), + 18: .same(proto: "dummy18"), + 19: .same(proto: "dummy19"), + 20: .same(proto: "dummy20"), + 21: .same(proto: "dummy21"), + 22: .same(proto: "dummy22"), + 23: .same(proto: "dummy23"), + 24: .same(proto: "dummy24"), + 25: .same(proto: "dummy25"), + 26: .same(proto: "dummy26"), + 27: .same(proto: "dummy27"), + 28: .same(proto: "dummy28"), + 29: .same(proto: "dummy29"), + 30: .same(proto: "dummy30"), + 31: .same(proto: "dummy31"), + 32: .same(proto: "dummy32"), + 33: .same(proto: "c"), + 34: .standard(proto: "optional_foreign"), + ] + + fileprivate class _StorageClass { + var _a: Int32? = nil + var _dummy2: Int32? = nil + var _b: Int32? = nil + var _dummy4: Int32? = nil + var _dummy5: Int32? = nil + var _dummy6: Int32? = nil + var _dummy7: Int32? = nil + var _dummy8: Int32? = nil + var _dummy9: Int32? = nil + var _dummy10: Int32? = nil + var _dummy11: Int32? = nil + var _dummy12: Int32? = nil + var _dummy13: Int32? = nil + var _dummy14: Int32? = nil + var _dummy15: Int32? = nil + var _dummy16: Int32? = nil + var _dummy17: Int32? = nil + var _dummy18: Int32? = nil + var _dummy19: Int32? = nil + var _dummy20: Int32? = nil + var _dummy21: Int32? = nil + var _dummy22: Int32? = nil + var _dummy23: Int32? = nil + var _dummy24: Int32? = nil + var _dummy25: Int32? = nil + var _dummy26: Int32? = nil + var _dummy27: Int32? = nil + var _dummy28: Int32? = nil + var _dummy29: Int32? = nil + var _dummy30: Int32? = nil + var _dummy31: Int32? = nil + var _dummy32: Int32? = nil + var _c: Int32? = nil + var _optionalForeign: ProtobufUnittest_ForeignMessage? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _a = source._a + _dummy2 = source._dummy2 + _b = source._b + _dummy4 = source._dummy4 + _dummy5 = source._dummy5 + _dummy6 = source._dummy6 + _dummy7 = source._dummy7 + _dummy8 = source._dummy8 + _dummy9 = source._dummy9 + _dummy10 = source._dummy10 + _dummy11 = source._dummy11 + _dummy12 = source._dummy12 + _dummy13 = source._dummy13 + _dummy14 = source._dummy14 + _dummy15 = source._dummy15 + _dummy16 = source._dummy16 + _dummy17 = source._dummy17 + _dummy18 = source._dummy18 + _dummy19 = source._dummy19 + _dummy20 = source._dummy20 + _dummy21 = source._dummy21 + _dummy22 = source._dummy22 + _dummy23 = source._dummy23 + _dummy24 = source._dummy24 + _dummy25 = source._dummy25 + _dummy26 = source._dummy26 + _dummy27 = source._dummy27 + _dummy28 = source._dummy28 + _dummy29 = source._dummy29 + _dummy30 = source._dummy30 + _dummy31 = source._dummy31 + _dummy32 = source._dummy32 + _c = source._c + _optionalForeign = source._optionalForeign + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + public var isInitialized: Bool { + return withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if _storage._a == nil {return false} + if _storage._b == nil {return false} + if _storage._c == nil {return false} + return true + } + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._a) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy2) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &_storage._b) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy4) }() + case 5: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy5) }() + case 6: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy6) }() + case 7: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy7) }() + case 8: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy8) }() + case 9: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy9) }() + case 10: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy10) }() + case 11: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy11) }() + case 12: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy12) }() + case 13: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy13) }() + case 14: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy14) }() + case 15: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy15) }() + case 16: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy16) }() + case 17: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy17) }() + case 18: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy18) }() + case 19: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy19) }() + case 20: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy20) }() + case 21: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy21) }() + case 22: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy22) }() + case 23: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy23) }() + case 24: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy24) }() + case 25: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy25) }() + case 26: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy26) }() + case 27: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy27) }() + case 28: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy28) }() + case 29: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy29) }() + case 30: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy30) }() + case 31: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy31) }() + case 32: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy32) }() + case 33: try { try decoder.decodeSingularInt32Field(value: &_storage._c) }() + case 34: try { try decoder.decodeSingularMessageField(value: &_storage._optionalForeign) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._dummy2 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._b { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._dummy4 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._dummy5 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 5) + } }() + try { if let v = _storage._dummy6 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 6) + } }() + try { if let v = _storage._dummy7 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 7) + } }() + try { if let v = _storage._dummy8 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 8) + } }() + try { if let v = _storage._dummy9 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._dummy10 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._dummy11 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 11) + } }() + try { if let v = _storage._dummy12 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 12) + } }() + try { if let v = _storage._dummy13 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 13) + } }() + try { if let v = _storage._dummy14 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 14) + } }() + try { if let v = _storage._dummy15 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 15) + } }() + try { if let v = _storage._dummy16 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 16) + } }() + try { if let v = _storage._dummy17 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 17) + } }() + try { if let v = _storage._dummy18 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._dummy19 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 19) + } }() + try { if let v = _storage._dummy20 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 20) + } }() + try { if let v = _storage._dummy21 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 21) + } }() + try { if let v = _storage._dummy22 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 22) + } }() + try { if let v = _storage._dummy23 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 23) + } }() + try { if let v = _storage._dummy24 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 24) + } }() + try { if let v = _storage._dummy25 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 25) + } }() + try { if let v = _storage._dummy26 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 26) + } }() + try { if let v = _storage._dummy27 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 27) + } }() + try { if let v = _storage._dummy28 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 28) + } }() + try { if let v = _storage._dummy29 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 29) + } }() + try { if let v = _storage._dummy30 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 30) + } }() + try { if let v = _storage._dummy31 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 31) + } }() + try { if let v = _storage._dummy32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 32) + } }() + try { if let v = _storage._c { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 33) + } }() + try { if let v = _storage._optionalForeign { + try visitor.visitSingularMessageField(value: v, fieldNumber: 34) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestRequired, rhs: ProtobufUnittest_TestRequired) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._a != rhs_storage._a {return false} + if _storage._dummy2 != rhs_storage._dummy2 {return false} + if _storage._b != rhs_storage._b {return false} + if _storage._dummy4 != rhs_storage._dummy4 {return false} + if _storage._dummy5 != rhs_storage._dummy5 {return false} + if _storage._dummy6 != rhs_storage._dummy6 {return false} + if _storage._dummy7 != rhs_storage._dummy7 {return false} + if _storage._dummy8 != rhs_storage._dummy8 {return false} + if _storage._dummy9 != rhs_storage._dummy9 {return false} + if _storage._dummy10 != rhs_storage._dummy10 {return false} + if _storage._dummy11 != rhs_storage._dummy11 {return false} + if _storage._dummy12 != rhs_storage._dummy12 {return false} + if _storage._dummy13 != rhs_storage._dummy13 {return false} + if _storage._dummy14 != rhs_storage._dummy14 {return false} + if _storage._dummy15 != rhs_storage._dummy15 {return false} + if _storage._dummy16 != rhs_storage._dummy16 {return false} + if _storage._dummy17 != rhs_storage._dummy17 {return false} + if _storage._dummy18 != rhs_storage._dummy18 {return false} + if _storage._dummy19 != rhs_storage._dummy19 {return false} + if _storage._dummy20 != rhs_storage._dummy20 {return false} + if _storage._dummy21 != rhs_storage._dummy21 {return false} + if _storage._dummy22 != rhs_storage._dummy22 {return false} + if _storage._dummy23 != rhs_storage._dummy23 {return false} + if _storage._dummy24 != rhs_storage._dummy24 {return false} + if _storage._dummy25 != rhs_storage._dummy25 {return false} + if _storage._dummy26 != rhs_storage._dummy26 {return false} + if _storage._dummy27 != rhs_storage._dummy27 {return false} + if _storage._dummy28 != rhs_storage._dummy28 {return false} + if _storage._dummy29 != rhs_storage._dummy29 {return false} + if _storage._dummy30 != rhs_storage._dummy30 {return false} + if _storage._dummy31 != rhs_storage._dummy31 {return false} + if _storage._dummy32 != rhs_storage._dummy32 {return false} + if _storage._c != rhs_storage._c {return false} + if _storage._optionalForeign != rhs_storage._optionalForeign {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestRequiredForeign: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestRequiredForeign" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_message"), + 2: .standard(proto: "repeated_message"), + 3: .same(proto: "dummy"), + 4: .standard(proto: "optional_lazy_message"), + ] + + public var isInitialized: Bool { + if let v = self._optionalMessage, !v.isInitialized {return false} + if !SwiftProtobuf.Internal.areAllInitialized(self.repeatedMessage) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._optionalMessage) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedMessage) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self._dummy) }() + case 4: try { try decoder.decodeSingularMessageField(value: &self._optionalLazyMessage) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if !self.repeatedMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedMessage, fieldNumber: 2) + } + try { if let v = self._dummy { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) + } }() + try { if let v = self._optionalLazyMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestRequiredForeign, rhs: ProtobufUnittest_TestRequiredForeign) -> Bool { + if lhs._optionalMessage != rhs._optionalMessage {return false} + if lhs.repeatedMessage != rhs.repeatedMessage {return false} + if lhs._dummy != rhs._dummy {return false} + if lhs._optionalLazyMessage != rhs._optionalLazyMessage {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestRequiredMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestRequiredMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_message"), + 2: .standard(proto: "repeated_message"), + 3: .standard(proto: "required_message"), + ] + + public var isInitialized: Bool { + if self._requiredMessage == nil {return false} + if let v = self._optionalMessage, !v.isInitialized {return false} + if !SwiftProtobuf.Internal.areAllInitialized(self.repeatedMessage) {return false} + if let v = self._requiredMessage, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._optionalMessage) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedMessage) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._requiredMessage) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if !self.repeatedMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedMessage, fieldNumber: 2) + } + try { if let v = self._requiredMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestRequiredMessage, rhs: ProtobufUnittest_TestRequiredMessage) -> Bool { + if lhs._optionalMessage != rhs._optionalMessage {return false} + if lhs.repeatedMessage != rhs.repeatedMessage {return false} + if lhs._requiredMessage != rhs._requiredMessage {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestNestedRequiredForeign: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestNestedRequiredForeign" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "child"), + 2: .same(proto: "payload"), + 3: .same(proto: "dummy"), + ] + + fileprivate class _StorageClass { + var _child: ProtobufUnittest_TestNestedRequiredForeign? = nil + var _payload: ProtobufUnittest_TestRequiredForeign? = nil + var _dummy: Int32? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _child = source._child + _payload = source._payload + _dummy = source._dummy + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + public var isInitialized: Bool { + return withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if let v = _storage._child, !v.isInitialized {return false} + if let v = _storage._payload, !v.isInitialized {return false} + return true + } + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._child) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._payload) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &_storage._dummy) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._child { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._payload { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._dummy { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestNestedRequiredForeign, rhs: ProtobufUnittest_TestNestedRequiredForeign) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._child != rhs_storage._child {return false} + if _storage._payload != rhs_storage._payload {return false} + if _storage._dummy != rhs_storage._dummy {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestForeignNested: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestForeignNested" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "foreign_nested"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._foreignNested) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._foreignNested { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestForeignNested, rhs: ProtobufUnittest_TestForeignNested) -> Bool { + if lhs._foreignNested != rhs._foreignNested {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestEmptyMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestEmptyMessage" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestEmptyMessage, rhs: ProtobufUnittest_TestEmptyMessage) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestEmptyMessageWithExtensions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestEmptyMessageWithExtensions" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + if (1 <= fieldNumber && fieldNumber < 536870912) { + try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestEmptyMessageWithExtensions.self, fieldNumber: fieldNumber) + } + } + } + + func traverse(visitor: inout V) throws { + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestEmptyMessageWithExtensions, rhs: ProtobufUnittest_TestEmptyMessageWithExtensions) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestPickleNestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestPickleNestedMessage" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestPickleNestedMessage, rhs: ProtobufUnittest_TestPickleNestedMessage) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestPickleNestedMessage.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestPickleNestedMessage.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "bb"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._bb) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._bb { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestPickleNestedMessage.NestedMessage, rhs: ProtobufUnittest_TestPickleNestedMessage.NestedMessage) -> Bool { + if lhs._bb != rhs._bb {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestPickleNestedMessage.NestedMessage.NestedNestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestPickleNestedMessage.NestedMessage.protoMessageName + ".NestedNestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "cc"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._cc) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._cc { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestPickleNestedMessage.NestedMessage.NestedNestedMessage, rhs: ProtobufUnittest_TestPickleNestedMessage.NestedMessage.NestedNestedMessage) -> Bool { + if lhs._cc != rhs._cc {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMultipleExtensionRanges: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMultipleExtensionRanges" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + if (42 == fieldNumber) || (4143 <= fieldNumber && fieldNumber < 4244) || (65536 <= fieldNumber && fieldNumber < 536870912) { + try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestMultipleExtensionRanges.self, fieldNumber: fieldNumber) + } + } + } + + func traverse(visitor: inout V) throws { + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 42, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMultipleExtensionRanges, rhs: ProtobufUnittest_TestMultipleExtensionRanges) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestReallyLargeTagNumber: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestReallyLargeTagNumber" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 268435455: .same(proto: "bb"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + case 268435455: try { try decoder.decodeSingularInt32Field(value: &self._bb) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._bb { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 268435455) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestReallyLargeTagNumber, rhs: ProtobufUnittest_TestReallyLargeTagNumber) -> Bool { + if lhs._a != rhs._a {return false} + if lhs._bb != rhs._bb {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestRecursiveMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestRecursiveMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 2: .same(proto: "i"), + ] + + fileprivate class _StorageClass { + var _a: ProtobufUnittest_TestRecursiveMessage? = nil + var _i: Int32? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _a = source._a + _i = source._i + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._a) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &_storage._i) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._a { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._i { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestRecursiveMessage, rhs: ProtobufUnittest_TestRecursiveMessage) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._a != rhs_storage._a {return false} + if _storage._i != rhs_storage._i {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMutualRecursionA: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMutualRecursionA" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "bb"), + 2: .unique(proto: "SubGroup", json: "subgroup"), + 5: .unique(proto: "SubGroupR", json: "subgroupr"), + ] + + fileprivate class _StorageClass { + var _bb: ProtobufUnittest_TestMutualRecursionB? = nil + var _subGroup: ProtobufUnittest_TestMutualRecursionA.SubGroup? = nil + var _subGroupR: [ProtobufUnittest_TestMutualRecursionA.SubGroupR] = [] + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _bb = source._bb + _subGroup = source._subGroup + _subGroupR = source._subGroupR + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._bb) }() + case 2: try { try decoder.decodeSingularGroupField(value: &_storage._subGroup) }() + case 5: try { try decoder.decodeRepeatedGroupField(value: &_storage._subGroupR) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._bb { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._subGroup { + try visitor.visitSingularGroupField(value: v, fieldNumber: 2) + } }() + if !_storage._subGroupR.isEmpty { + try visitor.visitRepeatedGroupField(value: _storage._subGroupR, fieldNumber: 5) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMutualRecursionA, rhs: ProtobufUnittest_TestMutualRecursionA) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._bb != rhs_storage._bb {return false} + if _storage._subGroup != rhs_storage._subGroup {return false} + if _storage._subGroupR != rhs_storage._subGroupR {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMutualRecursionA.SubMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestMutualRecursionA.protoMessageName + ".SubMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "b"), + ] + + fileprivate class _StorageClass { + var _b: ProtobufUnittest_TestMutualRecursionB? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _b = source._b + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._b) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._b { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMutualRecursionA.SubMessage, rhs: ProtobufUnittest_TestMutualRecursionA.SubMessage) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._b != rhs_storage._b {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMutualRecursionA.SubGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestMutualRecursionA.protoMessageName + ".SubGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 3: .standard(proto: "sub_message"), + 4: .standard(proto: "not_in_this_scc"), + ] + + fileprivate class _StorageClass { + var _subMessage: ProtobufUnittest_TestMutualRecursionA.SubMessage? = nil + var _notInThisScc: ProtobufUnittest_TestAllTypes? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _subMessage = source._subMessage + _notInThisScc = source._notInThisScc + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 3: try { try decoder.decodeSingularMessageField(value: &_storage._subMessage) }() + case 4: try { try decoder.decodeSingularMessageField(value: &_storage._notInThisScc) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._subMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._notInThisScc { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMutualRecursionA.SubGroup, rhs: ProtobufUnittest_TestMutualRecursionA.SubGroup) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._subMessage != rhs_storage._subMessage {return false} + if _storage._notInThisScc != rhs_storage._notInThisScc {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMutualRecursionA.SubGroupR: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestMutualRecursionA.protoMessageName + ".SubGroupR" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 6: .same(proto: "payload"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 6: try { try decoder.decodeSingularMessageField(value: &self._payload) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._payload { + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMutualRecursionA.SubGroupR, rhs: ProtobufUnittest_TestMutualRecursionA.SubGroupR) -> Bool { + if lhs._payload != rhs._payload {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMutualRecursionB: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMutualRecursionB" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 2: .standard(proto: "optional_int32"), + ] + + fileprivate class _StorageClass { + var _a: ProtobufUnittest_TestMutualRecursionA? = nil + var _optionalInt32: Int32? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _a = source._a + _optionalInt32 = source._optionalInt32 + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._a) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &_storage._optionalInt32) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._a { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._optionalInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMutualRecursionB, rhs: ProtobufUnittest_TestMutualRecursionB) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._a != rhs_storage._a {return false} + if _storage._optionalInt32 != rhs_storage._optionalInt32 {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestIsInitialized: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestIsInitialized" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "sub_message"), + ] + + public var isInitialized: Bool { + if let v = self._subMessage, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._subMessage) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._subMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestIsInitialized, rhs: ProtobufUnittest_TestIsInitialized) -> Bool { + if lhs._subMessage != rhs._subMessage {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestIsInitialized.SubMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestIsInitialized.protoMessageName + ".SubMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .unique(proto: "SubGroup", json: "subgroup"), + ] + + public var isInitialized: Bool { + if let v = self._subGroup, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularGroupField(value: &self._subGroup) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._subGroup { + try visitor.visitSingularGroupField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestIsInitialized.SubMessage, rhs: ProtobufUnittest_TestIsInitialized.SubMessage) -> Bool { + if lhs._subGroup != rhs._subGroup {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestIsInitialized.SubMessage.SubGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestIsInitialized.SubMessage.protoMessageName + ".SubGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 2: .same(proto: "i"), + ] + + public var isInitialized: Bool { + if self._i == nil {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 2: try { try decoder.decodeSingularInt32Field(value: &self._i) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._i { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestIsInitialized.SubMessage.SubGroup, rhs: ProtobufUnittest_TestIsInitialized.SubMessage.SubGroup) -> Bool { + if lhs._i != rhs._i {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestDupFieldNumber: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestDupFieldNumber" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 2: .unique(proto: "Foo", json: "foo"), + 3: .unique(proto: "Bar", json: "bar"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + case 2: try { try decoder.decodeSingularGroupField(value: &self._foo) }() + case 3: try { try decoder.decodeSingularGroupField(value: &self._bar) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._foo { + try visitor.visitSingularGroupField(value: v, fieldNumber: 2) + } }() + try { if let v = self._bar { + try visitor.visitSingularGroupField(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestDupFieldNumber, rhs: ProtobufUnittest_TestDupFieldNumber) -> Bool { + if lhs._a != rhs._a {return false} + if lhs._foo != rhs._foo {return false} + if lhs._bar != rhs._bar {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestDupFieldNumber.Foo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestDupFieldNumber.protoMessageName + ".Foo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestDupFieldNumber.Foo, rhs: ProtobufUnittest_TestDupFieldNumber.Foo) -> Bool { + if lhs._a != rhs._a {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestDupFieldNumber.Bar: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestDupFieldNumber.protoMessageName + ".Bar" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestDupFieldNumber.Bar, rhs: ProtobufUnittest_TestDupFieldNumber.Bar) -> Bool { + if lhs._a != rhs._a {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestEagerMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestEagerMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "sub_message"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._subMessage) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._subMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestEagerMessage, rhs: ProtobufUnittest_TestEagerMessage) -> Bool { + if lhs._subMessage != rhs._subMessage {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestLazyMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestLazyMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "sub_message"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._subMessage) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._subMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestLazyMessage, rhs: ProtobufUnittest_TestLazyMessage) -> Bool { + if lhs._subMessage != rhs._subMessage {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestLazyMessageRepeated: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestLazyMessageRepeated" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "repeated_message"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedMessage) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.repeatedMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedMessage, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestLazyMessageRepeated, rhs: ProtobufUnittest_TestLazyMessageRepeated) -> Bool { + if lhs.repeatedMessage != rhs.repeatedMessage {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestEagerMaybeLazy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestEagerMaybeLazy" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "message_foo"), + 2: .standard(proto: "message_bar"), + 3: .standard(proto: "message_baz"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._messageFoo) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._messageBar) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._messageBaz) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._messageFoo { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._messageBar { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = self._messageBaz { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestEagerMaybeLazy, rhs: ProtobufUnittest_TestEagerMaybeLazy) -> Bool { + if lhs._messageFoo != rhs._messageFoo {return false} + if lhs._messageBar != rhs._messageBar {return false} + if lhs._messageBaz != rhs._messageBaz {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestEagerMaybeLazy.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestEagerMaybeLazy.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "packed"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._packed) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._packed { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestEagerMaybeLazy.NestedMessage, rhs: ProtobufUnittest_TestEagerMaybeLazy.NestedMessage) -> Bool { + if lhs._packed != rhs._packed {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestNestedMessageHasBits: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestNestedMessageHasBits" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_nested_message"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._optionalNestedMessage) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalNestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestNestedMessageHasBits, rhs: ProtobufUnittest_TestNestedMessageHasBits) -> Bool { + if lhs._optionalNestedMessage != rhs._optionalNestedMessage {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestNestedMessageHasBits.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestNestedMessageHasBits.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "nestedmessage_repeated_int32"), + 2: .standard(proto: "nestedmessage_repeated_foreignmessage"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedInt32Field(value: &self.nestedmessageRepeatedInt32) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.nestedmessageRepeatedForeignmessage) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.nestedmessageRepeatedInt32.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.nestedmessageRepeatedInt32, fieldNumber: 1) + } + if !self.nestedmessageRepeatedForeignmessage.isEmpty { + try visitor.visitRepeatedMessageField(value: self.nestedmessageRepeatedForeignmessage, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestNestedMessageHasBits.NestedMessage, rhs: ProtobufUnittest_TestNestedMessageHasBits.NestedMessage) -> Bool { + if lhs.nestedmessageRepeatedInt32 != rhs.nestedmessageRepeatedInt32 {return false} + if lhs.nestedmessageRepeatedForeignmessage != rhs.nestedmessageRepeatedForeignmessage {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestCamelCaseFieldNames: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestCamelCaseFieldNames" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "PrimitiveField"), + 2: .same(proto: "StringField"), + 3: .same(proto: "EnumField"), + 4: .same(proto: "MessageField"), + 5: .same(proto: "StringPieceField"), + 6: .same(proto: "CordField"), + 7: .same(proto: "RepeatedPrimitiveField"), + 8: .same(proto: "RepeatedStringField"), + 9: .same(proto: "RepeatedEnumField"), + 10: .same(proto: "RepeatedMessageField"), + 11: .same(proto: "RepeatedStringPieceField"), + 12: .same(proto: "RepeatedCordField"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._primitiveField) }() + case 2: try { try decoder.decodeSingularStringField(value: &self._stringField) }() + case 3: try { try decoder.decodeSingularEnumField(value: &self._enumField) }() + case 4: try { try decoder.decodeSingularMessageField(value: &self._messageField) }() + case 5: try { try decoder.decodeSingularStringField(value: &self._stringPieceField) }() + case 6: try { try decoder.decodeSingularStringField(value: &self._cordField) }() + case 7: try { try decoder.decodeRepeatedInt32Field(value: &self.repeatedPrimitiveField) }() + case 8: try { try decoder.decodeRepeatedStringField(value: &self.repeatedStringField) }() + case 9: try { try decoder.decodeRepeatedEnumField(value: &self.repeatedEnumField) }() + case 10: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedMessageField) }() + case 11: try { try decoder.decodeRepeatedStringField(value: &self.repeatedStringPieceField) }() + case 12: try { try decoder.decodeRepeatedStringField(value: &self.repeatedCordField) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._primitiveField { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._stringField { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try { if let v = self._enumField { + try visitor.visitSingularEnumField(value: v, fieldNumber: 3) + } }() + try { if let v = self._messageField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + try { if let v = self._stringPieceField { + try visitor.visitSingularStringField(value: v, fieldNumber: 5) + } }() + try { if let v = self._cordField { + try visitor.visitSingularStringField(value: v, fieldNumber: 6) + } }() + if !self.repeatedPrimitiveField.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.repeatedPrimitiveField, fieldNumber: 7) + } + if !self.repeatedStringField.isEmpty { + try visitor.visitRepeatedStringField(value: self.repeatedStringField, fieldNumber: 8) + } + if !self.repeatedEnumField.isEmpty { + try visitor.visitRepeatedEnumField(value: self.repeatedEnumField, fieldNumber: 9) + } + if !self.repeatedMessageField.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedMessageField, fieldNumber: 10) + } + if !self.repeatedStringPieceField.isEmpty { + try visitor.visitRepeatedStringField(value: self.repeatedStringPieceField, fieldNumber: 11) + } + if !self.repeatedCordField.isEmpty { + try visitor.visitRepeatedStringField(value: self.repeatedCordField, fieldNumber: 12) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestCamelCaseFieldNames, rhs: ProtobufUnittest_TestCamelCaseFieldNames) -> Bool { + if lhs._primitiveField != rhs._primitiveField {return false} + if lhs._stringField != rhs._stringField {return false} + if lhs._enumField != rhs._enumField {return false} + if lhs._messageField != rhs._messageField {return false} + if lhs._stringPieceField != rhs._stringPieceField {return false} + if lhs._cordField != rhs._cordField {return false} + if lhs.repeatedPrimitiveField != rhs.repeatedPrimitiveField {return false} + if lhs.repeatedStringField != rhs.repeatedStringField {return false} + if lhs.repeatedEnumField != rhs.repeatedEnumField {return false} + if lhs.repeatedMessageField != rhs.repeatedMessageField {return false} + if lhs.repeatedStringPieceField != rhs.repeatedStringPieceField {return false} + if lhs.repeatedCordField != rhs.repeatedCordField {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestFieldOrderings: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestFieldOrderings" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 11: .standard(proto: "my_string"), + 1: .standard(proto: "my_int"), + 101: .standard(proto: "my_float"), + 200: .standard(proto: "optional_nested_message"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self._myInt) }() + case 11: try { try decoder.decodeSingularStringField(value: &self._myString) }() + case 101: try { try decoder.decodeSingularFloatField(value: &self._myFloat) }() + case 200: try { try decoder.decodeSingularMessageField(value: &self._optionalNestedMessage) }() + case 2..<11, 12..<101: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestFieldOrderings.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._myInt { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 1) + } }() + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 2, end: 11) + try { if let v = self._myString { + try visitor.visitSingularStringField(value: v, fieldNumber: 11) + } }() + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 12, end: 101) + try { if let v = self._myFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 101) + } }() + try { if let v = self._optionalNestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 200) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestFieldOrderings, rhs: ProtobufUnittest_TestFieldOrderings) -> Bool { + if lhs._myString != rhs._myString {return false} + if lhs._myInt != rhs._myInt {return false} + if lhs._myFloat != rhs._myFloat {return false} + if lhs._optionalNestedMessage != rhs._optionalNestedMessage {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestFieldOrderings.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestFieldOrderings.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 2: .same(proto: "oo"), + 1: .same(proto: "bb"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._bb) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self._oo) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._bb { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._oo { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestFieldOrderings.NestedMessage, rhs: ProtobufUnittest_TestFieldOrderings.NestedMessage) -> Bool { + if lhs._oo != rhs._oo {return false} + if lhs._bb != rhs._bb {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestExtensionOrderings1: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestExtensionOrderings1" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "my_string"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._myString) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._myString { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestExtensionOrderings1, rhs: ProtobufUnittest_TestExtensionOrderings1) -> Bool { + if lhs._myString != rhs._myString {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestExtensionOrderings2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestExtensionOrderings2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "my_string"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._myString) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._myString { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestExtensionOrderings2, rhs: ProtobufUnittest_TestExtensionOrderings2) -> Bool { + if lhs._myString != rhs._myString {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestExtensionOrderings2.TestExtensionOrderings3: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestExtensionOrderings2.protoMessageName + ".TestExtensionOrderings3" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "my_string"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._myString) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._myString { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestExtensionOrderings2.TestExtensionOrderings3, rhs: ProtobufUnittest_TestExtensionOrderings2.TestExtensionOrderings3) -> Bool { + if lhs._myString != rhs._myString {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestExtremeDefaultValues: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestExtremeDefaultValues" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "escaped_bytes"), + 2: .standard(proto: "large_uint32"), + 3: .standard(proto: "large_uint64"), + 4: .standard(proto: "small_int32"), + 5: .standard(proto: "small_int64"), + 21: .standard(proto: "really_small_int32"), + 22: .standard(proto: "really_small_int64"), + 6: .standard(proto: "utf8_string"), + 7: .standard(proto: "zero_float"), + 8: .standard(proto: "one_float"), + 9: .standard(proto: "small_float"), + 10: .standard(proto: "negative_one_float"), + 11: .standard(proto: "negative_float"), + 12: .standard(proto: "large_float"), + 13: .standard(proto: "small_negative_float"), + 14: .standard(proto: "inf_double"), + 15: .standard(proto: "neg_inf_double"), + 16: .standard(proto: "nan_double"), + 17: .standard(proto: "inf_float"), + 18: .standard(proto: "neg_inf_float"), + 19: .standard(proto: "nan_float"), + 20: .standard(proto: "cpp_trigraph"), + 23: .standard(proto: "string_with_zero"), + 24: .standard(proto: "bytes_with_zero"), + 25: .standard(proto: "string_piece_with_zero"), + 26: .standard(proto: "cord_with_zero"), + 27: .standard(proto: "replacement_string"), + ] + + fileprivate class _StorageClass { + var _escapedBytes: Data? = nil + var _largeUint32: UInt32? = nil + var _largeUint64: UInt64? = nil + var _smallInt32: Int32? = nil + var _smallInt64: Int64? = nil + var _reallySmallInt32: Int32? = nil + var _reallySmallInt64: Int64? = nil + var _utf8String: String? = nil + var _zeroFloat: Float? = nil + var _oneFloat: Float? = nil + var _smallFloat: Float? = nil + var _negativeOneFloat: Float? = nil + var _negativeFloat: Float? = nil + var _largeFloat: Float? = nil + var _smallNegativeFloat: Float? = nil + var _infDouble: Double? = nil + var _negInfDouble: Double? = nil + var _nanDouble: Double? = nil + var _infFloat: Float? = nil + var _negInfFloat: Float? = nil + var _nanFloat: Float? = nil + var _cppTrigraph: String? = nil + var _stringWithZero: String? = nil + var _bytesWithZero: Data? = nil + var _stringPieceWithZero: String? = nil + var _cordWithZero: String? = nil + var _replacementString: String? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _escapedBytes = source._escapedBytes + _largeUint32 = source._largeUint32 + _largeUint64 = source._largeUint64 + _smallInt32 = source._smallInt32 + _smallInt64 = source._smallInt64 + _reallySmallInt32 = source._reallySmallInt32 + _reallySmallInt64 = source._reallySmallInt64 + _utf8String = source._utf8String + _zeroFloat = source._zeroFloat + _oneFloat = source._oneFloat + _smallFloat = source._smallFloat + _negativeOneFloat = source._negativeOneFloat + _negativeFloat = source._negativeFloat + _largeFloat = source._largeFloat + _smallNegativeFloat = source._smallNegativeFloat + _infDouble = source._infDouble + _negInfDouble = source._negInfDouble + _nanDouble = source._nanDouble + _infFloat = source._infFloat + _negInfFloat = source._negInfFloat + _nanFloat = source._nanFloat + _cppTrigraph = source._cppTrigraph + _stringWithZero = source._stringWithZero + _bytesWithZero = source._bytesWithZero + _stringPieceWithZero = source._stringPieceWithZero + _cordWithZero = source._cordWithZero + _replacementString = source._replacementString + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &_storage._escapedBytes) }() + case 2: try { try decoder.decodeSingularUInt32Field(value: &_storage._largeUint32) }() + case 3: try { try decoder.decodeSingularUInt64Field(value: &_storage._largeUint64) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &_storage._smallInt32) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &_storage._smallInt64) }() + case 6: try { try decoder.decodeSingularStringField(value: &_storage._utf8String) }() + case 7: try { try decoder.decodeSingularFloatField(value: &_storage._zeroFloat) }() + case 8: try { try decoder.decodeSingularFloatField(value: &_storage._oneFloat) }() + case 9: try { try decoder.decodeSingularFloatField(value: &_storage._smallFloat) }() + case 10: try { try decoder.decodeSingularFloatField(value: &_storage._negativeOneFloat) }() + case 11: try { try decoder.decodeSingularFloatField(value: &_storage._negativeFloat) }() + case 12: try { try decoder.decodeSingularFloatField(value: &_storage._largeFloat) }() + case 13: try { try decoder.decodeSingularFloatField(value: &_storage._smallNegativeFloat) }() + case 14: try { try decoder.decodeSingularDoubleField(value: &_storage._infDouble) }() + case 15: try { try decoder.decodeSingularDoubleField(value: &_storage._negInfDouble) }() + case 16: try { try decoder.decodeSingularDoubleField(value: &_storage._nanDouble) }() + case 17: try { try decoder.decodeSingularFloatField(value: &_storage._infFloat) }() + case 18: try { try decoder.decodeSingularFloatField(value: &_storage._negInfFloat) }() + case 19: try { try decoder.decodeSingularFloatField(value: &_storage._nanFloat) }() + case 20: try { try decoder.decodeSingularStringField(value: &_storage._cppTrigraph) }() + case 21: try { try decoder.decodeSingularInt32Field(value: &_storage._reallySmallInt32) }() + case 22: try { try decoder.decodeSingularInt64Field(value: &_storage._reallySmallInt64) }() + case 23: try { try decoder.decodeSingularStringField(value: &_storage._stringWithZero) }() + case 24: try { try decoder.decodeSingularBytesField(value: &_storage._bytesWithZero) }() + case 25: try { try decoder.decodeSingularStringField(value: &_storage._stringPieceWithZero) }() + case 26: try { try decoder.decodeSingularStringField(value: &_storage._cordWithZero) }() + case 27: try { try decoder.decodeSingularStringField(value: &_storage._replacementString) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._escapedBytes { + try visitor.visitSingularBytesField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._largeUint32 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._largeUint64 { + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._smallInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._smallInt64 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 5) + } }() + try { if let v = _storage._utf8String { + try visitor.visitSingularStringField(value: v, fieldNumber: 6) + } }() + try { if let v = _storage._zeroFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 7) + } }() + try { if let v = _storage._oneFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 8) + } }() + try { if let v = _storage._smallFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._negativeOneFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._negativeFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 11) + } }() + try { if let v = _storage._largeFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 12) + } }() + try { if let v = _storage._smallNegativeFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 13) + } }() + try { if let v = _storage._infDouble { + try visitor.visitSingularDoubleField(value: v, fieldNumber: 14) + } }() + try { if let v = _storage._negInfDouble { + try visitor.visitSingularDoubleField(value: v, fieldNumber: 15) + } }() + try { if let v = _storage._nanDouble { + try visitor.visitSingularDoubleField(value: v, fieldNumber: 16) + } }() + try { if let v = _storage._infFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 17) + } }() + try { if let v = _storage._negInfFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._nanFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 19) + } }() + try { if let v = _storage._cppTrigraph { + try visitor.visitSingularStringField(value: v, fieldNumber: 20) + } }() + try { if let v = _storage._reallySmallInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 21) + } }() + try { if let v = _storage._reallySmallInt64 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 22) + } }() + try { if let v = _storage._stringWithZero { + try visitor.visitSingularStringField(value: v, fieldNumber: 23) + } }() + try { if let v = _storage._bytesWithZero { + try visitor.visitSingularBytesField(value: v, fieldNumber: 24) + } }() + try { if let v = _storage._stringPieceWithZero { + try visitor.visitSingularStringField(value: v, fieldNumber: 25) + } }() + try { if let v = _storage._cordWithZero { + try visitor.visitSingularStringField(value: v, fieldNumber: 26) + } }() + try { if let v = _storage._replacementString { + try visitor.visitSingularStringField(value: v, fieldNumber: 27) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestExtremeDefaultValues, rhs: ProtobufUnittest_TestExtremeDefaultValues) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._escapedBytes != rhs_storage._escapedBytes {return false} + if _storage._largeUint32 != rhs_storage._largeUint32 {return false} + if _storage._largeUint64 != rhs_storage._largeUint64 {return false} + if _storage._smallInt32 != rhs_storage._smallInt32 {return false} + if _storage._smallInt64 != rhs_storage._smallInt64 {return false} + if _storage._reallySmallInt32 != rhs_storage._reallySmallInt32 {return false} + if _storage._reallySmallInt64 != rhs_storage._reallySmallInt64 {return false} + if _storage._utf8String != rhs_storage._utf8String {return false} + if _storage._zeroFloat != rhs_storage._zeroFloat {return false} + if _storage._oneFloat != rhs_storage._oneFloat {return false} + if _storage._smallFloat != rhs_storage._smallFloat {return false} + if _storage._negativeOneFloat != rhs_storage._negativeOneFloat {return false} + if _storage._negativeFloat != rhs_storage._negativeFloat {return false} + if _storage._largeFloat != rhs_storage._largeFloat {return false} + if _storage._smallNegativeFloat != rhs_storage._smallNegativeFloat {return false} + if _storage._infDouble != rhs_storage._infDouble {return false} + if _storage._negInfDouble != rhs_storage._negInfDouble {return false} + if _storage._nanDouble != rhs_storage._nanDouble {return false} + if _storage._infFloat != rhs_storage._infFloat {return false} + if _storage._negInfFloat != rhs_storage._negInfFloat {return false} + if _storage._nanFloat != rhs_storage._nanFloat {return false} + if _storage._cppTrigraph != rhs_storage._cppTrigraph {return false} + if _storage._stringWithZero != rhs_storage._stringWithZero {return false} + if _storage._bytesWithZero != rhs_storage._bytesWithZero {return false} + if _storage._stringPieceWithZero != rhs_storage._stringPieceWithZero {return false} + if _storage._cordWithZero != rhs_storage._cordWithZero {return false} + if _storage._replacementString != rhs_storage._replacementString {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_SparseEnumMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".SparseEnumMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "sparse_enum"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self._sparseEnum) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._sparseEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_SparseEnumMessage, rhs: ProtobufUnittest_SparseEnumMessage) -> Bool { + if lhs._sparseEnum != rhs._sparseEnum {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_OneString: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".OneString" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "data"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._data) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._data { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_OneString, rhs: ProtobufUnittest_OneString) -> Bool { + if lhs._data != rhs._data {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_MoreString: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MoreString" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "data"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedStringField(value: &self.data) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.data.isEmpty { + try visitor.visitRepeatedStringField(value: self.data, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_MoreString, rhs: ProtobufUnittest_MoreString) -> Bool { + if lhs.data != rhs.data {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_OneBytes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".OneBytes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "data"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self._data) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._data { + try visitor.visitSingularBytesField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_OneBytes, rhs: ProtobufUnittest_OneBytes) -> Bool { + if lhs._data != rhs._data {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_MoreBytes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MoreBytes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "data"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedBytesField(value: &self.data) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.data.isEmpty { + try visitor.visitRepeatedBytesField(value: self.data, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_MoreBytes, rhs: ProtobufUnittest_MoreBytes) -> Bool { + if lhs.data != rhs.data {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_ManyOptionalString: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ManyOptionalString" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "str1"), + 2: .same(proto: "str2"), + 3: .same(proto: "str3"), + 4: .same(proto: "str4"), + 5: .same(proto: "str5"), + 6: .same(proto: "str6"), + 7: .same(proto: "str7"), + 8: .same(proto: "str8"), + 9: .same(proto: "str9"), + 10: .same(proto: "str10"), + 11: .same(proto: "str11"), + 12: .same(proto: "str12"), + 13: .same(proto: "str13"), + 14: .same(proto: "str14"), + 15: .same(proto: "str15"), + 16: .same(proto: "str16"), + 17: .same(proto: "str17"), + 18: .same(proto: "str18"), + 19: .same(proto: "str19"), + 20: .same(proto: "str20"), + 21: .same(proto: "str21"), + 22: .same(proto: "str22"), + 23: .same(proto: "str23"), + 24: .same(proto: "str24"), + 25: .same(proto: "str25"), + 26: .same(proto: "str26"), + 27: .same(proto: "str27"), + 28: .same(proto: "str28"), + 29: .same(proto: "str29"), + 30: .same(proto: "str30"), + 31: .same(proto: "str31"), + 32: .same(proto: "str32"), + ] + + fileprivate class _StorageClass { + var _str1: String? = nil + var _str2: String? = nil + var _str3: String? = nil + var _str4: String? = nil + var _str5: String? = nil + var _str6: String? = nil + var _str7: String? = nil + var _str8: String? = nil + var _str9: String? = nil + var _str10: String? = nil + var _str11: String? = nil + var _str12: String? = nil + var _str13: String? = nil + var _str14: String? = nil + var _str15: String? = nil + var _str16: String? = nil + var _str17: String? = nil + var _str18: String? = nil + var _str19: String? = nil + var _str20: String? = nil + var _str21: String? = nil + var _str22: String? = nil + var _str23: String? = nil + var _str24: String? = nil + var _str25: String? = nil + var _str26: String? = nil + var _str27: String? = nil + var _str28: String? = nil + var _str29: String? = nil + var _str30: String? = nil + var _str31: String? = nil + var _str32: String? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _str1 = source._str1 + _str2 = source._str2 + _str3 = source._str3 + _str4 = source._str4 + _str5 = source._str5 + _str6 = source._str6 + _str7 = source._str7 + _str8 = source._str8 + _str9 = source._str9 + _str10 = source._str10 + _str11 = source._str11 + _str12 = source._str12 + _str13 = source._str13 + _str14 = source._str14 + _str15 = source._str15 + _str16 = source._str16 + _str17 = source._str17 + _str18 = source._str18 + _str19 = source._str19 + _str20 = source._str20 + _str21 = source._str21 + _str22 = source._str22 + _str23 = source._str23 + _str24 = source._str24 + _str25 = source._str25 + _str26 = source._str26 + _str27 = source._str27 + _str28 = source._str28 + _str29 = source._str29 + _str30 = source._str30 + _str31 = source._str31 + _str32 = source._str32 + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &_storage._str1) }() + case 2: try { try decoder.decodeSingularStringField(value: &_storage._str2) }() + case 3: try { try decoder.decodeSingularStringField(value: &_storage._str3) }() + case 4: try { try decoder.decodeSingularStringField(value: &_storage._str4) }() + case 5: try { try decoder.decodeSingularStringField(value: &_storage._str5) }() + case 6: try { try decoder.decodeSingularStringField(value: &_storage._str6) }() + case 7: try { try decoder.decodeSingularStringField(value: &_storage._str7) }() + case 8: try { try decoder.decodeSingularStringField(value: &_storage._str8) }() + case 9: try { try decoder.decodeSingularStringField(value: &_storage._str9) }() + case 10: try { try decoder.decodeSingularStringField(value: &_storage._str10) }() + case 11: try { try decoder.decodeSingularStringField(value: &_storage._str11) }() + case 12: try { try decoder.decodeSingularStringField(value: &_storage._str12) }() + case 13: try { try decoder.decodeSingularStringField(value: &_storage._str13) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._str14) }() + case 15: try { try decoder.decodeSingularStringField(value: &_storage._str15) }() + case 16: try { try decoder.decodeSingularStringField(value: &_storage._str16) }() + case 17: try { try decoder.decodeSingularStringField(value: &_storage._str17) }() + case 18: try { try decoder.decodeSingularStringField(value: &_storage._str18) }() + case 19: try { try decoder.decodeSingularStringField(value: &_storage._str19) }() + case 20: try { try decoder.decodeSingularStringField(value: &_storage._str20) }() + case 21: try { try decoder.decodeSingularStringField(value: &_storage._str21) }() + case 22: try { try decoder.decodeSingularStringField(value: &_storage._str22) }() + case 23: try { try decoder.decodeSingularStringField(value: &_storage._str23) }() + case 24: try { try decoder.decodeSingularStringField(value: &_storage._str24) }() + case 25: try { try decoder.decodeSingularStringField(value: &_storage._str25) }() + case 26: try { try decoder.decodeSingularStringField(value: &_storage._str26) }() + case 27: try { try decoder.decodeSingularStringField(value: &_storage._str27) }() + case 28: try { try decoder.decodeSingularStringField(value: &_storage._str28) }() + case 29: try { try decoder.decodeSingularStringField(value: &_storage._str29) }() + case 30: try { try decoder.decodeSingularStringField(value: &_storage._str30) }() + case 31: try { try decoder.decodeSingularStringField(value: &_storage._str31) }() + case 32: try { try decoder.decodeSingularStringField(value: &_storage._str32) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._str1 { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._str2 { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._str3 { + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._str4 { + try visitor.visitSingularStringField(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._str5 { + try visitor.visitSingularStringField(value: v, fieldNumber: 5) + } }() + try { if let v = _storage._str6 { + try visitor.visitSingularStringField(value: v, fieldNumber: 6) + } }() + try { if let v = _storage._str7 { + try visitor.visitSingularStringField(value: v, fieldNumber: 7) + } }() + try { if let v = _storage._str8 { + try visitor.visitSingularStringField(value: v, fieldNumber: 8) + } }() + try { if let v = _storage._str9 { + try visitor.visitSingularStringField(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._str10 { + try visitor.visitSingularStringField(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._str11 { + try visitor.visitSingularStringField(value: v, fieldNumber: 11) + } }() + try { if let v = _storage._str12 { + try visitor.visitSingularStringField(value: v, fieldNumber: 12) + } }() + try { if let v = _storage._str13 { + try visitor.visitSingularStringField(value: v, fieldNumber: 13) + } }() + try { if let v = _storage._str14 { + try visitor.visitSingularStringField(value: v, fieldNumber: 14) + } }() + try { if let v = _storage._str15 { + try visitor.visitSingularStringField(value: v, fieldNumber: 15) + } }() + try { if let v = _storage._str16 { + try visitor.visitSingularStringField(value: v, fieldNumber: 16) + } }() + try { if let v = _storage._str17 { + try visitor.visitSingularStringField(value: v, fieldNumber: 17) + } }() + try { if let v = _storage._str18 { + try visitor.visitSingularStringField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._str19 { + try visitor.visitSingularStringField(value: v, fieldNumber: 19) + } }() + try { if let v = _storage._str20 { + try visitor.visitSingularStringField(value: v, fieldNumber: 20) + } }() + try { if let v = _storage._str21 { + try visitor.visitSingularStringField(value: v, fieldNumber: 21) + } }() + try { if let v = _storage._str22 { + try visitor.visitSingularStringField(value: v, fieldNumber: 22) + } }() + try { if let v = _storage._str23 { + try visitor.visitSingularStringField(value: v, fieldNumber: 23) + } }() + try { if let v = _storage._str24 { + try visitor.visitSingularStringField(value: v, fieldNumber: 24) + } }() + try { if let v = _storage._str25 { + try visitor.visitSingularStringField(value: v, fieldNumber: 25) + } }() + try { if let v = _storage._str26 { + try visitor.visitSingularStringField(value: v, fieldNumber: 26) + } }() + try { if let v = _storage._str27 { + try visitor.visitSingularStringField(value: v, fieldNumber: 27) + } }() + try { if let v = _storage._str28 { + try visitor.visitSingularStringField(value: v, fieldNumber: 28) + } }() + try { if let v = _storage._str29 { + try visitor.visitSingularStringField(value: v, fieldNumber: 29) + } }() + try { if let v = _storage._str30 { + try visitor.visitSingularStringField(value: v, fieldNumber: 30) + } }() + try { if let v = _storage._str31 { + try visitor.visitSingularStringField(value: v, fieldNumber: 31) + } }() + try { if let v = _storage._str32 { + try visitor.visitSingularStringField(value: v, fieldNumber: 32) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_ManyOptionalString, rhs: ProtobufUnittest_ManyOptionalString) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._str1 != rhs_storage._str1 {return false} + if _storage._str2 != rhs_storage._str2 {return false} + if _storage._str3 != rhs_storage._str3 {return false} + if _storage._str4 != rhs_storage._str4 {return false} + if _storage._str5 != rhs_storage._str5 {return false} + if _storage._str6 != rhs_storage._str6 {return false} + if _storage._str7 != rhs_storage._str7 {return false} + if _storage._str8 != rhs_storage._str8 {return false} + if _storage._str9 != rhs_storage._str9 {return false} + if _storage._str10 != rhs_storage._str10 {return false} + if _storage._str11 != rhs_storage._str11 {return false} + if _storage._str12 != rhs_storage._str12 {return false} + if _storage._str13 != rhs_storage._str13 {return false} + if _storage._str14 != rhs_storage._str14 {return false} + if _storage._str15 != rhs_storage._str15 {return false} + if _storage._str16 != rhs_storage._str16 {return false} + if _storage._str17 != rhs_storage._str17 {return false} + if _storage._str18 != rhs_storage._str18 {return false} + if _storage._str19 != rhs_storage._str19 {return false} + if _storage._str20 != rhs_storage._str20 {return false} + if _storage._str21 != rhs_storage._str21 {return false} + if _storage._str22 != rhs_storage._str22 {return false} + if _storage._str23 != rhs_storage._str23 {return false} + if _storage._str24 != rhs_storage._str24 {return false} + if _storage._str25 != rhs_storage._str25 {return false} + if _storage._str26 != rhs_storage._str26 {return false} + if _storage._str27 != rhs_storage._str27 {return false} + if _storage._str28 != rhs_storage._str28 {return false} + if _storage._str29 != rhs_storage._str29 {return false} + if _storage._str30 != rhs_storage._str30 {return false} + if _storage._str31 != rhs_storage._str31 {return false} + if _storage._str32 != rhs_storage._str32 {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_Int32Message: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Int32Message" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "data"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._data) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._data { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_Int32Message, rhs: ProtobufUnittest_Int32Message) -> Bool { + if lhs._data != rhs._data {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_Uint32Message: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Uint32Message" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "data"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt32Field(value: &self._data) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._data { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_Uint32Message, rhs: ProtobufUnittest_Uint32Message) -> Bool { + if lhs._data != rhs._data {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_Int64Message: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Int64Message" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "data"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self._data) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._data { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_Int64Message, rhs: ProtobufUnittest_Int64Message) -> Bool { + if lhs._data != rhs._data {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_Uint64Message: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Uint64Message" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "data"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt64Field(value: &self._data) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._data { + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_Uint64Message, rhs: ProtobufUnittest_Uint64Message) -> Bool { + if lhs._data != rhs._data {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_BoolMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".BoolMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "data"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self._data) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._data { + try visitor.visitSingularBoolField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_BoolMessage, rhs: ProtobufUnittest_BoolMessage) -> Bool { + if lhs._data != rhs._data {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestOneof: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestOneof" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "foo_int"), + 2: .standard(proto: "foo_string"), + 3: .standard(proto: "foo_message"), + 4: .unique(proto: "FooGroup", json: "foogroup"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { + var v: Int32? + try decoder.decodeSingularInt32Field(value: &v) + if let v = v { + if self.foo != nil {try decoder.handleConflictingOneOf()} + self.foo = .fooInt(v) + } + }() + case 2: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.foo != nil {try decoder.handleConflictingOneOf()} + self.foo = .fooString(v) + } + }() + case 3: try { + var v: ProtobufUnittest_TestAllTypes? + var hadOneofValue = false + if let current = self.foo { + hadOneofValue = true + if case .fooMessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.foo = .fooMessage(v) + } + }() + case 4: try { + var v: ProtobufUnittest_TestOneof.FooGroup? + var hadOneofValue = false + if let current = self.foo { + hadOneofValue = true + if case .fooGroup(let m) = current {v = m} + } + try decoder.decodeSingularGroupField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.foo = .fooGroup(v) + } + }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + switch self.foo { + case .fooInt?: try { + guard case .fooInt(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + }() + case .fooString?: try { + guard case .fooString(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + }() + case .fooMessage?: try { + guard case .fooMessage(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + }() + case .fooGroup?: try { + guard case .fooGroup(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularGroupField(value: v, fieldNumber: 4) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestOneof, rhs: ProtobufUnittest_TestOneof) -> Bool { + if lhs.foo != rhs.foo {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestOneof.FooGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestOneof.protoMessageName + ".FooGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 5: .same(proto: "a"), + 6: .same(proto: "b"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 5: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + case 6: try { try decoder.decodeSingularStringField(value: &self._b) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 5) + } }() + try { if let v = self._b { + try visitor.visitSingularStringField(value: v, fieldNumber: 6) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestOneof.FooGroup, rhs: ProtobufUnittest_TestOneof.FooGroup) -> Bool { + if lhs._a != rhs._a {return false} + if lhs._b != rhs._b {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestOneofBackwardsCompatible: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestOneofBackwardsCompatible" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "foo_int"), + 2: .standard(proto: "foo_string"), + 3: .standard(proto: "foo_message"), + 4: .unique(proto: "FooGroup", json: "foogroup"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._fooInt) }() + case 2: try { try decoder.decodeSingularStringField(value: &self._fooString) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._fooMessage) }() + case 4: try { try decoder.decodeSingularGroupField(value: &self._fooGroup) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._fooInt { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._fooString { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try { if let v = self._fooMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try { if let v = self._fooGroup { + try visitor.visitSingularGroupField(value: v, fieldNumber: 4) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestOneofBackwardsCompatible, rhs: ProtobufUnittest_TestOneofBackwardsCompatible) -> Bool { + if lhs._fooInt != rhs._fooInt {return false} + if lhs._fooString != rhs._fooString {return false} + if lhs._fooMessage != rhs._fooMessage {return false} + if lhs._fooGroup != rhs._fooGroup {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestOneofBackwardsCompatible.FooGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestOneofBackwardsCompatible.protoMessageName + ".FooGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 5: .same(proto: "a"), + 6: .same(proto: "b"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 5: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + case 6: try { try decoder.decodeSingularStringField(value: &self._b) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 5) + } }() + try { if let v = self._b { + try visitor.visitSingularStringField(value: v, fieldNumber: 6) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestOneofBackwardsCompatible.FooGroup, rhs: ProtobufUnittest_TestOneofBackwardsCompatible.FooGroup) -> Bool { + if lhs._a != rhs._a {return false} + if lhs._b != rhs._b {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestOneof2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestOneof2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "foo_int"), + 2: .standard(proto: "foo_string"), + 3: .standard(proto: "foo_cord"), + 4: .standard(proto: "foo_string_piece"), + 5: .standard(proto: "foo_bytes"), + 6: .standard(proto: "foo_enum"), + 7: .standard(proto: "foo_message"), + 8: .unique(proto: "FooGroup", json: "foogroup"), + 11: .standard(proto: "foo_lazy_message"), + 30: .standard(proto: "foo_bytes_cord"), + 12: .standard(proto: "bar_int"), + 13: .standard(proto: "bar_string"), + 14: .standard(proto: "bar_cord"), + 15: .standard(proto: "bar_string_piece"), + 16: .standard(proto: "bar_bytes"), + 17: .standard(proto: "bar_enum"), + 20: .standard(proto: "bar_string_with_empty_default"), + 21: .standard(proto: "bar_cord_with_empty_default"), + 22: .standard(proto: "bar_string_piece_with_empty_default"), + 23: .standard(proto: "bar_bytes_with_empty_default"), + 18: .standard(proto: "baz_int"), + 19: .standard(proto: "baz_string"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { + var v: Int32? + try decoder.decodeSingularInt32Field(value: &v) + if let v = v { + if self.foo != nil {try decoder.handleConflictingOneOf()} + self.foo = .fooInt(v) + } + }() + case 2: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.foo != nil {try decoder.handleConflictingOneOf()} + self.foo = .fooString(v) + } + }() + case 3: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.foo != nil {try decoder.handleConflictingOneOf()} + self.foo = .fooCord(v) + } + }() + case 4: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.foo != nil {try decoder.handleConflictingOneOf()} + self.foo = .fooStringPiece(v) + } + }() + case 5: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if self.foo != nil {try decoder.handleConflictingOneOf()} + self.foo = .fooBytes(v) + } + }() + case 6: try { + var v: ProtobufUnittest_TestOneof2.NestedEnum? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if self.foo != nil {try decoder.handleConflictingOneOf()} + self.foo = .fooEnum(v) + } + }() + case 7: try { + var v: ProtobufUnittest_TestOneof2.NestedMessage? + var hadOneofValue = false + if let current = self.foo { + hadOneofValue = true + if case .fooMessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.foo = .fooMessage(v) + } + }() + case 8: try { + var v: ProtobufUnittest_TestOneof2.FooGroup? + var hadOneofValue = false + if let current = self.foo { + hadOneofValue = true + if case .fooGroup(let m) = current {v = m} + } + try decoder.decodeSingularGroupField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.foo = .fooGroup(v) + } + }() + case 11: try { + var v: ProtobufUnittest_TestOneof2.NestedMessage? + var hadOneofValue = false + if let current = self.foo { + hadOneofValue = true + if case .fooLazyMessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.foo = .fooLazyMessage(v) + } + }() + case 12: try { + var v: Int32? + try decoder.decodeSingularInt32Field(value: &v) + if let v = v { + if self.bar != nil {try decoder.handleConflictingOneOf()} + self.bar = .barInt(v) + } + }() + case 13: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.bar != nil {try decoder.handleConflictingOneOf()} + self.bar = .barString(v) + } + }() + case 14: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.bar != nil {try decoder.handleConflictingOneOf()} + self.bar = .barCord(v) + } + }() + case 15: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.bar != nil {try decoder.handleConflictingOneOf()} + self.bar = .barStringPiece(v) + } + }() + case 16: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if self.bar != nil {try decoder.handleConflictingOneOf()} + self.bar = .barBytes(v) + } + }() + case 17: try { + var v: ProtobufUnittest_TestOneof2.NestedEnum? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if self.bar != nil {try decoder.handleConflictingOneOf()} + self.bar = .barEnum(v) + } + }() + case 18: try { try decoder.decodeSingularInt32Field(value: &self._bazInt) }() + case 19: try { try decoder.decodeSingularStringField(value: &self._bazString) }() + case 20: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.bar != nil {try decoder.handleConflictingOneOf()} + self.bar = .barStringWithEmptyDefault(v) + } + }() + case 21: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.bar != nil {try decoder.handleConflictingOneOf()} + self.bar = .barCordWithEmptyDefault(v) + } + }() + case 22: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.bar != nil {try decoder.handleConflictingOneOf()} + self.bar = .barStringPieceWithEmptyDefault(v) + } + }() + case 23: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if self.bar != nil {try decoder.handleConflictingOneOf()} + self.bar = .barBytesWithEmptyDefault(v) + } + }() + case 30: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if self.foo != nil {try decoder.handleConflictingOneOf()} + self.foo = .fooBytesCord(v) + } + }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + switch self.foo { + case .fooInt?: try { + guard case .fooInt(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + }() + case .fooString?: try { + guard case .fooString(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + }() + case .fooCord?: try { + guard case .fooCord(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + }() + case .fooStringPiece?: try { + guard case .fooStringPiece(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 4) + }() + case .fooBytes?: try { + guard case .fooBytes(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 5) + }() + case .fooEnum?: try { + guard case .fooEnum(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 6) + }() + case .fooMessage?: try { + guard case .fooMessage(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + }() + case .fooGroup?: try { + guard case .fooGroup(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularGroupField(value: v, fieldNumber: 8) + }() + case .fooLazyMessage?: try { + guard case .fooLazyMessage(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + }() + default: break + } + switch self.bar { + case .barInt?: try { + guard case .barInt(let v)? = self.bar else { preconditionFailure() } + try visitor.visitSingularInt32Field(value: v, fieldNumber: 12) + }() + case .barString?: try { + guard case .barString(let v)? = self.bar else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 13) + }() + case .barCord?: try { + guard case .barCord(let v)? = self.bar else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 14) + }() + case .barStringPiece?: try { + guard case .barStringPiece(let v)? = self.bar else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 15) + }() + case .barBytes?: try { + guard case .barBytes(let v)? = self.bar else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 16) + }() + case .barEnum?: try { + guard case .barEnum(let v)? = self.bar else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 17) + }() + default: break + } + try { if let v = self._bazInt { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 18) + } }() + try { if let v = self._bazString { + try visitor.visitSingularStringField(value: v, fieldNumber: 19) + } }() + switch self.bar { + case .barStringWithEmptyDefault?: try { + guard case .barStringWithEmptyDefault(let v)? = self.bar else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 20) + }() + case .barCordWithEmptyDefault?: try { + guard case .barCordWithEmptyDefault(let v)? = self.bar else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 21) + }() + case .barStringPieceWithEmptyDefault?: try { + guard case .barStringPieceWithEmptyDefault(let v)? = self.bar else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 22) + }() + case .barBytesWithEmptyDefault?: try { + guard case .barBytesWithEmptyDefault(let v)? = self.bar else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 23) + }() + default: break + } + try { if case .fooBytesCord(let v)? = self.foo { + try visitor.visitSingularBytesField(value: v, fieldNumber: 30) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestOneof2, rhs: ProtobufUnittest_TestOneof2) -> Bool { + if lhs.foo != rhs.foo {return false} + if lhs.bar != rhs.bar {return false} + if lhs._bazInt != rhs._bazInt {return false} + if lhs._bazString != rhs._bazString {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestOneof2.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "FOO"), + 2: .same(proto: "BAR"), + 3: .same(proto: "BAZ"), + ] +} + +extension ProtobufUnittest_TestOneof2.FooGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestOneof2.protoMessageName + ".FooGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 9: .same(proto: "a"), + 10: .same(proto: "b"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 9: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + case 10: try { try decoder.decodeSingularStringField(value: &self._b) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 9) + } }() + try { if let v = self._b { + try visitor.visitSingularStringField(value: v, fieldNumber: 10) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestOneof2.FooGroup, rhs: ProtobufUnittest_TestOneof2.FooGroup) -> Bool { + if lhs._a != rhs._a {return false} + if lhs._b != rhs._b {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestOneof2.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestOneof2.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "moo_int"), + 2: .standard(proto: "corge_int"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self._mooInt) }() + case 2: try { try decoder.decodeRepeatedInt32Field(value: &self.corgeInt) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._mooInt { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 1) + } }() + if !self.corgeInt.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.corgeInt, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestOneof2.NestedMessage, rhs: ProtobufUnittest_TestOneof2.NestedMessage) -> Bool { + if lhs._mooInt != rhs._mooInt {return false} + if lhs.corgeInt != rhs.corgeInt {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestRequiredOneof: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestRequiredOneof" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "foo_int"), + 2: .standard(proto: "foo_string"), + 3: .standard(proto: "foo_message"), + 4: .standard(proto: "foo_lazy_message"), + ] + + public var isInitialized: Bool { + if let v = self.foo, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { + var v: Int32? + try decoder.decodeSingularInt32Field(value: &v) + if let v = v { + if self.foo != nil {try decoder.handleConflictingOneOf()} + self.foo = .fooInt(v) + } + }() + case 2: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.foo != nil {try decoder.handleConflictingOneOf()} + self.foo = .fooString(v) + } + }() + case 3: try { + var v: ProtobufUnittest_TestRequiredOneof.NestedMessage? + var hadOneofValue = false + if let current = self.foo { + hadOneofValue = true + if case .fooMessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.foo = .fooMessage(v) + } + }() + case 4: try { + var v: ProtobufUnittest_TestRequiredOneof.NestedMessage? + var hadOneofValue = false + if let current = self.foo { + hadOneofValue = true + if case .fooLazyMessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.foo = .fooLazyMessage(v) + } + }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + switch self.foo { + case .fooInt?: try { + guard case .fooInt(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + }() + case .fooString?: try { + guard case .fooString(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + }() + case .fooMessage?: try { + guard case .fooMessage(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + }() + case .fooLazyMessage?: try { + guard case .fooLazyMessage(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestRequiredOneof, rhs: ProtobufUnittest_TestRequiredOneof) -> Bool { + if lhs.foo != rhs.foo {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestRequiredOneof.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestRequiredOneof.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "required_double"), + ] + + public var isInitialized: Bool { + if self._requiredDouble == nil {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularDoubleField(value: &self._requiredDouble) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._requiredDouble { + try visitor.visitSingularDoubleField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestRequiredOneof.NestedMessage, rhs: ProtobufUnittest_TestRequiredOneof.NestedMessage) -> Bool { + if lhs._requiredDouble != rhs._requiredDouble {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestPackedTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestPackedTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 90: .standard(proto: "packed_int32"), + 91: .standard(proto: "packed_int64"), + 92: .standard(proto: "packed_uint32"), + 93: .standard(proto: "packed_uint64"), + 94: .standard(proto: "packed_sint32"), + 95: .standard(proto: "packed_sint64"), + 96: .standard(proto: "packed_fixed32"), + 97: .standard(proto: "packed_fixed64"), + 98: .standard(proto: "packed_sfixed32"), + 99: .standard(proto: "packed_sfixed64"), + 100: .standard(proto: "packed_float"), + 101: .standard(proto: "packed_double"), + 102: .standard(proto: "packed_bool"), + 103: .standard(proto: "packed_enum"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 90: try { try decoder.decodeRepeatedInt32Field(value: &self.packedInt32) }() + case 91: try { try decoder.decodeRepeatedInt64Field(value: &self.packedInt64) }() + case 92: try { try decoder.decodeRepeatedUInt32Field(value: &self.packedUint32) }() + case 93: try { try decoder.decodeRepeatedUInt64Field(value: &self.packedUint64) }() + case 94: try { try decoder.decodeRepeatedSInt32Field(value: &self.packedSint32) }() + case 95: try { try decoder.decodeRepeatedSInt64Field(value: &self.packedSint64) }() + case 96: try { try decoder.decodeRepeatedFixed32Field(value: &self.packedFixed32) }() + case 97: try { try decoder.decodeRepeatedFixed64Field(value: &self.packedFixed64) }() + case 98: try { try decoder.decodeRepeatedSFixed32Field(value: &self.packedSfixed32) }() + case 99: try { try decoder.decodeRepeatedSFixed64Field(value: &self.packedSfixed64) }() + case 100: try { try decoder.decodeRepeatedFloatField(value: &self.packedFloat) }() + case 101: try { try decoder.decodeRepeatedDoubleField(value: &self.packedDouble) }() + case 102: try { try decoder.decodeRepeatedBoolField(value: &self.packedBool) }() + case 103: try { try decoder.decodeRepeatedEnumField(value: &self.packedEnum) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.packedInt32.isEmpty { + try visitor.visitPackedInt32Field(value: self.packedInt32, fieldNumber: 90) + } + if !self.packedInt64.isEmpty { + try visitor.visitPackedInt64Field(value: self.packedInt64, fieldNumber: 91) + } + if !self.packedUint32.isEmpty { + try visitor.visitPackedUInt32Field(value: self.packedUint32, fieldNumber: 92) + } + if !self.packedUint64.isEmpty { + try visitor.visitPackedUInt64Field(value: self.packedUint64, fieldNumber: 93) + } + if !self.packedSint32.isEmpty { + try visitor.visitPackedSInt32Field(value: self.packedSint32, fieldNumber: 94) + } + if !self.packedSint64.isEmpty { + try visitor.visitPackedSInt64Field(value: self.packedSint64, fieldNumber: 95) + } + if !self.packedFixed32.isEmpty { + try visitor.visitPackedFixed32Field(value: self.packedFixed32, fieldNumber: 96) + } + if !self.packedFixed64.isEmpty { + try visitor.visitPackedFixed64Field(value: self.packedFixed64, fieldNumber: 97) + } + if !self.packedSfixed32.isEmpty { + try visitor.visitPackedSFixed32Field(value: self.packedSfixed32, fieldNumber: 98) + } + if !self.packedSfixed64.isEmpty { + try visitor.visitPackedSFixed64Field(value: self.packedSfixed64, fieldNumber: 99) + } + if !self.packedFloat.isEmpty { + try visitor.visitPackedFloatField(value: self.packedFloat, fieldNumber: 100) + } + if !self.packedDouble.isEmpty { + try visitor.visitPackedDoubleField(value: self.packedDouble, fieldNumber: 101) + } + if !self.packedBool.isEmpty { + try visitor.visitPackedBoolField(value: self.packedBool, fieldNumber: 102) + } + if !self.packedEnum.isEmpty { + try visitor.visitPackedEnumField(value: self.packedEnum, fieldNumber: 103) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestPackedTypes, rhs: ProtobufUnittest_TestPackedTypes) -> Bool { + if lhs.packedInt32 != rhs.packedInt32 {return false} + if lhs.packedInt64 != rhs.packedInt64 {return false} + if lhs.packedUint32 != rhs.packedUint32 {return false} + if lhs.packedUint64 != rhs.packedUint64 {return false} + if lhs.packedSint32 != rhs.packedSint32 {return false} + if lhs.packedSint64 != rhs.packedSint64 {return false} + if lhs.packedFixed32 != rhs.packedFixed32 {return false} + if lhs.packedFixed64 != rhs.packedFixed64 {return false} + if lhs.packedSfixed32 != rhs.packedSfixed32 {return false} + if lhs.packedSfixed64 != rhs.packedSfixed64 {return false} + if lhs.packedFloat != rhs.packedFloat {return false} + if lhs.packedDouble != rhs.packedDouble {return false} + if lhs.packedBool != rhs.packedBool {return false} + if lhs.packedEnum != rhs.packedEnum {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestUnpackedTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestUnpackedTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 90: .standard(proto: "unpacked_int32"), + 91: .standard(proto: "unpacked_int64"), + 92: .standard(proto: "unpacked_uint32"), + 93: .standard(proto: "unpacked_uint64"), + 94: .standard(proto: "unpacked_sint32"), + 95: .standard(proto: "unpacked_sint64"), + 96: .standard(proto: "unpacked_fixed32"), + 97: .standard(proto: "unpacked_fixed64"), + 98: .standard(proto: "unpacked_sfixed32"), + 99: .standard(proto: "unpacked_sfixed64"), + 100: .standard(proto: "unpacked_float"), + 101: .standard(proto: "unpacked_double"), + 102: .standard(proto: "unpacked_bool"), + 103: .standard(proto: "unpacked_enum"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 90: try { try decoder.decodeRepeatedInt32Field(value: &self.unpackedInt32) }() + case 91: try { try decoder.decodeRepeatedInt64Field(value: &self.unpackedInt64) }() + case 92: try { try decoder.decodeRepeatedUInt32Field(value: &self.unpackedUint32) }() + case 93: try { try decoder.decodeRepeatedUInt64Field(value: &self.unpackedUint64) }() + case 94: try { try decoder.decodeRepeatedSInt32Field(value: &self.unpackedSint32) }() + case 95: try { try decoder.decodeRepeatedSInt64Field(value: &self.unpackedSint64) }() + case 96: try { try decoder.decodeRepeatedFixed32Field(value: &self.unpackedFixed32) }() + case 97: try { try decoder.decodeRepeatedFixed64Field(value: &self.unpackedFixed64) }() + case 98: try { try decoder.decodeRepeatedSFixed32Field(value: &self.unpackedSfixed32) }() + case 99: try { try decoder.decodeRepeatedSFixed64Field(value: &self.unpackedSfixed64) }() + case 100: try { try decoder.decodeRepeatedFloatField(value: &self.unpackedFloat) }() + case 101: try { try decoder.decodeRepeatedDoubleField(value: &self.unpackedDouble) }() + case 102: try { try decoder.decodeRepeatedBoolField(value: &self.unpackedBool) }() + case 103: try { try decoder.decodeRepeatedEnumField(value: &self.unpackedEnum) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.unpackedInt32.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.unpackedInt32, fieldNumber: 90) + } + if !self.unpackedInt64.isEmpty { + try visitor.visitRepeatedInt64Field(value: self.unpackedInt64, fieldNumber: 91) + } + if !self.unpackedUint32.isEmpty { + try visitor.visitRepeatedUInt32Field(value: self.unpackedUint32, fieldNumber: 92) + } + if !self.unpackedUint64.isEmpty { + try visitor.visitRepeatedUInt64Field(value: self.unpackedUint64, fieldNumber: 93) + } + if !self.unpackedSint32.isEmpty { + try visitor.visitRepeatedSInt32Field(value: self.unpackedSint32, fieldNumber: 94) + } + if !self.unpackedSint64.isEmpty { + try visitor.visitRepeatedSInt64Field(value: self.unpackedSint64, fieldNumber: 95) + } + if !self.unpackedFixed32.isEmpty { + try visitor.visitRepeatedFixed32Field(value: self.unpackedFixed32, fieldNumber: 96) + } + if !self.unpackedFixed64.isEmpty { + try visitor.visitRepeatedFixed64Field(value: self.unpackedFixed64, fieldNumber: 97) + } + if !self.unpackedSfixed32.isEmpty { + try visitor.visitRepeatedSFixed32Field(value: self.unpackedSfixed32, fieldNumber: 98) + } + if !self.unpackedSfixed64.isEmpty { + try visitor.visitRepeatedSFixed64Field(value: self.unpackedSfixed64, fieldNumber: 99) + } + if !self.unpackedFloat.isEmpty { + try visitor.visitRepeatedFloatField(value: self.unpackedFloat, fieldNumber: 100) + } + if !self.unpackedDouble.isEmpty { + try visitor.visitRepeatedDoubleField(value: self.unpackedDouble, fieldNumber: 101) + } + if !self.unpackedBool.isEmpty { + try visitor.visitRepeatedBoolField(value: self.unpackedBool, fieldNumber: 102) + } + if !self.unpackedEnum.isEmpty { + try visitor.visitRepeatedEnumField(value: self.unpackedEnum, fieldNumber: 103) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestUnpackedTypes, rhs: ProtobufUnittest_TestUnpackedTypes) -> Bool { + if lhs.unpackedInt32 != rhs.unpackedInt32 {return false} + if lhs.unpackedInt64 != rhs.unpackedInt64 {return false} + if lhs.unpackedUint32 != rhs.unpackedUint32 {return false} + if lhs.unpackedUint64 != rhs.unpackedUint64 {return false} + if lhs.unpackedSint32 != rhs.unpackedSint32 {return false} + if lhs.unpackedSint64 != rhs.unpackedSint64 {return false} + if lhs.unpackedFixed32 != rhs.unpackedFixed32 {return false} + if lhs.unpackedFixed64 != rhs.unpackedFixed64 {return false} + if lhs.unpackedSfixed32 != rhs.unpackedSfixed32 {return false} + if lhs.unpackedSfixed64 != rhs.unpackedSfixed64 {return false} + if lhs.unpackedFloat != rhs.unpackedFloat {return false} + if lhs.unpackedDouble != rhs.unpackedDouble {return false} + if lhs.unpackedBool != rhs.unpackedBool {return false} + if lhs.unpackedEnum != rhs.unpackedEnum {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestPackedExtensions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestPackedExtensions" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + if (1 <= fieldNumber && fieldNumber < 536870912) { + try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestPackedExtensions.self, fieldNumber: fieldNumber) + } + } + } + + func traverse(visitor: inout V) throws { + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestPackedExtensions, rhs: ProtobufUnittest_TestPackedExtensions) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestUnpackedExtensions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestUnpackedExtensions" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + if (1 <= fieldNumber && fieldNumber < 536870912) { + try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestUnpackedExtensions.self, fieldNumber: fieldNumber) + } + } + } + + func traverse(visitor: inout V) throws { + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestUnpackedExtensions, rhs: ProtobufUnittest_TestUnpackedExtensions) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestDynamicExtensions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestDynamicExtensions" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 2000: .standard(proto: "scalar_extension"), + 2001: .standard(proto: "enum_extension"), + 2002: .standard(proto: "dynamic_enum_extension"), + 2003: .standard(proto: "message_extension"), + 2004: .standard(proto: "dynamic_message_extension"), + 2005: .standard(proto: "repeated_extension"), + 2006: .standard(proto: "packed_extension"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 2000: try { try decoder.decodeSingularFixed32Field(value: &self._scalarExtension) }() + case 2001: try { try decoder.decodeSingularEnumField(value: &self._enumExtension) }() + case 2002: try { try decoder.decodeSingularEnumField(value: &self._dynamicEnumExtension) }() + case 2003: try { try decoder.decodeSingularMessageField(value: &self._messageExtension) }() + case 2004: try { try decoder.decodeSingularMessageField(value: &self._dynamicMessageExtension) }() + case 2005: try { try decoder.decodeRepeatedStringField(value: &self.repeatedExtension) }() + case 2006: try { try decoder.decodeRepeatedSInt32Field(value: &self.packedExtension) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._scalarExtension { + try visitor.visitSingularFixed32Field(value: v, fieldNumber: 2000) + } }() + try { if let v = self._enumExtension { + try visitor.visitSingularEnumField(value: v, fieldNumber: 2001) + } }() + try { if let v = self._dynamicEnumExtension { + try visitor.visitSingularEnumField(value: v, fieldNumber: 2002) + } }() + try { if let v = self._messageExtension { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2003) + } }() + try { if let v = self._dynamicMessageExtension { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2004) + } }() + if !self.repeatedExtension.isEmpty { + try visitor.visitRepeatedStringField(value: self.repeatedExtension, fieldNumber: 2005) + } + if !self.packedExtension.isEmpty { + try visitor.visitPackedSInt32Field(value: self.packedExtension, fieldNumber: 2006) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestDynamicExtensions, rhs: ProtobufUnittest_TestDynamicExtensions) -> Bool { + if lhs._scalarExtension != rhs._scalarExtension {return false} + if lhs._enumExtension != rhs._enumExtension {return false} + if lhs._dynamicEnumExtension != rhs._dynamicEnumExtension {return false} + if lhs._messageExtension != rhs._messageExtension {return false} + if lhs._dynamicMessageExtension != rhs._dynamicMessageExtension {return false} + if lhs.repeatedExtension != rhs.repeatedExtension {return false} + if lhs.packedExtension != rhs.packedExtension {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestDynamicExtensions.DynamicEnumType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 2200: .same(proto: "DYNAMIC_FOO"), + 2201: .same(proto: "DYNAMIC_BAR"), + 2202: .same(proto: "DYNAMIC_BAZ"), + ] +} + +extension ProtobufUnittest_TestDynamicExtensions.DynamicMessageType: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestDynamicExtensions.protoMessageName + ".DynamicMessageType" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 2100: .standard(proto: "dynamic_field"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 2100: try { try decoder.decodeSingularInt32Field(value: &self._dynamicField) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._dynamicField { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2100) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestDynamicExtensions.DynamicMessageType, rhs: ProtobufUnittest_TestDynamicExtensions.DynamicMessageType) -> Bool { + if lhs._dynamicField != rhs._dynamicField {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestRepeatedString: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestRepeatedString" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "repeated_string1"), + 2: .standard(proto: "repeated_string2"), + 11: .standard(proto: "repeated_bytes11"), + 12: .standard(proto: "repeated_bytes12"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedStringField(value: &self.repeatedString1) }() + case 2: try { try decoder.decodeRepeatedStringField(value: &self.repeatedString2) }() + case 11: try { try decoder.decodeRepeatedBytesField(value: &self.repeatedBytes11) }() + case 12: try { try decoder.decodeRepeatedBytesField(value: &self.repeatedBytes12) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.repeatedString1.isEmpty { + try visitor.visitRepeatedStringField(value: self.repeatedString1, fieldNumber: 1) + } + if !self.repeatedString2.isEmpty { + try visitor.visitRepeatedStringField(value: self.repeatedString2, fieldNumber: 2) + } + if !self.repeatedBytes11.isEmpty { + try visitor.visitRepeatedBytesField(value: self.repeatedBytes11, fieldNumber: 11) + } + if !self.repeatedBytes12.isEmpty { + try visitor.visitRepeatedBytesField(value: self.repeatedBytes12, fieldNumber: 12) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestRepeatedString, rhs: ProtobufUnittest_TestRepeatedString) -> Bool { + if lhs.repeatedString1 != rhs.repeatedString1 {return false} + if lhs.repeatedString2 != rhs.repeatedString2 {return false} + if lhs.repeatedBytes11 != rhs.repeatedBytes11 {return false} + if lhs.repeatedBytes12 != rhs.repeatedBytes12 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestRepeatedScalarDifferentTagSizes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestRepeatedScalarDifferentTagSizes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 12: .standard(proto: "repeated_fixed32"), + 13: .standard(proto: "repeated_int32"), + 2046: .standard(proto: "repeated_fixed64"), + 2047: .standard(proto: "repeated_int64"), + 262142: .standard(proto: "repeated_float"), + 262143: .standard(proto: "repeated_uint64"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 12: try { try decoder.decodeRepeatedFixed32Field(value: &self.repeatedFixed32) }() + case 13: try { try decoder.decodeRepeatedInt32Field(value: &self.repeatedInt32) }() + case 2046: try { try decoder.decodeRepeatedFixed64Field(value: &self.repeatedFixed64) }() + case 2047: try { try decoder.decodeRepeatedInt64Field(value: &self.repeatedInt64) }() + case 262142: try { try decoder.decodeRepeatedFloatField(value: &self.repeatedFloat) }() + case 262143: try { try decoder.decodeRepeatedUInt64Field(value: &self.repeatedUint64) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.repeatedFixed32.isEmpty { + try visitor.visitRepeatedFixed32Field(value: self.repeatedFixed32, fieldNumber: 12) + } + if !self.repeatedInt32.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.repeatedInt32, fieldNumber: 13) + } + if !self.repeatedFixed64.isEmpty { + try visitor.visitRepeatedFixed64Field(value: self.repeatedFixed64, fieldNumber: 2046) + } + if !self.repeatedInt64.isEmpty { + try visitor.visitRepeatedInt64Field(value: self.repeatedInt64, fieldNumber: 2047) + } + if !self.repeatedFloat.isEmpty { + try visitor.visitRepeatedFloatField(value: self.repeatedFloat, fieldNumber: 262142) + } + if !self.repeatedUint64.isEmpty { + try visitor.visitRepeatedUInt64Field(value: self.repeatedUint64, fieldNumber: 262143) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestRepeatedScalarDifferentTagSizes, rhs: ProtobufUnittest_TestRepeatedScalarDifferentTagSizes) -> Bool { + if lhs.repeatedFixed32 != rhs.repeatedFixed32 {return false} + if lhs.repeatedInt32 != rhs.repeatedInt32 {return false} + if lhs.repeatedFixed64 != rhs.repeatedFixed64 {return false} + if lhs.repeatedInt64 != rhs.repeatedInt64 {return false} + if lhs.repeatedFloat != rhs.repeatedFloat {return false} + if lhs.repeatedUint64 != rhs.repeatedUint64 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestParsingMerge: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestParsingMerge" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "required_all_types"), + 2: .standard(proto: "optional_all_types"), + 3: .standard(proto: "repeated_all_types"), + 10: .unique(proto: "OptionalGroup", json: "optionalgroup"), + 20: .unique(proto: "RepeatedGroup", json: "repeatedgroup"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + if self._requiredAllTypes == nil {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._requiredAllTypes) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._optionalAllTypes) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedAllTypes) }() + case 10: try { try decoder.decodeSingularGroupField(value: &self._optionalGroup) }() + case 20: try { try decoder.decodeRepeatedGroupField(value: &self.repeatedGroup) }() + case 1000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestParsingMerge.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._requiredAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if !self.repeatedAllTypes.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedAllTypes, fieldNumber: 3) + } + try { if let v = self._optionalGroup { + try visitor.visitSingularGroupField(value: v, fieldNumber: 10) + } }() + if !self.repeatedGroup.isEmpty { + try visitor.visitRepeatedGroupField(value: self.repeatedGroup, fieldNumber: 20) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestParsingMerge, rhs: ProtobufUnittest_TestParsingMerge) -> Bool { + if lhs._requiredAllTypes != rhs._requiredAllTypes {return false} + if lhs._optionalAllTypes != rhs._optionalAllTypes {return false} + if lhs.repeatedAllTypes != rhs.repeatedAllTypes {return false} + if lhs._optionalGroup != rhs._optionalGroup {return false} + if lhs.repeatedGroup != rhs.repeatedGroup {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestParsingMerge.protoMessageName + ".RepeatedFieldsGenerator" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "field1"), + 2: .same(proto: "field2"), + 3: .same(proto: "field3"), + 10: .unique(proto: "Group1", json: "group1"), + 20: .unique(proto: "Group2", json: "group2"), + 1000: .same(proto: "ext1"), + 1001: .same(proto: "ext2"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.field1) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.field2) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.field3) }() + case 10: try { try decoder.decodeRepeatedGroupField(value: &self.group1) }() + case 20: try { try decoder.decodeRepeatedGroupField(value: &self.group2) }() + case 1000: try { try decoder.decodeRepeatedMessageField(value: &self.ext1) }() + case 1001: try { try decoder.decodeRepeatedMessageField(value: &self.ext2) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.field1.isEmpty { + try visitor.visitRepeatedMessageField(value: self.field1, fieldNumber: 1) + } + if !self.field2.isEmpty { + try visitor.visitRepeatedMessageField(value: self.field2, fieldNumber: 2) + } + if !self.field3.isEmpty { + try visitor.visitRepeatedMessageField(value: self.field3, fieldNumber: 3) + } + if !self.group1.isEmpty { + try visitor.visitRepeatedGroupField(value: self.group1, fieldNumber: 10) + } + if !self.group2.isEmpty { + try visitor.visitRepeatedGroupField(value: self.group2, fieldNumber: 20) + } + if !self.ext1.isEmpty { + try visitor.visitRepeatedMessageField(value: self.ext1, fieldNumber: 1000) + } + if !self.ext2.isEmpty { + try visitor.visitRepeatedMessageField(value: self.ext2, fieldNumber: 1001) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator, rhs: ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator) -> Bool { + if lhs.field1 != rhs.field1 {return false} + if lhs.field2 != rhs.field2 {return false} + if lhs.field3 != rhs.field3 {return false} + if lhs.group1 != rhs.group1 {return false} + if lhs.group2 != rhs.group2 {return false} + if lhs.ext1 != rhs.ext1 {return false} + if lhs.ext2 != rhs.ext2 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator.Group1: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator.protoMessageName + ".Group1" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 11: .same(proto: "field1"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 11: try { try decoder.decodeSingularMessageField(value: &self._field1) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._field1 { + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator.Group1, rhs: ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator.Group1) -> Bool { + if lhs._field1 != rhs._field1 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator.Group2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator.protoMessageName + ".Group2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 21: .same(proto: "field1"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 21: try { try decoder.decodeSingularMessageField(value: &self._field1) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._field1 { + try visitor.visitSingularMessageField(value: v, fieldNumber: 21) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator.Group2, rhs: ProtobufUnittest_TestParsingMerge.RepeatedFieldsGenerator.Group2) -> Bool { + if lhs._field1 != rhs._field1 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestParsingMerge.OptionalGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestParsingMerge.protoMessageName + ".OptionalGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 11: .standard(proto: "optional_group_all_types"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 11: try { try decoder.decodeSingularMessageField(value: &self._optionalGroupAllTypes) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalGroupAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestParsingMerge.OptionalGroup, rhs: ProtobufUnittest_TestParsingMerge.OptionalGroup) -> Bool { + if lhs._optionalGroupAllTypes != rhs._optionalGroupAllTypes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestParsingMerge.RepeatedGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestParsingMerge.protoMessageName + ".RepeatedGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 21: .standard(proto: "repeated_group_all_types"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 21: try { try decoder.decodeSingularMessageField(value: &self._repeatedGroupAllTypes) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._repeatedGroupAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 21) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestParsingMerge.RepeatedGroup, rhs: ProtobufUnittest_TestParsingMerge.RepeatedGroup) -> Bool { + if lhs._repeatedGroupAllTypes != rhs._repeatedGroupAllTypes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMergeException: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMergeException" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "all_extensions"), + ] + + public var isInitialized: Bool { + if let v = self._allExtensions, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._allExtensions) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._allExtensions { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMergeException, rhs: ProtobufUnittest_TestMergeException) -> Bool { + if lhs._allExtensions != rhs._allExtensions {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestCommentInjectionMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestCommentInjectionMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._a) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestCommentInjectionMessage, rhs: ProtobufUnittest_TestCommentInjectionMessage) -> Bool { + if lhs._a != rhs._a {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMessageSize: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMessageSize" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "m1"), + 2: .same(proto: "m2"), + 3: .same(proto: "m3"), + 4: .same(proto: "m4"), + 5: .same(proto: "m5"), + 6: .same(proto: "m6"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self._m1) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self._m2) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self._m3) }() + case 4: try { try decoder.decodeSingularStringField(value: &self._m4) }() + case 5: try { try decoder.decodeSingularInt32Field(value: &self._m5) }() + case 6: try { try decoder.decodeSingularInt64Field(value: &self._m6) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._m1 { + try visitor.visitSingularBoolField(value: v, fieldNumber: 1) + } }() + try { if let v = self._m2 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._m3 { + try visitor.visitSingularBoolField(value: v, fieldNumber: 3) + } }() + try { if let v = self._m4 { + try visitor.visitSingularStringField(value: v, fieldNumber: 4) + } }() + try { if let v = self._m5 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 5) + } }() + try { if let v = self._m6 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 6) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMessageSize, rhs: ProtobufUnittest_TestMessageSize) -> Bool { + if lhs._m1 != rhs._m1 {return false} + if lhs._m2 != rhs._m2 {return false} + if lhs._m3 != rhs._m3 {return false} + if lhs._m4 != rhs._m4 {return false} + if lhs._m5 != rhs._m5 {return false} + if lhs._m6 != rhs._m6 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_FooRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FooRequest" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_FooRequest, rhs: ProtobufUnittest_FooRequest) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_FooResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FooResponse" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_FooResponse, rhs: ProtobufUnittest_FooResponse) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_FooClientMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FooClientMessage" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_FooClientMessage, rhs: ProtobufUnittest_FooClientMessage) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_FooServerMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FooServerMessage" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_FooServerMessage, rhs: ProtobufUnittest_FooServerMessage) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_BarRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".BarRequest" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_BarRequest, rhs: ProtobufUnittest_BarRequest) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_BarResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".BarResponse" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_BarResponse, rhs: ProtobufUnittest_BarResponse) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestJsonName: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestJsonName" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "field_name1"), + 2: .same(proto: "fieldName2"), + 3: .same(proto: "FieldName3"), + 4: .standard(proto: "_field_name4"), + 5: .standard(proto: "FIELD_NAME5"), + 6: .unique(proto: "field_name6", json: "@type"), + 7: .same(proto: "fieldname7"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._fieldName1) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._fieldName2) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self._fieldName3) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &self._fieldName4) }() + case 5: try { try decoder.decodeSingularInt32Field(value: &self._fieldName5) }() + case 6: try { try decoder.decodeSingularInt32Field(value: &self._fieldName6) }() + case 7: try { try decoder.decodeSingularInt32Field(value: &self._fieldname7) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._fieldName1 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._fieldName2 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._fieldName3 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) + } }() + try { if let v = self._fieldName4 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 4) + } }() + try { if let v = self._fieldName5 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 5) + } }() + try { if let v = self._fieldName6 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 6) + } }() + try { if let v = self._fieldname7 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 7) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestJsonName, rhs: ProtobufUnittest_TestJsonName) -> Bool { + if lhs._fieldName1 != rhs._fieldName1 {return false} + if lhs._fieldName2 != rhs._fieldName2 {return false} + if lhs._fieldName3 != rhs._fieldName3 {return false} + if lhs._fieldName4 != rhs._fieldName4 {return false} + if lhs._fieldName5 != rhs._fieldName5 {return false} + if lhs._fieldName6 != rhs._fieldName6 {return false} + if lhs._fieldname7 != rhs._fieldname7 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestHugeFieldNumbers: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestHugeFieldNumbers" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 536870000: .standard(proto: "optional_int32"), + 536870001: .standard(proto: "fixed_32"), + 536870002: .standard(proto: "repeated_int32"), + 536870003: .standard(proto: "packed_int32"), + 536870004: .standard(proto: "optional_enum"), + 536870005: .standard(proto: "optional_string"), + 536870006: .standard(proto: "optional_bytes"), + 536870007: .standard(proto: "optional_message"), + 536870008: .unique(proto: "OptionalGroup", json: "optionalgroup"), + 536870010: .standard(proto: "string_string_map"), + 536870011: .standard(proto: "oneof_uint32"), + 536870012: .standard(proto: "oneof_test_all_types"), + 536870013: .standard(proto: "oneof_string"), + 536870014: .standard(proto: "oneof_bytes"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 536870000: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt32) }() + case 536870001: try { try decoder.decodeSingularInt32Field(value: &self._fixed32) }() + case 536870002: try { try decoder.decodeRepeatedInt32Field(value: &self.repeatedInt32) }() + case 536870003: try { try decoder.decodeRepeatedInt32Field(value: &self.packedInt32) }() + case 536870004: try { try decoder.decodeSingularEnumField(value: &self._optionalEnum) }() + case 536870005: try { try decoder.decodeSingularStringField(value: &self._optionalString) }() + case 536870006: try { try decoder.decodeSingularBytesField(value: &self._optionalBytes) }() + case 536870007: try { try decoder.decodeSingularMessageField(value: &self._optionalMessage) }() + case 536870008: try { try decoder.decodeSingularGroupField(value: &self._optionalGroup) }() + case 536870010: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.stringStringMap) }() + case 536870011: try { + var v: UInt32? + try decoder.decodeSingularUInt32Field(value: &v) + if let v = v { + if self.oneofField != nil {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofUint32(v) + } + }() + case 536870012: try { + var v: ProtobufUnittest_TestAllTypes? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .oneofTestAllTypes(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofTestAllTypes(v) + } + }() + case 536870013: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.oneofField != nil {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofString(v) + } + }() + case 536870014: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if self.oneofField != nil {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofBytes(v) + } + }() + case 536860000..<536870000: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestHugeFieldNumbers.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 536860000, end: 536870000) + try { if let v = self._optionalInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 536870000) + } }() + try { if let v = self._fixed32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 536870001) + } }() + if !self.repeatedInt32.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.repeatedInt32, fieldNumber: 536870002) + } + if !self.packedInt32.isEmpty { + try visitor.visitPackedInt32Field(value: self.packedInt32, fieldNumber: 536870003) + } + try { if let v = self._optionalEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 536870004) + } }() + try { if let v = self._optionalString { + try visitor.visitSingularStringField(value: v, fieldNumber: 536870005) + } }() + try { if let v = self._optionalBytes { + try visitor.visitSingularBytesField(value: v, fieldNumber: 536870006) + } }() + try { if let v = self._optionalMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 536870007) + } }() + try { if let v = self._optionalGroup { + try visitor.visitSingularGroupField(value: v, fieldNumber: 536870008) + } }() + if !self.stringStringMap.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.stringStringMap, fieldNumber: 536870010) + } + switch self.oneofField { + case .oneofUint32?: try { + guard case .oneofUint32(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 536870011) + }() + case .oneofTestAllTypes?: try { + guard case .oneofTestAllTypes(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 536870012) + }() + case .oneofString?: try { + guard case .oneofString(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 536870013) + }() + case .oneofBytes?: try { + guard case .oneofBytes(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 536870014) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestHugeFieldNumbers, rhs: ProtobufUnittest_TestHugeFieldNumbers) -> Bool { + if lhs._optionalInt32 != rhs._optionalInt32 {return false} + if lhs._fixed32 != rhs._fixed32 {return false} + if lhs.repeatedInt32 != rhs.repeatedInt32 {return false} + if lhs.packedInt32 != rhs.packedInt32 {return false} + if lhs._optionalEnum != rhs._optionalEnum {return false} + if lhs._optionalString != rhs._optionalString {return false} + if lhs._optionalBytes != rhs._optionalBytes {return false} + if lhs._optionalMessage != rhs._optionalMessage {return false} + if lhs._optionalGroup != rhs._optionalGroup {return false} + if lhs.stringStringMap != rhs.stringStringMap {return false} + if lhs.oneofField != rhs.oneofField {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestHugeFieldNumbers.protoMessageName + ".OptionalGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 536870009: .standard(proto: "group_a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 536870009: try { try decoder.decodeSingularInt32Field(value: &self._groupA) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._groupA { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 536870009) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup, rhs: ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup) -> Bool { + if lhs._groupA != rhs._groupA {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestExtensionInsideTable: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestExtensionInsideTable" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "field1"), + 2: .same(proto: "field2"), + 3: .same(proto: "field3"), + 4: .same(proto: "field4"), + 6: .same(proto: "field6"), + 7: .same(proto: "field7"), + 8: .same(proto: "field8"), + 9: .same(proto: "field9"), + 10: .same(proto: "field10"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._field1) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._field2) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self._field3) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &self._field4) }() + case 6: try { try decoder.decodeSingularInt32Field(value: &self._field6) }() + case 7: try { try decoder.decodeSingularInt32Field(value: &self._field7) }() + case 8: try { try decoder.decodeSingularInt32Field(value: &self._field8) }() + case 9: try { try decoder.decodeSingularInt32Field(value: &self._field9) }() + case 10: try { try decoder.decodeSingularInt32Field(value: &self._field10) }() + case 5: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestExtensionInsideTable.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._field1 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._field2 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._field3 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) + } }() + try { if let v = self._field4 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 4) + } }() + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 5, end: 6) + try { if let v = self._field6 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 6) + } }() + try { if let v = self._field7 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 7) + } }() + try { if let v = self._field8 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 8) + } }() + try { if let v = self._field9 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 9) + } }() + try { if let v = self._field10 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 10) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestExtensionInsideTable, rhs: ProtobufUnittest_TestExtensionInsideTable) -> Bool { + if lhs._field1 != rhs._field1 {return false} + if lhs._field2 != rhs._field2 {return false} + if lhs._field3 != rhs._field3 {return false} + if lhs._field4 != rhs._field4 {return false} + if lhs._field6 != rhs._field6 {return false} + if lhs._field7 != rhs._field7 {return false} + if lhs._field8 != rhs._field8 {return false} + if lhs._field9 != rhs._field9 {return false} + if lhs._field10 != rhs._field10 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestNestedGroupExtensionOuter: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestNestedGroupExtensionOuter" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .unique(proto: "Layer1OptionalGroup", json: "layer1optionalgroup"), + ] + + public var isInitialized: Bool { + if let v = self._layer1OptionalGroup, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularGroupField(value: &self._layer1OptionalGroup) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._layer1OptionalGroup { + try visitor.visitSingularGroupField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestNestedGroupExtensionOuter, rhs: ProtobufUnittest_TestNestedGroupExtensionOuter) -> Bool { + if lhs._layer1OptionalGroup != rhs._layer1OptionalGroup {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestNestedGroupExtensionOuter.protoMessageName + ".Layer1OptionalGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 2: .unique(proto: "Layer2RepeatedGroup", json: "layer2repeatedgroup"), + 4: .unique(proto: "Layer2AnotherOptionalRepeatedGroup", json: "layer2anotheroptionalrepeatedgroup"), + ] + + public var isInitialized: Bool { + if !SwiftProtobuf.Internal.areAllInitialized(self.layer2RepeatedGroup) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 2: try { try decoder.decodeRepeatedGroupField(value: &self.layer2RepeatedGroup) }() + case 4: try { try decoder.decodeRepeatedGroupField(value: &self.layer2AnotherOptionalRepeatedGroup) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.layer2RepeatedGroup.isEmpty { + try visitor.visitRepeatedGroupField(value: self.layer2RepeatedGroup, fieldNumber: 2) + } + if !self.layer2AnotherOptionalRepeatedGroup.isEmpty { + try visitor.visitRepeatedGroupField(value: self.layer2AnotherOptionalRepeatedGroup, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup, rhs: ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup) -> Bool { + if lhs.layer2RepeatedGroup != rhs.layer2RepeatedGroup {return false} + if lhs.layer2AnotherOptionalRepeatedGroup != rhs.layer2AnotherOptionalRepeatedGroup {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2RepeatedGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup.protoMessageName + ".Layer2RepeatedGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 6: .standard(proto: "another_field"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 6: try { try decoder.decodeSingularStringField(value: &self._anotherField) }() + case 3: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2RepeatedGroup.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 3, end: 4) + try { if let v = self._anotherField { + try visitor.visitSingularStringField(value: v, fieldNumber: 6) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2RepeatedGroup, rhs: ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2RepeatedGroup) -> Bool { + if lhs._anotherField != rhs._anotherField {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2AnotherOptionalRepeatedGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup.protoMessageName + ".Layer2AnotherOptionalRepeatedGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 5: .standard(proto: "but_why_tho"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 5: try { try decoder.decodeSingularStringField(value: &self._butWhyTho) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._butWhyTho { + try visitor.visitSingularStringField(value: v, fieldNumber: 5) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2AnotherOptionalRepeatedGroup, rhs: ProtobufUnittest_TestNestedGroupExtensionOuter.Layer1OptionalGroup.Layer2AnotherOptionalRepeatedGroup) -> Bool { + if lhs._butWhyTho != rhs._butWhyTho {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestNestedGroupExtensionInnerExtension: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestNestedGroupExtensionInnerExtension" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "inner_name"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._innerName) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._innerName { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestNestedGroupExtensionInnerExtension, rhs: ProtobufUnittest_TestNestedGroupExtensionInnerExtension) -> Bool { + if lhs._innerName != rhs._innerName {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestExtensionRangeSerialize: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestExtensionRangeSerialize" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "foo_one"), + 6: .standard(proto: "foo_two"), + 7: .standard(proto: "foo_three"), + 13: .standard(proto: "foo_four"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._fooOne) }() + case 6: try { try decoder.decodeSingularInt32Field(value: &self._fooTwo) }() + case 7: try { try decoder.decodeSingularInt32Field(value: &self._fooThree) }() + case 13: try { try decoder.decodeSingularInt32Field(value: &self._fooFour) }() + case 2..<5, 9..<11, 15, 17, 19: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestExtensionRangeSerialize.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._fooOne { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 2, end: 5) + try { if let v = self._fooTwo { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 6) + } }() + try { if let v = self._fooThree { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 7) + } }() + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 9, end: 11) + try { if let v = self._fooFour { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 13) + } }() + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 15, end: 20) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestExtensionRangeSerialize, rhs: ProtobufUnittest_TestExtensionRangeSerialize) -> Bool { + if lhs._fooOne != rhs._fooOne {return false} + if lhs._fooTwo != rhs._fooTwo {return false} + if lhs._fooThree != rhs._fooThree {return false} + if lhs._fooFour != rhs._fooFour {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestVerifyInt32Simple: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestVerifyInt32Simple" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_int32_1"), + 2: .standard(proto: "optional_int32_2"), + 63: .standard(proto: "optional_int32_63"), + 64: .standard(proto: "optional_int32_64"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt321) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt322) }() + case 63: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt3263) }() + case 64: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt3264) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalInt321 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalInt322 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._optionalInt3263 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 63) + } }() + try { if let v = self._optionalInt3264 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 64) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestVerifyInt32Simple, rhs: ProtobufUnittest_TestVerifyInt32Simple) -> Bool { + if lhs._optionalInt321 != rhs._optionalInt321 {return false} + if lhs._optionalInt322 != rhs._optionalInt322 {return false} + if lhs._optionalInt3263 != rhs._optionalInt3263 {return false} + if lhs._optionalInt3264 != rhs._optionalInt3264 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestVerifyInt32: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestVerifyInt32" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_int32_1"), + 2: .standard(proto: "optional_int32_2"), + 63: .standard(proto: "optional_int32_63"), + 64: .standard(proto: "optional_int32_64"), + 9: .standard(proto: "optional_all_types"), + 10: .standard(proto: "repeated_all_types"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt321) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt322) }() + case 9: try { try decoder.decodeSingularMessageField(value: &self._optionalAllTypes) }() + case 10: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedAllTypes) }() + case 63: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt3263) }() + case 64: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt3264) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalInt321 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalInt322 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._optionalAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + if !self.repeatedAllTypes.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedAllTypes, fieldNumber: 10) + } + try { if let v = self._optionalInt3263 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 63) + } }() + try { if let v = self._optionalInt3264 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 64) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestVerifyInt32, rhs: ProtobufUnittest_TestVerifyInt32) -> Bool { + if lhs._optionalInt321 != rhs._optionalInt321 {return false} + if lhs._optionalInt322 != rhs._optionalInt322 {return false} + if lhs._optionalInt3263 != rhs._optionalInt3263 {return false} + if lhs._optionalInt3264 != rhs._optionalInt3264 {return false} + if lhs._optionalAllTypes != rhs._optionalAllTypes {return false} + if lhs.repeatedAllTypes != rhs.repeatedAllTypes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestVerifyMostlyInt32: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestVerifyMostlyInt32" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 30: .standard(proto: "optional_int64_30"), + 1: .standard(proto: "optional_int32_1"), + 2: .standard(proto: "optional_int32_2"), + 3: .standard(proto: "optional_int32_3"), + 4: .standard(proto: "optional_int32_4"), + 63: .standard(proto: "optional_int32_63"), + 64: .standard(proto: "optional_int32_64"), + 9: .standard(proto: "optional_all_types"), + 10: .standard(proto: "repeated_all_types"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt321) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt322) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt323) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt324) }() + case 9: try { try decoder.decodeSingularMessageField(value: &self._optionalAllTypes) }() + case 10: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedAllTypes) }() + case 30: try { try decoder.decodeSingularInt64Field(value: &self._optionalInt6430) }() + case 63: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt3263) }() + case 64: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt3264) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalInt321 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalInt322 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._optionalInt323 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) + } }() + try { if let v = self._optionalInt324 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 4) + } }() + try { if let v = self._optionalAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + if !self.repeatedAllTypes.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedAllTypes, fieldNumber: 10) + } + try { if let v = self._optionalInt6430 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 30) + } }() + try { if let v = self._optionalInt3263 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 63) + } }() + try { if let v = self._optionalInt3264 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 64) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestVerifyMostlyInt32, rhs: ProtobufUnittest_TestVerifyMostlyInt32) -> Bool { + if lhs._optionalInt6430 != rhs._optionalInt6430 {return false} + if lhs._optionalInt321 != rhs._optionalInt321 {return false} + if lhs._optionalInt322 != rhs._optionalInt322 {return false} + if lhs._optionalInt323 != rhs._optionalInt323 {return false} + if lhs._optionalInt324 != rhs._optionalInt324 {return false} + if lhs._optionalInt3263 != rhs._optionalInt3263 {return false} + if lhs._optionalInt3264 != rhs._optionalInt3264 {return false} + if lhs._optionalAllTypes != rhs._optionalAllTypes {return false} + if lhs.repeatedAllTypes != rhs.repeatedAllTypes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestVerifyMostlyInt32BigFieldNumber: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestVerifyMostlyInt32BigFieldNumber" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 30: .standard(proto: "optional_int64_30"), + 300: .standard(proto: "optional_int32_300"), + 1: .standard(proto: "optional_int32_1"), + 2: .standard(proto: "optional_int32_2"), + 3: .standard(proto: "optional_int32_3"), + 4: .standard(proto: "optional_int32_4"), + 63: .standard(proto: "optional_int32_63"), + 64: .standard(proto: "optional_int32_64"), + 9: .standard(proto: "optional_all_types"), + 10: .standard(proto: "repeated_all_types"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt321) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt322) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt323) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt324) }() + case 9: try { try decoder.decodeSingularMessageField(value: &self._optionalAllTypes) }() + case 10: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedAllTypes) }() + case 30: try { try decoder.decodeSingularInt64Field(value: &self._optionalInt6430) }() + case 63: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt3263) }() + case 64: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt3264) }() + case 300: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt32300) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalInt321 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalInt322 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._optionalInt323 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) + } }() + try { if let v = self._optionalInt324 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 4) + } }() + try { if let v = self._optionalAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + if !self.repeatedAllTypes.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedAllTypes, fieldNumber: 10) + } + try { if let v = self._optionalInt6430 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 30) + } }() + try { if let v = self._optionalInt3263 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 63) + } }() + try { if let v = self._optionalInt3264 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 64) + } }() + try { if let v = self._optionalInt32300 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 300) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestVerifyMostlyInt32BigFieldNumber, rhs: ProtobufUnittest_TestVerifyMostlyInt32BigFieldNumber) -> Bool { + if lhs._optionalInt6430 != rhs._optionalInt6430 {return false} + if lhs._optionalInt32300 != rhs._optionalInt32300 {return false} + if lhs._optionalInt321 != rhs._optionalInt321 {return false} + if lhs._optionalInt322 != rhs._optionalInt322 {return false} + if lhs._optionalInt323 != rhs._optionalInt323 {return false} + if lhs._optionalInt324 != rhs._optionalInt324 {return false} + if lhs._optionalInt3263 != rhs._optionalInt3263 {return false} + if lhs._optionalInt3264 != rhs._optionalInt3264 {return false} + if lhs._optionalAllTypes != rhs._optionalAllTypes {return false} + if lhs.repeatedAllTypes != rhs.repeatedAllTypes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestVerifyUint32Simple: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestVerifyUint32Simple" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_uint32_1"), + 2: .standard(proto: "optional_uint32_2"), + 63: .standard(proto: "optional_uint32_63"), + 64: .standard(proto: "optional_uint32_64"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt32Field(value: &self._optionalUint321) }() + case 2: try { try decoder.decodeSingularUInt32Field(value: &self._optionalUint322) }() + case 63: try { try decoder.decodeSingularUInt32Field(value: &self._optionalUint3263) }() + case 64: try { try decoder.decodeSingularUInt32Field(value: &self._optionalUint3264) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalUint321 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalUint322 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._optionalUint3263 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 63) + } }() + try { if let v = self._optionalUint3264 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 64) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestVerifyUint32Simple, rhs: ProtobufUnittest_TestVerifyUint32Simple) -> Bool { + if lhs._optionalUint321 != rhs._optionalUint321 {return false} + if lhs._optionalUint322 != rhs._optionalUint322 {return false} + if lhs._optionalUint3263 != rhs._optionalUint3263 {return false} + if lhs._optionalUint3264 != rhs._optionalUint3264 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestVerifyUint32: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestVerifyUint32" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_uint32_1"), + 2: .standard(proto: "optional_uint32_2"), + 63: .standard(proto: "optional_uint32_63"), + 64: .standard(proto: "optional_uint32_64"), + 9: .standard(proto: "optional_all_types"), + 10: .standard(proto: "repeated_all_types"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt32Field(value: &self._optionalUint321) }() + case 2: try { try decoder.decodeSingularUInt32Field(value: &self._optionalUint322) }() + case 9: try { try decoder.decodeSingularMessageField(value: &self._optionalAllTypes) }() + case 10: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedAllTypes) }() + case 63: try { try decoder.decodeSingularUInt32Field(value: &self._optionalUint3263) }() + case 64: try { try decoder.decodeSingularUInt32Field(value: &self._optionalUint3264) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalUint321 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalUint322 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._optionalAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + if !self.repeatedAllTypes.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedAllTypes, fieldNumber: 10) + } + try { if let v = self._optionalUint3263 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 63) + } }() + try { if let v = self._optionalUint3264 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 64) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestVerifyUint32, rhs: ProtobufUnittest_TestVerifyUint32) -> Bool { + if lhs._optionalUint321 != rhs._optionalUint321 {return false} + if lhs._optionalUint322 != rhs._optionalUint322 {return false} + if lhs._optionalUint3263 != rhs._optionalUint3263 {return false} + if lhs._optionalUint3264 != rhs._optionalUint3264 {return false} + if lhs._optionalAllTypes != rhs._optionalAllTypes {return false} + if lhs.repeatedAllTypes != rhs.repeatedAllTypes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestVerifyOneUint32: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestVerifyOneUint32" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_uint32_1"), + 2: .standard(proto: "optional_int32_2"), + 63: .standard(proto: "optional_int32_63"), + 64: .standard(proto: "optional_int32_64"), + 9: .standard(proto: "optional_all_types"), + 10: .standard(proto: "repeated_all_types"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt32Field(value: &self._optionalUint321) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt322) }() + case 9: try { try decoder.decodeSingularMessageField(value: &self._optionalAllTypes) }() + case 10: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedAllTypes) }() + case 63: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt3263) }() + case 64: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt3264) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalUint321 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalInt322 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._optionalAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + if !self.repeatedAllTypes.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedAllTypes, fieldNumber: 10) + } + try { if let v = self._optionalInt3263 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 63) + } }() + try { if let v = self._optionalInt3264 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 64) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestVerifyOneUint32, rhs: ProtobufUnittest_TestVerifyOneUint32) -> Bool { + if lhs._optionalUint321 != rhs._optionalUint321 {return false} + if lhs._optionalInt322 != rhs._optionalInt322 {return false} + if lhs._optionalInt3263 != rhs._optionalInt3263 {return false} + if lhs._optionalInt3264 != rhs._optionalInt3264 {return false} + if lhs._optionalAllTypes != rhs._optionalAllTypes {return false} + if lhs.repeatedAllTypes != rhs.repeatedAllTypes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestVerifyOneInt32BigFieldNumber: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestVerifyOneInt32BigFieldNumber" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 65: .standard(proto: "optional_int32_65"), + 1: .standard(proto: "optional_int64_1"), + 2: .standard(proto: "optional_int64_2"), + 63: .standard(proto: "optional_int64_63"), + 64: .standard(proto: "optional_int64_64"), + 9: .standard(proto: "optional_all_types"), + 10: .standard(proto: "repeated_all_types"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self._optionalInt641) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self._optionalInt642) }() + case 9: try { try decoder.decodeSingularMessageField(value: &self._optionalAllTypes) }() + case 10: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedAllTypes) }() + case 63: try { try decoder.decodeSingularInt64Field(value: &self._optionalInt6463) }() + case 64: try { try decoder.decodeSingularInt64Field(value: &self._optionalInt6464) }() + case 65: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt3265) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalInt641 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalInt642 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._optionalAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + if !self.repeatedAllTypes.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedAllTypes, fieldNumber: 10) + } + try { if let v = self._optionalInt6463 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 63) + } }() + try { if let v = self._optionalInt6464 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 64) + } }() + try { if let v = self._optionalInt3265 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 65) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestVerifyOneInt32BigFieldNumber, rhs: ProtobufUnittest_TestVerifyOneInt32BigFieldNumber) -> Bool { + if lhs._optionalInt3265 != rhs._optionalInt3265 {return false} + if lhs._optionalInt641 != rhs._optionalInt641 {return false} + if lhs._optionalInt642 != rhs._optionalInt642 {return false} + if lhs._optionalInt6463 != rhs._optionalInt6463 {return false} + if lhs._optionalInt6464 != rhs._optionalInt6464 {return false} + if lhs._optionalAllTypes != rhs._optionalAllTypes {return false} + if lhs.repeatedAllTypes != rhs.repeatedAllTypes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestVerifyInt32BigFieldNumber: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestVerifyInt32BigFieldNumber" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1000: .standard(proto: "optional_int32_1000"), + 65: .standard(proto: "optional_int32_65"), + 1: .standard(proto: "optional_int32_1"), + 2: .standard(proto: "optional_int32_2"), + 63: .standard(proto: "optional_int32_63"), + 64: .standard(proto: "optional_int32_64"), + 9: .standard(proto: "optional_all_types"), + 10: .standard(proto: "repeated_all_types"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt321) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt322) }() + case 9: try { try decoder.decodeSingularMessageField(value: &self._optionalAllTypes) }() + case 10: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedAllTypes) }() + case 63: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt3263) }() + case 64: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt3264) }() + case 65: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt3265) }() + case 1000: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt321000) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalInt321 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalInt322 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._optionalAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + if !self.repeatedAllTypes.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedAllTypes, fieldNumber: 10) + } + try { if let v = self._optionalInt3263 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 63) + } }() + try { if let v = self._optionalInt3264 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 64) + } }() + try { if let v = self._optionalInt3265 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 65) + } }() + try { if let v = self._optionalInt321000 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1000) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestVerifyInt32BigFieldNumber, rhs: ProtobufUnittest_TestVerifyInt32BigFieldNumber) -> Bool { + if lhs._optionalInt321000 != rhs._optionalInt321000 {return false} + if lhs._optionalInt3265 != rhs._optionalInt3265 {return false} + if lhs._optionalInt321 != rhs._optionalInt321 {return false} + if lhs._optionalInt322 != rhs._optionalInt322 {return false} + if lhs._optionalInt3263 != rhs._optionalInt3263 {return false} + if lhs._optionalInt3264 != rhs._optionalInt3264 {return false} + if lhs._optionalAllTypes != rhs._optionalAllTypes {return false} + if lhs.repeatedAllTypes != rhs.repeatedAllTypes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestVerifyUint32BigFieldNumber: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestVerifyUint32BigFieldNumber" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1000: .standard(proto: "optional_uint32_1000"), + 65: .standard(proto: "optional_uint32_65"), + 1: .standard(proto: "optional_uint32_1"), + 2: .standard(proto: "optional_uint32_2"), + 63: .standard(proto: "optional_uint32_63"), + 64: .standard(proto: "optional_uint32_64"), + 9: .standard(proto: "optional_all_types"), + 10: .standard(proto: "repeated_all_types"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt32Field(value: &self._optionalUint321) }() + case 2: try { try decoder.decodeSingularUInt32Field(value: &self._optionalUint322) }() + case 9: try { try decoder.decodeSingularMessageField(value: &self._optionalAllTypes) }() + case 10: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedAllTypes) }() + case 63: try { try decoder.decodeSingularUInt32Field(value: &self._optionalUint3263) }() + case 64: try { try decoder.decodeSingularUInt32Field(value: &self._optionalUint3264) }() + case 65: try { try decoder.decodeSingularUInt32Field(value: &self._optionalUint3265) }() + case 1000: try { try decoder.decodeSingularUInt32Field(value: &self._optionalUint321000) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalUint321 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalUint322 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._optionalAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + if !self.repeatedAllTypes.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedAllTypes, fieldNumber: 10) + } + try { if let v = self._optionalUint3263 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 63) + } }() + try { if let v = self._optionalUint3264 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 64) + } }() + try { if let v = self._optionalUint3265 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 65) + } }() + try { if let v = self._optionalUint321000 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 1000) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestVerifyUint32BigFieldNumber, rhs: ProtobufUnittest_TestVerifyUint32BigFieldNumber) -> Bool { + if lhs._optionalUint321000 != rhs._optionalUint321000 {return false} + if lhs._optionalUint3265 != rhs._optionalUint3265 {return false} + if lhs._optionalUint321 != rhs._optionalUint321 {return false} + if lhs._optionalUint322 != rhs._optionalUint322 {return false} + if lhs._optionalUint3263 != rhs._optionalUint3263 {return false} + if lhs._optionalUint3264 != rhs._optionalUint3264 {return false} + if lhs._optionalAllTypes != rhs._optionalAllTypes {return false} + if lhs.repeatedAllTypes != rhs.repeatedAllTypes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestVerifyBigFieldNumberUint32: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestVerifyBigFieldNumberUint32" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_nested"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._optionalNested) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalNested { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestVerifyBigFieldNumberUint32, rhs: ProtobufUnittest_TestVerifyBigFieldNumberUint32) -> Bool { + if lhs._optionalNested != rhs._optionalNested {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestVerifyBigFieldNumberUint32.Nested: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestVerifyBigFieldNumberUint32.protoMessageName + ".Nested" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 5000: .standard(proto: "optional_uint32_5000"), + 1000: .standard(proto: "optional_uint32_1000"), + 66: .standard(proto: "optional_uint32_66"), + 65: .standard(proto: "optional_uint32_65"), + 1: .standard(proto: "optional_uint32_1"), + 2: .standard(proto: "optional_uint32_2"), + 63: .standard(proto: "optional_uint32_63"), + 64: .standard(proto: "optional_uint32_64"), + 9: .standard(proto: "optional_nested"), + 10: .standard(proto: "repeated_nested"), + ] + + fileprivate class _StorageClass { + var _optionalUint325000: UInt32? = nil + var _optionalUint321000: UInt32? = nil + var _optionalUint3266: UInt32? = nil + var _optionalUint3265: UInt32? = nil + var _optionalUint321: UInt32? = nil + var _optionalUint322: UInt32? = nil + var _optionalUint3263: UInt32? = nil + var _optionalUint3264: UInt32? = nil + var _optionalNested: ProtobufUnittest_TestVerifyBigFieldNumberUint32.Nested? = nil + var _repeatedNested: [ProtobufUnittest_TestVerifyBigFieldNumberUint32.Nested] = [] + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _optionalUint325000 = source._optionalUint325000 + _optionalUint321000 = source._optionalUint321000 + _optionalUint3266 = source._optionalUint3266 + _optionalUint3265 = source._optionalUint3265 + _optionalUint321 = source._optionalUint321 + _optionalUint322 = source._optionalUint322 + _optionalUint3263 = source._optionalUint3263 + _optionalUint3264 = source._optionalUint3264 + _optionalNested = source._optionalNested + _repeatedNested = source._repeatedNested + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint321) }() + case 2: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint322) }() + case 9: try { try decoder.decodeSingularMessageField(value: &_storage._optionalNested) }() + case 10: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedNested) }() + case 63: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint3263) }() + case 64: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint3264) }() + case 65: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint3265) }() + case 66: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint3266) }() + case 1000: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint321000) }() + case 5000: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint325000) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._optionalUint321 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._optionalUint322 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._optionalNested { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + if !_storage._repeatedNested.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedNested, fieldNumber: 10) + } + try { if let v = _storage._optionalUint3263 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 63) + } }() + try { if let v = _storage._optionalUint3264 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 64) + } }() + try { if let v = _storage._optionalUint3265 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 65) + } }() + try { if let v = _storage._optionalUint3266 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 66) + } }() + try { if let v = _storage._optionalUint321000 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 1000) + } }() + try { if let v = _storage._optionalUint325000 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 5000) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestVerifyBigFieldNumberUint32.Nested, rhs: ProtobufUnittest_TestVerifyBigFieldNumberUint32.Nested) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._optionalUint325000 != rhs_storage._optionalUint325000 {return false} + if _storage._optionalUint321000 != rhs_storage._optionalUint321000 {return false} + if _storage._optionalUint3266 != rhs_storage._optionalUint3266 {return false} + if _storage._optionalUint3265 != rhs_storage._optionalUint3265 {return false} + if _storage._optionalUint321 != rhs_storage._optionalUint321 {return false} + if _storage._optionalUint322 != rhs_storage._optionalUint322 {return false} + if _storage._optionalUint3263 != rhs_storage._optionalUint3263 {return false} + if _storage._optionalUint3264 != rhs_storage._optionalUint3264 {return false} + if _storage._optionalNested != rhs_storage._optionalNested {return false} + if _storage._repeatedNested != rhs_storage._repeatedNested {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_EnumParseTester: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".EnumParseTester" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_seq_small_0_lowfield"), + 1001: .standard(proto: "optional_seq_small_0_midfield"), + 1000001: .standard(proto: "optional_seq_small_0_hifield"), + 2: .standard(proto: "repeated_seq_small_0_lowfield"), + 1002: .standard(proto: "repeated_seq_small_0_midfield"), + 1000002: .standard(proto: "repeated_seq_small_0_hifield"), + 3: .standard(proto: "packed_seq_small_0_lowfield"), + 1003: .standard(proto: "packed_seq_small_0_midfield"), + 1000003: .standard(proto: "packed_seq_small_0_hifield"), + 4: .standard(proto: "optional_seq_small_1_lowfield"), + 1004: .standard(proto: "optional_seq_small_1_midfield"), + 1000004: .standard(proto: "optional_seq_small_1_hifield"), + 5: .standard(proto: "repeated_seq_small_1_lowfield"), + 1005: .standard(proto: "repeated_seq_small_1_midfield"), + 1000005: .standard(proto: "repeated_seq_small_1_hifield"), + 6: .standard(proto: "packed_seq_small_1_lowfield"), + 1006: .standard(proto: "packed_seq_small_1_midfield"), + 1000006: .standard(proto: "packed_seq_small_1_hifield"), + 7: .standard(proto: "optional_seq_large_lowfield"), + 1007: .standard(proto: "optional_seq_large_midfield"), + 1000007: .standard(proto: "optional_seq_large_hifield"), + 8: .standard(proto: "repeated_seq_large_lowfield"), + 1008: .standard(proto: "repeated_seq_large_midfield"), + 1000008: .standard(proto: "repeated_seq_large_hifield"), + 9: .standard(proto: "packed_seq_large_lowfield"), + 1009: .standard(proto: "packed_seq_large_midfield"), + 1000009: .standard(proto: "packed_seq_large_hifield"), + 10: .standard(proto: "optional_arbitrary_lowfield"), + 1010: .standard(proto: "optional_arbitrary_midfield"), + 1000010: .standard(proto: "optional_arbitrary_hifield"), + 11: .standard(proto: "repeated_arbitrary_lowfield"), + 1011: .standard(proto: "repeated_arbitrary_midfield"), + 1000011: .standard(proto: "repeated_arbitrary_hifield"), + 12: .standard(proto: "packed_arbitrary_lowfield"), + 1012: .standard(proto: "packed_arbitrary_midfield"), + 1000012: .standard(proto: "packed_arbitrary_hifield"), + 99: .standard(proto: "other_field"), + ] + + fileprivate class _StorageClass { + var _optionalSeqSmall0Lowfield: ProtobufUnittest_EnumParseTester.SeqSmall0? = nil + var _optionalSeqSmall0Midfield: ProtobufUnittest_EnumParseTester.SeqSmall0? = nil + var _optionalSeqSmall0Hifield: ProtobufUnittest_EnumParseTester.SeqSmall0? = nil + var _repeatedSeqSmall0Lowfield: [ProtobufUnittest_EnumParseTester.SeqSmall0] = [] + var _repeatedSeqSmall0Midfield: [ProtobufUnittest_EnumParseTester.SeqSmall0] = [] + var _repeatedSeqSmall0Hifield: [ProtobufUnittest_EnumParseTester.SeqSmall0] = [] + var _packedSeqSmall0Lowfield: [ProtobufUnittest_EnumParseTester.SeqSmall0] = [] + var _packedSeqSmall0Midfield: [ProtobufUnittest_EnumParseTester.SeqSmall0] = [] + var _packedSeqSmall0Hifield: [ProtobufUnittest_EnumParseTester.SeqSmall0] = [] + var _optionalSeqSmall1Lowfield: ProtobufUnittest_EnumParseTester.SeqSmall1? = nil + var _optionalSeqSmall1Midfield: ProtobufUnittest_EnumParseTester.SeqSmall1? = nil + var _optionalSeqSmall1Hifield: ProtobufUnittest_EnumParseTester.SeqSmall1? = nil + var _repeatedSeqSmall1Lowfield: [ProtobufUnittest_EnumParseTester.SeqSmall1] = [] + var _repeatedSeqSmall1Midfield: [ProtobufUnittest_EnumParseTester.SeqSmall1] = [] + var _repeatedSeqSmall1Hifield: [ProtobufUnittest_EnumParseTester.SeqSmall1] = [] + var _packedSeqSmall1Lowfield: [ProtobufUnittest_EnumParseTester.SeqSmall1] = [] + var _packedSeqSmall1Midfield: [ProtobufUnittest_EnumParseTester.SeqSmall1] = [] + var _packedSeqSmall1Hifield: [ProtobufUnittest_EnumParseTester.SeqSmall1] = [] + var _optionalSeqLargeLowfield: ProtobufUnittest_EnumParseTester.SeqLarge? = nil + var _optionalSeqLargeMidfield: ProtobufUnittest_EnumParseTester.SeqLarge? = nil + var _optionalSeqLargeHifield: ProtobufUnittest_EnumParseTester.SeqLarge? = nil + var _repeatedSeqLargeLowfield: [ProtobufUnittest_EnumParseTester.SeqLarge] = [] + var _repeatedSeqLargeMidfield: [ProtobufUnittest_EnumParseTester.SeqLarge] = [] + var _repeatedSeqLargeHifield: [ProtobufUnittest_EnumParseTester.SeqLarge] = [] + var _packedSeqLargeLowfield: [ProtobufUnittest_EnumParseTester.SeqLarge] = [] + var _packedSeqLargeMidfield: [ProtobufUnittest_EnumParseTester.SeqLarge] = [] + var _packedSeqLargeHifield: [ProtobufUnittest_EnumParseTester.SeqLarge] = [] + var _optionalArbitraryLowfield: ProtobufUnittest_EnumParseTester.Arbitrary? = nil + var _optionalArbitraryMidfield: ProtobufUnittest_EnumParseTester.Arbitrary? = nil + var _optionalArbitraryHifield: ProtobufUnittest_EnumParseTester.Arbitrary? = nil + var _repeatedArbitraryLowfield: [ProtobufUnittest_EnumParseTester.Arbitrary] = [] + var _repeatedArbitraryMidfield: [ProtobufUnittest_EnumParseTester.Arbitrary] = [] + var _repeatedArbitraryHifield: [ProtobufUnittest_EnumParseTester.Arbitrary] = [] + var _packedArbitraryLowfield: [ProtobufUnittest_EnumParseTester.Arbitrary] = [] + var _packedArbitraryMidfield: [ProtobufUnittest_EnumParseTester.Arbitrary] = [] + var _packedArbitraryHifield: [ProtobufUnittest_EnumParseTester.Arbitrary] = [] + var _otherField: Int32? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _optionalSeqSmall0Lowfield = source._optionalSeqSmall0Lowfield + _optionalSeqSmall0Midfield = source._optionalSeqSmall0Midfield + _optionalSeqSmall0Hifield = source._optionalSeqSmall0Hifield + _repeatedSeqSmall0Lowfield = source._repeatedSeqSmall0Lowfield + _repeatedSeqSmall0Midfield = source._repeatedSeqSmall0Midfield + _repeatedSeqSmall0Hifield = source._repeatedSeqSmall0Hifield + _packedSeqSmall0Lowfield = source._packedSeqSmall0Lowfield + _packedSeqSmall0Midfield = source._packedSeqSmall0Midfield + _packedSeqSmall0Hifield = source._packedSeqSmall0Hifield + _optionalSeqSmall1Lowfield = source._optionalSeqSmall1Lowfield + _optionalSeqSmall1Midfield = source._optionalSeqSmall1Midfield + _optionalSeqSmall1Hifield = source._optionalSeqSmall1Hifield + _repeatedSeqSmall1Lowfield = source._repeatedSeqSmall1Lowfield + _repeatedSeqSmall1Midfield = source._repeatedSeqSmall1Midfield + _repeatedSeqSmall1Hifield = source._repeatedSeqSmall1Hifield + _packedSeqSmall1Lowfield = source._packedSeqSmall1Lowfield + _packedSeqSmall1Midfield = source._packedSeqSmall1Midfield + _packedSeqSmall1Hifield = source._packedSeqSmall1Hifield + _optionalSeqLargeLowfield = source._optionalSeqLargeLowfield + _optionalSeqLargeMidfield = source._optionalSeqLargeMidfield + _optionalSeqLargeHifield = source._optionalSeqLargeHifield + _repeatedSeqLargeLowfield = source._repeatedSeqLargeLowfield + _repeatedSeqLargeMidfield = source._repeatedSeqLargeMidfield + _repeatedSeqLargeHifield = source._repeatedSeqLargeHifield + _packedSeqLargeLowfield = source._packedSeqLargeLowfield + _packedSeqLargeMidfield = source._packedSeqLargeMidfield + _packedSeqLargeHifield = source._packedSeqLargeHifield + _optionalArbitraryLowfield = source._optionalArbitraryLowfield + _optionalArbitraryMidfield = source._optionalArbitraryMidfield + _optionalArbitraryHifield = source._optionalArbitraryHifield + _repeatedArbitraryLowfield = source._repeatedArbitraryLowfield + _repeatedArbitraryMidfield = source._repeatedArbitraryMidfield + _repeatedArbitraryHifield = source._repeatedArbitraryHifield + _packedArbitraryLowfield = source._packedArbitraryLowfield + _packedArbitraryMidfield = source._packedArbitraryMidfield + _packedArbitraryHifield = source._packedArbitraryHifield + _otherField = source._otherField + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &_storage._optionalSeqSmall0Lowfield) }() + case 2: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedSeqSmall0Lowfield) }() + case 3: try { try decoder.decodeRepeatedEnumField(value: &_storage._packedSeqSmall0Lowfield) }() + case 4: try { try decoder.decodeSingularEnumField(value: &_storage._optionalSeqSmall1Lowfield) }() + case 5: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedSeqSmall1Lowfield) }() + case 6: try { try decoder.decodeRepeatedEnumField(value: &_storage._packedSeqSmall1Lowfield) }() + case 7: try { try decoder.decodeSingularEnumField(value: &_storage._optionalSeqLargeLowfield) }() + case 8: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedSeqLargeLowfield) }() + case 9: try { try decoder.decodeRepeatedEnumField(value: &_storage._packedSeqLargeLowfield) }() + case 10: try { try decoder.decodeSingularEnumField(value: &_storage._optionalArbitraryLowfield) }() + case 11: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedArbitraryLowfield) }() + case 12: try { try decoder.decodeRepeatedEnumField(value: &_storage._packedArbitraryLowfield) }() + case 99: try { try decoder.decodeSingularInt32Field(value: &_storage._otherField) }() + case 1001: try { try decoder.decodeSingularEnumField(value: &_storage._optionalSeqSmall0Midfield) }() + case 1002: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedSeqSmall0Midfield) }() + case 1003: try { try decoder.decodeRepeatedEnumField(value: &_storage._packedSeqSmall0Midfield) }() + case 1004: try { try decoder.decodeSingularEnumField(value: &_storage._optionalSeqSmall1Midfield) }() + case 1005: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedSeqSmall1Midfield) }() + case 1006: try { try decoder.decodeRepeatedEnumField(value: &_storage._packedSeqSmall1Midfield) }() + case 1007: try { try decoder.decodeSingularEnumField(value: &_storage._optionalSeqLargeMidfield) }() + case 1008: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedSeqLargeMidfield) }() + case 1009: try { try decoder.decodeRepeatedEnumField(value: &_storage._packedSeqLargeMidfield) }() + case 1010: try { try decoder.decodeSingularEnumField(value: &_storage._optionalArbitraryMidfield) }() + case 1011: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedArbitraryMidfield) }() + case 1012: try { try decoder.decodeRepeatedEnumField(value: &_storage._packedArbitraryMidfield) }() + case 1000001: try { try decoder.decodeSingularEnumField(value: &_storage._optionalSeqSmall0Hifield) }() + case 1000002: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedSeqSmall0Hifield) }() + case 1000003: try { try decoder.decodeRepeatedEnumField(value: &_storage._packedSeqSmall0Hifield) }() + case 1000004: try { try decoder.decodeSingularEnumField(value: &_storage._optionalSeqSmall1Hifield) }() + case 1000005: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedSeqSmall1Hifield) }() + case 1000006: try { try decoder.decodeRepeatedEnumField(value: &_storage._packedSeqSmall1Hifield) }() + case 1000007: try { try decoder.decodeSingularEnumField(value: &_storage._optionalSeqLargeHifield) }() + case 1000008: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedSeqLargeHifield) }() + case 1000009: try { try decoder.decodeRepeatedEnumField(value: &_storage._packedSeqLargeHifield) }() + case 1000010: try { try decoder.decodeSingularEnumField(value: &_storage._optionalArbitraryHifield) }() + case 1000011: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedArbitraryHifield) }() + case 1000012: try { try decoder.decodeRepeatedEnumField(value: &_storage._packedArbitraryHifield) }() + case 2000000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_EnumParseTester.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._optionalSeqSmall0Lowfield { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1) + } }() + if !_storage._repeatedSeqSmall0Lowfield.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedSeqSmall0Lowfield, fieldNumber: 2) + } + if !_storage._packedSeqSmall0Lowfield.isEmpty { + try visitor.visitPackedEnumField(value: _storage._packedSeqSmall0Lowfield, fieldNumber: 3) + } + try { if let v = _storage._optionalSeqSmall1Lowfield { + try visitor.visitSingularEnumField(value: v, fieldNumber: 4) + } }() + if !_storage._repeatedSeqSmall1Lowfield.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedSeqSmall1Lowfield, fieldNumber: 5) + } + if !_storage._packedSeqSmall1Lowfield.isEmpty { + try visitor.visitPackedEnumField(value: _storage._packedSeqSmall1Lowfield, fieldNumber: 6) + } + try { if let v = _storage._optionalSeqLargeLowfield { + try visitor.visitSingularEnumField(value: v, fieldNumber: 7) + } }() + if !_storage._repeatedSeqLargeLowfield.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedSeqLargeLowfield, fieldNumber: 8) + } + if !_storage._packedSeqLargeLowfield.isEmpty { + try visitor.visitPackedEnumField(value: _storage._packedSeqLargeLowfield, fieldNumber: 9) + } + try { if let v = _storage._optionalArbitraryLowfield { + try visitor.visitSingularEnumField(value: v, fieldNumber: 10) + } }() + if !_storage._repeatedArbitraryLowfield.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedArbitraryLowfield, fieldNumber: 11) + } + if !_storage._packedArbitraryLowfield.isEmpty { + try visitor.visitPackedEnumField(value: _storage._packedArbitraryLowfield, fieldNumber: 12) + } + try { if let v = _storage._otherField { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 99) + } }() + try { if let v = _storage._optionalSeqSmall0Midfield { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1001) + } }() + if !_storage._repeatedSeqSmall0Midfield.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedSeqSmall0Midfield, fieldNumber: 1002) + } + if !_storage._packedSeqSmall0Midfield.isEmpty { + try visitor.visitPackedEnumField(value: _storage._packedSeqSmall0Midfield, fieldNumber: 1003) + } + try { if let v = _storage._optionalSeqSmall1Midfield { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1004) + } }() + if !_storage._repeatedSeqSmall1Midfield.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedSeqSmall1Midfield, fieldNumber: 1005) + } + if !_storage._packedSeqSmall1Midfield.isEmpty { + try visitor.visitPackedEnumField(value: _storage._packedSeqSmall1Midfield, fieldNumber: 1006) + } + try { if let v = _storage._optionalSeqLargeMidfield { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1007) + } }() + if !_storage._repeatedSeqLargeMidfield.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedSeqLargeMidfield, fieldNumber: 1008) + } + if !_storage._packedSeqLargeMidfield.isEmpty { + try visitor.visitPackedEnumField(value: _storage._packedSeqLargeMidfield, fieldNumber: 1009) + } + try { if let v = _storage._optionalArbitraryMidfield { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1010) + } }() + if !_storage._repeatedArbitraryMidfield.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedArbitraryMidfield, fieldNumber: 1011) + } + if !_storage._packedArbitraryMidfield.isEmpty { + try visitor.visitPackedEnumField(value: _storage._packedArbitraryMidfield, fieldNumber: 1012) + } + try { if let v = _storage._optionalSeqSmall0Hifield { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1000001) + } }() + if !_storage._repeatedSeqSmall0Hifield.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedSeqSmall0Hifield, fieldNumber: 1000002) + } + if !_storage._packedSeqSmall0Hifield.isEmpty { + try visitor.visitPackedEnumField(value: _storage._packedSeqSmall0Hifield, fieldNumber: 1000003) + } + try { if let v = _storage._optionalSeqSmall1Hifield { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1000004) + } }() + if !_storage._repeatedSeqSmall1Hifield.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedSeqSmall1Hifield, fieldNumber: 1000005) + } + if !_storage._packedSeqSmall1Hifield.isEmpty { + try visitor.visitPackedEnumField(value: _storage._packedSeqSmall1Hifield, fieldNumber: 1000006) + } + try { if let v = _storage._optionalSeqLargeHifield { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1000007) + } }() + if !_storage._repeatedSeqLargeHifield.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedSeqLargeHifield, fieldNumber: 1000008) + } + if !_storage._packedSeqLargeHifield.isEmpty { + try visitor.visitPackedEnumField(value: _storage._packedSeqLargeHifield, fieldNumber: 1000009) + } + try { if let v = _storage._optionalArbitraryHifield { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1000010) + } }() + if !_storage._repeatedArbitraryHifield.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedArbitraryHifield, fieldNumber: 1000011) + } + if !_storage._packedArbitraryHifield.isEmpty { + try visitor.visitPackedEnumField(value: _storage._packedArbitraryHifield, fieldNumber: 1000012) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 2000000, end: 536870912) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_EnumParseTester, rhs: ProtobufUnittest_EnumParseTester) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._optionalSeqSmall0Lowfield != rhs_storage._optionalSeqSmall0Lowfield {return false} + if _storage._optionalSeqSmall0Midfield != rhs_storage._optionalSeqSmall0Midfield {return false} + if _storage._optionalSeqSmall0Hifield != rhs_storage._optionalSeqSmall0Hifield {return false} + if _storage._repeatedSeqSmall0Lowfield != rhs_storage._repeatedSeqSmall0Lowfield {return false} + if _storage._repeatedSeqSmall0Midfield != rhs_storage._repeatedSeqSmall0Midfield {return false} + if _storage._repeatedSeqSmall0Hifield != rhs_storage._repeatedSeqSmall0Hifield {return false} + if _storage._packedSeqSmall0Lowfield != rhs_storage._packedSeqSmall0Lowfield {return false} + if _storage._packedSeqSmall0Midfield != rhs_storage._packedSeqSmall0Midfield {return false} + if _storage._packedSeqSmall0Hifield != rhs_storage._packedSeqSmall0Hifield {return false} + if _storage._optionalSeqSmall1Lowfield != rhs_storage._optionalSeqSmall1Lowfield {return false} + if _storage._optionalSeqSmall1Midfield != rhs_storage._optionalSeqSmall1Midfield {return false} + if _storage._optionalSeqSmall1Hifield != rhs_storage._optionalSeqSmall1Hifield {return false} + if _storage._repeatedSeqSmall1Lowfield != rhs_storage._repeatedSeqSmall1Lowfield {return false} + if _storage._repeatedSeqSmall1Midfield != rhs_storage._repeatedSeqSmall1Midfield {return false} + if _storage._repeatedSeqSmall1Hifield != rhs_storage._repeatedSeqSmall1Hifield {return false} + if _storage._packedSeqSmall1Lowfield != rhs_storage._packedSeqSmall1Lowfield {return false} + if _storage._packedSeqSmall1Midfield != rhs_storage._packedSeqSmall1Midfield {return false} + if _storage._packedSeqSmall1Hifield != rhs_storage._packedSeqSmall1Hifield {return false} + if _storage._optionalSeqLargeLowfield != rhs_storage._optionalSeqLargeLowfield {return false} + if _storage._optionalSeqLargeMidfield != rhs_storage._optionalSeqLargeMidfield {return false} + if _storage._optionalSeqLargeHifield != rhs_storage._optionalSeqLargeHifield {return false} + if _storage._repeatedSeqLargeLowfield != rhs_storage._repeatedSeqLargeLowfield {return false} + if _storage._repeatedSeqLargeMidfield != rhs_storage._repeatedSeqLargeMidfield {return false} + if _storage._repeatedSeqLargeHifield != rhs_storage._repeatedSeqLargeHifield {return false} + if _storage._packedSeqLargeLowfield != rhs_storage._packedSeqLargeLowfield {return false} + if _storage._packedSeqLargeMidfield != rhs_storage._packedSeqLargeMidfield {return false} + if _storage._packedSeqLargeHifield != rhs_storage._packedSeqLargeHifield {return false} + if _storage._optionalArbitraryLowfield != rhs_storage._optionalArbitraryLowfield {return false} + if _storage._optionalArbitraryMidfield != rhs_storage._optionalArbitraryMidfield {return false} + if _storage._optionalArbitraryHifield != rhs_storage._optionalArbitraryHifield {return false} + if _storage._repeatedArbitraryLowfield != rhs_storage._repeatedArbitraryLowfield {return false} + if _storage._repeatedArbitraryMidfield != rhs_storage._repeatedArbitraryMidfield {return false} + if _storage._repeatedArbitraryHifield != rhs_storage._repeatedArbitraryHifield {return false} + if _storage._packedArbitraryLowfield != rhs_storage._packedArbitraryLowfield {return false} + if _storage._packedArbitraryMidfield != rhs_storage._packedArbitraryMidfield {return false} + if _storage._packedArbitraryHifield != rhs_storage._packedArbitraryHifield {return false} + if _storage._otherField != rhs_storage._otherField {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_EnumParseTester.SeqSmall0: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "SEQ_SMALL_0_DEFAULT"), + 1: .same(proto: "SEQ_SMALL_0_1"), + 2: .same(proto: "SEQ_SMALL_0_2"), + ] +} + +extension ProtobufUnittest_EnumParseTester.SeqSmall1: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "SEQ_SMALL_1_DEFAULT"), + 2: .same(proto: "SEQ_SMALL_1_2"), + 3: .same(proto: "SEQ_SMALL_1_3"), + ] +} + +extension ProtobufUnittest_EnumParseTester.SeqLarge: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + -1: .same(proto: "SEQ_LARGE_DEFAULT"), + 0: .same(proto: "SEQ_LARGE_0"), + 1: .same(proto: "SEQ_LARGE_1"), + 2: .same(proto: "SEQ_LARGE_2"), + 3: .same(proto: "SEQ_LARGE_3"), + 4: .same(proto: "SEQ_LARGE_4"), + 5: .same(proto: "SEQ_LARGE_5"), + 6: .same(proto: "SEQ_LARGE_6"), + 7: .same(proto: "SEQ_LARGE_7"), + 8: .same(proto: "SEQ_LARGE_8"), + 9: .same(proto: "SEQ_LARGE_9"), + 10: .same(proto: "SEQ_LARGE_10"), + 11: .same(proto: "SEQ_LARGE_11"), + 12: .same(proto: "SEQ_LARGE_12"), + 13: .same(proto: "SEQ_LARGE_13"), + 14: .same(proto: "SEQ_LARGE_14"), + 15: .same(proto: "SEQ_LARGE_15"), + 16: .same(proto: "SEQ_LARGE_16"), + 17: .same(proto: "SEQ_LARGE_17"), + 18: .same(proto: "SEQ_LARGE_18"), + 19: .same(proto: "SEQ_LARGE_19"), + 20: .same(proto: "SEQ_LARGE_20"), + 21: .same(proto: "SEQ_LARGE_21"), + 22: .same(proto: "SEQ_LARGE_22"), + 23: .same(proto: "SEQ_LARGE_23"), + 24: .same(proto: "SEQ_LARGE_24"), + 25: .same(proto: "SEQ_LARGE_25"), + 26: .same(proto: "SEQ_LARGE_26"), + 27: .same(proto: "SEQ_LARGE_27"), + 28: .same(proto: "SEQ_LARGE_28"), + 29: .same(proto: "SEQ_LARGE_29"), + 30: .same(proto: "SEQ_LARGE_30"), + 31: .same(proto: "SEQ_LARGE_31"), + 32: .same(proto: "SEQ_LARGE_32"), + 33: .same(proto: "SEQ_LARGE_33"), + ] +} + +extension ProtobufUnittest_EnumParseTester.Arbitrary: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + -2147483648: .same(proto: "ARBITRARY_MIN"), + -123123: .same(proto: "ARBITRARY_DEFAULT"), + -123: .same(proto: "ARBITRARY_1"), + 213: .same(proto: "ARBITRARY_2"), + 213213: .same(proto: "ARBITRARY_3"), + 2147483647: .same(proto: "ARBITRARY_MAX"), + ] +} + +extension ProtobufUnittest_BoolParseTester: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".BoolParseTester" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_bool_lowfield"), + 1001: .standard(proto: "optional_bool_midfield"), + 1000001: .standard(proto: "optional_bool_hifield"), + 2: .standard(proto: "repeated_bool_lowfield"), + 1002: .standard(proto: "repeated_bool_midfield"), + 1000002: .standard(proto: "repeated_bool_hifield"), + 3: .standard(proto: "packed_bool_lowfield"), + 1003: .standard(proto: "packed_bool_midfield"), + 1000003: .standard(proto: "packed_bool_hifield"), + 99: .standard(proto: "other_field"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self._optionalBoolLowfield) }() + case 2: try { try decoder.decodeRepeatedBoolField(value: &self.repeatedBoolLowfield) }() + case 3: try { try decoder.decodeRepeatedBoolField(value: &self.packedBoolLowfield) }() + case 99: try { try decoder.decodeSingularInt32Field(value: &self._otherField) }() + case 1001: try { try decoder.decodeSingularBoolField(value: &self._optionalBoolMidfield) }() + case 1002: try { try decoder.decodeRepeatedBoolField(value: &self.repeatedBoolMidfield) }() + case 1003: try { try decoder.decodeRepeatedBoolField(value: &self.packedBoolMidfield) }() + case 1000001: try { try decoder.decodeSingularBoolField(value: &self._optionalBoolHifield) }() + case 1000002: try { try decoder.decodeRepeatedBoolField(value: &self.repeatedBoolHifield) }() + case 1000003: try { try decoder.decodeRepeatedBoolField(value: &self.packedBoolHifield) }() + case 2000000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_BoolParseTester.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalBoolLowfield { + try visitor.visitSingularBoolField(value: v, fieldNumber: 1) + } }() + if !self.repeatedBoolLowfield.isEmpty { + try visitor.visitRepeatedBoolField(value: self.repeatedBoolLowfield, fieldNumber: 2) + } + if !self.packedBoolLowfield.isEmpty { + try visitor.visitPackedBoolField(value: self.packedBoolLowfield, fieldNumber: 3) + } + try { if let v = self._otherField { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 99) + } }() + try { if let v = self._optionalBoolMidfield { + try visitor.visitSingularBoolField(value: v, fieldNumber: 1001) + } }() + if !self.repeatedBoolMidfield.isEmpty { + try visitor.visitRepeatedBoolField(value: self.repeatedBoolMidfield, fieldNumber: 1002) + } + if !self.packedBoolMidfield.isEmpty { + try visitor.visitPackedBoolField(value: self.packedBoolMidfield, fieldNumber: 1003) + } + try { if let v = self._optionalBoolHifield { + try visitor.visitSingularBoolField(value: v, fieldNumber: 1000001) + } }() + if !self.repeatedBoolHifield.isEmpty { + try visitor.visitRepeatedBoolField(value: self.repeatedBoolHifield, fieldNumber: 1000002) + } + if !self.packedBoolHifield.isEmpty { + try visitor.visitPackedBoolField(value: self.packedBoolHifield, fieldNumber: 1000003) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 2000000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_BoolParseTester, rhs: ProtobufUnittest_BoolParseTester) -> Bool { + if lhs._optionalBoolLowfield != rhs._optionalBoolLowfield {return false} + if lhs._optionalBoolMidfield != rhs._optionalBoolMidfield {return false} + if lhs._optionalBoolHifield != rhs._optionalBoolHifield {return false} + if lhs.repeatedBoolLowfield != rhs.repeatedBoolLowfield {return false} + if lhs.repeatedBoolMidfield != rhs.repeatedBoolMidfield {return false} + if lhs.repeatedBoolHifield != rhs.repeatedBoolHifield {return false} + if lhs.packedBoolLowfield != rhs.packedBoolLowfield {return false} + if lhs.packedBoolMidfield != rhs.packedBoolMidfield {return false} + if lhs.packedBoolHifield != rhs.packedBoolHifield {return false} + if lhs._otherField != rhs._otherField {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_Int32ParseTester: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Int32ParseTester" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_int32_lowfield"), + 1001: .standard(proto: "optional_int32_midfield"), + 1000001: .standard(proto: "optional_int32_hifield"), + 2: .standard(proto: "repeated_int32_lowfield"), + 1002: .standard(proto: "repeated_int32_midfield"), + 1000002: .standard(proto: "repeated_int32_hifield"), + 3: .standard(proto: "packed_int32_lowfield"), + 1003: .standard(proto: "packed_int32_midfield"), + 1000003: .standard(proto: "packed_int32_hifield"), + 99: .standard(proto: "other_field"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt32Lowfield) }() + case 2: try { try decoder.decodeRepeatedInt32Field(value: &self.repeatedInt32Lowfield) }() + case 3: try { try decoder.decodeRepeatedInt32Field(value: &self.packedInt32Lowfield) }() + case 99: try { try decoder.decodeSingularInt32Field(value: &self._otherField) }() + case 1001: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt32Midfield) }() + case 1002: try { try decoder.decodeRepeatedInt32Field(value: &self.repeatedInt32Midfield) }() + case 1003: try { try decoder.decodeRepeatedInt32Field(value: &self.packedInt32Midfield) }() + case 1000001: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt32Hifield) }() + case 1000002: try { try decoder.decodeRepeatedInt32Field(value: &self.repeatedInt32Hifield) }() + case 1000003: try { try decoder.decodeRepeatedInt32Field(value: &self.packedInt32Hifield) }() + case 2000000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_Int32ParseTester.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalInt32Lowfield { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + if !self.repeatedInt32Lowfield.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.repeatedInt32Lowfield, fieldNumber: 2) + } + if !self.packedInt32Lowfield.isEmpty { + try visitor.visitPackedInt32Field(value: self.packedInt32Lowfield, fieldNumber: 3) + } + try { if let v = self._otherField { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 99) + } }() + try { if let v = self._optionalInt32Midfield { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1001) + } }() + if !self.repeatedInt32Midfield.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.repeatedInt32Midfield, fieldNumber: 1002) + } + if !self.packedInt32Midfield.isEmpty { + try visitor.visitPackedInt32Field(value: self.packedInt32Midfield, fieldNumber: 1003) + } + try { if let v = self._optionalInt32Hifield { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1000001) + } }() + if !self.repeatedInt32Hifield.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.repeatedInt32Hifield, fieldNumber: 1000002) + } + if !self.packedInt32Hifield.isEmpty { + try visitor.visitPackedInt32Field(value: self.packedInt32Hifield, fieldNumber: 1000003) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 2000000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_Int32ParseTester, rhs: ProtobufUnittest_Int32ParseTester) -> Bool { + if lhs._optionalInt32Lowfield != rhs._optionalInt32Lowfield {return false} + if lhs._optionalInt32Midfield != rhs._optionalInt32Midfield {return false} + if lhs._optionalInt32Hifield != rhs._optionalInt32Hifield {return false} + if lhs.repeatedInt32Lowfield != rhs.repeatedInt32Lowfield {return false} + if lhs.repeatedInt32Midfield != rhs.repeatedInt32Midfield {return false} + if lhs.repeatedInt32Hifield != rhs.repeatedInt32Hifield {return false} + if lhs.packedInt32Lowfield != rhs.packedInt32Lowfield {return false} + if lhs.packedInt32Midfield != rhs.packedInt32Midfield {return false} + if lhs.packedInt32Hifield != rhs.packedInt32Hifield {return false} + if lhs._otherField != rhs._otherField {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_Int64ParseTester: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Int64ParseTester" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_int64_lowfield"), + 1001: .standard(proto: "optional_int64_midfield"), + 1000001: .standard(proto: "optional_int64_hifield"), + 2: .standard(proto: "repeated_int64_lowfield"), + 1002: .standard(proto: "repeated_int64_midfield"), + 1000002: .standard(proto: "repeated_int64_hifield"), + 3: .standard(proto: "packed_int64_lowfield"), + 1003: .standard(proto: "packed_int64_midfield"), + 1000003: .standard(proto: "packed_int64_hifield"), + 99: .standard(proto: "other_field"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self._optionalInt64Lowfield) }() + case 2: try { try decoder.decodeRepeatedInt64Field(value: &self.repeatedInt64Lowfield) }() + case 3: try { try decoder.decodeRepeatedInt64Field(value: &self.packedInt64Lowfield) }() + case 99: try { try decoder.decodeSingularInt32Field(value: &self._otherField) }() + case 1001: try { try decoder.decodeSingularInt64Field(value: &self._optionalInt64Midfield) }() + case 1002: try { try decoder.decodeRepeatedInt64Field(value: &self.repeatedInt64Midfield) }() + case 1003: try { try decoder.decodeRepeatedInt64Field(value: &self.packedInt64Midfield) }() + case 1000001: try { try decoder.decodeSingularInt64Field(value: &self._optionalInt64Hifield) }() + case 1000002: try { try decoder.decodeRepeatedInt64Field(value: &self.repeatedInt64Hifield) }() + case 1000003: try { try decoder.decodeRepeatedInt64Field(value: &self.packedInt64Hifield) }() + case 2000000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_Int64ParseTester.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalInt64Lowfield { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 1) + } }() + if !self.repeatedInt64Lowfield.isEmpty { + try visitor.visitRepeatedInt64Field(value: self.repeatedInt64Lowfield, fieldNumber: 2) + } + if !self.packedInt64Lowfield.isEmpty { + try visitor.visitPackedInt64Field(value: self.packedInt64Lowfield, fieldNumber: 3) + } + try { if let v = self._otherField { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 99) + } }() + try { if let v = self._optionalInt64Midfield { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 1001) + } }() + if !self.repeatedInt64Midfield.isEmpty { + try visitor.visitRepeatedInt64Field(value: self.repeatedInt64Midfield, fieldNumber: 1002) + } + if !self.packedInt64Midfield.isEmpty { + try visitor.visitPackedInt64Field(value: self.packedInt64Midfield, fieldNumber: 1003) + } + try { if let v = self._optionalInt64Hifield { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 1000001) + } }() + if !self.repeatedInt64Hifield.isEmpty { + try visitor.visitRepeatedInt64Field(value: self.repeatedInt64Hifield, fieldNumber: 1000002) + } + if !self.packedInt64Hifield.isEmpty { + try visitor.visitPackedInt64Field(value: self.packedInt64Hifield, fieldNumber: 1000003) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 2000000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_Int64ParseTester, rhs: ProtobufUnittest_Int64ParseTester) -> Bool { + if lhs._optionalInt64Lowfield != rhs._optionalInt64Lowfield {return false} + if lhs._optionalInt64Midfield != rhs._optionalInt64Midfield {return false} + if lhs._optionalInt64Hifield != rhs._optionalInt64Hifield {return false} + if lhs.repeatedInt64Lowfield != rhs.repeatedInt64Lowfield {return false} + if lhs.repeatedInt64Midfield != rhs.repeatedInt64Midfield {return false} + if lhs.repeatedInt64Hifield != rhs.repeatedInt64Hifield {return false} + if lhs.packedInt64Lowfield != rhs.packedInt64Lowfield {return false} + if lhs.packedInt64Midfield != rhs.packedInt64Midfield {return false} + if lhs.packedInt64Hifield != rhs.packedInt64Hifield {return false} + if lhs._otherField != rhs._otherField {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_InlinedStringIdxRegressionProto: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".InlinedStringIdxRegressionProto" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "str1"), + 2: .same(proto: "sub"), + 3: .same(proto: "str2"), + 4: .same(proto: "str3"), + ] + + fileprivate class _StorageClass { + var _str1: String? = nil + var _sub: ProtobufUnittest_InlinedStringIdxRegressionProto? = nil + var _str2: String? = nil + var _str3: Data? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _str1 = source._str1 + _sub = source._sub + _str2 = source._str2 + _str3 = source._str3 + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &_storage._str1) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._sub) }() + case 3: try { try decoder.decodeSingularStringField(value: &_storage._str2) }() + case 4: try { try decoder.decodeSingularBytesField(value: &_storage._str3) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._str1 { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._sub { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._str2 { + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._str3 { + try visitor.visitSingularBytesField(value: v, fieldNumber: 4) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_InlinedStringIdxRegressionProto, rhs: ProtobufUnittest_InlinedStringIdxRegressionProto) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._str1 != rhs_storage._str1 {return false} + if _storage._sub != rhs_storage._sub {return false} + if _storage._str2 != rhs_storage._str2 {return false} + if _storage._str3 != rhs_storage._str3 {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_StringParseTester: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".StringParseTester" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_string_lowfield"), + 1001: .standard(proto: "optional_string_midfield"), + 1000001: .standard(proto: "optional_string_hifield"), + 2: .standard(proto: "repeated_string_lowfield"), + 1002: .standard(proto: "repeated_string_midfield"), + 1000002: .standard(proto: "repeated_string_hifield"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._optionalStringLowfield) }() + case 2: try { try decoder.decodeRepeatedStringField(value: &self.repeatedStringLowfield) }() + case 1001: try { try decoder.decodeSingularStringField(value: &self._optionalStringMidfield) }() + case 1002: try { try decoder.decodeRepeatedStringField(value: &self.repeatedStringMidfield) }() + case 1000001: try { try decoder.decodeSingularStringField(value: &self._optionalStringHifield) }() + case 1000002: try { try decoder.decodeRepeatedStringField(value: &self.repeatedStringHifield) }() + case 2000000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_StringParseTester.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalStringLowfield { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + if !self.repeatedStringLowfield.isEmpty { + try visitor.visitRepeatedStringField(value: self.repeatedStringLowfield, fieldNumber: 2) + } + try { if let v = self._optionalStringMidfield { + try visitor.visitSingularStringField(value: v, fieldNumber: 1001) + } }() + if !self.repeatedStringMidfield.isEmpty { + try visitor.visitRepeatedStringField(value: self.repeatedStringMidfield, fieldNumber: 1002) + } + try { if let v = self._optionalStringHifield { + try visitor.visitSingularStringField(value: v, fieldNumber: 1000001) + } }() + if !self.repeatedStringHifield.isEmpty { + try visitor.visitRepeatedStringField(value: self.repeatedStringHifield, fieldNumber: 1000002) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 2000000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_StringParseTester, rhs: ProtobufUnittest_StringParseTester) -> Bool { + if lhs._optionalStringLowfield != rhs._optionalStringLowfield {return false} + if lhs._optionalStringMidfield != rhs._optionalStringMidfield {return false} + if lhs._optionalStringHifield != rhs._optionalStringHifield {return false} + if lhs.repeatedStringLowfield != rhs.repeatedStringLowfield {return false} + if lhs.repeatedStringMidfield != rhs.repeatedStringMidfield {return false} + if lhs.repeatedStringHifield != rhs.repeatedStringHifield {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_BadFieldNames: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".BadFieldNames" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "OptionalInt32"), + 2: .same(proto: "for"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt32) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._for) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._for { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_BadFieldNames, rhs: ProtobufUnittest_BadFieldNames) -> Bool { + if lhs._optionalInt32 != rhs._optionalInt32 {return false} + if lhs._for != rhs._for {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestNestedMessageRedaction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestNestedMessageRedaction" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_unredacted_nested_string"), + 2: .standard(proto: "optional_redacted_nested_string"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._optionalUnredactedNestedString) }() + case 2: try { try decoder.decodeSingularStringField(value: &self._optionalRedactedNestedString) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalUnredactedNestedString { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalRedactedNestedString { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestNestedMessageRedaction, rhs: ProtobufUnittest_TestNestedMessageRedaction) -> Bool { + if lhs._optionalUnredactedNestedString != rhs._optionalUnredactedNestedString {return false} + if lhs._optionalRedactedNestedString != rhs._optionalRedactedNestedString {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_RedactedFields: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RedactedFields" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_redacted_string"), + 2: .standard(proto: "optional_unredacted_string"), + 3: .standard(proto: "repeated_redacted_string"), + 4: .standard(proto: "repeated_unredacted_string"), + 5: .standard(proto: "optional_redacted_message"), + 6: .standard(proto: "optional_unredacted_message"), + 7: .standard(proto: "repeated_redacted_message"), + 8: .standard(proto: "repeated_unredacted_message"), + 9: .standard(proto: "map_redacted_string"), + 10: .standard(proto: "map_unredacted_string"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._optionalRedactedString) }() + case 2: try { try decoder.decodeSingularStringField(value: &self._optionalUnredactedString) }() + case 3: try { try decoder.decodeRepeatedStringField(value: &self.repeatedRedactedString) }() + case 4: try { try decoder.decodeRepeatedStringField(value: &self.repeatedUnredactedString) }() + case 5: try { try decoder.decodeSingularMessageField(value: &self._optionalRedactedMessage) }() + case 6: try { try decoder.decodeSingularMessageField(value: &self._optionalUnredactedMessage) }() + case 7: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedRedactedMessage) }() + case 8: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedUnredactedMessage) }() + case 9: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.mapRedactedString) }() + case 10: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.mapUnredactedString) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalRedactedString { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalUnredactedString { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + if !self.repeatedRedactedString.isEmpty { + try visitor.visitRepeatedStringField(value: self.repeatedRedactedString, fieldNumber: 3) + } + if !self.repeatedUnredactedString.isEmpty { + try visitor.visitRepeatedStringField(value: self.repeatedUnredactedString, fieldNumber: 4) + } + try { if let v = self._optionalRedactedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + try { if let v = self._optionalUnredactedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + } }() + if !self.repeatedRedactedMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedRedactedMessage, fieldNumber: 7) + } + if !self.repeatedUnredactedMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedUnredactedMessage, fieldNumber: 8) + } + if !self.mapRedactedString.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.mapRedactedString, fieldNumber: 9) + } + if !self.mapUnredactedString.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.mapUnredactedString, fieldNumber: 10) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_RedactedFields, rhs: ProtobufUnittest_RedactedFields) -> Bool { + if lhs._optionalRedactedString != rhs._optionalRedactedString {return false} + if lhs._optionalUnredactedString != rhs._optionalUnredactedString {return false} + if lhs.repeatedRedactedString != rhs.repeatedRedactedString {return false} + if lhs.repeatedUnredactedString != rhs.repeatedUnredactedString {return false} + if lhs._optionalRedactedMessage != rhs._optionalRedactedMessage {return false} + if lhs._optionalUnredactedMessage != rhs._optionalUnredactedMessage {return false} + if lhs.repeatedRedactedMessage != rhs.repeatedRedactedMessage {return false} + if lhs.repeatedUnredactedMessage != rhs.repeatedUnredactedMessage {return false} + if lhs.mapRedactedString != rhs.mapRedactedString {return false} + if lhs.mapUnredactedString != rhs.mapUnredactedString {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestCord: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestCord" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_bytes_cord"), + 2: .standard(proto: "optional_bytes_cord_default"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self._optionalBytesCord) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self._optionalBytesCordDefault) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalBytesCord { + try visitor.visitSingularBytesField(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalBytesCordDefault { + try visitor.visitSingularBytesField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestCord, rhs: ProtobufUnittest_TestCord) -> Bool { + if lhs._optionalBytesCord != rhs._optionalBytesCord {return false} + if lhs._optionalBytesCordDefault != rhs._optionalBytesCordDefault {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestPackedEnumSmallRange: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestPackedEnumSmallRange" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "vals"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedEnumField(value: &self.vals) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.vals.isEmpty { + try visitor.visitPackedEnumField(value: self.vals, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestPackedEnumSmallRange, rhs: ProtobufUnittest_TestPackedEnumSmallRange) -> Bool { + if lhs.vals != rhs.vals {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestPackedEnumSmallRange.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNSPECIFIED"), + 1: .same(proto: "FOO"), + 2: .same(proto: "BAR"), + 3: .same(proto: "BAZ"), + ] +} diff --git a/Reference/SwiftProtobufTests/unittest_arena.pb.swift b/Reference/SwiftProtobufTests/unittest_arena.pb.swift new file mode 100644 index 000000000..fb32b7f36 --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_arena.pb.swift @@ -0,0 +1,161 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_arena.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +struct Proto2ArenaUnittest_NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var d: Int32 { + get {return _d ?? 0} + set {_d = newValue} + } + /// Returns true if `d` has been explicitly set. + var hasD: Bool {return self._d != nil} + /// Clears the value of `d`. Subsequent reads from it will return its default value. + mutating func clearD() {self._d = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _d: Int32? = nil +} + +struct Proto2ArenaUnittest_ArenaMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var repeatedNestedMessage: [Proto2ArenaUnittest_NestedMessage] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Proto2ArenaUnittest_NestedMessage: @unchecked Sendable {} +extension Proto2ArenaUnittest_ArenaMessage: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "proto2_arena_unittest" + +extension Proto2ArenaUnittest_NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "d"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._d) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._d { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto2ArenaUnittest_NestedMessage, rhs: Proto2ArenaUnittest_NestedMessage) -> Bool { + if lhs._d != rhs._d {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto2ArenaUnittest_ArenaMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ArenaMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "repeated_nested_message"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedNestedMessage) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.repeatedNestedMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedNestedMessage, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto2ArenaUnittest_ArenaMessage, rhs: Proto2ArenaUnittest_ArenaMessage) -> Bool { + if lhs.repeatedNestedMessage != rhs.repeatedNestedMessage {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_custom_options.pb.swift b/Reference/SwiftProtobufTests/unittest_custom_options.pb.swift new file mode 100644 index 000000000..fa25c45ed --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_custom_options.pb.swift @@ -0,0 +1,2842 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_custom_options.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: benjy@google.com (Benjy Weinberger) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// A proto file used to test the "custom options" feature of google.protobuf. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum ProtobufUnittest_MethodOpt1: SwiftProtobuf.Enum { + typealias RawValue = Int + case val1 // = 1 + case val2 // = 2 + + init() { + self = .val1 + } + + init?(rawValue: Int) { + switch rawValue { + case 1: self = .val1 + case 2: self = .val2 + default: return nil + } + } + + var rawValue: Int { + switch self { + case .val1: return 1 + case .val2: return 2 + } + } + +} + +enum ProtobufUnittest_AggregateEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case value // = 1 + + init() { + self = .value + } + + init?(rawValue: Int) { + switch rawValue { + case 1: self = .value + default: return nil + } + } + + var rawValue: Int { + switch self { + case .value: return 1 + } + } + +} + +/// A test message with custom options at all possible locations (and also some +/// regular options, to make sure they interact nicely). +struct ProtobufUnittest_TestMessageWithCustomOptions { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var field1: String { + get {return _field1 ?? String()} + set {_field1 = newValue} + } + /// Returns true if `field1` has been explicitly set. + var hasField1: Bool {return self._field1 != nil} + /// Clears the value of `field1`. Subsequent reads from it will return its default value. + mutating func clearField1() {self._field1 = nil} + + var anOneof: ProtobufUnittest_TestMessageWithCustomOptions.OneOf_AnOneof? = nil + + var oneofField: Int32 { + get { + if case .oneofField(let v)? = anOneof {return v} + return 0 + } + set {anOneof = .oneofField(newValue)} + } + + var mapField: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_AnOneof: Equatable { + case oneofField(Int32) + + } + + enum AnEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case val1 // = 1 + case val2 // = 2 + + init() { + self = .val1 + } + + init?(rawValue: Int) { + switch rawValue { + case 1: self = .val1 + case 2: self = .val2 + default: return nil + } + } + + var rawValue: Int { + switch self { + case .val1: return 1 + case .val2: return 2 + } + } + + } + + init() {} + + fileprivate var _field1: String? = nil +} + +/// A test RPC service with custom options at all possible locations (and also +/// some regular options, to make sure they interact nicely). +struct ProtobufUnittest_CustomOptionFooRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_CustomOptionFooResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_CustomOptionFooClientMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_CustomOptionFooServerMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_DummyMessageContainingEnum { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum TestEnumType: SwiftProtobuf.Enum { + typealias RawValue = Int + case testOptionEnumType1 // = 22 + case testOptionEnumType2 // = -23 + + init() { + self = .testOptionEnumType1 + } + + init?(rawValue: Int) { + switch rawValue { + case -23: self = .testOptionEnumType2 + case 22: self = .testOptionEnumType1 + default: return nil + } + } + + var rawValue: Int { + switch self { + case .testOptionEnumType2: return -23 + case .testOptionEnumType1: return 22 + } + } + + } + + init() {} +} + +struct ProtobufUnittest_DummyMessageInvalidAsOptionType { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_CustomOptionMinIntegerValues { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_CustomOptionMaxIntegerValues { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_CustomOptionOtherValues { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_SettingRealsFromPositiveInts { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_SettingRealsFromNegativeInts { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_ComplexOptionType1: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var foo: Int32 { + get {return _foo ?? 0} + set {_foo = newValue} + } + /// Returns true if `foo` has been explicitly set. + var hasFoo: Bool {return self._foo != nil} + /// Clears the value of `foo`. Subsequent reads from it will return its default value. + mutating func clearFoo() {self._foo = nil} + + var foo2: Int32 { + get {return _foo2 ?? 0} + set {_foo2 = newValue} + } + /// Returns true if `foo2` has been explicitly set. + var hasFoo2: Bool {return self._foo2 != nil} + /// Clears the value of `foo2`. Subsequent reads from it will return its default value. + mutating func clearFoo2() {self._foo2 = nil} + + var foo3: Int32 { + get {return _foo3 ?? 0} + set {_foo3 = newValue} + } + /// Returns true if `foo3` has been explicitly set. + var hasFoo3: Bool {return self._foo3 != nil} + /// Clears the value of `foo3`. Subsequent reads from it will return its default value. + mutating func clearFoo3() {self._foo3 = nil} + + var foo4: [Int32] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _foo: Int32? = nil + fileprivate var _foo2: Int32? = nil + fileprivate var _foo3: Int32? = nil +} + +struct ProtobufUnittest_ComplexOptionType2: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var bar: ProtobufUnittest_ComplexOptionType1 { + get {return _bar ?? ProtobufUnittest_ComplexOptionType1()} + set {_bar = newValue} + } + /// Returns true if `bar` has been explicitly set. + var hasBar: Bool {return self._bar != nil} + /// Clears the value of `bar`. Subsequent reads from it will return its default value. + mutating func clearBar() {self._bar = nil} + + var baz: Int32 { + get {return _baz ?? 0} + set {_baz = newValue} + } + /// Returns true if `baz` has been explicitly set. + var hasBaz: Bool {return self._baz != nil} + /// Clears the value of `baz`. Subsequent reads from it will return its default value. + mutating func clearBaz() {self._baz = nil} + + var fred: ProtobufUnittest_ComplexOptionType2.ComplexOptionType4 { + get {return _fred ?? ProtobufUnittest_ComplexOptionType2.ComplexOptionType4()} + set {_fred = newValue} + } + /// Returns true if `fred` has been explicitly set. + var hasFred: Bool {return self._fred != nil} + /// Clears the value of `fred`. Subsequent reads from it will return its default value. + mutating func clearFred() {self._fred = nil} + + var barney: [ProtobufUnittest_ComplexOptionType2.ComplexOptionType4] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct ComplexOptionType4 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var waldo: Int32 { + get {return _waldo ?? 0} + set {_waldo = newValue} + } + /// Returns true if `waldo` has been explicitly set. + var hasWaldo: Bool {return self._waldo != nil} + /// Clears the value of `waldo`. Subsequent reads from it will return its default value. + mutating func clearWaldo() {self._waldo = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _waldo: Int32? = nil + } + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _bar: ProtobufUnittest_ComplexOptionType1? = nil + fileprivate var _baz: Int32? = nil + fileprivate var _fred: ProtobufUnittest_ComplexOptionType2.ComplexOptionType4? = nil +} + +struct ProtobufUnittest_ComplexOptionType3 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var moo: Int32 { + get {return _moo ?? 0} + set {_moo = newValue} + } + /// Returns true if `moo` has been explicitly set. + var hasMoo: Bool {return self._moo != nil} + /// Clears the value of `moo`. Subsequent reads from it will return its default value. + mutating func clearMoo() {self._moo = nil} + + var complexOptionType5: ProtobufUnittest_ComplexOptionType3.ComplexOptionType5 { + get {return _complexOptionType5 ?? ProtobufUnittest_ComplexOptionType3.ComplexOptionType5()} + set {_complexOptionType5 = newValue} + } + /// Returns true if `complexOptionType5` has been explicitly set. + var hasComplexOptionType5: Bool {return self._complexOptionType5 != nil} + /// Clears the value of `complexOptionType5`. Subsequent reads from it will return its default value. + mutating func clearComplexOptionType5() {self._complexOptionType5 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct ComplexOptionType5 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var plugh: Int32 { + get {return _plugh ?? 0} + set {_plugh = newValue} + } + /// Returns true if `plugh` has been explicitly set. + var hasPlugh: Bool {return self._plugh != nil} + /// Clears the value of `plugh`. Subsequent reads from it will return its default value. + mutating func clearPlugh() {self._plugh = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _plugh: Int32? = nil + } + + init() {} + + fileprivate var _moo: Int32? = nil + fileprivate var _complexOptionType5: ProtobufUnittest_ComplexOptionType3.ComplexOptionType5? = nil +} + +struct ProtobufUnittest_ComplexOpt6 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var xyzzy: Int32 { + get {return _xyzzy ?? 0} + set {_xyzzy = newValue} + } + /// Returns true if `xyzzy` has been explicitly set. + var hasXyzzy: Bool {return self._xyzzy != nil} + /// Clears the value of `xyzzy`. Subsequent reads from it will return its default value. + mutating func clearXyzzy() {self._xyzzy = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _xyzzy: Int32? = nil +} + +/// Note that we try various different ways of naming the same extension. +struct ProtobufUnittest_VariousComplexOptions { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_AggregateMessageSet: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() +} + +struct ProtobufUnittest_AggregateMessageSetElement { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var s: String { + get {return _s ?? String()} + set {_s = newValue} + } + /// Returns true if `s` has been explicitly set. + var hasS: Bool {return self._s != nil} + /// Clears the value of `s`. Subsequent reads from it will return its default value. + mutating func clearS() {self._s = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _s: String? = nil +} + +/// A helper type used to test aggregate option parsing +struct ProtobufUnittest_Aggregate { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var i: Int32 { + get {return _storage._i ?? 0} + set {_uniqueStorage()._i = newValue} + } + /// Returns true if `i` has been explicitly set. + var hasI: Bool {return _storage._i != nil} + /// Clears the value of `i`. Subsequent reads from it will return its default value. + mutating func clearI() {_uniqueStorage()._i = nil} + + var s: String { + get {return _storage._s ?? String()} + set {_uniqueStorage()._s = newValue} + } + /// Returns true if `s` has been explicitly set. + var hasS: Bool {return _storage._s != nil} + /// Clears the value of `s`. Subsequent reads from it will return its default value. + mutating func clearS() {_uniqueStorage()._s = nil} + + /// A nested object + var sub: ProtobufUnittest_Aggregate { + get {return _storage._sub ?? ProtobufUnittest_Aggregate()} + set {_uniqueStorage()._sub = newValue} + } + /// Returns true if `sub` has been explicitly set. + var hasSub: Bool {return _storage._sub != nil} + /// Clears the value of `sub`. Subsequent reads from it will return its default value. + mutating func clearSub() {_uniqueStorage()._sub = nil} + + /// To test the parsing of extensions inside aggregate values + var file: SwiftProtobuf.Google_Protobuf_FileOptions { + get {return _storage._file ?? SwiftProtobuf.Google_Protobuf_FileOptions()} + set {_uniqueStorage()._file = newValue} + } + /// Returns true if `file` has been explicitly set. + var hasFile: Bool {return _storage._file != nil} + /// Clears the value of `file`. Subsequent reads from it will return its default value. + mutating func clearFile() {_uniqueStorage()._file = nil} + + /// An embedded message set + var mset: ProtobufUnittest_AggregateMessageSet { + get {return _storage._mset ?? ProtobufUnittest_AggregateMessageSet()} + set {_uniqueStorage()._mset = newValue} + } + /// Returns true if `mset` has been explicitly set. + var hasMset: Bool {return _storage._mset != nil} + /// Clears the value of `mset`. Subsequent reads from it will return its default value. + mutating func clearMset() {_uniqueStorage()._mset = nil} + + /// An any + var any: SwiftProtobuf.Google_Protobuf_Any { + get {return _storage._any ?? SwiftProtobuf.Google_Protobuf_Any()} + set {_uniqueStorage()._any = newValue} + } + /// Returns true if `any` has been explicitly set. + var hasAny: Bool {return _storage._any != nil} + /// Clears the value of `any`. Subsequent reads from it will return its default value. + mutating func clearAny() {_uniqueStorage()._any = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufUnittest_AggregateMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var fieldname: Int32 { + get {return _fieldname ?? 0} + set {_fieldname = newValue} + } + /// Returns true if `fieldname` has been explicitly set. + var hasFieldname: Bool {return self._fieldname != nil} + /// Clears the value of `fieldname`. Subsequent reads from it will return its default value. + mutating func clearFieldname() {self._fieldname = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _fieldname: Int32? = nil +} + +/// Test custom options for nested type. +struct ProtobufUnittest_NestedOptionType { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case value // = 1 + + init() { + self = .value + } + + init?(rawValue: Int) { + switch rawValue { + case 1: self = .value + default: return nil + } + } + + var rawValue: Int { + switch self { + case .value: return 1 + } + } + + } + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var nestedField: Int32 { + get {return _nestedField ?? 0} + set {_nestedField = newValue} + } + /// Returns true if `nestedField` has been explicitly set. + var hasNestedField: Bool {return self._nestedField != nil} + /// Clears the value of `nestedField`. Subsequent reads from it will return its default value. + mutating func clearNestedField() {self._nestedField = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _nestedField: Int32? = nil + } + + init() {} +} + +/// Custom message option that has a required enum field. +/// WARNING: this is strongly discouraged! +struct ProtobufUnittest_OldOptionType { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var value: ProtobufUnittest_OldOptionType.TestEnum { + get {return _value ?? .oldValue} + set {_value = newValue} + } + /// Returns true if `value` has been explicitly set. + var hasValue: Bool {return self._value != nil} + /// Clears the value of `value`. Subsequent reads from it will return its default value. + mutating func clearValue() {self._value = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum TestEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case oldValue // = 0 + + init() { + self = .oldValue + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .oldValue + default: return nil + } + } + + var rawValue: Int { + switch self { + case .oldValue: return 0 + } + } + + } + + init() {} + + fileprivate var _value: ProtobufUnittest_OldOptionType.TestEnum? = nil +} + +/// Updated version of the custom option above. +struct ProtobufUnittest_NewOptionType { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var value: ProtobufUnittest_NewOptionType.TestEnum { + get {return _value ?? .oldValue} + set {_value = newValue} + } + /// Returns true if `value` has been explicitly set. + var hasValue: Bool {return self._value != nil} + /// Clears the value of `value`. Subsequent reads from it will return its default value. + mutating func clearValue() {self._value = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum TestEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case oldValue // = 0 + case newValue // = 1 + + init() { + self = .oldValue + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .oldValue + case 1: self = .newValue + default: return nil + } + } + + var rawValue: Int { + switch self { + case .oldValue: return 0 + case .newValue: return 1 + } + } + + } + + init() {} + + fileprivate var _value: ProtobufUnittest_NewOptionType.TestEnum? = nil +} + +/// Test message using the "required_enum_opt" option defined above. +struct ProtobufUnittest_TestMessageWithRequiredEnumOption { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittest_TestMessageWithCustomOptions: @unchecked Sendable {} +extension ProtobufUnittest_TestMessageWithCustomOptions.OneOf_AnOneof: @unchecked Sendable {} +extension ProtobufUnittest_CustomOptionFooRequest: @unchecked Sendable {} +extension ProtobufUnittest_CustomOptionFooResponse: @unchecked Sendable {} +extension ProtobufUnittest_CustomOptionFooClientMessage: @unchecked Sendable {} +extension ProtobufUnittest_CustomOptionFooServerMessage: @unchecked Sendable {} +extension ProtobufUnittest_DummyMessageContainingEnum: @unchecked Sendable {} +extension ProtobufUnittest_DummyMessageInvalidAsOptionType: @unchecked Sendable {} +extension ProtobufUnittest_CustomOptionMinIntegerValues: @unchecked Sendable {} +extension ProtobufUnittest_CustomOptionMaxIntegerValues: @unchecked Sendable {} +extension ProtobufUnittest_CustomOptionOtherValues: @unchecked Sendable {} +extension ProtobufUnittest_SettingRealsFromPositiveInts: @unchecked Sendable {} +extension ProtobufUnittest_SettingRealsFromNegativeInts: @unchecked Sendable {} +extension ProtobufUnittest_ComplexOptionType1: @unchecked Sendable {} +extension ProtobufUnittest_ComplexOptionType2: @unchecked Sendable {} +extension ProtobufUnittest_ComplexOptionType2.ComplexOptionType4: @unchecked Sendable {} +extension ProtobufUnittest_ComplexOptionType3: @unchecked Sendable {} +extension ProtobufUnittest_ComplexOptionType3.ComplexOptionType5: @unchecked Sendable {} +extension ProtobufUnittest_ComplexOpt6: @unchecked Sendable {} +extension ProtobufUnittest_VariousComplexOptions: @unchecked Sendable {} +extension ProtobufUnittest_AggregateMessageSet: @unchecked Sendable {} +extension ProtobufUnittest_AggregateMessageSetElement: @unchecked Sendable {} +extension ProtobufUnittest_Aggregate: @unchecked Sendable {} +extension ProtobufUnittest_AggregateMessage: @unchecked Sendable {} +extension ProtobufUnittest_NestedOptionType: @unchecked Sendable {} +extension ProtobufUnittest_NestedOptionType.NestedMessage: @unchecked Sendable {} +extension ProtobufUnittest_OldOptionType: @unchecked Sendable {} +extension ProtobufUnittest_NewOptionType: @unchecked Sendable {} +extension ProtobufUnittest_TestMessageWithRequiredEnumOption: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Extension support defined in unittest_custom_options.proto. + +// MARK: - Extension Properties + +// Swift Extensions on the exteneded Messages to add easy access to the declared +// extension fields. The names are based on the extension field name from the proto +// declaration. To avoid naming collisions, the names are prefixed with the name of +// the scope where the extend directive occurs. + +extension ProtobufUnittest_AggregateMessageSet { + + var ProtobufUnittest_AggregateMessageSetElement_messageSetExtension: ProtobufUnittest_AggregateMessageSetElement { + get {return getExtensionValue(ext: ProtobufUnittest_AggregateMessageSetElement.Extensions.message_set_extension) ?? ProtobufUnittest_AggregateMessageSetElement()} + set {setExtensionValue(ext: ProtobufUnittest_AggregateMessageSetElement.Extensions.message_set_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_AggregateMessageSetElement.Extensions.message_set_extension` + /// has been explicitly set. + var hasProtobufUnittest_AggregateMessageSetElement_messageSetExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_AggregateMessageSetElement.Extensions.message_set_extension) + } + /// Clears the value of extension `ProtobufUnittest_AggregateMessageSetElement.Extensions.message_set_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_AggregateMessageSetElement_messageSetExtension() { + clearExtensionValue(ext: ProtobufUnittest_AggregateMessageSetElement.Extensions.message_set_extension) + } +} + +extension ProtobufUnittest_ComplexOptionType1 { + + var ProtobufUnittest_mooo: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_mooo) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_mooo, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_mooo` + /// has been explicitly set. + var hasProtobufUnittest_mooo: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_mooo) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_mooo`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_mooo() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_mooo) + } + + var ProtobufUnittest_corge: ProtobufUnittest_ComplexOptionType3 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_corge) ?? ProtobufUnittest_ComplexOptionType3()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_corge, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_corge` + /// has been explicitly set. + var hasProtobufUnittest_corge: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_corge) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_corge`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_corge() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_corge) + } +} + +extension ProtobufUnittest_ComplexOptionType2 { + + var ProtobufUnittest_grault: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_grault) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_grault, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_grault` + /// has been explicitly set. + var hasProtobufUnittest_grault: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_grault) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_grault`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_grault() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_grault) + } + + var ProtobufUnittest_garply: ProtobufUnittest_ComplexOptionType1 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_garply) ?? ProtobufUnittest_ComplexOptionType1()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_garply, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_garply` + /// has been explicitly set. + var hasProtobufUnittest_garply: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_garply) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_garply`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_garply() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_garply) + } +} + +extension SwiftProtobuf.Google_Protobuf_EnumOptions { + + var ProtobufUnittest_enumOpt1: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_enum_opt1) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_enum_opt1, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_enum_opt1` + /// has been explicitly set. + var hasProtobufUnittest_enumOpt1: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_enum_opt1) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_enum_opt1`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_enumOpt1() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_enum_opt1) + } + + var ProtobufUnittest_enumopt: ProtobufUnittest_Aggregate { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_enumopt) ?? ProtobufUnittest_Aggregate()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_enumopt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_enumopt` + /// has been explicitly set. + var hasProtobufUnittest_enumopt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_enumopt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_enumopt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_enumopt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_enumopt) + } +} + +extension SwiftProtobuf.Google_Protobuf_EnumValueOptions { + + var ProtobufUnittest_enumValueOpt1: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_enum_value_opt1) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_enum_value_opt1, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_enum_value_opt1` + /// has been explicitly set. + var hasProtobufUnittest_enumValueOpt1: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_enum_value_opt1) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_enum_value_opt1`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_enumValueOpt1() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_enum_value_opt1) + } + + var ProtobufUnittest_enumvalopt: ProtobufUnittest_Aggregate { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_enumvalopt) ?? ProtobufUnittest_Aggregate()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_enumvalopt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_enumvalopt` + /// has been explicitly set. + var hasProtobufUnittest_enumvalopt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_enumvalopt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_enumvalopt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_enumvalopt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_enumvalopt) + } +} + +extension SwiftProtobuf.Google_Protobuf_FieldOptions { + + var ProtobufUnittest_fieldOpt1: UInt64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_field_opt1) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_field_opt1, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_field_opt1` + /// has been explicitly set. + var hasProtobufUnittest_fieldOpt1: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_field_opt1) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_field_opt1`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_fieldOpt1() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_field_opt1) + } + + /// This is useful for testing that we correctly register default values for + /// extension options. + var ProtobufUnittest_fieldOpt2: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_field_opt2) ?? 42} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_field_opt2, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_field_opt2` + /// has been explicitly set. + var hasProtobufUnittest_fieldOpt2: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_field_opt2) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_field_opt2`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_fieldOpt2() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_field_opt2) + } + + var ProtobufUnittest_fieldopt: ProtobufUnittest_Aggregate { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_fieldopt) ?? ProtobufUnittest_Aggregate()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_fieldopt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_fieldopt` + /// has been explicitly set. + var hasProtobufUnittest_fieldopt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_fieldopt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_fieldopt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_fieldopt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_fieldopt) + } +} + +extension SwiftProtobuf.Google_Protobuf_FileOptions { + + var ProtobufUnittest_fileOpt1: UInt64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_file_opt1) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_file_opt1, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_file_opt1` + /// has been explicitly set. + var hasProtobufUnittest_fileOpt1: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_file_opt1) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_file_opt1`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_fileOpt1() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_file_opt1) + } + + var ProtobufUnittest_fileopt: ProtobufUnittest_Aggregate { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_fileopt) ?? ProtobufUnittest_Aggregate()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_fileopt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_fileopt` + /// has been explicitly set. + var hasProtobufUnittest_fileopt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_fileopt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_fileopt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_fileopt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_fileopt) + } + + var ProtobufUnittest_Aggregate_nested: ProtobufUnittest_Aggregate { + get {return getExtensionValue(ext: ProtobufUnittest_Aggregate.Extensions.nested) ?? ProtobufUnittest_Aggregate()} + set {setExtensionValue(ext: ProtobufUnittest_Aggregate.Extensions.nested, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Aggregate.Extensions.nested` + /// has been explicitly set. + var hasProtobufUnittest_Aggregate_nested: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Aggregate.Extensions.nested) + } + /// Clears the value of extension `ProtobufUnittest_Aggregate.Extensions.nested`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_Aggregate_nested() { + clearExtensionValue(ext: ProtobufUnittest_Aggregate.Extensions.nested) + } + + var ProtobufUnittest_NestedOptionType_nestedExtension: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_NestedOptionType.Extensions.nested_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_NestedOptionType.Extensions.nested_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_NestedOptionType.Extensions.nested_extension` + /// has been explicitly set. + var hasProtobufUnittest_NestedOptionType_nestedExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_NestedOptionType.Extensions.nested_extension) + } + /// Clears the value of extension `ProtobufUnittest_NestedOptionType.Extensions.nested_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_NestedOptionType_nestedExtension() { + clearExtensionValue(ext: ProtobufUnittest_NestedOptionType.Extensions.nested_extension) + } +} + +extension SwiftProtobuf.Google_Protobuf_MessageOptions { + + var ProtobufUnittest_messageOpt1: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_message_opt1) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_message_opt1, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_message_opt1` + /// has been explicitly set. + var hasProtobufUnittest_messageOpt1: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_message_opt1) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_message_opt1`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_messageOpt1() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_message_opt1) + } + + var ProtobufUnittest_boolOpt: Bool { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_bool_opt) ?? false} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_bool_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_bool_opt` + /// has been explicitly set. + var hasProtobufUnittest_boolOpt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_bool_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_bool_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_boolOpt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_bool_opt) + } + + var ProtobufUnittest_int32Opt: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_int32_opt) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_int32_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_int32_opt` + /// has been explicitly set. + var hasProtobufUnittest_int32Opt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_int32_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_int32_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_int32Opt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_int32_opt) + } + + var ProtobufUnittest_int64Opt: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_int64_opt) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_int64_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_int64_opt` + /// has been explicitly set. + var hasProtobufUnittest_int64Opt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_int64_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_int64_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_int64Opt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_int64_opt) + } + + var ProtobufUnittest_uint32Opt: UInt32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_uint32_opt) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_uint32_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_uint32_opt` + /// has been explicitly set. + var hasProtobufUnittest_uint32Opt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_uint32_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_uint32_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_uint32Opt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_uint32_opt) + } + + var ProtobufUnittest_uint64Opt: UInt64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_uint64_opt) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_uint64_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_uint64_opt` + /// has been explicitly set. + var hasProtobufUnittest_uint64Opt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_uint64_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_uint64_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_uint64Opt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_uint64_opt) + } + + var ProtobufUnittest_sint32Opt: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_sint32_opt) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_sint32_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_sint32_opt` + /// has been explicitly set. + var hasProtobufUnittest_sint32Opt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_sint32_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_sint32_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_sint32Opt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_sint32_opt) + } + + var ProtobufUnittest_sint64Opt: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_sint64_opt) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_sint64_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_sint64_opt` + /// has been explicitly set. + var hasProtobufUnittest_sint64Opt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_sint64_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_sint64_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_sint64Opt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_sint64_opt) + } + + var ProtobufUnittest_fixed32Opt: UInt32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_fixed32_opt) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_fixed32_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_fixed32_opt` + /// has been explicitly set. + var hasProtobufUnittest_fixed32Opt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_fixed32_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_fixed32_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_fixed32Opt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_fixed32_opt) + } + + var ProtobufUnittest_fixed64Opt: UInt64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_fixed64_opt) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_fixed64_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_fixed64_opt` + /// has been explicitly set. + var hasProtobufUnittest_fixed64Opt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_fixed64_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_fixed64_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_fixed64Opt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_fixed64_opt) + } + + var ProtobufUnittest_sfixed32Opt: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_sfixed32_opt) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_sfixed32_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_sfixed32_opt` + /// has been explicitly set. + var hasProtobufUnittest_sfixed32Opt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_sfixed32_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_sfixed32_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_sfixed32Opt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_sfixed32_opt) + } + + var ProtobufUnittest_sfixed64Opt: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_sfixed64_opt) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_sfixed64_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_sfixed64_opt` + /// has been explicitly set. + var hasProtobufUnittest_sfixed64Opt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_sfixed64_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_sfixed64_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_sfixed64Opt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_sfixed64_opt) + } + + var ProtobufUnittest_floatOpt: Float { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_float_opt) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_float_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_float_opt` + /// has been explicitly set. + var hasProtobufUnittest_floatOpt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_float_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_float_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_floatOpt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_float_opt) + } + + var ProtobufUnittest_doubleOpt: Double { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_double_opt) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_double_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_double_opt` + /// has been explicitly set. + var hasProtobufUnittest_doubleOpt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_double_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_double_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_doubleOpt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_double_opt) + } + + var ProtobufUnittest_stringOpt: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_string_opt) ?? String()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_string_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_string_opt` + /// has been explicitly set. + var hasProtobufUnittest_stringOpt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_string_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_string_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_stringOpt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_string_opt) + } + + var ProtobufUnittest_bytesOpt: Data { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_bytes_opt) ?? Data()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_bytes_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_bytes_opt` + /// has been explicitly set. + var hasProtobufUnittest_bytesOpt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_bytes_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_bytes_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_bytesOpt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_bytes_opt) + } + + var ProtobufUnittest_enumOpt: ProtobufUnittest_DummyMessageContainingEnum.TestEnumType { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_enum_opt) ?? .testOptionEnumType1} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_enum_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_enum_opt` + /// has been explicitly set. + var hasProtobufUnittest_enumOpt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_enum_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_enum_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_enumOpt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_enum_opt) + } + + var ProtobufUnittest_messageTypeOpt: ProtobufUnittest_DummyMessageInvalidAsOptionType { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_message_type_opt) ?? ProtobufUnittest_DummyMessageInvalidAsOptionType()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_message_type_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_message_type_opt` + /// has been explicitly set. + var hasProtobufUnittest_messageTypeOpt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_message_type_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_message_type_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_messageTypeOpt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_message_type_opt) + } + + var ProtobufUnittest_complexOpt1: ProtobufUnittest_ComplexOptionType1 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_complex_opt1) ?? ProtobufUnittest_ComplexOptionType1()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_complex_opt1, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_complex_opt1` + /// has been explicitly set. + var hasProtobufUnittest_complexOpt1: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_complex_opt1) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_complex_opt1`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_complexOpt1() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_complex_opt1) + } + + var ProtobufUnittest_complexOpt2: ProtobufUnittest_ComplexOptionType2 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_complex_opt2) ?? ProtobufUnittest_ComplexOptionType2()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_complex_opt2, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_complex_opt2` + /// has been explicitly set. + var hasProtobufUnittest_complexOpt2: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_complex_opt2) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_complex_opt2`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_complexOpt2() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_complex_opt2) + } + + var ProtobufUnittest_complexOpt3: ProtobufUnittest_ComplexOptionType3 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_complex_opt3) ?? ProtobufUnittest_ComplexOptionType3()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_complex_opt3, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_complex_opt3` + /// has been explicitly set. + var hasProtobufUnittest_complexOpt3: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_complex_opt3) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_complex_opt3`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_complexOpt3() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_complex_opt3) + } + + var ProtobufUnittest_complexOpt6: ProtobufUnittest_ComplexOpt6 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_ComplexOpt6) ?? ProtobufUnittest_ComplexOpt6()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_ComplexOpt6, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_ComplexOpt6` + /// has been explicitly set. + var hasProtobufUnittest_complexOpt6: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_ComplexOpt6) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_ComplexOpt6`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_complexOpt6() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_ComplexOpt6) + } + + var ProtobufUnittest_msgopt: ProtobufUnittest_Aggregate { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_msgopt) ?? ProtobufUnittest_Aggregate()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_msgopt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_msgopt` + /// has been explicitly set. + var hasProtobufUnittest_msgopt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_msgopt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_msgopt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_msgopt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_msgopt) + } + + var ProtobufUnittest_requiredEnumOpt: ProtobufUnittest_OldOptionType { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_required_enum_opt) ?? ProtobufUnittest_OldOptionType()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_required_enum_opt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_required_enum_opt` + /// has been explicitly set. + var hasProtobufUnittest_requiredEnumOpt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_required_enum_opt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_required_enum_opt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_requiredEnumOpt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_required_enum_opt) + } + + var ProtobufUnittest_ComplexOptionType2_ComplexOptionType4_complexOpt4: ProtobufUnittest_ComplexOptionType2.ComplexOptionType4 { + get {return getExtensionValue(ext: ProtobufUnittest_ComplexOptionType2.ComplexOptionType4.Extensions.complex_opt4) ?? ProtobufUnittest_ComplexOptionType2.ComplexOptionType4()} + set {setExtensionValue(ext: ProtobufUnittest_ComplexOptionType2.ComplexOptionType4.Extensions.complex_opt4, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_ComplexOptionType2.ComplexOptionType4.Extensions.complex_opt4` + /// has been explicitly set. + var hasProtobufUnittest_ComplexOptionType2_ComplexOptionType4_complexOpt4: Bool { + return hasExtensionValue(ext: ProtobufUnittest_ComplexOptionType2.ComplexOptionType4.Extensions.complex_opt4) + } + /// Clears the value of extension `ProtobufUnittest_ComplexOptionType2.ComplexOptionType4.Extensions.complex_opt4`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_ComplexOptionType2_ComplexOptionType4_complexOpt4() { + clearExtensionValue(ext: ProtobufUnittest_ComplexOptionType2.ComplexOptionType4.Extensions.complex_opt4) + } +} + +extension SwiftProtobuf.Google_Protobuf_MethodOptions { + + var ProtobufUnittest_methodOpt1: ProtobufUnittest_MethodOpt1 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_method_opt1) ?? .val1} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_method_opt1, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_method_opt1` + /// has been explicitly set. + var hasProtobufUnittest_methodOpt1: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_method_opt1) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_method_opt1`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_methodOpt1() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_method_opt1) + } + + var ProtobufUnittest_methodopt: ProtobufUnittest_Aggregate { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_methodopt) ?? ProtobufUnittest_Aggregate()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_methodopt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_methodopt` + /// has been explicitly set. + var hasProtobufUnittest_methodopt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_methodopt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_methodopt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_methodopt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_methodopt) + } +} + +extension SwiftProtobuf.Google_Protobuf_OneofOptions { + + var ProtobufUnittest_oneofOpt1: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_oneof_opt1) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_oneof_opt1, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_oneof_opt1` + /// has been explicitly set. + var hasProtobufUnittest_oneofOpt1: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_oneof_opt1) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_oneof_opt1`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_oneofOpt1() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_oneof_opt1) + } +} + +extension SwiftProtobuf.Google_Protobuf_ServiceOptions { + + var ProtobufUnittest_serviceOpt1: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_service_opt1) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_service_opt1, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_service_opt1` + /// has been explicitly set. + var hasProtobufUnittest_serviceOpt1: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_service_opt1) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_service_opt1`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_serviceOpt1() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_service_opt1) + } + + var ProtobufUnittest_serviceopt: ProtobufUnittest_Aggregate { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_serviceopt) ?? ProtobufUnittest_Aggregate()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_serviceopt, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_serviceopt` + /// has been explicitly set. + var hasProtobufUnittest_serviceopt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_serviceopt) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_serviceopt`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_serviceopt() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_serviceopt) + } + +} + +// MARK: - File's ExtensionMap: ProtobufUnittest_UnittestCustomOptions_Extensions + +/// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by +/// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed +/// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create +/// a larger `SwiftProtobuf.SimpleExtensionMap`. +let ProtobufUnittest_UnittestCustomOptions_Extensions: SwiftProtobuf.SimpleExtensionMap = [ + ProtobufUnittest_Extensions_file_opt1, + ProtobufUnittest_Extensions_message_opt1, + ProtobufUnittest_Extensions_field_opt1, + ProtobufUnittest_Extensions_field_opt2, + ProtobufUnittest_Extensions_oneof_opt1, + ProtobufUnittest_Extensions_enum_opt1, + ProtobufUnittest_Extensions_enum_value_opt1, + ProtobufUnittest_Extensions_service_opt1, + ProtobufUnittest_Extensions_method_opt1, + ProtobufUnittest_Extensions_bool_opt, + ProtobufUnittest_Extensions_int32_opt, + ProtobufUnittest_Extensions_int64_opt, + ProtobufUnittest_Extensions_uint32_opt, + ProtobufUnittest_Extensions_uint64_opt, + ProtobufUnittest_Extensions_sint32_opt, + ProtobufUnittest_Extensions_sint64_opt, + ProtobufUnittest_Extensions_fixed32_opt, + ProtobufUnittest_Extensions_fixed64_opt, + ProtobufUnittest_Extensions_sfixed32_opt, + ProtobufUnittest_Extensions_sfixed64_opt, + ProtobufUnittest_Extensions_float_opt, + ProtobufUnittest_Extensions_double_opt, + ProtobufUnittest_Extensions_string_opt, + ProtobufUnittest_Extensions_bytes_opt, + ProtobufUnittest_Extensions_enum_opt, + ProtobufUnittest_Extensions_message_type_opt, + ProtobufUnittest_Extensions_mooo, + ProtobufUnittest_Extensions_corge, + ProtobufUnittest_Extensions_grault, + ProtobufUnittest_Extensions_garply, + ProtobufUnittest_Extensions_complex_opt1, + ProtobufUnittest_Extensions_complex_opt2, + ProtobufUnittest_Extensions_complex_opt3, + ProtobufUnittest_Extensions_ComplexOpt6, + ProtobufUnittest_Extensions_fileopt, + ProtobufUnittest_Extensions_msgopt, + ProtobufUnittest_Extensions_fieldopt, + ProtobufUnittest_Extensions_enumopt, + ProtobufUnittest_Extensions_enumvalopt, + ProtobufUnittest_Extensions_serviceopt, + ProtobufUnittest_Extensions_methodopt, + ProtobufUnittest_Extensions_required_enum_opt, + ProtobufUnittest_ComplexOptionType2.ComplexOptionType4.Extensions.complex_opt4, + ProtobufUnittest_AggregateMessageSetElement.Extensions.message_set_extension, + ProtobufUnittest_Aggregate.Extensions.nested, + ProtobufUnittest_NestedOptionType.Extensions.nested_extension +] + +// Extension Objects - The only reason these might be needed is when manually +// constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_ +// accessors for the extension fields on the messages directly. + +let ProtobufUnittest_Extensions_file_opt1 = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_FileOptions>( + _protobuf_fieldNumber: 7736974, + fieldName: "protobuf_unittest.file_opt1" +) + +let ProtobufUnittest_Extensions_message_opt1 = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7739036, + fieldName: "protobuf_unittest.message_opt1" +) + +let ProtobufUnittest_Extensions_field_opt1 = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_FieldOptions>( + _protobuf_fieldNumber: 7740936, + fieldName: "protobuf_unittest.field_opt1" +) + +/// This is useful for testing that we correctly register default values for +/// extension options. +let ProtobufUnittest_Extensions_field_opt2 = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_FieldOptions>( + _protobuf_fieldNumber: 7753913, + fieldName: "protobuf_unittest.field_opt2" +) + +let ProtobufUnittest_Extensions_oneof_opt1 = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_OneofOptions>( + _protobuf_fieldNumber: 7740111, + fieldName: "protobuf_unittest.oneof_opt1" +) + +let ProtobufUnittest_Extensions_enum_opt1 = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_EnumOptions>( + _protobuf_fieldNumber: 7753576, + fieldName: "protobuf_unittest.enum_opt1" +) + +let ProtobufUnittest_Extensions_enum_value_opt1 = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_EnumValueOptions>( + _protobuf_fieldNumber: 1560678, + fieldName: "protobuf_unittest.enum_value_opt1" +) + +let ProtobufUnittest_Extensions_service_opt1 = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_ServiceOptions>( + _protobuf_fieldNumber: 7887650, + fieldName: "protobuf_unittest.service_opt1" +) + +let ProtobufUnittest_Extensions_method_opt1 = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MethodOptions>( + _protobuf_fieldNumber: 7890860, + fieldName: "protobuf_unittest.method_opt1" +) + +let ProtobufUnittest_Extensions_bool_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7706090, + fieldName: "protobuf_unittest.bool_opt" +) + +let ProtobufUnittest_Extensions_int32_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7705709, + fieldName: "protobuf_unittest.int32_opt" +) + +let ProtobufUnittest_Extensions_int64_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7705542, + fieldName: "protobuf_unittest.int64_opt" +) + +let ProtobufUnittest_Extensions_uint32_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7704880, + fieldName: "protobuf_unittest.uint32_opt" +) + +let ProtobufUnittest_Extensions_uint64_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7702367, + fieldName: "protobuf_unittest.uint64_opt" +) + +let ProtobufUnittest_Extensions_sint32_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7701568, + fieldName: "protobuf_unittest.sint32_opt" +) + +let ProtobufUnittest_Extensions_sint64_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7700863, + fieldName: "protobuf_unittest.sint64_opt" +) + +let ProtobufUnittest_Extensions_fixed32_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7700307, + fieldName: "protobuf_unittest.fixed32_opt" +) + +let ProtobufUnittest_Extensions_fixed64_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7700194, + fieldName: "protobuf_unittest.fixed64_opt" +) + +let ProtobufUnittest_Extensions_sfixed32_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7698645, + fieldName: "protobuf_unittest.sfixed32_opt" +) + +let ProtobufUnittest_Extensions_sfixed64_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7685475, + fieldName: "protobuf_unittest.sfixed64_opt" +) + +let ProtobufUnittest_Extensions_float_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7675390, + fieldName: "protobuf_unittest.float_opt" +) + +let ProtobufUnittest_Extensions_double_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7673293, + fieldName: "protobuf_unittest.double_opt" +) + +let ProtobufUnittest_Extensions_string_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7673285, + fieldName: "protobuf_unittest.string_opt" +) + +let ProtobufUnittest_Extensions_bytes_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7673238, + fieldName: "protobuf_unittest.bytes_opt" +) + +let ProtobufUnittest_Extensions_enum_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7673233, + fieldName: "protobuf_unittest.enum_opt" +) + +let ProtobufUnittest_Extensions_message_type_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7665967, + fieldName: "protobuf_unittest.message_type_opt" +) + +let ProtobufUnittest_Extensions_mooo = SwiftProtobuf.MessageExtension, ProtobufUnittest_ComplexOptionType1>( + _protobuf_fieldNumber: 7663707, + fieldName: "protobuf_unittest.mooo" +) + +let ProtobufUnittest_Extensions_corge = SwiftProtobuf.MessageExtension, ProtobufUnittest_ComplexOptionType1>( + _protobuf_fieldNumber: 7663442, + fieldName: "protobuf_unittest.corge" +) + +let ProtobufUnittest_Extensions_grault = SwiftProtobuf.MessageExtension, ProtobufUnittest_ComplexOptionType2>( + _protobuf_fieldNumber: 7650927, + fieldName: "protobuf_unittest.grault" +) + +let ProtobufUnittest_Extensions_garply = SwiftProtobuf.MessageExtension, ProtobufUnittest_ComplexOptionType2>( + _protobuf_fieldNumber: 7649992, + fieldName: "protobuf_unittest.garply" +) + +let ProtobufUnittest_Extensions_complex_opt1 = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7646756, + fieldName: "protobuf_unittest.complex_opt1" +) + +let ProtobufUnittest_Extensions_complex_opt2 = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7636949, + fieldName: "protobuf_unittest.complex_opt2" +) + +let ProtobufUnittest_Extensions_complex_opt3 = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7636463, + fieldName: "protobuf_unittest.complex_opt3" +) + +let ProtobufUnittest_Extensions_ComplexOpt6 = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7595468, + fieldName: "protobuf_unittest.complexopt6" +) + +let ProtobufUnittest_Extensions_fileopt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_FileOptions>( + _protobuf_fieldNumber: 15478479, + fieldName: "protobuf_unittest.fileopt" +) + +let ProtobufUnittest_Extensions_msgopt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 15480088, + fieldName: "protobuf_unittest.msgopt" +) + +let ProtobufUnittest_Extensions_fieldopt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_FieldOptions>( + _protobuf_fieldNumber: 15481374, + fieldName: "protobuf_unittest.fieldopt" +) + +let ProtobufUnittest_Extensions_enumopt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_EnumOptions>( + _protobuf_fieldNumber: 15483218, + fieldName: "protobuf_unittest.enumopt" +) + +let ProtobufUnittest_Extensions_enumvalopt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_EnumValueOptions>( + _protobuf_fieldNumber: 15486921, + fieldName: "protobuf_unittest.enumvalopt" +) + +let ProtobufUnittest_Extensions_serviceopt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_ServiceOptions>( + _protobuf_fieldNumber: 15497145, + fieldName: "protobuf_unittest.serviceopt" +) + +let ProtobufUnittest_Extensions_methodopt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MethodOptions>( + _protobuf_fieldNumber: 15512713, + fieldName: "protobuf_unittest.methodopt" +) + +let ProtobufUnittest_Extensions_required_enum_opt = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 106161807, + fieldName: "protobuf_unittest.required_enum_opt" +) + +extension ProtobufUnittest_ComplexOptionType2.ComplexOptionType4 { + enum Extensions { + static let complex_opt4 = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 7633546, + fieldName: "protobuf_unittest.ComplexOptionType2.ComplexOptionType4.complex_opt4" + ) + } +} + +extension ProtobufUnittest_AggregateMessageSetElement { + enum Extensions { + static let message_set_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_AggregateMessageSet>( + _protobuf_fieldNumber: 15447542, + fieldName: "protobuf_unittest.AggregateMessageSetElement" + ) + } +} + +extension ProtobufUnittest_Aggregate { + enum Extensions { + static let nested = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_FileOptions>( + _protobuf_fieldNumber: 15476903, + fieldName: "protobuf_unittest.Aggregate.nested" + ) + } +} + +extension ProtobufUnittest_NestedOptionType { + enum Extensions { + static let nested_extension = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_FileOptions>( + _protobuf_fieldNumber: 7912573, + fieldName: "protobuf_unittest.NestedOptionType.nested_extension" + ) + } +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest" + +extension ProtobufUnittest_MethodOpt1: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "METHODOPT1_VAL1"), + 2: .same(proto: "METHODOPT1_VAL2"), + ] +} + +extension ProtobufUnittest_AggregateEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "VALUE"), + ] +} + +extension ProtobufUnittest_TestMessageWithCustomOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMessageWithCustomOptions" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "field1"), + 2: .standard(proto: "oneof_field"), + 3: .standard(proto: "map_field"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._field1) }() + case 2: try { + var v: Int32? + try decoder.decodeSingularInt32Field(value: &v) + if let v = v { + if self.anOneof != nil {try decoder.handleConflictingOneOf()} + self.anOneof = .oneofField(v) + } + }() + case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.mapField) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._field1 { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if case .oneofField(let v)? = self.anOneof { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + if !self.mapField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.mapField, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMessageWithCustomOptions, rhs: ProtobufUnittest_TestMessageWithCustomOptions) -> Bool { + if lhs._field1 != rhs._field1 {return false} + if lhs.anOneof != rhs.anOneof {return false} + if lhs.mapField != rhs.mapField {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMessageWithCustomOptions.AnEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "ANENUM_VAL1"), + 2: .same(proto: "ANENUM_VAL2"), + ] +} + +extension ProtobufUnittest_CustomOptionFooRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".CustomOptionFooRequest" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_CustomOptionFooRequest, rhs: ProtobufUnittest_CustomOptionFooRequest) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_CustomOptionFooResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".CustomOptionFooResponse" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_CustomOptionFooResponse, rhs: ProtobufUnittest_CustomOptionFooResponse) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_CustomOptionFooClientMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".CustomOptionFooClientMessage" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_CustomOptionFooClientMessage, rhs: ProtobufUnittest_CustomOptionFooClientMessage) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_CustomOptionFooServerMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".CustomOptionFooServerMessage" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_CustomOptionFooServerMessage, rhs: ProtobufUnittest_CustomOptionFooServerMessage) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_DummyMessageContainingEnum: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".DummyMessageContainingEnum" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_DummyMessageContainingEnum, rhs: ProtobufUnittest_DummyMessageContainingEnum) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_DummyMessageContainingEnum.TestEnumType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + -23: .same(proto: "TEST_OPTION_ENUM_TYPE2"), + 22: .same(proto: "TEST_OPTION_ENUM_TYPE1"), + ] +} + +extension ProtobufUnittest_DummyMessageInvalidAsOptionType: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".DummyMessageInvalidAsOptionType" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_DummyMessageInvalidAsOptionType, rhs: ProtobufUnittest_DummyMessageInvalidAsOptionType) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_CustomOptionMinIntegerValues: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".CustomOptionMinIntegerValues" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_CustomOptionMinIntegerValues, rhs: ProtobufUnittest_CustomOptionMinIntegerValues) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_CustomOptionMaxIntegerValues: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".CustomOptionMaxIntegerValues" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_CustomOptionMaxIntegerValues, rhs: ProtobufUnittest_CustomOptionMaxIntegerValues) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_CustomOptionOtherValues: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".CustomOptionOtherValues" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_CustomOptionOtherValues, rhs: ProtobufUnittest_CustomOptionOtherValues) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_SettingRealsFromPositiveInts: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".SettingRealsFromPositiveInts" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_SettingRealsFromPositiveInts, rhs: ProtobufUnittest_SettingRealsFromPositiveInts) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_SettingRealsFromNegativeInts: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".SettingRealsFromNegativeInts" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_SettingRealsFromNegativeInts, rhs: ProtobufUnittest_SettingRealsFromNegativeInts) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_ComplexOptionType1: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ComplexOptionType1" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "foo"), + 2: .same(proto: "foo2"), + 3: .same(proto: "foo3"), + 4: .same(proto: "foo4"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._foo) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._foo2) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self._foo3) }() + case 4: try { try decoder.decodeRepeatedInt32Field(value: &self.foo4) }() + case 100..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_ComplexOptionType1.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._foo { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._foo2 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._foo3 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) + } }() + if !self.foo4.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.foo4, fieldNumber: 4) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 100, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_ComplexOptionType1, rhs: ProtobufUnittest_ComplexOptionType1) -> Bool { + if lhs._foo != rhs._foo {return false} + if lhs._foo2 != rhs._foo2 {return false} + if lhs._foo3 != rhs._foo3 {return false} + if lhs.foo4 != rhs.foo4 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_ComplexOptionType2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ComplexOptionType2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "bar"), + 2: .same(proto: "baz"), + 3: .same(proto: "fred"), + 4: .same(proto: "barney"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + if let v = self._bar, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._bar) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._baz) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._fred) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.barney) }() + case 100..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_ComplexOptionType2.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._bar { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._baz { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._fred { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + if !self.barney.isEmpty { + try visitor.visitRepeatedMessageField(value: self.barney, fieldNumber: 4) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 100, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_ComplexOptionType2, rhs: ProtobufUnittest_ComplexOptionType2) -> Bool { + if lhs._bar != rhs._bar {return false} + if lhs._baz != rhs._baz {return false} + if lhs._fred != rhs._fred {return false} + if lhs.barney != rhs.barney {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_ComplexOptionType2.ComplexOptionType4: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_ComplexOptionType2.protoMessageName + ".ComplexOptionType4" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "waldo"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._waldo) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._waldo { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_ComplexOptionType2.ComplexOptionType4, rhs: ProtobufUnittest_ComplexOptionType2.ComplexOptionType4) -> Bool { + if lhs._waldo != rhs._waldo {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_ComplexOptionType3: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ComplexOptionType3" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "moo"), + 2: .unique(proto: "ComplexOptionType5", json: "complexoptiontype5"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._moo) }() + case 2: try { try decoder.decodeSingularGroupField(value: &self._complexOptionType5) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._moo { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._complexOptionType5 { + try visitor.visitSingularGroupField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_ComplexOptionType3, rhs: ProtobufUnittest_ComplexOptionType3) -> Bool { + if lhs._moo != rhs._moo {return false} + if lhs._complexOptionType5 != rhs._complexOptionType5 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_ComplexOptionType3.ComplexOptionType5: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_ComplexOptionType3.protoMessageName + ".ComplexOptionType5" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 3: .same(proto: "plugh"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 3: try { try decoder.decodeSingularInt32Field(value: &self._plugh) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._plugh { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_ComplexOptionType3.ComplexOptionType5, rhs: ProtobufUnittest_ComplexOptionType3.ComplexOptionType5) -> Bool { + if lhs._plugh != rhs._plugh {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_ComplexOpt6: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ComplexOpt6" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 7593951: .same(proto: "xyzzy"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 7593951: try { try decoder.decodeSingularInt32Field(value: &self._xyzzy) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._xyzzy { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 7593951) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_ComplexOpt6, rhs: ProtobufUnittest_ComplexOpt6) -> Bool { + if lhs._xyzzy != rhs._xyzzy {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_VariousComplexOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".VariousComplexOptions" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_VariousComplexOptions, rhs: ProtobufUnittest_VariousComplexOptions) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_AggregateMessageSet: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AggregateMessageSet" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + try decoder.decodeExtensionFieldsAsMessageSet(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_AggregateMessageSet.self) + } + + func traverse(visitor: inout V) throws { + try visitor.visitExtensionFieldsAsMessageSet(fields: _protobuf_extensionFieldValues, start: 4, end: 2147483647) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_AggregateMessageSet, rhs: ProtobufUnittest_AggregateMessageSet) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_AggregateMessageSetElement: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AggregateMessageSetElement" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "s"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._s) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._s { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_AggregateMessageSetElement, rhs: ProtobufUnittest_AggregateMessageSetElement) -> Bool { + if lhs._s != rhs._s {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_Aggregate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Aggregate" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "i"), + 2: .same(proto: "s"), + 3: .same(proto: "sub"), + 4: .same(proto: "file"), + 5: .same(proto: "mset"), + 6: .same(proto: "any"), + ] + + fileprivate class _StorageClass { + var _i: Int32? = nil + var _s: String? = nil + var _sub: ProtobufUnittest_Aggregate? = nil + var _file: SwiftProtobuf.Google_Protobuf_FileOptions? = nil + var _mset: ProtobufUnittest_AggregateMessageSet? = nil + var _any: SwiftProtobuf.Google_Protobuf_Any? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _i = source._i + _s = source._s + _sub = source._sub + _file = source._file + _mset = source._mset + _any = source._any + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + public var isInitialized: Bool { + return withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if let v = _storage._sub, !v.isInitialized {return false} + if let v = _storage._file, !v.isInitialized {return false} + if let v = _storage._mset, !v.isInitialized {return false} + return true + } + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._i) }() + case 2: try { try decoder.decodeSingularStringField(value: &_storage._s) }() + case 3: try { try decoder.decodeSingularMessageField(value: &_storage._sub) }() + case 4: try { try decoder.decodeSingularMessageField(value: &_storage._file) }() + case 5: try { try decoder.decodeSingularMessageField(value: &_storage._mset) }() + case 6: try { try decoder.decodeSingularMessageField(value: &_storage._any) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._i { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._s { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._sub { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._file { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._mset { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + try { if let v = _storage._any { + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_Aggregate, rhs: ProtobufUnittest_Aggregate) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._i != rhs_storage._i {return false} + if _storage._s != rhs_storage._s {return false} + if _storage._sub != rhs_storage._sub {return false} + if _storage._file != rhs_storage._file {return false} + if _storage._mset != rhs_storage._mset {return false} + if _storage._any != rhs_storage._any {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_AggregateMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AggregateMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "fieldname"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._fieldname) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._fieldname { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_AggregateMessage, rhs: ProtobufUnittest_AggregateMessage) -> Bool { + if lhs._fieldname != rhs._fieldname {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_NestedOptionType: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".NestedOptionType" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_NestedOptionType, rhs: ProtobufUnittest_NestedOptionType) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_NestedOptionType.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "NESTED_ENUM_VALUE"), + ] +} + +extension ProtobufUnittest_NestedOptionType.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_NestedOptionType.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "nested_field"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._nestedField) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._nestedField { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_NestedOptionType.NestedMessage, rhs: ProtobufUnittest_NestedOptionType.NestedMessage) -> Bool { + if lhs._nestedField != rhs._nestedField {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_OldOptionType: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".OldOptionType" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "value"), + ] + + public var isInitialized: Bool { + if self._value == nil {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self._value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._value { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_OldOptionType, rhs: ProtobufUnittest_OldOptionType) -> Bool { + if lhs._value != rhs._value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_OldOptionType.TestEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "OLD_VALUE"), + ] +} + +extension ProtobufUnittest_NewOptionType: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".NewOptionType" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "value"), + ] + + public var isInitialized: Bool { + if self._value == nil {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self._value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._value { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_NewOptionType, rhs: ProtobufUnittest_NewOptionType) -> Bool { + if lhs._value != rhs._value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_NewOptionType.TestEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "OLD_VALUE"), + 1: .same(proto: "NEW_VALUE"), + ] +} + +extension ProtobufUnittest_TestMessageWithRequiredEnumOption: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMessageWithRequiredEnumOption" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMessageWithRequiredEnumOption, rhs: ProtobufUnittest_TestMessageWithRequiredEnumOption) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_drop_unknown_fields.pb.swift b/Reference/SwiftProtobufTests/unittest_drop_unknown_fields.pb.swift new file mode 100644 index 000000000..91919fe4b --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_drop_unknown_fields.pb.swift @@ -0,0 +1,269 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_drop_unknown_fields.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +struct UnittestDropUnknownFields_Foo { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var int32Value: Int32 = 0 + + var enumValue: UnittestDropUnknownFields_Foo.NestedEnum = .foo + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 0 + case bar // = 1 + case baz // = 2 + case UNRECOGNIZED(Int) + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .foo + case 1: self = .bar + case 2: self = .baz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .foo: return 0 + case .bar: return 1 + case .baz: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [UnittestDropUnknownFields_Foo.NestedEnum] = [ + .foo, + .bar, + .baz, + ] + + } + + init() {} +} + +struct UnittestDropUnknownFields_FooWithExtraFields { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var int32Value: Int32 = 0 + + var enumValue: UnittestDropUnknownFields_FooWithExtraFields.NestedEnum = .foo + + var extraInt32Value: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 0 + case bar // = 1 + case baz // = 2 + case moo // = 3 + case UNRECOGNIZED(Int) + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .foo + case 1: self = .bar + case 2: self = .baz + case 3: self = .moo + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .foo: return 0 + case .bar: return 1 + case .baz: return 2 + case .moo: return 3 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [UnittestDropUnknownFields_FooWithExtraFields.NestedEnum] = [ + .foo, + .bar, + .baz, + .moo, + ] + + } + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension UnittestDropUnknownFields_Foo: @unchecked Sendable {} +extension UnittestDropUnknownFields_FooWithExtraFields: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "unittest_drop_unknown_fields" + +extension UnittestDropUnknownFields_Foo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Foo" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "int32_value"), + 2: .standard(proto: "enum_value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.int32Value) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self.enumValue) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.int32Value != 0 { + try visitor.visitSingularInt32Field(value: self.int32Value, fieldNumber: 1) + } + if self.enumValue != .foo { + try visitor.visitSingularEnumField(value: self.enumValue, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: UnittestDropUnknownFields_Foo, rhs: UnittestDropUnknownFields_Foo) -> Bool { + if lhs.int32Value != rhs.int32Value {return false} + if lhs.enumValue != rhs.enumValue {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension UnittestDropUnknownFields_Foo.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FOO"), + 1: .same(proto: "BAR"), + 2: .same(proto: "BAZ"), + ] +} + +extension UnittestDropUnknownFields_FooWithExtraFields: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FooWithExtraFields" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "int32_value"), + 2: .standard(proto: "enum_value"), + 3: .standard(proto: "extra_int32_value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.int32Value) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self.enumValue) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self.extraInt32Value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.int32Value != 0 { + try visitor.visitSingularInt32Field(value: self.int32Value, fieldNumber: 1) + } + if self.enumValue != .foo { + try visitor.visitSingularEnumField(value: self.enumValue, fieldNumber: 2) + } + if self.extraInt32Value != 0 { + try visitor.visitSingularInt32Field(value: self.extraInt32Value, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: UnittestDropUnknownFields_FooWithExtraFields, rhs: UnittestDropUnknownFields_FooWithExtraFields) -> Bool { + if lhs.int32Value != rhs.int32Value {return false} + if lhs.enumValue != rhs.enumValue {return false} + if lhs.extraInt32Value != rhs.extraInt32Value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension UnittestDropUnknownFields_FooWithExtraFields.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FOO"), + 1: .same(proto: "BAR"), + 2: .same(proto: "BAZ"), + 3: .same(proto: "MOO"), + ] +} diff --git a/Reference/SwiftProtobufTests/unittest_embed_optimize_for.pb.swift b/Reference/SwiftProtobufTests/unittest_embed_optimize_for.pb.swift new file mode 100644 index 000000000..57fedcb0d --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_embed_optimize_for.pb.swift @@ -0,0 +1,138 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_embed_optimize_for.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// A proto file which imports a proto file that uses optimize_for = CODE_SIZE. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +struct ProtobufUnittest_TestEmbedOptimizedForSize { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Test that embedding a message which has optimize_for = CODE_SIZE into + /// one optimized for speed works. + var optionalMessage: ProtobufUnittest_TestOptimizedForSize { + get {return _optionalMessage ?? ProtobufUnittest_TestOptimizedForSize()} + set {_optionalMessage = newValue} + } + /// Returns true if `optionalMessage` has been explicitly set. + var hasOptionalMessage: Bool {return self._optionalMessage != nil} + /// Clears the value of `optionalMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalMessage() {self._optionalMessage = nil} + + var repeatedMessage: [ProtobufUnittest_TestOptimizedForSize] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalMessage: ProtobufUnittest_TestOptimizedForSize? = nil +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittest_TestEmbedOptimizedForSize: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest" + +extension ProtobufUnittest_TestEmbedOptimizedForSize: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestEmbedOptimizedForSize" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_message"), + 2: .standard(proto: "repeated_message"), + ] + + public var isInitialized: Bool { + if let v = self._optionalMessage, !v.isInitialized {return false} + if !SwiftProtobuf.Internal.areAllInitialized(self.repeatedMessage) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._optionalMessage) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedMessage) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if !self.repeatedMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedMessage, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestEmbedOptimizedForSize, rhs: ProtobufUnittest_TestEmbedOptimizedForSize) -> Bool { + if lhs._optionalMessage != rhs._optionalMessage {return false} + if lhs.repeatedMessage != rhs.repeatedMessage {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_empty.pb.swift b/Reference/SwiftProtobufTests/unittest_empty.pb.swift new file mode 100644 index 000000000..bfc5c7e6b --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_empty.pb.swift @@ -0,0 +1,60 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_empty.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// NOLINT(no_package_specified): Test proto with no package + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// This file intentionally left blank. (At one point this wouldn't compile +// correctly.) + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} diff --git a/Reference/SwiftProtobufTests/unittest_import.pb.swift b/Reference/SwiftProtobufTests/unittest_import.pb.swift new file mode 100644 index 000000000..a64829a78 --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_import.pb.swift @@ -0,0 +1,197 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_import.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// A proto file which is imported by unittest.proto to test importing. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum ProtobufUnittestImport_ImportEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case importFoo // = 7 + case importBar // = 8 + case importBaz // = 9 + + init() { + self = .importFoo + } + + init?(rawValue: Int) { + switch rawValue { + case 7: self = .importFoo + case 8: self = .importBar + case 9: self = .importBaz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .importFoo: return 7 + case .importBar: return 8 + case .importBaz: return 9 + } + } + +} + +/// To use an enum in a map, it must has the first value as 0. +enum ProtobufUnittestImport_ImportEnumForMap: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + case foo // = 1 + case bar // = 2 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .foo + case 2: self = .bar + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .foo: return 1 + case .bar: return 2 + } + } + +} + +struct ProtobufUnittestImport_ImportMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var d: Int32 { + get {return _d ?? 0} + set {_d = newValue} + } + /// Returns true if `d` has been explicitly set. + var hasD: Bool {return self._d != nil} + /// Clears the value of `d`. Subsequent reads from it will return its default value. + mutating func clearD() {self._d = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _d: Int32? = nil +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittestImport_ImportMessage: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest_import" + +extension ProtobufUnittestImport_ImportEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 7: .same(proto: "IMPORT_FOO"), + 8: .same(proto: "IMPORT_BAR"), + 9: .same(proto: "IMPORT_BAZ"), + ] +} + +extension ProtobufUnittestImport_ImportEnumForMap: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN"), + 1: .same(proto: "FOO"), + 2: .same(proto: "BAR"), + ] +} + +extension ProtobufUnittestImport_ImportMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ImportMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "d"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._d) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._d { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittestImport_ImportMessage, rhs: ProtobufUnittestImport_ImportMessage) -> Bool { + if lhs._d != rhs._d {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_import_lite.pb.swift b/Reference/SwiftProtobufTests/unittest_import_lite.pb.swift new file mode 100644 index 000000000..32541731b --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_import_lite.pb.swift @@ -0,0 +1,157 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_import_lite.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// +// This is like unittest_import.proto but with optimize_for = LITE_RUNTIME. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum ProtobufUnittestImport_ImportEnumLite: SwiftProtobuf.Enum { + typealias RawValue = Int + case importLiteFoo // = 7 + case importLiteBar // = 8 + case importLiteBaz // = 9 + + init() { + self = .importLiteFoo + } + + init?(rawValue: Int) { + switch rawValue { + case 7: self = .importLiteFoo + case 8: self = .importLiteBar + case 9: self = .importLiteBaz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .importLiteFoo: return 7 + case .importLiteBar: return 8 + case .importLiteBaz: return 9 + } + } + +} + +struct ProtobufUnittestImport_ImportMessageLite { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var d: Int32 { + get {return _d ?? 0} + set {_d = newValue} + } + /// Returns true if `d` has been explicitly set. + var hasD: Bool {return self._d != nil} + /// Clears the value of `d`. Subsequent reads from it will return its default value. + mutating func clearD() {self._d = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _d: Int32? = nil +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittestImport_ImportMessageLite: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest_import" + +extension ProtobufUnittestImport_ImportEnumLite: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 7: .same(proto: "IMPORT_LITE_FOO"), + 8: .same(proto: "IMPORT_LITE_BAR"), + 9: .same(proto: "IMPORT_LITE_BAZ"), + ] +} + +extension ProtobufUnittestImport_ImportMessageLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ImportMessageLite" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "d"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._d) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._d { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittestImport_ImportMessageLite, rhs: ProtobufUnittestImport_ImportMessageLite) -> Bool { + if lhs._d != rhs._d {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_import_public.pb.swift b/Reference/SwiftProtobufTests/unittest_import_public.pb.swift new file mode 100644 index 000000000..242ef1369 --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_import_public.pb.swift @@ -0,0 +1,118 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_import_public.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: liujisi@google.com (Pherl Liu) + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +struct ProtobufUnittestImport_PublicImportMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var e: Int32 { + get {return _e ?? 0} + set {_e = newValue} + } + /// Returns true if `e` has been explicitly set. + var hasE: Bool {return self._e != nil} + /// Clears the value of `e`. Subsequent reads from it will return its default value. + mutating func clearE() {self._e = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _e: Int32? = nil +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittestImport_PublicImportMessage: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest_import" + +extension ProtobufUnittestImport_PublicImportMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublicImportMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "e"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._e) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._e { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittestImport_PublicImportMessage, rhs: ProtobufUnittestImport_PublicImportMessage) -> Bool { + if lhs._e != rhs._e {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_import_public_lite.pb.swift b/Reference/SwiftProtobufTests/unittest_import_public_lite.pb.swift new file mode 100644 index 000000000..b252d56d2 --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_import_public_lite.pb.swift @@ -0,0 +1,118 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_import_public_lite.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: liujisi@google.com (Pherl Liu) + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +struct ProtobufUnittestImport_PublicImportMessageLite { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var e: Int32 { + get {return _e ?? 0} + set {_e = newValue} + } + /// Returns true if `e` has been explicitly set. + var hasE: Bool {return self._e != nil} + /// Clears the value of `e`. Subsequent reads from it will return its default value. + mutating func clearE() {self._e = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _e: Int32? = nil +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittestImport_PublicImportMessageLite: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest_import" + +extension ProtobufUnittestImport_PublicImportMessageLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PublicImportMessageLite" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "e"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._e) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._e { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittestImport_PublicImportMessageLite, rhs: ProtobufUnittestImport_PublicImportMessageLite) -> Bool { + if lhs._e != rhs._e {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_lite.pb.swift b/Reference/SwiftProtobufTests/unittest_lite.pb.swift new file mode 100644 index 000000000..ac1b08d3c --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_lite.pb.swift @@ -0,0 +1,5795 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_lite.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// +// This is like unittest.proto but with optimize_for = LITE_RUNTIME. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum ProtobufUnittest_ForeignEnumLite: SwiftProtobuf.Enum { + typealias RawValue = Int + case foreignLiteFoo // = 4 + case foreignLiteBaz // = 6 + case foreignLiteBar // = 5 + + init() { + self = .foreignLiteFoo + } + + init?(rawValue: Int) { + switch rawValue { + case 4: self = .foreignLiteFoo + case 5: self = .foreignLiteBar + case 6: self = .foreignLiteBaz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .foreignLiteFoo: return 4 + case .foreignLiteBar: return 5 + case .foreignLiteBaz: return 6 + } + } + +} + +enum ProtobufUnittest_V1EnumLite: SwiftProtobuf.Enum { + typealias RawValue = Int + case v1First // = 1 + + init() { + self = .v1First + } + + init?(rawValue: Int) { + switch rawValue { + case 1: self = .v1First + default: return nil + } + } + + var rawValue: Int { + switch self { + case .v1First: return 1 + } + } + +} + +enum ProtobufUnittest_V2EnumLite: SwiftProtobuf.Enum { + typealias RawValue = Int + case v2First // = 1 + case v2Second // = 2 + + init() { + self = .v2First + } + + init?(rawValue: Int) { + switch rawValue { + case 1: self = .v2First + case 2: self = .v2Second + default: return nil + } + } + + var rawValue: Int { + switch self { + case .v2First: return 1 + case .v2Second: return 2 + } + } + +} + +/// Same as TestAllTypes but with the lite runtime. +struct ProtobufUnittest_TestAllTypesLite { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Singular + var optionalInt32: Int32 { + get {return _storage._optionalInt32 ?? 0} + set {_uniqueStorage()._optionalInt32 = newValue} + } + /// Returns true if `optionalInt32` has been explicitly set. + var hasOptionalInt32: Bool {return _storage._optionalInt32 != nil} + /// Clears the value of `optionalInt32`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt32() {_uniqueStorage()._optionalInt32 = nil} + + var optionalInt64: Int64 { + get {return _storage._optionalInt64 ?? 0} + set {_uniqueStorage()._optionalInt64 = newValue} + } + /// Returns true if `optionalInt64` has been explicitly set. + var hasOptionalInt64: Bool {return _storage._optionalInt64 != nil} + /// Clears the value of `optionalInt64`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt64() {_uniqueStorage()._optionalInt64 = nil} + + var optionalUint32: UInt32 { + get {return _storage._optionalUint32 ?? 0} + set {_uniqueStorage()._optionalUint32 = newValue} + } + /// Returns true if `optionalUint32` has been explicitly set. + var hasOptionalUint32: Bool {return _storage._optionalUint32 != nil} + /// Clears the value of `optionalUint32`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint32() {_uniqueStorage()._optionalUint32 = nil} + + var optionalUint64: UInt64 { + get {return _storage._optionalUint64 ?? 0} + set {_uniqueStorage()._optionalUint64 = newValue} + } + /// Returns true if `optionalUint64` has been explicitly set. + var hasOptionalUint64: Bool {return _storage._optionalUint64 != nil} + /// Clears the value of `optionalUint64`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint64() {_uniqueStorage()._optionalUint64 = nil} + + var optionalSint32: Int32 { + get {return _storage._optionalSint32 ?? 0} + set {_uniqueStorage()._optionalSint32 = newValue} + } + /// Returns true if `optionalSint32` has been explicitly set. + var hasOptionalSint32: Bool {return _storage._optionalSint32 != nil} + /// Clears the value of `optionalSint32`. Subsequent reads from it will return its default value. + mutating func clearOptionalSint32() {_uniqueStorage()._optionalSint32 = nil} + + var optionalSint64: Int64 { + get {return _storage._optionalSint64 ?? 0} + set {_uniqueStorage()._optionalSint64 = newValue} + } + /// Returns true if `optionalSint64` has been explicitly set. + var hasOptionalSint64: Bool {return _storage._optionalSint64 != nil} + /// Clears the value of `optionalSint64`. Subsequent reads from it will return its default value. + mutating func clearOptionalSint64() {_uniqueStorage()._optionalSint64 = nil} + + var optionalFixed32: UInt32 { + get {return _storage._optionalFixed32 ?? 0} + set {_uniqueStorage()._optionalFixed32 = newValue} + } + /// Returns true if `optionalFixed32` has been explicitly set. + var hasOptionalFixed32: Bool {return _storage._optionalFixed32 != nil} + /// Clears the value of `optionalFixed32`. Subsequent reads from it will return its default value. + mutating func clearOptionalFixed32() {_uniqueStorage()._optionalFixed32 = nil} + + var optionalFixed64: UInt64 { + get {return _storage._optionalFixed64 ?? 0} + set {_uniqueStorage()._optionalFixed64 = newValue} + } + /// Returns true if `optionalFixed64` has been explicitly set. + var hasOptionalFixed64: Bool {return _storage._optionalFixed64 != nil} + /// Clears the value of `optionalFixed64`. Subsequent reads from it will return its default value. + mutating func clearOptionalFixed64() {_uniqueStorage()._optionalFixed64 = nil} + + var optionalSfixed32: Int32 { + get {return _storage._optionalSfixed32 ?? 0} + set {_uniqueStorage()._optionalSfixed32 = newValue} + } + /// Returns true if `optionalSfixed32` has been explicitly set. + var hasOptionalSfixed32: Bool {return _storage._optionalSfixed32 != nil} + /// Clears the value of `optionalSfixed32`. Subsequent reads from it will return its default value. + mutating func clearOptionalSfixed32() {_uniqueStorage()._optionalSfixed32 = nil} + + var optionalSfixed64: Int64 { + get {return _storage._optionalSfixed64 ?? 0} + set {_uniqueStorage()._optionalSfixed64 = newValue} + } + /// Returns true if `optionalSfixed64` has been explicitly set. + var hasOptionalSfixed64: Bool {return _storage._optionalSfixed64 != nil} + /// Clears the value of `optionalSfixed64`. Subsequent reads from it will return its default value. + mutating func clearOptionalSfixed64() {_uniqueStorage()._optionalSfixed64 = nil} + + var optionalFloat: Float { + get {return _storage._optionalFloat ?? 0} + set {_uniqueStorage()._optionalFloat = newValue} + } + /// Returns true if `optionalFloat` has been explicitly set. + var hasOptionalFloat: Bool {return _storage._optionalFloat != nil} + /// Clears the value of `optionalFloat`. Subsequent reads from it will return its default value. + mutating func clearOptionalFloat() {_uniqueStorage()._optionalFloat = nil} + + var optionalDouble: Double { + get {return _storage._optionalDouble ?? 0} + set {_uniqueStorage()._optionalDouble = newValue} + } + /// Returns true if `optionalDouble` has been explicitly set. + var hasOptionalDouble: Bool {return _storage._optionalDouble != nil} + /// Clears the value of `optionalDouble`. Subsequent reads from it will return its default value. + mutating func clearOptionalDouble() {_uniqueStorage()._optionalDouble = nil} + + var optionalBool: Bool { + get {return _storage._optionalBool ?? false} + set {_uniqueStorage()._optionalBool = newValue} + } + /// Returns true if `optionalBool` has been explicitly set. + var hasOptionalBool: Bool {return _storage._optionalBool != nil} + /// Clears the value of `optionalBool`. Subsequent reads from it will return its default value. + mutating func clearOptionalBool() {_uniqueStorage()._optionalBool = nil} + + var optionalString: String { + get {return _storage._optionalString ?? String()} + set {_uniqueStorage()._optionalString = newValue} + } + /// Returns true if `optionalString` has been explicitly set. + var hasOptionalString: Bool {return _storage._optionalString != nil} + /// Clears the value of `optionalString`. Subsequent reads from it will return its default value. + mutating func clearOptionalString() {_uniqueStorage()._optionalString = nil} + + var optionalBytes: Data { + get {return _storage._optionalBytes ?? Data()} + set {_uniqueStorage()._optionalBytes = newValue} + } + /// Returns true if `optionalBytes` has been explicitly set. + var hasOptionalBytes: Bool {return _storage._optionalBytes != nil} + /// Clears the value of `optionalBytes`. Subsequent reads from it will return its default value. + mutating func clearOptionalBytes() {_uniqueStorage()._optionalBytes = nil} + + var optionalGroup: ProtobufUnittest_TestAllTypesLite.OptionalGroup { + get {return _storage._optionalGroup ?? ProtobufUnittest_TestAllTypesLite.OptionalGroup()} + set {_uniqueStorage()._optionalGroup = newValue} + } + /// Returns true if `optionalGroup` has been explicitly set. + var hasOptionalGroup: Bool {return _storage._optionalGroup != nil} + /// Clears the value of `optionalGroup`. Subsequent reads from it will return its default value. + mutating func clearOptionalGroup() {_uniqueStorage()._optionalGroup = nil} + + var optionalNestedMessage: ProtobufUnittest_TestAllTypesLite.NestedMessage { + get {return _storage._optionalNestedMessage ?? ProtobufUnittest_TestAllTypesLite.NestedMessage()} + set {_uniqueStorage()._optionalNestedMessage = newValue} + } + /// Returns true if `optionalNestedMessage` has been explicitly set. + var hasOptionalNestedMessage: Bool {return _storage._optionalNestedMessage != nil} + /// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedMessage() {_uniqueStorage()._optionalNestedMessage = nil} + + var optionalForeignMessage: ProtobufUnittest_ForeignMessageLite { + get {return _storage._optionalForeignMessage ?? ProtobufUnittest_ForeignMessageLite()} + set {_uniqueStorage()._optionalForeignMessage = newValue} + } + /// Returns true if `optionalForeignMessage` has been explicitly set. + var hasOptionalForeignMessage: Bool {return _storage._optionalForeignMessage != nil} + /// Clears the value of `optionalForeignMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalForeignMessage() {_uniqueStorage()._optionalForeignMessage = nil} + + var optionalImportMessage: ProtobufUnittestImport_ImportMessageLite { + get {return _storage._optionalImportMessage ?? ProtobufUnittestImport_ImportMessageLite()} + set {_uniqueStorage()._optionalImportMessage = newValue} + } + /// Returns true if `optionalImportMessage` has been explicitly set. + var hasOptionalImportMessage: Bool {return _storage._optionalImportMessage != nil} + /// Clears the value of `optionalImportMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalImportMessage() {_uniqueStorage()._optionalImportMessage = nil} + + var optionalNestedEnum: ProtobufUnittest_TestAllTypesLite.NestedEnum { + get {return _storage._optionalNestedEnum ?? .foo} + set {_uniqueStorage()._optionalNestedEnum = newValue} + } + /// Returns true if `optionalNestedEnum` has been explicitly set. + var hasOptionalNestedEnum: Bool {return _storage._optionalNestedEnum != nil} + /// Clears the value of `optionalNestedEnum`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedEnum() {_uniqueStorage()._optionalNestedEnum = nil} + + var optionalForeignEnum: ProtobufUnittest_ForeignEnumLite { + get {return _storage._optionalForeignEnum ?? .foreignLiteFoo} + set {_uniqueStorage()._optionalForeignEnum = newValue} + } + /// Returns true if `optionalForeignEnum` has been explicitly set. + var hasOptionalForeignEnum: Bool {return _storage._optionalForeignEnum != nil} + /// Clears the value of `optionalForeignEnum`. Subsequent reads from it will return its default value. + mutating func clearOptionalForeignEnum() {_uniqueStorage()._optionalForeignEnum = nil} + + var optionalImportEnum: ProtobufUnittestImport_ImportEnumLite { + get {return _storage._optionalImportEnum ?? .importLiteFoo} + set {_uniqueStorage()._optionalImportEnum = newValue} + } + /// Returns true if `optionalImportEnum` has been explicitly set. + var hasOptionalImportEnum: Bool {return _storage._optionalImportEnum != nil} + /// Clears the value of `optionalImportEnum`. Subsequent reads from it will return its default value. + mutating func clearOptionalImportEnum() {_uniqueStorage()._optionalImportEnum = nil} + + var optionalStringPiece: String { + get {return _storage._optionalStringPiece ?? String()} + set {_uniqueStorage()._optionalStringPiece = newValue} + } + /// Returns true if `optionalStringPiece` has been explicitly set. + var hasOptionalStringPiece: Bool {return _storage._optionalStringPiece != nil} + /// Clears the value of `optionalStringPiece`. Subsequent reads from it will return its default value. + mutating func clearOptionalStringPiece() {_uniqueStorage()._optionalStringPiece = nil} + + var optionalCord: String { + get {return _storage._optionalCord ?? String()} + set {_uniqueStorage()._optionalCord = newValue} + } + /// Returns true if `optionalCord` has been explicitly set. + var hasOptionalCord: Bool {return _storage._optionalCord != nil} + /// Clears the value of `optionalCord`. Subsequent reads from it will return its default value. + mutating func clearOptionalCord() {_uniqueStorage()._optionalCord = nil} + + /// Defined in unittest_import_public.proto + var optionalPublicImportMessage: ProtobufUnittestImport_PublicImportMessageLite { + get {return _storage._optionalPublicImportMessage ?? ProtobufUnittestImport_PublicImportMessageLite()} + set {_uniqueStorage()._optionalPublicImportMessage = newValue} + } + /// Returns true if `optionalPublicImportMessage` has been explicitly set. + var hasOptionalPublicImportMessage: Bool {return _storage._optionalPublicImportMessage != nil} + /// Clears the value of `optionalPublicImportMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalPublicImportMessage() {_uniqueStorage()._optionalPublicImportMessage = nil} + + var optionalLazyMessage: ProtobufUnittest_TestAllTypesLite.NestedMessage { + get {return _storage._optionalLazyMessage ?? ProtobufUnittest_TestAllTypesLite.NestedMessage()} + set {_uniqueStorage()._optionalLazyMessage = newValue} + } + /// Returns true if `optionalLazyMessage` has been explicitly set. + var hasOptionalLazyMessage: Bool {return _storage._optionalLazyMessage != nil} + /// Clears the value of `optionalLazyMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalLazyMessage() {_uniqueStorage()._optionalLazyMessage = nil} + + var optionalUnverifiedLazyMessage: ProtobufUnittest_TestAllTypesLite.NestedMessage { + get {return _storage._optionalUnverifiedLazyMessage ?? ProtobufUnittest_TestAllTypesLite.NestedMessage()} + set {_uniqueStorage()._optionalUnverifiedLazyMessage = newValue} + } + /// Returns true if `optionalUnverifiedLazyMessage` has been explicitly set. + var hasOptionalUnverifiedLazyMessage: Bool {return _storage._optionalUnverifiedLazyMessage != nil} + /// Clears the value of `optionalUnverifiedLazyMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalUnverifiedLazyMessage() {_uniqueStorage()._optionalUnverifiedLazyMessage = nil} + + /// Repeated + var repeatedInt32: [Int32] { + get {return _storage._repeatedInt32} + set {_uniqueStorage()._repeatedInt32 = newValue} + } + + var repeatedInt64: [Int64] { + get {return _storage._repeatedInt64} + set {_uniqueStorage()._repeatedInt64 = newValue} + } + + var repeatedUint32: [UInt32] { + get {return _storage._repeatedUint32} + set {_uniqueStorage()._repeatedUint32 = newValue} + } + + var repeatedUint64: [UInt64] { + get {return _storage._repeatedUint64} + set {_uniqueStorage()._repeatedUint64 = newValue} + } + + var repeatedSint32: [Int32] { + get {return _storage._repeatedSint32} + set {_uniqueStorage()._repeatedSint32 = newValue} + } + + var repeatedSint64: [Int64] { + get {return _storage._repeatedSint64} + set {_uniqueStorage()._repeatedSint64 = newValue} + } + + var repeatedFixed32: [UInt32] { + get {return _storage._repeatedFixed32} + set {_uniqueStorage()._repeatedFixed32 = newValue} + } + + var repeatedFixed64: [UInt64] { + get {return _storage._repeatedFixed64} + set {_uniqueStorage()._repeatedFixed64 = newValue} + } + + var repeatedSfixed32: [Int32] { + get {return _storage._repeatedSfixed32} + set {_uniqueStorage()._repeatedSfixed32 = newValue} + } + + var repeatedSfixed64: [Int64] { + get {return _storage._repeatedSfixed64} + set {_uniqueStorage()._repeatedSfixed64 = newValue} + } + + var repeatedFloat: [Float] { + get {return _storage._repeatedFloat} + set {_uniqueStorage()._repeatedFloat = newValue} + } + + var repeatedDouble: [Double] { + get {return _storage._repeatedDouble} + set {_uniqueStorage()._repeatedDouble = newValue} + } + + var repeatedBool: [Bool] { + get {return _storage._repeatedBool} + set {_uniqueStorage()._repeatedBool = newValue} + } + + var repeatedString: [String] { + get {return _storage._repeatedString} + set {_uniqueStorage()._repeatedString = newValue} + } + + var repeatedBytes: [Data] { + get {return _storage._repeatedBytes} + set {_uniqueStorage()._repeatedBytes = newValue} + } + + var repeatedGroup: [ProtobufUnittest_TestAllTypesLite.RepeatedGroup] { + get {return _storage._repeatedGroup} + set {_uniqueStorage()._repeatedGroup = newValue} + } + + var repeatedNestedMessage: [ProtobufUnittest_TestAllTypesLite.NestedMessage] { + get {return _storage._repeatedNestedMessage} + set {_uniqueStorage()._repeatedNestedMessage = newValue} + } + + var repeatedForeignMessage: [ProtobufUnittest_ForeignMessageLite] { + get {return _storage._repeatedForeignMessage} + set {_uniqueStorage()._repeatedForeignMessage = newValue} + } + + var repeatedImportMessage: [ProtobufUnittestImport_ImportMessageLite] { + get {return _storage._repeatedImportMessage} + set {_uniqueStorage()._repeatedImportMessage = newValue} + } + + var repeatedNestedEnum: [ProtobufUnittest_TestAllTypesLite.NestedEnum] { + get {return _storage._repeatedNestedEnum} + set {_uniqueStorage()._repeatedNestedEnum = newValue} + } + + var repeatedForeignEnum: [ProtobufUnittest_ForeignEnumLite] { + get {return _storage._repeatedForeignEnum} + set {_uniqueStorage()._repeatedForeignEnum = newValue} + } + + var repeatedImportEnum: [ProtobufUnittestImport_ImportEnumLite] { + get {return _storage._repeatedImportEnum} + set {_uniqueStorage()._repeatedImportEnum = newValue} + } + + var repeatedStringPiece: [String] { + get {return _storage._repeatedStringPiece} + set {_uniqueStorage()._repeatedStringPiece = newValue} + } + + var repeatedCord: [String] { + get {return _storage._repeatedCord} + set {_uniqueStorage()._repeatedCord = newValue} + } + + var repeatedLazyMessage: [ProtobufUnittest_TestAllTypesLite.NestedMessage] { + get {return _storage._repeatedLazyMessage} + set {_uniqueStorage()._repeatedLazyMessage = newValue} + } + + /// Singular with defaults + var defaultInt32: Int32 { + get {return _storage._defaultInt32 ?? 41} + set {_uniqueStorage()._defaultInt32 = newValue} + } + /// Returns true if `defaultInt32` has been explicitly set. + var hasDefaultInt32: Bool {return _storage._defaultInt32 != nil} + /// Clears the value of `defaultInt32`. Subsequent reads from it will return its default value. + mutating func clearDefaultInt32() {_uniqueStorage()._defaultInt32 = nil} + + var defaultInt64: Int64 { + get {return _storage._defaultInt64 ?? 42} + set {_uniqueStorage()._defaultInt64 = newValue} + } + /// Returns true if `defaultInt64` has been explicitly set. + var hasDefaultInt64: Bool {return _storage._defaultInt64 != nil} + /// Clears the value of `defaultInt64`. Subsequent reads from it will return its default value. + mutating func clearDefaultInt64() {_uniqueStorage()._defaultInt64 = nil} + + var defaultUint32: UInt32 { + get {return _storage._defaultUint32 ?? 43} + set {_uniqueStorage()._defaultUint32 = newValue} + } + /// Returns true if `defaultUint32` has been explicitly set. + var hasDefaultUint32: Bool {return _storage._defaultUint32 != nil} + /// Clears the value of `defaultUint32`. Subsequent reads from it will return its default value. + mutating func clearDefaultUint32() {_uniqueStorage()._defaultUint32 = nil} + + var defaultUint64: UInt64 { + get {return _storage._defaultUint64 ?? 44} + set {_uniqueStorage()._defaultUint64 = newValue} + } + /// Returns true if `defaultUint64` has been explicitly set. + var hasDefaultUint64: Bool {return _storage._defaultUint64 != nil} + /// Clears the value of `defaultUint64`. Subsequent reads from it will return its default value. + mutating func clearDefaultUint64() {_uniqueStorage()._defaultUint64 = nil} + + var defaultSint32: Int32 { + get {return _storage._defaultSint32 ?? -45} + set {_uniqueStorage()._defaultSint32 = newValue} + } + /// Returns true if `defaultSint32` has been explicitly set. + var hasDefaultSint32: Bool {return _storage._defaultSint32 != nil} + /// Clears the value of `defaultSint32`. Subsequent reads from it will return its default value. + mutating func clearDefaultSint32() {_uniqueStorage()._defaultSint32 = nil} + + var defaultSint64: Int64 { + get {return _storage._defaultSint64 ?? 46} + set {_uniqueStorage()._defaultSint64 = newValue} + } + /// Returns true if `defaultSint64` has been explicitly set. + var hasDefaultSint64: Bool {return _storage._defaultSint64 != nil} + /// Clears the value of `defaultSint64`. Subsequent reads from it will return its default value. + mutating func clearDefaultSint64() {_uniqueStorage()._defaultSint64 = nil} + + var defaultFixed32: UInt32 { + get {return _storage._defaultFixed32 ?? 47} + set {_uniqueStorage()._defaultFixed32 = newValue} + } + /// Returns true if `defaultFixed32` has been explicitly set. + var hasDefaultFixed32: Bool {return _storage._defaultFixed32 != nil} + /// Clears the value of `defaultFixed32`. Subsequent reads from it will return its default value. + mutating func clearDefaultFixed32() {_uniqueStorage()._defaultFixed32 = nil} + + var defaultFixed64: UInt64 { + get {return _storage._defaultFixed64 ?? 48} + set {_uniqueStorage()._defaultFixed64 = newValue} + } + /// Returns true if `defaultFixed64` has been explicitly set. + var hasDefaultFixed64: Bool {return _storage._defaultFixed64 != nil} + /// Clears the value of `defaultFixed64`. Subsequent reads from it will return its default value. + mutating func clearDefaultFixed64() {_uniqueStorage()._defaultFixed64 = nil} + + var defaultSfixed32: Int32 { + get {return _storage._defaultSfixed32 ?? 49} + set {_uniqueStorage()._defaultSfixed32 = newValue} + } + /// Returns true if `defaultSfixed32` has been explicitly set. + var hasDefaultSfixed32: Bool {return _storage._defaultSfixed32 != nil} + /// Clears the value of `defaultSfixed32`. Subsequent reads from it will return its default value. + mutating func clearDefaultSfixed32() {_uniqueStorage()._defaultSfixed32 = nil} + + var defaultSfixed64: Int64 { + get {return _storage._defaultSfixed64 ?? -50} + set {_uniqueStorage()._defaultSfixed64 = newValue} + } + /// Returns true if `defaultSfixed64` has been explicitly set. + var hasDefaultSfixed64: Bool {return _storage._defaultSfixed64 != nil} + /// Clears the value of `defaultSfixed64`. Subsequent reads from it will return its default value. + mutating func clearDefaultSfixed64() {_uniqueStorage()._defaultSfixed64 = nil} + + var defaultFloat: Float { + get {return _storage._defaultFloat ?? 51.5} + set {_uniqueStorage()._defaultFloat = newValue} + } + /// Returns true if `defaultFloat` has been explicitly set. + var hasDefaultFloat: Bool {return _storage._defaultFloat != nil} + /// Clears the value of `defaultFloat`. Subsequent reads from it will return its default value. + mutating func clearDefaultFloat() {_uniqueStorage()._defaultFloat = nil} + + var defaultDouble: Double { + get {return _storage._defaultDouble ?? 52000} + set {_uniqueStorage()._defaultDouble = newValue} + } + /// Returns true if `defaultDouble` has been explicitly set. + var hasDefaultDouble: Bool {return _storage._defaultDouble != nil} + /// Clears the value of `defaultDouble`. Subsequent reads from it will return its default value. + mutating func clearDefaultDouble() {_uniqueStorage()._defaultDouble = nil} + + var defaultBool: Bool { + get {return _storage._defaultBool ?? true} + set {_uniqueStorage()._defaultBool = newValue} + } + /// Returns true if `defaultBool` has been explicitly set. + var hasDefaultBool: Bool {return _storage._defaultBool != nil} + /// Clears the value of `defaultBool`. Subsequent reads from it will return its default value. + mutating func clearDefaultBool() {_uniqueStorage()._defaultBool = nil} + + var defaultString: String { + get {return _storage._defaultString ?? "hello"} + set {_uniqueStorage()._defaultString = newValue} + } + /// Returns true if `defaultString` has been explicitly set. + var hasDefaultString: Bool {return _storage._defaultString != nil} + /// Clears the value of `defaultString`. Subsequent reads from it will return its default value. + mutating func clearDefaultString() {_uniqueStorage()._defaultString = nil} + + var defaultBytes: Data { + get {return _storage._defaultBytes ?? Data([119, 111, 114, 108, 100])} + set {_uniqueStorage()._defaultBytes = newValue} + } + /// Returns true if `defaultBytes` has been explicitly set. + var hasDefaultBytes: Bool {return _storage._defaultBytes != nil} + /// Clears the value of `defaultBytes`. Subsequent reads from it will return its default value. + mutating func clearDefaultBytes() {_uniqueStorage()._defaultBytes = nil} + + var defaultNestedEnum: ProtobufUnittest_TestAllTypesLite.NestedEnum { + get {return _storage._defaultNestedEnum ?? .bar} + set {_uniqueStorage()._defaultNestedEnum = newValue} + } + /// Returns true if `defaultNestedEnum` has been explicitly set. + var hasDefaultNestedEnum: Bool {return _storage._defaultNestedEnum != nil} + /// Clears the value of `defaultNestedEnum`. Subsequent reads from it will return its default value. + mutating func clearDefaultNestedEnum() {_uniqueStorage()._defaultNestedEnum = nil} + + var defaultForeignEnum: ProtobufUnittest_ForeignEnumLite { + get {return _storage._defaultForeignEnum ?? .foreignLiteBar} + set {_uniqueStorage()._defaultForeignEnum = newValue} + } + /// Returns true if `defaultForeignEnum` has been explicitly set. + var hasDefaultForeignEnum: Bool {return _storage._defaultForeignEnum != nil} + /// Clears the value of `defaultForeignEnum`. Subsequent reads from it will return its default value. + mutating func clearDefaultForeignEnum() {_uniqueStorage()._defaultForeignEnum = nil} + + var defaultImportEnum: ProtobufUnittestImport_ImportEnumLite { + get {return _storage._defaultImportEnum ?? .importLiteBar} + set {_uniqueStorage()._defaultImportEnum = newValue} + } + /// Returns true if `defaultImportEnum` has been explicitly set. + var hasDefaultImportEnum: Bool {return _storage._defaultImportEnum != nil} + /// Clears the value of `defaultImportEnum`. Subsequent reads from it will return its default value. + mutating func clearDefaultImportEnum() {_uniqueStorage()._defaultImportEnum = nil} + + var defaultStringPiece: String { + get {return _storage._defaultStringPiece ?? "abc"} + set {_uniqueStorage()._defaultStringPiece = newValue} + } + /// Returns true if `defaultStringPiece` has been explicitly set. + var hasDefaultStringPiece: Bool {return _storage._defaultStringPiece != nil} + /// Clears the value of `defaultStringPiece`. Subsequent reads from it will return its default value. + mutating func clearDefaultStringPiece() {_uniqueStorage()._defaultStringPiece = nil} + + var defaultCord: String { + get {return _storage._defaultCord ?? "123"} + set {_uniqueStorage()._defaultCord = newValue} + } + /// Returns true if `defaultCord` has been explicitly set. + var hasDefaultCord: Bool {return _storage._defaultCord != nil} + /// Clears the value of `defaultCord`. Subsequent reads from it will return its default value. + mutating func clearDefaultCord() {_uniqueStorage()._defaultCord = nil} + + /// For oneof test + var oneofField: OneOf_OneofField? { + get {return _storage._oneofField} + set {_uniqueStorage()._oneofField = newValue} + } + + var oneofUint32: UInt32 { + get { + if case .oneofUint32(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofUint32(newValue)} + } + + var oneofNestedMessage: ProtobufUnittest_TestAllTypesLite.NestedMessage { + get { + if case .oneofNestedMessage(let v)? = _storage._oneofField {return v} + return ProtobufUnittest_TestAllTypesLite.NestedMessage() + } + set {_uniqueStorage()._oneofField = .oneofNestedMessage(newValue)} + } + + var oneofString: String { + get { + if case .oneofString(let v)? = _storage._oneofField {return v} + return String() + } + set {_uniqueStorage()._oneofField = .oneofString(newValue)} + } + + var oneofBytes: Data { + get { + if case .oneofBytes(let v)? = _storage._oneofField {return v} + return Data() + } + set {_uniqueStorage()._oneofField = .oneofBytes(newValue)} + } + + var oneofLazyNestedMessage: ProtobufUnittest_TestAllTypesLite.NestedMessage { + get { + if case .oneofLazyNestedMessage(let v)? = _storage._oneofField {return v} + return ProtobufUnittest_TestAllTypesLite.NestedMessage() + } + set {_uniqueStorage()._oneofField = .oneofLazyNestedMessage(newValue)} + } + + var oneofNestedMessage2: ProtobufUnittest_TestAllTypesLite.NestedMessage2 { + get { + if case .oneofNestedMessage2(let v)? = _storage._oneofField {return v} + return ProtobufUnittest_TestAllTypesLite.NestedMessage2() + } + set {_uniqueStorage()._oneofField = .oneofNestedMessage2(newValue)} + } + + /// Tests toString for non-repeated fields with a list suffix + var deceptivelyNamedList: Int32 { + get {return _storage._deceptivelyNamedList ?? 0} + set {_uniqueStorage()._deceptivelyNamedList = newValue} + } + /// Returns true if `deceptivelyNamedList` has been explicitly set. + var hasDeceptivelyNamedList: Bool {return _storage._deceptivelyNamedList != nil} + /// Clears the value of `deceptivelyNamedList`. Subsequent reads from it will return its default value. + mutating func clearDeceptivelyNamedList() {_uniqueStorage()._deceptivelyNamedList = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + /// For oneof test + enum OneOf_OneofField: Equatable { + case oneofUint32(UInt32) + case oneofNestedMessage(ProtobufUnittest_TestAllTypesLite.NestedMessage) + case oneofString(String) + case oneofBytes(Data) + case oneofLazyNestedMessage(ProtobufUnittest_TestAllTypesLite.NestedMessage) + case oneofNestedMessage2(ProtobufUnittest_TestAllTypesLite.NestedMessage2) + + } + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 1 + case bar // = 2 + case baz // = 3 + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case 1: self = .foo + case 2: self = .bar + case 3: self = .baz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .foo: return 1 + case .bar: return 2 + case .baz: return 3 + } + } + + } + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var bb: Int32 { + get {return _bb ?? 0} + set {_bb = newValue} + } + /// Returns true if `bb` has been explicitly set. + var hasBb: Bool {return self._bb != nil} + /// Clears the value of `bb`. Subsequent reads from it will return its default value. + mutating func clearBb() {self._bb = nil} + + var cc: Int64 { + get {return _cc ?? 0} + set {_cc = newValue} + } + /// Returns true if `cc` has been explicitly set. + var hasCc: Bool {return self._cc != nil} + /// Clears the value of `cc`. Subsequent reads from it will return its default value. + mutating func clearCc() {self._cc = nil} + + var dd: [Int32] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _bb: Int32? = nil + fileprivate var _cc: Int64? = nil + } + + struct NestedMessage2 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var dd: Int32 { + get {return _dd ?? 0} + set {_dd = newValue} + } + /// Returns true if `dd` has been explicitly set. + var hasDd: Bool {return self._dd != nil} + /// Clears the value of `dd`. Subsequent reads from it will return its default value. + mutating func clearDd() {self._dd = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _dd: Int32? = nil + } + + struct OptionalGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + } + + struct RepeatedGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufUnittest_ForeignMessageLite { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var c: Int32 { + get {return _c ?? 0} + set {_c = newValue} + } + /// Returns true if `c` has been explicitly set. + var hasC: Bool {return self._c != nil} + /// Clears the value of `c`. Subsequent reads from it will return its default value. + mutating func clearC() {self._c = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _c: Int32? = nil +} + +struct ProtobufUnittest_TestPackedTypesLite { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var packedInt32: [Int32] = [] + + var packedInt64: [Int64] = [] + + var packedUint32: [UInt32] = [] + + var packedUint64: [UInt64] = [] + + var packedSint32: [Int32] = [] + + var packedSint64: [Int64] = [] + + var packedFixed32: [UInt32] = [] + + var packedFixed64: [UInt64] = [] + + var packedSfixed32: [Int32] = [] + + var packedSfixed64: [Int64] = [] + + var packedFloat: [Float] = [] + + var packedDouble: [Double] = [] + + var packedBool: [Bool] = [] + + var packedEnum: [ProtobufUnittest_ForeignEnumLite] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_TestAllExtensionsLite: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() +} + +struct ProtobufUnittest_OptionalGroup_extension_lite { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil +} + +struct ProtobufUnittest_RepeatedGroup_extension_lite { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil +} + +struct ProtobufUnittest_TestPackedExtensionsLite: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() +} + +struct ProtobufUnittest_TestNestedExtensionLite { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Test that deprecated fields work. We only verify that they compile (at one +/// point this failed). +struct ProtobufUnittest_TestDeprecatedLite { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var deprecatedField: Int32 { + get {return _storage._deprecatedField ?? 0} + set {_uniqueStorage()._deprecatedField = newValue} + } + /// Returns true if `deprecatedField` has been explicitly set. + var hasDeprecatedField: Bool {return _storage._deprecatedField != nil} + /// Clears the value of `deprecatedField`. Subsequent reads from it will return its default value. + mutating func clearDeprecatedField() {_uniqueStorage()._deprecatedField = nil} + + var deprecatedField2: Int32 { + get {return _storage._deprecatedField2 ?? 0} + set {_uniqueStorage()._deprecatedField2 = newValue} + } + /// Returns true if `deprecatedField2` has been explicitly set. + var hasDeprecatedField2: Bool {return _storage._deprecatedField2 != nil} + /// Clears the value of `deprecatedField2`. Subsequent reads from it will return its default value. + mutating func clearDeprecatedField2() {_uniqueStorage()._deprecatedField2 = nil} + + var deprecatedField3: String { + get {return _storage._deprecatedField3 ?? String()} + set {_uniqueStorage()._deprecatedField3 = newValue} + } + /// Returns true if `deprecatedField3` has been explicitly set. + var hasDeprecatedField3: Bool {return _storage._deprecatedField3 != nil} + /// Clears the value of `deprecatedField3`. Subsequent reads from it will return its default value. + mutating func clearDeprecatedField3() {_uniqueStorage()._deprecatedField3 = nil} + + var deprecatedField4: ProtobufUnittest_TestDeprecatedLite { + get {return _storage._deprecatedField4 ?? ProtobufUnittest_TestDeprecatedLite()} + set {_uniqueStorage()._deprecatedField4 = newValue} + } + /// Returns true if `deprecatedField4` has been explicitly set. + var hasDeprecatedField4: Bool {return _storage._deprecatedField4 != nil} + /// Clears the value of `deprecatedField4`. Subsequent reads from it will return its default value. + mutating func clearDeprecatedField4() {_uniqueStorage()._deprecatedField4 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +/// See the comments of the same type in unittest.proto. +struct ProtobufUnittest_TestParsingMergeLite: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var requiredAllTypes: ProtobufUnittest_TestAllTypesLite { + get {return _requiredAllTypes ?? ProtobufUnittest_TestAllTypesLite()} + set {_requiredAllTypes = newValue} + } + /// Returns true if `requiredAllTypes` has been explicitly set. + var hasRequiredAllTypes: Bool {return self._requiredAllTypes != nil} + /// Clears the value of `requiredAllTypes`. Subsequent reads from it will return its default value. + mutating func clearRequiredAllTypes() {self._requiredAllTypes = nil} + + var optionalAllTypes: ProtobufUnittest_TestAllTypesLite { + get {return _optionalAllTypes ?? ProtobufUnittest_TestAllTypesLite()} + set {_optionalAllTypes = newValue} + } + /// Returns true if `optionalAllTypes` has been explicitly set. + var hasOptionalAllTypes: Bool {return self._optionalAllTypes != nil} + /// Clears the value of `optionalAllTypes`. Subsequent reads from it will return its default value. + mutating func clearOptionalAllTypes() {self._optionalAllTypes = nil} + + var repeatedAllTypes: [ProtobufUnittest_TestAllTypesLite] = [] + + var optionalGroup: ProtobufUnittest_TestParsingMergeLite.OptionalGroup { + get {return _optionalGroup ?? ProtobufUnittest_TestParsingMergeLite.OptionalGroup()} + set {_optionalGroup = newValue} + } + /// Returns true if `optionalGroup` has been explicitly set. + var hasOptionalGroup: Bool {return self._optionalGroup != nil} + /// Clears the value of `optionalGroup`. Subsequent reads from it will return its default value. + mutating func clearOptionalGroup() {self._optionalGroup = nil} + + var repeatedGroup: [ProtobufUnittest_TestParsingMergeLite.RepeatedGroup] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct RepeatedFieldsGenerator { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var field1: [ProtobufUnittest_TestAllTypesLite] = [] + + var field2: [ProtobufUnittest_TestAllTypesLite] = [] + + var field3: [ProtobufUnittest_TestAllTypesLite] = [] + + var group1: [ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator.Group1] = [] + + var group2: [ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator.Group2] = [] + + var ext1: [ProtobufUnittest_TestAllTypesLite] = [] + + var ext2: [ProtobufUnittest_TestAllTypesLite] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct Group1 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var field1: ProtobufUnittest_TestAllTypesLite { + get {return _field1 ?? ProtobufUnittest_TestAllTypesLite()} + set {_field1 = newValue} + } + /// Returns true if `field1` has been explicitly set. + var hasField1: Bool {return self._field1 != nil} + /// Clears the value of `field1`. Subsequent reads from it will return its default value. + mutating func clearField1() {self._field1 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _field1: ProtobufUnittest_TestAllTypesLite? = nil + } + + struct Group2 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var field1: ProtobufUnittest_TestAllTypesLite { + get {return _field1 ?? ProtobufUnittest_TestAllTypesLite()} + set {_field1 = newValue} + } + /// Returns true if `field1` has been explicitly set. + var hasField1: Bool {return self._field1 != nil} + /// Clears the value of `field1`. Subsequent reads from it will return its default value. + mutating func clearField1() {self._field1 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _field1: ProtobufUnittest_TestAllTypesLite? = nil + } + + init() {} + } + + struct OptionalGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalGroupAllTypes: ProtobufUnittest_TestAllTypesLite { + get {return _optionalGroupAllTypes ?? ProtobufUnittest_TestAllTypesLite()} + set {_optionalGroupAllTypes = newValue} + } + /// Returns true if `optionalGroupAllTypes` has been explicitly set. + var hasOptionalGroupAllTypes: Bool {return self._optionalGroupAllTypes != nil} + /// Clears the value of `optionalGroupAllTypes`. Subsequent reads from it will return its default value. + mutating func clearOptionalGroupAllTypes() {self._optionalGroupAllTypes = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _optionalGroupAllTypes: ProtobufUnittest_TestAllTypesLite? = nil + } + + struct RepeatedGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var repeatedGroupAllTypes: ProtobufUnittest_TestAllTypesLite { + get {return _repeatedGroupAllTypes ?? ProtobufUnittest_TestAllTypesLite()} + set {_repeatedGroupAllTypes = newValue} + } + /// Returns true if `repeatedGroupAllTypes` has been explicitly set. + var hasRepeatedGroupAllTypes: Bool {return self._repeatedGroupAllTypes != nil} + /// Clears the value of `repeatedGroupAllTypes`. Subsequent reads from it will return its default value. + mutating func clearRepeatedGroupAllTypes() {self._repeatedGroupAllTypes = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _repeatedGroupAllTypes: ProtobufUnittest_TestAllTypesLite? = nil + } + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _requiredAllTypes: ProtobufUnittest_TestAllTypesLite? = nil + fileprivate var _optionalAllTypes: ProtobufUnittest_TestAllTypesLite? = nil + fileprivate var _optionalGroup: ProtobufUnittest_TestParsingMergeLite.OptionalGroup? = nil +} + +/// Test that the correct exception is thrown by parseFrom in a corner case +/// involving merging, extensions, and required fields. +struct ProtobufUnittest_TestMergeExceptionLite { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var allExtensions: ProtobufUnittest_TestAllExtensionsLite { + get {return _allExtensions ?? ProtobufUnittest_TestAllExtensionsLite()} + set {_allExtensions = newValue} + } + /// Returns true if `allExtensions` has been explicitly set. + var hasAllExtensions: Bool {return self._allExtensions != nil} + /// Clears the value of `allExtensions`. Subsequent reads from it will return its default value. + mutating func clearAllExtensions() {self._allExtensions = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _allExtensions: ProtobufUnittest_TestAllExtensionsLite? = nil +} + +/// TestEmptyMessageLite is used to test unknown fields support in lite mode. +struct ProtobufUnittest_TestEmptyMessageLite { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Like above, but declare all field numbers as potential extensions. No +/// actual extensions should ever be defined for this type. +struct ProtobufUnittest_TestEmptyMessageWithExtensionsLite: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() +} + +struct ProtobufUnittest_V1MessageLite { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var intField: Int32 { + get {return _intField ?? 0} + set {_intField = newValue} + } + /// Returns true if `intField` has been explicitly set. + var hasIntField: Bool {return self._intField != nil} + /// Clears the value of `intField`. Subsequent reads from it will return its default value. + mutating func clearIntField() {self._intField = nil} + + var enumField: ProtobufUnittest_V1EnumLite { + get {return _enumField ?? .v1First} + set {_enumField = newValue} + } + /// Returns true if `enumField` has been explicitly set. + var hasEnumField: Bool {return self._enumField != nil} + /// Clears the value of `enumField`. Subsequent reads from it will return its default value. + mutating func clearEnumField() {self._enumField = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _intField: Int32? = nil + fileprivate var _enumField: ProtobufUnittest_V1EnumLite? = nil +} + +struct ProtobufUnittest_V2MessageLite { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var intField: Int32 { + get {return _intField ?? 0} + set {_intField = newValue} + } + /// Returns true if `intField` has been explicitly set. + var hasIntField: Bool {return self._intField != nil} + /// Clears the value of `intField`. Subsequent reads from it will return its default value. + mutating func clearIntField() {self._intField = nil} + + var enumField: ProtobufUnittest_V2EnumLite { + get {return _enumField ?? .v2First} + set {_enumField = newValue} + } + /// Returns true if `enumField` has been explicitly set. + var hasEnumField: Bool {return self._enumField != nil} + /// Clears the value of `enumField`. Subsequent reads from it will return its default value. + mutating func clearEnumField() {self._enumField = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _intField: Int32? = nil + fileprivate var _enumField: ProtobufUnittest_V2EnumLite? = nil +} + +struct ProtobufUnittest_TestHugeFieldNumbersLite: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalInt32: Int32 { + get {return _optionalInt32 ?? 0} + set {_optionalInt32 = newValue} + } + /// Returns true if `optionalInt32` has been explicitly set. + var hasOptionalInt32: Bool {return self._optionalInt32 != nil} + /// Clears the value of `optionalInt32`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt32() {self._optionalInt32 = nil} + + var fixed32: Int32 { + get {return _fixed32 ?? 0} + set {_fixed32 = newValue} + } + /// Returns true if `fixed32` has been explicitly set. + var hasFixed32: Bool {return self._fixed32 != nil} + /// Clears the value of `fixed32`. Subsequent reads from it will return its default value. + mutating func clearFixed32() {self._fixed32 = nil} + + var repeatedInt32: [Int32] = [] + + var packedInt32: [Int32] = [] + + var optionalEnum: ProtobufUnittest_ForeignEnumLite { + get {return _optionalEnum ?? .foreignLiteFoo} + set {_optionalEnum = newValue} + } + /// Returns true if `optionalEnum` has been explicitly set. + var hasOptionalEnum: Bool {return self._optionalEnum != nil} + /// Clears the value of `optionalEnum`. Subsequent reads from it will return its default value. + mutating func clearOptionalEnum() {self._optionalEnum = nil} + + var optionalString: String { + get {return _optionalString ?? String()} + set {_optionalString = newValue} + } + /// Returns true if `optionalString` has been explicitly set. + var hasOptionalString: Bool {return self._optionalString != nil} + /// Clears the value of `optionalString`. Subsequent reads from it will return its default value. + mutating func clearOptionalString() {self._optionalString = nil} + + var optionalBytes: Data { + get {return _optionalBytes ?? Data()} + set {_optionalBytes = newValue} + } + /// Returns true if `optionalBytes` has been explicitly set. + var hasOptionalBytes: Bool {return self._optionalBytes != nil} + /// Clears the value of `optionalBytes`. Subsequent reads from it will return its default value. + mutating func clearOptionalBytes() {self._optionalBytes = nil} + + var optionalMessage: ProtobufUnittest_ForeignMessageLite { + get {return _optionalMessage ?? ProtobufUnittest_ForeignMessageLite()} + set {_optionalMessage = newValue} + } + /// Returns true if `optionalMessage` has been explicitly set. + var hasOptionalMessage: Bool {return self._optionalMessage != nil} + /// Clears the value of `optionalMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalMessage() {self._optionalMessage = nil} + + var optionalGroup: ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup { + get {return _optionalGroup ?? ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup()} + set {_optionalGroup = newValue} + } + /// Returns true if `optionalGroup` has been explicitly set. + var hasOptionalGroup: Bool {return self._optionalGroup != nil} + /// Clears the value of `optionalGroup`. Subsequent reads from it will return its default value. + mutating func clearOptionalGroup() {self._optionalGroup = nil} + + var stringStringMap: Dictionary = [:] + + var oneofField: ProtobufUnittest_TestHugeFieldNumbersLite.OneOf_OneofField? = nil + + var oneofUint32: UInt32 { + get { + if case .oneofUint32(let v)? = oneofField {return v} + return 0 + } + set {oneofField = .oneofUint32(newValue)} + } + + var oneofTestAllTypes: ProtobufUnittest_TestAllTypesLite { + get { + if case .oneofTestAllTypes(let v)? = oneofField {return v} + return ProtobufUnittest_TestAllTypesLite() + } + set {oneofField = .oneofTestAllTypes(newValue)} + } + + var oneofString: String { + get { + if case .oneofString(let v)? = oneofField {return v} + return String() + } + set {oneofField = .oneofString(newValue)} + } + + var oneofBytes: Data { + get { + if case .oneofBytes(let v)? = oneofField {return v} + return Data() + } + set {oneofField = .oneofBytes(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_OneofField: Equatable { + case oneofUint32(UInt32) + case oneofTestAllTypes(ProtobufUnittest_TestAllTypesLite) + case oneofString(String) + case oneofBytes(Data) + + } + + struct OptionalGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var groupA: Int32 { + get {return _groupA ?? 0} + set {_groupA = newValue} + } + /// Returns true if `groupA` has been explicitly set. + var hasGroupA: Bool {return self._groupA != nil} + /// Clears the value of `groupA`. Subsequent reads from it will return its default value. + mutating func clearGroupA() {self._groupA = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _groupA: Int32? = nil + } + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _optionalInt32: Int32? = nil + fileprivate var _fixed32: Int32? = nil + fileprivate var _optionalEnum: ProtobufUnittest_ForeignEnumLite? = nil + fileprivate var _optionalString: String? = nil + fileprivate var _optionalBytes: Data? = nil + fileprivate var _optionalMessage: ProtobufUnittest_ForeignMessageLite? = nil + fileprivate var _optionalGroup: ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup? = nil +} + +struct ProtobufUnittest_TestOneofParsingLite { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var oneofField: ProtobufUnittest_TestOneofParsingLite.OneOf_OneofField? = nil + + var oneofInt32: Int32 { + get { + if case .oneofInt32(let v)? = oneofField {return v} + return 0 + } + set {oneofField = .oneofInt32(newValue)} + } + + var oneofSubmessage: ProtobufUnittest_TestAllTypesLite { + get { + if case .oneofSubmessage(let v)? = oneofField {return v} + return ProtobufUnittest_TestAllTypesLite() + } + set {oneofField = .oneofSubmessage(newValue)} + } + + var oneofString: String { + get { + if case .oneofString(let v)? = oneofField {return v} + return String() + } + set {oneofField = .oneofString(newValue)} + } + + var oneofBytes: Data { + get { + if case .oneofBytes(let v)? = oneofField {return v} + return Data([100, 101, 102, 97, 117, 108, 116, 32, 98, 121, 116, 101, 115]) + } + set {oneofField = .oneofBytes(newValue)} + } + + var oneofStringCord: String { + get { + if case .oneofStringCord(let v)? = oneofField {return v} + return "default Cord" + } + set {oneofField = .oneofStringCord(newValue)} + } + + var oneofBytesCord: Data { + get { + if case .oneofBytesCord(let v)? = oneofField {return v} + return Data() + } + set {oneofField = .oneofBytesCord(newValue)} + } + + var oneofStringStringPiece: String { + get { + if case .oneofStringStringPiece(let v)? = oneofField {return v} + return String() + } + set {oneofField = .oneofStringStringPiece(newValue)} + } + + var oneofBytesStringPiece: Data { + get { + if case .oneofBytesStringPiece(let v)? = oneofField {return v} + return Data([100, 101, 102, 97, 117, 108, 116, 32, 83, 116, 114, 105, 110, 103, 80, 105, 101, 99, 101]) + } + set {oneofField = .oneofBytesStringPiece(newValue)} + } + + var oneofEnum: ProtobufUnittest_V2EnumLite { + get { + if case .oneofEnum(let v)? = oneofField {return v} + return .v2First + } + set {oneofField = .oneofEnum(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_OneofField: Equatable { + case oneofInt32(Int32) + case oneofSubmessage(ProtobufUnittest_TestAllTypesLite) + case oneofString(String) + case oneofBytes(Data) + case oneofStringCord(String) + case oneofBytesCord(Data) + case oneofStringStringPiece(String) + case oneofBytesStringPiece(Data) + case oneofEnum(ProtobufUnittest_V2EnumLite) + + } + + init() {} +} + +struct ProtobufUnittest_TestMessageSetLite: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() +} + +/// The following four messages are set up to test for wire compatibility between +/// packed and non-packed repeated fields. We use the field number 2048, because +/// that is large enough to require a 3-byte varint for the tag. +struct ProtobufUnittest_PackedInt32 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var repeatedInt32: [Int32] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_NonPackedInt32 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var repeatedInt32: [Int32] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_PackedFixed32 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var repeatedFixed32: [UInt32] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufUnittest_NonPackedFixed32 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var repeatedFixed32: [UInt32] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Test an enum that has multiple values with the same number. +struct ProtobufUnittest_DupEnum { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum TestEnumWithDupValueLite: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo1 // = 1 + case bar1 // = 2 + case baz // = 3 + static let foo2 = foo1 + static let bar2 = bar1 + + init() { + self = .foo1 + } + + init?(rawValue: Int) { + switch rawValue { + case 1: self = .foo1 + case 2: self = .bar1 + case 3: self = .baz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .foo1: return 1 + case .bar1: return 2 + case .baz: return 3 + } + } + + } + + init() {} +} + +struct ProtobufUnittest_RecursiveMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var recurse: ProtobufUnittest_RecursiveMessage { + get {return _storage._recurse ?? ProtobufUnittest_RecursiveMessage()} + set {_uniqueStorage()._recurse = newValue} + } + /// Returns true if `recurse` has been explicitly set. + var hasRecurse: Bool {return _storage._recurse != nil} + /// Clears the value of `recurse`. Subsequent reads from it will return its default value. + mutating func clearRecurse() {_uniqueStorage()._recurse = nil} + + var payload: Data { + get {return _storage._payload ?? Data()} + set {_uniqueStorage()._payload = newValue} + } + /// Returns true if `payload` has been explicitly set. + var hasPayload: Bool {return _storage._payload != nil} + /// Clears the value of `payload`. Subsequent reads from it will return its default value. + mutating func clearPayload() {_uniqueStorage()._payload = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittest_TestAllTypesLite: @unchecked Sendable {} +extension ProtobufUnittest_TestAllTypesLite.OneOf_OneofField: @unchecked Sendable {} +extension ProtobufUnittest_TestAllTypesLite.NestedMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestAllTypesLite.NestedMessage2: @unchecked Sendable {} +extension ProtobufUnittest_TestAllTypesLite.OptionalGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestAllTypesLite.RepeatedGroup: @unchecked Sendable {} +extension ProtobufUnittest_ForeignMessageLite: @unchecked Sendable {} +extension ProtobufUnittest_TestPackedTypesLite: @unchecked Sendable {} +extension ProtobufUnittest_TestAllExtensionsLite: @unchecked Sendable {} +extension ProtobufUnittest_OptionalGroup_extension_lite: @unchecked Sendable {} +extension ProtobufUnittest_RepeatedGroup_extension_lite: @unchecked Sendable {} +extension ProtobufUnittest_TestPackedExtensionsLite: @unchecked Sendable {} +extension ProtobufUnittest_TestNestedExtensionLite: @unchecked Sendable {} +extension ProtobufUnittest_TestDeprecatedLite: @unchecked Sendable {} +extension ProtobufUnittest_TestParsingMergeLite: @unchecked Sendable {} +extension ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator: @unchecked Sendable {} +extension ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator.Group1: @unchecked Sendable {} +extension ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator.Group2: @unchecked Sendable {} +extension ProtobufUnittest_TestParsingMergeLite.OptionalGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestParsingMergeLite.RepeatedGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestMergeExceptionLite: @unchecked Sendable {} +extension ProtobufUnittest_TestEmptyMessageLite: @unchecked Sendable {} +extension ProtobufUnittest_TestEmptyMessageWithExtensionsLite: @unchecked Sendable {} +extension ProtobufUnittest_V1MessageLite: @unchecked Sendable {} +extension ProtobufUnittest_V2MessageLite: @unchecked Sendable {} +extension ProtobufUnittest_TestHugeFieldNumbersLite: @unchecked Sendable {} +extension ProtobufUnittest_TestHugeFieldNumbersLite.OneOf_OneofField: @unchecked Sendable {} +extension ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup: @unchecked Sendable {} +extension ProtobufUnittest_TestOneofParsingLite: @unchecked Sendable {} +extension ProtobufUnittest_TestOneofParsingLite.OneOf_OneofField: @unchecked Sendable {} +extension ProtobufUnittest_TestMessageSetLite: @unchecked Sendable {} +extension ProtobufUnittest_PackedInt32: @unchecked Sendable {} +extension ProtobufUnittest_NonPackedInt32: @unchecked Sendable {} +extension ProtobufUnittest_PackedFixed32: @unchecked Sendable {} +extension ProtobufUnittest_NonPackedFixed32: @unchecked Sendable {} +extension ProtobufUnittest_DupEnum: @unchecked Sendable {} +extension ProtobufUnittest_RecursiveMessage: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Extension support defined in unittest_lite.proto. + +// MARK: - Extension Properties + +// Swift Extensions on the exteneded Messages to add easy access to the declared +// extension fields. The names are based on the extension field name from the proto +// declaration. To avoid naming collisions, the names are prefixed with the name of +// the scope where the extend directive occurs. + +extension ProtobufUnittest_TestAllExtensionsLite { + + /// Singular + var ProtobufUnittest_optionalInt32ExtensionLite: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_int32_extension_lite) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_int32_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_int32_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalInt32ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_int32_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_int32_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalInt32ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_int32_extension_lite) + } + + var ProtobufUnittest_optionalInt64ExtensionLite: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_int64_extension_lite) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_int64_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_int64_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalInt64ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_int64_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_int64_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalInt64ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_int64_extension_lite) + } + + var ProtobufUnittest_optionalUint32ExtensionLite: UInt32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint32_extension_lite) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint32_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_uint32_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalUint32ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint32_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_uint32_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalUint32ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint32_extension_lite) + } + + var ProtobufUnittest_optionalUint64ExtensionLite: UInt64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint64_extension_lite) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint64_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_uint64_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalUint64ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint64_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_uint64_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalUint64ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_uint64_extension_lite) + } + + var ProtobufUnittest_optionalSint32ExtensionLite: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint32_extension_lite) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint32_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_sint32_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalSint32ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint32_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_sint32_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalSint32ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint32_extension_lite) + } + + var ProtobufUnittest_optionalSint64ExtensionLite: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint64_extension_lite) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint64_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_sint64_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalSint64ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint64_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_sint64_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalSint64ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_sint64_extension_lite) + } + + var ProtobufUnittest_optionalFixed32ExtensionLite: UInt32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed32_extension_lite) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed32_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_fixed32_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalFixed32ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed32_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_fixed32_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalFixed32ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed32_extension_lite) + } + + var ProtobufUnittest_optionalFixed64ExtensionLite: UInt64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed64_extension_lite) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed64_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_fixed64_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalFixed64ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed64_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_fixed64_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalFixed64ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_fixed64_extension_lite) + } + + var ProtobufUnittest_optionalSfixed32ExtensionLite: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed32_extension_lite) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed32_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_sfixed32_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalSfixed32ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed32_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_sfixed32_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalSfixed32ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed32_extension_lite) + } + + var ProtobufUnittest_optionalSfixed64ExtensionLite: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed64_extension_lite) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed64_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_sfixed64_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalSfixed64ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed64_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_sfixed64_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalSfixed64ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_sfixed64_extension_lite) + } + + var ProtobufUnittest_optionalFloatExtensionLite: Float { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_float_extension_lite) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_float_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_float_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalFloatExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_float_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_float_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalFloatExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_float_extension_lite) + } + + var ProtobufUnittest_optionalDoubleExtensionLite: Double { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_double_extension_lite) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_double_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_double_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalDoubleExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_double_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_double_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalDoubleExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_double_extension_lite) + } + + var ProtobufUnittest_optionalBoolExtensionLite: Bool { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_bool_extension_lite) ?? false} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_bool_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_bool_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalBoolExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_bool_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_bool_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalBoolExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_bool_extension_lite) + } + + var ProtobufUnittest_optionalStringExtensionLite: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_extension_lite) ?? String()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_string_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalStringExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_string_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalStringExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_extension_lite) + } + + var ProtobufUnittest_optionalBytesExtensionLite: Data { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_bytes_extension_lite) ?? Data()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_bytes_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_bytes_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalBytesExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_bytes_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_bytes_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalBytesExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_bytes_extension_lite) + } + + var ProtobufUnittest_optionalGroupExtensionLite: ProtobufUnittest_OptionalGroup_extension_lite { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_OptionalGroup_extension_lite) ?? ProtobufUnittest_OptionalGroup_extension_lite()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_OptionalGroup_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_OptionalGroup_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalGroupExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_OptionalGroup_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_OptionalGroup_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalGroupExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_OptionalGroup_extension_lite) + } + + var ProtobufUnittest_optionalNestedMessageExtensionLite: ProtobufUnittest_TestAllTypesLite.NestedMessage { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_message_extension_lite) ?? ProtobufUnittest_TestAllTypesLite.NestedMessage()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_message_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_nested_message_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalNestedMessageExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_message_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_nested_message_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalNestedMessageExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_message_extension_lite) + } + + var ProtobufUnittest_optionalForeignMessageExtensionLite: ProtobufUnittest_ForeignMessageLite { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_message_extension_lite) ?? ProtobufUnittest_ForeignMessageLite()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_message_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_foreign_message_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalForeignMessageExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_message_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_foreign_message_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalForeignMessageExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_message_extension_lite) + } + + var ProtobufUnittest_optionalImportMessageExtensionLite: ProtobufUnittestImport_ImportMessageLite { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_message_extension_lite) ?? ProtobufUnittestImport_ImportMessageLite()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_message_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_import_message_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalImportMessageExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_message_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_import_message_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalImportMessageExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_message_extension_lite) + } + + var ProtobufUnittest_optionalNestedEnumExtensionLite: ProtobufUnittest_TestAllTypesLite.NestedEnum { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_enum_extension_lite) ?? .foo} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_enum_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_nested_enum_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalNestedEnumExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_enum_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_nested_enum_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalNestedEnumExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_nested_enum_extension_lite) + } + + var ProtobufUnittest_optionalForeignEnumExtensionLite: ProtobufUnittest_ForeignEnumLite { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_enum_extension_lite) ?? .foreignLiteFoo} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_enum_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_foreign_enum_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalForeignEnumExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_enum_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_foreign_enum_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalForeignEnumExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_foreign_enum_extension_lite) + } + + var ProtobufUnittest_optionalImportEnumExtensionLite: ProtobufUnittestImport_ImportEnumLite { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_enum_extension_lite) ?? .importLiteFoo} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_enum_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_import_enum_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalImportEnumExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_enum_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_import_enum_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalImportEnumExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_import_enum_extension_lite) + } + + var ProtobufUnittest_optionalStringPieceExtensionLite: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_piece_extension_lite) ?? String()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_piece_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_string_piece_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalStringPieceExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_piece_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_string_piece_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalStringPieceExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_string_piece_extension_lite) + } + + var ProtobufUnittest_optionalCordExtensionLite: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_cord_extension_lite) ?? String()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_cord_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_cord_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalCordExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_cord_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_cord_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalCordExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_cord_extension_lite) + } + + var ProtobufUnittest_optionalPublicImportMessageExtensionLite: ProtobufUnittestImport_PublicImportMessageLite { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_public_import_message_extension_lite) ?? ProtobufUnittestImport_PublicImportMessageLite()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_public_import_message_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_public_import_message_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalPublicImportMessageExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_public_import_message_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_public_import_message_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalPublicImportMessageExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_public_import_message_extension_lite) + } + + var ProtobufUnittest_optionalLazyMessageExtensionLite: ProtobufUnittest_TestAllTypesLite.NestedMessage { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_lazy_message_extension_lite) ?? ProtobufUnittest_TestAllTypesLite.NestedMessage()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_lazy_message_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_lazy_message_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalLazyMessageExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_lazy_message_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_lazy_message_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalLazyMessageExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_lazy_message_extension_lite) + } + + var ProtobufUnittest_optionalUnverifiedLazyMessageExtensionLite: ProtobufUnittest_TestAllTypesLite.NestedMessage { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension_lite) ?? ProtobufUnittest_TestAllTypesLite.NestedMessage()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_optionalUnverifiedLazyMessageExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_optionalUnverifiedLazyMessageExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension_lite) + } + + /// Repeated + var ProtobufUnittest_repeatedInt32ExtensionLite: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_int32_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_int32_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedInt64ExtensionLite: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_int64_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_int64_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedUint32ExtensionLite: [UInt32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_uint32_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_uint32_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedUint64ExtensionLite: [UInt64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_uint64_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_uint64_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedSint32ExtensionLite: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sint32_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sint32_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedSint64ExtensionLite: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sint64_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sint64_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedFixed32ExtensionLite: [UInt32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_fixed32_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_fixed32_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedFixed64ExtensionLite: [UInt64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_fixed64_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_fixed64_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedSfixed32ExtensionLite: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sfixed32_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sfixed32_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedSfixed64ExtensionLite: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sfixed64_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_sfixed64_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedFloatExtensionLite: [Float] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_float_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_float_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedDoubleExtensionLite: [Double] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_double_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_double_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedBoolExtensionLite: [Bool] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_bool_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_bool_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedStringExtensionLite: [String] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_string_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_string_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedBytesExtensionLite: [Data] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_bytes_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_bytes_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedGroupExtensionLite: [ProtobufUnittest_RepeatedGroup_extension_lite] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_RepeatedGroup_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_RepeatedGroup_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedNestedMessageExtensionLite: [ProtobufUnittest_TestAllTypesLite.NestedMessage] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_nested_message_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_nested_message_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedForeignMessageExtensionLite: [ProtobufUnittest_ForeignMessageLite] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_foreign_message_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_foreign_message_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedImportMessageExtensionLite: [ProtobufUnittestImport_ImportMessageLite] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_import_message_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_import_message_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedNestedEnumExtensionLite: [ProtobufUnittest_TestAllTypesLite.NestedEnum] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_nested_enum_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_nested_enum_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedForeignEnumExtensionLite: [ProtobufUnittest_ForeignEnumLite] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_foreign_enum_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_foreign_enum_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedImportEnumExtensionLite: [ProtobufUnittestImport_ImportEnumLite] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_import_enum_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_import_enum_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedStringPieceExtensionLite: [String] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_string_piece_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_string_piece_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedCordExtensionLite: [String] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_cord_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_cord_extension_lite, value: newValue)} + } + + var ProtobufUnittest_repeatedLazyMessageExtensionLite: [ProtobufUnittest_TestAllTypesLite.NestedMessage] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_repeated_lazy_message_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_repeated_lazy_message_extension_lite, value: newValue)} + } + + /// Singular with defaults + var ProtobufUnittest_defaultInt32ExtensionLite: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_int32_extension_lite) ?? 41} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_int32_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_int32_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultInt32ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_int32_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_int32_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultInt32ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_int32_extension_lite) + } + + var ProtobufUnittest_defaultInt64ExtensionLite: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_int64_extension_lite) ?? 42} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_int64_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_int64_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultInt64ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_int64_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_int64_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultInt64ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_int64_extension_lite) + } + + var ProtobufUnittest_defaultUint32ExtensionLite: UInt32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_uint32_extension_lite) ?? 43} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_uint32_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_uint32_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultUint32ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_uint32_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_uint32_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultUint32ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_uint32_extension_lite) + } + + var ProtobufUnittest_defaultUint64ExtensionLite: UInt64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_uint64_extension_lite) ?? 44} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_uint64_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_uint64_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultUint64ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_uint64_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_uint64_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultUint64ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_uint64_extension_lite) + } + + var ProtobufUnittest_defaultSint32ExtensionLite: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_sint32_extension_lite) ?? -45} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_sint32_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_sint32_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultSint32ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_sint32_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_sint32_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultSint32ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_sint32_extension_lite) + } + + var ProtobufUnittest_defaultSint64ExtensionLite: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_sint64_extension_lite) ?? 46} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_sint64_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_sint64_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultSint64ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_sint64_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_sint64_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultSint64ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_sint64_extension_lite) + } + + var ProtobufUnittest_defaultFixed32ExtensionLite: UInt32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed32_extension_lite) ?? 47} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed32_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_fixed32_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultFixed32ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed32_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_fixed32_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultFixed32ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed32_extension_lite) + } + + var ProtobufUnittest_defaultFixed64ExtensionLite: UInt64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed64_extension_lite) ?? 48} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed64_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_fixed64_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultFixed64ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed64_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_fixed64_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultFixed64ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_fixed64_extension_lite) + } + + var ProtobufUnittest_defaultSfixed32ExtensionLite: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed32_extension_lite) ?? 49} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed32_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_sfixed32_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultSfixed32ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed32_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_sfixed32_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultSfixed32ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed32_extension_lite) + } + + var ProtobufUnittest_defaultSfixed64ExtensionLite: Int64 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed64_extension_lite) ?? -50} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed64_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_sfixed64_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultSfixed64ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed64_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_sfixed64_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultSfixed64ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_sfixed64_extension_lite) + } + + var ProtobufUnittest_defaultFloatExtensionLite: Float { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_float_extension_lite) ?? 51.5} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_float_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_float_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultFloatExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_float_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_float_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultFloatExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_float_extension_lite) + } + + var ProtobufUnittest_defaultDoubleExtensionLite: Double { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_double_extension_lite) ?? 52000} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_double_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_double_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultDoubleExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_double_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_double_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultDoubleExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_double_extension_lite) + } + + var ProtobufUnittest_defaultBoolExtensionLite: Bool { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_bool_extension_lite) ?? true} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_bool_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_bool_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultBoolExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_bool_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_bool_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultBoolExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_bool_extension_lite) + } + + var ProtobufUnittest_defaultStringExtensionLite: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_string_extension_lite) ?? "hello"} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_string_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_string_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultStringExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_string_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_string_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultStringExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_string_extension_lite) + } + + var ProtobufUnittest_defaultBytesExtensionLite: Data { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_bytes_extension_lite) ?? Data([119, 111, 114, 108, 100])} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_bytes_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_bytes_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultBytesExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_bytes_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_bytes_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultBytesExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_bytes_extension_lite) + } + + var ProtobufUnittest_defaultNestedEnumExtensionLite: ProtobufUnittest_TestAllTypesLite.NestedEnum { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_nested_enum_extension_lite) ?? .bar} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_nested_enum_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_nested_enum_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultNestedEnumExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_nested_enum_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_nested_enum_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultNestedEnumExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_nested_enum_extension_lite) + } + + var ProtobufUnittest_defaultForeignEnumExtensionLite: ProtobufUnittest_ForeignEnumLite { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_foreign_enum_extension_lite) ?? .foreignLiteBar} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_foreign_enum_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_foreign_enum_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultForeignEnumExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_foreign_enum_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_foreign_enum_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultForeignEnumExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_foreign_enum_extension_lite) + } + + var ProtobufUnittest_defaultImportEnumExtensionLite: ProtobufUnittestImport_ImportEnumLite { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_import_enum_extension_lite) ?? .importLiteBar} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_import_enum_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_import_enum_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultImportEnumExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_import_enum_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_import_enum_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultImportEnumExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_import_enum_extension_lite) + } + + var ProtobufUnittest_defaultStringPieceExtensionLite: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_string_piece_extension_lite) ?? "abc"} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_string_piece_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_string_piece_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultStringPieceExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_string_piece_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_string_piece_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultStringPieceExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_string_piece_extension_lite) + } + + var ProtobufUnittest_defaultCordExtensionLite: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_default_cord_extension_lite) ?? "123"} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_default_cord_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_default_cord_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_defaultCordExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_default_cord_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_default_cord_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_defaultCordExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_default_cord_extension_lite) + } + + /// For oneof test + var ProtobufUnittest_oneofUint32ExtensionLite: UInt32 { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_oneof_uint32_extension_lite) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_oneof_uint32_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_oneof_uint32_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_oneofUint32ExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_oneof_uint32_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_oneof_uint32_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_oneofUint32ExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_oneof_uint32_extension_lite) + } + + var ProtobufUnittest_oneofNestedMessageExtensionLite: ProtobufUnittest_TestAllTypesLite.NestedMessage { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_oneof_nested_message_extension_lite) ?? ProtobufUnittest_TestAllTypesLite.NestedMessage()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_oneof_nested_message_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_oneof_nested_message_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_oneofNestedMessageExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_oneof_nested_message_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_oneof_nested_message_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_oneofNestedMessageExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_oneof_nested_message_extension_lite) + } + + var ProtobufUnittest_oneofStringExtensionLite: String { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_oneof_string_extension_lite) ?? String()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_oneof_string_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_oneof_string_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_oneofStringExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_oneof_string_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_oneof_string_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_oneofStringExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_oneof_string_extension_lite) + } + + var ProtobufUnittest_oneofBytesExtensionLite: Data { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_oneof_bytes_extension_lite) ?? Data()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_oneof_bytes_extension_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_oneof_bytes_extension_lite` + /// has been explicitly set. + var hasProtobufUnittest_oneofBytesExtensionLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_oneof_bytes_extension_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_oneof_bytes_extension_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_oneofBytesExtensionLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_oneof_bytes_extension_lite) + } + + var ProtobufUnittest_TestNestedExtensionLite_nestedExtension: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_TestNestedExtensionLite.Extensions.nested_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_TestNestedExtensionLite.Extensions.nested_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestNestedExtensionLite.Extensions.nested_extension` + /// has been explicitly set. + var hasProtobufUnittest_TestNestedExtensionLite_nestedExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestNestedExtensionLite.Extensions.nested_extension) + } + /// Clears the value of extension `ProtobufUnittest_TestNestedExtensionLite.Extensions.nested_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestNestedExtensionLite_nestedExtension() { + clearExtensionValue(ext: ProtobufUnittest_TestNestedExtensionLite.Extensions.nested_extension) + } +} + +extension ProtobufUnittest_TestHugeFieldNumbersLite { + + var ProtobufUnittest_testAllTypesLite: ProtobufUnittest_TestAllTypesLite { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_test_all_types_lite) ?? ProtobufUnittest_TestAllTypesLite()} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_test_all_types_lite, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Extensions_test_all_types_lite` + /// has been explicitly set. + var hasProtobufUnittest_testAllTypesLite: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Extensions_test_all_types_lite) + } + /// Clears the value of extension `ProtobufUnittest_Extensions_test_all_types_lite`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_testAllTypesLite() { + clearExtensionValue(ext: ProtobufUnittest_Extensions_test_all_types_lite) + } +} + +extension ProtobufUnittest_TestPackedExtensionsLite { + + var ProtobufUnittest_packedInt32ExtensionLite: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_int32_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_int32_extension_lite, value: newValue)} + } + + var ProtobufUnittest_packedInt64ExtensionLite: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_int64_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_int64_extension_lite, value: newValue)} + } + + var ProtobufUnittest_packedUint32ExtensionLite: [UInt32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_uint32_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_uint32_extension_lite, value: newValue)} + } + + var ProtobufUnittest_packedUint64ExtensionLite: [UInt64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_uint64_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_uint64_extension_lite, value: newValue)} + } + + var ProtobufUnittest_packedSint32ExtensionLite: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_sint32_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_sint32_extension_lite, value: newValue)} + } + + var ProtobufUnittest_packedSint64ExtensionLite: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_sint64_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_sint64_extension_lite, value: newValue)} + } + + var ProtobufUnittest_packedFixed32ExtensionLite: [UInt32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_fixed32_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_fixed32_extension_lite, value: newValue)} + } + + var ProtobufUnittest_packedFixed64ExtensionLite: [UInt64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_fixed64_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_fixed64_extension_lite, value: newValue)} + } + + var ProtobufUnittest_packedSfixed32ExtensionLite: [Int32] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_sfixed32_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_sfixed32_extension_lite, value: newValue)} + } + + var ProtobufUnittest_packedSfixed64ExtensionLite: [Int64] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_sfixed64_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_sfixed64_extension_lite, value: newValue)} + } + + var ProtobufUnittest_packedFloatExtensionLite: [Float] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_float_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_float_extension_lite, value: newValue)} + } + + var ProtobufUnittest_packedDoubleExtensionLite: [Double] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_double_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_double_extension_lite, value: newValue)} + } + + var ProtobufUnittest_packedBoolExtensionLite: [Bool] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_bool_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_bool_extension_lite, value: newValue)} + } + + var ProtobufUnittest_packedEnumExtensionLite: [ProtobufUnittest_ForeignEnumLite] { + get {return getExtensionValue(ext: ProtobufUnittest_Extensions_packed_enum_extension_lite) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_Extensions_packed_enum_extension_lite, value: newValue)} + } +} + +extension ProtobufUnittest_TestParsingMergeLite { + + var ProtobufUnittest_TestParsingMergeLite_optionalExt: ProtobufUnittest_TestAllTypesLite { + get {return getExtensionValue(ext: ProtobufUnittest_TestParsingMergeLite.Extensions.optional_ext) ?? ProtobufUnittest_TestAllTypesLite()} + set {setExtensionValue(ext: ProtobufUnittest_TestParsingMergeLite.Extensions.optional_ext, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestParsingMergeLite.Extensions.optional_ext` + /// has been explicitly set. + var hasProtobufUnittest_TestParsingMergeLite_optionalExt: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestParsingMergeLite.Extensions.optional_ext) + } + /// Clears the value of extension `ProtobufUnittest_TestParsingMergeLite.Extensions.optional_ext`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestParsingMergeLite_optionalExt() { + clearExtensionValue(ext: ProtobufUnittest_TestParsingMergeLite.Extensions.optional_ext) + } + + var ProtobufUnittest_TestParsingMergeLite_repeatedExt: [ProtobufUnittest_TestAllTypesLite] { + get {return getExtensionValue(ext: ProtobufUnittest_TestParsingMergeLite.Extensions.repeated_ext) ?? []} + set {setExtensionValue(ext: ProtobufUnittest_TestParsingMergeLite.Extensions.repeated_ext, value: newValue)} + } + +} + +// MARK: - File's ExtensionMap: ProtobufUnittest_UnittestLite_Extensions + +/// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by +/// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed +/// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create +/// a larger `SwiftProtobuf.SimpleExtensionMap`. +let ProtobufUnittest_UnittestLite_Extensions: SwiftProtobuf.SimpleExtensionMap = [ + ProtobufUnittest_Extensions_optional_int32_extension_lite, + ProtobufUnittest_Extensions_optional_int64_extension_lite, + ProtobufUnittest_Extensions_optional_uint32_extension_lite, + ProtobufUnittest_Extensions_optional_uint64_extension_lite, + ProtobufUnittest_Extensions_optional_sint32_extension_lite, + ProtobufUnittest_Extensions_optional_sint64_extension_lite, + ProtobufUnittest_Extensions_optional_fixed32_extension_lite, + ProtobufUnittest_Extensions_optional_fixed64_extension_lite, + ProtobufUnittest_Extensions_optional_sfixed32_extension_lite, + ProtobufUnittest_Extensions_optional_sfixed64_extension_lite, + ProtobufUnittest_Extensions_optional_float_extension_lite, + ProtobufUnittest_Extensions_optional_double_extension_lite, + ProtobufUnittest_Extensions_optional_bool_extension_lite, + ProtobufUnittest_Extensions_optional_string_extension_lite, + ProtobufUnittest_Extensions_optional_bytes_extension_lite, + ProtobufUnittest_Extensions_OptionalGroup_extension_lite, + ProtobufUnittest_Extensions_optional_nested_message_extension_lite, + ProtobufUnittest_Extensions_optional_foreign_message_extension_lite, + ProtobufUnittest_Extensions_optional_import_message_extension_lite, + ProtobufUnittest_Extensions_optional_nested_enum_extension_lite, + ProtobufUnittest_Extensions_optional_foreign_enum_extension_lite, + ProtobufUnittest_Extensions_optional_import_enum_extension_lite, + ProtobufUnittest_Extensions_optional_string_piece_extension_lite, + ProtobufUnittest_Extensions_optional_cord_extension_lite, + ProtobufUnittest_Extensions_optional_public_import_message_extension_lite, + ProtobufUnittest_Extensions_optional_lazy_message_extension_lite, + ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension_lite, + ProtobufUnittest_Extensions_repeated_int32_extension_lite, + ProtobufUnittest_Extensions_repeated_int64_extension_lite, + ProtobufUnittest_Extensions_repeated_uint32_extension_lite, + ProtobufUnittest_Extensions_repeated_uint64_extension_lite, + ProtobufUnittest_Extensions_repeated_sint32_extension_lite, + ProtobufUnittest_Extensions_repeated_sint64_extension_lite, + ProtobufUnittest_Extensions_repeated_fixed32_extension_lite, + ProtobufUnittest_Extensions_repeated_fixed64_extension_lite, + ProtobufUnittest_Extensions_repeated_sfixed32_extension_lite, + ProtobufUnittest_Extensions_repeated_sfixed64_extension_lite, + ProtobufUnittest_Extensions_repeated_float_extension_lite, + ProtobufUnittest_Extensions_repeated_double_extension_lite, + ProtobufUnittest_Extensions_repeated_bool_extension_lite, + ProtobufUnittest_Extensions_repeated_string_extension_lite, + ProtobufUnittest_Extensions_repeated_bytes_extension_lite, + ProtobufUnittest_Extensions_RepeatedGroup_extension_lite, + ProtobufUnittest_Extensions_repeated_nested_message_extension_lite, + ProtobufUnittest_Extensions_repeated_foreign_message_extension_lite, + ProtobufUnittest_Extensions_repeated_import_message_extension_lite, + ProtobufUnittest_Extensions_repeated_nested_enum_extension_lite, + ProtobufUnittest_Extensions_repeated_foreign_enum_extension_lite, + ProtobufUnittest_Extensions_repeated_import_enum_extension_lite, + ProtobufUnittest_Extensions_repeated_string_piece_extension_lite, + ProtobufUnittest_Extensions_repeated_cord_extension_lite, + ProtobufUnittest_Extensions_repeated_lazy_message_extension_lite, + ProtobufUnittest_Extensions_default_int32_extension_lite, + ProtobufUnittest_Extensions_default_int64_extension_lite, + ProtobufUnittest_Extensions_default_uint32_extension_lite, + ProtobufUnittest_Extensions_default_uint64_extension_lite, + ProtobufUnittest_Extensions_default_sint32_extension_lite, + ProtobufUnittest_Extensions_default_sint64_extension_lite, + ProtobufUnittest_Extensions_default_fixed32_extension_lite, + ProtobufUnittest_Extensions_default_fixed64_extension_lite, + ProtobufUnittest_Extensions_default_sfixed32_extension_lite, + ProtobufUnittest_Extensions_default_sfixed64_extension_lite, + ProtobufUnittest_Extensions_default_float_extension_lite, + ProtobufUnittest_Extensions_default_double_extension_lite, + ProtobufUnittest_Extensions_default_bool_extension_lite, + ProtobufUnittest_Extensions_default_string_extension_lite, + ProtobufUnittest_Extensions_default_bytes_extension_lite, + ProtobufUnittest_Extensions_default_nested_enum_extension_lite, + ProtobufUnittest_Extensions_default_foreign_enum_extension_lite, + ProtobufUnittest_Extensions_default_import_enum_extension_lite, + ProtobufUnittest_Extensions_default_string_piece_extension_lite, + ProtobufUnittest_Extensions_default_cord_extension_lite, + ProtobufUnittest_Extensions_oneof_uint32_extension_lite, + ProtobufUnittest_Extensions_oneof_nested_message_extension_lite, + ProtobufUnittest_Extensions_oneof_string_extension_lite, + ProtobufUnittest_Extensions_oneof_bytes_extension_lite, + ProtobufUnittest_Extensions_packed_int32_extension_lite, + ProtobufUnittest_Extensions_packed_int64_extension_lite, + ProtobufUnittest_Extensions_packed_uint32_extension_lite, + ProtobufUnittest_Extensions_packed_uint64_extension_lite, + ProtobufUnittest_Extensions_packed_sint32_extension_lite, + ProtobufUnittest_Extensions_packed_sint64_extension_lite, + ProtobufUnittest_Extensions_packed_fixed32_extension_lite, + ProtobufUnittest_Extensions_packed_fixed64_extension_lite, + ProtobufUnittest_Extensions_packed_sfixed32_extension_lite, + ProtobufUnittest_Extensions_packed_sfixed64_extension_lite, + ProtobufUnittest_Extensions_packed_float_extension_lite, + ProtobufUnittest_Extensions_packed_double_extension_lite, + ProtobufUnittest_Extensions_packed_bool_extension_lite, + ProtobufUnittest_Extensions_packed_enum_extension_lite, + ProtobufUnittest_Extensions_test_all_types_lite, + ProtobufUnittest_TestNestedExtensionLite.Extensions.nested_extension, + ProtobufUnittest_TestParsingMergeLite.Extensions.optional_ext, + ProtobufUnittest_TestParsingMergeLite.Extensions.repeated_ext +] + +// Extension Objects - The only reason these might be needed is when manually +// constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_ +// accessors for the extension fields on the messages directly. + +/// Singular +let ProtobufUnittest_Extensions_optional_int32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 1, + fieldName: "protobuf_unittest.optional_int32_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_int64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 2, + fieldName: "protobuf_unittest.optional_int64_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_uint32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 3, + fieldName: "protobuf_unittest.optional_uint32_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_uint64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 4, + fieldName: "protobuf_unittest.optional_uint64_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_sint32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 5, + fieldName: "protobuf_unittest.optional_sint32_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_sint64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 6, + fieldName: "protobuf_unittest.optional_sint64_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_fixed32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 7, + fieldName: "protobuf_unittest.optional_fixed32_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_fixed64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 8, + fieldName: "protobuf_unittest.optional_fixed64_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_sfixed32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 9, + fieldName: "protobuf_unittest.optional_sfixed32_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_sfixed64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 10, + fieldName: "protobuf_unittest.optional_sfixed64_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_float_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 11, + fieldName: "protobuf_unittest.optional_float_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_double_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 12, + fieldName: "protobuf_unittest.optional_double_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_bool_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 13, + fieldName: "protobuf_unittest.optional_bool_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_string_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 14, + fieldName: "protobuf_unittest.optional_string_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_bytes_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 15, + fieldName: "protobuf_unittest.optional_bytes_extension_lite" +) + +let ProtobufUnittest_Extensions_OptionalGroup_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 16, + fieldName: "protobuf_unittest.optionalgroup_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_nested_message_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 18, + fieldName: "protobuf_unittest.optional_nested_message_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_foreign_message_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 19, + fieldName: "protobuf_unittest.optional_foreign_message_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_import_message_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 20, + fieldName: "protobuf_unittest.optional_import_message_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_nested_enum_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 21, + fieldName: "protobuf_unittest.optional_nested_enum_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_foreign_enum_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 22, + fieldName: "protobuf_unittest.optional_foreign_enum_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_import_enum_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 23, + fieldName: "protobuf_unittest.optional_import_enum_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_string_piece_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 24, + fieldName: "protobuf_unittest.optional_string_piece_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_cord_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 25, + fieldName: "protobuf_unittest.optional_cord_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_public_import_message_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 26, + fieldName: "protobuf_unittest.optional_public_import_message_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_lazy_message_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 27, + fieldName: "protobuf_unittest.optional_lazy_message_extension_lite" +) + +let ProtobufUnittest_Extensions_optional_unverified_lazy_message_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 28, + fieldName: "protobuf_unittest.optional_unverified_lazy_message_extension_lite" +) + +/// Repeated +let ProtobufUnittest_Extensions_repeated_int32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 31, + fieldName: "protobuf_unittest.repeated_int32_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_int64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 32, + fieldName: "protobuf_unittest.repeated_int64_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_uint32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 33, + fieldName: "protobuf_unittest.repeated_uint32_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_uint64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 34, + fieldName: "protobuf_unittest.repeated_uint64_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_sint32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 35, + fieldName: "protobuf_unittest.repeated_sint32_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_sint64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 36, + fieldName: "protobuf_unittest.repeated_sint64_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_fixed32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 37, + fieldName: "protobuf_unittest.repeated_fixed32_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_fixed64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 38, + fieldName: "protobuf_unittest.repeated_fixed64_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_sfixed32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 39, + fieldName: "protobuf_unittest.repeated_sfixed32_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_sfixed64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 40, + fieldName: "protobuf_unittest.repeated_sfixed64_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_float_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 41, + fieldName: "protobuf_unittest.repeated_float_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_double_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 42, + fieldName: "protobuf_unittest.repeated_double_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_bool_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 43, + fieldName: "protobuf_unittest.repeated_bool_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_string_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 44, + fieldName: "protobuf_unittest.repeated_string_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_bytes_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 45, + fieldName: "protobuf_unittest.repeated_bytes_extension_lite" +) + +let ProtobufUnittest_Extensions_RepeatedGroup_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 46, + fieldName: "protobuf_unittest.repeatedgroup_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_nested_message_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 48, + fieldName: "protobuf_unittest.repeated_nested_message_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_foreign_message_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 49, + fieldName: "protobuf_unittest.repeated_foreign_message_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_import_message_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 50, + fieldName: "protobuf_unittest.repeated_import_message_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_nested_enum_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 51, + fieldName: "protobuf_unittest.repeated_nested_enum_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_foreign_enum_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 52, + fieldName: "protobuf_unittest.repeated_foreign_enum_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_import_enum_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 53, + fieldName: "protobuf_unittest.repeated_import_enum_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_string_piece_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 54, + fieldName: "protobuf_unittest.repeated_string_piece_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_cord_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 55, + fieldName: "protobuf_unittest.repeated_cord_extension_lite" +) + +let ProtobufUnittest_Extensions_repeated_lazy_message_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 57, + fieldName: "protobuf_unittest.repeated_lazy_message_extension_lite" +) + +/// Singular with defaults +let ProtobufUnittest_Extensions_default_int32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 61, + fieldName: "protobuf_unittest.default_int32_extension_lite" +) + +let ProtobufUnittest_Extensions_default_int64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 62, + fieldName: "protobuf_unittest.default_int64_extension_lite" +) + +let ProtobufUnittest_Extensions_default_uint32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 63, + fieldName: "protobuf_unittest.default_uint32_extension_lite" +) + +let ProtobufUnittest_Extensions_default_uint64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 64, + fieldName: "protobuf_unittest.default_uint64_extension_lite" +) + +let ProtobufUnittest_Extensions_default_sint32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 65, + fieldName: "protobuf_unittest.default_sint32_extension_lite" +) + +let ProtobufUnittest_Extensions_default_sint64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 66, + fieldName: "protobuf_unittest.default_sint64_extension_lite" +) + +let ProtobufUnittest_Extensions_default_fixed32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 67, + fieldName: "protobuf_unittest.default_fixed32_extension_lite" +) + +let ProtobufUnittest_Extensions_default_fixed64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 68, + fieldName: "protobuf_unittest.default_fixed64_extension_lite" +) + +let ProtobufUnittest_Extensions_default_sfixed32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 69, + fieldName: "protobuf_unittest.default_sfixed32_extension_lite" +) + +let ProtobufUnittest_Extensions_default_sfixed64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 70, + fieldName: "protobuf_unittest.default_sfixed64_extension_lite" +) + +let ProtobufUnittest_Extensions_default_float_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 71, + fieldName: "protobuf_unittest.default_float_extension_lite" +) + +let ProtobufUnittest_Extensions_default_double_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 72, + fieldName: "protobuf_unittest.default_double_extension_lite" +) + +let ProtobufUnittest_Extensions_default_bool_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 73, + fieldName: "protobuf_unittest.default_bool_extension_lite" +) + +let ProtobufUnittest_Extensions_default_string_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 74, + fieldName: "protobuf_unittest.default_string_extension_lite" +) + +let ProtobufUnittest_Extensions_default_bytes_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 75, + fieldName: "protobuf_unittest.default_bytes_extension_lite" +) + +let ProtobufUnittest_Extensions_default_nested_enum_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 81, + fieldName: "protobuf_unittest.default_nested_enum_extension_lite" +) + +let ProtobufUnittest_Extensions_default_foreign_enum_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 82, + fieldName: "protobuf_unittest.default_foreign_enum_extension_lite" +) + +let ProtobufUnittest_Extensions_default_import_enum_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 83, + fieldName: "protobuf_unittest.default_import_enum_extension_lite" +) + +let ProtobufUnittest_Extensions_default_string_piece_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 84, + fieldName: "protobuf_unittest.default_string_piece_extension_lite" +) + +let ProtobufUnittest_Extensions_default_cord_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 85, + fieldName: "protobuf_unittest.default_cord_extension_lite" +) + +/// For oneof test +let ProtobufUnittest_Extensions_oneof_uint32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 111, + fieldName: "protobuf_unittest.oneof_uint32_extension_lite" +) + +let ProtobufUnittest_Extensions_oneof_nested_message_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 112, + fieldName: "protobuf_unittest.oneof_nested_message_extension_lite" +) + +let ProtobufUnittest_Extensions_oneof_string_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 113, + fieldName: "protobuf_unittest.oneof_string_extension_lite" +) + +let ProtobufUnittest_Extensions_oneof_bytes_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 114, + fieldName: "protobuf_unittest.oneof_bytes_extension_lite" +) + +let ProtobufUnittest_Extensions_packed_int32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensionsLite>( + _protobuf_fieldNumber: 90, + fieldName: "protobuf_unittest.packed_int32_extension_lite" +) + +let ProtobufUnittest_Extensions_packed_int64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensionsLite>( + _protobuf_fieldNumber: 91, + fieldName: "protobuf_unittest.packed_int64_extension_lite" +) + +let ProtobufUnittest_Extensions_packed_uint32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensionsLite>( + _protobuf_fieldNumber: 92, + fieldName: "protobuf_unittest.packed_uint32_extension_lite" +) + +let ProtobufUnittest_Extensions_packed_uint64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensionsLite>( + _protobuf_fieldNumber: 93, + fieldName: "protobuf_unittest.packed_uint64_extension_lite" +) + +let ProtobufUnittest_Extensions_packed_sint32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensionsLite>( + _protobuf_fieldNumber: 94, + fieldName: "protobuf_unittest.packed_sint32_extension_lite" +) + +let ProtobufUnittest_Extensions_packed_sint64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensionsLite>( + _protobuf_fieldNumber: 95, + fieldName: "protobuf_unittest.packed_sint64_extension_lite" +) + +let ProtobufUnittest_Extensions_packed_fixed32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensionsLite>( + _protobuf_fieldNumber: 96, + fieldName: "protobuf_unittest.packed_fixed32_extension_lite" +) + +let ProtobufUnittest_Extensions_packed_fixed64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensionsLite>( + _protobuf_fieldNumber: 97, + fieldName: "protobuf_unittest.packed_fixed64_extension_lite" +) + +let ProtobufUnittest_Extensions_packed_sfixed32_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensionsLite>( + _protobuf_fieldNumber: 98, + fieldName: "protobuf_unittest.packed_sfixed32_extension_lite" +) + +let ProtobufUnittest_Extensions_packed_sfixed64_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensionsLite>( + _protobuf_fieldNumber: 99, + fieldName: "protobuf_unittest.packed_sfixed64_extension_lite" +) + +let ProtobufUnittest_Extensions_packed_float_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensionsLite>( + _protobuf_fieldNumber: 100, + fieldName: "protobuf_unittest.packed_float_extension_lite" +) + +let ProtobufUnittest_Extensions_packed_double_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensionsLite>( + _protobuf_fieldNumber: 101, + fieldName: "protobuf_unittest.packed_double_extension_lite" +) + +let ProtobufUnittest_Extensions_packed_bool_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensionsLite>( + _protobuf_fieldNumber: 102, + fieldName: "protobuf_unittest.packed_bool_extension_lite" +) + +let ProtobufUnittest_Extensions_packed_enum_extension_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestPackedExtensionsLite>( + _protobuf_fieldNumber: 103, + fieldName: "protobuf_unittest.packed_enum_extension_lite" +) + +let ProtobufUnittest_Extensions_test_all_types_lite = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestHugeFieldNumbersLite>( + _protobuf_fieldNumber: 536860000, + fieldName: "protobuf_unittest.test_all_types_lite" +) + +extension ProtobufUnittest_TestNestedExtensionLite { + enum Extensions { + static let nested_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestAllExtensionsLite>( + _protobuf_fieldNumber: 12345, + fieldName: "protobuf_unittest.TestNestedExtensionLite.nested_extension" + ) + } +} + +extension ProtobufUnittest_TestParsingMergeLite { + enum Extensions { + static let optional_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestParsingMergeLite>( + _protobuf_fieldNumber: 1000, + fieldName: "protobuf_unittest.TestParsingMergeLite.optional_ext" + ) + + static let repeated_ext = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestParsingMergeLite>( + _protobuf_fieldNumber: 1001, + fieldName: "protobuf_unittest.TestParsingMergeLite.repeated_ext" + ) + } +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest" + +extension ProtobufUnittest_ForeignEnumLite: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 4: .same(proto: "FOREIGN_LITE_FOO"), + 5: .same(proto: "FOREIGN_LITE_BAR"), + 6: .same(proto: "FOREIGN_LITE_BAZ"), + ] +} + +extension ProtobufUnittest_V1EnumLite: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "V1_FIRST"), + ] +} + +extension ProtobufUnittest_V2EnumLite: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "V2_FIRST"), + 2: .same(proto: "V2_SECOND"), + ] +} + +extension ProtobufUnittest_TestAllTypesLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestAllTypesLite" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_int32"), + 2: .standard(proto: "optional_int64"), + 3: .standard(proto: "optional_uint32"), + 4: .standard(proto: "optional_uint64"), + 5: .standard(proto: "optional_sint32"), + 6: .standard(proto: "optional_sint64"), + 7: .standard(proto: "optional_fixed32"), + 8: .standard(proto: "optional_fixed64"), + 9: .standard(proto: "optional_sfixed32"), + 10: .standard(proto: "optional_sfixed64"), + 11: .standard(proto: "optional_float"), + 12: .standard(proto: "optional_double"), + 13: .standard(proto: "optional_bool"), + 14: .standard(proto: "optional_string"), + 15: .standard(proto: "optional_bytes"), + 16: .unique(proto: "OptionalGroup", json: "optionalgroup"), + 18: .standard(proto: "optional_nested_message"), + 19: .standard(proto: "optional_foreign_message"), + 20: .standard(proto: "optional_import_message"), + 21: .standard(proto: "optional_nested_enum"), + 22: .standard(proto: "optional_foreign_enum"), + 23: .standard(proto: "optional_import_enum"), + 24: .standard(proto: "optional_string_piece"), + 25: .standard(proto: "optional_cord"), + 26: .standard(proto: "optional_public_import_message"), + 27: .standard(proto: "optional_lazy_message"), + 28: .standard(proto: "optional_unverified_lazy_message"), + 31: .standard(proto: "repeated_int32"), + 32: .standard(proto: "repeated_int64"), + 33: .standard(proto: "repeated_uint32"), + 34: .standard(proto: "repeated_uint64"), + 35: .standard(proto: "repeated_sint32"), + 36: .standard(proto: "repeated_sint64"), + 37: .standard(proto: "repeated_fixed32"), + 38: .standard(proto: "repeated_fixed64"), + 39: .standard(proto: "repeated_sfixed32"), + 40: .standard(proto: "repeated_sfixed64"), + 41: .standard(proto: "repeated_float"), + 42: .standard(proto: "repeated_double"), + 43: .standard(proto: "repeated_bool"), + 44: .standard(proto: "repeated_string"), + 45: .standard(proto: "repeated_bytes"), + 46: .unique(proto: "RepeatedGroup", json: "repeatedgroup"), + 48: .standard(proto: "repeated_nested_message"), + 49: .standard(proto: "repeated_foreign_message"), + 50: .standard(proto: "repeated_import_message"), + 51: .standard(proto: "repeated_nested_enum"), + 52: .standard(proto: "repeated_foreign_enum"), + 53: .standard(proto: "repeated_import_enum"), + 54: .standard(proto: "repeated_string_piece"), + 55: .standard(proto: "repeated_cord"), + 57: .standard(proto: "repeated_lazy_message"), + 61: .standard(proto: "default_int32"), + 62: .standard(proto: "default_int64"), + 63: .standard(proto: "default_uint32"), + 64: .standard(proto: "default_uint64"), + 65: .standard(proto: "default_sint32"), + 66: .standard(proto: "default_sint64"), + 67: .standard(proto: "default_fixed32"), + 68: .standard(proto: "default_fixed64"), + 69: .standard(proto: "default_sfixed32"), + 70: .standard(proto: "default_sfixed64"), + 71: .standard(proto: "default_float"), + 72: .standard(proto: "default_double"), + 73: .standard(proto: "default_bool"), + 74: .standard(proto: "default_string"), + 75: .standard(proto: "default_bytes"), + 81: .standard(proto: "default_nested_enum"), + 82: .standard(proto: "default_foreign_enum"), + 83: .standard(proto: "default_import_enum"), + 84: .standard(proto: "default_string_piece"), + 85: .standard(proto: "default_cord"), + 111: .standard(proto: "oneof_uint32"), + 112: .standard(proto: "oneof_nested_message"), + 113: .standard(proto: "oneof_string"), + 114: .standard(proto: "oneof_bytes"), + 115: .standard(proto: "oneof_lazy_nested_message"), + 117: .standard(proto: "oneof_nested_message2"), + 116: .standard(proto: "deceptively_named_list"), + ] + + fileprivate class _StorageClass { + var _optionalInt32: Int32? = nil + var _optionalInt64: Int64? = nil + var _optionalUint32: UInt32? = nil + var _optionalUint64: UInt64? = nil + var _optionalSint32: Int32? = nil + var _optionalSint64: Int64? = nil + var _optionalFixed32: UInt32? = nil + var _optionalFixed64: UInt64? = nil + var _optionalSfixed32: Int32? = nil + var _optionalSfixed64: Int64? = nil + var _optionalFloat: Float? = nil + var _optionalDouble: Double? = nil + var _optionalBool: Bool? = nil + var _optionalString: String? = nil + var _optionalBytes: Data? = nil + var _optionalGroup: ProtobufUnittest_TestAllTypesLite.OptionalGroup? = nil + var _optionalNestedMessage: ProtobufUnittest_TestAllTypesLite.NestedMessage? = nil + var _optionalForeignMessage: ProtobufUnittest_ForeignMessageLite? = nil + var _optionalImportMessage: ProtobufUnittestImport_ImportMessageLite? = nil + var _optionalNestedEnum: ProtobufUnittest_TestAllTypesLite.NestedEnum? = nil + var _optionalForeignEnum: ProtobufUnittest_ForeignEnumLite? = nil + var _optionalImportEnum: ProtobufUnittestImport_ImportEnumLite? = nil + var _optionalStringPiece: String? = nil + var _optionalCord: String? = nil + var _optionalPublicImportMessage: ProtobufUnittestImport_PublicImportMessageLite? = nil + var _optionalLazyMessage: ProtobufUnittest_TestAllTypesLite.NestedMessage? = nil + var _optionalUnverifiedLazyMessage: ProtobufUnittest_TestAllTypesLite.NestedMessage? = nil + var _repeatedInt32: [Int32] = [] + var _repeatedInt64: [Int64] = [] + var _repeatedUint32: [UInt32] = [] + var _repeatedUint64: [UInt64] = [] + var _repeatedSint32: [Int32] = [] + var _repeatedSint64: [Int64] = [] + var _repeatedFixed32: [UInt32] = [] + var _repeatedFixed64: [UInt64] = [] + var _repeatedSfixed32: [Int32] = [] + var _repeatedSfixed64: [Int64] = [] + var _repeatedFloat: [Float] = [] + var _repeatedDouble: [Double] = [] + var _repeatedBool: [Bool] = [] + var _repeatedString: [String] = [] + var _repeatedBytes: [Data] = [] + var _repeatedGroup: [ProtobufUnittest_TestAllTypesLite.RepeatedGroup] = [] + var _repeatedNestedMessage: [ProtobufUnittest_TestAllTypesLite.NestedMessage] = [] + var _repeatedForeignMessage: [ProtobufUnittest_ForeignMessageLite] = [] + var _repeatedImportMessage: [ProtobufUnittestImport_ImportMessageLite] = [] + var _repeatedNestedEnum: [ProtobufUnittest_TestAllTypesLite.NestedEnum] = [] + var _repeatedForeignEnum: [ProtobufUnittest_ForeignEnumLite] = [] + var _repeatedImportEnum: [ProtobufUnittestImport_ImportEnumLite] = [] + var _repeatedStringPiece: [String] = [] + var _repeatedCord: [String] = [] + var _repeatedLazyMessage: [ProtobufUnittest_TestAllTypesLite.NestedMessage] = [] + var _defaultInt32: Int32? = nil + var _defaultInt64: Int64? = nil + var _defaultUint32: UInt32? = nil + var _defaultUint64: UInt64? = nil + var _defaultSint32: Int32? = nil + var _defaultSint64: Int64? = nil + var _defaultFixed32: UInt32? = nil + var _defaultFixed64: UInt64? = nil + var _defaultSfixed32: Int32? = nil + var _defaultSfixed64: Int64? = nil + var _defaultFloat: Float? = nil + var _defaultDouble: Double? = nil + var _defaultBool: Bool? = nil + var _defaultString: String? = nil + var _defaultBytes: Data? = nil + var _defaultNestedEnum: ProtobufUnittest_TestAllTypesLite.NestedEnum? = nil + var _defaultForeignEnum: ProtobufUnittest_ForeignEnumLite? = nil + var _defaultImportEnum: ProtobufUnittestImport_ImportEnumLite? = nil + var _defaultStringPiece: String? = nil + var _defaultCord: String? = nil + var _oneofField: ProtobufUnittest_TestAllTypesLite.OneOf_OneofField? + var _deceptivelyNamedList: Int32? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _optionalInt32 = source._optionalInt32 + _optionalInt64 = source._optionalInt64 + _optionalUint32 = source._optionalUint32 + _optionalUint64 = source._optionalUint64 + _optionalSint32 = source._optionalSint32 + _optionalSint64 = source._optionalSint64 + _optionalFixed32 = source._optionalFixed32 + _optionalFixed64 = source._optionalFixed64 + _optionalSfixed32 = source._optionalSfixed32 + _optionalSfixed64 = source._optionalSfixed64 + _optionalFloat = source._optionalFloat + _optionalDouble = source._optionalDouble + _optionalBool = source._optionalBool + _optionalString = source._optionalString + _optionalBytes = source._optionalBytes + _optionalGroup = source._optionalGroup + _optionalNestedMessage = source._optionalNestedMessage + _optionalForeignMessage = source._optionalForeignMessage + _optionalImportMessage = source._optionalImportMessage + _optionalNestedEnum = source._optionalNestedEnum + _optionalForeignEnum = source._optionalForeignEnum + _optionalImportEnum = source._optionalImportEnum + _optionalStringPiece = source._optionalStringPiece + _optionalCord = source._optionalCord + _optionalPublicImportMessage = source._optionalPublicImportMessage + _optionalLazyMessage = source._optionalLazyMessage + _optionalUnverifiedLazyMessage = source._optionalUnverifiedLazyMessage + _repeatedInt32 = source._repeatedInt32 + _repeatedInt64 = source._repeatedInt64 + _repeatedUint32 = source._repeatedUint32 + _repeatedUint64 = source._repeatedUint64 + _repeatedSint32 = source._repeatedSint32 + _repeatedSint64 = source._repeatedSint64 + _repeatedFixed32 = source._repeatedFixed32 + _repeatedFixed64 = source._repeatedFixed64 + _repeatedSfixed32 = source._repeatedSfixed32 + _repeatedSfixed64 = source._repeatedSfixed64 + _repeatedFloat = source._repeatedFloat + _repeatedDouble = source._repeatedDouble + _repeatedBool = source._repeatedBool + _repeatedString = source._repeatedString + _repeatedBytes = source._repeatedBytes + _repeatedGroup = source._repeatedGroup + _repeatedNestedMessage = source._repeatedNestedMessage + _repeatedForeignMessage = source._repeatedForeignMessage + _repeatedImportMessage = source._repeatedImportMessage + _repeatedNestedEnum = source._repeatedNestedEnum + _repeatedForeignEnum = source._repeatedForeignEnum + _repeatedImportEnum = source._repeatedImportEnum + _repeatedStringPiece = source._repeatedStringPiece + _repeatedCord = source._repeatedCord + _repeatedLazyMessage = source._repeatedLazyMessage + _defaultInt32 = source._defaultInt32 + _defaultInt64 = source._defaultInt64 + _defaultUint32 = source._defaultUint32 + _defaultUint64 = source._defaultUint64 + _defaultSint32 = source._defaultSint32 + _defaultSint64 = source._defaultSint64 + _defaultFixed32 = source._defaultFixed32 + _defaultFixed64 = source._defaultFixed64 + _defaultSfixed32 = source._defaultSfixed32 + _defaultSfixed64 = source._defaultSfixed64 + _defaultFloat = source._defaultFloat + _defaultDouble = source._defaultDouble + _defaultBool = source._defaultBool + _defaultString = source._defaultString + _defaultBytes = source._defaultBytes + _defaultNestedEnum = source._defaultNestedEnum + _defaultForeignEnum = source._defaultForeignEnum + _defaultImportEnum = source._defaultImportEnum + _defaultStringPiece = source._defaultStringPiece + _defaultCord = source._defaultCord + _oneofField = source._oneofField + _deceptivelyNamedList = source._deceptivelyNamedList + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._optionalInt32) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._optionalInt64) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint32) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._optionalUint64) }() + case 5: try { try decoder.decodeSingularSInt32Field(value: &_storage._optionalSint32) }() + case 6: try { try decoder.decodeSingularSInt64Field(value: &_storage._optionalSint64) }() + case 7: try { try decoder.decodeSingularFixed32Field(value: &_storage._optionalFixed32) }() + case 8: try { try decoder.decodeSingularFixed64Field(value: &_storage._optionalFixed64) }() + case 9: try { try decoder.decodeSingularSFixed32Field(value: &_storage._optionalSfixed32) }() + case 10: try { try decoder.decodeSingularSFixed64Field(value: &_storage._optionalSfixed64) }() + case 11: try { try decoder.decodeSingularFloatField(value: &_storage._optionalFloat) }() + case 12: try { try decoder.decodeSingularDoubleField(value: &_storage._optionalDouble) }() + case 13: try { try decoder.decodeSingularBoolField(value: &_storage._optionalBool) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._optionalString) }() + case 15: try { try decoder.decodeSingularBytesField(value: &_storage._optionalBytes) }() + case 16: try { try decoder.decodeSingularGroupField(value: &_storage._optionalGroup) }() + case 18: try { try decoder.decodeSingularMessageField(value: &_storage._optionalNestedMessage) }() + case 19: try { try decoder.decodeSingularMessageField(value: &_storage._optionalForeignMessage) }() + case 20: try { try decoder.decodeSingularMessageField(value: &_storage._optionalImportMessage) }() + case 21: try { try decoder.decodeSingularEnumField(value: &_storage._optionalNestedEnum) }() + case 22: try { try decoder.decodeSingularEnumField(value: &_storage._optionalForeignEnum) }() + case 23: try { try decoder.decodeSingularEnumField(value: &_storage._optionalImportEnum) }() + case 24: try { try decoder.decodeSingularStringField(value: &_storage._optionalStringPiece) }() + case 25: try { try decoder.decodeSingularStringField(value: &_storage._optionalCord) }() + case 26: try { try decoder.decodeSingularMessageField(value: &_storage._optionalPublicImportMessage) }() + case 27: try { try decoder.decodeSingularMessageField(value: &_storage._optionalLazyMessage) }() + case 28: try { try decoder.decodeSingularMessageField(value: &_storage._optionalUnverifiedLazyMessage) }() + case 31: try { try decoder.decodeRepeatedInt32Field(value: &_storage._repeatedInt32) }() + case 32: try { try decoder.decodeRepeatedInt64Field(value: &_storage._repeatedInt64) }() + case 33: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._repeatedUint32) }() + case 34: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._repeatedUint64) }() + case 35: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._repeatedSint32) }() + case 36: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._repeatedSint64) }() + case 37: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._repeatedFixed32) }() + case 38: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._repeatedFixed64) }() + case 39: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._repeatedSfixed32) }() + case 40: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._repeatedSfixed64) }() + case 41: try { try decoder.decodeRepeatedFloatField(value: &_storage._repeatedFloat) }() + case 42: try { try decoder.decodeRepeatedDoubleField(value: &_storage._repeatedDouble) }() + case 43: try { try decoder.decodeRepeatedBoolField(value: &_storage._repeatedBool) }() + case 44: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedString) }() + case 45: try { try decoder.decodeRepeatedBytesField(value: &_storage._repeatedBytes) }() + case 46: try { try decoder.decodeRepeatedGroupField(value: &_storage._repeatedGroup) }() + case 48: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedNestedMessage) }() + case 49: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedForeignMessage) }() + case 50: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedImportMessage) }() + case 51: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedNestedEnum) }() + case 52: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedForeignEnum) }() + case 53: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedImportEnum) }() + case 54: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedStringPiece) }() + case 55: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedCord) }() + case 57: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedLazyMessage) }() + case 61: try { try decoder.decodeSingularInt32Field(value: &_storage._defaultInt32) }() + case 62: try { try decoder.decodeSingularInt64Field(value: &_storage._defaultInt64) }() + case 63: try { try decoder.decodeSingularUInt32Field(value: &_storage._defaultUint32) }() + case 64: try { try decoder.decodeSingularUInt64Field(value: &_storage._defaultUint64) }() + case 65: try { try decoder.decodeSingularSInt32Field(value: &_storage._defaultSint32) }() + case 66: try { try decoder.decodeSingularSInt64Field(value: &_storage._defaultSint64) }() + case 67: try { try decoder.decodeSingularFixed32Field(value: &_storage._defaultFixed32) }() + case 68: try { try decoder.decodeSingularFixed64Field(value: &_storage._defaultFixed64) }() + case 69: try { try decoder.decodeSingularSFixed32Field(value: &_storage._defaultSfixed32) }() + case 70: try { try decoder.decodeSingularSFixed64Field(value: &_storage._defaultSfixed64) }() + case 71: try { try decoder.decodeSingularFloatField(value: &_storage._defaultFloat) }() + case 72: try { try decoder.decodeSingularDoubleField(value: &_storage._defaultDouble) }() + case 73: try { try decoder.decodeSingularBoolField(value: &_storage._defaultBool) }() + case 74: try { try decoder.decodeSingularStringField(value: &_storage._defaultString) }() + case 75: try { try decoder.decodeSingularBytesField(value: &_storage._defaultBytes) }() + case 81: try { try decoder.decodeSingularEnumField(value: &_storage._defaultNestedEnum) }() + case 82: try { try decoder.decodeSingularEnumField(value: &_storage._defaultForeignEnum) }() + case 83: try { try decoder.decodeSingularEnumField(value: &_storage._defaultImportEnum) }() + case 84: try { try decoder.decodeSingularStringField(value: &_storage._defaultStringPiece) }() + case 85: try { try decoder.decodeSingularStringField(value: &_storage._defaultCord) }() + case 111: try { + var v: UInt32? + try decoder.decodeSingularUInt32Field(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofUint32(v) + } + }() + case 112: try { + var v: ProtobufUnittest_TestAllTypesLite.NestedMessage? + var hadOneofValue = false + if let current = _storage._oneofField { + hadOneofValue = true + if case .oneofNestedMessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofNestedMessage(v) + } + }() + case 113: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofString(v) + } + }() + case 114: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofBytes(v) + } + }() + case 115: try { + var v: ProtobufUnittest_TestAllTypesLite.NestedMessage? + var hadOneofValue = false + if let current = _storage._oneofField { + hadOneofValue = true + if case .oneofLazyNestedMessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofLazyNestedMessage(v) + } + }() + case 116: try { try decoder.decodeSingularInt32Field(value: &_storage._deceptivelyNamedList) }() + case 117: try { + var v: ProtobufUnittest_TestAllTypesLite.NestedMessage2? + var hadOneofValue = false + if let current = _storage._oneofField { + hadOneofValue = true + if case .oneofNestedMessage2(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofNestedMessage2(v) + } + }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._optionalInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._optionalInt64 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._optionalUint32 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._optionalUint64 { + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._optionalSint32 { + try visitor.visitSingularSInt32Field(value: v, fieldNumber: 5) + } }() + try { if let v = _storage._optionalSint64 { + try visitor.visitSingularSInt64Field(value: v, fieldNumber: 6) + } }() + try { if let v = _storage._optionalFixed32 { + try visitor.visitSingularFixed32Field(value: v, fieldNumber: 7) + } }() + try { if let v = _storage._optionalFixed64 { + try visitor.visitSingularFixed64Field(value: v, fieldNumber: 8) + } }() + try { if let v = _storage._optionalSfixed32 { + try visitor.visitSingularSFixed32Field(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._optionalSfixed64 { + try visitor.visitSingularSFixed64Field(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._optionalFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 11) + } }() + try { if let v = _storage._optionalDouble { + try visitor.visitSingularDoubleField(value: v, fieldNumber: 12) + } }() + try { if let v = _storage._optionalBool { + try visitor.visitSingularBoolField(value: v, fieldNumber: 13) + } }() + try { if let v = _storage._optionalString { + try visitor.visitSingularStringField(value: v, fieldNumber: 14) + } }() + try { if let v = _storage._optionalBytes { + try visitor.visitSingularBytesField(value: v, fieldNumber: 15) + } }() + try { if let v = _storage._optionalGroup { + try visitor.visitSingularGroupField(value: v, fieldNumber: 16) + } }() + try { if let v = _storage._optionalNestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._optionalForeignMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + } }() + try { if let v = _storage._optionalImportMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 20) + } }() + try { if let v = _storage._optionalNestedEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 21) + } }() + try { if let v = _storage._optionalForeignEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 22) + } }() + try { if let v = _storage._optionalImportEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 23) + } }() + try { if let v = _storage._optionalStringPiece { + try visitor.visitSingularStringField(value: v, fieldNumber: 24) + } }() + try { if let v = _storage._optionalCord { + try visitor.visitSingularStringField(value: v, fieldNumber: 25) + } }() + try { if let v = _storage._optionalPublicImportMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 26) + } }() + try { if let v = _storage._optionalLazyMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 27) + } }() + try { if let v = _storage._optionalUnverifiedLazyMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 28) + } }() + if !_storage._repeatedInt32.isEmpty { + try visitor.visitRepeatedInt32Field(value: _storage._repeatedInt32, fieldNumber: 31) + } + if !_storage._repeatedInt64.isEmpty { + try visitor.visitRepeatedInt64Field(value: _storage._repeatedInt64, fieldNumber: 32) + } + if !_storage._repeatedUint32.isEmpty { + try visitor.visitRepeatedUInt32Field(value: _storage._repeatedUint32, fieldNumber: 33) + } + if !_storage._repeatedUint64.isEmpty { + try visitor.visitRepeatedUInt64Field(value: _storage._repeatedUint64, fieldNumber: 34) + } + if !_storage._repeatedSint32.isEmpty { + try visitor.visitRepeatedSInt32Field(value: _storage._repeatedSint32, fieldNumber: 35) + } + if !_storage._repeatedSint64.isEmpty { + try visitor.visitRepeatedSInt64Field(value: _storage._repeatedSint64, fieldNumber: 36) + } + if !_storage._repeatedFixed32.isEmpty { + try visitor.visitRepeatedFixed32Field(value: _storage._repeatedFixed32, fieldNumber: 37) + } + if !_storage._repeatedFixed64.isEmpty { + try visitor.visitRepeatedFixed64Field(value: _storage._repeatedFixed64, fieldNumber: 38) + } + if !_storage._repeatedSfixed32.isEmpty { + try visitor.visitRepeatedSFixed32Field(value: _storage._repeatedSfixed32, fieldNumber: 39) + } + if !_storage._repeatedSfixed64.isEmpty { + try visitor.visitRepeatedSFixed64Field(value: _storage._repeatedSfixed64, fieldNumber: 40) + } + if !_storage._repeatedFloat.isEmpty { + try visitor.visitRepeatedFloatField(value: _storage._repeatedFloat, fieldNumber: 41) + } + if !_storage._repeatedDouble.isEmpty { + try visitor.visitRepeatedDoubleField(value: _storage._repeatedDouble, fieldNumber: 42) + } + if !_storage._repeatedBool.isEmpty { + try visitor.visitRepeatedBoolField(value: _storage._repeatedBool, fieldNumber: 43) + } + if !_storage._repeatedString.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedString, fieldNumber: 44) + } + if !_storage._repeatedBytes.isEmpty { + try visitor.visitRepeatedBytesField(value: _storage._repeatedBytes, fieldNumber: 45) + } + if !_storage._repeatedGroup.isEmpty { + try visitor.visitRepeatedGroupField(value: _storage._repeatedGroup, fieldNumber: 46) + } + if !_storage._repeatedNestedMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedNestedMessage, fieldNumber: 48) + } + if !_storage._repeatedForeignMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedForeignMessage, fieldNumber: 49) + } + if !_storage._repeatedImportMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedImportMessage, fieldNumber: 50) + } + if !_storage._repeatedNestedEnum.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedNestedEnum, fieldNumber: 51) + } + if !_storage._repeatedForeignEnum.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedForeignEnum, fieldNumber: 52) + } + if !_storage._repeatedImportEnum.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedImportEnum, fieldNumber: 53) + } + if !_storage._repeatedStringPiece.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedStringPiece, fieldNumber: 54) + } + if !_storage._repeatedCord.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedCord, fieldNumber: 55) + } + if !_storage._repeatedLazyMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedLazyMessage, fieldNumber: 57) + } + try { if let v = _storage._defaultInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 61) + } }() + try { if let v = _storage._defaultInt64 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 62) + } }() + try { if let v = _storage._defaultUint32 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 63) + } }() + try { if let v = _storage._defaultUint64 { + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 64) + } }() + try { if let v = _storage._defaultSint32 { + try visitor.visitSingularSInt32Field(value: v, fieldNumber: 65) + } }() + try { if let v = _storage._defaultSint64 { + try visitor.visitSingularSInt64Field(value: v, fieldNumber: 66) + } }() + try { if let v = _storage._defaultFixed32 { + try visitor.visitSingularFixed32Field(value: v, fieldNumber: 67) + } }() + try { if let v = _storage._defaultFixed64 { + try visitor.visitSingularFixed64Field(value: v, fieldNumber: 68) + } }() + try { if let v = _storage._defaultSfixed32 { + try visitor.visitSingularSFixed32Field(value: v, fieldNumber: 69) + } }() + try { if let v = _storage._defaultSfixed64 { + try visitor.visitSingularSFixed64Field(value: v, fieldNumber: 70) + } }() + try { if let v = _storage._defaultFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 71) + } }() + try { if let v = _storage._defaultDouble { + try visitor.visitSingularDoubleField(value: v, fieldNumber: 72) + } }() + try { if let v = _storage._defaultBool { + try visitor.visitSingularBoolField(value: v, fieldNumber: 73) + } }() + try { if let v = _storage._defaultString { + try visitor.visitSingularStringField(value: v, fieldNumber: 74) + } }() + try { if let v = _storage._defaultBytes { + try visitor.visitSingularBytesField(value: v, fieldNumber: 75) + } }() + try { if let v = _storage._defaultNestedEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 81) + } }() + try { if let v = _storage._defaultForeignEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 82) + } }() + try { if let v = _storage._defaultImportEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 83) + } }() + try { if let v = _storage._defaultStringPiece { + try visitor.visitSingularStringField(value: v, fieldNumber: 84) + } }() + try { if let v = _storage._defaultCord { + try visitor.visitSingularStringField(value: v, fieldNumber: 85) + } }() + switch _storage._oneofField { + case .oneofUint32?: try { + guard case .oneofUint32(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 111) + }() + case .oneofNestedMessage?: try { + guard case .oneofNestedMessage(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 112) + }() + case .oneofString?: try { + guard case .oneofString(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 113) + }() + case .oneofBytes?: try { + guard case .oneofBytes(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 114) + }() + case .oneofLazyNestedMessage?: try { + guard case .oneofLazyNestedMessage(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 115) + }() + default: break + } + try { if let v = _storage._deceptivelyNamedList { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 116) + } }() + try { if case .oneofNestedMessage2(let v)? = _storage._oneofField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 117) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestAllTypesLite, rhs: ProtobufUnittest_TestAllTypesLite) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._optionalInt32 != rhs_storage._optionalInt32 {return false} + if _storage._optionalInt64 != rhs_storage._optionalInt64 {return false} + if _storage._optionalUint32 != rhs_storage._optionalUint32 {return false} + if _storage._optionalUint64 != rhs_storage._optionalUint64 {return false} + if _storage._optionalSint32 != rhs_storage._optionalSint32 {return false} + if _storage._optionalSint64 != rhs_storage._optionalSint64 {return false} + if _storage._optionalFixed32 != rhs_storage._optionalFixed32 {return false} + if _storage._optionalFixed64 != rhs_storage._optionalFixed64 {return false} + if _storage._optionalSfixed32 != rhs_storage._optionalSfixed32 {return false} + if _storage._optionalSfixed64 != rhs_storage._optionalSfixed64 {return false} + if _storage._optionalFloat != rhs_storage._optionalFloat {return false} + if _storage._optionalDouble != rhs_storage._optionalDouble {return false} + if _storage._optionalBool != rhs_storage._optionalBool {return false} + if _storage._optionalString != rhs_storage._optionalString {return false} + if _storage._optionalBytes != rhs_storage._optionalBytes {return false} + if _storage._optionalGroup != rhs_storage._optionalGroup {return false} + if _storage._optionalNestedMessage != rhs_storage._optionalNestedMessage {return false} + if _storage._optionalForeignMessage != rhs_storage._optionalForeignMessage {return false} + if _storage._optionalImportMessage != rhs_storage._optionalImportMessage {return false} + if _storage._optionalNestedEnum != rhs_storage._optionalNestedEnum {return false} + if _storage._optionalForeignEnum != rhs_storage._optionalForeignEnum {return false} + if _storage._optionalImportEnum != rhs_storage._optionalImportEnum {return false} + if _storage._optionalStringPiece != rhs_storage._optionalStringPiece {return false} + if _storage._optionalCord != rhs_storage._optionalCord {return false} + if _storage._optionalPublicImportMessage != rhs_storage._optionalPublicImportMessage {return false} + if _storage._optionalLazyMessage != rhs_storage._optionalLazyMessage {return false} + if _storage._optionalUnverifiedLazyMessage != rhs_storage._optionalUnverifiedLazyMessage {return false} + if _storage._repeatedInt32 != rhs_storage._repeatedInt32 {return false} + if _storage._repeatedInt64 != rhs_storage._repeatedInt64 {return false} + if _storage._repeatedUint32 != rhs_storage._repeatedUint32 {return false} + if _storage._repeatedUint64 != rhs_storage._repeatedUint64 {return false} + if _storage._repeatedSint32 != rhs_storage._repeatedSint32 {return false} + if _storage._repeatedSint64 != rhs_storage._repeatedSint64 {return false} + if _storage._repeatedFixed32 != rhs_storage._repeatedFixed32 {return false} + if _storage._repeatedFixed64 != rhs_storage._repeatedFixed64 {return false} + if _storage._repeatedSfixed32 != rhs_storage._repeatedSfixed32 {return false} + if _storage._repeatedSfixed64 != rhs_storage._repeatedSfixed64 {return false} + if _storage._repeatedFloat != rhs_storage._repeatedFloat {return false} + if _storage._repeatedDouble != rhs_storage._repeatedDouble {return false} + if _storage._repeatedBool != rhs_storage._repeatedBool {return false} + if _storage._repeatedString != rhs_storage._repeatedString {return false} + if _storage._repeatedBytes != rhs_storage._repeatedBytes {return false} + if _storage._repeatedGroup != rhs_storage._repeatedGroup {return false} + if _storage._repeatedNestedMessage != rhs_storage._repeatedNestedMessage {return false} + if _storage._repeatedForeignMessage != rhs_storage._repeatedForeignMessage {return false} + if _storage._repeatedImportMessage != rhs_storage._repeatedImportMessage {return false} + if _storage._repeatedNestedEnum != rhs_storage._repeatedNestedEnum {return false} + if _storage._repeatedForeignEnum != rhs_storage._repeatedForeignEnum {return false} + if _storage._repeatedImportEnum != rhs_storage._repeatedImportEnum {return false} + if _storage._repeatedStringPiece != rhs_storage._repeatedStringPiece {return false} + if _storage._repeatedCord != rhs_storage._repeatedCord {return false} + if _storage._repeatedLazyMessage != rhs_storage._repeatedLazyMessage {return false} + if _storage._defaultInt32 != rhs_storage._defaultInt32 {return false} + if _storage._defaultInt64 != rhs_storage._defaultInt64 {return false} + if _storage._defaultUint32 != rhs_storage._defaultUint32 {return false} + if _storage._defaultUint64 != rhs_storage._defaultUint64 {return false} + if _storage._defaultSint32 != rhs_storage._defaultSint32 {return false} + if _storage._defaultSint64 != rhs_storage._defaultSint64 {return false} + if _storage._defaultFixed32 != rhs_storage._defaultFixed32 {return false} + if _storage._defaultFixed64 != rhs_storage._defaultFixed64 {return false} + if _storage._defaultSfixed32 != rhs_storage._defaultSfixed32 {return false} + if _storage._defaultSfixed64 != rhs_storage._defaultSfixed64 {return false} + if _storage._defaultFloat != rhs_storage._defaultFloat {return false} + if _storage._defaultDouble != rhs_storage._defaultDouble {return false} + if _storage._defaultBool != rhs_storage._defaultBool {return false} + if _storage._defaultString != rhs_storage._defaultString {return false} + if _storage._defaultBytes != rhs_storage._defaultBytes {return false} + if _storage._defaultNestedEnum != rhs_storage._defaultNestedEnum {return false} + if _storage._defaultForeignEnum != rhs_storage._defaultForeignEnum {return false} + if _storage._defaultImportEnum != rhs_storage._defaultImportEnum {return false} + if _storage._defaultStringPiece != rhs_storage._defaultStringPiece {return false} + if _storage._defaultCord != rhs_storage._defaultCord {return false} + if _storage._oneofField != rhs_storage._oneofField {return false} + if _storage._deceptivelyNamedList != rhs_storage._deceptivelyNamedList {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestAllTypesLite.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "FOO"), + 2: .same(proto: "BAR"), + 3: .same(proto: "BAZ"), + ] +} + +extension ProtobufUnittest_TestAllTypesLite.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestAllTypesLite.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "bb"), + 2: .same(proto: "cc"), + 3: .same(proto: "dd"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._bb) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self._cc) }() + case 3: try { try decoder.decodeRepeatedInt32Field(value: &self.dd) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._bb { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._cc { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 2) + } }() + if !self.dd.isEmpty { + try visitor.visitPackedInt32Field(value: self.dd, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestAllTypesLite.NestedMessage, rhs: ProtobufUnittest_TestAllTypesLite.NestedMessage) -> Bool { + if lhs._bb != rhs._bb {return false} + if lhs._cc != rhs._cc {return false} + if lhs.dd != rhs.dd {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestAllTypesLite.NestedMessage2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestAllTypesLite.protoMessageName + ".NestedMessage2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "dd"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._dd) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._dd { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestAllTypesLite.NestedMessage2, rhs: ProtobufUnittest_TestAllTypesLite.NestedMessage2) -> Bool { + if lhs._dd != rhs._dd {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestAllTypesLite.OptionalGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestAllTypesLite.protoMessageName + ".OptionalGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 17: .same(proto: "a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 17: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 17) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestAllTypesLite.OptionalGroup, rhs: ProtobufUnittest_TestAllTypesLite.OptionalGroup) -> Bool { + if lhs._a != rhs._a {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestAllTypesLite.RepeatedGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestAllTypesLite.protoMessageName + ".RepeatedGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 47: .same(proto: "a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 47: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 47) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestAllTypesLite.RepeatedGroup, rhs: ProtobufUnittest_TestAllTypesLite.RepeatedGroup) -> Bool { + if lhs._a != rhs._a {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_ForeignMessageLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ForeignMessageLite" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "c"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._c) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._c { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_ForeignMessageLite, rhs: ProtobufUnittest_ForeignMessageLite) -> Bool { + if lhs._c != rhs._c {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestPackedTypesLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestPackedTypesLite" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 90: .standard(proto: "packed_int32"), + 91: .standard(proto: "packed_int64"), + 92: .standard(proto: "packed_uint32"), + 93: .standard(proto: "packed_uint64"), + 94: .standard(proto: "packed_sint32"), + 95: .standard(proto: "packed_sint64"), + 96: .standard(proto: "packed_fixed32"), + 97: .standard(proto: "packed_fixed64"), + 98: .standard(proto: "packed_sfixed32"), + 99: .standard(proto: "packed_sfixed64"), + 100: .standard(proto: "packed_float"), + 101: .standard(proto: "packed_double"), + 102: .standard(proto: "packed_bool"), + 103: .standard(proto: "packed_enum"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 90: try { try decoder.decodeRepeatedInt32Field(value: &self.packedInt32) }() + case 91: try { try decoder.decodeRepeatedInt64Field(value: &self.packedInt64) }() + case 92: try { try decoder.decodeRepeatedUInt32Field(value: &self.packedUint32) }() + case 93: try { try decoder.decodeRepeatedUInt64Field(value: &self.packedUint64) }() + case 94: try { try decoder.decodeRepeatedSInt32Field(value: &self.packedSint32) }() + case 95: try { try decoder.decodeRepeatedSInt64Field(value: &self.packedSint64) }() + case 96: try { try decoder.decodeRepeatedFixed32Field(value: &self.packedFixed32) }() + case 97: try { try decoder.decodeRepeatedFixed64Field(value: &self.packedFixed64) }() + case 98: try { try decoder.decodeRepeatedSFixed32Field(value: &self.packedSfixed32) }() + case 99: try { try decoder.decodeRepeatedSFixed64Field(value: &self.packedSfixed64) }() + case 100: try { try decoder.decodeRepeatedFloatField(value: &self.packedFloat) }() + case 101: try { try decoder.decodeRepeatedDoubleField(value: &self.packedDouble) }() + case 102: try { try decoder.decodeRepeatedBoolField(value: &self.packedBool) }() + case 103: try { try decoder.decodeRepeatedEnumField(value: &self.packedEnum) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.packedInt32.isEmpty { + try visitor.visitPackedInt32Field(value: self.packedInt32, fieldNumber: 90) + } + if !self.packedInt64.isEmpty { + try visitor.visitPackedInt64Field(value: self.packedInt64, fieldNumber: 91) + } + if !self.packedUint32.isEmpty { + try visitor.visitPackedUInt32Field(value: self.packedUint32, fieldNumber: 92) + } + if !self.packedUint64.isEmpty { + try visitor.visitPackedUInt64Field(value: self.packedUint64, fieldNumber: 93) + } + if !self.packedSint32.isEmpty { + try visitor.visitPackedSInt32Field(value: self.packedSint32, fieldNumber: 94) + } + if !self.packedSint64.isEmpty { + try visitor.visitPackedSInt64Field(value: self.packedSint64, fieldNumber: 95) + } + if !self.packedFixed32.isEmpty { + try visitor.visitPackedFixed32Field(value: self.packedFixed32, fieldNumber: 96) + } + if !self.packedFixed64.isEmpty { + try visitor.visitPackedFixed64Field(value: self.packedFixed64, fieldNumber: 97) + } + if !self.packedSfixed32.isEmpty { + try visitor.visitPackedSFixed32Field(value: self.packedSfixed32, fieldNumber: 98) + } + if !self.packedSfixed64.isEmpty { + try visitor.visitPackedSFixed64Field(value: self.packedSfixed64, fieldNumber: 99) + } + if !self.packedFloat.isEmpty { + try visitor.visitPackedFloatField(value: self.packedFloat, fieldNumber: 100) + } + if !self.packedDouble.isEmpty { + try visitor.visitPackedDoubleField(value: self.packedDouble, fieldNumber: 101) + } + if !self.packedBool.isEmpty { + try visitor.visitPackedBoolField(value: self.packedBool, fieldNumber: 102) + } + if !self.packedEnum.isEmpty { + try visitor.visitPackedEnumField(value: self.packedEnum, fieldNumber: 103) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestPackedTypesLite, rhs: ProtobufUnittest_TestPackedTypesLite) -> Bool { + if lhs.packedInt32 != rhs.packedInt32 {return false} + if lhs.packedInt64 != rhs.packedInt64 {return false} + if lhs.packedUint32 != rhs.packedUint32 {return false} + if lhs.packedUint64 != rhs.packedUint64 {return false} + if lhs.packedSint32 != rhs.packedSint32 {return false} + if lhs.packedSint64 != rhs.packedSint64 {return false} + if lhs.packedFixed32 != rhs.packedFixed32 {return false} + if lhs.packedFixed64 != rhs.packedFixed64 {return false} + if lhs.packedSfixed32 != rhs.packedSfixed32 {return false} + if lhs.packedSfixed64 != rhs.packedSfixed64 {return false} + if lhs.packedFloat != rhs.packedFloat {return false} + if lhs.packedDouble != rhs.packedDouble {return false} + if lhs.packedBool != rhs.packedBool {return false} + if lhs.packedEnum != rhs.packedEnum {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestAllExtensionsLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestAllExtensionsLite" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + if (1 <= fieldNumber && fieldNumber < 536870912) { + try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestAllExtensionsLite.self, fieldNumber: fieldNumber) + } + } + } + + func traverse(visitor: inout V) throws { + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestAllExtensionsLite, rhs: ProtobufUnittest_TestAllExtensionsLite) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_OptionalGroup_extension_lite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".OptionalGroup_extension_lite" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 17: .same(proto: "a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 17: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 17) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_OptionalGroup_extension_lite, rhs: ProtobufUnittest_OptionalGroup_extension_lite) -> Bool { + if lhs._a != rhs._a {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_RepeatedGroup_extension_lite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RepeatedGroup_extension_lite" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 47: .same(proto: "a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 47: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 47) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_RepeatedGroup_extension_lite, rhs: ProtobufUnittest_RepeatedGroup_extension_lite) -> Bool { + if lhs._a != rhs._a {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestPackedExtensionsLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestPackedExtensionsLite" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + if (1 <= fieldNumber && fieldNumber < 536870912) { + try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestPackedExtensionsLite.self, fieldNumber: fieldNumber) + } + } + } + + func traverse(visitor: inout V) throws { + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestPackedExtensionsLite, rhs: ProtobufUnittest_TestPackedExtensionsLite) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestNestedExtensionLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestNestedExtensionLite" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestNestedExtensionLite, rhs: ProtobufUnittest_TestNestedExtensionLite) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestDeprecatedLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestDeprecatedLite" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "deprecated_field"), + 2: .standard(proto: "deprecated_field2"), + 3: .standard(proto: "deprecated_field3"), + 4: .standard(proto: "deprecated_field4"), + ] + + fileprivate class _StorageClass { + var _deprecatedField: Int32? = nil + var _deprecatedField2: Int32? = nil + var _deprecatedField3: String? = nil + var _deprecatedField4: ProtobufUnittest_TestDeprecatedLite? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _deprecatedField = source._deprecatedField + _deprecatedField2 = source._deprecatedField2 + _deprecatedField3 = source._deprecatedField3 + _deprecatedField4 = source._deprecatedField4 + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + public var isInitialized: Bool { + return withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if _storage._deprecatedField2 == nil {return false} + if let v = _storage._deprecatedField4, !v.isInitialized {return false} + return true + } + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._deprecatedField) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &_storage._deprecatedField2) }() + case 3: try { try decoder.decodeSingularStringField(value: &_storage._deprecatedField3) }() + case 4: try { try decoder.decodeSingularMessageField(value: &_storage._deprecatedField4) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._deprecatedField { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._deprecatedField2 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._deprecatedField3 { + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._deprecatedField4 { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestDeprecatedLite, rhs: ProtobufUnittest_TestDeprecatedLite) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._deprecatedField != rhs_storage._deprecatedField {return false} + if _storage._deprecatedField2 != rhs_storage._deprecatedField2 {return false} + if _storage._deprecatedField3 != rhs_storage._deprecatedField3 {return false} + if _storage._deprecatedField4 != rhs_storage._deprecatedField4 {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestParsingMergeLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestParsingMergeLite" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "required_all_types"), + 2: .standard(proto: "optional_all_types"), + 3: .standard(proto: "repeated_all_types"), + 10: .unique(proto: "OptionalGroup", json: "optionalgroup"), + 20: .unique(proto: "RepeatedGroup", json: "repeatedgroup"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + if self._requiredAllTypes == nil {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._requiredAllTypes) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._optionalAllTypes) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.repeatedAllTypes) }() + case 10: try { try decoder.decodeSingularGroupField(value: &self._optionalGroup) }() + case 20: try { try decoder.decodeRepeatedGroupField(value: &self.repeatedGroup) }() + case 1000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestParsingMergeLite.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._requiredAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if !self.repeatedAllTypes.isEmpty { + try visitor.visitRepeatedMessageField(value: self.repeatedAllTypes, fieldNumber: 3) + } + try { if let v = self._optionalGroup { + try visitor.visitSingularGroupField(value: v, fieldNumber: 10) + } }() + if !self.repeatedGroup.isEmpty { + try visitor.visitRepeatedGroupField(value: self.repeatedGroup, fieldNumber: 20) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestParsingMergeLite, rhs: ProtobufUnittest_TestParsingMergeLite) -> Bool { + if lhs._requiredAllTypes != rhs._requiredAllTypes {return false} + if lhs._optionalAllTypes != rhs._optionalAllTypes {return false} + if lhs.repeatedAllTypes != rhs.repeatedAllTypes {return false} + if lhs._optionalGroup != rhs._optionalGroup {return false} + if lhs.repeatedGroup != rhs.repeatedGroup {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestParsingMergeLite.protoMessageName + ".RepeatedFieldsGenerator" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "field1"), + 2: .same(proto: "field2"), + 3: .same(proto: "field3"), + 10: .unique(proto: "Group1", json: "group1"), + 20: .unique(proto: "Group2", json: "group2"), + 1000: .same(proto: "ext1"), + 1001: .same(proto: "ext2"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.field1) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.field2) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.field3) }() + case 10: try { try decoder.decodeRepeatedGroupField(value: &self.group1) }() + case 20: try { try decoder.decodeRepeatedGroupField(value: &self.group2) }() + case 1000: try { try decoder.decodeRepeatedMessageField(value: &self.ext1) }() + case 1001: try { try decoder.decodeRepeatedMessageField(value: &self.ext2) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.field1.isEmpty { + try visitor.visitRepeatedMessageField(value: self.field1, fieldNumber: 1) + } + if !self.field2.isEmpty { + try visitor.visitRepeatedMessageField(value: self.field2, fieldNumber: 2) + } + if !self.field3.isEmpty { + try visitor.visitRepeatedMessageField(value: self.field3, fieldNumber: 3) + } + if !self.group1.isEmpty { + try visitor.visitRepeatedGroupField(value: self.group1, fieldNumber: 10) + } + if !self.group2.isEmpty { + try visitor.visitRepeatedGroupField(value: self.group2, fieldNumber: 20) + } + if !self.ext1.isEmpty { + try visitor.visitRepeatedMessageField(value: self.ext1, fieldNumber: 1000) + } + if !self.ext2.isEmpty { + try visitor.visitRepeatedMessageField(value: self.ext2, fieldNumber: 1001) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator, rhs: ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator) -> Bool { + if lhs.field1 != rhs.field1 {return false} + if lhs.field2 != rhs.field2 {return false} + if lhs.field3 != rhs.field3 {return false} + if lhs.group1 != rhs.group1 {return false} + if lhs.group2 != rhs.group2 {return false} + if lhs.ext1 != rhs.ext1 {return false} + if lhs.ext2 != rhs.ext2 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator.Group1: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator.protoMessageName + ".Group1" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 11: .same(proto: "field1"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 11: try { try decoder.decodeSingularMessageField(value: &self._field1) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._field1 { + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator.Group1, rhs: ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator.Group1) -> Bool { + if lhs._field1 != rhs._field1 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator.Group2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator.protoMessageName + ".Group2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 21: .same(proto: "field1"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 21: try { try decoder.decodeSingularMessageField(value: &self._field1) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._field1 { + try visitor.visitSingularMessageField(value: v, fieldNumber: 21) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator.Group2, rhs: ProtobufUnittest_TestParsingMergeLite.RepeatedFieldsGenerator.Group2) -> Bool { + if lhs._field1 != rhs._field1 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestParsingMergeLite.OptionalGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestParsingMergeLite.protoMessageName + ".OptionalGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 11: .standard(proto: "optional_group_all_types"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 11: try { try decoder.decodeSingularMessageField(value: &self._optionalGroupAllTypes) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalGroupAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestParsingMergeLite.OptionalGroup, rhs: ProtobufUnittest_TestParsingMergeLite.OptionalGroup) -> Bool { + if lhs._optionalGroupAllTypes != rhs._optionalGroupAllTypes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestParsingMergeLite.RepeatedGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestParsingMergeLite.protoMessageName + ".RepeatedGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 21: .standard(proto: "repeated_group_all_types"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 21: try { try decoder.decodeSingularMessageField(value: &self._repeatedGroupAllTypes) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._repeatedGroupAllTypes { + try visitor.visitSingularMessageField(value: v, fieldNumber: 21) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestParsingMergeLite.RepeatedGroup, rhs: ProtobufUnittest_TestParsingMergeLite.RepeatedGroup) -> Bool { + if lhs._repeatedGroupAllTypes != rhs._repeatedGroupAllTypes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMergeExceptionLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMergeExceptionLite" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "all_extensions"), + ] + + public var isInitialized: Bool { + if let v = self._allExtensions, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._allExtensions) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._allExtensions { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMergeExceptionLite, rhs: ProtobufUnittest_TestMergeExceptionLite) -> Bool { + if lhs._allExtensions != rhs._allExtensions {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestEmptyMessageLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestEmptyMessageLite" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestEmptyMessageLite, rhs: ProtobufUnittest_TestEmptyMessageLite) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestEmptyMessageWithExtensionsLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestEmptyMessageWithExtensionsLite" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + if (1 <= fieldNumber && fieldNumber < 536870912) { + try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestEmptyMessageWithExtensionsLite.self, fieldNumber: fieldNumber) + } + } + } + + func traverse(visitor: inout V) throws { + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestEmptyMessageWithExtensionsLite, rhs: ProtobufUnittest_TestEmptyMessageWithExtensionsLite) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_V1MessageLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".V1MessageLite" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "int_field"), + 2: .standard(proto: "enum_field"), + ] + + public var isInitialized: Bool { + if self._intField == nil {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._intField) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self._enumField) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._intField { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._enumField { + try visitor.visitSingularEnumField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_V1MessageLite, rhs: ProtobufUnittest_V1MessageLite) -> Bool { + if lhs._intField != rhs._intField {return false} + if lhs._enumField != rhs._enumField {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_V2MessageLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".V2MessageLite" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "int_field"), + 2: .standard(proto: "enum_field"), + ] + + public var isInitialized: Bool { + if self._intField == nil {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._intField) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self._enumField) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._intField { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._enumField { + try visitor.visitSingularEnumField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_V2MessageLite, rhs: ProtobufUnittest_V2MessageLite) -> Bool { + if lhs._intField != rhs._intField {return false} + if lhs._enumField != rhs._enumField {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestHugeFieldNumbersLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestHugeFieldNumbersLite" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 536870000: .standard(proto: "optional_int32"), + 536870001: .standard(proto: "fixed_32"), + 536870002: .standard(proto: "repeated_int32"), + 536870003: .standard(proto: "packed_int32"), + 536870004: .standard(proto: "optional_enum"), + 536870005: .standard(proto: "optional_string"), + 536870006: .standard(proto: "optional_bytes"), + 536870007: .standard(proto: "optional_message"), + 536870008: .unique(proto: "OptionalGroup", json: "optionalgroup"), + 536870010: .standard(proto: "string_string_map"), + 536870011: .standard(proto: "oneof_uint32"), + 536870012: .standard(proto: "oneof_test_all_types"), + 536870013: .standard(proto: "oneof_string"), + 536870014: .standard(proto: "oneof_bytes"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 536870000: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt32) }() + case 536870001: try { try decoder.decodeSingularInt32Field(value: &self._fixed32) }() + case 536870002: try { try decoder.decodeRepeatedInt32Field(value: &self.repeatedInt32) }() + case 536870003: try { try decoder.decodeRepeatedInt32Field(value: &self.packedInt32) }() + case 536870004: try { try decoder.decodeSingularEnumField(value: &self._optionalEnum) }() + case 536870005: try { try decoder.decodeSingularStringField(value: &self._optionalString) }() + case 536870006: try { try decoder.decodeSingularBytesField(value: &self._optionalBytes) }() + case 536870007: try { try decoder.decodeSingularMessageField(value: &self._optionalMessage) }() + case 536870008: try { try decoder.decodeSingularGroupField(value: &self._optionalGroup) }() + case 536870010: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.stringStringMap) }() + case 536870011: try { + var v: UInt32? + try decoder.decodeSingularUInt32Field(value: &v) + if let v = v { + if self.oneofField != nil {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofUint32(v) + } + }() + case 536870012: try { + var v: ProtobufUnittest_TestAllTypesLite? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .oneofTestAllTypes(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofTestAllTypes(v) + } + }() + case 536870013: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.oneofField != nil {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofString(v) + } + }() + case 536870014: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if self.oneofField != nil {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofBytes(v) + } + }() + case 536860000..<536870000: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestHugeFieldNumbersLite.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 536860000, end: 536870000) + try { if let v = self._optionalInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 536870000) + } }() + try { if let v = self._fixed32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 536870001) + } }() + if !self.repeatedInt32.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.repeatedInt32, fieldNumber: 536870002) + } + if !self.packedInt32.isEmpty { + try visitor.visitPackedInt32Field(value: self.packedInt32, fieldNumber: 536870003) + } + try { if let v = self._optionalEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 536870004) + } }() + try { if let v = self._optionalString { + try visitor.visitSingularStringField(value: v, fieldNumber: 536870005) + } }() + try { if let v = self._optionalBytes { + try visitor.visitSingularBytesField(value: v, fieldNumber: 536870006) + } }() + try { if let v = self._optionalMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 536870007) + } }() + try { if let v = self._optionalGroup { + try visitor.visitSingularGroupField(value: v, fieldNumber: 536870008) + } }() + if !self.stringStringMap.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.stringStringMap, fieldNumber: 536870010) + } + switch self.oneofField { + case .oneofUint32?: try { + guard case .oneofUint32(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 536870011) + }() + case .oneofTestAllTypes?: try { + guard case .oneofTestAllTypes(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 536870012) + }() + case .oneofString?: try { + guard case .oneofString(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 536870013) + }() + case .oneofBytes?: try { + guard case .oneofBytes(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 536870014) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestHugeFieldNumbersLite, rhs: ProtobufUnittest_TestHugeFieldNumbersLite) -> Bool { + if lhs._optionalInt32 != rhs._optionalInt32 {return false} + if lhs._fixed32 != rhs._fixed32 {return false} + if lhs.repeatedInt32 != rhs.repeatedInt32 {return false} + if lhs.packedInt32 != rhs.packedInt32 {return false} + if lhs._optionalEnum != rhs._optionalEnum {return false} + if lhs._optionalString != rhs._optionalString {return false} + if lhs._optionalBytes != rhs._optionalBytes {return false} + if lhs._optionalMessage != rhs._optionalMessage {return false} + if lhs._optionalGroup != rhs._optionalGroup {return false} + if lhs.stringStringMap != rhs.stringStringMap {return false} + if lhs.oneofField != rhs.oneofField {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestHugeFieldNumbersLite.protoMessageName + ".OptionalGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 536870009: .standard(proto: "group_a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 536870009: try { try decoder.decodeSingularInt32Field(value: &self._groupA) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._groupA { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 536870009) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup, rhs: ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup) -> Bool { + if lhs._groupA != rhs._groupA {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestOneofParsingLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestOneofParsingLite" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "oneof_int32"), + 2: .standard(proto: "oneof_submessage"), + 3: .standard(proto: "oneof_string"), + 4: .standard(proto: "oneof_bytes"), + 5: .standard(proto: "oneof_string_cord"), + 6: .standard(proto: "oneof_bytes_cord"), + 7: .standard(proto: "oneof_string_string_piece"), + 8: .standard(proto: "oneof_bytes_string_piece"), + 9: .standard(proto: "oneof_enum"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { + var v: Int32? + try decoder.decodeSingularInt32Field(value: &v) + if let v = v { + if self.oneofField != nil {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofInt32(v) + } + }() + case 2: try { + var v: ProtobufUnittest_TestAllTypesLite? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .oneofSubmessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofSubmessage(v) + } + }() + case 3: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.oneofField != nil {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofString(v) + } + }() + case 4: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if self.oneofField != nil {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofBytes(v) + } + }() + case 5: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.oneofField != nil {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofStringCord(v) + } + }() + case 6: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if self.oneofField != nil {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofBytesCord(v) + } + }() + case 7: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.oneofField != nil {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofStringStringPiece(v) + } + }() + case 8: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if self.oneofField != nil {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofBytesStringPiece(v) + } + }() + case 9: try { + var v: ProtobufUnittest_V2EnumLite? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if self.oneofField != nil {try decoder.handleConflictingOneOf()} + self.oneofField = .oneofEnum(v) + } + }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + switch self.oneofField { + case .oneofInt32?: try { + guard case .oneofInt32(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + }() + case .oneofSubmessage?: try { + guard case .oneofSubmessage(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + }() + case .oneofString?: try { + guard case .oneofString(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + }() + case .oneofBytes?: try { + guard case .oneofBytes(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 4) + }() + case .oneofStringCord?: try { + guard case .oneofStringCord(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 5) + }() + case .oneofBytesCord?: try { + guard case .oneofBytesCord(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 6) + }() + case .oneofStringStringPiece?: try { + guard case .oneofStringStringPiece(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 7) + }() + case .oneofBytesStringPiece?: try { + guard case .oneofBytesStringPiece(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 8) + }() + case .oneofEnum?: try { + guard case .oneofEnum(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 9) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestOneofParsingLite, rhs: ProtobufUnittest_TestOneofParsingLite) -> Bool { + if lhs.oneofField != rhs.oneofField {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMessageSetLite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMessageSetLite" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + try decoder.decodeExtensionFieldsAsMessageSet(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestMessageSetLite.self) + } + + func traverse(visitor: inout V) throws { + try visitor.visitExtensionFieldsAsMessageSet(fields: _protobuf_extensionFieldValues, start: 100, end: 2147483647) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMessageSetLite, rhs: ProtobufUnittest_TestMessageSetLite) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_PackedInt32: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PackedInt32" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 2048: .standard(proto: "repeated_int32"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 2048: try { try decoder.decodeRepeatedInt32Field(value: &self.repeatedInt32) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.repeatedInt32.isEmpty { + try visitor.visitPackedInt32Field(value: self.repeatedInt32, fieldNumber: 2048) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_PackedInt32, rhs: ProtobufUnittest_PackedInt32) -> Bool { + if lhs.repeatedInt32 != rhs.repeatedInt32 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_NonPackedInt32: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".NonPackedInt32" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 2048: .standard(proto: "repeated_int32"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 2048: try { try decoder.decodeRepeatedInt32Field(value: &self.repeatedInt32) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.repeatedInt32.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.repeatedInt32, fieldNumber: 2048) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_NonPackedInt32, rhs: ProtobufUnittest_NonPackedInt32) -> Bool { + if lhs.repeatedInt32 != rhs.repeatedInt32 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_PackedFixed32: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PackedFixed32" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 2048: .standard(proto: "repeated_fixed32"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 2048: try { try decoder.decodeRepeatedFixed32Field(value: &self.repeatedFixed32) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.repeatedFixed32.isEmpty { + try visitor.visitPackedFixed32Field(value: self.repeatedFixed32, fieldNumber: 2048) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_PackedFixed32, rhs: ProtobufUnittest_PackedFixed32) -> Bool { + if lhs.repeatedFixed32 != rhs.repeatedFixed32 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_NonPackedFixed32: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".NonPackedFixed32" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 2048: .standard(proto: "repeated_fixed32"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 2048: try { try decoder.decodeRepeatedFixed32Field(value: &self.repeatedFixed32) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.repeatedFixed32.isEmpty { + try visitor.visitRepeatedFixed32Field(value: self.repeatedFixed32, fieldNumber: 2048) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_NonPackedFixed32, rhs: ProtobufUnittest_NonPackedFixed32) -> Bool { + if lhs.repeatedFixed32 != rhs.repeatedFixed32 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_DupEnum: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".DupEnum" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_DupEnum, rhs: ProtobufUnittest_DupEnum) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_DupEnum.TestEnumWithDupValueLite: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .aliased(proto: "FOO1", aliases: ["FOO2"]), + 2: .aliased(proto: "BAR1", aliases: ["BAR2"]), + 3: .same(proto: "BAZ"), + ] +} + +extension ProtobufUnittest_RecursiveMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RecursiveMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "recurse"), + 2: .same(proto: "payload"), + ] + + fileprivate class _StorageClass { + var _recurse: ProtobufUnittest_RecursiveMessage? = nil + var _payload: Data? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _recurse = source._recurse + _payload = source._payload + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._recurse) }() + case 2: try { try decoder.decodeSingularBytesField(value: &_storage._payload) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._recurse { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._payload { + try visitor.visitSingularBytesField(value: v, fieldNumber: 2) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_RecursiveMessage, rhs: ProtobufUnittest_RecursiveMessage) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._recurse != rhs_storage._recurse {return false} + if _storage._payload != rhs_storage._payload {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_lite_imports_nonlite.pb.swift b/Reference/SwiftProtobufTests/unittest_lite_imports_nonlite.pb.swift new file mode 100644 index 000000000..d44127ef3 --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_lite_imports_nonlite.pb.swift @@ -0,0 +1,142 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_lite_imports_nonlite.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// +// Tests that a "lite" message can import a regular message. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +struct ProtobufUnittest_TestLiteImportsNonlite { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var message: ProtobufUnittest_TestAllTypes { + get {return _message ?? ProtobufUnittest_TestAllTypes()} + set {_message = newValue} + } + /// Returns true if `message` has been explicitly set. + var hasMessage: Bool {return self._message != nil} + /// Clears the value of `message`. Subsequent reads from it will return its default value. + mutating func clearMessage() {self._message = nil} + + /// Verifies that transitive required fields generates valid code. + var messageWithRequired: ProtobufUnittest_TestRequired { + get {return _messageWithRequired ?? ProtobufUnittest_TestRequired()} + set {_messageWithRequired = newValue} + } + /// Returns true if `messageWithRequired` has been explicitly set. + var hasMessageWithRequired: Bool {return self._messageWithRequired != nil} + /// Clears the value of `messageWithRequired`. Subsequent reads from it will return its default value. + mutating func clearMessageWithRequired() {self._messageWithRequired = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _message: ProtobufUnittest_TestAllTypes? = nil + fileprivate var _messageWithRequired: ProtobufUnittest_TestRequired? = nil +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittest_TestLiteImportsNonlite: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest" + +extension ProtobufUnittest_TestLiteImportsNonlite: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestLiteImportsNonlite" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "message"), + 2: .standard(proto: "message_with_required"), + ] + + public var isInitialized: Bool { + if let v = self._messageWithRequired, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._message) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._messageWithRequired) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._message { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._messageWithRequired { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestLiteImportsNonlite, rhs: ProtobufUnittest_TestLiteImportsNonlite) -> Bool { + if lhs._message != rhs._message {return false} + if lhs._messageWithRequired != rhs._messageWithRequired {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_mset.pb.swift b/Reference/SwiftProtobufTests/unittest_mset.pb.swift new file mode 100644 index 000000000..2d1127d22 --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_mset.pb.swift @@ -0,0 +1,831 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_mset.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// This file is similar to unittest_mset_wire_format.proto, but does not +// have a TestMessageSet, so it can be downgraded to proto1. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +struct ProtobufUnittest_TestMessageSetContainer { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var messageSet: Proto2WireformatUnittest_TestMessageSet { + get {return _messageSet ?? Proto2WireformatUnittest_TestMessageSet()} + set {_messageSet = newValue} + } + /// Returns true if `messageSet` has been explicitly set. + var hasMessageSet: Bool {return self._messageSet != nil} + /// Clears the value of `messageSet`. Subsequent reads from it will return its default value. + mutating func clearMessageSet() {self._messageSet = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _messageSet: Proto2WireformatUnittest_TestMessageSet? = nil +} + +struct ProtobufUnittest_NestedTestMessageSetContainer { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var container: ProtobufUnittest_TestMessageSetContainer { + get {return _storage._container ?? ProtobufUnittest_TestMessageSetContainer()} + set {_uniqueStorage()._container = newValue} + } + /// Returns true if `container` has been explicitly set. + var hasContainer: Bool {return _storage._container != nil} + /// Clears the value of `container`. Subsequent reads from it will return its default value. + mutating func clearContainer() {_uniqueStorage()._container = nil} + + var child: ProtobufUnittest_NestedTestMessageSetContainer { + get {return _storage._child ?? ProtobufUnittest_NestedTestMessageSetContainer()} + set {_uniqueStorage()._child = newValue} + } + /// Returns true if `child` has been explicitly set. + var hasChild: Bool {return _storage._child != nil} + /// Clears the value of `child`. Subsequent reads from it will return its default value. + mutating func clearChild() {_uniqueStorage()._child = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufUnittest_NestedTestInt { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: UInt32 { + get {return _storage._a ?? 0} + set {_uniqueStorage()._a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return _storage._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {_uniqueStorage()._a = nil} + + var b: Int32 { + get {return _storage._b ?? 0} + set {_uniqueStorage()._b = newValue} + } + /// Returns true if `b` has been explicitly set. + var hasB: Bool {return _storage._b != nil} + /// Clears the value of `b`. Subsequent reads from it will return its default value. + mutating func clearB() {_uniqueStorage()._b = nil} + + var child: ProtobufUnittest_NestedTestInt { + get {return _storage._child ?? ProtobufUnittest_NestedTestInt()} + set {_uniqueStorage()._child = newValue} + } + /// Returns true if `child` has been explicitly set. + var hasChild: Bool {return _storage._child != nil} + /// Clears the value of `child`. Subsequent reads from it will return its default value. + mutating func clearChild() {_uniqueStorage()._child = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufUnittest_TestMessageSetExtension1 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var i: Int32 { + get {return _i ?? 0} + set {_i = newValue} + } + /// Returns true if `i` has been explicitly set. + var hasI: Bool {return self._i != nil} + /// Clears the value of `i`. Subsequent reads from it will return its default value. + mutating func clearI() {self._i = nil} + + var recursive: Proto2WireformatUnittest_TestMessageSet { + get {return _recursive ?? Proto2WireformatUnittest_TestMessageSet()} + set {_recursive = newValue} + } + /// Returns true if `recursive` has been explicitly set. + var hasRecursive: Bool {return self._recursive != nil} + /// Clears the value of `recursive`. Subsequent reads from it will return its default value. + mutating func clearRecursive() {self._recursive = nil} + + var testAliasing: String { + get {return _testAliasing ?? String()} + set {_testAliasing = newValue} + } + /// Returns true if `testAliasing` has been explicitly set. + var hasTestAliasing: Bool {return self._testAliasing != nil} + /// Clears the value of `testAliasing`. Subsequent reads from it will return its default value. + mutating func clearTestAliasing() {self._testAliasing = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _i: Int32? = nil + fileprivate var _recursive: Proto2WireformatUnittest_TestMessageSet? = nil + fileprivate var _testAliasing: String? = nil +} + +struct ProtobufUnittest_TestMessageSetExtension2 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var str: String { + get {return _str ?? String()} + set {_str = newValue} + } + /// Returns true if `str` has been explicitly set. + var hasStr: Bool {return self._str != nil} + /// Clears the value of `str`. Subsequent reads from it will return its default value. + mutating func clearStr() {self._str = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _str: String? = nil +} + +struct ProtobufUnittest_TestMessageSetExtension3 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var msg: ProtobufUnittest_NestedTestInt { + get {return _msg ?? ProtobufUnittest_NestedTestInt()} + set {_msg = newValue} + } + /// Returns true if `msg` has been explicitly set. + var hasMsg: Bool {return self._msg != nil} + /// Clears the value of `msg`. Subsequent reads from it will return its default value. + mutating func clearMsg() {self._msg = nil} + + var requiredInt: Int32 { + get {return _requiredInt ?? 0} + set {_requiredInt = newValue} + } + /// Returns true if `requiredInt` has been explicitly set. + var hasRequiredInt: Bool {return self._requiredInt != nil} + /// Clears the value of `requiredInt`. Subsequent reads from it will return its default value. + mutating func clearRequiredInt() {self._requiredInt = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _msg: ProtobufUnittest_NestedTestInt? = nil + fileprivate var _requiredInt: Int32? = nil +} + +/// MessageSet wire format is equivalent to this. +struct ProtobufUnittest_RawMessageSet { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var item: [ProtobufUnittest_RawMessageSet.Item] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct Item { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var typeID: Int32 { + get {return _typeID ?? 0} + set {_typeID = newValue} + } + /// Returns true if `typeID` has been explicitly set. + var hasTypeID: Bool {return self._typeID != nil} + /// Clears the value of `typeID`. Subsequent reads from it will return its default value. + mutating func clearTypeID() {self._typeID = nil} + + var message: Data { + get {return _message ?? Data()} + set {_message = newValue} + } + /// Returns true if `message` has been explicitly set. + var hasMessage: Bool {return self._message != nil} + /// Clears the value of `message`. Subsequent reads from it will return its default value. + mutating func clearMessage() {self._message = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _typeID: Int32? = nil + fileprivate var _message: Data? = nil + } + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittest_TestMessageSetContainer: @unchecked Sendable {} +extension ProtobufUnittest_NestedTestMessageSetContainer: @unchecked Sendable {} +extension ProtobufUnittest_NestedTestInt: @unchecked Sendable {} +extension ProtobufUnittest_TestMessageSetExtension1: @unchecked Sendable {} +extension ProtobufUnittest_TestMessageSetExtension2: @unchecked Sendable {} +extension ProtobufUnittest_TestMessageSetExtension3: @unchecked Sendable {} +extension ProtobufUnittest_RawMessageSet: @unchecked Sendable {} +extension ProtobufUnittest_RawMessageSet.Item: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Extension support defined in unittest_mset.proto. + +// MARK: - Extension Properties + +// Swift Extensions on the exteneded Messages to add easy access to the declared +// extension fields. The names are based on the extension field name from the proto +// declaration. To avoid naming collisions, the names are prefixed with the name of +// the scope where the extend directive occurs. + +extension Proto2WireformatUnittest_TestMessageSet { + + var ProtobufUnittest_TestMessageSetExtension1_messageSetExtension: ProtobufUnittest_TestMessageSetExtension1 { + get {return getExtensionValue(ext: ProtobufUnittest_TestMessageSetExtension1.Extensions.message_set_extension) ?? ProtobufUnittest_TestMessageSetExtension1()} + set {setExtensionValue(ext: ProtobufUnittest_TestMessageSetExtension1.Extensions.message_set_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestMessageSetExtension1.Extensions.message_set_extension` + /// has been explicitly set. + var hasProtobufUnittest_TestMessageSetExtension1_messageSetExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestMessageSetExtension1.Extensions.message_set_extension) + } + /// Clears the value of extension `ProtobufUnittest_TestMessageSetExtension1.Extensions.message_set_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestMessageSetExtension1_messageSetExtension() { + clearExtensionValue(ext: ProtobufUnittest_TestMessageSetExtension1.Extensions.message_set_extension) + } + + var ProtobufUnittest_TestMessageSetExtension2_messageSetExtension: ProtobufUnittest_TestMessageSetExtension2 { + get {return getExtensionValue(ext: ProtobufUnittest_TestMessageSetExtension2.Extensions.message_set_extension) ?? ProtobufUnittest_TestMessageSetExtension2()} + set {setExtensionValue(ext: ProtobufUnittest_TestMessageSetExtension2.Extensions.message_set_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestMessageSetExtension2.Extensions.message_set_extension` + /// has been explicitly set. + var hasProtobufUnittest_TestMessageSetExtension2_messageSetExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestMessageSetExtension2.Extensions.message_set_extension) + } + /// Clears the value of extension `ProtobufUnittest_TestMessageSetExtension2.Extensions.message_set_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestMessageSetExtension2_messageSetExtension() { + clearExtensionValue(ext: ProtobufUnittest_TestMessageSetExtension2.Extensions.message_set_extension) + } + + var ProtobufUnittest_TestMessageSetExtension3_messageSetExtension: ProtobufUnittest_TestMessageSetExtension3 { + get {return getExtensionValue(ext: ProtobufUnittest_TestMessageSetExtension3.Extensions.message_set_extension) ?? ProtobufUnittest_TestMessageSetExtension3()} + set {setExtensionValue(ext: ProtobufUnittest_TestMessageSetExtension3.Extensions.message_set_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestMessageSetExtension3.Extensions.message_set_extension` + /// has been explicitly set. + var hasProtobufUnittest_TestMessageSetExtension3_messageSetExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestMessageSetExtension3.Extensions.message_set_extension) + } + /// Clears the value of extension `ProtobufUnittest_TestMessageSetExtension3.Extensions.message_set_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestMessageSetExtension3_messageSetExtension() { + clearExtensionValue(ext: ProtobufUnittest_TestMessageSetExtension3.Extensions.message_set_extension) + } + +} + +// MARK: - File's ExtensionMap: ProtobufUnittest_UnittestMset_Extensions + +/// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by +/// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed +/// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create +/// a larger `SwiftProtobuf.SimpleExtensionMap`. +let ProtobufUnittest_UnittestMset_Extensions: SwiftProtobuf.SimpleExtensionMap = [ + ProtobufUnittest_TestMessageSetExtension1.Extensions.message_set_extension, + ProtobufUnittest_TestMessageSetExtension2.Extensions.message_set_extension, + ProtobufUnittest_TestMessageSetExtension3.Extensions.message_set_extension +] + +// Extension Objects - The only reason these might be needed is when manually +// constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_ +// accessors for the extension fields on the messages directly. + +extension ProtobufUnittest_TestMessageSetExtension1 { + enum Extensions { + static let message_set_extension = SwiftProtobuf.MessageExtension, Proto2WireformatUnittest_TestMessageSet>( + _protobuf_fieldNumber: 1545008, + fieldName: "protobuf_unittest.TestMessageSetExtension1" + ) + } +} + +extension ProtobufUnittest_TestMessageSetExtension2 { + enum Extensions { + static let message_set_extension = SwiftProtobuf.MessageExtension, Proto2WireformatUnittest_TestMessageSet>( + _protobuf_fieldNumber: 1547769, + fieldName: "protobuf_unittest.TestMessageSetExtension2" + ) + } +} + +extension ProtobufUnittest_TestMessageSetExtension3 { + enum Extensions { + static let message_set_extension = SwiftProtobuf.MessageExtension, Proto2WireformatUnittest_TestMessageSet>( + _protobuf_fieldNumber: 195273129, + fieldName: "protobuf_unittest.TestMessageSetExtension3" + ) + } +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest" + +extension ProtobufUnittest_TestMessageSetContainer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMessageSetContainer" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "message_set"), + ] + + public var isInitialized: Bool { + if let v = self._messageSet, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._messageSet) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._messageSet { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMessageSetContainer, rhs: ProtobufUnittest_TestMessageSetContainer) -> Bool { + if lhs._messageSet != rhs._messageSet {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_NestedTestMessageSetContainer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".NestedTestMessageSetContainer" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "container"), + 2: .same(proto: "child"), + ] + + fileprivate class _StorageClass { + var _container: ProtobufUnittest_TestMessageSetContainer? = nil + var _child: ProtobufUnittest_NestedTestMessageSetContainer? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _container = source._container + _child = source._child + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + public var isInitialized: Bool { + return withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if let v = _storage._container, !v.isInitialized {return false} + if let v = _storage._child, !v.isInitialized {return false} + return true + } + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._container) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._child) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._container { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._child { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_NestedTestMessageSetContainer, rhs: ProtobufUnittest_NestedTestMessageSetContainer) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._container != rhs_storage._container {return false} + if _storage._child != rhs_storage._child {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_NestedTestInt: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".NestedTestInt" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 3: .same(proto: "b"), + 2: .same(proto: "child"), + ] + + fileprivate class _StorageClass { + var _a: UInt32? = nil + var _b: Int32? = nil + var _child: ProtobufUnittest_NestedTestInt? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _a = source._a + _b = source._b + _child = source._child + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFixed32Field(value: &_storage._a) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._child) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &_storage._b) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._a { + try visitor.visitSingularFixed32Field(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._child { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._b { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_NestedTestInt, rhs: ProtobufUnittest_NestedTestInt) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._a != rhs_storage._a {return false} + if _storage._b != rhs_storage._b {return false} + if _storage._child != rhs_storage._child {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMessageSetExtension1: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMessageSetExtension1" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 15: .same(proto: "i"), + 16: .same(proto: "recursive"), + 17: .standard(proto: "test_aliasing"), + ] + + public var isInitialized: Bool { + if let v = self._recursive, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 15: try { try decoder.decodeSingularInt32Field(value: &self._i) }() + case 16: try { try decoder.decodeSingularMessageField(value: &self._recursive) }() + case 17: try { try decoder.decodeSingularStringField(value: &self._testAliasing) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._i { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 15) + } }() + try { if let v = self._recursive { + try visitor.visitSingularMessageField(value: v, fieldNumber: 16) + } }() + try { if let v = self._testAliasing { + try visitor.visitSingularStringField(value: v, fieldNumber: 17) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMessageSetExtension1, rhs: ProtobufUnittest_TestMessageSetExtension1) -> Bool { + if lhs._i != rhs._i {return false} + if lhs._recursive != rhs._recursive {return false} + if lhs._testAliasing != rhs._testAliasing {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMessageSetExtension2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMessageSetExtension2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 25: .same(proto: "str"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 25: try { try decoder.decodeSingularStringField(value: &self._str) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._str { + try visitor.visitSingularStringField(value: v, fieldNumber: 25) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMessageSetExtension2, rhs: ProtobufUnittest_TestMessageSetExtension2) -> Bool { + if lhs._str != rhs._str {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestMessageSetExtension3: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMessageSetExtension3" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 35: .same(proto: "msg"), + 36: .standard(proto: "required_int"), + ] + + public var isInitialized: Bool { + if self._requiredInt == nil {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 35: try { try decoder.decodeSingularMessageField(value: &self._msg) }() + case 36: try { try decoder.decodeSingularInt32Field(value: &self._requiredInt) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._msg { + try visitor.visitSingularMessageField(value: v, fieldNumber: 35) + } }() + try { if let v = self._requiredInt { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 36) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestMessageSetExtension3, rhs: ProtobufUnittest_TestMessageSetExtension3) -> Bool { + if lhs._msg != rhs._msg {return false} + if lhs._requiredInt != rhs._requiredInt {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_RawMessageSet: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RawMessageSet" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .unique(proto: "Item", json: "item"), + ] + + public var isInitialized: Bool { + if !SwiftProtobuf.Internal.areAllInitialized(self.item) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedGroupField(value: &self.item) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.item.isEmpty { + try visitor.visitRepeatedGroupField(value: self.item, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_RawMessageSet, rhs: ProtobufUnittest_RawMessageSet) -> Bool { + if lhs.item != rhs.item {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_RawMessageSet.Item: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_RawMessageSet.protoMessageName + ".Item" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 2: .standard(proto: "type_id"), + 3: .same(proto: "message"), + ] + + public var isInitialized: Bool { + if self._typeID == nil {return false} + if self._message == nil {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 2: try { try decoder.decodeSingularInt32Field(value: &self._typeID) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self._message) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._typeID { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._message { + try visitor.visitSingularBytesField(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_RawMessageSet.Item, rhs: ProtobufUnittest_RawMessageSet.Item) -> Bool { + if lhs._typeID != rhs._typeID {return false} + if lhs._message != rhs._message {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_mset_wire_format.pb.swift b/Reference/SwiftProtobufTests/unittest_mset_wire_format.pb.swift new file mode 100644 index 000000000..cb3ea4806 --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_mset_wire_format.pb.swift @@ -0,0 +1,166 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_mset_wire_format.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// This file contains messages for testing message_set_wire_format. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +/// A message with message_set_wire_format. +struct Proto2WireformatUnittest_TestMessageSet: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() +} + +struct Proto2WireformatUnittest_TestMessageSetWireFormatContainer { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var messageSet: Proto2WireformatUnittest_TestMessageSet { + get {return _messageSet ?? Proto2WireformatUnittest_TestMessageSet()} + set {_messageSet = newValue} + } + /// Returns true if `messageSet` has been explicitly set. + var hasMessageSet: Bool {return self._messageSet != nil} + /// Clears the value of `messageSet`. Subsequent reads from it will return its default value. + mutating func clearMessageSet() {self._messageSet = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _messageSet: Proto2WireformatUnittest_TestMessageSet? = nil +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Proto2WireformatUnittest_TestMessageSet: @unchecked Sendable {} +extension Proto2WireformatUnittest_TestMessageSetWireFormatContainer: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "proto2_wireformat_unittest" + +extension Proto2WireformatUnittest_TestMessageSet: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMessageSet" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + try decoder.decodeExtensionFieldsAsMessageSet(values: &_protobuf_extensionFieldValues, messageType: Proto2WireformatUnittest_TestMessageSet.self) + } + + func traverse(visitor: inout V) throws { + try visitor.visitExtensionFieldsAsMessageSet(fields: _protobuf_extensionFieldValues, start: 4, end: 2147483647) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto2WireformatUnittest_TestMessageSet, rhs: Proto2WireformatUnittest_TestMessageSet) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension Proto2WireformatUnittest_TestMessageSetWireFormatContainer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMessageSetWireFormatContainer" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "message_set"), + ] + + public var isInitialized: Bool { + if let v = self._messageSet, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._messageSet) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._messageSet { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto2WireformatUnittest_TestMessageSetWireFormatContainer, rhs: Proto2WireformatUnittest_TestMessageSetWireFormatContainer) -> Bool { + if lhs._messageSet != rhs._messageSet {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_no_field_presence.pb.swift b/Reference/SwiftProtobufTests/unittest_no_field_presence.pb.swift new file mode 100644 index 000000000..aab2c4ae1 --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_no_field_presence.pb.swift @@ -0,0 +1,1113 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_no_field_presence.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// A proto file used to test a message type with no explicit field presence. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum Proto2NofieldpresenceUnittest_ForeignEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foreignFoo // = 0 + case foreignBar // = 1 + case foreignBaz // = 2 + case UNRECOGNIZED(Int) + + init() { + self = .foreignFoo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .foreignFoo + case 1: self = .foreignBar + case 2: self = .foreignBaz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .foreignFoo: return 0 + case .foreignBar: return 1 + case .foreignBaz: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Proto2NofieldpresenceUnittest_ForeignEnum] = [ + .foreignFoo, + .foreignBar, + .foreignBaz, + ] + +} + +/// This proto includes every type of field in both singular and repeated +/// forms. +struct Proto2NofieldpresenceUnittest_TestAllTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Singular + /// TODO: remove 'optional' labels as soon as CL 69188077 is LGTM'd to make + /// 'optional' optional. + var optionalInt32: Int32 { + get {return _storage._optionalInt32} + set {_uniqueStorage()._optionalInt32 = newValue} + } + + var optionalInt64: Int64 { + get {return _storage._optionalInt64} + set {_uniqueStorage()._optionalInt64 = newValue} + } + + var optionalUint32: UInt32 { + get {return _storage._optionalUint32} + set {_uniqueStorage()._optionalUint32 = newValue} + } + + var optionalUint64: UInt64 { + get {return _storage._optionalUint64} + set {_uniqueStorage()._optionalUint64 = newValue} + } + + var optionalSint32: Int32 { + get {return _storage._optionalSint32} + set {_uniqueStorage()._optionalSint32 = newValue} + } + + var optionalSint64: Int64 { + get {return _storage._optionalSint64} + set {_uniqueStorage()._optionalSint64 = newValue} + } + + var optionalFixed32: UInt32 { + get {return _storage._optionalFixed32} + set {_uniqueStorage()._optionalFixed32 = newValue} + } + + var optionalFixed64: UInt64 { + get {return _storage._optionalFixed64} + set {_uniqueStorage()._optionalFixed64 = newValue} + } + + var optionalSfixed32: Int32 { + get {return _storage._optionalSfixed32} + set {_uniqueStorage()._optionalSfixed32 = newValue} + } + + var optionalSfixed64: Int64 { + get {return _storage._optionalSfixed64} + set {_uniqueStorage()._optionalSfixed64 = newValue} + } + + var optionalFloat: Float { + get {return _storage._optionalFloat} + set {_uniqueStorage()._optionalFloat = newValue} + } + + var optionalDouble: Double { + get {return _storage._optionalDouble} + set {_uniqueStorage()._optionalDouble = newValue} + } + + var optionalBool: Bool { + get {return _storage._optionalBool} + set {_uniqueStorage()._optionalBool = newValue} + } + + var optionalString: String { + get {return _storage._optionalString} + set {_uniqueStorage()._optionalString = newValue} + } + + var optionalBytes: Data { + get {return _storage._optionalBytes} + set {_uniqueStorage()._optionalBytes = newValue} + } + + var optionalNestedMessage: Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage { + get {return _storage._optionalNestedMessage ?? Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage()} + set {_uniqueStorage()._optionalNestedMessage = newValue} + } + /// Returns true if `optionalNestedMessage` has been explicitly set. + var hasOptionalNestedMessage: Bool {return _storage._optionalNestedMessage != nil} + /// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedMessage() {_uniqueStorage()._optionalNestedMessage = nil} + + var optionalForeignMessage: Proto2NofieldpresenceUnittest_ForeignMessage { + get {return _storage._optionalForeignMessage ?? Proto2NofieldpresenceUnittest_ForeignMessage()} + set {_uniqueStorage()._optionalForeignMessage = newValue} + } + /// Returns true if `optionalForeignMessage` has been explicitly set. + var hasOptionalForeignMessage: Bool {return _storage._optionalForeignMessage != nil} + /// Clears the value of `optionalForeignMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalForeignMessage() {_uniqueStorage()._optionalForeignMessage = nil} + + var optionalProto2Message: ProtobufUnittest_TestAllTypes { + get {return _storage._optionalProto2Message ?? ProtobufUnittest_TestAllTypes()} + set {_uniqueStorage()._optionalProto2Message = newValue} + } + /// Returns true if `optionalProto2Message` has been explicitly set. + var hasOptionalProto2Message: Bool {return _storage._optionalProto2Message != nil} + /// Clears the value of `optionalProto2Message`. Subsequent reads from it will return its default value. + mutating func clearOptionalProto2Message() {_uniqueStorage()._optionalProto2Message = nil} + + var optionalNestedEnum: Proto2NofieldpresenceUnittest_TestAllTypes.NestedEnum { + get {return _storage._optionalNestedEnum} + set {_uniqueStorage()._optionalNestedEnum = newValue} + } + + /// N.B.: proto2-enum-type fields not allowed, because their default values + /// might not be zero. + /// optional protobuf_unittest.ForeignEnum optional_proto2_enum = + /// 23; + var optionalForeignEnum: Proto2NofieldpresenceUnittest_ForeignEnum { + get {return _storage._optionalForeignEnum} + set {_uniqueStorage()._optionalForeignEnum = newValue} + } + + var optionalStringPiece: String { + get {return _storage._optionalStringPiece} + set {_uniqueStorage()._optionalStringPiece = newValue} + } + + var optionalCord: String { + get {return _storage._optionalCord} + set {_uniqueStorage()._optionalCord = newValue} + } + + var optionalLazyMessage: Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage { + get {return _storage._optionalLazyMessage ?? Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage()} + set {_uniqueStorage()._optionalLazyMessage = newValue} + } + /// Returns true if `optionalLazyMessage` has been explicitly set. + var hasOptionalLazyMessage: Bool {return _storage._optionalLazyMessage != nil} + /// Clears the value of `optionalLazyMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalLazyMessage() {_uniqueStorage()._optionalLazyMessage = nil} + + /// Repeated + var repeatedInt32: [Int32] { + get {return _storage._repeatedInt32} + set {_uniqueStorage()._repeatedInt32 = newValue} + } + + var repeatedInt64: [Int64] { + get {return _storage._repeatedInt64} + set {_uniqueStorage()._repeatedInt64 = newValue} + } + + var repeatedUint32: [UInt32] { + get {return _storage._repeatedUint32} + set {_uniqueStorage()._repeatedUint32 = newValue} + } + + var repeatedUint64: [UInt64] { + get {return _storage._repeatedUint64} + set {_uniqueStorage()._repeatedUint64 = newValue} + } + + var repeatedSint32: [Int32] { + get {return _storage._repeatedSint32} + set {_uniqueStorage()._repeatedSint32 = newValue} + } + + var repeatedSint64: [Int64] { + get {return _storage._repeatedSint64} + set {_uniqueStorage()._repeatedSint64 = newValue} + } + + var repeatedFixed32: [UInt32] { + get {return _storage._repeatedFixed32} + set {_uniqueStorage()._repeatedFixed32 = newValue} + } + + var repeatedFixed64: [UInt64] { + get {return _storage._repeatedFixed64} + set {_uniqueStorage()._repeatedFixed64 = newValue} + } + + var repeatedSfixed32: [Int32] { + get {return _storage._repeatedSfixed32} + set {_uniqueStorage()._repeatedSfixed32 = newValue} + } + + var repeatedSfixed64: [Int64] { + get {return _storage._repeatedSfixed64} + set {_uniqueStorage()._repeatedSfixed64 = newValue} + } + + var repeatedFloat: [Float] { + get {return _storage._repeatedFloat} + set {_uniqueStorage()._repeatedFloat = newValue} + } + + var repeatedDouble: [Double] { + get {return _storage._repeatedDouble} + set {_uniqueStorage()._repeatedDouble = newValue} + } + + var repeatedBool: [Bool] { + get {return _storage._repeatedBool} + set {_uniqueStorage()._repeatedBool = newValue} + } + + var repeatedString: [String] { + get {return _storage._repeatedString} + set {_uniqueStorage()._repeatedString = newValue} + } + + var repeatedBytes: [Data] { + get {return _storage._repeatedBytes} + set {_uniqueStorage()._repeatedBytes = newValue} + } + + var repeatedNestedMessage: [Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage] { + get {return _storage._repeatedNestedMessage} + set {_uniqueStorage()._repeatedNestedMessage = newValue} + } + + var repeatedForeignMessage: [Proto2NofieldpresenceUnittest_ForeignMessage] { + get {return _storage._repeatedForeignMessage} + set {_uniqueStorage()._repeatedForeignMessage = newValue} + } + + var repeatedProto2Message: [ProtobufUnittest_TestAllTypes] { + get {return _storage._repeatedProto2Message} + set {_uniqueStorage()._repeatedProto2Message = newValue} + } + + var repeatedNestedEnum: [Proto2NofieldpresenceUnittest_TestAllTypes.NestedEnum] { + get {return _storage._repeatedNestedEnum} + set {_uniqueStorage()._repeatedNestedEnum = newValue} + } + + var repeatedForeignEnum: [Proto2NofieldpresenceUnittest_ForeignEnum] { + get {return _storage._repeatedForeignEnum} + set {_uniqueStorage()._repeatedForeignEnum = newValue} + } + + var repeatedStringPiece: [String] { + get {return _storage._repeatedStringPiece} + set {_uniqueStorage()._repeatedStringPiece = newValue} + } + + var repeatedCord: [String] { + get {return _storage._repeatedCord} + set {_uniqueStorage()._repeatedCord = newValue} + } + + var repeatedLazyMessage: [Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage] { + get {return _storage._repeatedLazyMessage} + set {_uniqueStorage()._repeatedLazyMessage = newValue} + } + + var oneofField: OneOf_OneofField? { + get {return _storage._oneofField} + set {_uniqueStorage()._oneofField = newValue} + } + + var oneofUint32: UInt32 { + get { + if case .oneofUint32(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofUint32(newValue)} + } + + var oneofNestedMessage: Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage { + get { + if case .oneofNestedMessage(let v)? = _storage._oneofField {return v} + return Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage() + } + set {_uniqueStorage()._oneofField = .oneofNestedMessage(newValue)} + } + + var oneofString: String { + get { + if case .oneofString(let v)? = _storage._oneofField {return v} + return String() + } + set {_uniqueStorage()._oneofField = .oneofString(newValue)} + } + + var oneofEnum: Proto2NofieldpresenceUnittest_TestAllTypes.NestedEnum { + get { + if case .oneofEnum(let v)? = _storage._oneofField {return v} + return .foo + } + set {_uniqueStorage()._oneofField = .oneofEnum(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_OneofField: Equatable { + case oneofUint32(UInt32) + case oneofNestedMessage(Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage) + case oneofString(String) + case oneofEnum(Proto2NofieldpresenceUnittest_TestAllTypes.NestedEnum) + + } + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 0 + case bar // = 1 + case baz // = 2 + case UNRECOGNIZED(Int) + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .foo + case 1: self = .bar + case 2: self = .baz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .foo: return 0 + case .bar: return 1 + case .baz: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Proto2NofieldpresenceUnittest_TestAllTypes.NestedEnum] = [ + .foo, + .bar, + .baz, + ] + + } + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var bb: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct Proto2NofieldpresenceUnittest_TestProto2Required { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var proto2: ProtobufUnittest_TestRequired { + get {return _proto2 ?? ProtobufUnittest_TestRequired()} + set {_proto2 = newValue} + } + /// Returns true if `proto2` has been explicitly set. + var hasProto2: Bool {return self._proto2 != nil} + /// Clears the value of `proto2`. Subsequent reads from it will return its default value. + mutating func clearProto2() {self._proto2 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _proto2: ProtobufUnittest_TestRequired? = nil +} + +/// Define these after TestAllTypes to make sure the compiler can handle +/// that. +struct Proto2NofieldpresenceUnittest_ForeignMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var c: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Proto2NofieldpresenceUnittest_TestAllTypes: @unchecked Sendable {} +extension Proto2NofieldpresenceUnittest_TestAllTypes.OneOf_OneofField: @unchecked Sendable {} +extension Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage: @unchecked Sendable {} +extension Proto2NofieldpresenceUnittest_TestProto2Required: @unchecked Sendable {} +extension Proto2NofieldpresenceUnittest_ForeignMessage: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "proto2_nofieldpresence_unittest" + +extension Proto2NofieldpresenceUnittest_ForeignEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FOREIGN_FOO"), + 1: .same(proto: "FOREIGN_BAR"), + 2: .same(proto: "FOREIGN_BAZ"), + ] +} + +extension Proto2NofieldpresenceUnittest_TestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestAllTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_int32"), + 2: .standard(proto: "optional_int64"), + 3: .standard(proto: "optional_uint32"), + 4: .standard(proto: "optional_uint64"), + 5: .standard(proto: "optional_sint32"), + 6: .standard(proto: "optional_sint64"), + 7: .standard(proto: "optional_fixed32"), + 8: .standard(proto: "optional_fixed64"), + 9: .standard(proto: "optional_sfixed32"), + 10: .standard(proto: "optional_sfixed64"), + 11: .standard(proto: "optional_float"), + 12: .standard(proto: "optional_double"), + 13: .standard(proto: "optional_bool"), + 14: .standard(proto: "optional_string"), + 15: .standard(proto: "optional_bytes"), + 18: .standard(proto: "optional_nested_message"), + 19: .standard(proto: "optional_foreign_message"), + 20: .standard(proto: "optional_proto2_message"), + 21: .standard(proto: "optional_nested_enum"), + 22: .standard(proto: "optional_foreign_enum"), + 24: .standard(proto: "optional_string_piece"), + 25: .standard(proto: "optional_cord"), + 30: .standard(proto: "optional_lazy_message"), + 31: .standard(proto: "repeated_int32"), + 32: .standard(proto: "repeated_int64"), + 33: .standard(proto: "repeated_uint32"), + 34: .standard(proto: "repeated_uint64"), + 35: .standard(proto: "repeated_sint32"), + 36: .standard(proto: "repeated_sint64"), + 37: .standard(proto: "repeated_fixed32"), + 38: .standard(proto: "repeated_fixed64"), + 39: .standard(proto: "repeated_sfixed32"), + 40: .standard(proto: "repeated_sfixed64"), + 41: .standard(proto: "repeated_float"), + 42: .standard(proto: "repeated_double"), + 43: .standard(proto: "repeated_bool"), + 44: .standard(proto: "repeated_string"), + 45: .standard(proto: "repeated_bytes"), + 48: .standard(proto: "repeated_nested_message"), + 49: .standard(proto: "repeated_foreign_message"), + 50: .standard(proto: "repeated_proto2_message"), + 51: .standard(proto: "repeated_nested_enum"), + 52: .standard(proto: "repeated_foreign_enum"), + 54: .standard(proto: "repeated_string_piece"), + 55: .standard(proto: "repeated_cord"), + 57: .standard(proto: "repeated_lazy_message"), + 111: .standard(proto: "oneof_uint32"), + 112: .standard(proto: "oneof_nested_message"), + 113: .standard(proto: "oneof_string"), + 114: .standard(proto: "oneof_enum"), + ] + + fileprivate class _StorageClass { + var _optionalInt32: Int32 = 0 + var _optionalInt64: Int64 = 0 + var _optionalUint32: UInt32 = 0 + var _optionalUint64: UInt64 = 0 + var _optionalSint32: Int32 = 0 + var _optionalSint64: Int64 = 0 + var _optionalFixed32: UInt32 = 0 + var _optionalFixed64: UInt64 = 0 + var _optionalSfixed32: Int32 = 0 + var _optionalSfixed64: Int64 = 0 + var _optionalFloat: Float = 0 + var _optionalDouble: Double = 0 + var _optionalBool: Bool = false + var _optionalString: String = String() + var _optionalBytes: Data = Data() + var _optionalNestedMessage: Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage? = nil + var _optionalForeignMessage: Proto2NofieldpresenceUnittest_ForeignMessage? = nil + var _optionalProto2Message: ProtobufUnittest_TestAllTypes? = nil + var _optionalNestedEnum: Proto2NofieldpresenceUnittest_TestAllTypes.NestedEnum = .foo + var _optionalForeignEnum: Proto2NofieldpresenceUnittest_ForeignEnum = .foreignFoo + var _optionalStringPiece: String = String() + var _optionalCord: String = String() + var _optionalLazyMessage: Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage? = nil + var _repeatedInt32: [Int32] = [] + var _repeatedInt64: [Int64] = [] + var _repeatedUint32: [UInt32] = [] + var _repeatedUint64: [UInt64] = [] + var _repeatedSint32: [Int32] = [] + var _repeatedSint64: [Int64] = [] + var _repeatedFixed32: [UInt32] = [] + var _repeatedFixed64: [UInt64] = [] + var _repeatedSfixed32: [Int32] = [] + var _repeatedSfixed64: [Int64] = [] + var _repeatedFloat: [Float] = [] + var _repeatedDouble: [Double] = [] + var _repeatedBool: [Bool] = [] + var _repeatedString: [String] = [] + var _repeatedBytes: [Data] = [] + var _repeatedNestedMessage: [Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage] = [] + var _repeatedForeignMessage: [Proto2NofieldpresenceUnittest_ForeignMessage] = [] + var _repeatedProto2Message: [ProtobufUnittest_TestAllTypes] = [] + var _repeatedNestedEnum: [Proto2NofieldpresenceUnittest_TestAllTypes.NestedEnum] = [] + var _repeatedForeignEnum: [Proto2NofieldpresenceUnittest_ForeignEnum] = [] + var _repeatedStringPiece: [String] = [] + var _repeatedCord: [String] = [] + var _repeatedLazyMessage: [Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage] = [] + var _oneofField: Proto2NofieldpresenceUnittest_TestAllTypes.OneOf_OneofField? + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _optionalInt32 = source._optionalInt32 + _optionalInt64 = source._optionalInt64 + _optionalUint32 = source._optionalUint32 + _optionalUint64 = source._optionalUint64 + _optionalSint32 = source._optionalSint32 + _optionalSint64 = source._optionalSint64 + _optionalFixed32 = source._optionalFixed32 + _optionalFixed64 = source._optionalFixed64 + _optionalSfixed32 = source._optionalSfixed32 + _optionalSfixed64 = source._optionalSfixed64 + _optionalFloat = source._optionalFloat + _optionalDouble = source._optionalDouble + _optionalBool = source._optionalBool + _optionalString = source._optionalString + _optionalBytes = source._optionalBytes + _optionalNestedMessage = source._optionalNestedMessage + _optionalForeignMessage = source._optionalForeignMessage + _optionalProto2Message = source._optionalProto2Message + _optionalNestedEnum = source._optionalNestedEnum + _optionalForeignEnum = source._optionalForeignEnum + _optionalStringPiece = source._optionalStringPiece + _optionalCord = source._optionalCord + _optionalLazyMessage = source._optionalLazyMessage + _repeatedInt32 = source._repeatedInt32 + _repeatedInt64 = source._repeatedInt64 + _repeatedUint32 = source._repeatedUint32 + _repeatedUint64 = source._repeatedUint64 + _repeatedSint32 = source._repeatedSint32 + _repeatedSint64 = source._repeatedSint64 + _repeatedFixed32 = source._repeatedFixed32 + _repeatedFixed64 = source._repeatedFixed64 + _repeatedSfixed32 = source._repeatedSfixed32 + _repeatedSfixed64 = source._repeatedSfixed64 + _repeatedFloat = source._repeatedFloat + _repeatedDouble = source._repeatedDouble + _repeatedBool = source._repeatedBool + _repeatedString = source._repeatedString + _repeatedBytes = source._repeatedBytes + _repeatedNestedMessage = source._repeatedNestedMessage + _repeatedForeignMessage = source._repeatedForeignMessage + _repeatedProto2Message = source._repeatedProto2Message + _repeatedNestedEnum = source._repeatedNestedEnum + _repeatedForeignEnum = source._repeatedForeignEnum + _repeatedStringPiece = source._repeatedStringPiece + _repeatedCord = source._repeatedCord + _repeatedLazyMessage = source._repeatedLazyMessage + _oneofField = source._oneofField + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._optionalInt32) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._optionalInt64) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint32) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._optionalUint64) }() + case 5: try { try decoder.decodeSingularSInt32Field(value: &_storage._optionalSint32) }() + case 6: try { try decoder.decodeSingularSInt64Field(value: &_storage._optionalSint64) }() + case 7: try { try decoder.decodeSingularFixed32Field(value: &_storage._optionalFixed32) }() + case 8: try { try decoder.decodeSingularFixed64Field(value: &_storage._optionalFixed64) }() + case 9: try { try decoder.decodeSingularSFixed32Field(value: &_storage._optionalSfixed32) }() + case 10: try { try decoder.decodeSingularSFixed64Field(value: &_storage._optionalSfixed64) }() + case 11: try { try decoder.decodeSingularFloatField(value: &_storage._optionalFloat) }() + case 12: try { try decoder.decodeSingularDoubleField(value: &_storage._optionalDouble) }() + case 13: try { try decoder.decodeSingularBoolField(value: &_storage._optionalBool) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._optionalString) }() + case 15: try { try decoder.decodeSingularBytesField(value: &_storage._optionalBytes) }() + case 18: try { try decoder.decodeSingularMessageField(value: &_storage._optionalNestedMessage) }() + case 19: try { try decoder.decodeSingularMessageField(value: &_storage._optionalForeignMessage) }() + case 20: try { try decoder.decodeSingularMessageField(value: &_storage._optionalProto2Message) }() + case 21: try { try decoder.decodeSingularEnumField(value: &_storage._optionalNestedEnum) }() + case 22: try { try decoder.decodeSingularEnumField(value: &_storage._optionalForeignEnum) }() + case 24: try { try decoder.decodeSingularStringField(value: &_storage._optionalStringPiece) }() + case 25: try { try decoder.decodeSingularStringField(value: &_storage._optionalCord) }() + case 30: try { try decoder.decodeSingularMessageField(value: &_storage._optionalLazyMessage) }() + case 31: try { try decoder.decodeRepeatedInt32Field(value: &_storage._repeatedInt32) }() + case 32: try { try decoder.decodeRepeatedInt64Field(value: &_storage._repeatedInt64) }() + case 33: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._repeatedUint32) }() + case 34: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._repeatedUint64) }() + case 35: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._repeatedSint32) }() + case 36: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._repeatedSint64) }() + case 37: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._repeatedFixed32) }() + case 38: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._repeatedFixed64) }() + case 39: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._repeatedSfixed32) }() + case 40: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._repeatedSfixed64) }() + case 41: try { try decoder.decodeRepeatedFloatField(value: &_storage._repeatedFloat) }() + case 42: try { try decoder.decodeRepeatedDoubleField(value: &_storage._repeatedDouble) }() + case 43: try { try decoder.decodeRepeatedBoolField(value: &_storage._repeatedBool) }() + case 44: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedString) }() + case 45: try { try decoder.decodeRepeatedBytesField(value: &_storage._repeatedBytes) }() + case 48: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedNestedMessage) }() + case 49: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedForeignMessage) }() + case 50: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedProto2Message) }() + case 51: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedNestedEnum) }() + case 52: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedForeignEnum) }() + case 54: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedStringPiece) }() + case 55: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedCord) }() + case 57: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedLazyMessage) }() + case 111: try { + var v: UInt32? + try decoder.decodeSingularUInt32Field(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofUint32(v) + } + }() + case 112: try { + var v: Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage? + var hadOneofValue = false + if let current = _storage._oneofField { + hadOneofValue = true + if case .oneofNestedMessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofNestedMessage(v) + } + }() + case 113: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofString(v) + } + }() + case 114: try { + var v: Proto2NofieldpresenceUnittest_TestAllTypes.NestedEnum? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofEnum(v) + } + }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if _storage._optionalInt32 != 0 { + try visitor.visitSingularInt32Field(value: _storage._optionalInt32, fieldNumber: 1) + } + if _storage._optionalInt64 != 0 { + try visitor.visitSingularInt64Field(value: _storage._optionalInt64, fieldNumber: 2) + } + if _storage._optionalUint32 != 0 { + try visitor.visitSingularUInt32Field(value: _storage._optionalUint32, fieldNumber: 3) + } + if _storage._optionalUint64 != 0 { + try visitor.visitSingularUInt64Field(value: _storage._optionalUint64, fieldNumber: 4) + } + if _storage._optionalSint32 != 0 { + try visitor.visitSingularSInt32Field(value: _storage._optionalSint32, fieldNumber: 5) + } + if _storage._optionalSint64 != 0 { + try visitor.visitSingularSInt64Field(value: _storage._optionalSint64, fieldNumber: 6) + } + if _storage._optionalFixed32 != 0 { + try visitor.visitSingularFixed32Field(value: _storage._optionalFixed32, fieldNumber: 7) + } + if _storage._optionalFixed64 != 0 { + try visitor.visitSingularFixed64Field(value: _storage._optionalFixed64, fieldNumber: 8) + } + if _storage._optionalSfixed32 != 0 { + try visitor.visitSingularSFixed32Field(value: _storage._optionalSfixed32, fieldNumber: 9) + } + if _storage._optionalSfixed64 != 0 { + try visitor.visitSingularSFixed64Field(value: _storage._optionalSfixed64, fieldNumber: 10) + } + if _storage._optionalFloat != 0 { + try visitor.visitSingularFloatField(value: _storage._optionalFloat, fieldNumber: 11) + } + if _storage._optionalDouble != 0 { + try visitor.visitSingularDoubleField(value: _storage._optionalDouble, fieldNumber: 12) + } + if _storage._optionalBool != false { + try visitor.visitSingularBoolField(value: _storage._optionalBool, fieldNumber: 13) + } + if !_storage._optionalString.isEmpty { + try visitor.visitSingularStringField(value: _storage._optionalString, fieldNumber: 14) + } + if !_storage._optionalBytes.isEmpty { + try visitor.visitSingularBytesField(value: _storage._optionalBytes, fieldNumber: 15) + } + try { if let v = _storage._optionalNestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._optionalForeignMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + } }() + try { if let v = _storage._optionalProto2Message { + try visitor.visitSingularMessageField(value: v, fieldNumber: 20) + } }() + if _storage._optionalNestedEnum != .foo { + try visitor.visitSingularEnumField(value: _storage._optionalNestedEnum, fieldNumber: 21) + } + if _storage._optionalForeignEnum != .foreignFoo { + try visitor.visitSingularEnumField(value: _storage._optionalForeignEnum, fieldNumber: 22) + } + if !_storage._optionalStringPiece.isEmpty { + try visitor.visitSingularStringField(value: _storage._optionalStringPiece, fieldNumber: 24) + } + if !_storage._optionalCord.isEmpty { + try visitor.visitSingularStringField(value: _storage._optionalCord, fieldNumber: 25) + } + try { if let v = _storage._optionalLazyMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 30) + } }() + if !_storage._repeatedInt32.isEmpty { + try visitor.visitPackedInt32Field(value: _storage._repeatedInt32, fieldNumber: 31) + } + if !_storage._repeatedInt64.isEmpty { + try visitor.visitPackedInt64Field(value: _storage._repeatedInt64, fieldNumber: 32) + } + if !_storage._repeatedUint32.isEmpty { + try visitor.visitPackedUInt32Field(value: _storage._repeatedUint32, fieldNumber: 33) + } + if !_storage._repeatedUint64.isEmpty { + try visitor.visitPackedUInt64Field(value: _storage._repeatedUint64, fieldNumber: 34) + } + if !_storage._repeatedSint32.isEmpty { + try visitor.visitPackedSInt32Field(value: _storage._repeatedSint32, fieldNumber: 35) + } + if !_storage._repeatedSint64.isEmpty { + try visitor.visitPackedSInt64Field(value: _storage._repeatedSint64, fieldNumber: 36) + } + if !_storage._repeatedFixed32.isEmpty { + try visitor.visitPackedFixed32Field(value: _storage._repeatedFixed32, fieldNumber: 37) + } + if !_storage._repeatedFixed64.isEmpty { + try visitor.visitPackedFixed64Field(value: _storage._repeatedFixed64, fieldNumber: 38) + } + if !_storage._repeatedSfixed32.isEmpty { + try visitor.visitPackedSFixed32Field(value: _storage._repeatedSfixed32, fieldNumber: 39) + } + if !_storage._repeatedSfixed64.isEmpty { + try visitor.visitPackedSFixed64Field(value: _storage._repeatedSfixed64, fieldNumber: 40) + } + if !_storage._repeatedFloat.isEmpty { + try visitor.visitPackedFloatField(value: _storage._repeatedFloat, fieldNumber: 41) + } + if !_storage._repeatedDouble.isEmpty { + try visitor.visitPackedDoubleField(value: _storage._repeatedDouble, fieldNumber: 42) + } + if !_storage._repeatedBool.isEmpty { + try visitor.visitPackedBoolField(value: _storage._repeatedBool, fieldNumber: 43) + } + if !_storage._repeatedString.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedString, fieldNumber: 44) + } + if !_storage._repeatedBytes.isEmpty { + try visitor.visitRepeatedBytesField(value: _storage._repeatedBytes, fieldNumber: 45) + } + if !_storage._repeatedNestedMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedNestedMessage, fieldNumber: 48) + } + if !_storage._repeatedForeignMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedForeignMessage, fieldNumber: 49) + } + if !_storage._repeatedProto2Message.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedProto2Message, fieldNumber: 50) + } + if !_storage._repeatedNestedEnum.isEmpty { + try visitor.visitPackedEnumField(value: _storage._repeatedNestedEnum, fieldNumber: 51) + } + if !_storage._repeatedForeignEnum.isEmpty { + try visitor.visitPackedEnumField(value: _storage._repeatedForeignEnum, fieldNumber: 52) + } + if !_storage._repeatedStringPiece.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedStringPiece, fieldNumber: 54) + } + if !_storage._repeatedCord.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedCord, fieldNumber: 55) + } + if !_storage._repeatedLazyMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedLazyMessage, fieldNumber: 57) + } + switch _storage._oneofField { + case .oneofUint32?: try { + guard case .oneofUint32(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 111) + }() + case .oneofNestedMessage?: try { + guard case .oneofNestedMessage(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 112) + }() + case .oneofString?: try { + guard case .oneofString(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 113) + }() + case .oneofEnum?: try { + guard case .oneofEnum(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 114) + }() + case nil: break + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto2NofieldpresenceUnittest_TestAllTypes, rhs: Proto2NofieldpresenceUnittest_TestAllTypes) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._optionalInt32 != rhs_storage._optionalInt32 {return false} + if _storage._optionalInt64 != rhs_storage._optionalInt64 {return false} + if _storage._optionalUint32 != rhs_storage._optionalUint32 {return false} + if _storage._optionalUint64 != rhs_storage._optionalUint64 {return false} + if _storage._optionalSint32 != rhs_storage._optionalSint32 {return false} + if _storage._optionalSint64 != rhs_storage._optionalSint64 {return false} + if _storage._optionalFixed32 != rhs_storage._optionalFixed32 {return false} + if _storage._optionalFixed64 != rhs_storage._optionalFixed64 {return false} + if _storage._optionalSfixed32 != rhs_storage._optionalSfixed32 {return false} + if _storage._optionalSfixed64 != rhs_storage._optionalSfixed64 {return false} + if _storage._optionalFloat != rhs_storage._optionalFloat {return false} + if _storage._optionalDouble != rhs_storage._optionalDouble {return false} + if _storage._optionalBool != rhs_storage._optionalBool {return false} + if _storage._optionalString != rhs_storage._optionalString {return false} + if _storage._optionalBytes != rhs_storage._optionalBytes {return false} + if _storage._optionalNestedMessage != rhs_storage._optionalNestedMessage {return false} + if _storage._optionalForeignMessage != rhs_storage._optionalForeignMessage {return false} + if _storage._optionalProto2Message != rhs_storage._optionalProto2Message {return false} + if _storage._optionalNestedEnum != rhs_storage._optionalNestedEnum {return false} + if _storage._optionalForeignEnum != rhs_storage._optionalForeignEnum {return false} + if _storage._optionalStringPiece != rhs_storage._optionalStringPiece {return false} + if _storage._optionalCord != rhs_storage._optionalCord {return false} + if _storage._optionalLazyMessage != rhs_storage._optionalLazyMessage {return false} + if _storage._repeatedInt32 != rhs_storage._repeatedInt32 {return false} + if _storage._repeatedInt64 != rhs_storage._repeatedInt64 {return false} + if _storage._repeatedUint32 != rhs_storage._repeatedUint32 {return false} + if _storage._repeatedUint64 != rhs_storage._repeatedUint64 {return false} + if _storage._repeatedSint32 != rhs_storage._repeatedSint32 {return false} + if _storage._repeatedSint64 != rhs_storage._repeatedSint64 {return false} + if _storage._repeatedFixed32 != rhs_storage._repeatedFixed32 {return false} + if _storage._repeatedFixed64 != rhs_storage._repeatedFixed64 {return false} + if _storage._repeatedSfixed32 != rhs_storage._repeatedSfixed32 {return false} + if _storage._repeatedSfixed64 != rhs_storage._repeatedSfixed64 {return false} + if _storage._repeatedFloat != rhs_storage._repeatedFloat {return false} + if _storage._repeatedDouble != rhs_storage._repeatedDouble {return false} + if _storage._repeatedBool != rhs_storage._repeatedBool {return false} + if _storage._repeatedString != rhs_storage._repeatedString {return false} + if _storage._repeatedBytes != rhs_storage._repeatedBytes {return false} + if _storage._repeatedNestedMessage != rhs_storage._repeatedNestedMessage {return false} + if _storage._repeatedForeignMessage != rhs_storage._repeatedForeignMessage {return false} + if _storage._repeatedProto2Message != rhs_storage._repeatedProto2Message {return false} + if _storage._repeatedNestedEnum != rhs_storage._repeatedNestedEnum {return false} + if _storage._repeatedForeignEnum != rhs_storage._repeatedForeignEnum {return false} + if _storage._repeatedStringPiece != rhs_storage._repeatedStringPiece {return false} + if _storage._repeatedCord != rhs_storage._repeatedCord {return false} + if _storage._repeatedLazyMessage != rhs_storage._repeatedLazyMessage {return false} + if _storage._oneofField != rhs_storage._oneofField {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto2NofieldpresenceUnittest_TestAllTypes.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FOO"), + 1: .same(proto: "BAR"), + 2: .same(proto: "BAZ"), + ] +} + +extension Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Proto2NofieldpresenceUnittest_TestAllTypes.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "bb"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.bb) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.bb != 0 { + try visitor.visitSingularInt32Field(value: self.bb, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage, rhs: Proto2NofieldpresenceUnittest_TestAllTypes.NestedMessage) -> Bool { + if lhs.bb != rhs.bb {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto2NofieldpresenceUnittest_TestProto2Required: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestProto2Required" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "proto2"), + ] + + public var isInitialized: Bool { + if let v = self._proto2, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._proto2) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._proto2 { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto2NofieldpresenceUnittest_TestProto2Required, rhs: Proto2NofieldpresenceUnittest_TestProto2Required) -> Bool { + if lhs._proto2 != rhs._proto2 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto2NofieldpresenceUnittest_ForeignMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ForeignMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "c"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.c) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.c != 0 { + try visitor.visitSingularInt32Field(value: self.c, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto2NofieldpresenceUnittest_ForeignMessage, rhs: Proto2NofieldpresenceUnittest_ForeignMessage) -> Bool { + if lhs.c != rhs.c {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_no_generic_services.pb.swift b/Reference/SwiftProtobufTests/unittest_no_generic_services.pb.swift new file mode 100644 index 000000000..41ad8ebe8 --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_no_generic_services.pb.swift @@ -0,0 +1,204 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_no_generic_services.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum ProtobufUnittest_NoGenericServicesTest_TestEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 1 + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case 1: self = .foo + default: return nil + } + } + + var rawValue: Int { + switch self { + case .foo: return 1 + } + } + +} + +struct ProtobufUnittest_NoGenericServicesTest_TestMessage: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _a: Int32? = nil +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittest_NoGenericServicesTest_TestMessage: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Extension support defined in unittest_no_generic_services.proto. + +// MARK: - Extension Properties + +// Swift Extensions on the exteneded Messages to add easy access to the declared +// extension fields. The names are based on the extension field name from the proto +// declaration. To avoid naming collisions, the names are prefixed with the name of +// the scope where the extend directive occurs. + +extension ProtobufUnittest_NoGenericServicesTest_TestMessage { + + var ProtobufUnittest_NoGenericServicesTest_testExtension: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_NoGenericServicesTest_Extensions_test_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_NoGenericServicesTest_Extensions_test_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_NoGenericServicesTest_Extensions_test_extension` + /// has been explicitly set. + var hasProtobufUnittest_NoGenericServicesTest_testExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_NoGenericServicesTest_Extensions_test_extension) + } + /// Clears the value of extension `ProtobufUnittest_NoGenericServicesTest_Extensions_test_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_NoGenericServicesTest_testExtension() { + clearExtensionValue(ext: ProtobufUnittest_NoGenericServicesTest_Extensions_test_extension) + } + +} + +// MARK: - File's ExtensionMap: ProtobufUnittest_NoGenericServicesTest_UnittestNoGenericServices_Extensions + +/// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by +/// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed +/// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create +/// a larger `SwiftProtobuf.SimpleExtensionMap`. +let ProtobufUnittest_NoGenericServicesTest_UnittestNoGenericServices_Extensions: SwiftProtobuf.SimpleExtensionMap = [ + ProtobufUnittest_NoGenericServicesTest_Extensions_test_extension +] + +// Extension Objects - The only reason these might be needed is when manually +// constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_ +// accessors for the extension fields on the messages directly. + +let ProtobufUnittest_NoGenericServicesTest_Extensions_test_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_NoGenericServicesTest_TestMessage>( + _protobuf_fieldNumber: 1000, + fieldName: "protobuf_unittest.no_generic_services_test.test_extension" +) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest.no_generic_services_test" + +extension ProtobufUnittest_NoGenericServicesTest_TestEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "FOO"), + ] +} + +extension ProtobufUnittest_NoGenericServicesTest_TestMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + case 1000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_NoGenericServicesTest_TestMessage.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_NoGenericServicesTest_TestMessage, rhs: ProtobufUnittest_NoGenericServicesTest_TestMessage) -> Bool { + if lhs._a != rhs._a {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_optimize_for.pb.swift b/Reference/SwiftProtobufTests/unittest_optimize_for.pb.swift new file mode 100644 index 000000000..2dff3e3f3 --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_optimize_for.pb.swift @@ -0,0 +1,401 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_optimize_for.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// A proto file which uses optimize_for = CODE_SIZE. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +struct ProtobufUnittest_TestOptimizedForSize: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var i: Int32 { + get {return _i ?? 0} + set {_i = newValue} + } + /// Returns true if `i` has been explicitly set. + var hasI: Bool {return self._i != nil} + /// Clears the value of `i`. Subsequent reads from it will return its default value. + mutating func clearI() {self._i = nil} + + var msg: ProtobufUnittest_ForeignMessage { + get {return _msg ?? ProtobufUnittest_ForeignMessage()} + set {_msg = newValue} + } + /// Returns true if `msg` has been explicitly set. + var hasMsg: Bool {return self._msg != nil} + /// Clears the value of `msg`. Subsequent reads from it will return its default value. + mutating func clearMsg() {self._msg = nil} + + var foo: ProtobufUnittest_TestOptimizedForSize.OneOf_Foo? = nil + + var integerField: Int32 { + get { + if case .integerField(let v)? = foo {return v} + return 0 + } + set {foo = .integerField(newValue)} + } + + var stringField: String { + get { + if case .stringField(let v)? = foo {return v} + return String() + } + set {foo = .stringField(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_Foo: Equatable { + case integerField(Int32) + case stringField(String) + + } + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _i: Int32? = nil + fileprivate var _msg: ProtobufUnittest_ForeignMessage? = nil +} + +struct ProtobufUnittest_TestRequiredOptimizedForSize { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var x: Int32 { + get {return _x ?? 0} + set {_x = newValue} + } + /// Returns true if `x` has been explicitly set. + var hasX: Bool {return self._x != nil} + /// Clears the value of `x`. Subsequent reads from it will return its default value. + mutating func clearX() {self._x = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _x: Int32? = nil +} + +struct ProtobufUnittest_TestOptionalOptimizedForSize { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var o: ProtobufUnittest_TestRequiredOptimizedForSize { + get {return _o ?? ProtobufUnittest_TestRequiredOptimizedForSize()} + set {_o = newValue} + } + /// Returns true if `o` has been explicitly set. + var hasO: Bool {return self._o != nil} + /// Clears the value of `o`. Subsequent reads from it will return its default value. + mutating func clearO() {self._o = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _o: ProtobufUnittest_TestRequiredOptimizedForSize? = nil +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittest_TestOptimizedForSize: @unchecked Sendable {} +extension ProtobufUnittest_TestOptimizedForSize.OneOf_Foo: @unchecked Sendable {} +extension ProtobufUnittest_TestRequiredOptimizedForSize: @unchecked Sendable {} +extension ProtobufUnittest_TestOptionalOptimizedForSize: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Extension support defined in unittest_optimize_for.proto. + +// MARK: - Extension Properties + +// Swift Extensions on the exteneded Messages to add easy access to the declared +// extension fields. The names are based on the extension field name from the proto +// declaration. To avoid naming collisions, the names are prefixed with the name of +// the scope where the extend directive occurs. + +extension ProtobufUnittest_TestOptimizedForSize { + + var ProtobufUnittest_TestOptimizedForSize_testExtension: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_TestOptimizedForSize.Extensions.test_extension) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_TestOptimizedForSize.Extensions.test_extension, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestOptimizedForSize.Extensions.test_extension` + /// has been explicitly set. + var hasProtobufUnittest_TestOptimizedForSize_testExtension: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestOptimizedForSize.Extensions.test_extension) + } + /// Clears the value of extension `ProtobufUnittest_TestOptimizedForSize.Extensions.test_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestOptimizedForSize_testExtension() { + clearExtensionValue(ext: ProtobufUnittest_TestOptimizedForSize.Extensions.test_extension) + } + + var ProtobufUnittest_TestOptimizedForSize_testExtension2: ProtobufUnittest_TestRequiredOptimizedForSize { + get {return getExtensionValue(ext: ProtobufUnittest_TestOptimizedForSize.Extensions.test_extension2) ?? ProtobufUnittest_TestRequiredOptimizedForSize()} + set {setExtensionValue(ext: ProtobufUnittest_TestOptimizedForSize.Extensions.test_extension2, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_TestOptimizedForSize.Extensions.test_extension2` + /// has been explicitly set. + var hasProtobufUnittest_TestOptimizedForSize_testExtension2: Bool { + return hasExtensionValue(ext: ProtobufUnittest_TestOptimizedForSize.Extensions.test_extension2) + } + /// Clears the value of extension `ProtobufUnittest_TestOptimizedForSize.Extensions.test_extension2`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_TestOptimizedForSize_testExtension2() { + clearExtensionValue(ext: ProtobufUnittest_TestOptimizedForSize.Extensions.test_extension2) + } + +} + +// MARK: - File's ExtensionMap: ProtobufUnittest_UnittestOptimizeFor_Extensions + +/// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by +/// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed +/// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create +/// a larger `SwiftProtobuf.SimpleExtensionMap`. +let ProtobufUnittest_UnittestOptimizeFor_Extensions: SwiftProtobuf.SimpleExtensionMap = [ + ProtobufUnittest_TestOptimizedForSize.Extensions.test_extension, + ProtobufUnittest_TestOptimizedForSize.Extensions.test_extension2 +] + +// Extension Objects - The only reason these might be needed is when manually +// constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_ +// accessors for the extension fields on the messages directly. + +extension ProtobufUnittest_TestOptimizedForSize { + enum Extensions { + static let test_extension = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestOptimizedForSize>( + _protobuf_fieldNumber: 1234, + fieldName: "protobuf_unittest.TestOptimizedForSize.test_extension" + ) + + static let test_extension2 = SwiftProtobuf.MessageExtension, ProtobufUnittest_TestOptimizedForSize>( + _protobuf_fieldNumber: 1235, + fieldName: "protobuf_unittest.TestOptimizedForSize.test_extension2" + ) + } +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest" + +extension ProtobufUnittest_TestOptimizedForSize: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestOptimizedForSize" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "i"), + 19: .same(proto: "msg"), + 2: .standard(proto: "integer_field"), + 3: .standard(proto: "string_field"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._i) }() + case 2: try { + var v: Int32? + try decoder.decodeSingularInt32Field(value: &v) + if let v = v { + if self.foo != nil {try decoder.handleConflictingOneOf()} + self.foo = .integerField(v) + } + }() + case 3: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.foo != nil {try decoder.handleConflictingOneOf()} + self.foo = .stringField(v) + } + }() + case 19: try { try decoder.decodeSingularMessageField(value: &self._msg) }() + case 1000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufUnittest_TestOptimizedForSize.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._i { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + switch self.foo { + case .integerField?: try { + guard case .integerField(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + }() + case .stringField?: try { + guard case .stringField(let v)? = self.foo else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + }() + case nil: break + } + try { if let v = self._msg { + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + } }() + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestOptimizedForSize, rhs: ProtobufUnittest_TestOptimizedForSize) -> Bool { + if lhs._i != rhs._i {return false} + if lhs._msg != rhs._msg {return false} + if lhs.foo != rhs.foo {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufUnittest_TestRequiredOptimizedForSize: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestRequiredOptimizedForSize" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "x"), + ] + + public var isInitialized: Bool { + if self._x == nil {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._x) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._x { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestRequiredOptimizedForSize, rhs: ProtobufUnittest_TestRequiredOptimizedForSize) -> Bool { + if lhs._x != rhs._x {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestOptionalOptimizedForSize: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestOptionalOptimizedForSize" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "o"), + ] + + public var isInitialized: Bool { + if let v = self._o, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._o) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._o { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestOptionalOptimizedForSize, rhs: ProtobufUnittest_TestOptionalOptimizedForSize) -> Bool { + if lhs._o != rhs._o {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_preserve_unknown_enum.pb.swift b/Reference/SwiftProtobufTests/unittest_preserve_unknown_enum.pb.swift new file mode 100644 index 000000000..76178a0ac --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_preserve_unknown_enum.pb.swift @@ -0,0 +1,412 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_preserve_unknown_enum.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum Proto3PreserveUnknownEnumUnittest_MyEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 0 + case bar // = 1 + case baz // = 2 + case UNRECOGNIZED(Int) + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .foo + case 1: self = .bar + case 2: self = .baz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .foo: return 0 + case .bar: return 1 + case .baz: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Proto3PreserveUnknownEnumUnittest_MyEnum] = [ + .foo, + .bar, + .baz, + ] + +} + +enum Proto3PreserveUnknownEnumUnittest_MyEnumPlusExtra: SwiftProtobuf.Enum { + typealias RawValue = Int + case eFoo // = 0 + case eBar // = 1 + case eBaz // = 2 + case eExtra // = 3 + case UNRECOGNIZED(Int) + + init() { + self = .eFoo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .eFoo + case 1: self = .eBar + case 2: self = .eBaz + case 3: self = .eExtra + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .eFoo: return 0 + case .eBar: return 1 + case .eBaz: return 2 + case .eExtra: return 3 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Proto3PreserveUnknownEnumUnittest_MyEnumPlusExtra] = [ + .eFoo, + .eBar, + .eBaz, + .eExtra, + ] + +} + +struct Proto3PreserveUnknownEnumUnittest_MyMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var e: Proto3PreserveUnknownEnumUnittest_MyEnum = .foo + + var repeatedE: [Proto3PreserveUnknownEnumUnittest_MyEnum] = [] + + var repeatedPackedE: [Proto3PreserveUnknownEnumUnittest_MyEnum] = [] + + /// not packed + var repeatedPackedUnexpectedE: [Proto3PreserveUnknownEnumUnittest_MyEnumPlusExtra] = [] + + var o: Proto3PreserveUnknownEnumUnittest_MyMessage.OneOf_O? = nil + + var oneofE1: Proto3PreserveUnknownEnumUnittest_MyEnum { + get { + if case .oneofE1(let v)? = o {return v} + return .foo + } + set {o = .oneofE1(newValue)} + } + + var oneofE2: Proto3PreserveUnknownEnumUnittest_MyEnum { + get { + if case .oneofE2(let v)? = o {return v} + return .foo + } + set {o = .oneofE2(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_O: Equatable { + case oneofE1(Proto3PreserveUnknownEnumUnittest_MyEnum) + case oneofE2(Proto3PreserveUnknownEnumUnittest_MyEnum) + + } + + init() {} +} + +struct Proto3PreserveUnknownEnumUnittest_MyMessagePlusExtra { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var e: Proto3PreserveUnknownEnumUnittest_MyEnumPlusExtra = .eFoo + + var repeatedE: [Proto3PreserveUnknownEnumUnittest_MyEnumPlusExtra] = [] + + var repeatedPackedE: [Proto3PreserveUnknownEnumUnittest_MyEnumPlusExtra] = [] + + var repeatedPackedUnexpectedE: [Proto3PreserveUnknownEnumUnittest_MyEnumPlusExtra] = [] + + var o: Proto3PreserveUnknownEnumUnittest_MyMessagePlusExtra.OneOf_O? = nil + + var oneofE1: Proto3PreserveUnknownEnumUnittest_MyEnumPlusExtra { + get { + if case .oneofE1(let v)? = o {return v} + return .eFoo + } + set {o = .oneofE1(newValue)} + } + + var oneofE2: Proto3PreserveUnknownEnumUnittest_MyEnumPlusExtra { + get { + if case .oneofE2(let v)? = o {return v} + return .eFoo + } + set {o = .oneofE2(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_O: Equatable { + case oneofE1(Proto3PreserveUnknownEnumUnittest_MyEnumPlusExtra) + case oneofE2(Proto3PreserveUnknownEnumUnittest_MyEnumPlusExtra) + + } + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Proto3PreserveUnknownEnumUnittest_MyMessage: @unchecked Sendable {} +extension Proto3PreserveUnknownEnumUnittest_MyMessage.OneOf_O: @unchecked Sendable {} +extension Proto3PreserveUnknownEnumUnittest_MyMessagePlusExtra: @unchecked Sendable {} +extension Proto3PreserveUnknownEnumUnittest_MyMessagePlusExtra.OneOf_O: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "proto3_preserve_unknown_enum_unittest" + +extension Proto3PreserveUnknownEnumUnittest_MyEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FOO"), + 1: .same(proto: "BAR"), + 2: .same(proto: "BAZ"), + ] +} + +extension Proto3PreserveUnknownEnumUnittest_MyEnumPlusExtra: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "E_FOO"), + 1: .same(proto: "E_BAR"), + 2: .same(proto: "E_BAZ"), + 3: .same(proto: "E_EXTRA"), + ] +} + +extension Proto3PreserveUnknownEnumUnittest_MyMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MyMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "e"), + 2: .standard(proto: "repeated_e"), + 3: .standard(proto: "repeated_packed_e"), + 4: .standard(proto: "repeated_packed_unexpected_e"), + 5: .standard(proto: "oneof_e_1"), + 6: .standard(proto: "oneof_e_2"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.e) }() + case 2: try { try decoder.decodeRepeatedEnumField(value: &self.repeatedE) }() + case 3: try { try decoder.decodeRepeatedEnumField(value: &self.repeatedPackedE) }() + case 4: try { try decoder.decodeRepeatedEnumField(value: &self.repeatedPackedUnexpectedE) }() + case 5: try { + var v: Proto3PreserveUnknownEnumUnittest_MyEnum? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if self.o != nil {try decoder.handleConflictingOneOf()} + self.o = .oneofE1(v) + } + }() + case 6: try { + var v: Proto3PreserveUnknownEnumUnittest_MyEnum? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if self.o != nil {try decoder.handleConflictingOneOf()} + self.o = .oneofE2(v) + } + }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.e != .foo { + try visitor.visitSingularEnumField(value: self.e, fieldNumber: 1) + } + if !self.repeatedE.isEmpty { + try visitor.visitPackedEnumField(value: self.repeatedE, fieldNumber: 2) + } + if !self.repeatedPackedE.isEmpty { + try visitor.visitPackedEnumField(value: self.repeatedPackedE, fieldNumber: 3) + } + if !self.repeatedPackedUnexpectedE.isEmpty { + try visitor.visitPackedEnumField(value: self.repeatedPackedUnexpectedE, fieldNumber: 4) + } + switch self.o { + case .oneofE1?: try { + guard case .oneofE1(let v)? = self.o else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 5) + }() + case .oneofE2?: try { + guard case .oneofE2(let v)? = self.o else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 6) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3PreserveUnknownEnumUnittest_MyMessage, rhs: Proto3PreserveUnknownEnumUnittest_MyMessage) -> Bool { + if lhs.e != rhs.e {return false} + if lhs.repeatedE != rhs.repeatedE {return false} + if lhs.repeatedPackedE != rhs.repeatedPackedE {return false} + if lhs.repeatedPackedUnexpectedE != rhs.repeatedPackedUnexpectedE {return false} + if lhs.o != rhs.o {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3PreserveUnknownEnumUnittest_MyMessagePlusExtra: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MyMessagePlusExtra" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "e"), + 2: .standard(proto: "repeated_e"), + 3: .standard(proto: "repeated_packed_e"), + 4: .standard(proto: "repeated_packed_unexpected_e"), + 5: .standard(proto: "oneof_e_1"), + 6: .standard(proto: "oneof_e_2"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.e) }() + case 2: try { try decoder.decodeRepeatedEnumField(value: &self.repeatedE) }() + case 3: try { try decoder.decodeRepeatedEnumField(value: &self.repeatedPackedE) }() + case 4: try { try decoder.decodeRepeatedEnumField(value: &self.repeatedPackedUnexpectedE) }() + case 5: try { + var v: Proto3PreserveUnknownEnumUnittest_MyEnumPlusExtra? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if self.o != nil {try decoder.handleConflictingOneOf()} + self.o = .oneofE1(v) + } + }() + case 6: try { + var v: Proto3PreserveUnknownEnumUnittest_MyEnumPlusExtra? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if self.o != nil {try decoder.handleConflictingOneOf()} + self.o = .oneofE2(v) + } + }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.e != .eFoo { + try visitor.visitSingularEnumField(value: self.e, fieldNumber: 1) + } + if !self.repeatedE.isEmpty { + try visitor.visitPackedEnumField(value: self.repeatedE, fieldNumber: 2) + } + if !self.repeatedPackedE.isEmpty { + try visitor.visitPackedEnumField(value: self.repeatedPackedE, fieldNumber: 3) + } + if !self.repeatedPackedUnexpectedE.isEmpty { + try visitor.visitPackedEnumField(value: self.repeatedPackedUnexpectedE, fieldNumber: 4) + } + switch self.o { + case .oneofE1?: try { + guard case .oneofE1(let v)? = self.o else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 5) + }() + case .oneofE2?: try { + guard case .oneofE2(let v)? = self.o else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 6) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3PreserveUnknownEnumUnittest_MyMessagePlusExtra, rhs: Proto3PreserveUnknownEnumUnittest_MyMessagePlusExtra) -> Bool { + if lhs.e != rhs.e {return false} + if lhs.repeatedE != rhs.repeatedE {return false} + if lhs.repeatedPackedE != rhs.repeatedPackedE {return false} + if lhs.repeatedPackedUnexpectedE != rhs.repeatedPackedUnexpectedE {return false} + if lhs.o != rhs.o {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_preserve_unknown_enum2.pb.swift b/Reference/SwiftProtobufTests/unittest_preserve_unknown_enum2.pb.swift new file mode 100644 index 000000000..8d64f12f9 --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_preserve_unknown_enum2.pb.swift @@ -0,0 +1,233 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_preserve_unknown_enum2.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum Proto2PreserveUnknownEnumUnittest_MyEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 0 + case bar // = 1 + case baz // = 2 + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .foo + case 1: self = .bar + case 2: self = .baz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .foo: return 0 + case .bar: return 1 + case .baz: return 2 + } + } + +} + +struct Proto2PreserveUnknownEnumUnittest_MyMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var e: Proto2PreserveUnknownEnumUnittest_MyEnum { + get {return _e ?? .foo} + set {_e = newValue} + } + /// Returns true if `e` has been explicitly set. + var hasE: Bool {return self._e != nil} + /// Clears the value of `e`. Subsequent reads from it will return its default value. + mutating func clearE() {self._e = nil} + + var repeatedE: [Proto2PreserveUnknownEnumUnittest_MyEnum] = [] + + var repeatedPackedE: [Proto2PreserveUnknownEnumUnittest_MyEnum] = [] + + /// not packed + var repeatedPackedUnexpectedE: [Proto2PreserveUnknownEnumUnittest_MyEnum] = [] + + var o: Proto2PreserveUnknownEnumUnittest_MyMessage.OneOf_O? = nil + + var oneofE1: Proto2PreserveUnknownEnumUnittest_MyEnum { + get { + if case .oneofE1(let v)? = o {return v} + return .foo + } + set {o = .oneofE1(newValue)} + } + + var oneofE2: Proto2PreserveUnknownEnumUnittest_MyEnum { + get { + if case .oneofE2(let v)? = o {return v} + return .foo + } + set {o = .oneofE2(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_O: Equatable { + case oneofE1(Proto2PreserveUnknownEnumUnittest_MyEnum) + case oneofE2(Proto2PreserveUnknownEnumUnittest_MyEnum) + + } + + init() {} + + fileprivate var _e: Proto2PreserveUnknownEnumUnittest_MyEnum? = nil +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Proto2PreserveUnknownEnumUnittest_MyMessage: @unchecked Sendable {} +extension Proto2PreserveUnknownEnumUnittest_MyMessage.OneOf_O: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "proto2_preserve_unknown_enum_unittest" + +extension Proto2PreserveUnknownEnumUnittest_MyEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FOO"), + 1: .same(proto: "BAR"), + 2: .same(proto: "BAZ"), + ] +} + +extension Proto2PreserveUnknownEnumUnittest_MyMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MyMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "e"), + 2: .standard(proto: "repeated_e"), + 3: .standard(proto: "repeated_packed_e"), + 4: .standard(proto: "repeated_packed_unexpected_e"), + 5: .standard(proto: "oneof_e_1"), + 6: .standard(proto: "oneof_e_2"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self._e) }() + case 2: try { try decoder.decodeRepeatedEnumField(value: &self.repeatedE) }() + case 3: try { try decoder.decodeRepeatedEnumField(value: &self.repeatedPackedE) }() + case 4: try { try decoder.decodeRepeatedEnumField(value: &self.repeatedPackedUnexpectedE) }() + case 5: try { + var v: Proto2PreserveUnknownEnumUnittest_MyEnum? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if self.o != nil {try decoder.handleConflictingOneOf()} + self.o = .oneofE1(v) + } + }() + case 6: try { + var v: Proto2PreserveUnknownEnumUnittest_MyEnum? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if self.o != nil {try decoder.handleConflictingOneOf()} + self.o = .oneofE2(v) + } + }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._e { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1) + } }() + if !self.repeatedE.isEmpty { + try visitor.visitRepeatedEnumField(value: self.repeatedE, fieldNumber: 2) + } + if !self.repeatedPackedE.isEmpty { + try visitor.visitPackedEnumField(value: self.repeatedPackedE, fieldNumber: 3) + } + if !self.repeatedPackedUnexpectedE.isEmpty { + try visitor.visitRepeatedEnumField(value: self.repeatedPackedUnexpectedE, fieldNumber: 4) + } + switch self.o { + case .oneofE1?: try { + guard case .oneofE1(let v)? = self.o else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 5) + }() + case .oneofE2?: try { + guard case .oneofE2(let v)? = self.o else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 6) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto2PreserveUnknownEnumUnittest_MyMessage, rhs: Proto2PreserveUnknownEnumUnittest_MyMessage) -> Bool { + if lhs._e != rhs._e {return false} + if lhs.repeatedE != rhs.repeatedE {return false} + if lhs.repeatedPackedE != rhs.repeatedPackedE {return false} + if lhs.repeatedPackedUnexpectedE != rhs.repeatedPackedUnexpectedE {return false} + if lhs.o != rhs.o {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_proto3.pb.swift b/Reference/SwiftProtobufTests/unittest_proto3.pb.swift new file mode 100644 index 000000000..261410083 --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_proto3.pb.swift @@ -0,0 +1,1723 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_proto3.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum Proto3Unittest_ForeignEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foreignZero // = 0 + case foreignFoo // = 4 + case foreignBar // = 5 + case foreignBaz // = 6 + case UNRECOGNIZED(Int) + + init() { + self = .foreignZero + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .foreignZero + case 4: self = .foreignFoo + case 5: self = .foreignBar + case 6: self = .foreignBaz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .foreignZero: return 0 + case .foreignFoo: return 4 + case .foreignBar: return 5 + case .foreignBaz: return 6 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Proto3Unittest_ForeignEnum] = [ + .foreignZero, + .foreignFoo, + .foreignBar, + .foreignBaz, + ] + +} + +/// This proto includes every type of field in both singular and repeated +/// forms. +struct Proto3Unittest_TestAllTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Singular + var optionalInt32: Int32 { + get {return _storage._optionalInt32} + set {_uniqueStorage()._optionalInt32 = newValue} + } + + var optionalInt64: Int64 { + get {return _storage._optionalInt64} + set {_uniqueStorage()._optionalInt64 = newValue} + } + + var optionalUint32: UInt32 { + get {return _storage._optionalUint32} + set {_uniqueStorage()._optionalUint32 = newValue} + } + + var optionalUint64: UInt64 { + get {return _storage._optionalUint64} + set {_uniqueStorage()._optionalUint64 = newValue} + } + + var optionalSint32: Int32 { + get {return _storage._optionalSint32} + set {_uniqueStorage()._optionalSint32 = newValue} + } + + var optionalSint64: Int64 { + get {return _storage._optionalSint64} + set {_uniqueStorage()._optionalSint64 = newValue} + } + + var optionalFixed32: UInt32 { + get {return _storage._optionalFixed32} + set {_uniqueStorage()._optionalFixed32 = newValue} + } + + var optionalFixed64: UInt64 { + get {return _storage._optionalFixed64} + set {_uniqueStorage()._optionalFixed64 = newValue} + } + + var optionalSfixed32: Int32 { + get {return _storage._optionalSfixed32} + set {_uniqueStorage()._optionalSfixed32 = newValue} + } + + var optionalSfixed64: Int64 { + get {return _storage._optionalSfixed64} + set {_uniqueStorage()._optionalSfixed64 = newValue} + } + + var optionalFloat: Float { + get {return _storage._optionalFloat} + set {_uniqueStorage()._optionalFloat = newValue} + } + + var optionalDouble: Double { + get {return _storage._optionalDouble} + set {_uniqueStorage()._optionalDouble = newValue} + } + + var optionalBool: Bool { + get {return _storage._optionalBool} + set {_uniqueStorage()._optionalBool = newValue} + } + + var optionalString: String { + get {return _storage._optionalString} + set {_uniqueStorage()._optionalString = newValue} + } + + var optionalBytes: Data { + get {return _storage._optionalBytes} + set {_uniqueStorage()._optionalBytes = newValue} + } + + var optionalNestedMessage: Proto3Unittest_TestAllTypes.NestedMessage { + get {return _storage._optionalNestedMessage ?? Proto3Unittest_TestAllTypes.NestedMessage()} + set {_uniqueStorage()._optionalNestedMessage = newValue} + } + /// Returns true if `optionalNestedMessage` has been explicitly set. + var hasOptionalNestedMessage: Bool {return _storage._optionalNestedMessage != nil} + /// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedMessage() {_uniqueStorage()._optionalNestedMessage = nil} + + var optionalForeignMessage: Proto3Unittest_ForeignMessage { + get {return _storage._optionalForeignMessage ?? Proto3Unittest_ForeignMessage()} + set {_uniqueStorage()._optionalForeignMessage = newValue} + } + /// Returns true if `optionalForeignMessage` has been explicitly set. + var hasOptionalForeignMessage: Bool {return _storage._optionalForeignMessage != nil} + /// Clears the value of `optionalForeignMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalForeignMessage() {_uniqueStorage()._optionalForeignMessage = nil} + + var optionalImportMessage: ProtobufUnittestImport_ImportMessage { + get {return _storage._optionalImportMessage ?? ProtobufUnittestImport_ImportMessage()} + set {_uniqueStorage()._optionalImportMessage = newValue} + } + /// Returns true if `optionalImportMessage` has been explicitly set. + var hasOptionalImportMessage: Bool {return _storage._optionalImportMessage != nil} + /// Clears the value of `optionalImportMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalImportMessage() {_uniqueStorage()._optionalImportMessage = nil} + + var optionalNestedEnum: Proto3Unittest_TestAllTypes.NestedEnum { + get {return _storage._optionalNestedEnum} + set {_uniqueStorage()._optionalNestedEnum = newValue} + } + + var optionalForeignEnum: Proto3Unittest_ForeignEnum { + get {return _storage._optionalForeignEnum} + set {_uniqueStorage()._optionalForeignEnum = newValue} + } + + var optionalStringPiece: String { + get {return _storage._optionalStringPiece} + set {_uniqueStorage()._optionalStringPiece = newValue} + } + + var optionalCord: String { + get {return _storage._optionalCord} + set {_uniqueStorage()._optionalCord = newValue} + } + + /// Defined in unittest_import_public.proto + var optionalPublicImportMessage: ProtobufUnittestImport_PublicImportMessage { + get {return _storage._optionalPublicImportMessage ?? ProtobufUnittestImport_PublicImportMessage()} + set {_uniqueStorage()._optionalPublicImportMessage = newValue} + } + /// Returns true if `optionalPublicImportMessage` has been explicitly set. + var hasOptionalPublicImportMessage: Bool {return _storage._optionalPublicImportMessage != nil} + /// Clears the value of `optionalPublicImportMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalPublicImportMessage() {_uniqueStorage()._optionalPublicImportMessage = nil} + + var optionalLazyMessage: Proto3Unittest_TestAllTypes.NestedMessage { + get {return _storage._optionalLazyMessage ?? Proto3Unittest_TestAllTypes.NestedMessage()} + set {_uniqueStorage()._optionalLazyMessage = newValue} + } + /// Returns true if `optionalLazyMessage` has been explicitly set. + var hasOptionalLazyMessage: Bool {return _storage._optionalLazyMessage != nil} + /// Clears the value of `optionalLazyMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalLazyMessage() {_uniqueStorage()._optionalLazyMessage = nil} + + var optionalUnverifiedLazyMessage: Proto3Unittest_TestAllTypes.NestedMessage { + get {return _storage._optionalUnverifiedLazyMessage ?? Proto3Unittest_TestAllTypes.NestedMessage()} + set {_uniqueStorage()._optionalUnverifiedLazyMessage = newValue} + } + /// Returns true if `optionalUnverifiedLazyMessage` has been explicitly set. + var hasOptionalUnverifiedLazyMessage: Bool {return _storage._optionalUnverifiedLazyMessage != nil} + /// Clears the value of `optionalUnverifiedLazyMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalUnverifiedLazyMessage() {_uniqueStorage()._optionalUnverifiedLazyMessage = nil} + + var optionalLazyImportMessage: ProtobufUnittestImport_ImportMessage { + get {return _storage._optionalLazyImportMessage ?? ProtobufUnittestImport_ImportMessage()} + set {_uniqueStorage()._optionalLazyImportMessage = newValue} + } + /// Returns true if `optionalLazyImportMessage` has been explicitly set. + var hasOptionalLazyImportMessage: Bool {return _storage._optionalLazyImportMessage != nil} + /// Clears the value of `optionalLazyImportMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalLazyImportMessage() {_uniqueStorage()._optionalLazyImportMessage = nil} + + /// Repeated + var repeatedInt32: [Int32] { + get {return _storage._repeatedInt32} + set {_uniqueStorage()._repeatedInt32 = newValue} + } + + var repeatedInt64: [Int64] { + get {return _storage._repeatedInt64} + set {_uniqueStorage()._repeatedInt64 = newValue} + } + + var repeatedUint32: [UInt32] { + get {return _storage._repeatedUint32} + set {_uniqueStorage()._repeatedUint32 = newValue} + } + + var repeatedUint64: [UInt64] { + get {return _storage._repeatedUint64} + set {_uniqueStorage()._repeatedUint64 = newValue} + } + + var repeatedSint32: [Int32] { + get {return _storage._repeatedSint32} + set {_uniqueStorage()._repeatedSint32 = newValue} + } + + var repeatedSint64: [Int64] { + get {return _storage._repeatedSint64} + set {_uniqueStorage()._repeatedSint64 = newValue} + } + + var repeatedFixed32: [UInt32] { + get {return _storage._repeatedFixed32} + set {_uniqueStorage()._repeatedFixed32 = newValue} + } + + var repeatedFixed64: [UInt64] { + get {return _storage._repeatedFixed64} + set {_uniqueStorage()._repeatedFixed64 = newValue} + } + + var repeatedSfixed32: [Int32] { + get {return _storage._repeatedSfixed32} + set {_uniqueStorage()._repeatedSfixed32 = newValue} + } + + var repeatedSfixed64: [Int64] { + get {return _storage._repeatedSfixed64} + set {_uniqueStorage()._repeatedSfixed64 = newValue} + } + + var repeatedFloat: [Float] { + get {return _storage._repeatedFloat} + set {_uniqueStorage()._repeatedFloat = newValue} + } + + var repeatedDouble: [Double] { + get {return _storage._repeatedDouble} + set {_uniqueStorage()._repeatedDouble = newValue} + } + + var repeatedBool: [Bool] { + get {return _storage._repeatedBool} + set {_uniqueStorage()._repeatedBool = newValue} + } + + var repeatedString: [String] { + get {return _storage._repeatedString} + set {_uniqueStorage()._repeatedString = newValue} + } + + var repeatedBytes: [Data] { + get {return _storage._repeatedBytes} + set {_uniqueStorage()._repeatedBytes = newValue} + } + + var repeatedNestedMessage: [Proto3Unittest_TestAllTypes.NestedMessage] { + get {return _storage._repeatedNestedMessage} + set {_uniqueStorage()._repeatedNestedMessage = newValue} + } + + var repeatedForeignMessage: [Proto3Unittest_ForeignMessage] { + get {return _storage._repeatedForeignMessage} + set {_uniqueStorage()._repeatedForeignMessage = newValue} + } + + var repeatedImportMessage: [ProtobufUnittestImport_ImportMessage] { + get {return _storage._repeatedImportMessage} + set {_uniqueStorage()._repeatedImportMessage = newValue} + } + + var repeatedNestedEnum: [Proto3Unittest_TestAllTypes.NestedEnum] { + get {return _storage._repeatedNestedEnum} + set {_uniqueStorage()._repeatedNestedEnum = newValue} + } + + var repeatedForeignEnum: [Proto3Unittest_ForeignEnum] { + get {return _storage._repeatedForeignEnum} + set {_uniqueStorage()._repeatedForeignEnum = newValue} + } + + var repeatedStringPiece: [String] { + get {return _storage._repeatedStringPiece} + set {_uniqueStorage()._repeatedStringPiece = newValue} + } + + var repeatedCord: [String] { + get {return _storage._repeatedCord} + set {_uniqueStorage()._repeatedCord = newValue} + } + + var repeatedLazyMessage: [Proto3Unittest_TestAllTypes.NestedMessage] { + get {return _storage._repeatedLazyMessage} + set {_uniqueStorage()._repeatedLazyMessage = newValue} + } + + var oneofField: OneOf_OneofField? { + get {return _storage._oneofField} + set {_uniqueStorage()._oneofField = newValue} + } + + var oneofUint32: UInt32 { + get { + if case .oneofUint32(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofUint32(newValue)} + } + + var oneofNestedMessage: Proto3Unittest_TestAllTypes.NestedMessage { + get { + if case .oneofNestedMessage(let v)? = _storage._oneofField {return v} + return Proto3Unittest_TestAllTypes.NestedMessage() + } + set {_uniqueStorage()._oneofField = .oneofNestedMessage(newValue)} + } + + var oneofString: String { + get { + if case .oneofString(let v)? = _storage._oneofField {return v} + return String() + } + set {_uniqueStorage()._oneofField = .oneofString(newValue)} + } + + var oneofBytes: Data { + get { + if case .oneofBytes(let v)? = _storage._oneofField {return v} + return Data() + } + set {_uniqueStorage()._oneofField = .oneofBytes(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_OneofField: Equatable { + case oneofUint32(UInt32) + case oneofNestedMessage(Proto3Unittest_TestAllTypes.NestedMessage) + case oneofString(String) + case oneofBytes(Data) + + } + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case zero // = 0 + case foo // = 1 + case bar // = 2 + case baz // = 3 + + /// Intentionally negative. + case neg // = -1 + case UNRECOGNIZED(Int) + + init() { + self = .zero + } + + init?(rawValue: Int) { + switch rawValue { + case -1: self = .neg + case 0: self = .zero + case 1: self = .foo + case 2: self = .bar + case 3: self = .baz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .neg: return -1 + case .zero: return 0 + case .foo: return 1 + case .bar: return 2 + case .baz: return 3 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Proto3Unittest_TestAllTypes.NestedEnum] = [ + .zero, + .foo, + .bar, + .baz, + .neg, + ] + + } + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The field name "b" fails to compile in proto1 because it conflicts with + /// a local variable named "b" in one of the generated methods. Doh. + /// This file needs to compile in proto1 to test backwards-compatibility. + var bb: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct Proto3Unittest_TestPackedTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var packedInt32: [Int32] = [] + + var packedInt64: [Int64] = [] + + var packedUint32: [UInt32] = [] + + var packedUint64: [UInt64] = [] + + var packedSint32: [Int32] = [] + + var packedSint64: [Int64] = [] + + var packedFixed32: [UInt32] = [] + + var packedFixed64: [UInt64] = [] + + var packedSfixed32: [Int32] = [] + + var packedSfixed64: [Int64] = [] + + var packedFloat: [Float] = [] + + var packedDouble: [Double] = [] + + var packedBool: [Bool] = [] + + var packedEnum: [Proto3Unittest_ForeignEnum] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Explicitly set packed to false +struct Proto3Unittest_TestUnpackedTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var repeatedInt32: [Int32] = [] + + var repeatedInt64: [Int64] = [] + + var repeatedUint32: [UInt32] = [] + + var repeatedUint64: [UInt64] = [] + + var repeatedSint32: [Int32] = [] + + var repeatedSint64: [Int64] = [] + + var repeatedFixed32: [UInt32] = [] + + var repeatedFixed64: [UInt64] = [] + + var repeatedSfixed32: [Int32] = [] + + var repeatedSfixed64: [Int64] = [] + + var repeatedFloat: [Float] = [] + + var repeatedDouble: [Double] = [] + + var repeatedBool: [Bool] = [] + + var repeatedNestedEnum: [Proto3Unittest_TestAllTypes.NestedEnum] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// This proto includes a recursively nested message. +struct Proto3Unittest_NestedTestAllTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var child: Proto3Unittest_NestedTestAllTypes { + get {return _storage._child ?? Proto3Unittest_NestedTestAllTypes()} + set {_uniqueStorage()._child = newValue} + } + /// Returns true if `child` has been explicitly set. + var hasChild: Bool {return _storage._child != nil} + /// Clears the value of `child`. Subsequent reads from it will return its default value. + mutating func clearChild() {_uniqueStorage()._child = nil} + + var payload: Proto3Unittest_TestAllTypes { + get {return _storage._payload ?? Proto3Unittest_TestAllTypes()} + set {_uniqueStorage()._payload = newValue} + } + /// Returns true if `payload` has been explicitly set. + var hasPayload: Bool {return _storage._payload != nil} + /// Clears the value of `payload`. Subsequent reads from it will return its default value. + mutating func clearPayload() {_uniqueStorage()._payload = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +/// Define these after TestAllTypes to make sure the compiler can handle +/// that. +struct Proto3Unittest_ForeignMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var c: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// TestEmptyMessage is used to test behavior of unknown fields. +struct Proto3Unittest_TestEmptyMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// TestMessageWithDummy is also used to test behavior of unknown fields. +struct Proto3Unittest_TestMessageWithDummy { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// This field is only here for triggering copy-on-write; it's not intended to + /// be serialized. + var dummy: Bool = false + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Same layout as TestOneof2 in unittest.proto to test unknown enum value +/// parsing behavior in oneof. +struct Proto3Unittest_TestOneof2 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var foo: Proto3Unittest_TestOneof2.OneOf_Foo? = nil + + var fooEnum: Proto3Unittest_TestOneof2.NestedEnum { + get { + if case .fooEnum(let v)? = foo {return v} + return .unknown + } + set {foo = .fooEnum(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_Foo: Equatable { + case fooEnum(Proto3Unittest_TestOneof2.NestedEnum) + + } + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + case foo // = 1 + case bar // = 2 + case baz // = 3 + case UNRECOGNIZED(Int) + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .foo + case 2: self = .bar + case 3: self = .baz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .foo: return 1 + case .bar: return 2 + case .baz: return 3 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Proto3Unittest_TestOneof2.NestedEnum] = [ + .unknown, + .foo, + .bar, + .baz, + ] + + } + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Proto3Unittest_TestAllTypes: @unchecked Sendable {} +extension Proto3Unittest_TestAllTypes.OneOf_OneofField: @unchecked Sendable {} +extension Proto3Unittest_TestAllTypes.NestedMessage: @unchecked Sendable {} +extension Proto3Unittest_TestPackedTypes: @unchecked Sendable {} +extension Proto3Unittest_TestUnpackedTypes: @unchecked Sendable {} +extension Proto3Unittest_NestedTestAllTypes: @unchecked Sendable {} +extension Proto3Unittest_ForeignMessage: @unchecked Sendable {} +extension Proto3Unittest_TestEmptyMessage: @unchecked Sendable {} +extension Proto3Unittest_TestMessageWithDummy: @unchecked Sendable {} +extension Proto3Unittest_TestOneof2: @unchecked Sendable {} +extension Proto3Unittest_TestOneof2.OneOf_Foo: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "proto3_unittest" + +extension Proto3Unittest_ForeignEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FOREIGN_ZERO"), + 4: .same(proto: "FOREIGN_FOO"), + 5: .same(proto: "FOREIGN_BAR"), + 6: .same(proto: "FOREIGN_BAZ"), + ] +} + +extension Proto3Unittest_TestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestAllTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_int32"), + 2: .standard(proto: "optional_int64"), + 3: .standard(proto: "optional_uint32"), + 4: .standard(proto: "optional_uint64"), + 5: .standard(proto: "optional_sint32"), + 6: .standard(proto: "optional_sint64"), + 7: .standard(proto: "optional_fixed32"), + 8: .standard(proto: "optional_fixed64"), + 9: .standard(proto: "optional_sfixed32"), + 10: .standard(proto: "optional_sfixed64"), + 11: .standard(proto: "optional_float"), + 12: .standard(proto: "optional_double"), + 13: .standard(proto: "optional_bool"), + 14: .standard(proto: "optional_string"), + 15: .standard(proto: "optional_bytes"), + 18: .standard(proto: "optional_nested_message"), + 19: .standard(proto: "optional_foreign_message"), + 20: .standard(proto: "optional_import_message"), + 21: .standard(proto: "optional_nested_enum"), + 22: .standard(proto: "optional_foreign_enum"), + 24: .standard(proto: "optional_string_piece"), + 25: .standard(proto: "optional_cord"), + 26: .standard(proto: "optional_public_import_message"), + 27: .standard(proto: "optional_lazy_message"), + 28: .standard(proto: "optional_unverified_lazy_message"), + 115: .standard(proto: "optional_lazy_import_message"), + 31: .standard(proto: "repeated_int32"), + 32: .standard(proto: "repeated_int64"), + 33: .standard(proto: "repeated_uint32"), + 34: .standard(proto: "repeated_uint64"), + 35: .standard(proto: "repeated_sint32"), + 36: .standard(proto: "repeated_sint64"), + 37: .standard(proto: "repeated_fixed32"), + 38: .standard(proto: "repeated_fixed64"), + 39: .standard(proto: "repeated_sfixed32"), + 40: .standard(proto: "repeated_sfixed64"), + 41: .standard(proto: "repeated_float"), + 42: .standard(proto: "repeated_double"), + 43: .standard(proto: "repeated_bool"), + 44: .standard(proto: "repeated_string"), + 45: .standard(proto: "repeated_bytes"), + 48: .standard(proto: "repeated_nested_message"), + 49: .standard(proto: "repeated_foreign_message"), + 50: .standard(proto: "repeated_import_message"), + 51: .standard(proto: "repeated_nested_enum"), + 52: .standard(proto: "repeated_foreign_enum"), + 54: .standard(proto: "repeated_string_piece"), + 55: .standard(proto: "repeated_cord"), + 57: .standard(proto: "repeated_lazy_message"), + 111: .standard(proto: "oneof_uint32"), + 112: .standard(proto: "oneof_nested_message"), + 113: .standard(proto: "oneof_string"), + 114: .standard(proto: "oneof_bytes"), + ] + + fileprivate class _StorageClass { + var _optionalInt32: Int32 = 0 + var _optionalInt64: Int64 = 0 + var _optionalUint32: UInt32 = 0 + var _optionalUint64: UInt64 = 0 + var _optionalSint32: Int32 = 0 + var _optionalSint64: Int64 = 0 + var _optionalFixed32: UInt32 = 0 + var _optionalFixed64: UInt64 = 0 + var _optionalSfixed32: Int32 = 0 + var _optionalSfixed64: Int64 = 0 + var _optionalFloat: Float = 0 + var _optionalDouble: Double = 0 + var _optionalBool: Bool = false + var _optionalString: String = String() + var _optionalBytes: Data = Data() + var _optionalNestedMessage: Proto3Unittest_TestAllTypes.NestedMessage? = nil + var _optionalForeignMessage: Proto3Unittest_ForeignMessage? = nil + var _optionalImportMessage: ProtobufUnittestImport_ImportMessage? = nil + var _optionalNestedEnum: Proto3Unittest_TestAllTypes.NestedEnum = .zero + var _optionalForeignEnum: Proto3Unittest_ForeignEnum = .foreignZero + var _optionalStringPiece: String = String() + var _optionalCord: String = String() + var _optionalPublicImportMessage: ProtobufUnittestImport_PublicImportMessage? = nil + var _optionalLazyMessage: Proto3Unittest_TestAllTypes.NestedMessage? = nil + var _optionalUnverifiedLazyMessage: Proto3Unittest_TestAllTypes.NestedMessage? = nil + var _optionalLazyImportMessage: ProtobufUnittestImport_ImportMessage? = nil + var _repeatedInt32: [Int32] = [] + var _repeatedInt64: [Int64] = [] + var _repeatedUint32: [UInt32] = [] + var _repeatedUint64: [UInt64] = [] + var _repeatedSint32: [Int32] = [] + var _repeatedSint64: [Int64] = [] + var _repeatedFixed32: [UInt32] = [] + var _repeatedFixed64: [UInt64] = [] + var _repeatedSfixed32: [Int32] = [] + var _repeatedSfixed64: [Int64] = [] + var _repeatedFloat: [Float] = [] + var _repeatedDouble: [Double] = [] + var _repeatedBool: [Bool] = [] + var _repeatedString: [String] = [] + var _repeatedBytes: [Data] = [] + var _repeatedNestedMessage: [Proto3Unittest_TestAllTypes.NestedMessage] = [] + var _repeatedForeignMessage: [Proto3Unittest_ForeignMessage] = [] + var _repeatedImportMessage: [ProtobufUnittestImport_ImportMessage] = [] + var _repeatedNestedEnum: [Proto3Unittest_TestAllTypes.NestedEnum] = [] + var _repeatedForeignEnum: [Proto3Unittest_ForeignEnum] = [] + var _repeatedStringPiece: [String] = [] + var _repeatedCord: [String] = [] + var _repeatedLazyMessage: [Proto3Unittest_TestAllTypes.NestedMessage] = [] + var _oneofField: Proto3Unittest_TestAllTypes.OneOf_OneofField? + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _optionalInt32 = source._optionalInt32 + _optionalInt64 = source._optionalInt64 + _optionalUint32 = source._optionalUint32 + _optionalUint64 = source._optionalUint64 + _optionalSint32 = source._optionalSint32 + _optionalSint64 = source._optionalSint64 + _optionalFixed32 = source._optionalFixed32 + _optionalFixed64 = source._optionalFixed64 + _optionalSfixed32 = source._optionalSfixed32 + _optionalSfixed64 = source._optionalSfixed64 + _optionalFloat = source._optionalFloat + _optionalDouble = source._optionalDouble + _optionalBool = source._optionalBool + _optionalString = source._optionalString + _optionalBytes = source._optionalBytes + _optionalNestedMessage = source._optionalNestedMessage + _optionalForeignMessage = source._optionalForeignMessage + _optionalImportMessage = source._optionalImportMessage + _optionalNestedEnum = source._optionalNestedEnum + _optionalForeignEnum = source._optionalForeignEnum + _optionalStringPiece = source._optionalStringPiece + _optionalCord = source._optionalCord + _optionalPublicImportMessage = source._optionalPublicImportMessage + _optionalLazyMessage = source._optionalLazyMessage + _optionalUnverifiedLazyMessage = source._optionalUnverifiedLazyMessage + _optionalLazyImportMessage = source._optionalLazyImportMessage + _repeatedInt32 = source._repeatedInt32 + _repeatedInt64 = source._repeatedInt64 + _repeatedUint32 = source._repeatedUint32 + _repeatedUint64 = source._repeatedUint64 + _repeatedSint32 = source._repeatedSint32 + _repeatedSint64 = source._repeatedSint64 + _repeatedFixed32 = source._repeatedFixed32 + _repeatedFixed64 = source._repeatedFixed64 + _repeatedSfixed32 = source._repeatedSfixed32 + _repeatedSfixed64 = source._repeatedSfixed64 + _repeatedFloat = source._repeatedFloat + _repeatedDouble = source._repeatedDouble + _repeatedBool = source._repeatedBool + _repeatedString = source._repeatedString + _repeatedBytes = source._repeatedBytes + _repeatedNestedMessage = source._repeatedNestedMessage + _repeatedForeignMessage = source._repeatedForeignMessage + _repeatedImportMessage = source._repeatedImportMessage + _repeatedNestedEnum = source._repeatedNestedEnum + _repeatedForeignEnum = source._repeatedForeignEnum + _repeatedStringPiece = source._repeatedStringPiece + _repeatedCord = source._repeatedCord + _repeatedLazyMessage = source._repeatedLazyMessage + _oneofField = source._oneofField + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._optionalInt32) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._optionalInt64) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint32) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._optionalUint64) }() + case 5: try { try decoder.decodeSingularSInt32Field(value: &_storage._optionalSint32) }() + case 6: try { try decoder.decodeSingularSInt64Field(value: &_storage._optionalSint64) }() + case 7: try { try decoder.decodeSingularFixed32Field(value: &_storage._optionalFixed32) }() + case 8: try { try decoder.decodeSingularFixed64Field(value: &_storage._optionalFixed64) }() + case 9: try { try decoder.decodeSingularSFixed32Field(value: &_storage._optionalSfixed32) }() + case 10: try { try decoder.decodeSingularSFixed64Field(value: &_storage._optionalSfixed64) }() + case 11: try { try decoder.decodeSingularFloatField(value: &_storage._optionalFloat) }() + case 12: try { try decoder.decodeSingularDoubleField(value: &_storage._optionalDouble) }() + case 13: try { try decoder.decodeSingularBoolField(value: &_storage._optionalBool) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._optionalString) }() + case 15: try { try decoder.decodeSingularBytesField(value: &_storage._optionalBytes) }() + case 18: try { try decoder.decodeSingularMessageField(value: &_storage._optionalNestedMessage) }() + case 19: try { try decoder.decodeSingularMessageField(value: &_storage._optionalForeignMessage) }() + case 20: try { try decoder.decodeSingularMessageField(value: &_storage._optionalImportMessage) }() + case 21: try { try decoder.decodeSingularEnumField(value: &_storage._optionalNestedEnum) }() + case 22: try { try decoder.decodeSingularEnumField(value: &_storage._optionalForeignEnum) }() + case 24: try { try decoder.decodeSingularStringField(value: &_storage._optionalStringPiece) }() + case 25: try { try decoder.decodeSingularStringField(value: &_storage._optionalCord) }() + case 26: try { try decoder.decodeSingularMessageField(value: &_storage._optionalPublicImportMessage) }() + case 27: try { try decoder.decodeSingularMessageField(value: &_storage._optionalLazyMessage) }() + case 28: try { try decoder.decodeSingularMessageField(value: &_storage._optionalUnverifiedLazyMessage) }() + case 31: try { try decoder.decodeRepeatedInt32Field(value: &_storage._repeatedInt32) }() + case 32: try { try decoder.decodeRepeatedInt64Field(value: &_storage._repeatedInt64) }() + case 33: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._repeatedUint32) }() + case 34: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._repeatedUint64) }() + case 35: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._repeatedSint32) }() + case 36: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._repeatedSint64) }() + case 37: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._repeatedFixed32) }() + case 38: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._repeatedFixed64) }() + case 39: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._repeatedSfixed32) }() + case 40: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._repeatedSfixed64) }() + case 41: try { try decoder.decodeRepeatedFloatField(value: &_storage._repeatedFloat) }() + case 42: try { try decoder.decodeRepeatedDoubleField(value: &_storage._repeatedDouble) }() + case 43: try { try decoder.decodeRepeatedBoolField(value: &_storage._repeatedBool) }() + case 44: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedString) }() + case 45: try { try decoder.decodeRepeatedBytesField(value: &_storage._repeatedBytes) }() + case 48: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedNestedMessage) }() + case 49: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedForeignMessage) }() + case 50: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedImportMessage) }() + case 51: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedNestedEnum) }() + case 52: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedForeignEnum) }() + case 54: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedStringPiece) }() + case 55: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedCord) }() + case 57: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedLazyMessage) }() + case 111: try { + var v: UInt32? + try decoder.decodeSingularUInt32Field(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofUint32(v) + } + }() + case 112: try { + var v: Proto3Unittest_TestAllTypes.NestedMessage? + var hadOneofValue = false + if let current = _storage._oneofField { + hadOneofValue = true + if case .oneofNestedMessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofNestedMessage(v) + } + }() + case 113: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofString(v) + } + }() + case 114: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofBytes(v) + } + }() + case 115: try { try decoder.decodeSingularMessageField(value: &_storage._optionalLazyImportMessage) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if _storage._optionalInt32 != 0 { + try visitor.visitSingularInt32Field(value: _storage._optionalInt32, fieldNumber: 1) + } + if _storage._optionalInt64 != 0 { + try visitor.visitSingularInt64Field(value: _storage._optionalInt64, fieldNumber: 2) + } + if _storage._optionalUint32 != 0 { + try visitor.visitSingularUInt32Field(value: _storage._optionalUint32, fieldNumber: 3) + } + if _storage._optionalUint64 != 0 { + try visitor.visitSingularUInt64Field(value: _storage._optionalUint64, fieldNumber: 4) + } + if _storage._optionalSint32 != 0 { + try visitor.visitSingularSInt32Field(value: _storage._optionalSint32, fieldNumber: 5) + } + if _storage._optionalSint64 != 0 { + try visitor.visitSingularSInt64Field(value: _storage._optionalSint64, fieldNumber: 6) + } + if _storage._optionalFixed32 != 0 { + try visitor.visitSingularFixed32Field(value: _storage._optionalFixed32, fieldNumber: 7) + } + if _storage._optionalFixed64 != 0 { + try visitor.visitSingularFixed64Field(value: _storage._optionalFixed64, fieldNumber: 8) + } + if _storage._optionalSfixed32 != 0 { + try visitor.visitSingularSFixed32Field(value: _storage._optionalSfixed32, fieldNumber: 9) + } + if _storage._optionalSfixed64 != 0 { + try visitor.visitSingularSFixed64Field(value: _storage._optionalSfixed64, fieldNumber: 10) + } + if _storage._optionalFloat != 0 { + try visitor.visitSingularFloatField(value: _storage._optionalFloat, fieldNumber: 11) + } + if _storage._optionalDouble != 0 { + try visitor.visitSingularDoubleField(value: _storage._optionalDouble, fieldNumber: 12) + } + if _storage._optionalBool != false { + try visitor.visitSingularBoolField(value: _storage._optionalBool, fieldNumber: 13) + } + if !_storage._optionalString.isEmpty { + try visitor.visitSingularStringField(value: _storage._optionalString, fieldNumber: 14) + } + if !_storage._optionalBytes.isEmpty { + try visitor.visitSingularBytesField(value: _storage._optionalBytes, fieldNumber: 15) + } + try { if let v = _storage._optionalNestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._optionalForeignMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + } }() + try { if let v = _storage._optionalImportMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 20) + } }() + if _storage._optionalNestedEnum != .zero { + try visitor.visitSingularEnumField(value: _storage._optionalNestedEnum, fieldNumber: 21) + } + if _storage._optionalForeignEnum != .foreignZero { + try visitor.visitSingularEnumField(value: _storage._optionalForeignEnum, fieldNumber: 22) + } + if !_storage._optionalStringPiece.isEmpty { + try visitor.visitSingularStringField(value: _storage._optionalStringPiece, fieldNumber: 24) + } + if !_storage._optionalCord.isEmpty { + try visitor.visitSingularStringField(value: _storage._optionalCord, fieldNumber: 25) + } + try { if let v = _storage._optionalPublicImportMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 26) + } }() + try { if let v = _storage._optionalLazyMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 27) + } }() + try { if let v = _storage._optionalUnverifiedLazyMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 28) + } }() + if !_storage._repeatedInt32.isEmpty { + try visitor.visitPackedInt32Field(value: _storage._repeatedInt32, fieldNumber: 31) + } + if !_storage._repeatedInt64.isEmpty { + try visitor.visitPackedInt64Field(value: _storage._repeatedInt64, fieldNumber: 32) + } + if !_storage._repeatedUint32.isEmpty { + try visitor.visitPackedUInt32Field(value: _storage._repeatedUint32, fieldNumber: 33) + } + if !_storage._repeatedUint64.isEmpty { + try visitor.visitPackedUInt64Field(value: _storage._repeatedUint64, fieldNumber: 34) + } + if !_storage._repeatedSint32.isEmpty { + try visitor.visitPackedSInt32Field(value: _storage._repeatedSint32, fieldNumber: 35) + } + if !_storage._repeatedSint64.isEmpty { + try visitor.visitPackedSInt64Field(value: _storage._repeatedSint64, fieldNumber: 36) + } + if !_storage._repeatedFixed32.isEmpty { + try visitor.visitPackedFixed32Field(value: _storage._repeatedFixed32, fieldNumber: 37) + } + if !_storage._repeatedFixed64.isEmpty { + try visitor.visitPackedFixed64Field(value: _storage._repeatedFixed64, fieldNumber: 38) + } + if !_storage._repeatedSfixed32.isEmpty { + try visitor.visitPackedSFixed32Field(value: _storage._repeatedSfixed32, fieldNumber: 39) + } + if !_storage._repeatedSfixed64.isEmpty { + try visitor.visitPackedSFixed64Field(value: _storage._repeatedSfixed64, fieldNumber: 40) + } + if !_storage._repeatedFloat.isEmpty { + try visitor.visitPackedFloatField(value: _storage._repeatedFloat, fieldNumber: 41) + } + if !_storage._repeatedDouble.isEmpty { + try visitor.visitPackedDoubleField(value: _storage._repeatedDouble, fieldNumber: 42) + } + if !_storage._repeatedBool.isEmpty { + try visitor.visitPackedBoolField(value: _storage._repeatedBool, fieldNumber: 43) + } + if !_storage._repeatedString.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedString, fieldNumber: 44) + } + if !_storage._repeatedBytes.isEmpty { + try visitor.visitRepeatedBytesField(value: _storage._repeatedBytes, fieldNumber: 45) + } + if !_storage._repeatedNestedMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedNestedMessage, fieldNumber: 48) + } + if !_storage._repeatedForeignMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedForeignMessage, fieldNumber: 49) + } + if !_storage._repeatedImportMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedImportMessage, fieldNumber: 50) + } + if !_storage._repeatedNestedEnum.isEmpty { + try visitor.visitPackedEnumField(value: _storage._repeatedNestedEnum, fieldNumber: 51) + } + if !_storage._repeatedForeignEnum.isEmpty { + try visitor.visitPackedEnumField(value: _storage._repeatedForeignEnum, fieldNumber: 52) + } + if !_storage._repeatedStringPiece.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedStringPiece, fieldNumber: 54) + } + if !_storage._repeatedCord.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedCord, fieldNumber: 55) + } + if !_storage._repeatedLazyMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedLazyMessage, fieldNumber: 57) + } + switch _storage._oneofField { + case .oneofUint32?: try { + guard case .oneofUint32(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 111) + }() + case .oneofNestedMessage?: try { + guard case .oneofNestedMessage(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 112) + }() + case .oneofString?: try { + guard case .oneofString(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 113) + }() + case .oneofBytes?: try { + guard case .oneofBytes(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 114) + }() + case nil: break + } + try { if let v = _storage._optionalLazyImportMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 115) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3Unittest_TestAllTypes, rhs: Proto3Unittest_TestAllTypes) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._optionalInt32 != rhs_storage._optionalInt32 {return false} + if _storage._optionalInt64 != rhs_storage._optionalInt64 {return false} + if _storage._optionalUint32 != rhs_storage._optionalUint32 {return false} + if _storage._optionalUint64 != rhs_storage._optionalUint64 {return false} + if _storage._optionalSint32 != rhs_storage._optionalSint32 {return false} + if _storage._optionalSint64 != rhs_storage._optionalSint64 {return false} + if _storage._optionalFixed32 != rhs_storage._optionalFixed32 {return false} + if _storage._optionalFixed64 != rhs_storage._optionalFixed64 {return false} + if _storage._optionalSfixed32 != rhs_storage._optionalSfixed32 {return false} + if _storage._optionalSfixed64 != rhs_storage._optionalSfixed64 {return false} + if _storage._optionalFloat != rhs_storage._optionalFloat {return false} + if _storage._optionalDouble != rhs_storage._optionalDouble {return false} + if _storage._optionalBool != rhs_storage._optionalBool {return false} + if _storage._optionalString != rhs_storage._optionalString {return false} + if _storage._optionalBytes != rhs_storage._optionalBytes {return false} + if _storage._optionalNestedMessage != rhs_storage._optionalNestedMessage {return false} + if _storage._optionalForeignMessage != rhs_storage._optionalForeignMessage {return false} + if _storage._optionalImportMessage != rhs_storage._optionalImportMessage {return false} + if _storage._optionalNestedEnum != rhs_storage._optionalNestedEnum {return false} + if _storage._optionalForeignEnum != rhs_storage._optionalForeignEnum {return false} + if _storage._optionalStringPiece != rhs_storage._optionalStringPiece {return false} + if _storage._optionalCord != rhs_storage._optionalCord {return false} + if _storage._optionalPublicImportMessage != rhs_storage._optionalPublicImportMessage {return false} + if _storage._optionalLazyMessage != rhs_storage._optionalLazyMessage {return false} + if _storage._optionalUnverifiedLazyMessage != rhs_storage._optionalUnverifiedLazyMessage {return false} + if _storage._optionalLazyImportMessage != rhs_storage._optionalLazyImportMessage {return false} + if _storage._repeatedInt32 != rhs_storage._repeatedInt32 {return false} + if _storage._repeatedInt64 != rhs_storage._repeatedInt64 {return false} + if _storage._repeatedUint32 != rhs_storage._repeatedUint32 {return false} + if _storage._repeatedUint64 != rhs_storage._repeatedUint64 {return false} + if _storage._repeatedSint32 != rhs_storage._repeatedSint32 {return false} + if _storage._repeatedSint64 != rhs_storage._repeatedSint64 {return false} + if _storage._repeatedFixed32 != rhs_storage._repeatedFixed32 {return false} + if _storage._repeatedFixed64 != rhs_storage._repeatedFixed64 {return false} + if _storage._repeatedSfixed32 != rhs_storage._repeatedSfixed32 {return false} + if _storage._repeatedSfixed64 != rhs_storage._repeatedSfixed64 {return false} + if _storage._repeatedFloat != rhs_storage._repeatedFloat {return false} + if _storage._repeatedDouble != rhs_storage._repeatedDouble {return false} + if _storage._repeatedBool != rhs_storage._repeatedBool {return false} + if _storage._repeatedString != rhs_storage._repeatedString {return false} + if _storage._repeatedBytes != rhs_storage._repeatedBytes {return false} + if _storage._repeatedNestedMessage != rhs_storage._repeatedNestedMessage {return false} + if _storage._repeatedForeignMessage != rhs_storage._repeatedForeignMessage {return false} + if _storage._repeatedImportMessage != rhs_storage._repeatedImportMessage {return false} + if _storage._repeatedNestedEnum != rhs_storage._repeatedNestedEnum {return false} + if _storage._repeatedForeignEnum != rhs_storage._repeatedForeignEnum {return false} + if _storage._repeatedStringPiece != rhs_storage._repeatedStringPiece {return false} + if _storage._repeatedCord != rhs_storage._repeatedCord {return false} + if _storage._repeatedLazyMessage != rhs_storage._repeatedLazyMessage {return false} + if _storage._oneofField != rhs_storage._oneofField {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3Unittest_TestAllTypes.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + -1: .same(proto: "NEG"), + 0: .same(proto: "ZERO"), + 1: .same(proto: "FOO"), + 2: .same(proto: "BAR"), + 3: .same(proto: "BAZ"), + ] +} + +extension Proto3Unittest_TestAllTypes.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Proto3Unittest_TestAllTypes.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "bb"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.bb) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.bb != 0 { + try visitor.visitSingularInt32Field(value: self.bb, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3Unittest_TestAllTypes.NestedMessage, rhs: Proto3Unittest_TestAllTypes.NestedMessage) -> Bool { + if lhs.bb != rhs.bb {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3Unittest_TestPackedTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestPackedTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 90: .standard(proto: "packed_int32"), + 91: .standard(proto: "packed_int64"), + 92: .standard(proto: "packed_uint32"), + 93: .standard(proto: "packed_uint64"), + 94: .standard(proto: "packed_sint32"), + 95: .standard(proto: "packed_sint64"), + 96: .standard(proto: "packed_fixed32"), + 97: .standard(proto: "packed_fixed64"), + 98: .standard(proto: "packed_sfixed32"), + 99: .standard(proto: "packed_sfixed64"), + 100: .standard(proto: "packed_float"), + 101: .standard(proto: "packed_double"), + 102: .standard(proto: "packed_bool"), + 103: .standard(proto: "packed_enum"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 90: try { try decoder.decodeRepeatedInt32Field(value: &self.packedInt32) }() + case 91: try { try decoder.decodeRepeatedInt64Field(value: &self.packedInt64) }() + case 92: try { try decoder.decodeRepeatedUInt32Field(value: &self.packedUint32) }() + case 93: try { try decoder.decodeRepeatedUInt64Field(value: &self.packedUint64) }() + case 94: try { try decoder.decodeRepeatedSInt32Field(value: &self.packedSint32) }() + case 95: try { try decoder.decodeRepeatedSInt64Field(value: &self.packedSint64) }() + case 96: try { try decoder.decodeRepeatedFixed32Field(value: &self.packedFixed32) }() + case 97: try { try decoder.decodeRepeatedFixed64Field(value: &self.packedFixed64) }() + case 98: try { try decoder.decodeRepeatedSFixed32Field(value: &self.packedSfixed32) }() + case 99: try { try decoder.decodeRepeatedSFixed64Field(value: &self.packedSfixed64) }() + case 100: try { try decoder.decodeRepeatedFloatField(value: &self.packedFloat) }() + case 101: try { try decoder.decodeRepeatedDoubleField(value: &self.packedDouble) }() + case 102: try { try decoder.decodeRepeatedBoolField(value: &self.packedBool) }() + case 103: try { try decoder.decodeRepeatedEnumField(value: &self.packedEnum) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.packedInt32.isEmpty { + try visitor.visitPackedInt32Field(value: self.packedInt32, fieldNumber: 90) + } + if !self.packedInt64.isEmpty { + try visitor.visitPackedInt64Field(value: self.packedInt64, fieldNumber: 91) + } + if !self.packedUint32.isEmpty { + try visitor.visitPackedUInt32Field(value: self.packedUint32, fieldNumber: 92) + } + if !self.packedUint64.isEmpty { + try visitor.visitPackedUInt64Field(value: self.packedUint64, fieldNumber: 93) + } + if !self.packedSint32.isEmpty { + try visitor.visitPackedSInt32Field(value: self.packedSint32, fieldNumber: 94) + } + if !self.packedSint64.isEmpty { + try visitor.visitPackedSInt64Field(value: self.packedSint64, fieldNumber: 95) + } + if !self.packedFixed32.isEmpty { + try visitor.visitPackedFixed32Field(value: self.packedFixed32, fieldNumber: 96) + } + if !self.packedFixed64.isEmpty { + try visitor.visitPackedFixed64Field(value: self.packedFixed64, fieldNumber: 97) + } + if !self.packedSfixed32.isEmpty { + try visitor.visitPackedSFixed32Field(value: self.packedSfixed32, fieldNumber: 98) + } + if !self.packedSfixed64.isEmpty { + try visitor.visitPackedSFixed64Field(value: self.packedSfixed64, fieldNumber: 99) + } + if !self.packedFloat.isEmpty { + try visitor.visitPackedFloatField(value: self.packedFloat, fieldNumber: 100) + } + if !self.packedDouble.isEmpty { + try visitor.visitPackedDoubleField(value: self.packedDouble, fieldNumber: 101) + } + if !self.packedBool.isEmpty { + try visitor.visitPackedBoolField(value: self.packedBool, fieldNumber: 102) + } + if !self.packedEnum.isEmpty { + try visitor.visitPackedEnumField(value: self.packedEnum, fieldNumber: 103) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3Unittest_TestPackedTypes, rhs: Proto3Unittest_TestPackedTypes) -> Bool { + if lhs.packedInt32 != rhs.packedInt32 {return false} + if lhs.packedInt64 != rhs.packedInt64 {return false} + if lhs.packedUint32 != rhs.packedUint32 {return false} + if lhs.packedUint64 != rhs.packedUint64 {return false} + if lhs.packedSint32 != rhs.packedSint32 {return false} + if lhs.packedSint64 != rhs.packedSint64 {return false} + if lhs.packedFixed32 != rhs.packedFixed32 {return false} + if lhs.packedFixed64 != rhs.packedFixed64 {return false} + if lhs.packedSfixed32 != rhs.packedSfixed32 {return false} + if lhs.packedSfixed64 != rhs.packedSfixed64 {return false} + if lhs.packedFloat != rhs.packedFloat {return false} + if lhs.packedDouble != rhs.packedDouble {return false} + if lhs.packedBool != rhs.packedBool {return false} + if lhs.packedEnum != rhs.packedEnum {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3Unittest_TestUnpackedTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestUnpackedTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "repeated_int32"), + 2: .standard(proto: "repeated_int64"), + 3: .standard(proto: "repeated_uint32"), + 4: .standard(proto: "repeated_uint64"), + 5: .standard(proto: "repeated_sint32"), + 6: .standard(proto: "repeated_sint64"), + 7: .standard(proto: "repeated_fixed32"), + 8: .standard(proto: "repeated_fixed64"), + 9: .standard(proto: "repeated_sfixed32"), + 10: .standard(proto: "repeated_sfixed64"), + 11: .standard(proto: "repeated_float"), + 12: .standard(proto: "repeated_double"), + 13: .standard(proto: "repeated_bool"), + 14: .standard(proto: "repeated_nested_enum"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedInt32Field(value: &self.repeatedInt32) }() + case 2: try { try decoder.decodeRepeatedInt64Field(value: &self.repeatedInt64) }() + case 3: try { try decoder.decodeRepeatedUInt32Field(value: &self.repeatedUint32) }() + case 4: try { try decoder.decodeRepeatedUInt64Field(value: &self.repeatedUint64) }() + case 5: try { try decoder.decodeRepeatedSInt32Field(value: &self.repeatedSint32) }() + case 6: try { try decoder.decodeRepeatedSInt64Field(value: &self.repeatedSint64) }() + case 7: try { try decoder.decodeRepeatedFixed32Field(value: &self.repeatedFixed32) }() + case 8: try { try decoder.decodeRepeatedFixed64Field(value: &self.repeatedFixed64) }() + case 9: try { try decoder.decodeRepeatedSFixed32Field(value: &self.repeatedSfixed32) }() + case 10: try { try decoder.decodeRepeatedSFixed64Field(value: &self.repeatedSfixed64) }() + case 11: try { try decoder.decodeRepeatedFloatField(value: &self.repeatedFloat) }() + case 12: try { try decoder.decodeRepeatedDoubleField(value: &self.repeatedDouble) }() + case 13: try { try decoder.decodeRepeatedBoolField(value: &self.repeatedBool) }() + case 14: try { try decoder.decodeRepeatedEnumField(value: &self.repeatedNestedEnum) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.repeatedInt32.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.repeatedInt32, fieldNumber: 1) + } + if !self.repeatedInt64.isEmpty { + try visitor.visitRepeatedInt64Field(value: self.repeatedInt64, fieldNumber: 2) + } + if !self.repeatedUint32.isEmpty { + try visitor.visitRepeatedUInt32Field(value: self.repeatedUint32, fieldNumber: 3) + } + if !self.repeatedUint64.isEmpty { + try visitor.visitRepeatedUInt64Field(value: self.repeatedUint64, fieldNumber: 4) + } + if !self.repeatedSint32.isEmpty { + try visitor.visitRepeatedSInt32Field(value: self.repeatedSint32, fieldNumber: 5) + } + if !self.repeatedSint64.isEmpty { + try visitor.visitRepeatedSInt64Field(value: self.repeatedSint64, fieldNumber: 6) + } + if !self.repeatedFixed32.isEmpty { + try visitor.visitRepeatedFixed32Field(value: self.repeatedFixed32, fieldNumber: 7) + } + if !self.repeatedFixed64.isEmpty { + try visitor.visitRepeatedFixed64Field(value: self.repeatedFixed64, fieldNumber: 8) + } + if !self.repeatedSfixed32.isEmpty { + try visitor.visitRepeatedSFixed32Field(value: self.repeatedSfixed32, fieldNumber: 9) + } + if !self.repeatedSfixed64.isEmpty { + try visitor.visitRepeatedSFixed64Field(value: self.repeatedSfixed64, fieldNumber: 10) + } + if !self.repeatedFloat.isEmpty { + try visitor.visitRepeatedFloatField(value: self.repeatedFloat, fieldNumber: 11) + } + if !self.repeatedDouble.isEmpty { + try visitor.visitRepeatedDoubleField(value: self.repeatedDouble, fieldNumber: 12) + } + if !self.repeatedBool.isEmpty { + try visitor.visitRepeatedBoolField(value: self.repeatedBool, fieldNumber: 13) + } + if !self.repeatedNestedEnum.isEmpty { + try visitor.visitRepeatedEnumField(value: self.repeatedNestedEnum, fieldNumber: 14) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3Unittest_TestUnpackedTypes, rhs: Proto3Unittest_TestUnpackedTypes) -> Bool { + if lhs.repeatedInt32 != rhs.repeatedInt32 {return false} + if lhs.repeatedInt64 != rhs.repeatedInt64 {return false} + if lhs.repeatedUint32 != rhs.repeatedUint32 {return false} + if lhs.repeatedUint64 != rhs.repeatedUint64 {return false} + if lhs.repeatedSint32 != rhs.repeatedSint32 {return false} + if lhs.repeatedSint64 != rhs.repeatedSint64 {return false} + if lhs.repeatedFixed32 != rhs.repeatedFixed32 {return false} + if lhs.repeatedFixed64 != rhs.repeatedFixed64 {return false} + if lhs.repeatedSfixed32 != rhs.repeatedSfixed32 {return false} + if lhs.repeatedSfixed64 != rhs.repeatedSfixed64 {return false} + if lhs.repeatedFloat != rhs.repeatedFloat {return false} + if lhs.repeatedDouble != rhs.repeatedDouble {return false} + if lhs.repeatedBool != rhs.repeatedBool {return false} + if lhs.repeatedNestedEnum != rhs.repeatedNestedEnum {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3Unittest_NestedTestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".NestedTestAllTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "child"), + 2: .same(proto: "payload"), + ] + + fileprivate class _StorageClass { + var _child: Proto3Unittest_NestedTestAllTypes? = nil + var _payload: Proto3Unittest_TestAllTypes? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _child = source._child + _payload = source._payload + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._child) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._payload) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._child { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._payload { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3Unittest_NestedTestAllTypes, rhs: Proto3Unittest_NestedTestAllTypes) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._child != rhs_storage._child {return false} + if _storage._payload != rhs_storage._payload {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3Unittest_ForeignMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ForeignMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "c"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.c) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.c != 0 { + try visitor.visitSingularInt32Field(value: self.c, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3Unittest_ForeignMessage, rhs: Proto3Unittest_ForeignMessage) -> Bool { + if lhs.c != rhs.c {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3Unittest_TestEmptyMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestEmptyMessage" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3Unittest_TestEmptyMessage, rhs: Proto3Unittest_TestEmptyMessage) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3Unittest_TestMessageWithDummy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestMessageWithDummy" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 536870911: .same(proto: "dummy"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 536870911: try { try decoder.decodeSingularBoolField(value: &self.dummy) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.dummy != false { + try visitor.visitSingularBoolField(value: self.dummy, fieldNumber: 536870911) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3Unittest_TestMessageWithDummy, rhs: Proto3Unittest_TestMessageWithDummy) -> Bool { + if lhs.dummy != rhs.dummy {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3Unittest_TestOneof2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestOneof2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 6: .standard(proto: "foo_enum"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 6: try { + var v: Proto3Unittest_TestOneof2.NestedEnum? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if self.foo != nil {try decoder.handleConflictingOneOf()} + self.foo = .fooEnum(v) + } + }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if case .fooEnum(let v)? = self.foo { + try visitor.visitSingularEnumField(value: v, fieldNumber: 6) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3Unittest_TestOneof2, rhs: Proto3Unittest_TestOneof2) -> Bool { + if lhs.foo != rhs.foo {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3Unittest_TestOneof2.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN"), + 1: .same(proto: "FOO"), + 2: .same(proto: "BAR"), + 3: .same(proto: "BAZ"), + ] +} diff --git a/Reference/SwiftProtobufTests/unittest_proto3_arena.pb.swift b/Reference/SwiftProtobufTests/unittest_proto3_arena.pb.swift new file mode 100644 index 000000000..7fd0719ac --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_proto3_arena.pb.swift @@ -0,0 +1,1959 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_proto3_arena.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum Proto3ArenaUnittest_ForeignEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foreignZero // = 0 + case foreignFoo // = 4 + case foreignBar // = 5 + case foreignBaz // = 6 + case UNRECOGNIZED(Int) + + init() { + self = .foreignZero + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .foreignZero + case 4: self = .foreignFoo + case 5: self = .foreignBar + case 6: self = .foreignBaz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .foreignZero: return 0 + case .foreignFoo: return 4 + case .foreignBar: return 5 + case .foreignBaz: return 6 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Proto3ArenaUnittest_ForeignEnum] = [ + .foreignZero, + .foreignFoo, + .foreignBar, + .foreignBaz, + ] + +} + +/// This proto includes every type of field in both singular and repeated +/// forms. +struct Proto3ArenaUnittest_TestAllTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Singular + var optionalInt32: Int32 { + get {return _storage._optionalInt32} + set {_uniqueStorage()._optionalInt32 = newValue} + } + + var optionalInt64: Int64 { + get {return _storage._optionalInt64} + set {_uniqueStorage()._optionalInt64 = newValue} + } + + var optionalUint32: UInt32 { + get {return _storage._optionalUint32} + set {_uniqueStorage()._optionalUint32 = newValue} + } + + var optionalUint64: UInt64 { + get {return _storage._optionalUint64} + set {_uniqueStorage()._optionalUint64 = newValue} + } + + var optionalSint32: Int32 { + get {return _storage._optionalSint32} + set {_uniqueStorage()._optionalSint32 = newValue} + } + + var optionalSint64: Int64 { + get {return _storage._optionalSint64} + set {_uniqueStorage()._optionalSint64 = newValue} + } + + var optionalFixed32: UInt32 { + get {return _storage._optionalFixed32} + set {_uniqueStorage()._optionalFixed32 = newValue} + } + + var optionalFixed64: UInt64 { + get {return _storage._optionalFixed64} + set {_uniqueStorage()._optionalFixed64 = newValue} + } + + var optionalSfixed32: Int32 { + get {return _storage._optionalSfixed32} + set {_uniqueStorage()._optionalSfixed32 = newValue} + } + + var optionalSfixed64: Int64 { + get {return _storage._optionalSfixed64} + set {_uniqueStorage()._optionalSfixed64 = newValue} + } + + var optionalFloat: Float { + get {return _storage._optionalFloat} + set {_uniqueStorage()._optionalFloat = newValue} + } + + var optionalDouble: Double { + get {return _storage._optionalDouble} + set {_uniqueStorage()._optionalDouble = newValue} + } + + var optionalBool: Bool { + get {return _storage._optionalBool} + set {_uniqueStorage()._optionalBool = newValue} + } + + var optionalString: String { + get {return _storage._optionalString} + set {_uniqueStorage()._optionalString = newValue} + } + + var optionalBytes: Data { + get {return _storage._optionalBytes} + set {_uniqueStorage()._optionalBytes = newValue} + } + + var optionalNestedMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage { + get {return _storage._optionalNestedMessage ?? Proto3ArenaUnittest_TestAllTypes.NestedMessage()} + set {_uniqueStorage()._optionalNestedMessage = newValue} + } + /// Returns true if `optionalNestedMessage` has been explicitly set. + var hasOptionalNestedMessage: Bool {return _storage._optionalNestedMessage != nil} + /// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedMessage() {_uniqueStorage()._optionalNestedMessage = nil} + + var optionalForeignMessage: Proto3ArenaUnittest_ForeignMessage { + get {return _storage._optionalForeignMessage ?? Proto3ArenaUnittest_ForeignMessage()} + set {_uniqueStorage()._optionalForeignMessage = newValue} + } + /// Returns true if `optionalForeignMessage` has been explicitly set. + var hasOptionalForeignMessage: Bool {return _storage._optionalForeignMessage != nil} + /// Clears the value of `optionalForeignMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalForeignMessage() {_uniqueStorage()._optionalForeignMessage = nil} + + var optionalImportMessage: ProtobufUnittestImport_ImportMessage { + get {return _storage._optionalImportMessage ?? ProtobufUnittestImport_ImportMessage()} + set {_uniqueStorage()._optionalImportMessage = newValue} + } + /// Returns true if `optionalImportMessage` has been explicitly set. + var hasOptionalImportMessage: Bool {return _storage._optionalImportMessage != nil} + /// Clears the value of `optionalImportMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalImportMessage() {_uniqueStorage()._optionalImportMessage = nil} + + var optionalNestedEnum: Proto3ArenaUnittest_TestAllTypes.NestedEnum { + get {return _storage._optionalNestedEnum} + set {_uniqueStorage()._optionalNestedEnum = newValue} + } + + var optionalForeignEnum: Proto3ArenaUnittest_ForeignEnum { + get {return _storage._optionalForeignEnum} + set {_uniqueStorage()._optionalForeignEnum = newValue} + } + + var optionalStringPiece: String { + get {return _storage._optionalStringPiece} + set {_uniqueStorage()._optionalStringPiece = newValue} + } + + var optionalCord: String { + get {return _storage._optionalCord} + set {_uniqueStorage()._optionalCord = newValue} + } + + /// Defined in unittest_import_public.proto + var optionalPublicImportMessage: ProtobufUnittestImport_PublicImportMessage { + get {return _storage._optionalPublicImportMessage ?? ProtobufUnittestImport_PublicImportMessage()} + set {_uniqueStorage()._optionalPublicImportMessage = newValue} + } + /// Returns true if `optionalPublicImportMessage` has been explicitly set. + var hasOptionalPublicImportMessage: Bool {return _storage._optionalPublicImportMessage != nil} + /// Clears the value of `optionalPublicImportMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalPublicImportMessage() {_uniqueStorage()._optionalPublicImportMessage = nil} + + var optionalLazyMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage { + get {return _storage._optionalLazyMessage ?? Proto3ArenaUnittest_TestAllTypes.NestedMessage()} + set {_uniqueStorage()._optionalLazyMessage = newValue} + } + /// Returns true if `optionalLazyMessage` has been explicitly set. + var hasOptionalLazyMessage: Bool {return _storage._optionalLazyMessage != nil} + /// Clears the value of `optionalLazyMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalLazyMessage() {_uniqueStorage()._optionalLazyMessage = nil} + + var optionalUnverifiedLazyMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage { + get {return _storage._optionalUnverifiedLazyMessage ?? Proto3ArenaUnittest_TestAllTypes.NestedMessage()} + set {_uniqueStorage()._optionalUnverifiedLazyMessage = newValue} + } + /// Returns true if `optionalUnverifiedLazyMessage` has been explicitly set. + var hasOptionalUnverifiedLazyMessage: Bool {return _storage._optionalUnverifiedLazyMessage != nil} + /// Clears the value of `optionalUnverifiedLazyMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalUnverifiedLazyMessage() {_uniqueStorage()._optionalUnverifiedLazyMessage = nil} + + var optionalLazyImportMessage: ProtobufUnittestImport_ImportMessage { + get {return _storage._optionalLazyImportMessage ?? ProtobufUnittestImport_ImportMessage()} + set {_uniqueStorage()._optionalLazyImportMessage = newValue} + } + /// Returns true if `optionalLazyImportMessage` has been explicitly set. + var hasOptionalLazyImportMessage: Bool {return _storage._optionalLazyImportMessage != nil} + /// Clears the value of `optionalLazyImportMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalLazyImportMessage() {_uniqueStorage()._optionalLazyImportMessage = nil} + + /// Repeated + var repeatedInt32: [Int32] { + get {return _storage._repeatedInt32} + set {_uniqueStorage()._repeatedInt32 = newValue} + } + + var repeatedInt64: [Int64] { + get {return _storage._repeatedInt64} + set {_uniqueStorage()._repeatedInt64 = newValue} + } + + var repeatedUint32: [UInt32] { + get {return _storage._repeatedUint32} + set {_uniqueStorage()._repeatedUint32 = newValue} + } + + var repeatedUint64: [UInt64] { + get {return _storage._repeatedUint64} + set {_uniqueStorage()._repeatedUint64 = newValue} + } + + var repeatedSint32: [Int32] { + get {return _storage._repeatedSint32} + set {_uniqueStorage()._repeatedSint32 = newValue} + } + + var repeatedSint64: [Int64] { + get {return _storage._repeatedSint64} + set {_uniqueStorage()._repeatedSint64 = newValue} + } + + var repeatedFixed32: [UInt32] { + get {return _storage._repeatedFixed32} + set {_uniqueStorage()._repeatedFixed32 = newValue} + } + + var repeatedFixed64: [UInt64] { + get {return _storage._repeatedFixed64} + set {_uniqueStorage()._repeatedFixed64 = newValue} + } + + var repeatedSfixed32: [Int32] { + get {return _storage._repeatedSfixed32} + set {_uniqueStorage()._repeatedSfixed32 = newValue} + } + + var repeatedSfixed64: [Int64] { + get {return _storage._repeatedSfixed64} + set {_uniqueStorage()._repeatedSfixed64 = newValue} + } + + var repeatedFloat: [Float] { + get {return _storage._repeatedFloat} + set {_uniqueStorage()._repeatedFloat = newValue} + } + + var repeatedDouble: [Double] { + get {return _storage._repeatedDouble} + set {_uniqueStorage()._repeatedDouble = newValue} + } + + var repeatedBool: [Bool] { + get {return _storage._repeatedBool} + set {_uniqueStorage()._repeatedBool = newValue} + } + + var repeatedString: [String] { + get {return _storage._repeatedString} + set {_uniqueStorage()._repeatedString = newValue} + } + + var repeatedBytes: [Data] { + get {return _storage._repeatedBytes} + set {_uniqueStorage()._repeatedBytes = newValue} + } + + /// Optional + var proto3OptionalInt32: Int32 { + get {return _storage._proto3OptionalInt32 ?? 0} + set {_uniqueStorage()._proto3OptionalInt32 = newValue} + } + /// Returns true if `proto3OptionalInt32` has been explicitly set. + var hasProto3OptionalInt32: Bool {return _storage._proto3OptionalInt32 != nil} + /// Clears the value of `proto3OptionalInt32`. Subsequent reads from it will return its default value. + mutating func clearProto3OptionalInt32() {_uniqueStorage()._proto3OptionalInt32 = nil} + + var proto3OptionalInt64: Int64 { + get {return _storage._proto3OptionalInt64 ?? 0} + set {_uniqueStorage()._proto3OptionalInt64 = newValue} + } + /// Returns true if `proto3OptionalInt64` has been explicitly set. + var hasProto3OptionalInt64: Bool {return _storage._proto3OptionalInt64 != nil} + /// Clears the value of `proto3OptionalInt64`. Subsequent reads from it will return its default value. + mutating func clearProto3OptionalInt64() {_uniqueStorage()._proto3OptionalInt64 = nil} + + var proto3OptionalUint32: UInt32 { + get {return _storage._proto3OptionalUint32 ?? 0} + set {_uniqueStorage()._proto3OptionalUint32 = newValue} + } + /// Returns true if `proto3OptionalUint32` has been explicitly set. + var hasProto3OptionalUint32: Bool {return _storage._proto3OptionalUint32 != nil} + /// Clears the value of `proto3OptionalUint32`. Subsequent reads from it will return its default value. + mutating func clearProto3OptionalUint32() {_uniqueStorage()._proto3OptionalUint32 = nil} + + var proto3OptionalUint64: UInt64 { + get {return _storage._proto3OptionalUint64 ?? 0} + set {_uniqueStorage()._proto3OptionalUint64 = newValue} + } + /// Returns true if `proto3OptionalUint64` has been explicitly set. + var hasProto3OptionalUint64: Bool {return _storage._proto3OptionalUint64 != nil} + /// Clears the value of `proto3OptionalUint64`. Subsequent reads from it will return its default value. + mutating func clearProto3OptionalUint64() {_uniqueStorage()._proto3OptionalUint64 = nil} + + var proto3OptionalSint32: Int32 { + get {return _storage._proto3OptionalSint32 ?? 0} + set {_uniqueStorage()._proto3OptionalSint32 = newValue} + } + /// Returns true if `proto3OptionalSint32` has been explicitly set. + var hasProto3OptionalSint32: Bool {return _storage._proto3OptionalSint32 != nil} + /// Clears the value of `proto3OptionalSint32`. Subsequent reads from it will return its default value. + mutating func clearProto3OptionalSint32() {_uniqueStorage()._proto3OptionalSint32 = nil} + + var proto3OptionalSint64: Int64 { + get {return _storage._proto3OptionalSint64 ?? 0} + set {_uniqueStorage()._proto3OptionalSint64 = newValue} + } + /// Returns true if `proto3OptionalSint64` has been explicitly set. + var hasProto3OptionalSint64: Bool {return _storage._proto3OptionalSint64 != nil} + /// Clears the value of `proto3OptionalSint64`. Subsequent reads from it will return its default value. + mutating func clearProto3OptionalSint64() {_uniqueStorage()._proto3OptionalSint64 = nil} + + var proto3OptionalFixed32: UInt32 { + get {return _storage._proto3OptionalFixed32 ?? 0} + set {_uniqueStorage()._proto3OptionalFixed32 = newValue} + } + /// Returns true if `proto3OptionalFixed32` has been explicitly set. + var hasProto3OptionalFixed32: Bool {return _storage._proto3OptionalFixed32 != nil} + /// Clears the value of `proto3OptionalFixed32`. Subsequent reads from it will return its default value. + mutating func clearProto3OptionalFixed32() {_uniqueStorage()._proto3OptionalFixed32 = nil} + + var proto3OptionalFixed64: UInt64 { + get {return _storage._proto3OptionalFixed64 ?? 0} + set {_uniqueStorage()._proto3OptionalFixed64 = newValue} + } + /// Returns true if `proto3OptionalFixed64` has been explicitly set. + var hasProto3OptionalFixed64: Bool {return _storage._proto3OptionalFixed64 != nil} + /// Clears the value of `proto3OptionalFixed64`. Subsequent reads from it will return its default value. + mutating func clearProto3OptionalFixed64() {_uniqueStorage()._proto3OptionalFixed64 = nil} + + var proto3OptionalSfixed32: Int32 { + get {return _storage._proto3OptionalSfixed32 ?? 0} + set {_uniqueStorage()._proto3OptionalSfixed32 = newValue} + } + /// Returns true if `proto3OptionalSfixed32` has been explicitly set. + var hasProto3OptionalSfixed32: Bool {return _storage._proto3OptionalSfixed32 != nil} + /// Clears the value of `proto3OptionalSfixed32`. Subsequent reads from it will return its default value. + mutating func clearProto3OptionalSfixed32() {_uniqueStorage()._proto3OptionalSfixed32 = nil} + + var proto3OptionalSfixed64: Int64 { + get {return _storage._proto3OptionalSfixed64 ?? 0} + set {_uniqueStorage()._proto3OptionalSfixed64 = newValue} + } + /// Returns true if `proto3OptionalSfixed64` has been explicitly set. + var hasProto3OptionalSfixed64: Bool {return _storage._proto3OptionalSfixed64 != nil} + /// Clears the value of `proto3OptionalSfixed64`. Subsequent reads from it will return its default value. + mutating func clearProto3OptionalSfixed64() {_uniqueStorage()._proto3OptionalSfixed64 = nil} + + var proto3OptionalFloat: Float { + get {return _storage._proto3OptionalFloat ?? 0} + set {_uniqueStorage()._proto3OptionalFloat = newValue} + } + /// Returns true if `proto3OptionalFloat` has been explicitly set. + var hasProto3OptionalFloat: Bool {return _storage._proto3OptionalFloat != nil} + /// Clears the value of `proto3OptionalFloat`. Subsequent reads from it will return its default value. + mutating func clearProto3OptionalFloat() {_uniqueStorage()._proto3OptionalFloat = nil} + + var proto3OptionalDouble: Double { + get {return _storage._proto3OptionalDouble ?? 0} + set {_uniqueStorage()._proto3OptionalDouble = newValue} + } + /// Returns true if `proto3OptionalDouble` has been explicitly set. + var hasProto3OptionalDouble: Bool {return _storage._proto3OptionalDouble != nil} + /// Clears the value of `proto3OptionalDouble`. Subsequent reads from it will return its default value. + mutating func clearProto3OptionalDouble() {_uniqueStorage()._proto3OptionalDouble = nil} + + var proto3OptionalBool: Bool { + get {return _storage._proto3OptionalBool ?? false} + set {_uniqueStorage()._proto3OptionalBool = newValue} + } + /// Returns true if `proto3OptionalBool` has been explicitly set. + var hasProto3OptionalBool: Bool {return _storage._proto3OptionalBool != nil} + /// Clears the value of `proto3OptionalBool`. Subsequent reads from it will return its default value. + mutating func clearProto3OptionalBool() {_uniqueStorage()._proto3OptionalBool = nil} + + var proto3OptionalString: String { + get {return _storage._proto3OptionalString ?? String()} + set {_uniqueStorage()._proto3OptionalString = newValue} + } + /// Returns true if `proto3OptionalString` has been explicitly set. + var hasProto3OptionalString: Bool {return _storage._proto3OptionalString != nil} + /// Clears the value of `proto3OptionalString`. Subsequent reads from it will return its default value. + mutating func clearProto3OptionalString() {_uniqueStorage()._proto3OptionalString = nil} + + var proto3OptionalBytes: Data { + get {return _storage._proto3OptionalBytes ?? Data()} + set {_uniqueStorage()._proto3OptionalBytes = newValue} + } + /// Returns true if `proto3OptionalBytes` has been explicitly set. + var hasProto3OptionalBytes: Bool {return _storage._proto3OptionalBytes != nil} + /// Clears the value of `proto3OptionalBytes`. Subsequent reads from it will return its default value. + mutating func clearProto3OptionalBytes() {_uniqueStorage()._proto3OptionalBytes = nil} + + var repeatedNestedMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] { + get {return _storage._repeatedNestedMessage} + set {_uniqueStorage()._repeatedNestedMessage = newValue} + } + + var repeatedForeignMessage: [Proto3ArenaUnittest_ForeignMessage] { + get {return _storage._repeatedForeignMessage} + set {_uniqueStorage()._repeatedForeignMessage = newValue} + } + + var repeatedImportMessage: [ProtobufUnittestImport_ImportMessage] { + get {return _storage._repeatedImportMessage} + set {_uniqueStorage()._repeatedImportMessage = newValue} + } + + var repeatedNestedEnum: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] { + get {return _storage._repeatedNestedEnum} + set {_uniqueStorage()._repeatedNestedEnum = newValue} + } + + var repeatedForeignEnum: [Proto3ArenaUnittest_ForeignEnum] { + get {return _storage._repeatedForeignEnum} + set {_uniqueStorage()._repeatedForeignEnum = newValue} + } + + var repeatedStringPiece: [String] { + get {return _storage._repeatedStringPiece} + set {_uniqueStorage()._repeatedStringPiece = newValue} + } + + var repeatedCord: [String] { + get {return _storage._repeatedCord} + set {_uniqueStorage()._repeatedCord = newValue} + } + + var repeatedLazyMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] { + get {return _storage._repeatedLazyMessage} + set {_uniqueStorage()._repeatedLazyMessage = newValue} + } + + var oneofField: OneOf_OneofField? { + get {return _storage._oneofField} + set {_uniqueStorage()._oneofField = newValue} + } + + var oneofUint32: UInt32 { + get { + if case .oneofUint32(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofUint32(newValue)} + } + + var oneofNestedMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage { + get { + if case .oneofNestedMessage(let v)? = _storage._oneofField {return v} + return Proto3ArenaUnittest_TestAllTypes.NestedMessage() + } + set {_uniqueStorage()._oneofField = .oneofNestedMessage(newValue)} + } + + var oneofString: String { + get { + if case .oneofString(let v)? = _storage._oneofField {return v} + return String() + } + set {_uniqueStorage()._oneofField = .oneofString(newValue)} + } + + var oneofBytes: Data { + get { + if case .oneofBytes(let v)? = _storage._oneofField {return v} + return Data() + } + set {_uniqueStorage()._oneofField = .oneofBytes(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_OneofField: Equatable { + case oneofUint32(UInt32) + case oneofNestedMessage(Proto3ArenaUnittest_TestAllTypes.NestedMessage) + case oneofString(String) + case oneofBytes(Data) + + } + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case zero // = 0 + case foo // = 1 + case bar // = 2 + case baz // = 3 + + /// Intentionally negative. + case neg // = -1 + case UNRECOGNIZED(Int) + + init() { + self = .zero + } + + init?(rawValue: Int) { + switch rawValue { + case -1: self = .neg + case 0: self = .zero + case 1: self = .foo + case 2: self = .bar + case 3: self = .baz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .neg: return -1 + case .zero: return 0 + case .foo: return 1 + case .bar: return 2 + case .baz: return 3 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] = [ + .zero, + .foo, + .bar, + .baz, + .neg, + ] + + } + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The field name "b" fails to compile in proto1 because it conflicts with + /// a local variable named "b" in one of the generated methods. Doh. + /// This file needs to compile in proto1 to test backwards-compatibility. + var bb: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct Proto3ArenaUnittest_TestPackedTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var packedInt32: [Int32] = [] + + var packedInt64: [Int64] = [] + + var packedUint32: [UInt32] = [] + + var packedUint64: [UInt64] = [] + + var packedSint32: [Int32] = [] + + var packedSint64: [Int64] = [] + + var packedFixed32: [UInt32] = [] + + var packedFixed64: [UInt64] = [] + + var packedSfixed32: [Int32] = [] + + var packedSfixed64: [Int64] = [] + + var packedFloat: [Float] = [] + + var packedDouble: [Double] = [] + + var packedBool: [Bool] = [] + + var packedEnum: [Proto3ArenaUnittest_ForeignEnum] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Explicitly set packed to false +struct Proto3ArenaUnittest_TestUnpackedTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var repeatedInt32: [Int32] = [] + + var repeatedInt64: [Int64] = [] + + var repeatedUint32: [UInt32] = [] + + var repeatedUint64: [UInt64] = [] + + var repeatedSint32: [Int32] = [] + + var repeatedSint64: [Int64] = [] + + var repeatedFixed32: [UInt32] = [] + + var repeatedFixed64: [UInt64] = [] + + var repeatedSfixed32: [Int32] = [] + + var repeatedSfixed64: [Int64] = [] + + var repeatedFloat: [Float] = [] + + var repeatedDouble: [Double] = [] + + var repeatedBool: [Bool] = [] + + var repeatedNestedEnum: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// This proto includes a recursively nested message. +struct Proto3ArenaUnittest_NestedTestAllTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var child: Proto3ArenaUnittest_NestedTestAllTypes { + get {return _storage._child ?? Proto3ArenaUnittest_NestedTestAllTypes()} + set {_uniqueStorage()._child = newValue} + } + /// Returns true if `child` has been explicitly set. + var hasChild: Bool {return _storage._child != nil} + /// Clears the value of `child`. Subsequent reads from it will return its default value. + mutating func clearChild() {_uniqueStorage()._child = nil} + + var payload: Proto3ArenaUnittest_TestAllTypes { + get {return _storage._payload ?? Proto3ArenaUnittest_TestAllTypes()} + set {_uniqueStorage()._payload = newValue} + } + /// Returns true if `payload` has been explicitly set. + var hasPayload: Bool {return _storage._payload != nil} + /// Clears the value of `payload`. Subsequent reads from it will return its default value. + mutating func clearPayload() {_uniqueStorage()._payload = nil} + + var repeatedChild: [Proto3ArenaUnittest_NestedTestAllTypes] { + get {return _storage._repeatedChild} + set {_uniqueStorage()._repeatedChild = newValue} + } + + var lazyPayload: Proto3ArenaUnittest_TestAllTypes { + get {return _storage._lazyPayload ?? Proto3ArenaUnittest_TestAllTypes()} + set {_uniqueStorage()._lazyPayload = newValue} + } + /// Returns true if `lazyPayload` has been explicitly set. + var hasLazyPayload: Bool {return _storage._lazyPayload != nil} + /// Clears the value of `lazyPayload`. Subsequent reads from it will return its default value. + mutating func clearLazyPayload() {_uniqueStorage()._lazyPayload = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +/// Define these after TestAllTypes to make sure the compiler can handle +/// that. +struct Proto3ArenaUnittest_ForeignMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var c: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// TestEmptyMessage is used to test behavior of unknown fields. +struct Proto3ArenaUnittest_TestEmptyMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Needed for a Python test. +struct Proto3ArenaUnittest_TestPickleNestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var bb: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct NestedNestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var cc: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + } + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Proto3ArenaUnittest_TestAllTypes: @unchecked Sendable {} +extension Proto3ArenaUnittest_TestAllTypes.OneOf_OneofField: @unchecked Sendable {} +extension Proto3ArenaUnittest_TestAllTypes.NestedMessage: @unchecked Sendable {} +extension Proto3ArenaUnittest_TestPackedTypes: @unchecked Sendable {} +extension Proto3ArenaUnittest_TestUnpackedTypes: @unchecked Sendable {} +extension Proto3ArenaUnittest_NestedTestAllTypes: @unchecked Sendable {} +extension Proto3ArenaUnittest_ForeignMessage: @unchecked Sendable {} +extension Proto3ArenaUnittest_TestEmptyMessage: @unchecked Sendable {} +extension Proto3ArenaUnittest_TestPickleNestedMessage: @unchecked Sendable {} +extension Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage: @unchecked Sendable {} +extension Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage.NestedNestedMessage: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "proto3_arena_unittest" + +extension Proto3ArenaUnittest_ForeignEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FOREIGN_ZERO"), + 4: .same(proto: "FOREIGN_FOO"), + 5: .same(proto: "FOREIGN_BAR"), + 6: .same(proto: "FOREIGN_BAZ"), + ] +} + +extension Proto3ArenaUnittest_TestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestAllTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_int32"), + 2: .standard(proto: "optional_int64"), + 3: .standard(proto: "optional_uint32"), + 4: .standard(proto: "optional_uint64"), + 5: .standard(proto: "optional_sint32"), + 6: .standard(proto: "optional_sint64"), + 7: .standard(proto: "optional_fixed32"), + 8: .standard(proto: "optional_fixed64"), + 9: .standard(proto: "optional_sfixed32"), + 10: .standard(proto: "optional_sfixed64"), + 11: .standard(proto: "optional_float"), + 12: .standard(proto: "optional_double"), + 13: .standard(proto: "optional_bool"), + 14: .standard(proto: "optional_string"), + 15: .standard(proto: "optional_bytes"), + 18: .standard(proto: "optional_nested_message"), + 19: .standard(proto: "optional_foreign_message"), + 20: .standard(proto: "optional_import_message"), + 21: .standard(proto: "optional_nested_enum"), + 22: .standard(proto: "optional_foreign_enum"), + 24: .standard(proto: "optional_string_piece"), + 25: .standard(proto: "optional_cord"), + 26: .standard(proto: "optional_public_import_message"), + 27: .standard(proto: "optional_lazy_message"), + 28: .standard(proto: "optional_unverified_lazy_message"), + 115: .standard(proto: "optional_lazy_import_message"), + 31: .standard(proto: "repeated_int32"), + 32: .standard(proto: "repeated_int64"), + 33: .standard(proto: "repeated_uint32"), + 34: .standard(proto: "repeated_uint64"), + 35: .standard(proto: "repeated_sint32"), + 36: .standard(proto: "repeated_sint64"), + 37: .standard(proto: "repeated_fixed32"), + 38: .standard(proto: "repeated_fixed64"), + 39: .standard(proto: "repeated_sfixed32"), + 40: .standard(proto: "repeated_sfixed64"), + 41: .standard(proto: "repeated_float"), + 42: .standard(proto: "repeated_double"), + 43: .standard(proto: "repeated_bool"), + 44: .standard(proto: "repeated_string"), + 45: .standard(proto: "repeated_bytes"), + 116: .standard(proto: "proto3_optional_int32"), + 117: .standard(proto: "proto3_optional_int64"), + 118: .standard(proto: "proto3_optional_uint32"), + 119: .standard(proto: "proto3_optional_uint64"), + 120: .standard(proto: "proto3_optional_sint32"), + 121: .standard(proto: "proto3_optional_sint64"), + 122: .standard(proto: "proto3_optional_fixed32"), + 123: .standard(proto: "proto3_optional_fixed64"), + 124: .standard(proto: "proto3_optional_sfixed32"), + 125: .standard(proto: "proto3_optional_sfixed64"), + 126: .standard(proto: "proto3_optional_float"), + 127: .standard(proto: "proto3_optional_double"), + 128: .standard(proto: "proto3_optional_bool"), + 129: .standard(proto: "proto3_optional_string"), + 130: .standard(proto: "proto3_optional_bytes"), + 48: .standard(proto: "repeated_nested_message"), + 49: .standard(proto: "repeated_foreign_message"), + 50: .standard(proto: "repeated_import_message"), + 51: .standard(proto: "repeated_nested_enum"), + 52: .standard(proto: "repeated_foreign_enum"), + 54: .standard(proto: "repeated_string_piece"), + 55: .standard(proto: "repeated_cord"), + 57: .standard(proto: "repeated_lazy_message"), + 111: .standard(proto: "oneof_uint32"), + 112: .standard(proto: "oneof_nested_message"), + 113: .standard(proto: "oneof_string"), + 114: .standard(proto: "oneof_bytes"), + ] + + fileprivate class _StorageClass { + var _optionalInt32: Int32 = 0 + var _optionalInt64: Int64 = 0 + var _optionalUint32: UInt32 = 0 + var _optionalUint64: UInt64 = 0 + var _optionalSint32: Int32 = 0 + var _optionalSint64: Int64 = 0 + var _optionalFixed32: UInt32 = 0 + var _optionalFixed64: UInt64 = 0 + var _optionalSfixed32: Int32 = 0 + var _optionalSfixed64: Int64 = 0 + var _optionalFloat: Float = 0 + var _optionalDouble: Double = 0 + var _optionalBool: Bool = false + var _optionalString: String = String() + var _optionalBytes: Data = Data() + var _optionalNestedMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage? = nil + var _optionalForeignMessage: Proto3ArenaUnittest_ForeignMessage? = nil + var _optionalImportMessage: ProtobufUnittestImport_ImportMessage? = nil + var _optionalNestedEnum: Proto3ArenaUnittest_TestAllTypes.NestedEnum = .zero + var _optionalForeignEnum: Proto3ArenaUnittest_ForeignEnum = .foreignZero + var _optionalStringPiece: String = String() + var _optionalCord: String = String() + var _optionalPublicImportMessage: ProtobufUnittestImport_PublicImportMessage? = nil + var _optionalLazyMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage? = nil + var _optionalUnverifiedLazyMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage? = nil + var _optionalLazyImportMessage: ProtobufUnittestImport_ImportMessage? = nil + var _repeatedInt32: [Int32] = [] + var _repeatedInt64: [Int64] = [] + var _repeatedUint32: [UInt32] = [] + var _repeatedUint64: [UInt64] = [] + var _repeatedSint32: [Int32] = [] + var _repeatedSint64: [Int64] = [] + var _repeatedFixed32: [UInt32] = [] + var _repeatedFixed64: [UInt64] = [] + var _repeatedSfixed32: [Int32] = [] + var _repeatedSfixed64: [Int64] = [] + var _repeatedFloat: [Float] = [] + var _repeatedDouble: [Double] = [] + var _repeatedBool: [Bool] = [] + var _repeatedString: [String] = [] + var _repeatedBytes: [Data] = [] + var _proto3OptionalInt32: Int32? = nil + var _proto3OptionalInt64: Int64? = nil + var _proto3OptionalUint32: UInt32? = nil + var _proto3OptionalUint64: UInt64? = nil + var _proto3OptionalSint32: Int32? = nil + var _proto3OptionalSint64: Int64? = nil + var _proto3OptionalFixed32: UInt32? = nil + var _proto3OptionalFixed64: UInt64? = nil + var _proto3OptionalSfixed32: Int32? = nil + var _proto3OptionalSfixed64: Int64? = nil + var _proto3OptionalFloat: Float? = nil + var _proto3OptionalDouble: Double? = nil + var _proto3OptionalBool: Bool? = nil + var _proto3OptionalString: String? = nil + var _proto3OptionalBytes: Data? = nil + var _repeatedNestedMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] = [] + var _repeatedForeignMessage: [Proto3ArenaUnittest_ForeignMessage] = [] + var _repeatedImportMessage: [ProtobufUnittestImport_ImportMessage] = [] + var _repeatedNestedEnum: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] = [] + var _repeatedForeignEnum: [Proto3ArenaUnittest_ForeignEnum] = [] + var _repeatedStringPiece: [String] = [] + var _repeatedCord: [String] = [] + var _repeatedLazyMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] = [] + var _oneofField: Proto3ArenaUnittest_TestAllTypes.OneOf_OneofField? + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _optionalInt32 = source._optionalInt32 + _optionalInt64 = source._optionalInt64 + _optionalUint32 = source._optionalUint32 + _optionalUint64 = source._optionalUint64 + _optionalSint32 = source._optionalSint32 + _optionalSint64 = source._optionalSint64 + _optionalFixed32 = source._optionalFixed32 + _optionalFixed64 = source._optionalFixed64 + _optionalSfixed32 = source._optionalSfixed32 + _optionalSfixed64 = source._optionalSfixed64 + _optionalFloat = source._optionalFloat + _optionalDouble = source._optionalDouble + _optionalBool = source._optionalBool + _optionalString = source._optionalString + _optionalBytes = source._optionalBytes + _optionalNestedMessage = source._optionalNestedMessage + _optionalForeignMessage = source._optionalForeignMessage + _optionalImportMessage = source._optionalImportMessage + _optionalNestedEnum = source._optionalNestedEnum + _optionalForeignEnum = source._optionalForeignEnum + _optionalStringPiece = source._optionalStringPiece + _optionalCord = source._optionalCord + _optionalPublicImportMessage = source._optionalPublicImportMessage + _optionalLazyMessage = source._optionalLazyMessage + _optionalUnverifiedLazyMessage = source._optionalUnverifiedLazyMessage + _optionalLazyImportMessage = source._optionalLazyImportMessage + _repeatedInt32 = source._repeatedInt32 + _repeatedInt64 = source._repeatedInt64 + _repeatedUint32 = source._repeatedUint32 + _repeatedUint64 = source._repeatedUint64 + _repeatedSint32 = source._repeatedSint32 + _repeatedSint64 = source._repeatedSint64 + _repeatedFixed32 = source._repeatedFixed32 + _repeatedFixed64 = source._repeatedFixed64 + _repeatedSfixed32 = source._repeatedSfixed32 + _repeatedSfixed64 = source._repeatedSfixed64 + _repeatedFloat = source._repeatedFloat + _repeatedDouble = source._repeatedDouble + _repeatedBool = source._repeatedBool + _repeatedString = source._repeatedString + _repeatedBytes = source._repeatedBytes + _proto3OptionalInt32 = source._proto3OptionalInt32 + _proto3OptionalInt64 = source._proto3OptionalInt64 + _proto3OptionalUint32 = source._proto3OptionalUint32 + _proto3OptionalUint64 = source._proto3OptionalUint64 + _proto3OptionalSint32 = source._proto3OptionalSint32 + _proto3OptionalSint64 = source._proto3OptionalSint64 + _proto3OptionalFixed32 = source._proto3OptionalFixed32 + _proto3OptionalFixed64 = source._proto3OptionalFixed64 + _proto3OptionalSfixed32 = source._proto3OptionalSfixed32 + _proto3OptionalSfixed64 = source._proto3OptionalSfixed64 + _proto3OptionalFloat = source._proto3OptionalFloat + _proto3OptionalDouble = source._proto3OptionalDouble + _proto3OptionalBool = source._proto3OptionalBool + _proto3OptionalString = source._proto3OptionalString + _proto3OptionalBytes = source._proto3OptionalBytes + _repeatedNestedMessage = source._repeatedNestedMessage + _repeatedForeignMessage = source._repeatedForeignMessage + _repeatedImportMessage = source._repeatedImportMessage + _repeatedNestedEnum = source._repeatedNestedEnum + _repeatedForeignEnum = source._repeatedForeignEnum + _repeatedStringPiece = source._repeatedStringPiece + _repeatedCord = source._repeatedCord + _repeatedLazyMessage = source._repeatedLazyMessage + _oneofField = source._oneofField + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._optionalInt32) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._optionalInt64) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint32) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._optionalUint64) }() + case 5: try { try decoder.decodeSingularSInt32Field(value: &_storage._optionalSint32) }() + case 6: try { try decoder.decodeSingularSInt64Field(value: &_storage._optionalSint64) }() + case 7: try { try decoder.decodeSingularFixed32Field(value: &_storage._optionalFixed32) }() + case 8: try { try decoder.decodeSingularFixed64Field(value: &_storage._optionalFixed64) }() + case 9: try { try decoder.decodeSingularSFixed32Field(value: &_storage._optionalSfixed32) }() + case 10: try { try decoder.decodeSingularSFixed64Field(value: &_storage._optionalSfixed64) }() + case 11: try { try decoder.decodeSingularFloatField(value: &_storage._optionalFloat) }() + case 12: try { try decoder.decodeSingularDoubleField(value: &_storage._optionalDouble) }() + case 13: try { try decoder.decodeSingularBoolField(value: &_storage._optionalBool) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._optionalString) }() + case 15: try { try decoder.decodeSingularBytesField(value: &_storage._optionalBytes) }() + case 18: try { try decoder.decodeSingularMessageField(value: &_storage._optionalNestedMessage) }() + case 19: try { try decoder.decodeSingularMessageField(value: &_storage._optionalForeignMessage) }() + case 20: try { try decoder.decodeSingularMessageField(value: &_storage._optionalImportMessage) }() + case 21: try { try decoder.decodeSingularEnumField(value: &_storage._optionalNestedEnum) }() + case 22: try { try decoder.decodeSingularEnumField(value: &_storage._optionalForeignEnum) }() + case 24: try { try decoder.decodeSingularStringField(value: &_storage._optionalStringPiece) }() + case 25: try { try decoder.decodeSingularStringField(value: &_storage._optionalCord) }() + case 26: try { try decoder.decodeSingularMessageField(value: &_storage._optionalPublicImportMessage) }() + case 27: try { try decoder.decodeSingularMessageField(value: &_storage._optionalLazyMessage) }() + case 28: try { try decoder.decodeSingularMessageField(value: &_storage._optionalUnverifiedLazyMessage) }() + case 31: try { try decoder.decodeRepeatedInt32Field(value: &_storage._repeatedInt32) }() + case 32: try { try decoder.decodeRepeatedInt64Field(value: &_storage._repeatedInt64) }() + case 33: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._repeatedUint32) }() + case 34: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._repeatedUint64) }() + case 35: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._repeatedSint32) }() + case 36: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._repeatedSint64) }() + case 37: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._repeatedFixed32) }() + case 38: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._repeatedFixed64) }() + case 39: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._repeatedSfixed32) }() + case 40: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._repeatedSfixed64) }() + case 41: try { try decoder.decodeRepeatedFloatField(value: &_storage._repeatedFloat) }() + case 42: try { try decoder.decodeRepeatedDoubleField(value: &_storage._repeatedDouble) }() + case 43: try { try decoder.decodeRepeatedBoolField(value: &_storage._repeatedBool) }() + case 44: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedString) }() + case 45: try { try decoder.decodeRepeatedBytesField(value: &_storage._repeatedBytes) }() + case 48: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedNestedMessage) }() + case 49: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedForeignMessage) }() + case 50: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedImportMessage) }() + case 51: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedNestedEnum) }() + case 52: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedForeignEnum) }() + case 54: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedStringPiece) }() + case 55: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedCord) }() + case 57: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedLazyMessage) }() + case 111: try { + var v: UInt32? + try decoder.decodeSingularUInt32Field(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofUint32(v) + } + }() + case 112: try { + var v: Proto3ArenaUnittest_TestAllTypes.NestedMessage? + var hadOneofValue = false + if let current = _storage._oneofField { + hadOneofValue = true + if case .oneofNestedMessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofNestedMessage(v) + } + }() + case 113: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofString(v) + } + }() + case 114: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofBytes(v) + } + }() + case 115: try { try decoder.decodeSingularMessageField(value: &_storage._optionalLazyImportMessage) }() + case 116: try { try decoder.decodeSingularInt32Field(value: &_storage._proto3OptionalInt32) }() + case 117: try { try decoder.decodeSingularInt64Field(value: &_storage._proto3OptionalInt64) }() + case 118: try { try decoder.decodeSingularUInt32Field(value: &_storage._proto3OptionalUint32) }() + case 119: try { try decoder.decodeSingularUInt64Field(value: &_storage._proto3OptionalUint64) }() + case 120: try { try decoder.decodeSingularSInt32Field(value: &_storage._proto3OptionalSint32) }() + case 121: try { try decoder.decodeSingularSInt64Field(value: &_storage._proto3OptionalSint64) }() + case 122: try { try decoder.decodeSingularFixed32Field(value: &_storage._proto3OptionalFixed32) }() + case 123: try { try decoder.decodeSingularFixed64Field(value: &_storage._proto3OptionalFixed64) }() + case 124: try { try decoder.decodeSingularSFixed32Field(value: &_storage._proto3OptionalSfixed32) }() + case 125: try { try decoder.decodeSingularSFixed64Field(value: &_storage._proto3OptionalSfixed64) }() + case 126: try { try decoder.decodeSingularFloatField(value: &_storage._proto3OptionalFloat) }() + case 127: try { try decoder.decodeSingularDoubleField(value: &_storage._proto3OptionalDouble) }() + case 128: try { try decoder.decodeSingularBoolField(value: &_storage._proto3OptionalBool) }() + case 129: try { try decoder.decodeSingularStringField(value: &_storage._proto3OptionalString) }() + case 130: try { try decoder.decodeSingularBytesField(value: &_storage._proto3OptionalBytes) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if _storage._optionalInt32 != 0 { + try visitor.visitSingularInt32Field(value: _storage._optionalInt32, fieldNumber: 1) + } + if _storage._optionalInt64 != 0 { + try visitor.visitSingularInt64Field(value: _storage._optionalInt64, fieldNumber: 2) + } + if _storage._optionalUint32 != 0 { + try visitor.visitSingularUInt32Field(value: _storage._optionalUint32, fieldNumber: 3) + } + if _storage._optionalUint64 != 0 { + try visitor.visitSingularUInt64Field(value: _storage._optionalUint64, fieldNumber: 4) + } + if _storage._optionalSint32 != 0 { + try visitor.visitSingularSInt32Field(value: _storage._optionalSint32, fieldNumber: 5) + } + if _storage._optionalSint64 != 0 { + try visitor.visitSingularSInt64Field(value: _storage._optionalSint64, fieldNumber: 6) + } + if _storage._optionalFixed32 != 0 { + try visitor.visitSingularFixed32Field(value: _storage._optionalFixed32, fieldNumber: 7) + } + if _storage._optionalFixed64 != 0 { + try visitor.visitSingularFixed64Field(value: _storage._optionalFixed64, fieldNumber: 8) + } + if _storage._optionalSfixed32 != 0 { + try visitor.visitSingularSFixed32Field(value: _storage._optionalSfixed32, fieldNumber: 9) + } + if _storage._optionalSfixed64 != 0 { + try visitor.visitSingularSFixed64Field(value: _storage._optionalSfixed64, fieldNumber: 10) + } + if _storage._optionalFloat != 0 { + try visitor.visitSingularFloatField(value: _storage._optionalFloat, fieldNumber: 11) + } + if _storage._optionalDouble != 0 { + try visitor.visitSingularDoubleField(value: _storage._optionalDouble, fieldNumber: 12) + } + if _storage._optionalBool != false { + try visitor.visitSingularBoolField(value: _storage._optionalBool, fieldNumber: 13) + } + if !_storage._optionalString.isEmpty { + try visitor.visitSingularStringField(value: _storage._optionalString, fieldNumber: 14) + } + if !_storage._optionalBytes.isEmpty { + try visitor.visitSingularBytesField(value: _storage._optionalBytes, fieldNumber: 15) + } + try { if let v = _storage._optionalNestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._optionalForeignMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + } }() + try { if let v = _storage._optionalImportMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 20) + } }() + if _storage._optionalNestedEnum != .zero { + try visitor.visitSingularEnumField(value: _storage._optionalNestedEnum, fieldNumber: 21) + } + if _storage._optionalForeignEnum != .foreignZero { + try visitor.visitSingularEnumField(value: _storage._optionalForeignEnum, fieldNumber: 22) + } + if !_storage._optionalStringPiece.isEmpty { + try visitor.visitSingularStringField(value: _storage._optionalStringPiece, fieldNumber: 24) + } + if !_storage._optionalCord.isEmpty { + try visitor.visitSingularStringField(value: _storage._optionalCord, fieldNumber: 25) + } + try { if let v = _storage._optionalPublicImportMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 26) + } }() + try { if let v = _storage._optionalLazyMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 27) + } }() + try { if let v = _storage._optionalUnverifiedLazyMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 28) + } }() + if !_storage._repeatedInt32.isEmpty { + try visitor.visitPackedInt32Field(value: _storage._repeatedInt32, fieldNumber: 31) + } + if !_storage._repeatedInt64.isEmpty { + try visitor.visitPackedInt64Field(value: _storage._repeatedInt64, fieldNumber: 32) + } + if !_storage._repeatedUint32.isEmpty { + try visitor.visitPackedUInt32Field(value: _storage._repeatedUint32, fieldNumber: 33) + } + if !_storage._repeatedUint64.isEmpty { + try visitor.visitPackedUInt64Field(value: _storage._repeatedUint64, fieldNumber: 34) + } + if !_storage._repeatedSint32.isEmpty { + try visitor.visitPackedSInt32Field(value: _storage._repeatedSint32, fieldNumber: 35) + } + if !_storage._repeatedSint64.isEmpty { + try visitor.visitPackedSInt64Field(value: _storage._repeatedSint64, fieldNumber: 36) + } + if !_storage._repeatedFixed32.isEmpty { + try visitor.visitPackedFixed32Field(value: _storage._repeatedFixed32, fieldNumber: 37) + } + if !_storage._repeatedFixed64.isEmpty { + try visitor.visitPackedFixed64Field(value: _storage._repeatedFixed64, fieldNumber: 38) + } + if !_storage._repeatedSfixed32.isEmpty { + try visitor.visitPackedSFixed32Field(value: _storage._repeatedSfixed32, fieldNumber: 39) + } + if !_storage._repeatedSfixed64.isEmpty { + try visitor.visitPackedSFixed64Field(value: _storage._repeatedSfixed64, fieldNumber: 40) + } + if !_storage._repeatedFloat.isEmpty { + try visitor.visitPackedFloatField(value: _storage._repeatedFloat, fieldNumber: 41) + } + if !_storage._repeatedDouble.isEmpty { + try visitor.visitPackedDoubleField(value: _storage._repeatedDouble, fieldNumber: 42) + } + if !_storage._repeatedBool.isEmpty { + try visitor.visitPackedBoolField(value: _storage._repeatedBool, fieldNumber: 43) + } + if !_storage._repeatedString.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedString, fieldNumber: 44) + } + if !_storage._repeatedBytes.isEmpty { + try visitor.visitRepeatedBytesField(value: _storage._repeatedBytes, fieldNumber: 45) + } + if !_storage._repeatedNestedMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedNestedMessage, fieldNumber: 48) + } + if !_storage._repeatedForeignMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedForeignMessage, fieldNumber: 49) + } + if !_storage._repeatedImportMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedImportMessage, fieldNumber: 50) + } + if !_storage._repeatedNestedEnum.isEmpty { + try visitor.visitPackedEnumField(value: _storage._repeatedNestedEnum, fieldNumber: 51) + } + if !_storage._repeatedForeignEnum.isEmpty { + try visitor.visitPackedEnumField(value: _storage._repeatedForeignEnum, fieldNumber: 52) + } + if !_storage._repeatedStringPiece.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedStringPiece, fieldNumber: 54) + } + if !_storage._repeatedCord.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedCord, fieldNumber: 55) + } + if !_storage._repeatedLazyMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedLazyMessage, fieldNumber: 57) + } + switch _storage._oneofField { + case .oneofUint32?: try { + guard case .oneofUint32(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 111) + }() + case .oneofNestedMessage?: try { + guard case .oneofNestedMessage(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 112) + }() + case .oneofString?: try { + guard case .oneofString(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 113) + }() + case .oneofBytes?: try { + guard case .oneofBytes(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 114) + }() + case nil: break + } + try { if let v = _storage._optionalLazyImportMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 115) + } }() + try { if let v = _storage._proto3OptionalInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 116) + } }() + try { if let v = _storage._proto3OptionalInt64 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 117) + } }() + try { if let v = _storage._proto3OptionalUint32 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 118) + } }() + try { if let v = _storage._proto3OptionalUint64 { + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 119) + } }() + try { if let v = _storage._proto3OptionalSint32 { + try visitor.visitSingularSInt32Field(value: v, fieldNumber: 120) + } }() + try { if let v = _storage._proto3OptionalSint64 { + try visitor.visitSingularSInt64Field(value: v, fieldNumber: 121) + } }() + try { if let v = _storage._proto3OptionalFixed32 { + try visitor.visitSingularFixed32Field(value: v, fieldNumber: 122) + } }() + try { if let v = _storage._proto3OptionalFixed64 { + try visitor.visitSingularFixed64Field(value: v, fieldNumber: 123) + } }() + try { if let v = _storage._proto3OptionalSfixed32 { + try visitor.visitSingularSFixed32Field(value: v, fieldNumber: 124) + } }() + try { if let v = _storage._proto3OptionalSfixed64 { + try visitor.visitSingularSFixed64Field(value: v, fieldNumber: 125) + } }() + try { if let v = _storage._proto3OptionalFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 126) + } }() + try { if let v = _storage._proto3OptionalDouble { + try visitor.visitSingularDoubleField(value: v, fieldNumber: 127) + } }() + try { if let v = _storage._proto3OptionalBool { + try visitor.visitSingularBoolField(value: v, fieldNumber: 128) + } }() + try { if let v = _storage._proto3OptionalString { + try visitor.visitSingularStringField(value: v, fieldNumber: 129) + } }() + try { if let v = _storage._proto3OptionalBytes { + try visitor.visitSingularBytesField(value: v, fieldNumber: 130) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3ArenaUnittest_TestAllTypes, rhs: Proto3ArenaUnittest_TestAllTypes) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._optionalInt32 != rhs_storage._optionalInt32 {return false} + if _storage._optionalInt64 != rhs_storage._optionalInt64 {return false} + if _storage._optionalUint32 != rhs_storage._optionalUint32 {return false} + if _storage._optionalUint64 != rhs_storage._optionalUint64 {return false} + if _storage._optionalSint32 != rhs_storage._optionalSint32 {return false} + if _storage._optionalSint64 != rhs_storage._optionalSint64 {return false} + if _storage._optionalFixed32 != rhs_storage._optionalFixed32 {return false} + if _storage._optionalFixed64 != rhs_storage._optionalFixed64 {return false} + if _storage._optionalSfixed32 != rhs_storage._optionalSfixed32 {return false} + if _storage._optionalSfixed64 != rhs_storage._optionalSfixed64 {return false} + if _storage._optionalFloat != rhs_storage._optionalFloat {return false} + if _storage._optionalDouble != rhs_storage._optionalDouble {return false} + if _storage._optionalBool != rhs_storage._optionalBool {return false} + if _storage._optionalString != rhs_storage._optionalString {return false} + if _storage._optionalBytes != rhs_storage._optionalBytes {return false} + if _storage._optionalNestedMessage != rhs_storage._optionalNestedMessage {return false} + if _storage._optionalForeignMessage != rhs_storage._optionalForeignMessage {return false} + if _storage._optionalImportMessage != rhs_storage._optionalImportMessage {return false} + if _storage._optionalNestedEnum != rhs_storage._optionalNestedEnum {return false} + if _storage._optionalForeignEnum != rhs_storage._optionalForeignEnum {return false} + if _storage._optionalStringPiece != rhs_storage._optionalStringPiece {return false} + if _storage._optionalCord != rhs_storage._optionalCord {return false} + if _storage._optionalPublicImportMessage != rhs_storage._optionalPublicImportMessage {return false} + if _storage._optionalLazyMessage != rhs_storage._optionalLazyMessage {return false} + if _storage._optionalUnverifiedLazyMessage != rhs_storage._optionalUnverifiedLazyMessage {return false} + if _storage._optionalLazyImportMessage != rhs_storage._optionalLazyImportMessage {return false} + if _storage._repeatedInt32 != rhs_storage._repeatedInt32 {return false} + if _storage._repeatedInt64 != rhs_storage._repeatedInt64 {return false} + if _storage._repeatedUint32 != rhs_storage._repeatedUint32 {return false} + if _storage._repeatedUint64 != rhs_storage._repeatedUint64 {return false} + if _storage._repeatedSint32 != rhs_storage._repeatedSint32 {return false} + if _storage._repeatedSint64 != rhs_storage._repeatedSint64 {return false} + if _storage._repeatedFixed32 != rhs_storage._repeatedFixed32 {return false} + if _storage._repeatedFixed64 != rhs_storage._repeatedFixed64 {return false} + if _storage._repeatedSfixed32 != rhs_storage._repeatedSfixed32 {return false} + if _storage._repeatedSfixed64 != rhs_storage._repeatedSfixed64 {return false} + if _storage._repeatedFloat != rhs_storage._repeatedFloat {return false} + if _storage._repeatedDouble != rhs_storage._repeatedDouble {return false} + if _storage._repeatedBool != rhs_storage._repeatedBool {return false} + if _storage._repeatedString != rhs_storage._repeatedString {return false} + if _storage._repeatedBytes != rhs_storage._repeatedBytes {return false} + if _storage._proto3OptionalInt32 != rhs_storage._proto3OptionalInt32 {return false} + if _storage._proto3OptionalInt64 != rhs_storage._proto3OptionalInt64 {return false} + if _storage._proto3OptionalUint32 != rhs_storage._proto3OptionalUint32 {return false} + if _storage._proto3OptionalUint64 != rhs_storage._proto3OptionalUint64 {return false} + if _storage._proto3OptionalSint32 != rhs_storage._proto3OptionalSint32 {return false} + if _storage._proto3OptionalSint64 != rhs_storage._proto3OptionalSint64 {return false} + if _storage._proto3OptionalFixed32 != rhs_storage._proto3OptionalFixed32 {return false} + if _storage._proto3OptionalFixed64 != rhs_storage._proto3OptionalFixed64 {return false} + if _storage._proto3OptionalSfixed32 != rhs_storage._proto3OptionalSfixed32 {return false} + if _storage._proto3OptionalSfixed64 != rhs_storage._proto3OptionalSfixed64 {return false} + if _storage._proto3OptionalFloat != rhs_storage._proto3OptionalFloat {return false} + if _storage._proto3OptionalDouble != rhs_storage._proto3OptionalDouble {return false} + if _storage._proto3OptionalBool != rhs_storage._proto3OptionalBool {return false} + if _storage._proto3OptionalString != rhs_storage._proto3OptionalString {return false} + if _storage._proto3OptionalBytes != rhs_storage._proto3OptionalBytes {return false} + if _storage._repeatedNestedMessage != rhs_storage._repeatedNestedMessage {return false} + if _storage._repeatedForeignMessage != rhs_storage._repeatedForeignMessage {return false} + if _storage._repeatedImportMessage != rhs_storage._repeatedImportMessage {return false} + if _storage._repeatedNestedEnum != rhs_storage._repeatedNestedEnum {return false} + if _storage._repeatedForeignEnum != rhs_storage._repeatedForeignEnum {return false} + if _storage._repeatedStringPiece != rhs_storage._repeatedStringPiece {return false} + if _storage._repeatedCord != rhs_storage._repeatedCord {return false} + if _storage._repeatedLazyMessage != rhs_storage._repeatedLazyMessage {return false} + if _storage._oneofField != rhs_storage._oneofField {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3ArenaUnittest_TestAllTypes.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + -1: .same(proto: "NEG"), + 0: .same(proto: "ZERO"), + 1: .same(proto: "FOO"), + 2: .same(proto: "BAR"), + 3: .same(proto: "BAZ"), + ] +} + +extension Proto3ArenaUnittest_TestAllTypes.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Proto3ArenaUnittest_TestAllTypes.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "bb"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.bb) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.bb != 0 { + try visitor.visitSingularInt32Field(value: self.bb, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3ArenaUnittest_TestAllTypes.NestedMessage, rhs: Proto3ArenaUnittest_TestAllTypes.NestedMessage) -> Bool { + if lhs.bb != rhs.bb {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3ArenaUnittest_TestPackedTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestPackedTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 90: .standard(proto: "packed_int32"), + 91: .standard(proto: "packed_int64"), + 92: .standard(proto: "packed_uint32"), + 93: .standard(proto: "packed_uint64"), + 94: .standard(proto: "packed_sint32"), + 95: .standard(proto: "packed_sint64"), + 96: .standard(proto: "packed_fixed32"), + 97: .standard(proto: "packed_fixed64"), + 98: .standard(proto: "packed_sfixed32"), + 99: .standard(proto: "packed_sfixed64"), + 100: .standard(proto: "packed_float"), + 101: .standard(proto: "packed_double"), + 102: .standard(proto: "packed_bool"), + 103: .standard(proto: "packed_enum"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 90: try { try decoder.decodeRepeatedInt32Field(value: &self.packedInt32) }() + case 91: try { try decoder.decodeRepeatedInt64Field(value: &self.packedInt64) }() + case 92: try { try decoder.decodeRepeatedUInt32Field(value: &self.packedUint32) }() + case 93: try { try decoder.decodeRepeatedUInt64Field(value: &self.packedUint64) }() + case 94: try { try decoder.decodeRepeatedSInt32Field(value: &self.packedSint32) }() + case 95: try { try decoder.decodeRepeatedSInt64Field(value: &self.packedSint64) }() + case 96: try { try decoder.decodeRepeatedFixed32Field(value: &self.packedFixed32) }() + case 97: try { try decoder.decodeRepeatedFixed64Field(value: &self.packedFixed64) }() + case 98: try { try decoder.decodeRepeatedSFixed32Field(value: &self.packedSfixed32) }() + case 99: try { try decoder.decodeRepeatedSFixed64Field(value: &self.packedSfixed64) }() + case 100: try { try decoder.decodeRepeatedFloatField(value: &self.packedFloat) }() + case 101: try { try decoder.decodeRepeatedDoubleField(value: &self.packedDouble) }() + case 102: try { try decoder.decodeRepeatedBoolField(value: &self.packedBool) }() + case 103: try { try decoder.decodeRepeatedEnumField(value: &self.packedEnum) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.packedInt32.isEmpty { + try visitor.visitPackedInt32Field(value: self.packedInt32, fieldNumber: 90) + } + if !self.packedInt64.isEmpty { + try visitor.visitPackedInt64Field(value: self.packedInt64, fieldNumber: 91) + } + if !self.packedUint32.isEmpty { + try visitor.visitPackedUInt32Field(value: self.packedUint32, fieldNumber: 92) + } + if !self.packedUint64.isEmpty { + try visitor.visitPackedUInt64Field(value: self.packedUint64, fieldNumber: 93) + } + if !self.packedSint32.isEmpty { + try visitor.visitPackedSInt32Field(value: self.packedSint32, fieldNumber: 94) + } + if !self.packedSint64.isEmpty { + try visitor.visitPackedSInt64Field(value: self.packedSint64, fieldNumber: 95) + } + if !self.packedFixed32.isEmpty { + try visitor.visitPackedFixed32Field(value: self.packedFixed32, fieldNumber: 96) + } + if !self.packedFixed64.isEmpty { + try visitor.visitPackedFixed64Field(value: self.packedFixed64, fieldNumber: 97) + } + if !self.packedSfixed32.isEmpty { + try visitor.visitPackedSFixed32Field(value: self.packedSfixed32, fieldNumber: 98) + } + if !self.packedSfixed64.isEmpty { + try visitor.visitPackedSFixed64Field(value: self.packedSfixed64, fieldNumber: 99) + } + if !self.packedFloat.isEmpty { + try visitor.visitPackedFloatField(value: self.packedFloat, fieldNumber: 100) + } + if !self.packedDouble.isEmpty { + try visitor.visitPackedDoubleField(value: self.packedDouble, fieldNumber: 101) + } + if !self.packedBool.isEmpty { + try visitor.visitPackedBoolField(value: self.packedBool, fieldNumber: 102) + } + if !self.packedEnum.isEmpty { + try visitor.visitPackedEnumField(value: self.packedEnum, fieldNumber: 103) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3ArenaUnittest_TestPackedTypes, rhs: Proto3ArenaUnittest_TestPackedTypes) -> Bool { + if lhs.packedInt32 != rhs.packedInt32 {return false} + if lhs.packedInt64 != rhs.packedInt64 {return false} + if lhs.packedUint32 != rhs.packedUint32 {return false} + if lhs.packedUint64 != rhs.packedUint64 {return false} + if lhs.packedSint32 != rhs.packedSint32 {return false} + if lhs.packedSint64 != rhs.packedSint64 {return false} + if lhs.packedFixed32 != rhs.packedFixed32 {return false} + if lhs.packedFixed64 != rhs.packedFixed64 {return false} + if lhs.packedSfixed32 != rhs.packedSfixed32 {return false} + if lhs.packedSfixed64 != rhs.packedSfixed64 {return false} + if lhs.packedFloat != rhs.packedFloat {return false} + if lhs.packedDouble != rhs.packedDouble {return false} + if lhs.packedBool != rhs.packedBool {return false} + if lhs.packedEnum != rhs.packedEnum {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3ArenaUnittest_TestUnpackedTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestUnpackedTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "repeated_int32"), + 2: .standard(proto: "repeated_int64"), + 3: .standard(proto: "repeated_uint32"), + 4: .standard(proto: "repeated_uint64"), + 5: .standard(proto: "repeated_sint32"), + 6: .standard(proto: "repeated_sint64"), + 7: .standard(proto: "repeated_fixed32"), + 8: .standard(proto: "repeated_fixed64"), + 9: .standard(proto: "repeated_sfixed32"), + 10: .standard(proto: "repeated_sfixed64"), + 11: .standard(proto: "repeated_float"), + 12: .standard(proto: "repeated_double"), + 13: .standard(proto: "repeated_bool"), + 14: .standard(proto: "repeated_nested_enum"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedInt32Field(value: &self.repeatedInt32) }() + case 2: try { try decoder.decodeRepeatedInt64Field(value: &self.repeatedInt64) }() + case 3: try { try decoder.decodeRepeatedUInt32Field(value: &self.repeatedUint32) }() + case 4: try { try decoder.decodeRepeatedUInt64Field(value: &self.repeatedUint64) }() + case 5: try { try decoder.decodeRepeatedSInt32Field(value: &self.repeatedSint32) }() + case 6: try { try decoder.decodeRepeatedSInt64Field(value: &self.repeatedSint64) }() + case 7: try { try decoder.decodeRepeatedFixed32Field(value: &self.repeatedFixed32) }() + case 8: try { try decoder.decodeRepeatedFixed64Field(value: &self.repeatedFixed64) }() + case 9: try { try decoder.decodeRepeatedSFixed32Field(value: &self.repeatedSfixed32) }() + case 10: try { try decoder.decodeRepeatedSFixed64Field(value: &self.repeatedSfixed64) }() + case 11: try { try decoder.decodeRepeatedFloatField(value: &self.repeatedFloat) }() + case 12: try { try decoder.decodeRepeatedDoubleField(value: &self.repeatedDouble) }() + case 13: try { try decoder.decodeRepeatedBoolField(value: &self.repeatedBool) }() + case 14: try { try decoder.decodeRepeatedEnumField(value: &self.repeatedNestedEnum) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.repeatedInt32.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.repeatedInt32, fieldNumber: 1) + } + if !self.repeatedInt64.isEmpty { + try visitor.visitRepeatedInt64Field(value: self.repeatedInt64, fieldNumber: 2) + } + if !self.repeatedUint32.isEmpty { + try visitor.visitRepeatedUInt32Field(value: self.repeatedUint32, fieldNumber: 3) + } + if !self.repeatedUint64.isEmpty { + try visitor.visitRepeatedUInt64Field(value: self.repeatedUint64, fieldNumber: 4) + } + if !self.repeatedSint32.isEmpty { + try visitor.visitRepeatedSInt32Field(value: self.repeatedSint32, fieldNumber: 5) + } + if !self.repeatedSint64.isEmpty { + try visitor.visitRepeatedSInt64Field(value: self.repeatedSint64, fieldNumber: 6) + } + if !self.repeatedFixed32.isEmpty { + try visitor.visitRepeatedFixed32Field(value: self.repeatedFixed32, fieldNumber: 7) + } + if !self.repeatedFixed64.isEmpty { + try visitor.visitRepeatedFixed64Field(value: self.repeatedFixed64, fieldNumber: 8) + } + if !self.repeatedSfixed32.isEmpty { + try visitor.visitRepeatedSFixed32Field(value: self.repeatedSfixed32, fieldNumber: 9) + } + if !self.repeatedSfixed64.isEmpty { + try visitor.visitRepeatedSFixed64Field(value: self.repeatedSfixed64, fieldNumber: 10) + } + if !self.repeatedFloat.isEmpty { + try visitor.visitRepeatedFloatField(value: self.repeatedFloat, fieldNumber: 11) + } + if !self.repeatedDouble.isEmpty { + try visitor.visitRepeatedDoubleField(value: self.repeatedDouble, fieldNumber: 12) + } + if !self.repeatedBool.isEmpty { + try visitor.visitRepeatedBoolField(value: self.repeatedBool, fieldNumber: 13) + } + if !self.repeatedNestedEnum.isEmpty { + try visitor.visitRepeatedEnumField(value: self.repeatedNestedEnum, fieldNumber: 14) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3ArenaUnittest_TestUnpackedTypes, rhs: Proto3ArenaUnittest_TestUnpackedTypes) -> Bool { + if lhs.repeatedInt32 != rhs.repeatedInt32 {return false} + if lhs.repeatedInt64 != rhs.repeatedInt64 {return false} + if lhs.repeatedUint32 != rhs.repeatedUint32 {return false} + if lhs.repeatedUint64 != rhs.repeatedUint64 {return false} + if lhs.repeatedSint32 != rhs.repeatedSint32 {return false} + if lhs.repeatedSint64 != rhs.repeatedSint64 {return false} + if lhs.repeatedFixed32 != rhs.repeatedFixed32 {return false} + if lhs.repeatedFixed64 != rhs.repeatedFixed64 {return false} + if lhs.repeatedSfixed32 != rhs.repeatedSfixed32 {return false} + if lhs.repeatedSfixed64 != rhs.repeatedSfixed64 {return false} + if lhs.repeatedFloat != rhs.repeatedFloat {return false} + if lhs.repeatedDouble != rhs.repeatedDouble {return false} + if lhs.repeatedBool != rhs.repeatedBool {return false} + if lhs.repeatedNestedEnum != rhs.repeatedNestedEnum {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3ArenaUnittest_NestedTestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".NestedTestAllTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "child"), + 2: .same(proto: "payload"), + 3: .standard(proto: "repeated_child"), + 4: .standard(proto: "lazy_payload"), + ] + + fileprivate class _StorageClass { + var _child: Proto3ArenaUnittest_NestedTestAllTypes? = nil + var _payload: Proto3ArenaUnittest_TestAllTypes? = nil + var _repeatedChild: [Proto3ArenaUnittest_NestedTestAllTypes] = [] + var _lazyPayload: Proto3ArenaUnittest_TestAllTypes? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _child = source._child + _payload = source._payload + _repeatedChild = source._repeatedChild + _lazyPayload = source._lazyPayload + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._child) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._payload) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedChild) }() + case 4: try { try decoder.decodeSingularMessageField(value: &_storage._lazyPayload) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._child { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._payload { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if !_storage._repeatedChild.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedChild, fieldNumber: 3) + } + try { if let v = _storage._lazyPayload { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3ArenaUnittest_NestedTestAllTypes, rhs: Proto3ArenaUnittest_NestedTestAllTypes) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._child != rhs_storage._child {return false} + if _storage._payload != rhs_storage._payload {return false} + if _storage._repeatedChild != rhs_storage._repeatedChild {return false} + if _storage._lazyPayload != rhs_storage._lazyPayload {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3ArenaUnittest_ForeignMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ForeignMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "c"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.c) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.c != 0 { + try visitor.visitSingularInt32Field(value: self.c, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3ArenaUnittest_ForeignMessage, rhs: Proto3ArenaUnittest_ForeignMessage) -> Bool { + if lhs.c != rhs.c {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3ArenaUnittest_TestEmptyMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestEmptyMessage" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3ArenaUnittest_TestEmptyMessage, rhs: Proto3ArenaUnittest_TestEmptyMessage) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3ArenaUnittest_TestPickleNestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestPickleNestedMessage" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3ArenaUnittest_TestPickleNestedMessage, rhs: Proto3ArenaUnittest_TestPickleNestedMessage) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Proto3ArenaUnittest_TestPickleNestedMessage.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "bb"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.bb) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.bb != 0 { + try visitor.visitSingularInt32Field(value: self.bb, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage, rhs: Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage) -> Bool { + if lhs.bb != rhs.bb {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage.NestedNestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage.protoMessageName + ".NestedNestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "cc"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.cc) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.cc != 0 { + try visitor.visitSingularInt32Field(value: self.cc, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage.NestedNestedMessage, rhs: Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage.NestedNestedMessage) -> Bool { + if lhs.cc != rhs.cc {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/SwiftProtobufTests/unittest_proto3_optional.pb.swift b/Reference/SwiftProtobufTests/unittest_proto3_optional.pb.swift new file mode 100644 index 000000000..c2cbfe36b --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_proto3_optional.pb.swift @@ -0,0 +1,822 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_proto3_optional.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +struct ProtobufUnittest_TestProto3Optional { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Singular + var optionalInt32: Int32 { + get {return _storage._optionalInt32 ?? 0} + set {_uniqueStorage()._optionalInt32 = newValue} + } + /// Returns true if `optionalInt32` has been explicitly set. + var hasOptionalInt32: Bool {return _storage._optionalInt32 != nil} + /// Clears the value of `optionalInt32`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt32() {_uniqueStorage()._optionalInt32 = nil} + + var optionalInt64: Int64 { + get {return _storage._optionalInt64 ?? 0} + set {_uniqueStorage()._optionalInt64 = newValue} + } + /// Returns true if `optionalInt64` has been explicitly set. + var hasOptionalInt64: Bool {return _storage._optionalInt64 != nil} + /// Clears the value of `optionalInt64`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt64() {_uniqueStorage()._optionalInt64 = nil} + + var optionalUint32: UInt32 { + get {return _storage._optionalUint32 ?? 0} + set {_uniqueStorage()._optionalUint32 = newValue} + } + /// Returns true if `optionalUint32` has been explicitly set. + var hasOptionalUint32: Bool {return _storage._optionalUint32 != nil} + /// Clears the value of `optionalUint32`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint32() {_uniqueStorage()._optionalUint32 = nil} + + var optionalUint64: UInt64 { + get {return _storage._optionalUint64 ?? 0} + set {_uniqueStorage()._optionalUint64 = newValue} + } + /// Returns true if `optionalUint64` has been explicitly set. + var hasOptionalUint64: Bool {return _storage._optionalUint64 != nil} + /// Clears the value of `optionalUint64`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint64() {_uniqueStorage()._optionalUint64 = nil} + + var optionalSint32: Int32 { + get {return _storage._optionalSint32 ?? 0} + set {_uniqueStorage()._optionalSint32 = newValue} + } + /// Returns true if `optionalSint32` has been explicitly set. + var hasOptionalSint32: Bool {return _storage._optionalSint32 != nil} + /// Clears the value of `optionalSint32`. Subsequent reads from it will return its default value. + mutating func clearOptionalSint32() {_uniqueStorage()._optionalSint32 = nil} + + var optionalSint64: Int64 { + get {return _storage._optionalSint64 ?? 0} + set {_uniqueStorage()._optionalSint64 = newValue} + } + /// Returns true if `optionalSint64` has been explicitly set. + var hasOptionalSint64: Bool {return _storage._optionalSint64 != nil} + /// Clears the value of `optionalSint64`. Subsequent reads from it will return its default value. + mutating func clearOptionalSint64() {_uniqueStorage()._optionalSint64 = nil} + + var optionalFixed32: UInt32 { + get {return _storage._optionalFixed32 ?? 0} + set {_uniqueStorage()._optionalFixed32 = newValue} + } + /// Returns true if `optionalFixed32` has been explicitly set. + var hasOptionalFixed32: Bool {return _storage._optionalFixed32 != nil} + /// Clears the value of `optionalFixed32`. Subsequent reads from it will return its default value. + mutating func clearOptionalFixed32() {_uniqueStorage()._optionalFixed32 = nil} + + var optionalFixed64: UInt64 { + get {return _storage._optionalFixed64 ?? 0} + set {_uniqueStorage()._optionalFixed64 = newValue} + } + /// Returns true if `optionalFixed64` has been explicitly set. + var hasOptionalFixed64: Bool {return _storage._optionalFixed64 != nil} + /// Clears the value of `optionalFixed64`. Subsequent reads from it will return its default value. + mutating func clearOptionalFixed64() {_uniqueStorage()._optionalFixed64 = nil} + + var optionalSfixed32: Int32 { + get {return _storage._optionalSfixed32 ?? 0} + set {_uniqueStorage()._optionalSfixed32 = newValue} + } + /// Returns true if `optionalSfixed32` has been explicitly set. + var hasOptionalSfixed32: Bool {return _storage._optionalSfixed32 != nil} + /// Clears the value of `optionalSfixed32`. Subsequent reads from it will return its default value. + mutating func clearOptionalSfixed32() {_uniqueStorage()._optionalSfixed32 = nil} + + var optionalSfixed64: Int64 { + get {return _storage._optionalSfixed64 ?? 0} + set {_uniqueStorage()._optionalSfixed64 = newValue} + } + /// Returns true if `optionalSfixed64` has been explicitly set. + var hasOptionalSfixed64: Bool {return _storage._optionalSfixed64 != nil} + /// Clears the value of `optionalSfixed64`. Subsequent reads from it will return its default value. + mutating func clearOptionalSfixed64() {_uniqueStorage()._optionalSfixed64 = nil} + + var optionalFloat: Float { + get {return _storage._optionalFloat ?? 0} + set {_uniqueStorage()._optionalFloat = newValue} + } + /// Returns true if `optionalFloat` has been explicitly set. + var hasOptionalFloat: Bool {return _storage._optionalFloat != nil} + /// Clears the value of `optionalFloat`. Subsequent reads from it will return its default value. + mutating func clearOptionalFloat() {_uniqueStorage()._optionalFloat = nil} + + var optionalDouble: Double { + get {return _storage._optionalDouble ?? 0} + set {_uniqueStorage()._optionalDouble = newValue} + } + /// Returns true if `optionalDouble` has been explicitly set. + var hasOptionalDouble: Bool {return _storage._optionalDouble != nil} + /// Clears the value of `optionalDouble`. Subsequent reads from it will return its default value. + mutating func clearOptionalDouble() {_uniqueStorage()._optionalDouble = nil} + + var optionalBool: Bool { + get {return _storage._optionalBool ?? false} + set {_uniqueStorage()._optionalBool = newValue} + } + /// Returns true if `optionalBool` has been explicitly set. + var hasOptionalBool: Bool {return _storage._optionalBool != nil} + /// Clears the value of `optionalBool`. Subsequent reads from it will return its default value. + mutating func clearOptionalBool() {_uniqueStorage()._optionalBool = nil} + + var optionalString: String { + get {return _storage._optionalString ?? String()} + set {_uniqueStorage()._optionalString = newValue} + } + /// Returns true if `optionalString` has been explicitly set. + var hasOptionalString: Bool {return _storage._optionalString != nil} + /// Clears the value of `optionalString`. Subsequent reads from it will return its default value. + mutating func clearOptionalString() {_uniqueStorage()._optionalString = nil} + + var optionalBytes: Data { + get {return _storage._optionalBytes ?? Data()} + set {_uniqueStorage()._optionalBytes = newValue} + } + /// Returns true if `optionalBytes` has been explicitly set. + var hasOptionalBytes: Bool {return _storage._optionalBytes != nil} + /// Clears the value of `optionalBytes`. Subsequent reads from it will return its default value. + mutating func clearOptionalBytes() {_uniqueStorage()._optionalBytes = nil} + + var optionalCord: String { + get {return _storage._optionalCord ?? String()} + set {_uniqueStorage()._optionalCord = newValue} + } + /// Returns true if `optionalCord` has been explicitly set. + var hasOptionalCord: Bool {return _storage._optionalCord != nil} + /// Clears the value of `optionalCord`. Subsequent reads from it will return its default value. + mutating func clearOptionalCord() {_uniqueStorage()._optionalCord = nil} + + var optionalNestedMessage: ProtobufUnittest_TestProto3Optional.NestedMessage { + get {return _storage._optionalNestedMessage ?? ProtobufUnittest_TestProto3Optional.NestedMessage()} + set {_uniqueStorage()._optionalNestedMessage = newValue} + } + /// Returns true if `optionalNestedMessage` has been explicitly set. + var hasOptionalNestedMessage: Bool {return _storage._optionalNestedMessage != nil} + /// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedMessage() {_uniqueStorage()._optionalNestedMessage = nil} + + var lazyNestedMessage: ProtobufUnittest_TestProto3Optional.NestedMessage { + get {return _storage._lazyNestedMessage ?? ProtobufUnittest_TestProto3Optional.NestedMessage()} + set {_uniqueStorage()._lazyNestedMessage = newValue} + } + /// Returns true if `lazyNestedMessage` has been explicitly set. + var hasLazyNestedMessage: Bool {return _storage._lazyNestedMessage != nil} + /// Clears the value of `lazyNestedMessage`. Subsequent reads from it will return its default value. + mutating func clearLazyNestedMessage() {_uniqueStorage()._lazyNestedMessage = nil} + + var optionalNestedEnum: ProtobufUnittest_TestProto3Optional.NestedEnum { + get {return _storage._optionalNestedEnum ?? .unspecified} + set {_uniqueStorage()._optionalNestedEnum = newValue} + } + /// Returns true if `optionalNestedEnum` has been explicitly set. + var hasOptionalNestedEnum: Bool {return _storage._optionalNestedEnum != nil} + /// Clears the value of `optionalNestedEnum`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedEnum() {_uniqueStorage()._optionalNestedEnum = nil} + + /// Add some non-optional fields to verify we can mix them. + var singularInt32: Int32 { + get {return _storage._singularInt32} + set {_uniqueStorage()._singularInt32 = newValue} + } + + var singularInt64: Int64 { + get {return _storage._singularInt64} + set {_uniqueStorage()._singularInt64 = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case unspecified // = 0 + case foo // = 1 + case bar // = 2 + case baz // = 3 + + /// Intentionally negative. + case neg // = -1 + case UNRECOGNIZED(Int) + + init() { + self = .unspecified + } + + init?(rawValue: Int) { + switch rawValue { + case -1: self = .neg + case 0: self = .unspecified + case 1: self = .foo + case 2: self = .bar + case 3: self = .baz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .neg: return -1 + case .unspecified: return 0 + case .foo: return 1 + case .bar: return 2 + case .baz: return 3 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [ProtobufUnittest_TestProto3Optional.NestedEnum] = [ + .unspecified, + .foo, + .bar, + .baz, + .neg, + ] + + } + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The field name "b" fails to compile in proto1 because it conflicts with + /// a local variable named "b" in one of the generated methods. Doh. + /// This file needs to compile in proto1 to test backwards-compatibility. + var bb: Int32 { + get {return _bb ?? 0} + set {_bb = newValue} + } + /// Returns true if `bb` has been explicitly set. + var hasBb: Bool {return self._bb != nil} + /// Clears the value of `bb`. Subsequent reads from it will return its default value. + mutating func clearBb() {self._bb = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _bb: Int32? = nil + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufUnittest_TestProto3OptionalMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var nestedMessage: ProtobufUnittest_TestProto3OptionalMessage.NestedMessage { + get {return _nestedMessage ?? ProtobufUnittest_TestProto3OptionalMessage.NestedMessage()} + set {_nestedMessage = newValue} + } + /// Returns true if `nestedMessage` has been explicitly set. + var hasNestedMessage: Bool {return self._nestedMessage != nil} + /// Clears the value of `nestedMessage`. Subsequent reads from it will return its default value. + mutating func clearNestedMessage() {self._nestedMessage = nil} + + var optionalNestedMessage: ProtobufUnittest_TestProto3OptionalMessage.NestedMessage { + get {return _optionalNestedMessage ?? ProtobufUnittest_TestProto3OptionalMessage.NestedMessage()} + set {_optionalNestedMessage = newValue} + } + /// Returns true if `optionalNestedMessage` has been explicitly set. + var hasOptionalNestedMessage: Bool {return self._optionalNestedMessage != nil} + /// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedMessage() {self._optionalNestedMessage = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var s: String = String() + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + } + + init() {} + + fileprivate var _nestedMessage: ProtobufUnittest_TestProto3OptionalMessage.NestedMessage? = nil + fileprivate var _optionalNestedMessage: ProtobufUnittest_TestProto3OptionalMessage.NestedMessage? = nil +} + +struct ProtobufUnittest_Proto3OptionalExtensions { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittest_TestProto3Optional: @unchecked Sendable {} +extension ProtobufUnittest_TestProto3Optional.NestedMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestProto3OptionalMessage: @unchecked Sendable {} +extension ProtobufUnittest_TestProto3OptionalMessage.NestedMessage: @unchecked Sendable {} +extension ProtobufUnittest_Proto3OptionalExtensions: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Extension support defined in unittest_proto3_optional.proto. + +// MARK: - Extension Properties + +// Swift Extensions on the exteneded Messages to add easy access to the declared +// extension fields. The names are based on the extension field name from the proto +// declaration. To avoid naming collisions, the names are prefixed with the name of +// the scope where the extend directive occurs. + +extension SwiftProtobuf.Google_Protobuf_MessageOptions { + + var ProtobufUnittest_Proto3OptionalExtensions_extNoOptional: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Proto3OptionalExtensions.Extensions.ext_no_optional) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Proto3OptionalExtensions.Extensions.ext_no_optional, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Proto3OptionalExtensions.Extensions.ext_no_optional` + /// has been explicitly set. + var hasProtobufUnittest_Proto3OptionalExtensions_extNoOptional: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Proto3OptionalExtensions.Extensions.ext_no_optional) + } + /// Clears the value of extension `ProtobufUnittest_Proto3OptionalExtensions.Extensions.ext_no_optional`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_Proto3OptionalExtensions_extNoOptional() { + clearExtensionValue(ext: ProtobufUnittest_Proto3OptionalExtensions.Extensions.ext_no_optional) + } + + var ProtobufUnittest_Proto3OptionalExtensions_extWithOptional: Int32 { + get {return getExtensionValue(ext: ProtobufUnittest_Proto3OptionalExtensions.Extensions.ext_with_optional) ?? 0} + set {setExtensionValue(ext: ProtobufUnittest_Proto3OptionalExtensions.Extensions.ext_with_optional, value: newValue)} + } + /// Returns true if extension `ProtobufUnittest_Proto3OptionalExtensions.Extensions.ext_with_optional` + /// has been explicitly set. + var hasProtobufUnittest_Proto3OptionalExtensions_extWithOptional: Bool { + return hasExtensionValue(ext: ProtobufUnittest_Proto3OptionalExtensions.Extensions.ext_with_optional) + } + /// Clears the value of extension `ProtobufUnittest_Proto3OptionalExtensions.Extensions.ext_with_optional`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufUnittest_Proto3OptionalExtensions_extWithOptional() { + clearExtensionValue(ext: ProtobufUnittest_Proto3OptionalExtensions.Extensions.ext_with_optional) + } + +} + +// MARK: - File's ExtensionMap: ProtobufUnittest_UnittestProto3Optional_Extensions + +/// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by +/// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed +/// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create +/// a larger `SwiftProtobuf.SimpleExtensionMap`. +let ProtobufUnittest_UnittestProto3Optional_Extensions: SwiftProtobuf.SimpleExtensionMap = [ + ProtobufUnittest_Proto3OptionalExtensions.Extensions.ext_no_optional, + ProtobufUnittest_Proto3OptionalExtensions.Extensions.ext_with_optional +] + +// Extension Objects - The only reason these might be needed is when manually +// constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_ +// accessors for the extension fields on the messages directly. + +extension ProtobufUnittest_Proto3OptionalExtensions { + enum Extensions { + static let ext_no_optional = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 355886728, + fieldName: "protobuf_unittest.Proto3OptionalExtensions.ext_no_optional" + ) + + static let ext_with_optional = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_MessageOptions>( + _protobuf_fieldNumber: 355886729, + fieldName: "protobuf_unittest.Proto3OptionalExtensions.ext_with_optional" + ) + } +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest" + +extension ProtobufUnittest_TestProto3Optional: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestProto3Optional" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_int32"), + 2: .standard(proto: "optional_int64"), + 3: .standard(proto: "optional_uint32"), + 4: .standard(proto: "optional_uint64"), + 5: .standard(proto: "optional_sint32"), + 6: .standard(proto: "optional_sint64"), + 7: .standard(proto: "optional_fixed32"), + 8: .standard(proto: "optional_fixed64"), + 9: .standard(proto: "optional_sfixed32"), + 10: .standard(proto: "optional_sfixed64"), + 11: .standard(proto: "optional_float"), + 12: .standard(proto: "optional_double"), + 13: .standard(proto: "optional_bool"), + 14: .standard(proto: "optional_string"), + 15: .standard(proto: "optional_bytes"), + 16: .standard(proto: "optional_cord"), + 18: .standard(proto: "optional_nested_message"), + 19: .standard(proto: "lazy_nested_message"), + 21: .standard(proto: "optional_nested_enum"), + 22: .standard(proto: "singular_int32"), + 23: .standard(proto: "singular_int64"), + ] + + fileprivate class _StorageClass { + var _optionalInt32: Int32? = nil + var _optionalInt64: Int64? = nil + var _optionalUint32: UInt32? = nil + var _optionalUint64: UInt64? = nil + var _optionalSint32: Int32? = nil + var _optionalSint64: Int64? = nil + var _optionalFixed32: UInt32? = nil + var _optionalFixed64: UInt64? = nil + var _optionalSfixed32: Int32? = nil + var _optionalSfixed64: Int64? = nil + var _optionalFloat: Float? = nil + var _optionalDouble: Double? = nil + var _optionalBool: Bool? = nil + var _optionalString: String? = nil + var _optionalBytes: Data? = nil + var _optionalCord: String? = nil + var _optionalNestedMessage: ProtobufUnittest_TestProto3Optional.NestedMessage? = nil + var _lazyNestedMessage: ProtobufUnittest_TestProto3Optional.NestedMessage? = nil + var _optionalNestedEnum: ProtobufUnittest_TestProto3Optional.NestedEnum? = nil + var _singularInt32: Int32 = 0 + var _singularInt64: Int64 = 0 + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _optionalInt32 = source._optionalInt32 + _optionalInt64 = source._optionalInt64 + _optionalUint32 = source._optionalUint32 + _optionalUint64 = source._optionalUint64 + _optionalSint32 = source._optionalSint32 + _optionalSint64 = source._optionalSint64 + _optionalFixed32 = source._optionalFixed32 + _optionalFixed64 = source._optionalFixed64 + _optionalSfixed32 = source._optionalSfixed32 + _optionalSfixed64 = source._optionalSfixed64 + _optionalFloat = source._optionalFloat + _optionalDouble = source._optionalDouble + _optionalBool = source._optionalBool + _optionalString = source._optionalString + _optionalBytes = source._optionalBytes + _optionalCord = source._optionalCord + _optionalNestedMessage = source._optionalNestedMessage + _lazyNestedMessage = source._lazyNestedMessage + _optionalNestedEnum = source._optionalNestedEnum + _singularInt32 = source._singularInt32 + _singularInt64 = source._singularInt64 + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._optionalInt32) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._optionalInt64) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint32) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._optionalUint64) }() + case 5: try { try decoder.decodeSingularSInt32Field(value: &_storage._optionalSint32) }() + case 6: try { try decoder.decodeSingularSInt64Field(value: &_storage._optionalSint64) }() + case 7: try { try decoder.decodeSingularFixed32Field(value: &_storage._optionalFixed32) }() + case 8: try { try decoder.decodeSingularFixed64Field(value: &_storage._optionalFixed64) }() + case 9: try { try decoder.decodeSingularSFixed32Field(value: &_storage._optionalSfixed32) }() + case 10: try { try decoder.decodeSingularSFixed64Field(value: &_storage._optionalSfixed64) }() + case 11: try { try decoder.decodeSingularFloatField(value: &_storage._optionalFloat) }() + case 12: try { try decoder.decodeSingularDoubleField(value: &_storage._optionalDouble) }() + case 13: try { try decoder.decodeSingularBoolField(value: &_storage._optionalBool) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._optionalString) }() + case 15: try { try decoder.decodeSingularBytesField(value: &_storage._optionalBytes) }() + case 16: try { try decoder.decodeSingularStringField(value: &_storage._optionalCord) }() + case 18: try { try decoder.decodeSingularMessageField(value: &_storage._optionalNestedMessage) }() + case 19: try { try decoder.decodeSingularMessageField(value: &_storage._lazyNestedMessage) }() + case 21: try { try decoder.decodeSingularEnumField(value: &_storage._optionalNestedEnum) }() + case 22: try { try decoder.decodeSingularInt32Field(value: &_storage._singularInt32) }() + case 23: try { try decoder.decodeSingularInt64Field(value: &_storage._singularInt64) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._optionalInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._optionalInt64 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._optionalUint32 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._optionalUint64 { + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._optionalSint32 { + try visitor.visitSingularSInt32Field(value: v, fieldNumber: 5) + } }() + try { if let v = _storage._optionalSint64 { + try visitor.visitSingularSInt64Field(value: v, fieldNumber: 6) + } }() + try { if let v = _storage._optionalFixed32 { + try visitor.visitSingularFixed32Field(value: v, fieldNumber: 7) + } }() + try { if let v = _storage._optionalFixed64 { + try visitor.visitSingularFixed64Field(value: v, fieldNumber: 8) + } }() + try { if let v = _storage._optionalSfixed32 { + try visitor.visitSingularSFixed32Field(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._optionalSfixed64 { + try visitor.visitSingularSFixed64Field(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._optionalFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 11) + } }() + try { if let v = _storage._optionalDouble { + try visitor.visitSingularDoubleField(value: v, fieldNumber: 12) + } }() + try { if let v = _storage._optionalBool { + try visitor.visitSingularBoolField(value: v, fieldNumber: 13) + } }() + try { if let v = _storage._optionalString { + try visitor.visitSingularStringField(value: v, fieldNumber: 14) + } }() + try { if let v = _storage._optionalBytes { + try visitor.visitSingularBytesField(value: v, fieldNumber: 15) + } }() + try { if let v = _storage._optionalCord { + try visitor.visitSingularStringField(value: v, fieldNumber: 16) + } }() + try { if let v = _storage._optionalNestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._lazyNestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + } }() + try { if let v = _storage._optionalNestedEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 21) + } }() + if _storage._singularInt32 != 0 { + try visitor.visitSingularInt32Field(value: _storage._singularInt32, fieldNumber: 22) + } + if _storage._singularInt64 != 0 { + try visitor.visitSingularInt64Field(value: _storage._singularInt64, fieldNumber: 23) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestProto3Optional, rhs: ProtobufUnittest_TestProto3Optional) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._optionalInt32 != rhs_storage._optionalInt32 {return false} + if _storage._optionalInt64 != rhs_storage._optionalInt64 {return false} + if _storage._optionalUint32 != rhs_storage._optionalUint32 {return false} + if _storage._optionalUint64 != rhs_storage._optionalUint64 {return false} + if _storage._optionalSint32 != rhs_storage._optionalSint32 {return false} + if _storage._optionalSint64 != rhs_storage._optionalSint64 {return false} + if _storage._optionalFixed32 != rhs_storage._optionalFixed32 {return false} + if _storage._optionalFixed64 != rhs_storage._optionalFixed64 {return false} + if _storage._optionalSfixed32 != rhs_storage._optionalSfixed32 {return false} + if _storage._optionalSfixed64 != rhs_storage._optionalSfixed64 {return false} + if _storage._optionalFloat != rhs_storage._optionalFloat {return false} + if _storage._optionalDouble != rhs_storage._optionalDouble {return false} + if _storage._optionalBool != rhs_storage._optionalBool {return false} + if _storage._optionalString != rhs_storage._optionalString {return false} + if _storage._optionalBytes != rhs_storage._optionalBytes {return false} + if _storage._optionalCord != rhs_storage._optionalCord {return false} + if _storage._optionalNestedMessage != rhs_storage._optionalNestedMessage {return false} + if _storage._lazyNestedMessage != rhs_storage._lazyNestedMessage {return false} + if _storage._optionalNestedEnum != rhs_storage._optionalNestedEnum {return false} + if _storage._singularInt32 != rhs_storage._singularInt32 {return false} + if _storage._singularInt64 != rhs_storage._singularInt64 {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestProto3Optional.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + -1: .same(proto: "NEG"), + 0: .same(proto: "UNSPECIFIED"), + 1: .same(proto: "FOO"), + 2: .same(proto: "BAR"), + 3: .same(proto: "BAZ"), + ] +} + +extension ProtobufUnittest_TestProto3Optional.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestProto3Optional.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "bb"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._bb) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._bb { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestProto3Optional.NestedMessage, rhs: ProtobufUnittest_TestProto3Optional.NestedMessage) -> Bool { + if lhs._bb != rhs._bb {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestProto3OptionalMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestProto3OptionalMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "nested_message"), + 2: .standard(proto: "optional_nested_message"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._nestedMessage) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._optionalNestedMessage) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._nestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._optionalNestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestProto3OptionalMessage, rhs: ProtobufUnittest_TestProto3OptionalMessage) -> Bool { + if lhs._nestedMessage != rhs._nestedMessage {return false} + if lhs._optionalNestedMessage != rhs._optionalNestedMessage {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_TestProto3OptionalMessage.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufUnittest_TestProto3OptionalMessage.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "s"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.s) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.s.isEmpty { + try visitor.visitSingularStringField(value: self.s, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestProto3OptionalMessage.NestedMessage, rhs: ProtobufUnittest_TestProto3OptionalMessage.NestedMessage) -> Bool { + if lhs.s != rhs.s {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_Proto3OptionalExtensions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Proto3OptionalExtensions" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_Proto3OptionalExtensions, rhs: ProtobufUnittest_Proto3OptionalExtensions) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/unittest_swift_all_required_types.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_all_required_types.pb.swift similarity index 100% rename from Reference/unittest_swift_all_required_types.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_all_required_types.pb.swift diff --git a/Reference/unittest_swift_cycle.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_cycle.pb.swift similarity index 100% rename from Reference/unittest_swift_cycle.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_cycle.pb.swift diff --git a/Reference/unittest_swift_enum.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_enum.pb.swift similarity index 100% rename from Reference/unittest_swift_enum.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_enum.pb.swift diff --git a/Reference/unittest_swift_enum_optional_default.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_enum_optional_default.pb.swift similarity index 100% rename from Reference/unittest_swift_enum_optional_default.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_enum_optional_default.pb.swift diff --git a/Reference/unittest_swift_enum_proto3.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_enum_proto3.pb.swift similarity index 100% rename from Reference/unittest_swift_enum_proto3.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_enum_proto3.pb.swift diff --git a/Reference/unittest_swift_extension.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_extension.pb.swift similarity index 100% rename from Reference/unittest_swift_extension.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_extension.pb.swift diff --git a/Reference/unittest_swift_extension2.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_extension2.pb.swift similarity index 100% rename from Reference/unittest_swift_extension2.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_extension2.pb.swift diff --git a/Reference/unittest_swift_extension3.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_extension3.pb.swift similarity index 100% rename from Reference/unittest_swift_extension3.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_extension3.pb.swift diff --git a/Reference/unittest_swift_extension4.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_extension4.pb.swift similarity index 100% rename from Reference/unittest_swift_extension4.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_extension4.pb.swift diff --git a/Reference/unittest_swift_fieldorder.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_fieldorder.pb.swift similarity index 100% rename from Reference/unittest_swift_fieldorder.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_fieldorder.pb.swift diff --git a/Reference/unittest_swift_groups.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_groups.pb.swift similarity index 100% rename from Reference/unittest_swift_groups.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_groups.pb.swift diff --git a/Reference/unittest_swift_json.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_json.pb.swift similarity index 100% rename from Reference/unittest_swift_json.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_json.pb.swift diff --git a/Reference/unittest_swift_naming.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_naming.pb.swift similarity index 100% rename from Reference/unittest_swift_naming.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_naming.pb.swift diff --git a/Reference/unittest_swift_naming_no_prefix.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_naming_no_prefix.pb.swift similarity index 100% rename from Reference/unittest_swift_naming_no_prefix.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_naming_no_prefix.pb.swift diff --git a/Reference/unittest_swift_naming_number_prefix.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_naming_number_prefix.pb.swift similarity index 100% rename from Reference/unittest_swift_naming_number_prefix.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_naming_number_prefix.pb.swift diff --git a/Reference/unittest_swift_oneof_all_required.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_oneof_all_required.pb.swift similarity index 100% rename from Reference/unittest_swift_oneof_all_required.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_oneof_all_required.pb.swift diff --git a/Reference/unittest_swift_oneof_merging.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_oneof_merging.pb.swift similarity index 100% rename from Reference/unittest_swift_oneof_merging.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_oneof_merging.pb.swift diff --git a/Reference/unittest_swift_performance.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_performance.pb.swift similarity index 100% rename from Reference/unittest_swift_performance.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_performance.pb.swift diff --git a/Reference/unittest_swift_reserved.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_reserved.pb.swift similarity index 100% rename from Reference/unittest_swift_reserved.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_reserved.pb.swift diff --git a/Reference/unittest_swift_reserved_ext.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_reserved_ext.pb.swift similarity index 100% rename from Reference/unittest_swift_reserved_ext.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_reserved_ext.pb.swift diff --git a/Reference/unittest_swift_runtime_proto2.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_runtime_proto2.pb.swift similarity index 100% rename from Reference/unittest_swift_runtime_proto2.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_runtime_proto2.pb.swift diff --git a/Reference/unittest_swift_runtime_proto3.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_runtime_proto3.pb.swift similarity index 100% rename from Reference/unittest_swift_runtime_proto3.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_runtime_proto3.pb.swift diff --git a/Reference/unittest_swift_startup.pb.swift b/Reference/SwiftProtobufTests/unittest_swift_startup.pb.swift similarity index 100% rename from Reference/unittest_swift_startup.pb.swift rename to Reference/SwiftProtobufTests/unittest_swift_startup.pb.swift diff --git a/Reference/SwiftProtobufTests/unittest_well_known_types.pb.swift b/Reference/SwiftProtobufTests/unittest_well_known_types.pb.swift new file mode 100644 index 000000000..8ee8719d9 --- /dev/null +++ b/Reference/SwiftProtobufTests/unittest_well_known_types.pb.swift @@ -0,0 +1,1607 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: unittest_well_known_types.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +/// Test that we can include all well-known types. +/// Each wrapper type is included separately, as languages +/// map handle different wrappers in different ways. +struct ProtobufUnittest_TestWellKnownTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var anyField: SwiftProtobuf.Google_Protobuf_Any { + get {return _storage._anyField ?? SwiftProtobuf.Google_Protobuf_Any()} + set {_uniqueStorage()._anyField = newValue} + } + /// Returns true if `anyField` has been explicitly set. + var hasAnyField: Bool {return _storage._anyField != nil} + /// Clears the value of `anyField`. Subsequent reads from it will return its default value. + mutating func clearAnyField() {_uniqueStorage()._anyField = nil} + + var apiField: SwiftProtobuf.Google_Protobuf_Api { + get {return _storage._apiField ?? SwiftProtobuf.Google_Protobuf_Api()} + set {_uniqueStorage()._apiField = newValue} + } + /// Returns true if `apiField` has been explicitly set. + var hasApiField: Bool {return _storage._apiField != nil} + /// Clears the value of `apiField`. Subsequent reads from it will return its default value. + mutating func clearApiField() {_uniqueStorage()._apiField = nil} + + var durationField: SwiftProtobuf.Google_Protobuf_Duration { + get {return _storage._durationField ?? SwiftProtobuf.Google_Protobuf_Duration()} + set {_uniqueStorage()._durationField = newValue} + } + /// Returns true if `durationField` has been explicitly set. + var hasDurationField: Bool {return _storage._durationField != nil} + /// Clears the value of `durationField`. Subsequent reads from it will return its default value. + mutating func clearDurationField() {_uniqueStorage()._durationField = nil} + + var emptyField: SwiftProtobuf.Google_Protobuf_Empty { + get {return _storage._emptyField ?? SwiftProtobuf.Google_Protobuf_Empty()} + set {_uniqueStorage()._emptyField = newValue} + } + /// Returns true if `emptyField` has been explicitly set. + var hasEmptyField: Bool {return _storage._emptyField != nil} + /// Clears the value of `emptyField`. Subsequent reads from it will return its default value. + mutating func clearEmptyField() {_uniqueStorage()._emptyField = nil} + + var fieldMaskField: SwiftProtobuf.Google_Protobuf_FieldMask { + get {return _storage._fieldMaskField ?? SwiftProtobuf.Google_Protobuf_FieldMask()} + set {_uniqueStorage()._fieldMaskField = newValue} + } + /// Returns true if `fieldMaskField` has been explicitly set. + var hasFieldMaskField: Bool {return _storage._fieldMaskField != nil} + /// Clears the value of `fieldMaskField`. Subsequent reads from it will return its default value. + mutating func clearFieldMaskField() {_uniqueStorage()._fieldMaskField = nil} + + var sourceContextField: SwiftProtobuf.Google_Protobuf_SourceContext { + get {return _storage._sourceContextField ?? SwiftProtobuf.Google_Protobuf_SourceContext()} + set {_uniqueStorage()._sourceContextField = newValue} + } + /// Returns true if `sourceContextField` has been explicitly set. + var hasSourceContextField: Bool {return _storage._sourceContextField != nil} + /// Clears the value of `sourceContextField`. Subsequent reads from it will return its default value. + mutating func clearSourceContextField() {_uniqueStorage()._sourceContextField = nil} + + var structField: SwiftProtobuf.Google_Protobuf_Struct { + get {return _storage._structField ?? SwiftProtobuf.Google_Protobuf_Struct()} + set {_uniqueStorage()._structField = newValue} + } + /// Returns true if `structField` has been explicitly set. + var hasStructField: Bool {return _storage._structField != nil} + /// Clears the value of `structField`. Subsequent reads from it will return its default value. + mutating func clearStructField() {_uniqueStorage()._structField = nil} + + var timestampField: SwiftProtobuf.Google_Protobuf_Timestamp { + get {return _storage._timestampField ?? SwiftProtobuf.Google_Protobuf_Timestamp()} + set {_uniqueStorage()._timestampField = newValue} + } + /// Returns true if `timestampField` has been explicitly set. + var hasTimestampField: Bool {return _storage._timestampField != nil} + /// Clears the value of `timestampField`. Subsequent reads from it will return its default value. + mutating func clearTimestampField() {_uniqueStorage()._timestampField = nil} + + var typeField: SwiftProtobuf.Google_Protobuf_Type { + get {return _storage._typeField ?? SwiftProtobuf.Google_Protobuf_Type()} + set {_uniqueStorage()._typeField = newValue} + } + /// Returns true if `typeField` has been explicitly set. + var hasTypeField: Bool {return _storage._typeField != nil} + /// Clears the value of `typeField`. Subsequent reads from it will return its default value. + mutating func clearTypeField() {_uniqueStorage()._typeField = nil} + + var doubleField: SwiftProtobuf.Google_Protobuf_DoubleValue { + get {return _storage._doubleField ?? SwiftProtobuf.Google_Protobuf_DoubleValue()} + set {_uniqueStorage()._doubleField = newValue} + } + /// Returns true if `doubleField` has been explicitly set. + var hasDoubleField: Bool {return _storage._doubleField != nil} + /// Clears the value of `doubleField`. Subsequent reads from it will return its default value. + mutating func clearDoubleField() {_uniqueStorage()._doubleField = nil} + + var floatField: SwiftProtobuf.Google_Protobuf_FloatValue { + get {return _storage._floatField ?? SwiftProtobuf.Google_Protobuf_FloatValue()} + set {_uniqueStorage()._floatField = newValue} + } + /// Returns true if `floatField` has been explicitly set. + var hasFloatField: Bool {return _storage._floatField != nil} + /// Clears the value of `floatField`. Subsequent reads from it will return its default value. + mutating func clearFloatField() {_uniqueStorage()._floatField = nil} + + var int64Field: SwiftProtobuf.Google_Protobuf_Int64Value { + get {return _storage._int64Field ?? SwiftProtobuf.Google_Protobuf_Int64Value()} + set {_uniqueStorage()._int64Field = newValue} + } + /// Returns true if `int64Field` has been explicitly set. + var hasInt64Field: Bool {return _storage._int64Field != nil} + /// Clears the value of `int64Field`. Subsequent reads from it will return its default value. + mutating func clearInt64Field() {_uniqueStorage()._int64Field = nil} + + var uint64Field: SwiftProtobuf.Google_Protobuf_UInt64Value { + get {return _storage._uint64Field ?? SwiftProtobuf.Google_Protobuf_UInt64Value()} + set {_uniqueStorage()._uint64Field = newValue} + } + /// Returns true if `uint64Field` has been explicitly set. + var hasUint64Field: Bool {return _storage._uint64Field != nil} + /// Clears the value of `uint64Field`. Subsequent reads from it will return its default value. + mutating func clearUint64Field() {_uniqueStorage()._uint64Field = nil} + + var int32Field: SwiftProtobuf.Google_Protobuf_Int32Value { + get {return _storage._int32Field ?? SwiftProtobuf.Google_Protobuf_Int32Value()} + set {_uniqueStorage()._int32Field = newValue} + } + /// Returns true if `int32Field` has been explicitly set. + var hasInt32Field: Bool {return _storage._int32Field != nil} + /// Clears the value of `int32Field`. Subsequent reads from it will return its default value. + mutating func clearInt32Field() {_uniqueStorage()._int32Field = nil} + + var uint32Field: SwiftProtobuf.Google_Protobuf_UInt32Value { + get {return _storage._uint32Field ?? SwiftProtobuf.Google_Protobuf_UInt32Value()} + set {_uniqueStorage()._uint32Field = newValue} + } + /// Returns true if `uint32Field` has been explicitly set. + var hasUint32Field: Bool {return _storage._uint32Field != nil} + /// Clears the value of `uint32Field`. Subsequent reads from it will return its default value. + mutating func clearUint32Field() {_uniqueStorage()._uint32Field = nil} + + var boolField: SwiftProtobuf.Google_Protobuf_BoolValue { + get {return _storage._boolField ?? SwiftProtobuf.Google_Protobuf_BoolValue()} + set {_uniqueStorage()._boolField = newValue} + } + /// Returns true if `boolField` has been explicitly set. + var hasBoolField: Bool {return _storage._boolField != nil} + /// Clears the value of `boolField`. Subsequent reads from it will return its default value. + mutating func clearBoolField() {_uniqueStorage()._boolField = nil} + + var stringField: SwiftProtobuf.Google_Protobuf_StringValue { + get {return _storage._stringField ?? SwiftProtobuf.Google_Protobuf_StringValue()} + set {_uniqueStorage()._stringField = newValue} + } + /// Returns true if `stringField` has been explicitly set. + var hasStringField: Bool {return _storage._stringField != nil} + /// Clears the value of `stringField`. Subsequent reads from it will return its default value. + mutating func clearStringField() {_uniqueStorage()._stringField = nil} + + var bytesField: SwiftProtobuf.Google_Protobuf_BytesValue { + get {return _storage._bytesField ?? SwiftProtobuf.Google_Protobuf_BytesValue()} + set {_uniqueStorage()._bytesField = newValue} + } + /// Returns true if `bytesField` has been explicitly set. + var hasBytesField: Bool {return _storage._bytesField != nil} + /// Clears the value of `bytesField`. Subsequent reads from it will return its default value. + mutating func clearBytesField() {_uniqueStorage()._bytesField = nil} + + /// Part of struct, but useful to be able to test separately + var valueField: SwiftProtobuf.Google_Protobuf_Value { + get {return _storage._valueField ?? SwiftProtobuf.Google_Protobuf_Value()} + set {_uniqueStorage()._valueField = newValue} + } + /// Returns true if `valueField` has been explicitly set. + var hasValueField: Bool {return _storage._valueField != nil} + /// Clears the value of `valueField`. Subsequent reads from it will return its default value. + mutating func clearValueField() {_uniqueStorage()._valueField = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +/// A repeated field for each well-known type. +struct ProtobufUnittest_RepeatedWellKnownTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var anyField: [SwiftProtobuf.Google_Protobuf_Any] { + get {return _storage._anyField} + set {_uniqueStorage()._anyField = newValue} + } + + var apiField: [SwiftProtobuf.Google_Protobuf_Api] { + get {return _storage._apiField} + set {_uniqueStorage()._apiField = newValue} + } + + var durationField: [SwiftProtobuf.Google_Protobuf_Duration] { + get {return _storage._durationField} + set {_uniqueStorage()._durationField = newValue} + } + + var emptyField: [SwiftProtobuf.Google_Protobuf_Empty] { + get {return _storage._emptyField} + set {_uniqueStorage()._emptyField = newValue} + } + + var fieldMaskField: [SwiftProtobuf.Google_Protobuf_FieldMask] { + get {return _storage._fieldMaskField} + set {_uniqueStorage()._fieldMaskField = newValue} + } + + var sourceContextField: [SwiftProtobuf.Google_Protobuf_SourceContext] { + get {return _storage._sourceContextField} + set {_uniqueStorage()._sourceContextField = newValue} + } + + var structField: [SwiftProtobuf.Google_Protobuf_Struct] { + get {return _storage._structField} + set {_uniqueStorage()._structField = newValue} + } + + var timestampField: [SwiftProtobuf.Google_Protobuf_Timestamp] { + get {return _storage._timestampField} + set {_uniqueStorage()._timestampField = newValue} + } + + var typeField: [SwiftProtobuf.Google_Protobuf_Type] { + get {return _storage._typeField} + set {_uniqueStorage()._typeField = newValue} + } + + /// These don't actually make a lot of sense, but they're not prohibited... + var doubleField: [SwiftProtobuf.Google_Protobuf_DoubleValue] { + get {return _storage._doubleField} + set {_uniqueStorage()._doubleField = newValue} + } + + var floatField: [SwiftProtobuf.Google_Protobuf_FloatValue] { + get {return _storage._floatField} + set {_uniqueStorage()._floatField = newValue} + } + + var int64Field: [SwiftProtobuf.Google_Protobuf_Int64Value] { + get {return _storage._int64Field} + set {_uniqueStorage()._int64Field = newValue} + } + + var uint64Field: [SwiftProtobuf.Google_Protobuf_UInt64Value] { + get {return _storage._uint64Field} + set {_uniqueStorage()._uint64Field = newValue} + } + + var int32Field: [SwiftProtobuf.Google_Protobuf_Int32Value] { + get {return _storage._int32Field} + set {_uniqueStorage()._int32Field = newValue} + } + + var uint32Field: [SwiftProtobuf.Google_Protobuf_UInt32Value] { + get {return _storage._uint32Field} + set {_uniqueStorage()._uint32Field = newValue} + } + + var boolField: [SwiftProtobuf.Google_Protobuf_BoolValue] { + get {return _storage._boolField} + set {_uniqueStorage()._boolField = newValue} + } + + var stringField: [SwiftProtobuf.Google_Protobuf_StringValue] { + get {return _storage._stringField} + set {_uniqueStorage()._stringField = newValue} + } + + var bytesField: [SwiftProtobuf.Google_Protobuf_BytesValue] { + get {return _storage._bytesField} + set {_uniqueStorage()._bytesField = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufUnittest_OneofWellKnownTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var oneofField: ProtobufUnittest_OneofWellKnownTypes.OneOf_OneofField? = nil + + var anyField: SwiftProtobuf.Google_Protobuf_Any { + get { + if case .anyField(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_Any() + } + set {oneofField = .anyField(newValue)} + } + + var apiField: SwiftProtobuf.Google_Protobuf_Api { + get { + if case .apiField(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_Api() + } + set {oneofField = .apiField(newValue)} + } + + var durationField: SwiftProtobuf.Google_Protobuf_Duration { + get { + if case .durationField(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_Duration() + } + set {oneofField = .durationField(newValue)} + } + + var emptyField: SwiftProtobuf.Google_Protobuf_Empty { + get { + if case .emptyField(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_Empty() + } + set {oneofField = .emptyField(newValue)} + } + + var fieldMaskField: SwiftProtobuf.Google_Protobuf_FieldMask { + get { + if case .fieldMaskField(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_FieldMask() + } + set {oneofField = .fieldMaskField(newValue)} + } + + var sourceContextField: SwiftProtobuf.Google_Protobuf_SourceContext { + get { + if case .sourceContextField(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_SourceContext() + } + set {oneofField = .sourceContextField(newValue)} + } + + var structField: SwiftProtobuf.Google_Protobuf_Struct { + get { + if case .structField(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_Struct() + } + set {oneofField = .structField(newValue)} + } + + var timestampField: SwiftProtobuf.Google_Protobuf_Timestamp { + get { + if case .timestampField(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_Timestamp() + } + set {oneofField = .timestampField(newValue)} + } + + var typeField: SwiftProtobuf.Google_Protobuf_Type { + get { + if case .typeField(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_Type() + } + set {oneofField = .typeField(newValue)} + } + + var doubleField: SwiftProtobuf.Google_Protobuf_DoubleValue { + get { + if case .doubleField(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_DoubleValue() + } + set {oneofField = .doubleField(newValue)} + } + + var floatField: SwiftProtobuf.Google_Protobuf_FloatValue { + get { + if case .floatField(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_FloatValue() + } + set {oneofField = .floatField(newValue)} + } + + var int64Field: SwiftProtobuf.Google_Protobuf_Int64Value { + get { + if case .int64Field(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_Int64Value() + } + set {oneofField = .int64Field(newValue)} + } + + var uint64Field: SwiftProtobuf.Google_Protobuf_UInt64Value { + get { + if case .uint64Field(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_UInt64Value() + } + set {oneofField = .uint64Field(newValue)} + } + + var int32Field: SwiftProtobuf.Google_Protobuf_Int32Value { + get { + if case .int32Field(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_Int32Value() + } + set {oneofField = .int32Field(newValue)} + } + + var uint32Field: SwiftProtobuf.Google_Protobuf_UInt32Value { + get { + if case .uint32Field(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_UInt32Value() + } + set {oneofField = .uint32Field(newValue)} + } + + var boolField: SwiftProtobuf.Google_Protobuf_BoolValue { + get { + if case .boolField(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_BoolValue() + } + set {oneofField = .boolField(newValue)} + } + + var stringField: SwiftProtobuf.Google_Protobuf_StringValue { + get { + if case .stringField(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_StringValue() + } + set {oneofField = .stringField(newValue)} + } + + var bytesField: SwiftProtobuf.Google_Protobuf_BytesValue { + get { + if case .bytesField(let v)? = oneofField {return v} + return SwiftProtobuf.Google_Protobuf_BytesValue() + } + set {oneofField = .bytesField(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_OneofField: Equatable { + case anyField(SwiftProtobuf.Google_Protobuf_Any) + case apiField(SwiftProtobuf.Google_Protobuf_Api) + case durationField(SwiftProtobuf.Google_Protobuf_Duration) + case emptyField(SwiftProtobuf.Google_Protobuf_Empty) + case fieldMaskField(SwiftProtobuf.Google_Protobuf_FieldMask) + case sourceContextField(SwiftProtobuf.Google_Protobuf_SourceContext) + case structField(SwiftProtobuf.Google_Protobuf_Struct) + case timestampField(SwiftProtobuf.Google_Protobuf_Timestamp) + case typeField(SwiftProtobuf.Google_Protobuf_Type) + case doubleField(SwiftProtobuf.Google_Protobuf_DoubleValue) + case floatField(SwiftProtobuf.Google_Protobuf_FloatValue) + case int64Field(SwiftProtobuf.Google_Protobuf_Int64Value) + case uint64Field(SwiftProtobuf.Google_Protobuf_UInt64Value) + case int32Field(SwiftProtobuf.Google_Protobuf_Int32Value) + case uint32Field(SwiftProtobuf.Google_Protobuf_UInt32Value) + case boolField(SwiftProtobuf.Google_Protobuf_BoolValue) + case stringField(SwiftProtobuf.Google_Protobuf_StringValue) + case bytesField(SwiftProtobuf.Google_Protobuf_BytesValue) + + } + + init() {} +} + +/// A map field for each well-known type. We only +/// need to worry about the value part of the map being the +/// well-known types, as messages can't be map keys. +struct ProtobufUnittest_MapWellKnownTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var anyField: Dictionary { + get {return _storage._anyField} + set {_uniqueStorage()._anyField = newValue} + } + + var apiField: Dictionary { + get {return _storage._apiField} + set {_uniqueStorage()._apiField = newValue} + } + + var durationField: Dictionary { + get {return _storage._durationField} + set {_uniqueStorage()._durationField = newValue} + } + + var emptyField: Dictionary { + get {return _storage._emptyField} + set {_uniqueStorage()._emptyField = newValue} + } + + var fieldMaskField: Dictionary { + get {return _storage._fieldMaskField} + set {_uniqueStorage()._fieldMaskField = newValue} + } + + var sourceContextField: Dictionary { + get {return _storage._sourceContextField} + set {_uniqueStorage()._sourceContextField = newValue} + } + + var structField: Dictionary { + get {return _storage._structField} + set {_uniqueStorage()._structField = newValue} + } + + var timestampField: Dictionary { + get {return _storage._timestampField} + set {_uniqueStorage()._timestampField = newValue} + } + + var typeField: Dictionary { + get {return _storage._typeField} + set {_uniqueStorage()._typeField = newValue} + } + + var doubleField: Dictionary { + get {return _storage._doubleField} + set {_uniqueStorage()._doubleField = newValue} + } + + var floatField: Dictionary { + get {return _storage._floatField} + set {_uniqueStorage()._floatField = newValue} + } + + var int64Field: Dictionary { + get {return _storage._int64Field} + set {_uniqueStorage()._int64Field = newValue} + } + + var uint64Field: Dictionary { + get {return _storage._uint64Field} + set {_uniqueStorage()._uint64Field = newValue} + } + + var int32Field: Dictionary { + get {return _storage._int32Field} + set {_uniqueStorage()._int32Field = newValue} + } + + var uint32Field: Dictionary { + get {return _storage._uint32Field} + set {_uniqueStorage()._uint32Field = newValue} + } + + var boolField: Dictionary { + get {return _storage._boolField} + set {_uniqueStorage()._boolField = newValue} + } + + var stringField: Dictionary { + get {return _storage._stringField} + set {_uniqueStorage()._stringField = newValue} + } + + var bytesField: Dictionary { + get {return _storage._bytesField} + set {_uniqueStorage()._bytesField = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufUnittest_TestWellKnownTypes: @unchecked Sendable {} +extension ProtobufUnittest_RepeatedWellKnownTypes: @unchecked Sendable {} +extension ProtobufUnittest_OneofWellKnownTypes: @unchecked Sendable {} +extension ProtobufUnittest_OneofWellKnownTypes.OneOf_OneofField: @unchecked Sendable {} +extension ProtobufUnittest_MapWellKnownTypes: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest" + +extension ProtobufUnittest_TestWellKnownTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestWellKnownTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "any_field"), + 2: .standard(proto: "api_field"), + 3: .standard(proto: "duration_field"), + 4: .standard(proto: "empty_field"), + 5: .standard(proto: "field_mask_field"), + 6: .standard(proto: "source_context_field"), + 7: .standard(proto: "struct_field"), + 8: .standard(proto: "timestamp_field"), + 9: .standard(proto: "type_field"), + 10: .standard(proto: "double_field"), + 11: .standard(proto: "float_field"), + 12: .standard(proto: "int64_field"), + 13: .standard(proto: "uint64_field"), + 14: .standard(proto: "int32_field"), + 15: .standard(proto: "uint32_field"), + 16: .standard(proto: "bool_field"), + 17: .standard(proto: "string_field"), + 18: .standard(proto: "bytes_field"), + 19: .standard(proto: "value_field"), + ] + + fileprivate class _StorageClass { + var _anyField: SwiftProtobuf.Google_Protobuf_Any? = nil + var _apiField: SwiftProtobuf.Google_Protobuf_Api? = nil + var _durationField: SwiftProtobuf.Google_Protobuf_Duration? = nil + var _emptyField: SwiftProtobuf.Google_Protobuf_Empty? = nil + var _fieldMaskField: SwiftProtobuf.Google_Protobuf_FieldMask? = nil + var _sourceContextField: SwiftProtobuf.Google_Protobuf_SourceContext? = nil + var _structField: SwiftProtobuf.Google_Protobuf_Struct? = nil + var _timestampField: SwiftProtobuf.Google_Protobuf_Timestamp? = nil + var _typeField: SwiftProtobuf.Google_Protobuf_Type? = nil + var _doubleField: SwiftProtobuf.Google_Protobuf_DoubleValue? = nil + var _floatField: SwiftProtobuf.Google_Protobuf_FloatValue? = nil + var _int64Field: SwiftProtobuf.Google_Protobuf_Int64Value? = nil + var _uint64Field: SwiftProtobuf.Google_Protobuf_UInt64Value? = nil + var _int32Field: SwiftProtobuf.Google_Protobuf_Int32Value? = nil + var _uint32Field: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil + var _boolField: SwiftProtobuf.Google_Protobuf_BoolValue? = nil + var _stringField: SwiftProtobuf.Google_Protobuf_StringValue? = nil + var _bytesField: SwiftProtobuf.Google_Protobuf_BytesValue? = nil + var _valueField: SwiftProtobuf.Google_Protobuf_Value? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _anyField = source._anyField + _apiField = source._apiField + _durationField = source._durationField + _emptyField = source._emptyField + _fieldMaskField = source._fieldMaskField + _sourceContextField = source._sourceContextField + _structField = source._structField + _timestampField = source._timestampField + _typeField = source._typeField + _doubleField = source._doubleField + _floatField = source._floatField + _int64Field = source._int64Field + _uint64Field = source._uint64Field + _int32Field = source._int32Field + _uint32Field = source._uint32Field + _boolField = source._boolField + _stringField = source._stringField + _bytesField = source._bytesField + _valueField = source._valueField + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._anyField) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._apiField) }() + case 3: try { try decoder.decodeSingularMessageField(value: &_storage._durationField) }() + case 4: try { try decoder.decodeSingularMessageField(value: &_storage._emptyField) }() + case 5: try { try decoder.decodeSingularMessageField(value: &_storage._fieldMaskField) }() + case 6: try { try decoder.decodeSingularMessageField(value: &_storage._sourceContextField) }() + case 7: try { try decoder.decodeSingularMessageField(value: &_storage._structField) }() + case 8: try { try decoder.decodeSingularMessageField(value: &_storage._timestampField) }() + case 9: try { try decoder.decodeSingularMessageField(value: &_storage._typeField) }() + case 10: try { try decoder.decodeSingularMessageField(value: &_storage._doubleField) }() + case 11: try { try decoder.decodeSingularMessageField(value: &_storage._floatField) }() + case 12: try { try decoder.decodeSingularMessageField(value: &_storage._int64Field) }() + case 13: try { try decoder.decodeSingularMessageField(value: &_storage._uint64Field) }() + case 14: try { try decoder.decodeSingularMessageField(value: &_storage._int32Field) }() + case 15: try { try decoder.decodeSingularMessageField(value: &_storage._uint32Field) }() + case 16: try { try decoder.decodeSingularMessageField(value: &_storage._boolField) }() + case 17: try { try decoder.decodeSingularMessageField(value: &_storage._stringField) }() + case 18: try { try decoder.decodeSingularMessageField(value: &_storage._bytesField) }() + case 19: try { try decoder.decodeSingularMessageField(value: &_storage._valueField) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._anyField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._apiField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._durationField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._emptyField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._fieldMaskField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + try { if let v = _storage._sourceContextField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + } }() + try { if let v = _storage._structField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + } }() + try { if let v = _storage._timestampField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + } }() + try { if let v = _storage._typeField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._doubleField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._floatField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + } }() + try { if let v = _storage._int64Field { + try visitor.visitSingularMessageField(value: v, fieldNumber: 12) + } }() + try { if let v = _storage._uint64Field { + try visitor.visitSingularMessageField(value: v, fieldNumber: 13) + } }() + try { if let v = _storage._int32Field { + try visitor.visitSingularMessageField(value: v, fieldNumber: 14) + } }() + try { if let v = _storage._uint32Field { + try visitor.visitSingularMessageField(value: v, fieldNumber: 15) + } }() + try { if let v = _storage._boolField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 16) + } }() + try { if let v = _storage._stringField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 17) + } }() + try { if let v = _storage._bytesField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._valueField { + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_TestWellKnownTypes, rhs: ProtobufUnittest_TestWellKnownTypes) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._anyField != rhs_storage._anyField {return false} + if _storage._apiField != rhs_storage._apiField {return false} + if _storage._durationField != rhs_storage._durationField {return false} + if _storage._emptyField != rhs_storage._emptyField {return false} + if _storage._fieldMaskField != rhs_storage._fieldMaskField {return false} + if _storage._sourceContextField != rhs_storage._sourceContextField {return false} + if _storage._structField != rhs_storage._structField {return false} + if _storage._timestampField != rhs_storage._timestampField {return false} + if _storage._typeField != rhs_storage._typeField {return false} + if _storage._doubleField != rhs_storage._doubleField {return false} + if _storage._floatField != rhs_storage._floatField {return false} + if _storage._int64Field != rhs_storage._int64Field {return false} + if _storage._uint64Field != rhs_storage._uint64Field {return false} + if _storage._int32Field != rhs_storage._int32Field {return false} + if _storage._uint32Field != rhs_storage._uint32Field {return false} + if _storage._boolField != rhs_storage._boolField {return false} + if _storage._stringField != rhs_storage._stringField {return false} + if _storage._bytesField != rhs_storage._bytesField {return false} + if _storage._valueField != rhs_storage._valueField {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_RepeatedWellKnownTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".RepeatedWellKnownTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "any_field"), + 2: .standard(proto: "api_field"), + 3: .standard(proto: "duration_field"), + 4: .standard(proto: "empty_field"), + 5: .standard(proto: "field_mask_field"), + 6: .standard(proto: "source_context_field"), + 7: .standard(proto: "struct_field"), + 8: .standard(proto: "timestamp_field"), + 9: .standard(proto: "type_field"), + 10: .standard(proto: "double_field"), + 11: .standard(proto: "float_field"), + 12: .standard(proto: "int64_field"), + 13: .standard(proto: "uint64_field"), + 14: .standard(proto: "int32_field"), + 15: .standard(proto: "uint32_field"), + 16: .standard(proto: "bool_field"), + 17: .standard(proto: "string_field"), + 18: .standard(proto: "bytes_field"), + ] + + fileprivate class _StorageClass { + var _anyField: [SwiftProtobuf.Google_Protobuf_Any] = [] + var _apiField: [SwiftProtobuf.Google_Protobuf_Api] = [] + var _durationField: [SwiftProtobuf.Google_Protobuf_Duration] = [] + var _emptyField: [SwiftProtobuf.Google_Protobuf_Empty] = [] + var _fieldMaskField: [SwiftProtobuf.Google_Protobuf_FieldMask] = [] + var _sourceContextField: [SwiftProtobuf.Google_Protobuf_SourceContext] = [] + var _structField: [SwiftProtobuf.Google_Protobuf_Struct] = [] + var _timestampField: [SwiftProtobuf.Google_Protobuf_Timestamp] = [] + var _typeField: [SwiftProtobuf.Google_Protobuf_Type] = [] + var _doubleField: [SwiftProtobuf.Google_Protobuf_DoubleValue] = [] + var _floatField: [SwiftProtobuf.Google_Protobuf_FloatValue] = [] + var _int64Field: [SwiftProtobuf.Google_Protobuf_Int64Value] = [] + var _uint64Field: [SwiftProtobuf.Google_Protobuf_UInt64Value] = [] + var _int32Field: [SwiftProtobuf.Google_Protobuf_Int32Value] = [] + var _uint32Field: [SwiftProtobuf.Google_Protobuf_UInt32Value] = [] + var _boolField: [SwiftProtobuf.Google_Protobuf_BoolValue] = [] + var _stringField: [SwiftProtobuf.Google_Protobuf_StringValue] = [] + var _bytesField: [SwiftProtobuf.Google_Protobuf_BytesValue] = [] + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _anyField = source._anyField + _apiField = source._apiField + _durationField = source._durationField + _emptyField = source._emptyField + _fieldMaskField = source._fieldMaskField + _sourceContextField = source._sourceContextField + _structField = source._structField + _timestampField = source._timestampField + _typeField = source._typeField + _doubleField = source._doubleField + _floatField = source._floatField + _int64Field = source._int64Field + _uint64Field = source._uint64Field + _int32Field = source._int32Field + _uint32Field = source._uint32Field + _boolField = source._boolField + _stringField = source._stringField + _bytesField = source._bytesField + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &_storage._anyField) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &_storage._apiField) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &_storage._durationField) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &_storage._emptyField) }() + case 5: try { try decoder.decodeRepeatedMessageField(value: &_storage._fieldMaskField) }() + case 6: try { try decoder.decodeRepeatedMessageField(value: &_storage._sourceContextField) }() + case 7: try { try decoder.decodeRepeatedMessageField(value: &_storage._structField) }() + case 8: try { try decoder.decodeRepeatedMessageField(value: &_storage._timestampField) }() + case 9: try { try decoder.decodeRepeatedMessageField(value: &_storage._typeField) }() + case 10: try { try decoder.decodeRepeatedMessageField(value: &_storage._doubleField) }() + case 11: try { try decoder.decodeRepeatedMessageField(value: &_storage._floatField) }() + case 12: try { try decoder.decodeRepeatedMessageField(value: &_storage._int64Field) }() + case 13: try { try decoder.decodeRepeatedMessageField(value: &_storage._uint64Field) }() + case 14: try { try decoder.decodeRepeatedMessageField(value: &_storage._int32Field) }() + case 15: try { try decoder.decodeRepeatedMessageField(value: &_storage._uint32Field) }() + case 16: try { try decoder.decodeRepeatedMessageField(value: &_storage._boolField) }() + case 17: try { try decoder.decodeRepeatedMessageField(value: &_storage._stringField) }() + case 18: try { try decoder.decodeRepeatedMessageField(value: &_storage._bytesField) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._anyField.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._anyField, fieldNumber: 1) + } + if !_storage._apiField.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._apiField, fieldNumber: 2) + } + if !_storage._durationField.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._durationField, fieldNumber: 3) + } + if !_storage._emptyField.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._emptyField, fieldNumber: 4) + } + if !_storage._fieldMaskField.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._fieldMaskField, fieldNumber: 5) + } + if !_storage._sourceContextField.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._sourceContextField, fieldNumber: 6) + } + if !_storage._structField.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._structField, fieldNumber: 7) + } + if !_storage._timestampField.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._timestampField, fieldNumber: 8) + } + if !_storage._typeField.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._typeField, fieldNumber: 9) + } + if !_storage._doubleField.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._doubleField, fieldNumber: 10) + } + if !_storage._floatField.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._floatField, fieldNumber: 11) + } + if !_storage._int64Field.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._int64Field, fieldNumber: 12) + } + if !_storage._uint64Field.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._uint64Field, fieldNumber: 13) + } + if !_storage._int32Field.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._int32Field, fieldNumber: 14) + } + if !_storage._uint32Field.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._uint32Field, fieldNumber: 15) + } + if !_storage._boolField.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._boolField, fieldNumber: 16) + } + if !_storage._stringField.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._stringField, fieldNumber: 17) + } + if !_storage._bytesField.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._bytesField, fieldNumber: 18) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_RepeatedWellKnownTypes, rhs: ProtobufUnittest_RepeatedWellKnownTypes) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._anyField != rhs_storage._anyField {return false} + if _storage._apiField != rhs_storage._apiField {return false} + if _storage._durationField != rhs_storage._durationField {return false} + if _storage._emptyField != rhs_storage._emptyField {return false} + if _storage._fieldMaskField != rhs_storage._fieldMaskField {return false} + if _storage._sourceContextField != rhs_storage._sourceContextField {return false} + if _storage._structField != rhs_storage._structField {return false} + if _storage._timestampField != rhs_storage._timestampField {return false} + if _storage._typeField != rhs_storage._typeField {return false} + if _storage._doubleField != rhs_storage._doubleField {return false} + if _storage._floatField != rhs_storage._floatField {return false} + if _storage._int64Field != rhs_storage._int64Field {return false} + if _storage._uint64Field != rhs_storage._uint64Field {return false} + if _storage._int32Field != rhs_storage._int32Field {return false} + if _storage._uint32Field != rhs_storage._uint32Field {return false} + if _storage._boolField != rhs_storage._boolField {return false} + if _storage._stringField != rhs_storage._stringField {return false} + if _storage._bytesField != rhs_storage._bytesField {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_OneofWellKnownTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".OneofWellKnownTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "any_field"), + 2: .standard(proto: "api_field"), + 3: .standard(proto: "duration_field"), + 4: .standard(proto: "empty_field"), + 5: .standard(proto: "field_mask_field"), + 6: .standard(proto: "source_context_field"), + 7: .standard(proto: "struct_field"), + 8: .standard(proto: "timestamp_field"), + 9: .standard(proto: "type_field"), + 10: .standard(proto: "double_field"), + 11: .standard(proto: "float_field"), + 12: .standard(proto: "int64_field"), + 13: .standard(proto: "uint64_field"), + 14: .standard(proto: "int32_field"), + 15: .standard(proto: "uint32_field"), + 16: .standard(proto: "bool_field"), + 17: .standard(proto: "string_field"), + 18: .standard(proto: "bytes_field"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { + var v: SwiftProtobuf.Google_Protobuf_Any? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .anyField(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .anyField(v) + } + }() + case 2: try { + var v: SwiftProtobuf.Google_Protobuf_Api? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .apiField(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .apiField(v) + } + }() + case 3: try { + var v: SwiftProtobuf.Google_Protobuf_Duration? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .durationField(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .durationField(v) + } + }() + case 4: try { + var v: SwiftProtobuf.Google_Protobuf_Empty? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .emptyField(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .emptyField(v) + } + }() + case 5: try { + var v: SwiftProtobuf.Google_Protobuf_FieldMask? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .fieldMaskField(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .fieldMaskField(v) + } + }() + case 6: try { + var v: SwiftProtobuf.Google_Protobuf_SourceContext? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .sourceContextField(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .sourceContextField(v) + } + }() + case 7: try { + var v: SwiftProtobuf.Google_Protobuf_Struct? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .structField(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .structField(v) + } + }() + case 8: try { + var v: SwiftProtobuf.Google_Protobuf_Timestamp? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .timestampField(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .timestampField(v) + } + }() + case 9: try { + var v: SwiftProtobuf.Google_Protobuf_Type? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .typeField(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .typeField(v) + } + }() + case 10: try { + var v: SwiftProtobuf.Google_Protobuf_DoubleValue? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .doubleField(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .doubleField(v) + } + }() + case 11: try { + var v: SwiftProtobuf.Google_Protobuf_FloatValue? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .floatField(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .floatField(v) + } + }() + case 12: try { + var v: SwiftProtobuf.Google_Protobuf_Int64Value? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .int64Field(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .int64Field(v) + } + }() + case 13: try { + var v: SwiftProtobuf.Google_Protobuf_UInt64Value? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .uint64Field(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .uint64Field(v) + } + }() + case 14: try { + var v: SwiftProtobuf.Google_Protobuf_Int32Value? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .int32Field(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .int32Field(v) + } + }() + case 15: try { + var v: SwiftProtobuf.Google_Protobuf_UInt32Value? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .uint32Field(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .uint32Field(v) + } + }() + case 16: try { + var v: SwiftProtobuf.Google_Protobuf_BoolValue? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .boolField(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .boolField(v) + } + }() + case 17: try { + var v: SwiftProtobuf.Google_Protobuf_StringValue? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .stringField(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .stringField(v) + } + }() + case 18: try { + var v: SwiftProtobuf.Google_Protobuf_BytesValue? + var hadOneofValue = false + if let current = self.oneofField { + hadOneofValue = true + if case .bytesField(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.oneofField = .bytesField(v) + } + }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + switch self.oneofField { + case .anyField?: try { + guard case .anyField(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + }() + case .apiField?: try { + guard case .apiField(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + }() + case .durationField?: try { + guard case .durationField(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + }() + case .emptyField?: try { + guard case .emptyField(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + }() + case .fieldMaskField?: try { + guard case .fieldMaskField(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + }() + case .sourceContextField?: try { + guard case .sourceContextField(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + }() + case .structField?: try { + guard case .structField(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + }() + case .timestampField?: try { + guard case .timestampField(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + }() + case .typeField?: try { + guard case .typeField(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + }() + case .doubleField?: try { + guard case .doubleField(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + }() + case .floatField?: try { + guard case .floatField(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + }() + case .int64Field?: try { + guard case .int64Field(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 12) + }() + case .uint64Field?: try { + guard case .uint64Field(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 13) + }() + case .int32Field?: try { + guard case .int32Field(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 14) + }() + case .uint32Field?: try { + guard case .uint32Field(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 15) + }() + case .boolField?: try { + guard case .boolField(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 16) + }() + case .stringField?: try { + guard case .stringField(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 17) + }() + case .bytesField?: try { + guard case .bytesField(let v)? = self.oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_OneofWellKnownTypes, rhs: ProtobufUnittest_OneofWellKnownTypes) -> Bool { + if lhs.oneofField != rhs.oneofField {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufUnittest_MapWellKnownTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MapWellKnownTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "any_field"), + 2: .standard(proto: "api_field"), + 3: .standard(proto: "duration_field"), + 4: .standard(proto: "empty_field"), + 5: .standard(proto: "field_mask_field"), + 6: .standard(proto: "source_context_field"), + 7: .standard(proto: "struct_field"), + 8: .standard(proto: "timestamp_field"), + 9: .standard(proto: "type_field"), + 10: .standard(proto: "double_field"), + 11: .standard(proto: "float_field"), + 12: .standard(proto: "int64_field"), + 13: .standard(proto: "uint64_field"), + 14: .standard(proto: "int32_field"), + 15: .standard(proto: "uint32_field"), + 16: .standard(proto: "bool_field"), + 17: .standard(proto: "string_field"), + 18: .standard(proto: "bytes_field"), + ] + + fileprivate class _StorageClass { + var _anyField: Dictionary = [:] + var _apiField: Dictionary = [:] + var _durationField: Dictionary = [:] + var _emptyField: Dictionary = [:] + var _fieldMaskField: Dictionary = [:] + var _sourceContextField: Dictionary = [:] + var _structField: Dictionary = [:] + var _timestampField: Dictionary = [:] + var _typeField: Dictionary = [:] + var _doubleField: Dictionary = [:] + var _floatField: Dictionary = [:] + var _int64Field: Dictionary = [:] + var _uint64Field: Dictionary = [:] + var _int32Field: Dictionary = [:] + var _uint32Field: Dictionary = [:] + var _boolField: Dictionary = [:] + var _stringField: Dictionary = [:] + var _bytesField: Dictionary = [:] + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _anyField = source._anyField + _apiField = source._apiField + _durationField = source._durationField + _emptyField = source._emptyField + _fieldMaskField = source._fieldMaskField + _sourceContextField = source._sourceContextField + _structField = source._structField + _timestampField = source._timestampField + _typeField = source._typeField + _doubleField = source._doubleField + _floatField = source._floatField + _int64Field = source._int64Field + _uint64Field = source._uint64Field + _int32Field = source._int32Field + _uint32Field = source._uint32Field + _boolField = source._boolField + _stringField = source._stringField + _bytesField = source._bytesField + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._anyField) }() + case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._apiField) }() + case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._durationField) }() + case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._emptyField) }() + case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._fieldMaskField) }() + case 6: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._sourceContextField) }() + case 7: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._structField) }() + case 8: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._timestampField) }() + case 9: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._typeField) }() + case 10: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._doubleField) }() + case 11: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._floatField) }() + case 12: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._int64Field) }() + case 13: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._uint64Field) }() + case 14: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._int32Field) }() + case 15: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._uint32Field) }() + case 16: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._boolField) }() + case 17: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._stringField) }() + case 18: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._bytesField) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._anyField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._anyField, fieldNumber: 1) + } + if !_storage._apiField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._apiField, fieldNumber: 2) + } + if !_storage._durationField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._durationField, fieldNumber: 3) + } + if !_storage._emptyField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._emptyField, fieldNumber: 4) + } + if !_storage._fieldMaskField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._fieldMaskField, fieldNumber: 5) + } + if !_storage._sourceContextField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._sourceContextField, fieldNumber: 6) + } + if !_storage._structField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._structField, fieldNumber: 7) + } + if !_storage._timestampField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._timestampField, fieldNumber: 8) + } + if !_storage._typeField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._typeField, fieldNumber: 9) + } + if !_storage._doubleField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._doubleField, fieldNumber: 10) + } + if !_storage._floatField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._floatField, fieldNumber: 11) + } + if !_storage._int64Field.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._int64Field, fieldNumber: 12) + } + if !_storage._uint64Field.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._uint64Field, fieldNumber: 13) + } + if !_storage._int32Field.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._int32Field, fieldNumber: 14) + } + if !_storage._uint32Field.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._uint32Field, fieldNumber: 15) + } + if !_storage._boolField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._boolField, fieldNumber: 16) + } + if !_storage._stringField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._stringField, fieldNumber: 17) + } + if !_storage._bytesField.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._bytesField, fieldNumber: 18) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_MapWellKnownTypes, rhs: ProtobufUnittest_MapWellKnownTypes) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._anyField != rhs_storage._anyField {return false} + if _storage._apiField != rhs_storage._apiField {return false} + if _storage._durationField != rhs_storage._durationField {return false} + if _storage._emptyField != rhs_storage._emptyField {return false} + if _storage._fieldMaskField != rhs_storage._fieldMaskField {return false} + if _storage._sourceContextField != rhs_storage._sourceContextField {return false} + if _storage._structField != rhs_storage._structField {return false} + if _storage._timestampField != rhs_storage._timestampField {return false} + if _storage._typeField != rhs_storage._typeField {return false} + if _storage._doubleField != rhs_storage._doubleField {return false} + if _storage._floatField != rhs_storage._floatField {return false} + if _storage._int64Field != rhs_storage._int64Field {return false} + if _storage._uint64Field != rhs_storage._uint64Field {return false} + if _storage._int32Field != rhs_storage._int32Field {return false} + if _storage._uint32Field != rhs_storage._uint32Field {return false} + if _storage._boolField != rhs_storage._boolField {return false} + if _storage._stringField != rhs_storage._stringField {return false} + if _storage._bytesField != rhs_storage._bytesField {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/plugin_descriptor_test.pb.swift b/Reference/protoc-gen-swiftTests/plugin_descriptor_test.pb.swift similarity index 100% rename from Reference/plugin_descriptor_test.pb.swift rename to Reference/protoc-gen-swiftTests/plugin_descriptor_test.pb.swift diff --git a/Reference/upstream/conformance/conformance.pb.swift b/Reference/upstream/conformance/conformance.pb.swift new file mode 100644 index 000000000..bc69343bf --- /dev/null +++ b/Reference/upstream/conformance/conformance.pb.swift @@ -0,0 +1,804 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: conformance/conformance.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum Conformance_WireFormat: SwiftProtobuf.Enum { + typealias RawValue = Int + case unspecified // = 0 + case protobuf // = 1 + case json // = 2 + + /// Only used inside Google. Opensource testees just skip it. + case jspb // = 3 + case textFormat // = 4 + case UNRECOGNIZED(Int) + + init() { + self = .unspecified + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unspecified + case 1: self = .protobuf + case 2: self = .json + case 3: self = .jspb + case 4: self = .textFormat + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .unspecified: return 0 + case .protobuf: return 1 + case .json: return 2 + case .jspb: return 3 + case .textFormat: return 4 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Conformance_WireFormat] = [ + .unspecified, + .protobuf, + .json, + .jspb, + .textFormat, + ] + +} + +enum Conformance_TestCategory: SwiftProtobuf.Enum { + typealias RawValue = Int + case unspecifiedTest // = 0 + + /// Test binary wire format. + case binaryTest // = 1 + + /// Test json wire format. + case jsonTest // = 2 + + /// 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. + case jsonIgnoreUnknownParsingTest // = 3 + + /// Test jspb wire format. Only used inside Google. Opensource testees just + /// skip it. + case jspbTest // = 4 + + /// Test text format. For cpp, java and python, testees can already deal with + /// this type. Testees of other languages can simply skip it. + case textFormatTest // = 5 + case UNRECOGNIZED(Int) + + init() { + self = .unspecifiedTest + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unspecifiedTest + case 1: self = .binaryTest + case 2: self = .jsonTest + case 3: self = .jsonIgnoreUnknownParsingTest + case 4: self = .jspbTest + case 5: self = .textFormatTest + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .unspecifiedTest: return 0 + case .binaryTest: return 1 + case .jsonTest: return 2 + case .jsonIgnoreUnknownParsingTest: return 3 + case .jspbTest: return 4 + case .textFormatTest: return 5 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Conformance_TestCategory] = [ + .unspecifiedTest, + .binaryTest, + .jsonTest, + .jsonIgnoreUnknownParsingTest, + .jspbTest, + .textFormatTest, + ] + +} + +/// 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. +struct Conformance_FailureSet { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var failure: [String] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// 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. +struct Conformance_ConformanceRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The payload (whether protobuf of JSON) is always for a + /// protobuf_test_messages.proto3.TestAllTypes proto (as defined in + /// src/google/protobuf/proto3_test_messages.proto). + var payload: Conformance_ConformanceRequest.OneOf_Payload? = nil + + var protobufPayload: Data { + get { + if case .protobufPayload(let v)? = payload {return v} + return Data() + } + set {payload = .protobufPayload(newValue)} + } + + var jsonPayload: String { + get { + if case .jsonPayload(let v)? = payload {return v} + return String() + } + set {payload = .jsonPayload(newValue)} + } + + /// Only used inside Google. Opensource testees just skip it. + var jspbPayload: String { + get { + if case .jspbPayload(let v)? = payload {return v} + return String() + } + set {payload = .jspbPayload(newValue)} + } + + var textPayload: String { + get { + if case .textPayload(let v)? = payload {return v} + return String() + } + set {payload = .textPayload(newValue)} + } + + /// Which format should the testee serialize its message to? + var requestedOutputFormat: Conformance_WireFormat = .unspecified + + /// 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. + var messageType: String = 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. + var testCategory: Conformance_TestCategory = .unspecifiedTest + + /// Specify details for how to encode jspb. + var jspbEncodingOptions: Conformance_JspbEncodingConfig { + get {return _jspbEncodingOptions ?? Conformance_JspbEncodingConfig()} + set {_jspbEncodingOptions = newValue} + } + /// Returns true if `jspbEncodingOptions` has been explicitly set. + var hasJspbEncodingOptions: Bool {return self._jspbEncodingOptions != nil} + /// Clears the value of `jspbEncodingOptions`. Subsequent reads from it will return its default value. + mutating func clearJspbEncodingOptions() {self._jspbEncodingOptions = nil} + + /// This can be used in json and text format. If true, testee should print + /// unknown fields instead of ignore. This feature is optional. + var printUnknownFields: Bool = false + + var unknownFields = SwiftProtobuf.UnknownStorage() + + /// The payload (whether protobuf of JSON) is always for a + /// protobuf_test_messages.proto3.TestAllTypes proto (as defined in + /// src/google/protobuf/proto3_test_messages.proto). + enum OneOf_Payload: Equatable { + case protobufPayload(Data) + case jsonPayload(String) + /// Only used inside Google. Opensource testees just skip it. + case jspbPayload(String) + case textPayload(String) + + } + + init() {} + + fileprivate var _jspbEncodingOptions: Conformance_JspbEncodingConfig? = nil +} + +/// Represents a single test case's output. +struct Conformance_ConformanceResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var result: Conformance_ConformanceResponse.OneOf_Result? = nil + + /// 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. + var parseError: String { + get { + if case .parseError(let v)? = result {return v} + return String() + } + set {result = .parseError(newValue)} + } + + /// If the input was successfully parsed but errors occurred when + /// serializing it to the requested output format, set the error message in + /// this field. + var serializeError: String { + get { + if case .serializeError(let v)? = result {return v} + return String() + } + set {result = .serializeError(newValue)} + } + + /// 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. + var timeoutError: String { + get { + if case .timeoutError(let v)? = result {return v} + return String() + } + set {result = .timeoutError(newValue)} + } + + /// 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. + var runtimeError: String { + get { + if case .runtimeError(let v)? = result {return v} + return String() + } + set {result = .runtimeError(newValue)} + } + + /// If the input was successfully parsed and the requested output was + /// protobuf, serialize it to protobuf and set it in this field. + var protobufPayload: Data { + get { + if case .protobufPayload(let v)? = result {return v} + return Data() + } + set {result = .protobufPayload(newValue)} + } + + /// If the input was successfully parsed and the requested output was JSON, + /// serialize to JSON and set it in this field. + var jsonPayload: String { + get { + if case .jsonPayload(let v)? = result {return v} + return String() + } + set {result = .jsonPayload(newValue)} + } + + /// For when the testee skipped the test, likely because a certain feature + /// wasn't supported, like JSON input/output. + var skipped: String { + get { + if case .skipped(let v)? = result {return v} + return String() + } + set {result = .skipped(newValue)} + } + + /// 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. + var jspbPayload: String { + get { + if case .jspbPayload(let v)? = result {return v} + return String() + } + set {result = .jspbPayload(newValue)} + } + + /// If the input was successfully parsed and the requested output was + /// TEXT_FORMAT, serialize to TEXT_FORMAT and set it in this field. + var textPayload: String { + get { + if case .textPayload(let v)? = result {return v} + return String() + } + set {result = .textPayload(newValue)} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_Result: Equatable { + /// 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. + case parseError(String) + /// If the input was successfully parsed but errors occurred when + /// serializing it to the requested output format, set the error message in + /// this field. + case serializeError(String) + /// 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. + case timeoutError(String) + /// 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. + case runtimeError(String) + /// If the input was successfully parsed and the requested output was + /// protobuf, serialize it to protobuf and set it in this field. + case protobufPayload(Data) + /// If the input was successfully parsed and the requested output was JSON, + /// serialize to JSON and set it in this field. + case jsonPayload(String) + /// For when the testee skipped the test, likely because a certain feature + /// wasn't supported, like JSON input/output. + case skipped(String) + /// 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. + case jspbPayload(String) + /// If the input was successfully parsed and the requested output was + /// TEXT_FORMAT, serialize to TEXT_FORMAT and set it in this field. + case textPayload(String) + + } + + init() {} +} + +/// Encoding options for jspb format. +struct Conformance_JspbEncodingConfig { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Encode the value field of Any as jspb array if true, otherwise binary. + var useJspbArrayAnyFormat: Bool = false + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Conformance_FailureSet: @unchecked Sendable {} +extension Conformance_ConformanceRequest: @unchecked Sendable {} +extension Conformance_ConformanceRequest.OneOf_Payload: @unchecked Sendable {} +extension Conformance_ConformanceResponse: @unchecked Sendable {} +extension Conformance_ConformanceResponse.OneOf_Result: @unchecked Sendable {} +extension Conformance_JspbEncodingConfig: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "conformance" + +extension Conformance_WireFormat: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNSPECIFIED"), + 1: .same(proto: "PROTOBUF"), + 2: .same(proto: "JSON"), + 3: .same(proto: "JSPB"), + 4: .same(proto: "TEXT_FORMAT"), + ] +} + +extension Conformance_TestCategory: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNSPECIFIED_TEST"), + 1: .same(proto: "BINARY_TEST"), + 2: .same(proto: "JSON_TEST"), + 3: .same(proto: "JSON_IGNORE_UNKNOWN_PARSING_TEST"), + 4: .same(proto: "JSPB_TEST"), + 5: .same(proto: "TEXT_FORMAT_TEST"), + ] +} + +extension Conformance_FailureSet: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FailureSet" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "failure"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedStringField(value: &self.failure) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.failure.isEmpty { + try visitor.visitRepeatedStringField(value: self.failure, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Conformance_FailureSet, rhs: Conformance_FailureSet) -> Bool { + if lhs.failure != rhs.failure {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Conformance_ConformanceRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ConformanceRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "protobuf_payload"), + 2: .standard(proto: "json_payload"), + 7: .standard(proto: "jspb_payload"), + 8: .standard(proto: "text_payload"), + 3: .standard(proto: "requested_output_format"), + 4: .standard(proto: "message_type"), + 5: .standard(proto: "test_category"), + 6: .standard(proto: "jspb_encoding_options"), + 9: .standard(proto: "print_unknown_fields"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if self.payload != nil {try decoder.handleConflictingOneOf()} + self.payload = .protobufPayload(v) + } + }() + case 2: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.payload != nil {try decoder.handleConflictingOneOf()} + self.payload = .jsonPayload(v) + } + }() + case 3: try { try decoder.decodeSingularEnumField(value: &self.requestedOutputFormat) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.messageType) }() + case 5: try { try decoder.decodeSingularEnumField(value: &self.testCategory) }() + case 6: try { try decoder.decodeSingularMessageField(value: &self._jspbEncodingOptions) }() + case 7: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.payload != nil {try decoder.handleConflictingOneOf()} + self.payload = .jspbPayload(v) + } + }() + case 8: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.payload != nil {try decoder.handleConflictingOneOf()} + self.payload = .textPayload(v) + } + }() + case 9: try { try decoder.decodeSingularBoolField(value: &self.printUnknownFields) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + switch self.payload { + case .protobufPayload?: try { + guard case .protobufPayload(let v)? = self.payload else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 1) + }() + case .jsonPayload?: try { + guard case .jsonPayload(let v)? = self.payload else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + }() + default: break + } + if self.requestedOutputFormat != .unspecified { + try visitor.visitSingularEnumField(value: self.requestedOutputFormat, fieldNumber: 3) + } + if !self.messageType.isEmpty { + try visitor.visitSingularStringField(value: self.messageType, fieldNumber: 4) + } + if self.testCategory != .unspecifiedTest { + try visitor.visitSingularEnumField(value: self.testCategory, fieldNumber: 5) + } + try { if let v = self._jspbEncodingOptions { + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + } }() + switch self.payload { + case .jspbPayload?: try { + guard case .jspbPayload(let v)? = self.payload else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 7) + }() + case .textPayload?: try { + guard case .textPayload(let v)? = self.payload else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 8) + }() + default: break + } + if self.printUnknownFields != false { + try visitor.visitSingularBoolField(value: self.printUnknownFields, fieldNumber: 9) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Conformance_ConformanceRequest, rhs: Conformance_ConformanceRequest) -> Bool { + if lhs.payload != rhs.payload {return false} + if lhs.requestedOutputFormat != rhs.requestedOutputFormat {return false} + if lhs.messageType != rhs.messageType {return false} + if lhs.testCategory != rhs.testCategory {return false} + if lhs._jspbEncodingOptions != rhs._jspbEncodingOptions {return false} + if lhs.printUnknownFields != rhs.printUnknownFields {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Conformance_ConformanceResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ConformanceResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "parse_error"), + 6: .standard(proto: "serialize_error"), + 9: .standard(proto: "timeout_error"), + 2: .standard(proto: "runtime_error"), + 3: .standard(proto: "protobuf_payload"), + 4: .standard(proto: "json_payload"), + 5: .same(proto: "skipped"), + 7: .standard(proto: "jspb_payload"), + 8: .standard(proto: "text_payload"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.result != nil {try decoder.handleConflictingOneOf()} + self.result = .parseError(v) + } + }() + case 2: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.result != nil {try decoder.handleConflictingOneOf()} + self.result = .runtimeError(v) + } + }() + case 3: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if self.result != nil {try decoder.handleConflictingOneOf()} + self.result = .protobufPayload(v) + } + }() + case 4: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.result != nil {try decoder.handleConflictingOneOf()} + self.result = .jsonPayload(v) + } + }() + case 5: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.result != nil {try decoder.handleConflictingOneOf()} + self.result = .skipped(v) + } + }() + case 6: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.result != nil {try decoder.handleConflictingOneOf()} + self.result = .serializeError(v) + } + }() + case 7: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.result != nil {try decoder.handleConflictingOneOf()} + self.result = .jspbPayload(v) + } + }() + case 8: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.result != nil {try decoder.handleConflictingOneOf()} + self.result = .textPayload(v) + } + }() + case 9: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.result != nil {try decoder.handleConflictingOneOf()} + self.result = .timeoutError(v) + } + }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + switch self.result { + case .parseError?: try { + guard case .parseError(let v)? = self.result else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + }() + case .runtimeError?: try { + guard case .runtimeError(let v)? = self.result else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + }() + case .protobufPayload?: try { + guard case .protobufPayload(let v)? = self.result else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 3) + }() + case .jsonPayload?: try { + guard case .jsonPayload(let v)? = self.result else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 4) + }() + case .skipped?: try { + guard case .skipped(let v)? = self.result else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 5) + }() + case .serializeError?: try { + guard case .serializeError(let v)? = self.result else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 6) + }() + case .jspbPayload?: try { + guard case .jspbPayload(let v)? = self.result else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 7) + }() + case .textPayload?: try { + guard case .textPayload(let v)? = self.result else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 8) + }() + case .timeoutError?: try { + guard case .timeoutError(let v)? = self.result else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 9) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Conformance_ConformanceResponse, rhs: Conformance_ConformanceResponse) -> Bool { + if lhs.result != rhs.result {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Conformance_JspbEncodingConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".JspbEncodingConfig" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "use_jspb_array_any_format"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.useJspbArrayAnyFormat) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.useJspbArrayAnyFormat != false { + try visitor.visitSingularBoolField(value: self.useJspbArrayAnyFormat, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Conformance_JspbEncodingConfig, rhs: Conformance_JspbEncodingConfig) -> Bool { + if lhs.useJspbArrayAnyFormat != rhs.useJspbArrayAnyFormat {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/upstream/google/protobuf/any.pb.swift b/Reference/upstream/google/protobuf/any.pb.swift new file mode 100644 index 000000000..640810558 --- /dev/null +++ b/Reference/upstream/google/protobuf/any.pb.swift @@ -0,0 +1,249 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: google/protobuf/any.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: ProtobufAPIVersionCheck { + struct _3: ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +/// `Any` contains an arbitrary serialized protocol buffer message along with a +/// URL that describes the type of the serialized message. +/// +/// Protobuf library provides support to pack/unpack Any values in the form +/// of utility functions or additional generated methods of the Any type. +/// +/// Example 1: Pack and unpack a message in C++. +/// +/// Foo foo = ...; +/// Any any; +/// any.PackFrom(foo); +/// ... +/// if (any.UnpackTo(&foo)) { +/// ... +/// } +/// +/// Example 2: Pack and unpack a message in Java. +/// +/// Foo foo = ...; +/// Any any = Any.pack(foo); +/// ... +/// if (any.is(Foo.class)) { +/// foo = any.unpack(Foo.class); +/// } +/// // or ... +/// if (any.isSameTypeAs(Foo.getDefaultInstance())) { +/// foo = any.unpack(Foo.getDefaultInstance()); +/// } +/// +/// Example 3: Pack and unpack a message in Python. +/// +/// foo = Foo(...) +/// any = Any() +/// any.Pack(foo) +/// ... +/// if any.Is(Foo.DESCRIPTOR): +/// any.Unpack(foo) +/// ... +/// +/// Example 4: Pack and unpack a message in Go +/// +/// foo := &pb.Foo{...} +/// any, err := anypb.New(foo) +/// if err != nil { +/// ... +/// } +/// ... +/// foo := &pb.Foo{} +/// if err := any.UnmarshalTo(foo); err != nil { +/// ... +/// } +/// +/// The pack methods provided by protobuf library will by default use +/// 'type.googleapis.com/full.type.name' as the type URL and the unpack +/// methods only use the fully qualified type name after the last '/' +/// in the type URL, for example "foo.bar.com/x/y.z" will yield type +/// name "y.z". +/// +/// JSON +/// ==== +/// The JSON representation of an `Any` value uses the regular +/// representation of the deserialized, embedded message, with an +/// additional field `@type` which contains the type URL. Example: +/// +/// package google.profile; +/// message Person { +/// string first_name = 1; +/// string last_name = 2; +/// } +/// +/// { +/// "@type": "type.googleapis.com/google.profile.Person", +/// "firstName": , +/// "lastName": +/// } +/// +/// If the embedded message type is well-known and has a custom JSON +/// representation, that representation will be embedded adding a field +/// `value` which holds the custom JSON in addition to the `@type` +/// field. Example (for message [google.protobuf.Duration][]): +/// +/// { +/// "@type": "type.googleapis.com/google.protobuf.Duration", +/// "value": "1.212s" +/// } +struct Google_Protobuf_Any { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// A URL/resource name that uniquely identifies the type of the serialized + /// protocol buffer message. This string must contain at least + /// one "/" character. The last segment of the URL's path must represent + /// the fully qualified name of the type (as in + /// `path/google.protobuf.Duration`). The name should be in a canonical form + /// (e.g., leading "." is not accepted). + /// + /// In practice, teams usually precompile into the binary all types that they + /// expect it to use in the context of Any. However, for URLs which use the + /// scheme `http`, `https`, or no scheme, one can optionally set up a type + /// server that maps type URLs to message definitions as follows: + /// + /// * If no scheme is provided, `https` is assumed. + /// * An HTTP GET on the URL must yield a [google.protobuf.Type][] + /// value in binary format, or produce an error. + /// * Applications are allowed to cache lookup results based on the + /// URL, or have them precompiled into a binary to avoid any + /// lookup. Therefore, binary compatibility needs to be preserved + /// on changes to types. (Use versioned type names to manage + /// breaking changes.) + /// + /// Note: this functionality is not currently available in the official + /// protobuf release, and it is not used for type URLs beginning with + /// type.googleapis.com. As of May 2023, there are no widely used type server + /// implementations and no plans to implement one. + /// + /// Schemes other than `http`, `https` (or the empty scheme) might be + /// used with implementation specific semantics. + var typeURL: String { + get {return _storage._typeURL} + set {_uniqueStorage()._typeURL = newValue} + } + + /// Must be a valid serialized protocol buffer of the above specified type. + var value: Data { + get {return _storage._value} + set {_uniqueStorage()._value = newValue} + } + + var unknownFields = UnknownStorage() + + init() {} + + internal var _storage = _StorageClass.defaultInstance +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Google_Protobuf_Any: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "google.protobuf" + +extension Google_Protobuf_Any: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Any" + static let _protobuf_nameMap: _NameMap = [ + 1: .standard(proto: "type_url"), + 2: .same(proto: "value"), + ] + + typealias _StorageClass = AnyMessageStorage + + internal mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &_storage._typeURL) }() + case 2: try { try decoder.decodeSingularBytesField(value: &_storage._value) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + try _storage.preTraverse() + if !_storage._typeURL.isEmpty { + try visitor.visitSingularStringField(value: _storage._typeURL, fieldNumber: 1) + } + if !_storage._value.isEmpty { + try visitor.visitSingularBytesField(value: _storage._value, fieldNumber: 2) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Any, rhs: Google_Protobuf_Any) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = lhs._storage.isEqualTo(other: rhs._storage) + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/google/protobuf/any_test.pb.swift b/Reference/upstream/google/protobuf/any_test.pb.swift similarity index 100% rename from Reference/google/protobuf/any_test.pb.swift rename to Reference/upstream/google/protobuf/any_test.pb.swift diff --git a/Reference/upstream/google/protobuf/api.pb.swift b/Reference/upstream/google/protobuf/api.pb.swift new file mode 100644 index 000000000..38c701edb --- /dev/null +++ b/Reference/upstream/google/protobuf/api.pb.swift @@ -0,0 +1,434 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: google/protobuf/api.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: ProtobufAPIVersionCheck { + struct _3: ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +/// Api is a light-weight descriptor for an API Interface. +/// +/// Interfaces are also described as "protocol buffer services" in some contexts, +/// such as by the "service" keyword in a .proto file, but they are different +/// from API Services, which represent a concrete implementation of an interface +/// as opposed to simply a description of methods and bindings. They are also +/// sometimes simply referred to as "APIs" in other contexts, such as the name of +/// this message itself. See https://cloud.google.com/apis/design/glossary for +/// detailed terminology. +struct Google_Protobuf_Api { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The fully qualified name of this interface, including package name + /// followed by the interface's simple name. + var name: String = String() + + /// The methods of this interface, in unspecified order. + var methods: [Google_Protobuf_Method] = [] + + /// Any metadata attached to the interface. + var options: [Google_Protobuf_Option] = [] + + /// A version string for this interface. If specified, must have the form + /// `major-version.minor-version`, as in `1.10`. If the minor version is + /// omitted, it defaults to zero. If the entire version field is empty, the + /// major version is derived from the package name, as outlined below. If the + /// field is not empty, the version in the package name will be verified to be + /// consistent with what is provided here. + /// + /// The versioning schema uses [semantic + /// versioning](http://semver.org) where the major version number + /// indicates a breaking change and the minor version an additive, + /// non-breaking change. Both version numbers are signals to users + /// what to expect from different versions, and should be carefully + /// chosen based on the product plan. + /// + /// The major version is also reflected in the package name of the + /// interface, which must end in `v`, as in + /// `google.feature.v1`. For major versions 0 and 1, the suffix can + /// be omitted. Zero major versions must only be used for + /// experimental, non-GA interfaces. + var version: String = String() + + /// Source context for the protocol buffer service represented by this + /// message. + var sourceContext: Google_Protobuf_SourceContext { + get {return _sourceContext ?? Google_Protobuf_SourceContext()} + set {_sourceContext = newValue} + } + /// Returns true if `sourceContext` has been explicitly set. + var hasSourceContext: Bool {return self._sourceContext != nil} + /// Clears the value of `sourceContext`. Subsequent reads from it will return its default value. + mutating func clearSourceContext() {self._sourceContext = nil} + + /// Included interfaces. See [Mixin][]. + var mixins: [Google_Protobuf_Mixin] = [] + + /// The source syntax of the service. + var syntax: Google_Protobuf_Syntax = .proto2 + + var unknownFields = UnknownStorage() + + init() {} + + fileprivate var _sourceContext: Google_Protobuf_SourceContext? = nil +} + +/// Method represents a method of an API interface. +struct Google_Protobuf_Method { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The simple name of this method. + var name: String = String() + + /// A URL of the input message type. + var requestTypeURL: String = String() + + /// If true, the request is streamed. + var requestStreaming: Bool = false + + /// The URL of the output message type. + var responseTypeURL: String = String() + + /// If true, the response is streamed. + var responseStreaming: Bool = false + + /// Any metadata attached to the method. + var options: [Google_Protobuf_Option] = [] + + /// The source syntax of this method. + var syntax: Google_Protobuf_Syntax = .proto2 + + var unknownFields = UnknownStorage() + + init() {} +} + +/// Declares an API Interface to be included in this interface. The including +/// interface must redeclare all the methods from the included interface, but +/// documentation and options are inherited as follows: +/// +/// - If after comment and whitespace stripping, the documentation +/// string of the redeclared method is empty, it will be inherited +/// from the original method. +/// +/// - Each annotation belonging to the service config (http, +/// visibility) which is not set in the redeclared method will be +/// inherited. +/// +/// - If an http annotation is inherited, the path pattern will be +/// modified as follows. Any version prefix will be replaced by the +/// version of the including interface plus the [root][] path if +/// specified. +/// +/// Example of a simple mixin: +/// +/// package google.acl.v1; +/// service AccessControl { +/// // Get the underlying ACL object. +/// rpc GetAcl(GetAclRequest) returns (Acl) { +/// option (google.api.http).get = "/v1/{resource=**}:getAcl"; +/// } +/// } +/// +/// package google.storage.v2; +/// service Storage { +/// rpc GetAcl(GetAclRequest) returns (Acl); +/// +/// // Get a data record. +/// rpc GetData(GetDataRequest) returns (Data) { +/// option (google.api.http).get = "/v2/{resource=**}"; +/// } +/// } +/// +/// Example of a mixin configuration: +/// +/// apis: +/// - name: google.storage.v2.Storage +/// mixins: +/// - name: google.acl.v1.AccessControl +/// +/// The mixin construct implies that all methods in `AccessControl` are +/// also declared with same name and request/response types in +/// `Storage`. A documentation generator or annotation processor will +/// see the effective `Storage.GetAcl` method after inherting +/// documentation and annotations as follows: +/// +/// service Storage { +/// // Get the underlying ACL object. +/// rpc GetAcl(GetAclRequest) returns (Acl) { +/// option (google.api.http).get = "/v2/{resource=**}:getAcl"; +/// } +/// ... +/// } +/// +/// Note how the version in the path pattern changed from `v1` to `v2`. +/// +/// If the `root` field in the mixin is specified, it should be a +/// relative path under which inherited HTTP paths are placed. Example: +/// +/// apis: +/// - name: google.storage.v2.Storage +/// mixins: +/// - name: google.acl.v1.AccessControl +/// root: acls +/// +/// This implies the following inherited HTTP annotation: +/// +/// service Storage { +/// // Get the underlying ACL object. +/// rpc GetAcl(GetAclRequest) returns (Acl) { +/// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; +/// } +/// ... +/// } +struct Google_Protobuf_Mixin { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The fully qualified name of the interface which is included. + var name: String = String() + + /// If non-empty specifies a path under which inherited HTTP paths + /// are rooted. + var root: String = String() + + var unknownFields = UnknownStorage() + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Google_Protobuf_Api: @unchecked Sendable {} +extension Google_Protobuf_Method: @unchecked Sendable {} +extension Google_Protobuf_Mixin: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "google.protobuf" + +extension Google_Protobuf_Api: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Api" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "methods"), + 3: .same(proto: "options"), + 4: .same(proto: "version"), + 5: .standard(proto: "source_context"), + 6: .same(proto: "mixins"), + 7: .same(proto: "syntax"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.methods) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.options) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.version) }() + case 5: try { try decoder.decodeSingularMessageField(value: &self._sourceContext) }() + case 6: try { try decoder.decodeRepeatedMessageField(value: &self.mixins) }() + case 7: try { try decoder.decodeSingularEnumField(value: &self.syntax) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + if !self.methods.isEmpty { + try visitor.visitRepeatedMessageField(value: self.methods, fieldNumber: 2) + } + if !self.options.isEmpty { + try visitor.visitRepeatedMessageField(value: self.options, fieldNumber: 3) + } + if !self.version.isEmpty { + try visitor.visitSingularStringField(value: self.version, fieldNumber: 4) + } + try { if let v = self._sourceContext { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + if !self.mixins.isEmpty { + try visitor.visitRepeatedMessageField(value: self.mixins, fieldNumber: 6) + } + if self.syntax != .proto2 { + try visitor.visitSingularEnumField(value: self.syntax, fieldNumber: 7) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Api, rhs: Google_Protobuf_Api) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.methods != rhs.methods {return false} + if lhs.options != rhs.options {return false} + if lhs.version != rhs.version {return false} + if lhs._sourceContext != rhs._sourceContext {return false} + if lhs.mixins != rhs.mixins {return false} + if lhs.syntax != rhs.syntax {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_Method: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Method" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "name"), + 2: .standard(proto: "request_type_url"), + 3: .standard(proto: "request_streaming"), + 4: .standard(proto: "response_type_url"), + 5: .standard(proto: "response_streaming"), + 6: .same(proto: "options"), + 7: .same(proto: "syntax"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.requestTypeURL) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self.requestStreaming) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.responseTypeURL) }() + case 5: try { try decoder.decodeSingularBoolField(value: &self.responseStreaming) }() + case 6: try { try decoder.decodeRepeatedMessageField(value: &self.options) }() + case 7: try { try decoder.decodeSingularEnumField(value: &self.syntax) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + if !self.requestTypeURL.isEmpty { + try visitor.visitSingularStringField(value: self.requestTypeURL, fieldNumber: 2) + } + if self.requestStreaming != false { + try visitor.visitSingularBoolField(value: self.requestStreaming, fieldNumber: 3) + } + if !self.responseTypeURL.isEmpty { + try visitor.visitSingularStringField(value: self.responseTypeURL, fieldNumber: 4) + } + if self.responseStreaming != false { + try visitor.visitSingularBoolField(value: self.responseStreaming, fieldNumber: 5) + } + if !self.options.isEmpty { + try visitor.visitRepeatedMessageField(value: self.options, fieldNumber: 6) + } + if self.syntax != .proto2 { + try visitor.visitSingularEnumField(value: self.syntax, fieldNumber: 7) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Method, rhs: Google_Protobuf_Method) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.requestTypeURL != rhs.requestTypeURL {return false} + if lhs.requestStreaming != rhs.requestStreaming {return false} + if lhs.responseTypeURL != rhs.responseTypeURL {return false} + if lhs.responseStreaming != rhs.responseStreaming {return false} + if lhs.options != rhs.options {return false} + if lhs.syntax != rhs.syntax {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_Mixin: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Mixin" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "root"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.root) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + if !self.root.isEmpty { + try visitor.visitSingularStringField(value: self.root, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Mixin, rhs: Google_Protobuf_Mixin) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.root != rhs.root {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/upstream/google/protobuf/compiler/plugin.pb.swift b/Reference/upstream/google/protobuf/compiler/plugin.pb.swift new file mode 100644 index 000000000..1fe8371d5 --- /dev/null +++ b/Reference/upstream/google/protobuf/compiler/plugin.pb.swift @@ -0,0 +1,598 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: google/protobuf/compiler/plugin.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// +// protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is +// just a program that reads a CodeGeneratorRequest from stdin and writes a +// CodeGeneratorResponse to stdout. +// +// Plugins written using C++ can use google/protobuf/compiler/plugin.h instead +// of dealing with the raw protocol defined here. +// +// A plugin executable needs only to be placed somewhere in the path. The +// plugin should be named "protoc-gen-$NAME", and will then be used when the +// flag "--${NAME}_out" is passed to protoc. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +/// The version number of protocol compiler. +struct Google_Protobuf_Compiler_Version { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var major: Int32 { + get {return _major ?? 0} + set {_major = newValue} + } + /// Returns true if `major` has been explicitly set. + var hasMajor: Bool {return self._major != nil} + /// Clears the value of `major`. Subsequent reads from it will return its default value. + mutating func clearMajor() {self._major = nil} + + var minor: Int32 { + get {return _minor ?? 0} + set {_minor = newValue} + } + /// Returns true if `minor` has been explicitly set. + var hasMinor: Bool {return self._minor != nil} + /// Clears the value of `minor`. Subsequent reads from it will return its default value. + mutating func clearMinor() {self._minor = nil} + + var patch: Int32 { + get {return _patch ?? 0} + set {_patch = newValue} + } + /// Returns true if `patch` has been explicitly set. + var hasPatch: Bool {return self._patch != nil} + /// Clears the value of `patch`. Subsequent reads from it will return its default value. + mutating func clearPatch() {self._patch = nil} + + /// A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should + /// be empty for mainline stable releases. + var suffix: String { + get {return _suffix ?? String()} + set {_suffix = newValue} + } + /// Returns true if `suffix` has been explicitly set. + var hasSuffix: Bool {return self._suffix != nil} + /// Clears the value of `suffix`. Subsequent reads from it will return its default value. + mutating func clearSuffix() {self._suffix = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _major: Int32? = nil + fileprivate var _minor: Int32? = nil + fileprivate var _patch: Int32? = nil + fileprivate var _suffix: String? = nil +} + +/// An encoded CodeGeneratorRequest is written to the plugin's stdin. +struct Google_Protobuf_Compiler_CodeGeneratorRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The .proto files that were explicitly listed on the command-line. The + /// code generator should generate code only for these files. Each file's + /// descriptor will be included in proto_file, below. + var fileToGenerate: [String] = [] + + /// The generator parameter passed on the command-line. + var parameter: String { + get {return _parameter ?? String()} + set {_parameter = newValue} + } + /// Returns true if `parameter` has been explicitly set. + var hasParameter: Bool {return self._parameter != nil} + /// Clears the value of `parameter`. Subsequent reads from it will return its default value. + mutating func clearParameter() {self._parameter = nil} + + /// FileDescriptorProtos for all files in files_to_generate and everything + /// they import. The files will appear in topological order, so each file + /// appears before any file that imports it. + /// + /// Note: the files listed in files_to_generate will include runtime-retention + /// options only, but all other files will include source-retention options. + /// The source_file_descriptors field below is available in case you need + /// source-retention options for files_to_generate. + /// + /// protoc guarantees that all proto_files will be written after + /// the fields above, even though this is not technically guaranteed by the + /// protobuf wire format. This theoretically could allow a plugin to stream + /// in the FileDescriptorProtos and handle them one by one rather than read + /// the entire set into memory at once. However, as of this writing, this + /// is not similarly optimized on protoc's end -- it will store all fields in + /// memory at once before sending them to the plugin. + /// + /// Type names of fields and extensions in the FileDescriptorProto are always + /// fully qualified. + var protoFile: [SwiftProtobuf.Google_Protobuf_FileDescriptorProto] = [] + + /// File descriptors with all options, including source-retention options. + /// These descriptors are only provided for the files listed in + /// files_to_generate. + var sourceFileDescriptors: [SwiftProtobuf.Google_Protobuf_FileDescriptorProto] = [] + + /// The version number of protocol compiler. + var compilerVersion: Google_Protobuf_Compiler_Version { + get {return _compilerVersion ?? Google_Protobuf_Compiler_Version()} + set {_compilerVersion = newValue} + } + /// Returns true if `compilerVersion` has been explicitly set. + var hasCompilerVersion: Bool {return self._compilerVersion != nil} + /// Clears the value of `compilerVersion`. Subsequent reads from it will return its default value. + mutating func clearCompilerVersion() {self._compilerVersion = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _parameter: String? = nil + fileprivate var _compilerVersion: Google_Protobuf_Compiler_Version? = nil +} + +/// The plugin writes an encoded CodeGeneratorResponse to stdout. +struct Google_Protobuf_Compiler_CodeGeneratorResponse { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Error message. If non-empty, code generation failed. The plugin process + /// should exit with status code zero even if it reports an error in this way. + /// + /// This should be used to indicate errors in .proto files which prevent the + /// code generator from generating correct code. Errors which indicate a + /// problem in protoc itself -- such as the input CodeGeneratorRequest being + /// unparseable -- should be reported by writing a message to stderr and + /// exiting with a non-zero status code. + var error: String { + get {return _error ?? String()} + set {_error = newValue} + } + /// Returns true if `error` has been explicitly set. + var hasError: Bool {return self._error != nil} + /// Clears the value of `error`. Subsequent reads from it will return its default value. + mutating func clearError() {self._error = nil} + + /// A bitmask of supported features that the code generator supports. + /// This is a bitwise "or" of values from the Feature enum. + var supportedFeatures: UInt64 { + get {return _supportedFeatures ?? 0} + set {_supportedFeatures = newValue} + } + /// Returns true if `supportedFeatures` has been explicitly set. + var hasSupportedFeatures: Bool {return self._supportedFeatures != nil} + /// Clears the value of `supportedFeatures`. Subsequent reads from it will return its default value. + mutating func clearSupportedFeatures() {self._supportedFeatures = nil} + + var file: [Google_Protobuf_Compiler_CodeGeneratorResponse.File] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + /// Sync with code_generator.h. + enum Feature: SwiftProtobuf.Enum { + typealias RawValue = Int + case none // = 0 + case proto3Optional // = 1 + + init() { + self = .none + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .none + case 1: self = .proto3Optional + default: return nil + } + } + + var rawValue: Int { + switch self { + case .none: return 0 + case .proto3Optional: return 1 + } + } + + } + + /// Represents a single generated file. + struct File { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The file name, relative to the output directory. The name must not + /// contain "." or ".." components and must be relative, not be absolute (so, + /// the file cannot lie outside the output directory). "/" must be used as + /// the path separator, not "\". + /// + /// If the name is omitted, the content will be appended to the previous + /// file. This allows the generator to break large files into small chunks, + /// and allows the generated text to be streamed back to protoc so that large + /// files need not reside completely in memory at one time. Note that as of + /// this writing protoc does not optimize for this -- it will read the entire + /// CodeGeneratorResponse before writing files to disk. + var name: String { + get {return _name ?? String()} + set {_name = newValue} + } + /// Returns true if `name` has been explicitly set. + var hasName: Bool {return self._name != nil} + /// Clears the value of `name`. Subsequent reads from it will return its default value. + mutating func clearName() {self._name = nil} + + /// If non-empty, indicates that the named file should already exist, and the + /// content here is to be inserted into that file at a defined insertion + /// point. This feature allows a code generator to extend the output + /// produced by another code generator. The original generator may provide + /// insertion points by placing special annotations in the file that look + /// like: + /// @@protoc_insertion_point(NAME) + /// The annotation can have arbitrary text before and after it on the line, + /// which allows it to be placed in a comment. NAME should be replaced with + /// an identifier naming the point -- this is what other generators will use + /// as the insertion_point. Code inserted at this point will be placed + /// immediately above the line containing the insertion point (thus multiple + /// insertions to the same point will come out in the order they were added). + /// The double-@ is intended to make it unlikely that the generated code + /// could contain things that look like insertion points by accident. + /// + /// For example, the C++ code generator places the following line in the + /// .pb.h files that it generates: + /// // @@protoc_insertion_point(namespace_scope) + /// This line appears within the scope of the file's package namespace, but + /// outside of any particular class. Another plugin can then specify the + /// insertion_point "namespace_scope" to generate additional classes or + /// other declarations that should be placed in this scope. + /// + /// Note that if the line containing the insertion point begins with + /// whitespace, the same whitespace will be added to every line of the + /// inserted text. This is useful for languages like Python, where + /// indentation matters. In these languages, the insertion point comment + /// should be indented the same amount as any inserted code will need to be + /// in order to work correctly in that context. + /// + /// The code generator that generates the initial file and the one which + /// inserts into it must both run as part of a single invocation of protoc. + /// Code generators are executed in the order in which they appear on the + /// command line. + /// + /// If |insertion_point| is present, |name| must also be present. + var insertionPoint: String { + get {return _insertionPoint ?? String()} + set {_insertionPoint = newValue} + } + /// Returns true if `insertionPoint` has been explicitly set. + var hasInsertionPoint: Bool {return self._insertionPoint != nil} + /// Clears the value of `insertionPoint`. Subsequent reads from it will return its default value. + mutating func clearInsertionPoint() {self._insertionPoint = nil} + + /// The file contents. + var content: String { + get {return _content ?? String()} + set {_content = newValue} + } + /// Returns true if `content` has been explicitly set. + var hasContent: Bool {return self._content != nil} + /// Clears the value of `content`. Subsequent reads from it will return its default value. + mutating func clearContent() {self._content = nil} + + /// Information describing the file content being inserted. If an insertion + /// point is used, this information will be appropriately offset and inserted + /// into the code generation metadata for the generated files. + var generatedCodeInfo: SwiftProtobuf.Google_Protobuf_GeneratedCodeInfo { + get {return _generatedCodeInfo ?? SwiftProtobuf.Google_Protobuf_GeneratedCodeInfo()} + set {_generatedCodeInfo = newValue} + } + /// Returns true if `generatedCodeInfo` has been explicitly set. + var hasGeneratedCodeInfo: Bool {return self._generatedCodeInfo != nil} + /// Clears the value of `generatedCodeInfo`. Subsequent reads from it will return its default value. + mutating func clearGeneratedCodeInfo() {self._generatedCodeInfo = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _name: String? = nil + fileprivate var _insertionPoint: String? = nil + fileprivate var _content: String? = nil + fileprivate var _generatedCodeInfo: SwiftProtobuf.Google_Protobuf_GeneratedCodeInfo? = nil + } + + init() {} + + fileprivate var _error: String? = nil + fileprivate var _supportedFeatures: UInt64? = nil +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Google_Protobuf_Compiler_Version: @unchecked Sendable {} +extension Google_Protobuf_Compiler_CodeGeneratorRequest: @unchecked Sendable {} +extension Google_Protobuf_Compiler_CodeGeneratorResponse: @unchecked Sendable {} +extension Google_Protobuf_Compiler_CodeGeneratorResponse.File: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "google.protobuf.compiler" + +extension Google_Protobuf_Compiler_Version: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Version" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "major"), + 2: .same(proto: "minor"), + 3: .same(proto: "patch"), + 4: .same(proto: "suffix"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._major) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._minor) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self._patch) }() + case 4: try { try decoder.decodeSingularStringField(value: &self._suffix) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._major { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._minor { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._patch { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) + } }() + try { if let v = self._suffix { + try visitor.visitSingularStringField(value: v, fieldNumber: 4) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Compiler_Version, rhs: Google_Protobuf_Compiler_Version) -> Bool { + if lhs._major != rhs._major {return false} + if lhs._minor != rhs._minor {return false} + if lhs._patch != rhs._patch {return false} + if lhs._suffix != rhs._suffix {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_Compiler_CodeGeneratorRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".CodeGeneratorRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "file_to_generate"), + 2: .same(proto: "parameter"), + 15: .standard(proto: "proto_file"), + 17: .standard(proto: "source_file_descriptors"), + 3: .standard(proto: "compiler_version"), + ] + + public var isInitialized: Bool { + if !SwiftProtobuf.Internal.areAllInitialized(self.protoFile) {return false} + if !SwiftProtobuf.Internal.areAllInitialized(self.sourceFileDescriptors) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedStringField(value: &self.fileToGenerate) }() + case 2: try { try decoder.decodeSingularStringField(value: &self._parameter) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._compilerVersion) }() + case 15: try { try decoder.decodeRepeatedMessageField(value: &self.protoFile) }() + case 17: try { try decoder.decodeRepeatedMessageField(value: &self.sourceFileDescriptors) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.fileToGenerate.isEmpty { + try visitor.visitRepeatedStringField(value: self.fileToGenerate, fieldNumber: 1) + } + try { if let v = self._parameter { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try { if let v = self._compilerVersion { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + if !self.protoFile.isEmpty { + try visitor.visitRepeatedMessageField(value: self.protoFile, fieldNumber: 15) + } + if !self.sourceFileDescriptors.isEmpty { + try visitor.visitRepeatedMessageField(value: self.sourceFileDescriptors, fieldNumber: 17) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Compiler_CodeGeneratorRequest, rhs: Google_Protobuf_Compiler_CodeGeneratorRequest) -> Bool { + if lhs.fileToGenerate != rhs.fileToGenerate {return false} + if lhs._parameter != rhs._parameter {return false} + if lhs.protoFile != rhs.protoFile {return false} + if lhs.sourceFileDescriptors != rhs.sourceFileDescriptors {return false} + if lhs._compilerVersion != rhs._compilerVersion {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_Compiler_CodeGeneratorResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".CodeGeneratorResponse" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "error"), + 2: .standard(proto: "supported_features"), + 15: .same(proto: "file"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._error) }() + case 2: try { try decoder.decodeSingularUInt64Field(value: &self._supportedFeatures) }() + case 15: try { try decoder.decodeRepeatedMessageField(value: &self.file) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._error { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._supportedFeatures { + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 2) + } }() + if !self.file.isEmpty { + try visitor.visitRepeatedMessageField(value: self.file, fieldNumber: 15) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Compiler_CodeGeneratorResponse, rhs: Google_Protobuf_Compiler_CodeGeneratorResponse) -> Bool { + if lhs._error != rhs._error {return false} + if lhs._supportedFeatures != rhs._supportedFeatures {return false} + if lhs.file != rhs.file {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_Compiler_CodeGeneratorResponse.Feature: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FEATURE_NONE"), + 1: .same(proto: "FEATURE_PROTO3_OPTIONAL"), + ] +} + +extension Google_Protobuf_Compiler_CodeGeneratorResponse.File: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Google_Protobuf_Compiler_CodeGeneratorResponse.protoMessageName + ".File" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "name"), + 2: .standard(proto: "insertion_point"), + 15: .same(proto: "content"), + 16: .standard(proto: "generated_code_info"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._name) }() + case 2: try { try decoder.decodeSingularStringField(value: &self._insertionPoint) }() + case 15: try { try decoder.decodeSingularStringField(value: &self._content) }() + case 16: try { try decoder.decodeSingularMessageField(value: &self._generatedCodeInfo) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._name { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._insertionPoint { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try { if let v = self._content { + try visitor.visitSingularStringField(value: v, fieldNumber: 15) + } }() + try { if let v = self._generatedCodeInfo { + try visitor.visitSingularMessageField(value: v, fieldNumber: 16) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Compiler_CodeGeneratorResponse.File, rhs: Google_Protobuf_Compiler_CodeGeneratorResponse.File) -> Bool { + if lhs._name != rhs._name {return false} + if lhs._insertionPoint != rhs._insertionPoint {return false} + if lhs._content != rhs._content {return false} + if lhs._generatedCodeInfo != rhs._generatedCodeInfo {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/upstream/google/protobuf/descriptor.pb.swift b/Reference/upstream/google/protobuf/descriptor.pb.swift new file mode 100644 index 000000000..799148cd7 --- /dev/null +++ b/Reference/upstream/google/protobuf/descriptor.pb.swift @@ -0,0 +1,4477 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: google/protobuf/descriptor.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). + +import Foundation + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: ProtobufAPIVersionCheck { + struct _3: ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +/// The protocol compiler can output a FileDescriptorSet containing the .proto +/// files it parses. +struct Google_Protobuf_FileDescriptorSet { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var file: [Google_Protobuf_FileDescriptorProto] = [] + + var unknownFields = UnknownStorage() + + init() {} +} + +/// Describes a complete .proto file. +struct Google_Protobuf_FileDescriptorProto { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// file name, relative to root of source tree + var name: String { + get {return _name ?? String()} + set {_name = newValue} + } + /// Returns true if `name` has been explicitly set. + var hasName: Bool {return self._name != nil} + /// Clears the value of `name`. Subsequent reads from it will return its default value. + mutating func clearName() {self._name = nil} + + /// e.g. "foo", "foo.bar", etc. + var package: String { + get {return _package ?? String()} + set {_package = newValue} + } + /// Returns true if `package` has been explicitly set. + var hasPackage: Bool {return self._package != nil} + /// Clears the value of `package`. Subsequent reads from it will return its default value. + mutating func clearPackage() {self._package = nil} + + /// Names of files imported by this file. + var dependency: [String] = [] + + /// Indexes of the public imported files in the dependency list above. + var publicDependency: [Int32] = [] + + /// Indexes of the weak imported files in the dependency list. + /// For Google-internal migration only. Do not use. + var weakDependency: [Int32] = [] + + /// All top-level definitions in this file. + var messageType: [Google_Protobuf_DescriptorProto] = [] + + var enumType: [Google_Protobuf_EnumDescriptorProto] = [] + + var service: [Google_Protobuf_ServiceDescriptorProto] = [] + + var `extension`: [Google_Protobuf_FieldDescriptorProto] = [] + + var options: Google_Protobuf_FileOptions { + get {return _options ?? Google_Protobuf_FileOptions()} + set {_options = newValue} + } + /// Returns true if `options` has been explicitly set. + var hasOptions: Bool {return self._options != nil} + /// Clears the value of `options`. Subsequent reads from it will return its default value. + mutating func clearOptions() {self._options = nil} + + /// This field contains optional information about the original source code. + /// You may safely remove this entire field without harming runtime + /// functionality of the descriptors -- the information is needed only by + /// development tools. + var sourceCodeInfo: Google_Protobuf_SourceCodeInfo { + get {return _sourceCodeInfo ?? Google_Protobuf_SourceCodeInfo()} + set {_sourceCodeInfo = newValue} + } + /// Returns true if `sourceCodeInfo` has been explicitly set. + var hasSourceCodeInfo: Bool {return self._sourceCodeInfo != nil} + /// Clears the value of `sourceCodeInfo`. Subsequent reads from it will return its default value. + mutating func clearSourceCodeInfo() {self._sourceCodeInfo = nil} + + /// The syntax of the proto file. + /// The supported values are "proto2", "proto3", and "editions". + /// + /// If `edition` is present, this value must be "editions". + var syntax: String { + get {return _syntax ?? String()} + set {_syntax = newValue} + } + /// Returns true if `syntax` has been explicitly set. + var hasSyntax: Bool {return self._syntax != nil} + /// Clears the value of `syntax`. Subsequent reads from it will return its default value. + mutating func clearSyntax() {self._syntax = nil} + + /// The edition of the proto file, which is an opaque string. + var edition: String { + get {return _edition ?? String()} + set {_edition = newValue} + } + /// Returns true if `edition` has been explicitly set. + var hasEdition: Bool {return self._edition != nil} + /// Clears the value of `edition`. Subsequent reads from it will return its default value. + mutating func clearEdition() {self._edition = nil} + + var unknownFields = UnknownStorage() + + init() {} + + fileprivate var _name: String? = nil + fileprivate var _package: String? = nil + fileprivate var _options: Google_Protobuf_FileOptions? = nil + fileprivate var _sourceCodeInfo: Google_Protobuf_SourceCodeInfo? = nil + fileprivate var _syntax: String? = nil + fileprivate var _edition: String? = nil +} + +/// Describes a message type. +struct Google_Protobuf_DescriptorProto { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var name: String { + get {return _name ?? String()} + set {_name = newValue} + } + /// Returns true if `name` has been explicitly set. + var hasName: Bool {return self._name != nil} + /// Clears the value of `name`. Subsequent reads from it will return its default value. + mutating func clearName() {self._name = nil} + + var field: [Google_Protobuf_FieldDescriptorProto] = [] + + var `extension`: [Google_Protobuf_FieldDescriptorProto] = [] + + var nestedType: [Google_Protobuf_DescriptorProto] = [] + + var enumType: [Google_Protobuf_EnumDescriptorProto] = [] + + var extensionRange: [Google_Protobuf_DescriptorProto.ExtensionRange] = [] + + var oneofDecl: [Google_Protobuf_OneofDescriptorProto] = [] + + var options: Google_Protobuf_MessageOptions { + get {return _options ?? Google_Protobuf_MessageOptions()} + set {_options = newValue} + } + /// Returns true if `options` has been explicitly set. + var hasOptions: Bool {return self._options != nil} + /// Clears the value of `options`. Subsequent reads from it will return its default value. + mutating func clearOptions() {self._options = nil} + + var reservedRange: [Google_Protobuf_DescriptorProto.ReservedRange] = [] + + /// Reserved field names, which may not be used by fields in the same message. + /// A given name may only be reserved once. + var reservedName: [String] = [] + + var unknownFields = UnknownStorage() + + struct ExtensionRange { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Inclusive. + var start: Int32 { + get {return _start ?? 0} + set {_start = newValue} + } + /// Returns true if `start` has been explicitly set. + var hasStart: Bool {return self._start != nil} + /// Clears the value of `start`. Subsequent reads from it will return its default value. + mutating func clearStart() {self._start = nil} + + /// Exclusive. + var end: Int32 { + get {return _end ?? 0} + set {_end = newValue} + } + /// Returns true if `end` has been explicitly set. + var hasEnd: Bool {return self._end != nil} + /// Clears the value of `end`. Subsequent reads from it will return its default value. + mutating func clearEnd() {self._end = nil} + + var options: Google_Protobuf_ExtensionRangeOptions { + get {return _options ?? Google_Protobuf_ExtensionRangeOptions()} + set {_options = newValue} + } + /// Returns true if `options` has been explicitly set. + var hasOptions: Bool {return self._options != nil} + /// Clears the value of `options`. Subsequent reads from it will return its default value. + mutating func clearOptions() {self._options = nil} + + var unknownFields = UnknownStorage() + + init() {} + + fileprivate var _start: Int32? = nil + fileprivate var _end: Int32? = nil + fileprivate var _options: Google_Protobuf_ExtensionRangeOptions? = nil + } + + /// Range of reserved tag numbers. Reserved tag numbers may not be used by + /// fields or extension ranges in the same message. Reserved ranges may + /// not overlap. + struct ReservedRange { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Inclusive. + var start: Int32 { + get {return _start ?? 0} + set {_start = newValue} + } + /// Returns true if `start` has been explicitly set. + var hasStart: Bool {return self._start != nil} + /// Clears the value of `start`. Subsequent reads from it will return its default value. + mutating func clearStart() {self._start = nil} + + /// Exclusive. + var end: Int32 { + get {return _end ?? 0} + set {_end = newValue} + } + /// Returns true if `end` has been explicitly set. + var hasEnd: Bool {return self._end != nil} + /// Clears the value of `end`. Subsequent reads from it will return its default value. + mutating func clearEnd() {self._end = nil} + + var unknownFields = UnknownStorage() + + init() {} + + fileprivate var _start: Int32? = nil + fileprivate var _end: Int32? = nil + } + + init() {} + + fileprivate var _name: String? = nil + fileprivate var _options: Google_Protobuf_MessageOptions? = nil +} + +struct Google_Protobuf_ExtensionRangeOptions: ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The parser stores options it doesn't recognize here. See above. + var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = [] + + /// For external users: DO NOT USE. We are in the process of open sourcing + /// extension declaration and executing internal cleanups before it can be + /// used externally. + var declaration: [Google_Protobuf_ExtensionRangeOptions.Declaration] = [] + + /// The verification state of the range. + /// TODO(b/278783756): flip the default to DECLARATION once all empty ranges + /// are marked as UNVERIFIED. + var verification: Google_Protobuf_ExtensionRangeOptions.VerificationState { + get {return _verification ?? .unverified} + set {_verification = newValue} + } + /// Returns true if `verification` has been explicitly set. + var hasVerification: Bool {return self._verification != nil} + /// Clears the value of `verification`. Subsequent reads from it will return its default value. + mutating func clearVerification() {self._verification = nil} + + var unknownFields = UnknownStorage() + + /// The verification state of the extension range. + enum VerificationState: Enum { + typealias RawValue = Int + + /// All the extensions of the range must be declared. + case declaration // = 0 + case unverified // = 1 + + init() { + self = .declaration + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .declaration + case 1: self = .unverified + default: return nil + } + } + + var rawValue: Int { + switch self { + case .declaration: return 0 + case .unverified: return 1 + } + } + + } + + struct Declaration { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The extension number declared within the extension range. + var number: Int32 { + get {return _number ?? 0} + set {_number = newValue} + } + /// Returns true if `number` has been explicitly set. + var hasNumber: Bool {return self._number != nil} + /// Clears the value of `number`. Subsequent reads from it will return its default value. + mutating func clearNumber() {self._number = nil} + + /// The fully-qualified name of the extension field. There must be a leading + /// dot in front of the full name. + var fullName: String { + get {return _fullName ?? String()} + set {_fullName = newValue} + } + /// Returns true if `fullName` has been explicitly set. + var hasFullName: Bool {return self._fullName != nil} + /// Clears the value of `fullName`. Subsequent reads from it will return its default value. + mutating func clearFullName() {self._fullName = nil} + + /// The fully-qualified type name of the extension field. Unlike + /// Metadata.type, Declaration.type must have a leading dot for messages + /// and enums. + var type: String { + get {return _type ?? String()} + set {_type = newValue} + } + /// Returns true if `type` has been explicitly set. + var hasType: Bool {return self._type != nil} + /// Clears the value of `type`. Subsequent reads from it will return its default value. + mutating func clearType() {self._type = nil} + + /// Deprecated. Please use "repeated". + var isRepeated: Bool { + get {return _isRepeated ?? false} + set {_isRepeated = newValue} + } + /// Returns true if `isRepeated` has been explicitly set. + var hasIsRepeated: Bool {return self._isRepeated != nil} + /// Clears the value of `isRepeated`. Subsequent reads from it will return its default value. + mutating func clearIsRepeated() {self._isRepeated = nil} + + /// If true, indicates that the number is reserved in the extension range, + /// and any extension field with the number will fail to compile. Set this + /// when a declared extension field is deleted. + var reserved: Bool { + get {return _reserved ?? false} + set {_reserved = newValue} + } + /// Returns true if `reserved` has been explicitly set. + var hasReserved: Bool {return self._reserved != nil} + /// Clears the value of `reserved`. Subsequent reads from it will return its default value. + mutating func clearReserved() {self._reserved = nil} + + /// If true, indicates that the extension must be defined as repeated. + /// Otherwise the extension must be defined as optional. + var repeated: Bool { + get {return _repeated ?? false} + set {_repeated = newValue} + } + /// Returns true if `repeated` has been explicitly set. + var hasRepeated: Bool {return self._repeated != nil} + /// Clears the value of `repeated`. Subsequent reads from it will return its default value. + mutating func clearRepeated() {self._repeated = nil} + + var unknownFields = UnknownStorage() + + init() {} + + fileprivate var _number: Int32? = nil + fileprivate var _fullName: String? = nil + fileprivate var _type: String? = nil + fileprivate var _isRepeated: Bool? = nil + fileprivate var _reserved: Bool? = nil + fileprivate var _repeated: Bool? = nil + } + + init() {} + + var _protobuf_extensionFieldValues = ExtensionFieldValueSet() + fileprivate var _verification: Google_Protobuf_ExtensionRangeOptions.VerificationState? = nil +} + +/// Describes a field within a message. +struct Google_Protobuf_FieldDescriptorProto { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var name: String { + get {return _storage._name ?? String()} + set {_uniqueStorage()._name = newValue} + } + /// Returns true if `name` has been explicitly set. + var hasName: Bool {return _storage._name != nil} + /// Clears the value of `name`. Subsequent reads from it will return its default value. + mutating func clearName() {_uniqueStorage()._name = nil} + + var number: Int32 { + get {return _storage._number ?? 0} + set {_uniqueStorage()._number = newValue} + } + /// Returns true if `number` has been explicitly set. + var hasNumber: Bool {return _storage._number != nil} + /// Clears the value of `number`. Subsequent reads from it will return its default value. + mutating func clearNumber() {_uniqueStorage()._number = nil} + + var label: Google_Protobuf_FieldDescriptorProto.Label { + get {return _storage._label ?? .optional} + set {_uniqueStorage()._label = newValue} + } + /// Returns true if `label` has been explicitly set. + var hasLabel: Bool {return _storage._label != nil} + /// Clears the value of `label`. Subsequent reads from it will return its default value. + mutating func clearLabel() {_uniqueStorage()._label = nil} + + /// If type_name is set, this need not be set. If both this and type_name + /// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + var type: Google_Protobuf_FieldDescriptorProto.TypeEnum { + get {return _storage._type ?? .double} + set {_uniqueStorage()._type = newValue} + } + /// Returns true if `type` has been explicitly set. + var hasType: Bool {return _storage._type != nil} + /// Clears the value of `type`. Subsequent reads from it will return its default value. + mutating func clearType() {_uniqueStorage()._type = nil} + + /// For message and enum types, this is the name of the type. If the name + /// starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + /// rules are used to find the type (i.e. first the nested types within this + /// message are searched, then within the parent, on up to the root + /// namespace). + var typeName: String { + get {return _storage._typeName ?? String()} + set {_uniqueStorage()._typeName = newValue} + } + /// Returns true if `typeName` has been explicitly set. + var hasTypeName: Bool {return _storage._typeName != nil} + /// Clears the value of `typeName`. Subsequent reads from it will return its default value. + mutating func clearTypeName() {_uniqueStorage()._typeName = nil} + + /// For extensions, this is the name of the type being extended. It is + /// resolved in the same manner as type_name. + var extendee: String { + get {return _storage._extendee ?? String()} + set {_uniqueStorage()._extendee = newValue} + } + /// Returns true if `extendee` has been explicitly set. + var hasExtendee: Bool {return _storage._extendee != nil} + /// Clears the value of `extendee`. Subsequent reads from it will return its default value. + mutating func clearExtendee() {_uniqueStorage()._extendee = nil} + + /// For numeric types, contains the original text representation of the value. + /// For booleans, "true" or "false". + /// For strings, contains the default text contents (not escaped in any way). + /// For bytes, contains the C escaped value. All bytes >= 128 are escaped. + var defaultValue: String { + get {return _storage._defaultValue ?? String()} + set {_uniqueStorage()._defaultValue = newValue} + } + /// Returns true if `defaultValue` has been explicitly set. + var hasDefaultValue: Bool {return _storage._defaultValue != nil} + /// Clears the value of `defaultValue`. Subsequent reads from it will return its default value. + mutating func clearDefaultValue() {_uniqueStorage()._defaultValue = nil} + + /// If set, gives the index of a oneof in the containing type's oneof_decl + /// list. This field is a member of that oneof. + var oneofIndex: Int32 { + get {return _storage._oneofIndex ?? 0} + set {_uniqueStorage()._oneofIndex = newValue} + } + /// Returns true if `oneofIndex` has been explicitly set. + var hasOneofIndex: Bool {return _storage._oneofIndex != nil} + /// Clears the value of `oneofIndex`. Subsequent reads from it will return its default value. + mutating func clearOneofIndex() {_uniqueStorage()._oneofIndex = nil} + + /// JSON name of this field. The value is set by protocol compiler. If the + /// user has set a "json_name" option on this field, that option's value + /// will be used. Otherwise, it's deduced from the field's name by converting + /// it to camelCase. + var jsonName: String { + get {return _storage._jsonName ?? String()} + set {_uniqueStorage()._jsonName = newValue} + } + /// Returns true if `jsonName` has been explicitly set. + var hasJsonName: Bool {return _storage._jsonName != nil} + /// Clears the value of `jsonName`. Subsequent reads from it will return its default value. + mutating func clearJsonName() {_uniqueStorage()._jsonName = nil} + + var options: Google_Protobuf_FieldOptions { + get {return _storage._options ?? Google_Protobuf_FieldOptions()} + set {_uniqueStorage()._options = newValue} + } + /// Returns true if `options` has been explicitly set. + var hasOptions: Bool {return _storage._options != nil} + /// Clears the value of `options`. Subsequent reads from it will return its default value. + mutating func clearOptions() {_uniqueStorage()._options = nil} + + /// If true, this is a proto3 "optional". When a proto3 field is optional, it + /// tracks presence regardless of field type. + /// + /// When proto3_optional is true, this field must be belong to a oneof to + /// signal to old proto3 clients that presence is tracked for this field. This + /// oneof is known as a "synthetic" oneof, and this field must be its sole + /// member (each proto3 optional field gets its own synthetic oneof). Synthetic + /// oneofs exist in the descriptor only, and do not generate any API. Synthetic + /// oneofs must be ordered after all "real" oneofs. + /// + /// For message fields, proto3_optional doesn't create any semantic change, + /// since non-repeated message fields always track presence. However it still + /// indicates the semantic detail of whether the user wrote "optional" or not. + /// This can be useful for round-tripping the .proto file. For consistency we + /// give message fields a synthetic oneof also, even though it is not required + /// to track presence. This is especially important because the parser can't + /// tell if a field is a message or an enum, so it must always create a + /// synthetic oneof. + /// + /// Proto2 optional fields do not set this flag, because they already indicate + /// optional with `LABEL_OPTIONAL`. + var proto3Optional: Bool { + get {return _storage._proto3Optional ?? false} + set {_uniqueStorage()._proto3Optional = newValue} + } + /// Returns true if `proto3Optional` has been explicitly set. + var hasProto3Optional: Bool {return _storage._proto3Optional != nil} + /// Clears the value of `proto3Optional`. Subsequent reads from it will return its default value. + mutating func clearProto3Optional() {_uniqueStorage()._proto3Optional = nil} + + var unknownFields = UnknownStorage() + + enum TypeEnum: Enum { + typealias RawValue = Int + + /// 0 is reserved for errors. + /// Order is weird for historical reasons. + case double // = 1 + case float // = 2 + + /// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + /// negative values are likely. + case int64 // = 3 + case uint64 // = 4 + + /// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + /// negative values are likely. + case int32 // = 5 + case fixed64 // = 6 + case fixed32 // = 7 + case bool // = 8 + case string // = 9 + + /// Tag-delimited aggregate. + /// Group type is deprecated and not supported in proto3. However, Proto3 + /// implementations should still be able to parse the group wire format and + /// treat group fields as unknown fields. + case group // = 10 + + /// Length-delimited aggregate. + case message // = 11 + + /// New in version 2. + case bytes // = 12 + case uint32 // = 13 + case `enum` // = 14 + case sfixed32 // = 15 + case sfixed64 // = 16 + + /// Uses ZigZag encoding. + case sint32 // = 17 + + /// Uses ZigZag encoding. + case sint64 // = 18 + + init() { + self = .double + } + + init?(rawValue: Int) { + switch rawValue { + case 1: self = .double + case 2: self = .float + case 3: self = .int64 + case 4: self = .uint64 + case 5: self = .int32 + case 6: self = .fixed64 + case 7: self = .fixed32 + case 8: self = .bool + case 9: self = .string + case 10: self = .group + case 11: self = .message + case 12: self = .bytes + case 13: self = .uint32 + case 14: self = .enum + case 15: self = .sfixed32 + case 16: self = .sfixed64 + case 17: self = .sint32 + case 18: self = .sint64 + default: return nil + } + } + + var rawValue: Int { + switch self { + case .double: return 1 + case .float: return 2 + case .int64: return 3 + case .uint64: return 4 + case .int32: return 5 + case .fixed64: return 6 + case .fixed32: return 7 + case .bool: return 8 + case .string: return 9 + case .group: return 10 + case .message: return 11 + case .bytes: return 12 + case .uint32: return 13 + case .enum: return 14 + case .sfixed32: return 15 + case .sfixed64: return 16 + case .sint32: return 17 + case .sint64: return 18 + } + } + + } + + enum Label: Enum { + typealias RawValue = Int + + /// 0 is reserved for errors + case `optional` // = 1 + case `required` // = 2 + case repeated // = 3 + + init() { + self = .optional + } + + init?(rawValue: Int) { + switch rawValue { + case 1: self = .optional + case 2: self = .required + case 3: self = .repeated + default: return nil + } + } + + var rawValue: Int { + switch self { + case .optional: return 1 + case .required: return 2 + case .repeated: return 3 + } + } + + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +/// Describes a oneof. +struct Google_Protobuf_OneofDescriptorProto { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var name: String { + get {return _name ?? String()} + set {_name = newValue} + } + /// Returns true if `name` has been explicitly set. + var hasName: Bool {return self._name != nil} + /// Clears the value of `name`. Subsequent reads from it will return its default value. + mutating func clearName() {self._name = nil} + + var options: Google_Protobuf_OneofOptions { + get {return _options ?? Google_Protobuf_OneofOptions()} + set {_options = newValue} + } + /// Returns true if `options` has been explicitly set. + var hasOptions: Bool {return self._options != nil} + /// Clears the value of `options`. Subsequent reads from it will return its default value. + mutating func clearOptions() {self._options = nil} + + var unknownFields = UnknownStorage() + + init() {} + + fileprivate var _name: String? = nil + fileprivate var _options: Google_Protobuf_OneofOptions? = nil +} + +/// Describes an enum type. +struct Google_Protobuf_EnumDescriptorProto { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var name: String { + get {return _name ?? String()} + set {_name = newValue} + } + /// Returns true if `name` has been explicitly set. + var hasName: Bool {return self._name != nil} + /// Clears the value of `name`. Subsequent reads from it will return its default value. + mutating func clearName() {self._name = nil} + + var value: [Google_Protobuf_EnumValueDescriptorProto] = [] + + var options: Google_Protobuf_EnumOptions { + get {return _options ?? Google_Protobuf_EnumOptions()} + set {_options = newValue} + } + /// Returns true if `options` has been explicitly set. + var hasOptions: Bool {return self._options != nil} + /// Clears the value of `options`. Subsequent reads from it will return its default value. + mutating func clearOptions() {self._options = nil} + + /// Range of reserved numeric values. Reserved numeric values may not be used + /// by enum values in the same enum declaration. Reserved ranges may not + /// overlap. + var reservedRange: [Google_Protobuf_EnumDescriptorProto.EnumReservedRange] = [] + + /// Reserved enum value names, which may not be reused. A given name may only + /// be reserved once. + var reservedName: [String] = [] + + var unknownFields = UnknownStorage() + + /// Range of reserved numeric values. Reserved values may not be used by + /// entries in the same enum. Reserved ranges may not overlap. + /// + /// Note that this is distinct from DescriptorProto.ReservedRange in that it + /// is inclusive such that it can appropriately represent the entire int32 + /// domain. + struct EnumReservedRange { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Inclusive. + var start: Int32 { + get {return _start ?? 0} + set {_start = newValue} + } + /// Returns true if `start` has been explicitly set. + var hasStart: Bool {return self._start != nil} + /// Clears the value of `start`. Subsequent reads from it will return its default value. + mutating func clearStart() {self._start = nil} + + /// Inclusive. + var end: Int32 { + get {return _end ?? 0} + set {_end = newValue} + } + /// Returns true if `end` has been explicitly set. + var hasEnd: Bool {return self._end != nil} + /// Clears the value of `end`. Subsequent reads from it will return its default value. + mutating func clearEnd() {self._end = nil} + + var unknownFields = UnknownStorage() + + init() {} + + fileprivate var _start: Int32? = nil + fileprivate var _end: Int32? = nil + } + + init() {} + + fileprivate var _name: String? = nil + fileprivate var _options: Google_Protobuf_EnumOptions? = nil +} + +/// Describes a value within an enum. +struct Google_Protobuf_EnumValueDescriptorProto { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var name: String { + get {return _name ?? String()} + set {_name = newValue} + } + /// Returns true if `name` has been explicitly set. + var hasName: Bool {return self._name != nil} + /// Clears the value of `name`. Subsequent reads from it will return its default value. + mutating func clearName() {self._name = nil} + + var number: Int32 { + get {return _number ?? 0} + set {_number = newValue} + } + /// Returns true if `number` has been explicitly set. + var hasNumber: Bool {return self._number != nil} + /// Clears the value of `number`. Subsequent reads from it will return its default value. + mutating func clearNumber() {self._number = nil} + + var options: Google_Protobuf_EnumValueOptions { + get {return _options ?? Google_Protobuf_EnumValueOptions()} + set {_options = newValue} + } + /// Returns true if `options` has been explicitly set. + var hasOptions: Bool {return self._options != nil} + /// Clears the value of `options`. Subsequent reads from it will return its default value. + mutating func clearOptions() {self._options = nil} + + var unknownFields = UnknownStorage() + + init() {} + + fileprivate var _name: String? = nil + fileprivate var _number: Int32? = nil + fileprivate var _options: Google_Protobuf_EnumValueOptions? = nil +} + +/// Describes a service. +struct Google_Protobuf_ServiceDescriptorProto { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var name: String { + get {return _name ?? String()} + set {_name = newValue} + } + /// Returns true if `name` has been explicitly set. + var hasName: Bool {return self._name != nil} + /// Clears the value of `name`. Subsequent reads from it will return its default value. + mutating func clearName() {self._name = nil} + + var method: [Google_Protobuf_MethodDescriptorProto] = [] + + var options: Google_Protobuf_ServiceOptions { + get {return _options ?? Google_Protobuf_ServiceOptions()} + set {_options = newValue} + } + /// Returns true if `options` has been explicitly set. + var hasOptions: Bool {return self._options != nil} + /// Clears the value of `options`. Subsequent reads from it will return its default value. + mutating func clearOptions() {self._options = nil} + + var unknownFields = UnknownStorage() + + init() {} + + fileprivate var _name: String? = nil + fileprivate var _options: Google_Protobuf_ServiceOptions? = nil +} + +/// Describes a method of a service. +struct Google_Protobuf_MethodDescriptorProto { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var name: String { + get {return _name ?? String()} + set {_name = newValue} + } + /// Returns true if `name` has been explicitly set. + var hasName: Bool {return self._name != nil} + /// Clears the value of `name`. Subsequent reads from it will return its default value. + mutating func clearName() {self._name = nil} + + /// Input and output type names. These are resolved in the same way as + /// FieldDescriptorProto.type_name, but must refer to a message type. + var inputType: String { + get {return _inputType ?? String()} + set {_inputType = newValue} + } + /// Returns true if `inputType` has been explicitly set. + var hasInputType: Bool {return self._inputType != nil} + /// Clears the value of `inputType`. Subsequent reads from it will return its default value. + mutating func clearInputType() {self._inputType = nil} + + var outputType: String { + get {return _outputType ?? String()} + set {_outputType = newValue} + } + /// Returns true if `outputType` has been explicitly set. + var hasOutputType: Bool {return self._outputType != nil} + /// Clears the value of `outputType`. Subsequent reads from it will return its default value. + mutating func clearOutputType() {self._outputType = nil} + + var options: Google_Protobuf_MethodOptions { + get {return _options ?? Google_Protobuf_MethodOptions()} + set {_options = newValue} + } + /// Returns true if `options` has been explicitly set. + var hasOptions: Bool {return self._options != nil} + /// Clears the value of `options`. Subsequent reads from it will return its default value. + mutating func clearOptions() {self._options = nil} + + /// Identifies if client streams multiple client messages + var clientStreaming: Bool { + get {return _clientStreaming ?? false} + set {_clientStreaming = newValue} + } + /// Returns true if `clientStreaming` has been explicitly set. + var hasClientStreaming: Bool {return self._clientStreaming != nil} + /// Clears the value of `clientStreaming`. Subsequent reads from it will return its default value. + mutating func clearClientStreaming() {self._clientStreaming = nil} + + /// Identifies if server streams multiple server messages + var serverStreaming: Bool { + get {return _serverStreaming ?? false} + set {_serverStreaming = newValue} + } + /// Returns true if `serverStreaming` has been explicitly set. + var hasServerStreaming: Bool {return self._serverStreaming != nil} + /// Clears the value of `serverStreaming`. Subsequent reads from it will return its default value. + mutating func clearServerStreaming() {self._serverStreaming = nil} + + var unknownFields = UnknownStorage() + + init() {} + + fileprivate var _name: String? = nil + fileprivate var _inputType: String? = nil + fileprivate var _outputType: String? = nil + fileprivate var _options: Google_Protobuf_MethodOptions? = nil + fileprivate var _clientStreaming: Bool? = nil + fileprivate var _serverStreaming: Bool? = nil +} + +struct Google_Protobuf_FileOptions: ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Sets the Java package where classes generated from this .proto will be + /// placed. By default, the proto package is used, but this is often + /// inappropriate because proto packages do not normally start with backwards + /// domain names. + var javaPackage: String { + get {return _storage._javaPackage ?? String()} + set {_uniqueStorage()._javaPackage = newValue} + } + /// Returns true if `javaPackage` has been explicitly set. + var hasJavaPackage: Bool {return _storage._javaPackage != nil} + /// Clears the value of `javaPackage`. Subsequent reads from it will return its default value. + mutating func clearJavaPackage() {_uniqueStorage()._javaPackage = nil} + + /// Controls the name of the wrapper Java class generated for the .proto file. + /// That class will always contain the .proto file's getDescriptor() method as + /// well as any top-level extensions defined in the .proto file. + /// If java_multiple_files is disabled, then all the other classes from the + /// .proto file will be nested inside the single wrapper outer class. + var javaOuterClassname: String { + get {return _storage._javaOuterClassname ?? String()} + set {_uniqueStorage()._javaOuterClassname = newValue} + } + /// Returns true if `javaOuterClassname` has been explicitly set. + var hasJavaOuterClassname: Bool {return _storage._javaOuterClassname != nil} + /// Clears the value of `javaOuterClassname`. Subsequent reads from it will return its default value. + mutating func clearJavaOuterClassname() {_uniqueStorage()._javaOuterClassname = nil} + + /// If enabled, then the Java code generator will generate a separate .java + /// file for each top-level message, enum, and service defined in the .proto + /// file. Thus, these types will *not* be nested inside the wrapper class + /// named by java_outer_classname. However, the wrapper class will still be + /// generated to contain the file's getDescriptor() method as well as any + /// top-level extensions defined in the file. + var javaMultipleFiles: Bool { + get {return _storage._javaMultipleFiles ?? false} + set {_uniqueStorage()._javaMultipleFiles = newValue} + } + /// Returns true if `javaMultipleFiles` has been explicitly set. + var hasJavaMultipleFiles: Bool {return _storage._javaMultipleFiles != nil} + /// Clears the value of `javaMultipleFiles`. Subsequent reads from it will return its default value. + mutating func clearJavaMultipleFiles() {_uniqueStorage()._javaMultipleFiles = nil} + + /// This option does nothing. + var javaGenerateEqualsAndHash: Bool { + get {return _storage._javaGenerateEqualsAndHash ?? false} + set {_uniqueStorage()._javaGenerateEqualsAndHash = newValue} + } + /// Returns true if `javaGenerateEqualsAndHash` has been explicitly set. + var hasJavaGenerateEqualsAndHash: Bool {return _storage._javaGenerateEqualsAndHash != nil} + /// Clears the value of `javaGenerateEqualsAndHash`. Subsequent reads from it will return its default value. + mutating func clearJavaGenerateEqualsAndHash() {_uniqueStorage()._javaGenerateEqualsAndHash = nil} + + /// If set true, then the Java2 code generator will generate code that + /// throws an exception whenever an attempt is made to assign a non-UTF-8 + /// byte sequence to a string field. + /// Message reflection will do the same. + /// However, an extension field still accepts non-UTF-8 byte sequences. + /// This option has no effect on when used with the lite runtime. + var javaStringCheckUtf8: Bool { + get {return _storage._javaStringCheckUtf8 ?? false} + set {_uniqueStorage()._javaStringCheckUtf8 = newValue} + } + /// Returns true if `javaStringCheckUtf8` has been explicitly set. + var hasJavaStringCheckUtf8: Bool {return _storage._javaStringCheckUtf8 != nil} + /// Clears the value of `javaStringCheckUtf8`. Subsequent reads from it will return its default value. + mutating func clearJavaStringCheckUtf8() {_uniqueStorage()._javaStringCheckUtf8 = nil} + + var optimizeFor: Google_Protobuf_FileOptions.OptimizeMode { + get {return _storage._optimizeFor ?? .speed} + set {_uniqueStorage()._optimizeFor = newValue} + } + /// Returns true if `optimizeFor` has been explicitly set. + var hasOptimizeFor: Bool {return _storage._optimizeFor != nil} + /// Clears the value of `optimizeFor`. Subsequent reads from it will return its default value. + mutating func clearOptimizeFor() {_uniqueStorage()._optimizeFor = nil} + + /// Sets the Go package where structs generated from this .proto will be + /// placed. If omitted, the Go package will be derived from the following: + /// - The basename of the package import path, if provided. + /// - Otherwise, the package statement in the .proto file, if present. + /// - Otherwise, the basename of the .proto file, without extension. + var goPackage: String { + get {return _storage._goPackage ?? String()} + set {_uniqueStorage()._goPackage = newValue} + } + /// Returns true if `goPackage` has been explicitly set. + var hasGoPackage: Bool {return _storage._goPackage != nil} + /// Clears the value of `goPackage`. Subsequent reads from it will return its default value. + mutating func clearGoPackage() {_uniqueStorage()._goPackage = nil} + + /// Should generic services be generated in each language? "Generic" services + /// are not specific to any particular RPC system. They are generated by the + /// main code generators in each language (without additional plugins). + /// Generic services were the only kind of service generation supported by + /// early versions of google.protobuf. + /// + /// Generic services are now considered deprecated in favor of using plugins + /// that generate code specific to your particular RPC system. Therefore, + /// these default to false. Old code which depends on generic services should + /// explicitly set them to true. + var ccGenericServices: Bool { + get {return _storage._ccGenericServices ?? false} + set {_uniqueStorage()._ccGenericServices = newValue} + } + /// Returns true if `ccGenericServices` has been explicitly set. + var hasCcGenericServices: Bool {return _storage._ccGenericServices != nil} + /// Clears the value of `ccGenericServices`. Subsequent reads from it will return its default value. + mutating func clearCcGenericServices() {_uniqueStorage()._ccGenericServices = nil} + + var javaGenericServices: Bool { + get {return _storage._javaGenericServices ?? false} + set {_uniqueStorage()._javaGenericServices = newValue} + } + /// Returns true if `javaGenericServices` has been explicitly set. + var hasJavaGenericServices: Bool {return _storage._javaGenericServices != nil} + /// Clears the value of `javaGenericServices`. Subsequent reads from it will return its default value. + mutating func clearJavaGenericServices() {_uniqueStorage()._javaGenericServices = nil} + + var pyGenericServices: Bool { + get {return _storage._pyGenericServices ?? false} + set {_uniqueStorage()._pyGenericServices = newValue} + } + /// Returns true if `pyGenericServices` has been explicitly set. + var hasPyGenericServices: Bool {return _storage._pyGenericServices != nil} + /// Clears the value of `pyGenericServices`. Subsequent reads from it will return its default value. + mutating func clearPyGenericServices() {_uniqueStorage()._pyGenericServices = nil} + + var phpGenericServices: Bool { + get {return _storage._phpGenericServices ?? false} + set {_uniqueStorage()._phpGenericServices = newValue} + } + /// Returns true if `phpGenericServices` has been explicitly set. + var hasPhpGenericServices: Bool {return _storage._phpGenericServices != nil} + /// Clears the value of `phpGenericServices`. Subsequent reads from it will return its default value. + mutating func clearPhpGenericServices() {_uniqueStorage()._phpGenericServices = nil} + + /// Is this file deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for everything in the file, or it will be completely ignored; in the very + /// least, this is a formalization for deprecating files. + var deprecated: Bool { + get {return _storage._deprecated ?? false} + set {_uniqueStorage()._deprecated = newValue} + } + /// Returns true if `deprecated` has been explicitly set. + var hasDeprecated: Bool {return _storage._deprecated != nil} + /// Clears the value of `deprecated`. Subsequent reads from it will return its default value. + mutating func clearDeprecated() {_uniqueStorage()._deprecated = nil} + + /// Enables the use of arenas for the proto messages in this file. This applies + /// only to generated classes for C++. + var ccEnableArenas: Bool { + get {return _storage._ccEnableArenas ?? true} + set {_uniqueStorage()._ccEnableArenas = newValue} + } + /// Returns true if `ccEnableArenas` has been explicitly set. + var hasCcEnableArenas: Bool {return _storage._ccEnableArenas != nil} + /// Clears the value of `ccEnableArenas`. Subsequent reads from it will return its default value. + mutating func clearCcEnableArenas() {_uniqueStorage()._ccEnableArenas = nil} + + /// Sets the objective c class prefix which is prepended to all objective c + /// generated classes from this .proto. There is no default. + var objcClassPrefix: String { + get {return _storage._objcClassPrefix ?? String()} + set {_uniqueStorage()._objcClassPrefix = newValue} + } + /// Returns true if `objcClassPrefix` has been explicitly set. + var hasObjcClassPrefix: Bool {return _storage._objcClassPrefix != nil} + /// Clears the value of `objcClassPrefix`. Subsequent reads from it will return its default value. + mutating func clearObjcClassPrefix() {_uniqueStorage()._objcClassPrefix = nil} + + /// Namespace for generated classes; defaults to the package. + var csharpNamespace: String { + get {return _storage._csharpNamespace ?? String()} + set {_uniqueStorage()._csharpNamespace = newValue} + } + /// Returns true if `csharpNamespace` has been explicitly set. + var hasCsharpNamespace: Bool {return _storage._csharpNamespace != nil} + /// Clears the value of `csharpNamespace`. Subsequent reads from it will return its default value. + mutating func clearCsharpNamespace() {_uniqueStorage()._csharpNamespace = nil} + + /// By default Swift generators will take the proto package and CamelCase it + /// replacing '.' with underscore and use that to prefix the types/symbols + /// defined. When this options is provided, they will use this value instead + /// to prefix the types/symbols defined. + var swiftPrefix: String { + get {return _storage._swiftPrefix ?? String()} + set {_uniqueStorage()._swiftPrefix = newValue} + } + /// Returns true if `swiftPrefix` has been explicitly set. + var hasSwiftPrefix: Bool {return _storage._swiftPrefix != nil} + /// Clears the value of `swiftPrefix`. Subsequent reads from it will return its default value. + mutating func clearSwiftPrefix() {_uniqueStorage()._swiftPrefix = nil} + + /// Sets the php class prefix which is prepended to all php generated classes + /// from this .proto. Default is empty. + var phpClassPrefix: String { + get {return _storage._phpClassPrefix ?? String()} + set {_uniqueStorage()._phpClassPrefix = newValue} + } + /// Returns true if `phpClassPrefix` has been explicitly set. + var hasPhpClassPrefix: Bool {return _storage._phpClassPrefix != nil} + /// Clears the value of `phpClassPrefix`. Subsequent reads from it will return its default value. + mutating func clearPhpClassPrefix() {_uniqueStorage()._phpClassPrefix = nil} + + /// Use this option to change the namespace of php generated classes. Default + /// is empty. When this option is empty, the package name will be used for + /// determining the namespace. + var phpNamespace: String { + get {return _storage._phpNamespace ?? String()} + set {_uniqueStorage()._phpNamespace = newValue} + } + /// Returns true if `phpNamespace` has been explicitly set. + var hasPhpNamespace: Bool {return _storage._phpNamespace != nil} + /// Clears the value of `phpNamespace`. Subsequent reads from it will return its default value. + mutating func clearPhpNamespace() {_uniqueStorage()._phpNamespace = nil} + + /// Use this option to change the namespace of php generated metadata classes. + /// Default is empty. When this option is empty, the proto file name will be + /// used for determining the namespace. + var phpMetadataNamespace: String { + get {return _storage._phpMetadataNamespace ?? String()} + set {_uniqueStorage()._phpMetadataNamespace = newValue} + } + /// Returns true if `phpMetadataNamespace` has been explicitly set. + var hasPhpMetadataNamespace: Bool {return _storage._phpMetadataNamespace != nil} + /// Clears the value of `phpMetadataNamespace`. Subsequent reads from it will return its default value. + mutating func clearPhpMetadataNamespace() {_uniqueStorage()._phpMetadataNamespace = nil} + + /// Use this option to change the package of ruby generated classes. Default + /// is empty. When this option is not set, the package name will be used for + /// determining the ruby package. + var rubyPackage: String { + get {return _storage._rubyPackage ?? String()} + set {_uniqueStorage()._rubyPackage = newValue} + } + /// Returns true if `rubyPackage` has been explicitly set. + var hasRubyPackage: Bool {return _storage._rubyPackage != nil} + /// Clears the value of `rubyPackage`. Subsequent reads from it will return its default value. + mutating func clearRubyPackage() {_uniqueStorage()._rubyPackage = nil} + + /// The parser stores options it doesn't recognize here. + /// See the documentation for the "Options" section above. + var uninterpretedOption: [Google_Protobuf_UninterpretedOption] { + get {return _storage._uninterpretedOption} + set {_uniqueStorage()._uninterpretedOption = newValue} + } + + var unknownFields = UnknownStorage() + + /// Generated classes can be optimized for speed or code size. + enum OptimizeMode: Enum { + typealias RawValue = Int + + /// Generate complete code for parsing, serialization, + case speed // = 1 + + /// etc. + case codeSize // = 2 + + /// Generate code using MessageLite and the lite runtime. + case liteRuntime // = 3 + + init() { + self = .speed + } + + init?(rawValue: Int) { + switch rawValue { + case 1: self = .speed + case 2: self = .codeSize + case 3: self = .liteRuntime + default: return nil + } + } + + var rawValue: Int { + switch self { + case .speed: return 1 + case .codeSize: return 2 + case .liteRuntime: return 3 + } + } + + } + + init() {} + + var _protobuf_extensionFieldValues = ExtensionFieldValueSet() + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct Google_Protobuf_MessageOptions: ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Set true to use the old proto1 MessageSet wire format for extensions. + /// This is provided for backwards-compatibility with the MessageSet wire + /// format. You should not use this for any other reason: It's less + /// efficient, has fewer features, and is more complicated. + /// + /// The message must be defined exactly as follows: + /// message Foo { + /// option message_set_wire_format = true; + /// extensions 4 to max; + /// } + /// Note that the message cannot have any defined fields; MessageSets only + /// have extensions. + /// + /// All extensions of your type must be singular messages; e.g. they cannot + /// be int32s, enums, or repeated messages. + /// + /// Because this is an option, the above two restrictions are not enforced by + /// the protocol compiler. + var messageSetWireFormat: Bool { + get {return _messageSetWireFormat ?? false} + set {_messageSetWireFormat = newValue} + } + /// Returns true if `messageSetWireFormat` has been explicitly set. + var hasMessageSetWireFormat: Bool {return self._messageSetWireFormat != nil} + /// Clears the value of `messageSetWireFormat`. Subsequent reads from it will return its default value. + mutating func clearMessageSetWireFormat() {self._messageSetWireFormat = nil} + + /// Disables the generation of the standard "descriptor()" accessor, which can + /// conflict with a field of the same name. This is meant to make migration + /// from proto1 easier; new code should avoid fields named "descriptor". + var noStandardDescriptorAccessor: Bool { + get {return _noStandardDescriptorAccessor ?? false} + set {_noStandardDescriptorAccessor = newValue} + } + /// Returns true if `noStandardDescriptorAccessor` has been explicitly set. + var hasNoStandardDescriptorAccessor: Bool {return self._noStandardDescriptorAccessor != nil} + /// Clears the value of `noStandardDescriptorAccessor`. Subsequent reads from it will return its default value. + mutating func clearNoStandardDescriptorAccessor() {self._noStandardDescriptorAccessor = nil} + + /// Is this message deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the message, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating messages. + var deprecated: Bool { + get {return _deprecated ?? false} + set {_deprecated = newValue} + } + /// Returns true if `deprecated` has been explicitly set. + var hasDeprecated: Bool {return self._deprecated != nil} + /// Clears the value of `deprecated`. Subsequent reads from it will return its default value. + mutating func clearDeprecated() {self._deprecated = nil} + + /// NOTE: Do not set the option in .proto files. Always use the maps syntax + /// instead. The option should only be implicitly set by the proto compiler + /// parser. + /// + /// Whether the message is an automatically generated map entry type for the + /// maps field. + /// + /// For maps fields: + /// map map_field = 1; + /// The parsed descriptor looks like: + /// message MapFieldEntry { + /// option map_entry = true; + /// optional KeyType key = 1; + /// optional ValueType value = 2; + /// } + /// repeated MapFieldEntry map_field = 1; + /// + /// Implementations may choose not to generate the map_entry=true message, but + /// use a native map in the target language to hold the keys and values. + /// The reflection APIs in such implementations still need to work as + /// if the field is a repeated message field. + var mapEntry: Bool { + get {return _mapEntry ?? false} + set {_mapEntry = newValue} + } + /// Returns true if `mapEntry` has been explicitly set. + var hasMapEntry: Bool {return self._mapEntry != nil} + /// Clears the value of `mapEntry`. Subsequent reads from it will return its default value. + mutating func clearMapEntry() {self._mapEntry = nil} + + /// Enable the legacy handling of JSON field name conflicts. This lowercases + /// and strips underscored from the fields before comparison in proto3 only. + /// The new behavior takes `json_name` into account and applies to proto2 as + /// well. + /// + /// This should only be used as a temporary measure against broken builds due + /// to the change in behavior for JSON field name conflicts. + /// + /// TODO(b/261750190) This is legacy behavior we plan to remove once downstream + /// teams have had time to migrate. + var deprecatedLegacyJsonFieldConflicts: Bool { + get {return _deprecatedLegacyJsonFieldConflicts ?? false} + set {_deprecatedLegacyJsonFieldConflicts = newValue} + } + /// Returns true if `deprecatedLegacyJsonFieldConflicts` has been explicitly set. + var hasDeprecatedLegacyJsonFieldConflicts: Bool {return self._deprecatedLegacyJsonFieldConflicts != nil} + /// Clears the value of `deprecatedLegacyJsonFieldConflicts`. Subsequent reads from it will return its default value. + mutating func clearDeprecatedLegacyJsonFieldConflicts() {self._deprecatedLegacyJsonFieldConflicts = nil} + + /// The parser stores options it doesn't recognize here. See above. + var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = [] + + var unknownFields = UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = ExtensionFieldValueSet() + fileprivate var _messageSetWireFormat: Bool? = nil + fileprivate var _noStandardDescriptorAccessor: Bool? = nil + fileprivate var _deprecated: Bool? = nil + fileprivate var _mapEntry: Bool? = nil + fileprivate var _deprecatedLegacyJsonFieldConflicts: Bool? = nil +} + +struct Google_Protobuf_FieldOptions: ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The ctype option instructs the C++ code generator to use a different + /// representation of the field than it normally would. See the specific + /// options below. This option is only implemented to support use of + /// [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + /// type "bytes" in the open source release -- sorry, we'll try to include + /// other types in a future version! + var ctype: Google_Protobuf_FieldOptions.CType { + get {return _ctype ?? .string} + set {_ctype = newValue} + } + /// Returns true if `ctype` has been explicitly set. + var hasCtype: Bool {return self._ctype != nil} + /// Clears the value of `ctype`. Subsequent reads from it will return its default value. + mutating func clearCtype() {self._ctype = nil} + + /// The packed option can be enabled for repeated primitive fields to enable + /// a more efficient representation on the wire. Rather than repeatedly + /// writing the tag and type for each element, the entire array is encoded as + /// a single length-delimited blob. In proto3, only explicit setting it to + /// false will avoid using packed encoding. + var packed: Bool { + get {return _packed ?? false} + set {_packed = newValue} + } + /// Returns true if `packed` has been explicitly set. + var hasPacked: Bool {return self._packed != nil} + /// Clears the value of `packed`. Subsequent reads from it will return its default value. + mutating func clearPacked() {self._packed = nil} + + /// The jstype option determines the JavaScript type used for values of the + /// field. The option is permitted only for 64 bit integral and fixed types + /// (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + /// is represented as JavaScript string, which avoids loss of precision that + /// can happen when a large value is converted to a floating point JavaScript. + /// Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + /// use the JavaScript "number" type. The behavior of the default option + /// JS_NORMAL is implementation dependent. + /// + /// This option is an enum to permit additional types to be added, e.g. + /// goog.math.Integer. + var jstype: Google_Protobuf_FieldOptions.JSType { + get {return _jstype ?? .jsNormal} + set {_jstype = newValue} + } + /// Returns true if `jstype` has been explicitly set. + var hasJstype: Bool {return self._jstype != nil} + /// Clears the value of `jstype`. Subsequent reads from it will return its default value. + mutating func clearJstype() {self._jstype = nil} + + /// Should this field be parsed lazily? Lazy applies only to message-type + /// fields. It means that when the outer message is initially parsed, the + /// inner message's contents will not be parsed but instead stored in encoded + /// form. The inner message will actually be parsed when it is first accessed. + /// + /// This is only a hint. Implementations are free to choose whether to use + /// eager or lazy parsing regardless of the value of this option. However, + /// setting this option true suggests that the protocol author believes that + /// using lazy parsing on this field is worth the additional bookkeeping + /// overhead typically needed to implement it. + /// + /// This option does not affect the public interface of any generated code; + /// all method signatures remain the same. Furthermore, thread-safety of the + /// interface is not affected by this option; const methods remain safe to + /// call from multiple threads concurrently, while non-const methods continue + /// to require exclusive access. + /// + /// Note that implementations may choose not to check required fields within + /// a lazy sub-message. That is, calling IsInitialized() on the outer message + /// may return true even if the inner message has missing required fields. + /// This is necessary because otherwise the inner message would have to be + /// parsed in order to perform the check, defeating the purpose of lazy + /// parsing. An implementation which chooses not to check required fields + /// must be consistent about it. That is, for any particular sub-message, the + /// implementation must either *always* check its required fields, or *never* + /// check its required fields, regardless of whether or not the message has + /// been parsed. + /// + /// As of May 2022, lazy verifies the contents of the byte stream during + /// parsing. An invalid byte stream will cause the overall parsing to fail. + var lazy: Bool { + get {return _lazy ?? false} + set {_lazy = newValue} + } + /// Returns true if `lazy` has been explicitly set. + var hasLazy: Bool {return self._lazy != nil} + /// Clears the value of `lazy`. Subsequent reads from it will return its default value. + mutating func clearLazy() {self._lazy = nil} + + /// unverified_lazy does no correctness checks on the byte stream. This should + /// only be used where lazy with verification is prohibitive for performance + /// reasons. + var unverifiedLazy: Bool { + get {return _unverifiedLazy ?? false} + set {_unverifiedLazy = newValue} + } + /// Returns true if `unverifiedLazy` has been explicitly set. + var hasUnverifiedLazy: Bool {return self._unverifiedLazy != nil} + /// Clears the value of `unverifiedLazy`. Subsequent reads from it will return its default value. + mutating func clearUnverifiedLazy() {self._unverifiedLazy = nil} + + /// Is this field deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for accessors, or it will be completely ignored; in the very least, this + /// is a formalization for deprecating fields. + var deprecated: Bool { + get {return _deprecated ?? false} + set {_deprecated = newValue} + } + /// Returns true if `deprecated` has been explicitly set. + var hasDeprecated: Bool {return self._deprecated != nil} + /// Clears the value of `deprecated`. Subsequent reads from it will return its default value. + mutating func clearDeprecated() {self._deprecated = nil} + + /// For Google-internal migration only. Do not use. + var weak: Bool { + get {return _weak ?? false} + set {_weak = newValue} + } + /// Returns true if `weak` has been explicitly set. + var hasWeak: Bool {return self._weak != nil} + /// Clears the value of `weak`. Subsequent reads from it will return its default value. + mutating func clearWeak() {self._weak = nil} + + /// Indicate that the field value should not be printed out when using debug + /// formats, e.g. when the field contains sensitive credentials. + var debugRedact: Bool { + get {return _debugRedact ?? false} + set {_debugRedact = newValue} + } + /// Returns true if `debugRedact` has been explicitly set. + var hasDebugRedact: Bool {return self._debugRedact != nil} + /// Clears the value of `debugRedact`. Subsequent reads from it will return its default value. + mutating func clearDebugRedact() {self._debugRedact = nil} + + var retention: Google_Protobuf_FieldOptions.OptionRetention { + get {return _retention ?? .retentionUnknown} + set {_retention = newValue} + } + /// Returns true if `retention` has been explicitly set. + var hasRetention: Bool {return self._retention != nil} + /// Clears the value of `retention`. Subsequent reads from it will return its default value. + mutating func clearRetention() {self._retention = nil} + + var targets: [Google_Protobuf_FieldOptions.OptionTargetType] = [] + + /// The parser stores options it doesn't recognize here. See above. + var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = [] + + var targetObsoleteDoNotUse: Google_Protobuf_FieldOptions.OptionTargetType { + get {return _targetObsoleteDoNotUse ?? .targetTypeUnknown} + set {_targetObsoleteDoNotUse = newValue} + } + /// Returns true if `targetObsoleteDoNotUse` has been explicitly set. + var hasTargetObsoleteDoNotUse: Bool {return self._targetObsoleteDoNotUse != nil} + /// Clears the value of `targetObsoleteDoNotUse`. Subsequent reads from it will return its default value. + mutating func clearTargetObsoleteDoNotUse() {self._targetObsoleteDoNotUse = nil} + + var unknownFields = UnknownStorage() + + enum CType: Enum { + typealias RawValue = Int + + /// Default mode. + case string // = 0 + + /// The option [ctype=CORD] may be applied to a non-repeated field of type + /// "bytes". It indicates that in C++, the data should be stored in a Cord + /// instead of a string. For very large strings, this may reduce memory + /// fragmentation. It may also allow better performance when parsing from a + /// Cord, or when parsing with aliasing enabled, as the parsed Cord may then + /// alias the original buffer. + case cord // = 1 + case stringPiece // = 2 + + init() { + self = .string + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .string + case 1: self = .cord + case 2: self = .stringPiece + default: return nil + } + } + + var rawValue: Int { + switch self { + case .string: return 0 + case .cord: return 1 + case .stringPiece: return 2 + } + } + + } + + enum JSType: Enum { + typealias RawValue = Int + + /// Use the default type. + case jsNormal // = 0 + + /// Use JavaScript strings. + case jsString // = 1 + + /// Use JavaScript numbers. + case jsNumber // = 2 + + init() { + self = .jsNormal + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .jsNormal + case 1: self = .jsString + case 2: self = .jsNumber + default: return nil + } + } + + var rawValue: Int { + switch self { + case .jsNormal: return 0 + case .jsString: return 1 + case .jsNumber: return 2 + } + } + + } + + /// If set to RETENTION_SOURCE, the option will be omitted from the binary. + /// Note: as of January 2023, support for this is in progress and does not yet + /// have an effect (b/264593489). + enum OptionRetention: Enum { + typealias RawValue = Int + case retentionUnknown // = 0 + case retentionRuntime // = 1 + case retentionSource // = 2 + + init() { + self = .retentionUnknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .retentionUnknown + case 1: self = .retentionRuntime + case 2: self = .retentionSource + default: return nil + } + } + + var rawValue: Int { + switch self { + case .retentionUnknown: return 0 + case .retentionRuntime: return 1 + case .retentionSource: return 2 + } + } + + } + + /// This indicates the types of entities that the field may apply to when used + /// as an option. If it is unset, then the field may be freely used as an + /// option on any kind of entity. Note: as of January 2023, support for this is + /// in progress and does not yet have an effect (b/264593489). + enum OptionTargetType: Enum { + typealias RawValue = Int + case targetTypeUnknown // = 0 + case targetTypeFile // = 1 + case targetTypeExtensionRange // = 2 + case targetTypeMessage // = 3 + case targetTypeField // = 4 + case targetTypeOneof // = 5 + case targetTypeEnum // = 6 + case targetTypeEnumEntry // = 7 + case targetTypeService // = 8 + case targetTypeMethod // = 9 + + init() { + self = .targetTypeUnknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .targetTypeUnknown + case 1: self = .targetTypeFile + case 2: self = .targetTypeExtensionRange + case 3: self = .targetTypeMessage + case 4: self = .targetTypeField + case 5: self = .targetTypeOneof + case 6: self = .targetTypeEnum + case 7: self = .targetTypeEnumEntry + case 8: self = .targetTypeService + case 9: self = .targetTypeMethod + default: return nil + } + } + + var rawValue: Int { + switch self { + case .targetTypeUnknown: return 0 + case .targetTypeFile: return 1 + case .targetTypeExtensionRange: return 2 + case .targetTypeMessage: return 3 + case .targetTypeField: return 4 + case .targetTypeOneof: return 5 + case .targetTypeEnum: return 6 + case .targetTypeEnumEntry: return 7 + case .targetTypeService: return 8 + case .targetTypeMethod: return 9 + } + } + + } + + init() {} + + var _protobuf_extensionFieldValues = ExtensionFieldValueSet() + fileprivate var _ctype: Google_Protobuf_FieldOptions.CType? = nil + fileprivate var _packed: Bool? = nil + fileprivate var _jstype: Google_Protobuf_FieldOptions.JSType? = nil + fileprivate var _lazy: Bool? = nil + fileprivate var _unverifiedLazy: Bool? = nil + fileprivate var _deprecated: Bool? = nil + fileprivate var _weak: Bool? = nil + fileprivate var _debugRedact: Bool? = nil + fileprivate var _retention: Google_Protobuf_FieldOptions.OptionRetention? = nil + fileprivate var _targetObsoleteDoNotUse: Google_Protobuf_FieldOptions.OptionTargetType? = nil +} + +struct Google_Protobuf_OneofOptions: ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The parser stores options it doesn't recognize here. See above. + var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = [] + + var unknownFields = UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = ExtensionFieldValueSet() +} + +struct Google_Protobuf_EnumOptions: ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Set this option to true to allow mapping different tag names to the same + /// value. + var allowAlias: Bool { + get {return _allowAlias ?? false} + set {_allowAlias = newValue} + } + /// Returns true if `allowAlias` has been explicitly set. + var hasAllowAlias: Bool {return self._allowAlias != nil} + /// Clears the value of `allowAlias`. Subsequent reads from it will return its default value. + mutating func clearAllowAlias() {self._allowAlias = nil} + + /// Is this enum deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the enum, or it will be completely ignored; in the very least, this + /// is a formalization for deprecating enums. + var deprecated: Bool { + get {return _deprecated ?? false} + set {_deprecated = newValue} + } + /// Returns true if `deprecated` has been explicitly set. + var hasDeprecated: Bool {return self._deprecated != nil} + /// Clears the value of `deprecated`. Subsequent reads from it will return its default value. + mutating func clearDeprecated() {self._deprecated = nil} + + /// Enable the legacy handling of JSON field name conflicts. This lowercases + /// and strips underscored from the fields before comparison in proto3 only. + /// The new behavior takes `json_name` into account and applies to proto2 as + /// well. + /// TODO(b/261750190) Remove this legacy behavior once downstream teams have + /// had time to migrate. + var deprecatedLegacyJsonFieldConflicts: Bool { + get {return _deprecatedLegacyJsonFieldConflicts ?? false} + set {_deprecatedLegacyJsonFieldConflicts = newValue} + } + /// Returns true if `deprecatedLegacyJsonFieldConflicts` has been explicitly set. + var hasDeprecatedLegacyJsonFieldConflicts: Bool {return self._deprecatedLegacyJsonFieldConflicts != nil} + /// Clears the value of `deprecatedLegacyJsonFieldConflicts`. Subsequent reads from it will return its default value. + mutating func clearDeprecatedLegacyJsonFieldConflicts() {self._deprecatedLegacyJsonFieldConflicts = nil} + + /// The parser stores options it doesn't recognize here. See above. + var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = [] + + var unknownFields = UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = ExtensionFieldValueSet() + fileprivate var _allowAlias: Bool? = nil + fileprivate var _deprecated: Bool? = nil + fileprivate var _deprecatedLegacyJsonFieldConflicts: Bool? = nil +} + +struct Google_Protobuf_EnumValueOptions: ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Is this enum value deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the enum value, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating enum values. + var deprecated: Bool { + get {return _deprecated ?? false} + set {_deprecated = newValue} + } + /// Returns true if `deprecated` has been explicitly set. + var hasDeprecated: Bool {return self._deprecated != nil} + /// Clears the value of `deprecated`. Subsequent reads from it will return its default value. + mutating func clearDeprecated() {self._deprecated = nil} + + /// Indicate that fields annotated with this enum value should not be printed + /// out when using debug formats, e.g. when the field contains sensitive + /// credentials. + var debugRedact: Bool { + get {return _debugRedact ?? false} + set {_debugRedact = newValue} + } + /// Returns true if `debugRedact` has been explicitly set. + var hasDebugRedact: Bool {return self._debugRedact != nil} + /// Clears the value of `debugRedact`. Subsequent reads from it will return its default value. + mutating func clearDebugRedact() {self._debugRedact = nil} + + /// The parser stores options it doesn't recognize here. See above. + var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = [] + + var unknownFields = UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = ExtensionFieldValueSet() + fileprivate var _deprecated: Bool? = nil + fileprivate var _debugRedact: Bool? = nil +} + +struct Google_Protobuf_ServiceOptions: ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Is this service deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the service, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating services. + var deprecated: Bool { + get {return _deprecated ?? false} + set {_deprecated = newValue} + } + /// Returns true if `deprecated` has been explicitly set. + var hasDeprecated: Bool {return self._deprecated != nil} + /// Clears the value of `deprecated`. Subsequent reads from it will return its default value. + mutating func clearDeprecated() {self._deprecated = nil} + + /// The parser stores options it doesn't recognize here. See above. + var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = [] + + var unknownFields = UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = ExtensionFieldValueSet() + fileprivate var _deprecated: Bool? = nil +} + +struct Google_Protobuf_MethodOptions: ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Is this method deprecated? + /// Depending on the target platform, this can emit Deprecated annotations + /// for the method, or it will be completely ignored; in the very least, + /// this is a formalization for deprecating methods. + var deprecated: Bool { + get {return _deprecated ?? false} + set {_deprecated = newValue} + } + /// Returns true if `deprecated` has been explicitly set. + var hasDeprecated: Bool {return self._deprecated != nil} + /// Clears the value of `deprecated`. Subsequent reads from it will return its default value. + mutating func clearDeprecated() {self._deprecated = nil} + + var idempotencyLevel: Google_Protobuf_MethodOptions.IdempotencyLevel { + get {return _idempotencyLevel ?? .idempotencyUnknown} + set {_idempotencyLevel = newValue} + } + /// Returns true if `idempotencyLevel` has been explicitly set. + var hasIdempotencyLevel: Bool {return self._idempotencyLevel != nil} + /// Clears the value of `idempotencyLevel`. Subsequent reads from it will return its default value. + mutating func clearIdempotencyLevel() {self._idempotencyLevel = nil} + + /// The parser stores options it doesn't recognize here. See above. + var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = [] + + var unknownFields = UnknownStorage() + + /// Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + /// or neither? HTTP based RPC implementation may choose GET verb for safe + /// methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel: Enum { + typealias RawValue = Int + case idempotencyUnknown // = 0 + + /// implies idempotent + case noSideEffects // = 1 + + /// idempotent, but may have side effects + case idempotent // = 2 + + init() { + self = .idempotencyUnknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .idempotencyUnknown + case 1: self = .noSideEffects + case 2: self = .idempotent + default: return nil + } + } + + var rawValue: Int { + switch self { + case .idempotencyUnknown: return 0 + case .noSideEffects: return 1 + case .idempotent: return 2 + } + } + + } + + init() {} + + var _protobuf_extensionFieldValues = ExtensionFieldValueSet() + fileprivate var _deprecated: Bool? = nil + fileprivate var _idempotencyLevel: Google_Protobuf_MethodOptions.IdempotencyLevel? = nil +} + +/// A message representing a option the parser does not recognize. This only +/// appears in options protos created by the compiler::Parser class. +/// DescriptorPool resolves these when building Descriptor objects. Therefore, +/// options protos in descriptor objects (e.g. returned by Descriptor::options(), +/// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +/// in them. +struct Google_Protobuf_UninterpretedOption { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var name: [Google_Protobuf_UninterpretedOption.NamePart] = [] + + /// The value of the uninterpreted option, in whatever type the tokenizer + /// identified it as during parsing. Exactly one of these should be set. + var identifierValue: String { + get {return _identifierValue ?? String()} + set {_identifierValue = newValue} + } + /// Returns true if `identifierValue` has been explicitly set. + var hasIdentifierValue: Bool {return self._identifierValue != nil} + /// Clears the value of `identifierValue`. Subsequent reads from it will return its default value. + mutating func clearIdentifierValue() {self._identifierValue = nil} + + var positiveIntValue: UInt64 { + get {return _positiveIntValue ?? 0} + set {_positiveIntValue = newValue} + } + /// Returns true if `positiveIntValue` has been explicitly set. + var hasPositiveIntValue: Bool {return self._positiveIntValue != nil} + /// Clears the value of `positiveIntValue`. Subsequent reads from it will return its default value. + mutating func clearPositiveIntValue() {self._positiveIntValue = nil} + + var negativeIntValue: Int64 { + get {return _negativeIntValue ?? 0} + set {_negativeIntValue = newValue} + } + /// Returns true if `negativeIntValue` has been explicitly set. + var hasNegativeIntValue: Bool {return self._negativeIntValue != nil} + /// Clears the value of `negativeIntValue`. Subsequent reads from it will return its default value. + mutating func clearNegativeIntValue() {self._negativeIntValue = nil} + + var doubleValue: Double { + get {return _doubleValue ?? 0} + set {_doubleValue = newValue} + } + /// Returns true if `doubleValue` has been explicitly set. + var hasDoubleValue: Bool {return self._doubleValue != nil} + /// Clears the value of `doubleValue`. Subsequent reads from it will return its default value. + mutating func clearDoubleValue() {self._doubleValue = nil} + + var stringValue: Data { + get {return _stringValue ?? Data()} + set {_stringValue = newValue} + } + /// Returns true if `stringValue` has been explicitly set. + var hasStringValue: Bool {return self._stringValue != nil} + /// Clears the value of `stringValue`. Subsequent reads from it will return its default value. + mutating func clearStringValue() {self._stringValue = nil} + + var aggregateValue: String { + get {return _aggregateValue ?? String()} + set {_aggregateValue = newValue} + } + /// Returns true if `aggregateValue` has been explicitly set. + var hasAggregateValue: Bool {return self._aggregateValue != nil} + /// Clears the value of `aggregateValue`. Subsequent reads from it will return its default value. + mutating func clearAggregateValue() {self._aggregateValue = nil} + + var unknownFields = UnknownStorage() + + /// The name of the uninterpreted option. Each string represents a segment in + /// a dot-separated name. is_extension is true iff a segment represents an + /// extension (denoted with parentheses in options specs in .proto files). + /// E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + /// "foo.(bar.baz).moo". + struct NamePart { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var namePart: String { + get {return _namePart ?? String()} + set {_namePart = newValue} + } + /// Returns true if `namePart` has been explicitly set. + var hasNamePart: Bool {return self._namePart != nil} + /// Clears the value of `namePart`. Subsequent reads from it will return its default value. + mutating func clearNamePart() {self._namePart = nil} + + var isExtension: Bool { + get {return _isExtension ?? false} + set {_isExtension = newValue} + } + /// Returns true if `isExtension` has been explicitly set. + var hasIsExtension: Bool {return self._isExtension != nil} + /// Clears the value of `isExtension`. Subsequent reads from it will return its default value. + mutating func clearIsExtension() {self._isExtension = nil} + + var unknownFields = UnknownStorage() + + init() {} + + fileprivate var _namePart: String? = nil + fileprivate var _isExtension: Bool? = nil + } + + init() {} + + fileprivate var _identifierValue: String? = nil + fileprivate var _positiveIntValue: UInt64? = nil + fileprivate var _negativeIntValue: Int64? = nil + fileprivate var _doubleValue: Double? = nil + fileprivate var _stringValue: Data? = nil + fileprivate var _aggregateValue: String? = nil +} + +/// Encapsulates information about the original source file from which a +/// FileDescriptorProto was generated. +struct Google_Protobuf_SourceCodeInfo { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// A Location identifies a piece of source code in a .proto file which + /// corresponds to a particular definition. This information is intended + /// to be useful to IDEs, code indexers, documentation generators, and similar + /// tools. + /// + /// For example, say we have a file like: + /// message Foo { + /// optional string foo = 1; + /// } + /// Let's look at just the field definition: + /// optional string foo = 1; + /// ^ ^^ ^^ ^ ^^^ + /// a bc de f ghi + /// We have the following locations: + /// span path represents + /// [a,i) [ 4, 0, 2, 0 ] The whole field definition. + /// [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + /// [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + /// [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + /// [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + /// + /// Notes: + /// - A location may refer to a repeated field itself (i.e. not to any + /// particular index within it). This is used whenever a set of elements are + /// logically enclosed in a single code segment. For example, an entire + /// extend block (possibly containing multiple extension definitions) will + /// have an outer location whose path refers to the "extensions" repeated + /// field without an index. + /// - Multiple locations may have the same path. This happens when a single + /// logical declaration is spread out across multiple places. The most + /// obvious example is the "extend" block again -- there may be multiple + /// extend blocks in the same scope, each of which will have the same path. + /// - A location's span is not always a subset of its parent's span. For + /// example, the "extendee" of an extension declaration appears at the + /// beginning of the "extend" block and is shared by all extensions within + /// the block. + /// - Just because a location's span is a subset of some other location's span + /// does not mean that it is a descendant. For example, a "group" defines + /// both a type and a field in a single declaration. Thus, the locations + /// corresponding to the type and field and their components will overlap. + /// - Code which tries to interpret locations should probably be designed to + /// ignore those that it doesn't understand, as more types of locations could + /// be recorded in the future. + var location: [Google_Protobuf_SourceCodeInfo.Location] = [] + + var unknownFields = UnknownStorage() + + struct Location { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Identifies which part of the FileDescriptorProto was defined at this + /// location. + /// + /// Each element is a field number or an index. They form a path from + /// the root FileDescriptorProto to the place where the definition occurs. + /// For example, this path: + /// [ 4, 3, 2, 7, 1 ] + /// refers to: + /// file.message_type(3) // 4, 3 + /// .field(7) // 2, 7 + /// .name() // 1 + /// This is because FileDescriptorProto.message_type has field number 4: + /// repeated DescriptorProto message_type = 4; + /// and DescriptorProto.field has field number 2: + /// repeated FieldDescriptorProto field = 2; + /// and FieldDescriptorProto.name has field number 1: + /// optional string name = 1; + /// + /// Thus, the above path gives the location of a field name. If we removed + /// the last element: + /// [ 4, 3, 2, 7 ] + /// this path refers to the whole field declaration (from the beginning + /// of the label to the terminating semicolon). + var path: [Int32] = [] + + /// Always has exactly three or four elements: start line, start column, + /// end line (optional, otherwise assumed same as start line), end column. + /// These are packed into a single field for efficiency. Note that line + /// and column numbers are zero-based -- typically you will want to add + /// 1 to each before displaying to a user. + var span: [Int32] = [] + + /// If this SourceCodeInfo represents a complete declaration, these are any + /// comments appearing before and after the declaration which appear to be + /// attached to the declaration. + /// + /// A series of line comments appearing on consecutive lines, with no other + /// tokens appearing on those lines, will be treated as a single comment. + /// + /// leading_detached_comments will keep paragraphs of comments that appear + /// before (but not connected to) the current element. Each paragraph, + /// separated by empty lines, will be one comment element in the repeated + /// field. + /// + /// Only the comment content is provided; comment markers (e.g. //) are + /// stripped out. For block comments, leading whitespace and an asterisk + /// will be stripped from the beginning of each line other than the first. + /// Newlines are included in the output. + /// + /// Examples: + /// + /// optional int32 foo = 1; // Comment attached to foo. + /// // Comment attached to bar. + /// optional int32 bar = 2; + /// + /// optional string baz = 3; + /// // Comment attached to baz. + /// // Another line attached to baz. + /// + /// // Comment attached to moo. + /// // + /// // Another line attached to moo. + /// optional double moo = 4; + /// + /// // Detached comment for corge. This is not leading or trailing comments + /// // to moo or corge because there are blank lines separating it from + /// // both. + /// + /// // Detached comment for corge paragraph 2. + /// + /// optional string corge = 5; + /// /* Block comment attached + /// * to corge. Leading asterisks + /// * will be removed. */ + /// /* Block comment attached to + /// * grault. */ + /// optional int32 grault = 6; + /// + /// // ignored detached comments. + var leadingComments: String { + get {return _leadingComments ?? String()} + set {_leadingComments = newValue} + } + /// Returns true if `leadingComments` has been explicitly set. + var hasLeadingComments: Bool {return self._leadingComments != nil} + /// Clears the value of `leadingComments`. Subsequent reads from it will return its default value. + mutating func clearLeadingComments() {self._leadingComments = nil} + + var trailingComments: String { + get {return _trailingComments ?? String()} + set {_trailingComments = newValue} + } + /// Returns true if `trailingComments` has been explicitly set. + var hasTrailingComments: Bool {return self._trailingComments != nil} + /// Clears the value of `trailingComments`. Subsequent reads from it will return its default value. + mutating func clearTrailingComments() {self._trailingComments = nil} + + var leadingDetachedComments: [String] = [] + + var unknownFields = UnknownStorage() + + init() {} + + fileprivate var _leadingComments: String? = nil + fileprivate var _trailingComments: String? = nil + } + + init() {} +} + +/// Describes the relationship between generated code and its original source +/// file. A GeneratedCodeInfo message is associated with only one generated +/// source file, but may contain references to different source .proto files. +struct Google_Protobuf_GeneratedCodeInfo { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// An Annotation connects some span of text in generated code to an element + /// of its generating .proto file. + var annotation: [Google_Protobuf_GeneratedCodeInfo.Annotation] = [] + + var unknownFields = UnknownStorage() + + struct Annotation { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Identifies the element in the original source .proto file. This field + /// is formatted the same as SourceCodeInfo.Location.path. + var path: [Int32] = [] + + /// Identifies the filesystem path to the original source .proto. + var sourceFile: String { + get {return _sourceFile ?? String()} + set {_sourceFile = newValue} + } + /// Returns true if `sourceFile` has been explicitly set. + var hasSourceFile: Bool {return self._sourceFile != nil} + /// Clears the value of `sourceFile`. Subsequent reads from it will return its default value. + mutating func clearSourceFile() {self._sourceFile = nil} + + /// Identifies the starting offset in bytes in the generated code + /// that relates to the identified object. + var begin: Int32 { + get {return _begin ?? 0} + set {_begin = newValue} + } + /// Returns true if `begin` has been explicitly set. + var hasBegin: Bool {return self._begin != nil} + /// Clears the value of `begin`. Subsequent reads from it will return its default value. + mutating func clearBegin() {self._begin = nil} + + /// Identifies the ending offset in bytes in the generated code that + /// relates to the identified object. The end offset should be one past + /// the last relevant byte (so the length of the text = end - begin). + var end: Int32 { + get {return _end ?? 0} + set {_end = newValue} + } + /// Returns true if `end` has been explicitly set. + var hasEnd: Bool {return self._end != nil} + /// Clears the value of `end`. Subsequent reads from it will return its default value. + mutating func clearEnd() {self._end = nil} + + var semantic: Google_Protobuf_GeneratedCodeInfo.Annotation.Semantic { + get {return _semantic ?? .none} + set {_semantic = newValue} + } + /// Returns true if `semantic` has been explicitly set. + var hasSemantic: Bool {return self._semantic != nil} + /// Clears the value of `semantic`. Subsequent reads from it will return its default value. + mutating func clearSemantic() {self._semantic = nil} + + var unknownFields = UnknownStorage() + + /// Represents the identified object's effect on the element in the original + /// .proto file. + enum Semantic: Enum { + typealias RawValue = Int + + /// There is no effect or the effect is indescribable. + case none // = 0 + + /// The element is set or otherwise mutated. + case set // = 1 + + /// An alias to the element is returned. + case alias // = 2 + + init() { + self = .none + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .none + case 1: self = .set + case 2: self = .alias + default: return nil + } + } + + var rawValue: Int { + switch self { + case .none: return 0 + case .set: return 1 + case .alias: return 2 + } + } + + } + + init() {} + + fileprivate var _sourceFile: String? = nil + fileprivate var _begin: Int32? = nil + fileprivate var _end: Int32? = nil + fileprivate var _semantic: Google_Protobuf_GeneratedCodeInfo.Annotation.Semantic? = nil + } + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Google_Protobuf_FileDescriptorSet: @unchecked Sendable {} +extension Google_Protobuf_FileDescriptorProto: @unchecked Sendable {} +extension Google_Protobuf_DescriptorProto: @unchecked Sendable {} +extension Google_Protobuf_DescriptorProto.ExtensionRange: @unchecked Sendable {} +extension Google_Protobuf_DescriptorProto.ReservedRange: @unchecked Sendable {} +extension Google_Protobuf_ExtensionRangeOptions: @unchecked Sendable {} +extension Google_Protobuf_ExtensionRangeOptions.Declaration: @unchecked Sendable {} +extension Google_Protobuf_FieldDescriptorProto: @unchecked Sendable {} +extension Google_Protobuf_OneofDescriptorProto: @unchecked Sendable {} +extension Google_Protobuf_EnumDescriptorProto: @unchecked Sendable {} +extension Google_Protobuf_EnumDescriptorProto.EnumReservedRange: @unchecked Sendable {} +extension Google_Protobuf_EnumValueDescriptorProto: @unchecked Sendable {} +extension Google_Protobuf_ServiceDescriptorProto: @unchecked Sendable {} +extension Google_Protobuf_MethodDescriptorProto: @unchecked Sendable {} +extension Google_Protobuf_FileOptions: @unchecked Sendable {} +extension Google_Protobuf_MessageOptions: @unchecked Sendable {} +extension Google_Protobuf_FieldOptions: @unchecked Sendable {} +extension Google_Protobuf_OneofOptions: @unchecked Sendable {} +extension Google_Protobuf_EnumOptions: @unchecked Sendable {} +extension Google_Protobuf_EnumValueOptions: @unchecked Sendable {} +extension Google_Protobuf_ServiceOptions: @unchecked Sendable {} +extension Google_Protobuf_MethodOptions: @unchecked Sendable {} +extension Google_Protobuf_UninterpretedOption: @unchecked Sendable {} +extension Google_Protobuf_UninterpretedOption.NamePart: @unchecked Sendable {} +extension Google_Protobuf_SourceCodeInfo: @unchecked Sendable {} +extension Google_Protobuf_SourceCodeInfo.Location: @unchecked Sendable {} +extension Google_Protobuf_GeneratedCodeInfo: @unchecked Sendable {} +extension Google_Protobuf_GeneratedCodeInfo.Annotation: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "google.protobuf" + +extension Google_Protobuf_FileDescriptorSet: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FileDescriptorSet" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "file"), + ] + + public var isInitialized: Bool { + if !Internal.areAllInitialized(self.file) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.file) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.file.isEmpty { + try visitor.visitRepeatedMessageField(value: self.file, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_FileDescriptorSet, rhs: Google_Protobuf_FileDescriptorSet) -> Bool { + if lhs.file != rhs.file {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_FileDescriptorProto: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FileDescriptorProto" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "package"), + 3: .same(proto: "dependency"), + 10: .standard(proto: "public_dependency"), + 11: .standard(proto: "weak_dependency"), + 4: .standard(proto: "message_type"), + 5: .standard(proto: "enum_type"), + 6: .same(proto: "service"), + 7: .same(proto: "extension"), + 8: .same(proto: "options"), + 9: .standard(proto: "source_code_info"), + 12: .same(proto: "syntax"), + 13: .same(proto: "edition"), + ] + + public var isInitialized: Bool { + if !Internal.areAllInitialized(self.messageType) {return false} + if !Internal.areAllInitialized(self.enumType) {return false} + if !Internal.areAllInitialized(self.service) {return false} + if !Internal.areAllInitialized(self.`extension`) {return false} + if let v = self._options, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._name) }() + case 2: try { try decoder.decodeSingularStringField(value: &self._package) }() + case 3: try { try decoder.decodeRepeatedStringField(value: &self.dependency) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.messageType) }() + case 5: try { try decoder.decodeRepeatedMessageField(value: &self.enumType) }() + case 6: try { try decoder.decodeRepeatedMessageField(value: &self.service) }() + case 7: try { try decoder.decodeRepeatedMessageField(value: &self.`extension`) }() + case 8: try { try decoder.decodeSingularMessageField(value: &self._options) }() + case 9: try { try decoder.decodeSingularMessageField(value: &self._sourceCodeInfo) }() + case 10: try { try decoder.decodeRepeatedInt32Field(value: &self.publicDependency) }() + case 11: try { try decoder.decodeRepeatedInt32Field(value: &self.weakDependency) }() + case 12: try { try decoder.decodeSingularStringField(value: &self._syntax) }() + case 13: try { try decoder.decodeSingularStringField(value: &self._edition) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._name { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._package { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + if !self.dependency.isEmpty { + try visitor.visitRepeatedStringField(value: self.dependency, fieldNumber: 3) + } + if !self.messageType.isEmpty { + try visitor.visitRepeatedMessageField(value: self.messageType, fieldNumber: 4) + } + if !self.enumType.isEmpty { + try visitor.visitRepeatedMessageField(value: self.enumType, fieldNumber: 5) + } + if !self.service.isEmpty { + try visitor.visitRepeatedMessageField(value: self.service, fieldNumber: 6) + } + if !self.`extension`.isEmpty { + try visitor.visitRepeatedMessageField(value: self.`extension`, fieldNumber: 7) + } + try { if let v = self._options { + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + } }() + try { if let v = self._sourceCodeInfo { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + if !self.publicDependency.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.publicDependency, fieldNumber: 10) + } + if !self.weakDependency.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.weakDependency, fieldNumber: 11) + } + try { if let v = self._syntax { + try visitor.visitSingularStringField(value: v, fieldNumber: 12) + } }() + try { if let v = self._edition { + try visitor.visitSingularStringField(value: v, fieldNumber: 13) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_FileDescriptorProto, rhs: Google_Protobuf_FileDescriptorProto) -> Bool { + if lhs._name != rhs._name {return false} + if lhs._package != rhs._package {return false} + if lhs.dependency != rhs.dependency {return false} + if lhs.publicDependency != rhs.publicDependency {return false} + if lhs.weakDependency != rhs.weakDependency {return false} + if lhs.messageType != rhs.messageType {return false} + if lhs.enumType != rhs.enumType {return false} + if lhs.service != rhs.service {return false} + if lhs.`extension` != rhs.`extension` {return false} + if lhs._options != rhs._options {return false} + if lhs._sourceCodeInfo != rhs._sourceCodeInfo {return false} + if lhs._syntax != rhs._syntax {return false} + if lhs._edition != rhs._edition {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_DescriptorProto: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".DescriptorProto" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "field"), + 6: .same(proto: "extension"), + 3: .standard(proto: "nested_type"), + 4: .standard(proto: "enum_type"), + 5: .standard(proto: "extension_range"), + 8: .standard(proto: "oneof_decl"), + 7: .same(proto: "options"), + 9: .standard(proto: "reserved_range"), + 10: .standard(proto: "reserved_name"), + ] + + public var isInitialized: Bool { + if !Internal.areAllInitialized(self.field) {return false} + if !Internal.areAllInitialized(self.`extension`) {return false} + if !Internal.areAllInitialized(self.nestedType) {return false} + if !Internal.areAllInitialized(self.enumType) {return false} + if !Internal.areAllInitialized(self.extensionRange) {return false} + if !Internal.areAllInitialized(self.oneofDecl) {return false} + if let v = self._options, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._name) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.field) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.nestedType) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.enumType) }() + case 5: try { try decoder.decodeRepeatedMessageField(value: &self.extensionRange) }() + case 6: try { try decoder.decodeRepeatedMessageField(value: &self.`extension`) }() + case 7: try { try decoder.decodeSingularMessageField(value: &self._options) }() + case 8: try { try decoder.decodeRepeatedMessageField(value: &self.oneofDecl) }() + case 9: try { try decoder.decodeRepeatedMessageField(value: &self.reservedRange) }() + case 10: try { try decoder.decodeRepeatedStringField(value: &self.reservedName) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._name { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + if !self.field.isEmpty { + try visitor.visitRepeatedMessageField(value: self.field, fieldNumber: 2) + } + if !self.nestedType.isEmpty { + try visitor.visitRepeatedMessageField(value: self.nestedType, fieldNumber: 3) + } + if !self.enumType.isEmpty { + try visitor.visitRepeatedMessageField(value: self.enumType, fieldNumber: 4) + } + if !self.extensionRange.isEmpty { + try visitor.visitRepeatedMessageField(value: self.extensionRange, fieldNumber: 5) + } + if !self.`extension`.isEmpty { + try visitor.visitRepeatedMessageField(value: self.`extension`, fieldNumber: 6) + } + try { if let v = self._options { + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + } }() + if !self.oneofDecl.isEmpty { + try visitor.visitRepeatedMessageField(value: self.oneofDecl, fieldNumber: 8) + } + if !self.reservedRange.isEmpty { + try visitor.visitRepeatedMessageField(value: self.reservedRange, fieldNumber: 9) + } + if !self.reservedName.isEmpty { + try visitor.visitRepeatedStringField(value: self.reservedName, fieldNumber: 10) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_DescriptorProto, rhs: Google_Protobuf_DescriptorProto) -> Bool { + if lhs._name != rhs._name {return false} + if lhs.field != rhs.field {return false} + if lhs.`extension` != rhs.`extension` {return false} + if lhs.nestedType != rhs.nestedType {return false} + if lhs.enumType != rhs.enumType {return false} + if lhs.extensionRange != rhs.extensionRange {return false} + if lhs.oneofDecl != rhs.oneofDecl {return false} + if lhs._options != rhs._options {return false} + if lhs.reservedRange != rhs.reservedRange {return false} + if lhs.reservedName != rhs.reservedName {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_DescriptorProto.ExtensionRange: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = Google_Protobuf_DescriptorProto.protoMessageName + ".ExtensionRange" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "start"), + 2: .same(proto: "end"), + 3: .same(proto: "options"), + ] + + public var isInitialized: Bool { + if let v = self._options, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._start) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._end) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._options) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._start { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._end { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._options { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_DescriptorProto.ExtensionRange, rhs: Google_Protobuf_DescriptorProto.ExtensionRange) -> Bool { + if lhs._start != rhs._start {return false} + if lhs._end != rhs._end {return false} + if lhs._options != rhs._options {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_DescriptorProto.ReservedRange: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = Google_Protobuf_DescriptorProto.protoMessageName + ".ReservedRange" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "start"), + 2: .same(proto: "end"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._start) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._end) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._start { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._end { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_DescriptorProto.ReservedRange, rhs: Google_Protobuf_DescriptorProto.ReservedRange) -> Bool { + if lhs._start != rhs._start {return false} + if lhs._end != rhs._end {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_ExtensionRangeOptions: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ExtensionRangeOptions" + static let _protobuf_nameMap: _NameMap = [ + 999: .standard(proto: "uninterpreted_option"), + 2: .same(proto: "declaration"), + 3: .same(proto: "verification"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + if !Internal.areAllInitialized(self.uninterpretedOption) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.declaration) }() + case 3: try { try decoder.decodeSingularEnumField(value: &self._verification) }() + case 999: try { try decoder.decodeRepeatedMessageField(value: &self.uninterpretedOption) }() + case 1000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: Google_Protobuf_ExtensionRangeOptions.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.declaration.isEmpty { + try visitor.visitRepeatedMessageField(value: self.declaration, fieldNumber: 2) + } + try { if let v = self._verification { + try visitor.visitSingularEnumField(value: v, fieldNumber: 3) + } }() + if !self.uninterpretedOption.isEmpty { + try visitor.visitRepeatedMessageField(value: self.uninterpretedOption, fieldNumber: 999) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_ExtensionRangeOptions, rhs: Google_Protobuf_ExtensionRangeOptions) -> Bool { + if lhs.uninterpretedOption != rhs.uninterpretedOption {return false} + if lhs.declaration != rhs.declaration {return false} + if lhs._verification != rhs._verification {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension Google_Protobuf_ExtensionRangeOptions.VerificationState: _ProtoNameProviding { + static let _protobuf_nameMap: _NameMap = [ + 0: .same(proto: "DECLARATION"), + 1: .same(proto: "UNVERIFIED"), + ] +} + +extension Google_Protobuf_ExtensionRangeOptions.Declaration: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = Google_Protobuf_ExtensionRangeOptions.protoMessageName + ".Declaration" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "number"), + 2: .standard(proto: "full_name"), + 3: .same(proto: "type"), + 4: .standard(proto: "is_repeated"), + 5: .same(proto: "reserved"), + 6: .same(proto: "repeated"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._number) }() + case 2: try { try decoder.decodeSingularStringField(value: &self._fullName) }() + case 3: try { try decoder.decodeSingularStringField(value: &self._type) }() + case 4: try { try decoder.decodeSingularBoolField(value: &self._isRepeated) }() + case 5: try { try decoder.decodeSingularBoolField(value: &self._reserved) }() + case 6: try { try decoder.decodeSingularBoolField(value: &self._repeated) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._number { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._fullName { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try { if let v = self._type { + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + } }() + try { if let v = self._isRepeated { + try visitor.visitSingularBoolField(value: v, fieldNumber: 4) + } }() + try { if let v = self._reserved { + try visitor.visitSingularBoolField(value: v, fieldNumber: 5) + } }() + try { if let v = self._repeated { + try visitor.visitSingularBoolField(value: v, fieldNumber: 6) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_ExtensionRangeOptions.Declaration, rhs: Google_Protobuf_ExtensionRangeOptions.Declaration) -> Bool { + if lhs._number != rhs._number {return false} + if lhs._fullName != rhs._fullName {return false} + if lhs._type != rhs._type {return false} + if lhs._isRepeated != rhs._isRepeated {return false} + if lhs._reserved != rhs._reserved {return false} + if lhs._repeated != rhs._repeated {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_FieldDescriptorProto: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FieldDescriptorProto" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "name"), + 3: .same(proto: "number"), + 4: .same(proto: "label"), + 5: .same(proto: "type"), + 6: .standard(proto: "type_name"), + 2: .same(proto: "extendee"), + 7: .standard(proto: "default_value"), + 9: .standard(proto: "oneof_index"), + 10: .standard(proto: "json_name"), + 8: .same(proto: "options"), + 17: .standard(proto: "proto3_optional"), + ] + + fileprivate class _StorageClass { + var _name: String? = nil + var _number: Int32? = nil + var _label: Google_Protobuf_FieldDescriptorProto.Label? = nil + var _type: Google_Protobuf_FieldDescriptorProto.TypeEnum? = nil + var _typeName: String? = nil + var _extendee: String? = nil + var _defaultValue: String? = nil + var _oneofIndex: Int32? = nil + var _jsonName: String? = nil + var _options: Google_Protobuf_FieldOptions? = nil + var _proto3Optional: Bool? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _name = source._name + _number = source._number + _label = source._label + _type = source._type + _typeName = source._typeName + _extendee = source._extendee + _defaultValue = source._defaultValue + _oneofIndex = source._oneofIndex + _jsonName = source._jsonName + _options = source._options + _proto3Optional = source._proto3Optional + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + public var isInitialized: Bool { + return withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if let v = _storage._options, !v.isInitialized {return false} + return true + } + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &_storage._name) }() + case 2: try { try decoder.decodeSingularStringField(value: &_storage._extendee) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &_storage._number) }() + case 4: try { try decoder.decodeSingularEnumField(value: &_storage._label) }() + case 5: try { try decoder.decodeSingularEnumField(value: &_storage._type) }() + case 6: try { try decoder.decodeSingularStringField(value: &_storage._typeName) }() + case 7: try { try decoder.decodeSingularStringField(value: &_storage._defaultValue) }() + case 8: try { try decoder.decodeSingularMessageField(value: &_storage._options) }() + case 9: try { try decoder.decodeSingularInt32Field(value: &_storage._oneofIndex) }() + case 10: try { try decoder.decodeSingularStringField(value: &_storage._jsonName) }() + case 17: try { try decoder.decodeSingularBoolField(value: &_storage._proto3Optional) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._name { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._extendee { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._number { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._label { + try visitor.visitSingularEnumField(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._type { + try visitor.visitSingularEnumField(value: v, fieldNumber: 5) + } }() + try { if let v = _storage._typeName { + try visitor.visitSingularStringField(value: v, fieldNumber: 6) + } }() + try { if let v = _storage._defaultValue { + try visitor.visitSingularStringField(value: v, fieldNumber: 7) + } }() + try { if let v = _storage._options { + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + } }() + try { if let v = _storage._oneofIndex { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._jsonName { + try visitor.visitSingularStringField(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._proto3Optional { + try visitor.visitSingularBoolField(value: v, fieldNumber: 17) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_FieldDescriptorProto, rhs: Google_Protobuf_FieldDescriptorProto) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._name != rhs_storage._name {return false} + if _storage._number != rhs_storage._number {return false} + if _storage._label != rhs_storage._label {return false} + if _storage._type != rhs_storage._type {return false} + if _storage._typeName != rhs_storage._typeName {return false} + if _storage._extendee != rhs_storage._extendee {return false} + if _storage._defaultValue != rhs_storage._defaultValue {return false} + if _storage._oneofIndex != rhs_storage._oneofIndex {return false} + if _storage._jsonName != rhs_storage._jsonName {return false} + if _storage._options != rhs_storage._options {return false} + if _storage._proto3Optional != rhs_storage._proto3Optional {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_FieldDescriptorProto.TypeEnum: _ProtoNameProviding { + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "TYPE_DOUBLE"), + 2: .same(proto: "TYPE_FLOAT"), + 3: .same(proto: "TYPE_INT64"), + 4: .same(proto: "TYPE_UINT64"), + 5: .same(proto: "TYPE_INT32"), + 6: .same(proto: "TYPE_FIXED64"), + 7: .same(proto: "TYPE_FIXED32"), + 8: .same(proto: "TYPE_BOOL"), + 9: .same(proto: "TYPE_STRING"), + 10: .same(proto: "TYPE_GROUP"), + 11: .same(proto: "TYPE_MESSAGE"), + 12: .same(proto: "TYPE_BYTES"), + 13: .same(proto: "TYPE_UINT32"), + 14: .same(proto: "TYPE_ENUM"), + 15: .same(proto: "TYPE_SFIXED32"), + 16: .same(proto: "TYPE_SFIXED64"), + 17: .same(proto: "TYPE_SINT32"), + 18: .same(proto: "TYPE_SINT64"), + ] +} + +extension Google_Protobuf_FieldDescriptorProto.Label: _ProtoNameProviding { + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "LABEL_OPTIONAL"), + 2: .same(proto: "LABEL_REQUIRED"), + 3: .same(proto: "LABEL_REPEATED"), + ] +} + +extension Google_Protobuf_OneofDescriptorProto: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".OneofDescriptorProto" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "options"), + ] + + public var isInitialized: Bool { + if let v = self._options, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._name) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._options) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._name { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._options { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_OneofDescriptorProto, rhs: Google_Protobuf_OneofDescriptorProto) -> Bool { + if lhs._name != rhs._name {return false} + if lhs._options != rhs._options {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_EnumDescriptorProto: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".EnumDescriptorProto" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "value"), + 3: .same(proto: "options"), + 4: .standard(proto: "reserved_range"), + 5: .standard(proto: "reserved_name"), + ] + + public var isInitialized: Bool { + if !Internal.areAllInitialized(self.value) {return false} + if let v = self._options, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._name) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.value) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._options) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.reservedRange) }() + case 5: try { try decoder.decodeRepeatedStringField(value: &self.reservedName) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._name { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + if !self.value.isEmpty { + try visitor.visitRepeatedMessageField(value: self.value, fieldNumber: 2) + } + try { if let v = self._options { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + if !self.reservedRange.isEmpty { + try visitor.visitRepeatedMessageField(value: self.reservedRange, fieldNumber: 4) + } + if !self.reservedName.isEmpty { + try visitor.visitRepeatedStringField(value: self.reservedName, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_EnumDescriptorProto, rhs: Google_Protobuf_EnumDescriptorProto) -> Bool { + if lhs._name != rhs._name {return false} + if lhs.value != rhs.value {return false} + if lhs._options != rhs._options {return false} + if lhs.reservedRange != rhs.reservedRange {return false} + if lhs.reservedName != rhs.reservedName {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_EnumDescriptorProto.EnumReservedRange: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = Google_Protobuf_EnumDescriptorProto.protoMessageName + ".EnumReservedRange" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "start"), + 2: .same(proto: "end"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._start) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._end) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._start { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._end { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_EnumDescriptorProto.EnumReservedRange, rhs: Google_Protobuf_EnumDescriptorProto.EnumReservedRange) -> Bool { + if lhs._start != rhs._start {return false} + if lhs._end != rhs._end {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_EnumValueDescriptorProto: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".EnumValueDescriptorProto" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "number"), + 3: .same(proto: "options"), + ] + + public var isInitialized: Bool { + if let v = self._options, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._name) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self._number) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._options) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._name { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._number { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._options { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_EnumValueDescriptorProto, rhs: Google_Protobuf_EnumValueDescriptorProto) -> Bool { + if lhs._name != rhs._name {return false} + if lhs._number != rhs._number {return false} + if lhs._options != rhs._options {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_ServiceDescriptorProto: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ServiceDescriptorProto" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "method"), + 3: .same(proto: "options"), + ] + + public var isInitialized: Bool { + if !Internal.areAllInitialized(self.method) {return false} + if let v = self._options, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._name) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.method) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._options) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._name { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + if !self.method.isEmpty { + try visitor.visitRepeatedMessageField(value: self.method, fieldNumber: 2) + } + try { if let v = self._options { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_ServiceDescriptorProto, rhs: Google_Protobuf_ServiceDescriptorProto) -> Bool { + if lhs._name != rhs._name {return false} + if lhs.method != rhs.method {return false} + if lhs._options != rhs._options {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_MethodDescriptorProto: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MethodDescriptorProto" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "name"), + 2: .standard(proto: "input_type"), + 3: .standard(proto: "output_type"), + 4: .same(proto: "options"), + 5: .standard(proto: "client_streaming"), + 6: .standard(proto: "server_streaming"), + ] + + public var isInitialized: Bool { + if let v = self._options, !v.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._name) }() + case 2: try { try decoder.decodeSingularStringField(value: &self._inputType) }() + case 3: try { try decoder.decodeSingularStringField(value: &self._outputType) }() + case 4: try { try decoder.decodeSingularMessageField(value: &self._options) }() + case 5: try { try decoder.decodeSingularBoolField(value: &self._clientStreaming) }() + case 6: try { try decoder.decodeSingularBoolField(value: &self._serverStreaming) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._name { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._inputType { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try { if let v = self._outputType { + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + } }() + try { if let v = self._options { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + try { if let v = self._clientStreaming { + try visitor.visitSingularBoolField(value: v, fieldNumber: 5) + } }() + try { if let v = self._serverStreaming { + try visitor.visitSingularBoolField(value: v, fieldNumber: 6) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_MethodDescriptorProto, rhs: Google_Protobuf_MethodDescriptorProto) -> Bool { + if lhs._name != rhs._name {return false} + if lhs._inputType != rhs._inputType {return false} + if lhs._outputType != rhs._outputType {return false} + if lhs._options != rhs._options {return false} + if lhs._clientStreaming != rhs._clientStreaming {return false} + if lhs._serverStreaming != rhs._serverStreaming {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_FileOptions: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FileOptions" + static let _protobuf_nameMap: _NameMap = [ + 1: .standard(proto: "java_package"), + 8: .standard(proto: "java_outer_classname"), + 10: .standard(proto: "java_multiple_files"), + 20: .standard(proto: "java_generate_equals_and_hash"), + 27: .standard(proto: "java_string_check_utf8"), + 9: .standard(proto: "optimize_for"), + 11: .standard(proto: "go_package"), + 16: .standard(proto: "cc_generic_services"), + 17: .standard(proto: "java_generic_services"), + 18: .standard(proto: "py_generic_services"), + 42: .standard(proto: "php_generic_services"), + 23: .same(proto: "deprecated"), + 31: .standard(proto: "cc_enable_arenas"), + 36: .standard(proto: "objc_class_prefix"), + 37: .standard(proto: "csharp_namespace"), + 39: .standard(proto: "swift_prefix"), + 40: .standard(proto: "php_class_prefix"), + 41: .standard(proto: "php_namespace"), + 44: .standard(proto: "php_metadata_namespace"), + 45: .standard(proto: "ruby_package"), + 999: .standard(proto: "uninterpreted_option"), + ] + + fileprivate class _StorageClass { + var _javaPackage: String? = nil + var _javaOuterClassname: String? = nil + var _javaMultipleFiles: Bool? = nil + var _javaGenerateEqualsAndHash: Bool? = nil + var _javaStringCheckUtf8: Bool? = nil + var _optimizeFor: Google_Protobuf_FileOptions.OptimizeMode? = nil + var _goPackage: String? = nil + var _ccGenericServices: Bool? = nil + var _javaGenericServices: Bool? = nil + var _pyGenericServices: Bool? = nil + var _phpGenericServices: Bool? = nil + var _deprecated: Bool? = nil + var _ccEnableArenas: Bool? = nil + var _objcClassPrefix: String? = nil + var _csharpNamespace: String? = nil + var _swiftPrefix: String? = nil + var _phpClassPrefix: String? = nil + var _phpNamespace: String? = nil + var _phpMetadataNamespace: String? = nil + var _rubyPackage: String? = nil + var _uninterpretedOption: [Google_Protobuf_UninterpretedOption] = [] + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _javaPackage = source._javaPackage + _javaOuterClassname = source._javaOuterClassname + _javaMultipleFiles = source._javaMultipleFiles + _javaGenerateEqualsAndHash = source._javaGenerateEqualsAndHash + _javaStringCheckUtf8 = source._javaStringCheckUtf8 + _optimizeFor = source._optimizeFor + _goPackage = source._goPackage + _ccGenericServices = source._ccGenericServices + _javaGenericServices = source._javaGenericServices + _pyGenericServices = source._pyGenericServices + _phpGenericServices = source._phpGenericServices + _deprecated = source._deprecated + _ccEnableArenas = source._ccEnableArenas + _objcClassPrefix = source._objcClassPrefix + _csharpNamespace = source._csharpNamespace + _swiftPrefix = source._swiftPrefix + _phpClassPrefix = source._phpClassPrefix + _phpNamespace = source._phpNamespace + _phpMetadataNamespace = source._phpMetadataNamespace + _rubyPackage = source._rubyPackage + _uninterpretedOption = source._uninterpretedOption + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !Internal.areAllInitialized(_storage._uninterpretedOption) {return false} + return true + } + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &_storage._javaPackage) }() + case 8: try { try decoder.decodeSingularStringField(value: &_storage._javaOuterClassname) }() + case 9: try { try decoder.decodeSingularEnumField(value: &_storage._optimizeFor) }() + case 10: try { try decoder.decodeSingularBoolField(value: &_storage._javaMultipleFiles) }() + case 11: try { try decoder.decodeSingularStringField(value: &_storage._goPackage) }() + case 16: try { try decoder.decodeSingularBoolField(value: &_storage._ccGenericServices) }() + case 17: try { try decoder.decodeSingularBoolField(value: &_storage._javaGenericServices) }() + case 18: try { try decoder.decodeSingularBoolField(value: &_storage._pyGenericServices) }() + case 20: try { try decoder.decodeSingularBoolField(value: &_storage._javaGenerateEqualsAndHash) }() + case 23: try { try decoder.decodeSingularBoolField(value: &_storage._deprecated) }() + case 27: try { try decoder.decodeSingularBoolField(value: &_storage._javaStringCheckUtf8) }() + case 31: try { try decoder.decodeSingularBoolField(value: &_storage._ccEnableArenas) }() + case 36: try { try decoder.decodeSingularStringField(value: &_storage._objcClassPrefix) }() + case 37: try { try decoder.decodeSingularStringField(value: &_storage._csharpNamespace) }() + case 39: try { try decoder.decodeSingularStringField(value: &_storage._swiftPrefix) }() + case 40: try { try decoder.decodeSingularStringField(value: &_storage._phpClassPrefix) }() + case 41: try { try decoder.decodeSingularStringField(value: &_storage._phpNamespace) }() + case 42: try { try decoder.decodeSingularBoolField(value: &_storage._phpGenericServices) }() + case 44: try { try decoder.decodeSingularStringField(value: &_storage._phpMetadataNamespace) }() + case 45: try { try decoder.decodeSingularStringField(value: &_storage._rubyPackage) }() + case 999: try { try decoder.decodeRepeatedMessageField(value: &_storage._uninterpretedOption) }() + case 1000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: Google_Protobuf_FileOptions.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._javaPackage { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._javaOuterClassname { + try visitor.visitSingularStringField(value: v, fieldNumber: 8) + } }() + try { if let v = _storage._optimizeFor { + try visitor.visitSingularEnumField(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._javaMultipleFiles { + try visitor.visitSingularBoolField(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._goPackage { + try visitor.visitSingularStringField(value: v, fieldNumber: 11) + } }() + try { if let v = _storage._ccGenericServices { + try visitor.visitSingularBoolField(value: v, fieldNumber: 16) + } }() + try { if let v = _storage._javaGenericServices { + try visitor.visitSingularBoolField(value: v, fieldNumber: 17) + } }() + try { if let v = _storage._pyGenericServices { + try visitor.visitSingularBoolField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._javaGenerateEqualsAndHash { + try visitor.visitSingularBoolField(value: v, fieldNumber: 20) + } }() + try { if let v = _storage._deprecated { + try visitor.visitSingularBoolField(value: v, fieldNumber: 23) + } }() + try { if let v = _storage._javaStringCheckUtf8 { + try visitor.visitSingularBoolField(value: v, fieldNumber: 27) + } }() + try { if let v = _storage._ccEnableArenas { + try visitor.visitSingularBoolField(value: v, fieldNumber: 31) + } }() + try { if let v = _storage._objcClassPrefix { + try visitor.visitSingularStringField(value: v, fieldNumber: 36) + } }() + try { if let v = _storage._csharpNamespace { + try visitor.visitSingularStringField(value: v, fieldNumber: 37) + } }() + try { if let v = _storage._swiftPrefix { + try visitor.visitSingularStringField(value: v, fieldNumber: 39) + } }() + try { if let v = _storage._phpClassPrefix { + try visitor.visitSingularStringField(value: v, fieldNumber: 40) + } }() + try { if let v = _storage._phpNamespace { + try visitor.visitSingularStringField(value: v, fieldNumber: 41) + } }() + try { if let v = _storage._phpGenericServices { + try visitor.visitSingularBoolField(value: v, fieldNumber: 42) + } }() + try { if let v = _storage._phpMetadataNamespace { + try visitor.visitSingularStringField(value: v, fieldNumber: 44) + } }() + try { if let v = _storage._rubyPackage { + try visitor.visitSingularStringField(value: v, fieldNumber: 45) + } }() + if !_storage._uninterpretedOption.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._uninterpretedOption, fieldNumber: 999) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_FileOptions, rhs: Google_Protobuf_FileOptions) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._javaPackage != rhs_storage._javaPackage {return false} + if _storage._javaOuterClassname != rhs_storage._javaOuterClassname {return false} + if _storage._javaMultipleFiles != rhs_storage._javaMultipleFiles {return false} + if _storage._javaGenerateEqualsAndHash != rhs_storage._javaGenerateEqualsAndHash {return false} + if _storage._javaStringCheckUtf8 != rhs_storage._javaStringCheckUtf8 {return false} + if _storage._optimizeFor != rhs_storage._optimizeFor {return false} + if _storage._goPackage != rhs_storage._goPackage {return false} + if _storage._ccGenericServices != rhs_storage._ccGenericServices {return false} + if _storage._javaGenericServices != rhs_storage._javaGenericServices {return false} + if _storage._pyGenericServices != rhs_storage._pyGenericServices {return false} + if _storage._phpGenericServices != rhs_storage._phpGenericServices {return false} + if _storage._deprecated != rhs_storage._deprecated {return false} + if _storage._ccEnableArenas != rhs_storage._ccEnableArenas {return false} + if _storage._objcClassPrefix != rhs_storage._objcClassPrefix {return false} + if _storage._csharpNamespace != rhs_storage._csharpNamespace {return false} + if _storage._swiftPrefix != rhs_storage._swiftPrefix {return false} + if _storage._phpClassPrefix != rhs_storage._phpClassPrefix {return false} + if _storage._phpNamespace != rhs_storage._phpNamespace {return false} + if _storage._phpMetadataNamespace != rhs_storage._phpMetadataNamespace {return false} + if _storage._rubyPackage != rhs_storage._rubyPackage {return false} + if _storage._uninterpretedOption != rhs_storage._uninterpretedOption {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension Google_Protobuf_FileOptions.OptimizeMode: _ProtoNameProviding { + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "SPEED"), + 2: .same(proto: "CODE_SIZE"), + 3: .same(proto: "LITE_RUNTIME"), + ] +} + +extension Google_Protobuf_MessageOptions: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MessageOptions" + static let _protobuf_nameMap: _NameMap = [ + 1: .standard(proto: "message_set_wire_format"), + 2: .standard(proto: "no_standard_descriptor_accessor"), + 3: .same(proto: "deprecated"), + 7: .standard(proto: "map_entry"), + 11: .standard(proto: "deprecated_legacy_json_field_conflicts"), + 999: .standard(proto: "uninterpreted_option"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + if !Internal.areAllInitialized(self.uninterpretedOption) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self._messageSetWireFormat) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self._noStandardDescriptorAccessor) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self._deprecated) }() + case 7: try { try decoder.decodeSingularBoolField(value: &self._mapEntry) }() + case 11: try { try decoder.decodeSingularBoolField(value: &self._deprecatedLegacyJsonFieldConflicts) }() + case 999: try { try decoder.decodeRepeatedMessageField(value: &self.uninterpretedOption) }() + case 1000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: Google_Protobuf_MessageOptions.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._messageSetWireFormat { + try visitor.visitSingularBoolField(value: v, fieldNumber: 1) + } }() + try { if let v = self._noStandardDescriptorAccessor { + try visitor.visitSingularBoolField(value: v, fieldNumber: 2) + } }() + try { if let v = self._deprecated { + try visitor.visitSingularBoolField(value: v, fieldNumber: 3) + } }() + try { if let v = self._mapEntry { + try visitor.visitSingularBoolField(value: v, fieldNumber: 7) + } }() + try { if let v = self._deprecatedLegacyJsonFieldConflicts { + try visitor.visitSingularBoolField(value: v, fieldNumber: 11) + } }() + if !self.uninterpretedOption.isEmpty { + try visitor.visitRepeatedMessageField(value: self.uninterpretedOption, fieldNumber: 999) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_MessageOptions, rhs: Google_Protobuf_MessageOptions) -> Bool { + if lhs._messageSetWireFormat != rhs._messageSetWireFormat {return false} + if lhs._noStandardDescriptorAccessor != rhs._noStandardDescriptorAccessor {return false} + if lhs._deprecated != rhs._deprecated {return false} + if lhs._mapEntry != rhs._mapEntry {return false} + if lhs._deprecatedLegacyJsonFieldConflicts != rhs._deprecatedLegacyJsonFieldConflicts {return false} + if lhs.uninterpretedOption != rhs.uninterpretedOption {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension Google_Protobuf_FieldOptions: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FieldOptions" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "ctype"), + 2: .same(proto: "packed"), + 6: .same(proto: "jstype"), + 5: .same(proto: "lazy"), + 15: .standard(proto: "unverified_lazy"), + 3: .same(proto: "deprecated"), + 10: .same(proto: "weak"), + 16: .standard(proto: "debug_redact"), + 17: .same(proto: "retention"), + 19: .same(proto: "targets"), + 999: .standard(proto: "uninterpreted_option"), + 18: .standard(proto: "target_obsolete_do_not_use"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + if !Internal.areAllInitialized(self.uninterpretedOption) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self._ctype) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self._packed) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self._deprecated) }() + case 5: try { try decoder.decodeSingularBoolField(value: &self._lazy) }() + case 6: try { try decoder.decodeSingularEnumField(value: &self._jstype) }() + case 10: try { try decoder.decodeSingularBoolField(value: &self._weak) }() + case 15: try { try decoder.decodeSingularBoolField(value: &self._unverifiedLazy) }() + case 16: try { try decoder.decodeSingularBoolField(value: &self._debugRedact) }() + case 17: try { try decoder.decodeSingularEnumField(value: &self._retention) }() + case 18: try { try decoder.decodeSingularEnumField(value: &self._targetObsoleteDoNotUse) }() + case 19: try { try decoder.decodeRepeatedEnumField(value: &self.targets) }() + case 999: try { try decoder.decodeRepeatedMessageField(value: &self.uninterpretedOption) }() + case 1000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: Google_Protobuf_FieldOptions.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._ctype { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1) + } }() + try { if let v = self._packed { + try visitor.visitSingularBoolField(value: v, fieldNumber: 2) + } }() + try { if let v = self._deprecated { + try visitor.visitSingularBoolField(value: v, fieldNumber: 3) + } }() + try { if let v = self._lazy { + try visitor.visitSingularBoolField(value: v, fieldNumber: 5) + } }() + try { if let v = self._jstype { + try visitor.visitSingularEnumField(value: v, fieldNumber: 6) + } }() + try { if let v = self._weak { + try visitor.visitSingularBoolField(value: v, fieldNumber: 10) + } }() + try { if let v = self._unverifiedLazy { + try visitor.visitSingularBoolField(value: v, fieldNumber: 15) + } }() + try { if let v = self._debugRedact { + try visitor.visitSingularBoolField(value: v, fieldNumber: 16) + } }() + try { if let v = self._retention { + try visitor.visitSingularEnumField(value: v, fieldNumber: 17) + } }() + try { if let v = self._targetObsoleteDoNotUse { + try visitor.visitSingularEnumField(value: v, fieldNumber: 18) + } }() + if !self.targets.isEmpty { + try visitor.visitRepeatedEnumField(value: self.targets, fieldNumber: 19) + } + if !self.uninterpretedOption.isEmpty { + try visitor.visitRepeatedMessageField(value: self.uninterpretedOption, fieldNumber: 999) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_FieldOptions, rhs: Google_Protobuf_FieldOptions) -> Bool { + if lhs._ctype != rhs._ctype {return false} + if lhs._packed != rhs._packed {return false} + if lhs._jstype != rhs._jstype {return false} + if lhs._lazy != rhs._lazy {return false} + if lhs._unverifiedLazy != rhs._unverifiedLazy {return false} + if lhs._deprecated != rhs._deprecated {return false} + if lhs._weak != rhs._weak {return false} + if lhs._debugRedact != rhs._debugRedact {return false} + if lhs._retention != rhs._retention {return false} + if lhs.targets != rhs.targets {return false} + if lhs.uninterpretedOption != rhs.uninterpretedOption {return false} + if lhs._targetObsoleteDoNotUse != rhs._targetObsoleteDoNotUse {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension Google_Protobuf_FieldOptions.CType: _ProtoNameProviding { + static let _protobuf_nameMap: _NameMap = [ + 0: .same(proto: "STRING"), + 1: .same(proto: "CORD"), + 2: .same(proto: "STRING_PIECE"), + ] +} + +extension Google_Protobuf_FieldOptions.JSType: _ProtoNameProviding { + static let _protobuf_nameMap: _NameMap = [ + 0: .same(proto: "JS_NORMAL"), + 1: .same(proto: "JS_STRING"), + 2: .same(proto: "JS_NUMBER"), + ] +} + +extension Google_Protobuf_FieldOptions.OptionRetention: _ProtoNameProviding { + static let _protobuf_nameMap: _NameMap = [ + 0: .same(proto: "RETENTION_UNKNOWN"), + 1: .same(proto: "RETENTION_RUNTIME"), + 2: .same(proto: "RETENTION_SOURCE"), + ] +} + +extension Google_Protobuf_FieldOptions.OptionTargetType: _ProtoNameProviding { + static let _protobuf_nameMap: _NameMap = [ + 0: .same(proto: "TARGET_TYPE_UNKNOWN"), + 1: .same(proto: "TARGET_TYPE_FILE"), + 2: .same(proto: "TARGET_TYPE_EXTENSION_RANGE"), + 3: .same(proto: "TARGET_TYPE_MESSAGE"), + 4: .same(proto: "TARGET_TYPE_FIELD"), + 5: .same(proto: "TARGET_TYPE_ONEOF"), + 6: .same(proto: "TARGET_TYPE_ENUM"), + 7: .same(proto: "TARGET_TYPE_ENUM_ENTRY"), + 8: .same(proto: "TARGET_TYPE_SERVICE"), + 9: .same(proto: "TARGET_TYPE_METHOD"), + ] +} + +extension Google_Protobuf_OneofOptions: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".OneofOptions" + static let _protobuf_nameMap: _NameMap = [ + 999: .standard(proto: "uninterpreted_option"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + if !Internal.areAllInitialized(self.uninterpretedOption) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 999: try { try decoder.decodeRepeatedMessageField(value: &self.uninterpretedOption) }() + case 1000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: Google_Protobuf_OneofOptions.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.uninterpretedOption.isEmpty { + try visitor.visitRepeatedMessageField(value: self.uninterpretedOption, fieldNumber: 999) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_OneofOptions, rhs: Google_Protobuf_OneofOptions) -> Bool { + if lhs.uninterpretedOption != rhs.uninterpretedOption {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension Google_Protobuf_EnumOptions: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".EnumOptions" + static let _protobuf_nameMap: _NameMap = [ + 2: .standard(proto: "allow_alias"), + 3: .same(proto: "deprecated"), + 6: .standard(proto: "deprecated_legacy_json_field_conflicts"), + 999: .standard(proto: "uninterpreted_option"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + if !Internal.areAllInitialized(self.uninterpretedOption) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 2: try { try decoder.decodeSingularBoolField(value: &self._allowAlias) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self._deprecated) }() + case 6: try { try decoder.decodeSingularBoolField(value: &self._deprecatedLegacyJsonFieldConflicts) }() + case 999: try { try decoder.decodeRepeatedMessageField(value: &self.uninterpretedOption) }() + case 1000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: Google_Protobuf_EnumOptions.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._allowAlias { + try visitor.visitSingularBoolField(value: v, fieldNumber: 2) + } }() + try { if let v = self._deprecated { + try visitor.visitSingularBoolField(value: v, fieldNumber: 3) + } }() + try { if let v = self._deprecatedLegacyJsonFieldConflicts { + try visitor.visitSingularBoolField(value: v, fieldNumber: 6) + } }() + if !self.uninterpretedOption.isEmpty { + try visitor.visitRepeatedMessageField(value: self.uninterpretedOption, fieldNumber: 999) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_EnumOptions, rhs: Google_Protobuf_EnumOptions) -> Bool { + if lhs._allowAlias != rhs._allowAlias {return false} + if lhs._deprecated != rhs._deprecated {return false} + if lhs._deprecatedLegacyJsonFieldConflicts != rhs._deprecatedLegacyJsonFieldConflicts {return false} + if lhs.uninterpretedOption != rhs.uninterpretedOption {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension Google_Protobuf_EnumValueOptions: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".EnumValueOptions" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "deprecated"), + 3: .standard(proto: "debug_redact"), + 999: .standard(proto: "uninterpreted_option"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + if !Internal.areAllInitialized(self.uninterpretedOption) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self._deprecated) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self._debugRedact) }() + case 999: try { try decoder.decodeRepeatedMessageField(value: &self.uninterpretedOption) }() + case 1000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: Google_Protobuf_EnumValueOptions.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._deprecated { + try visitor.visitSingularBoolField(value: v, fieldNumber: 1) + } }() + try { if let v = self._debugRedact { + try visitor.visitSingularBoolField(value: v, fieldNumber: 3) + } }() + if !self.uninterpretedOption.isEmpty { + try visitor.visitRepeatedMessageField(value: self.uninterpretedOption, fieldNumber: 999) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_EnumValueOptions, rhs: Google_Protobuf_EnumValueOptions) -> Bool { + if lhs._deprecated != rhs._deprecated {return false} + if lhs._debugRedact != rhs._debugRedact {return false} + if lhs.uninterpretedOption != rhs.uninterpretedOption {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension Google_Protobuf_ServiceOptions: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ServiceOptions" + static let _protobuf_nameMap: _NameMap = [ + 33: .same(proto: "deprecated"), + 999: .standard(proto: "uninterpreted_option"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + if !Internal.areAllInitialized(self.uninterpretedOption) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 33: try { try decoder.decodeSingularBoolField(value: &self._deprecated) }() + case 999: try { try decoder.decodeRepeatedMessageField(value: &self.uninterpretedOption) }() + case 1000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: Google_Protobuf_ServiceOptions.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._deprecated { + try visitor.visitSingularBoolField(value: v, fieldNumber: 33) + } }() + if !self.uninterpretedOption.isEmpty { + try visitor.visitRepeatedMessageField(value: self.uninterpretedOption, fieldNumber: 999) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_ServiceOptions, rhs: Google_Protobuf_ServiceOptions) -> Bool { + if lhs._deprecated != rhs._deprecated {return false} + if lhs.uninterpretedOption != rhs.uninterpretedOption {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension Google_Protobuf_MethodOptions: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MethodOptions" + static let _protobuf_nameMap: _NameMap = [ + 33: .same(proto: "deprecated"), + 34: .standard(proto: "idempotency_level"), + 999: .standard(proto: "uninterpreted_option"), + ] + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + if !Internal.areAllInitialized(self.uninterpretedOption) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 33: try { try decoder.decodeSingularBoolField(value: &self._deprecated) }() + case 34: try { try decoder.decodeSingularEnumField(value: &self._idempotencyLevel) }() + case 999: try { try decoder.decodeRepeatedMessageField(value: &self.uninterpretedOption) }() + case 1000..<536870912: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: Google_Protobuf_MethodOptions.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._deprecated { + try visitor.visitSingularBoolField(value: v, fieldNumber: 33) + } }() + try { if let v = self._idempotencyLevel { + try visitor.visitSingularEnumField(value: v, fieldNumber: 34) + } }() + if !self.uninterpretedOption.isEmpty { + try visitor.visitRepeatedMessageField(value: self.uninterpretedOption, fieldNumber: 999) + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_MethodOptions, rhs: Google_Protobuf_MethodOptions) -> Bool { + if lhs._deprecated != rhs._deprecated {return false} + if lhs._idempotencyLevel != rhs._idempotencyLevel {return false} + if lhs.uninterpretedOption != rhs.uninterpretedOption {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension Google_Protobuf_MethodOptions.IdempotencyLevel: _ProtoNameProviding { + static let _protobuf_nameMap: _NameMap = [ + 0: .same(proto: "IDEMPOTENCY_UNKNOWN"), + 1: .same(proto: "NO_SIDE_EFFECTS"), + 2: .same(proto: "IDEMPOTENT"), + ] +} + +extension Google_Protobuf_UninterpretedOption: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".UninterpretedOption" + static let _protobuf_nameMap: _NameMap = [ + 2: .same(proto: "name"), + 3: .standard(proto: "identifier_value"), + 4: .standard(proto: "positive_int_value"), + 5: .standard(proto: "negative_int_value"), + 6: .standard(proto: "double_value"), + 7: .standard(proto: "string_value"), + 8: .standard(proto: "aggregate_value"), + ] + + public var isInitialized: Bool { + if !Internal.areAllInitialized(self.name) {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.name) }() + case 3: try { try decoder.decodeSingularStringField(value: &self._identifierValue) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &self._positiveIntValue) }() + case 5: try { try decoder.decodeSingularInt64Field(value: &self._negativeIntValue) }() + case 6: try { try decoder.decodeSingularDoubleField(value: &self._doubleValue) }() + case 7: try { try decoder.decodeSingularBytesField(value: &self._stringValue) }() + case 8: try { try decoder.decodeSingularStringField(value: &self._aggregateValue) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.name.isEmpty { + try visitor.visitRepeatedMessageField(value: self.name, fieldNumber: 2) + } + try { if let v = self._identifierValue { + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + } }() + try { if let v = self._positiveIntValue { + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 4) + } }() + try { if let v = self._negativeIntValue { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 5) + } }() + try { if let v = self._doubleValue { + try visitor.visitSingularDoubleField(value: v, fieldNumber: 6) + } }() + try { if let v = self._stringValue { + try visitor.visitSingularBytesField(value: v, fieldNumber: 7) + } }() + try { if let v = self._aggregateValue { + try visitor.visitSingularStringField(value: v, fieldNumber: 8) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_UninterpretedOption, rhs: Google_Protobuf_UninterpretedOption) -> Bool { + if lhs.name != rhs.name {return false} + if lhs._identifierValue != rhs._identifierValue {return false} + if lhs._positiveIntValue != rhs._positiveIntValue {return false} + if lhs._negativeIntValue != rhs._negativeIntValue {return false} + if lhs._doubleValue != rhs._doubleValue {return false} + if lhs._stringValue != rhs._stringValue {return false} + if lhs._aggregateValue != rhs._aggregateValue {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_UninterpretedOption.NamePart: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = Google_Protobuf_UninterpretedOption.protoMessageName + ".NamePart" + static let _protobuf_nameMap: _NameMap = [ + 1: .standard(proto: "name_part"), + 2: .standard(proto: "is_extension"), + ] + + public var isInitialized: Bool { + if self._namePart == nil {return false} + if self._isExtension == nil {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._namePart) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self._isExtension) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._namePart { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._isExtension { + try visitor.visitSingularBoolField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_UninterpretedOption.NamePart, rhs: Google_Protobuf_UninterpretedOption.NamePart) -> Bool { + if lhs._namePart != rhs._namePart {return false} + if lhs._isExtension != rhs._isExtension {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_SourceCodeInfo: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".SourceCodeInfo" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "location"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.location) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.location.isEmpty { + try visitor.visitRepeatedMessageField(value: self.location, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_SourceCodeInfo, rhs: Google_Protobuf_SourceCodeInfo) -> Bool { + if lhs.location != rhs.location {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_SourceCodeInfo.Location: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = Google_Protobuf_SourceCodeInfo.protoMessageName + ".Location" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "path"), + 2: .same(proto: "span"), + 3: .standard(proto: "leading_comments"), + 4: .standard(proto: "trailing_comments"), + 6: .standard(proto: "leading_detached_comments"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedInt32Field(value: &self.path) }() + case 2: try { try decoder.decodeRepeatedInt32Field(value: &self.span) }() + case 3: try { try decoder.decodeSingularStringField(value: &self._leadingComments) }() + case 4: try { try decoder.decodeSingularStringField(value: &self._trailingComments) }() + case 6: try { try decoder.decodeRepeatedStringField(value: &self.leadingDetachedComments) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.path.isEmpty { + try visitor.visitPackedInt32Field(value: self.path, fieldNumber: 1) + } + if !self.span.isEmpty { + try visitor.visitPackedInt32Field(value: self.span, fieldNumber: 2) + } + try { if let v = self._leadingComments { + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + } }() + try { if let v = self._trailingComments { + try visitor.visitSingularStringField(value: v, fieldNumber: 4) + } }() + if !self.leadingDetachedComments.isEmpty { + try visitor.visitRepeatedStringField(value: self.leadingDetachedComments, fieldNumber: 6) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_SourceCodeInfo.Location, rhs: Google_Protobuf_SourceCodeInfo.Location) -> Bool { + if lhs.path != rhs.path {return false} + if lhs.span != rhs.span {return false} + if lhs._leadingComments != rhs._leadingComments {return false} + if lhs._trailingComments != rhs._trailingComments {return false} + if lhs.leadingDetachedComments != rhs.leadingDetachedComments {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_GeneratedCodeInfo: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".GeneratedCodeInfo" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "annotation"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.annotation) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.annotation.isEmpty { + try visitor.visitRepeatedMessageField(value: self.annotation, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_GeneratedCodeInfo, rhs: Google_Protobuf_GeneratedCodeInfo) -> Bool { + if lhs.annotation != rhs.annotation {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_GeneratedCodeInfo.Annotation: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = Google_Protobuf_GeneratedCodeInfo.protoMessageName + ".Annotation" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "path"), + 2: .standard(proto: "source_file"), + 3: .same(proto: "begin"), + 4: .same(proto: "end"), + 5: .same(proto: "semantic"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedInt32Field(value: &self.path) }() + case 2: try { try decoder.decodeSingularStringField(value: &self._sourceFile) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self._begin) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &self._end) }() + case 5: try { try decoder.decodeSingularEnumField(value: &self._semantic) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.path.isEmpty { + try visitor.visitPackedInt32Field(value: self.path, fieldNumber: 1) + } + try { if let v = self._sourceFile { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try { if let v = self._begin { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) + } }() + try { if let v = self._end { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 4) + } }() + try { if let v = self._semantic { + try visitor.visitSingularEnumField(value: v, fieldNumber: 5) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_GeneratedCodeInfo.Annotation, rhs: Google_Protobuf_GeneratedCodeInfo.Annotation) -> Bool { + if lhs.path != rhs.path {return false} + if lhs._sourceFile != rhs._sourceFile {return false} + if lhs._begin != rhs._begin {return false} + if lhs._end != rhs._end {return false} + if lhs._semantic != rhs._semantic {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_GeneratedCodeInfo.Annotation.Semantic: _ProtoNameProviding { + static let _protobuf_nameMap: _NameMap = [ + 0: .same(proto: "NONE"), + 1: .same(proto: "SET"), + 2: .same(proto: "ALIAS"), + ] +} diff --git a/Reference/upstream/google/protobuf/duration.pb.swift b/Reference/upstream/google/protobuf/duration.pb.swift new file mode 100644 index 000000000..7bad2517c --- /dev/null +++ b/Reference/upstream/google/protobuf/duration.pb.swift @@ -0,0 +1,177 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: google/protobuf/duration.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: ProtobufAPIVersionCheck { + struct _3: ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +/// A Duration represents a signed, fixed-length span of time represented +/// as a count of seconds and fractions of seconds at nanosecond +/// resolution. It is independent of any calendar and concepts like "day" +/// or "month". It is related to Timestamp in that the difference between +/// two Timestamp values is a Duration and it can be added or subtracted +/// from a Timestamp. Range is approximately +-10,000 years. +/// +/// # Examples +/// +/// Example 1: Compute Duration from two Timestamps in pseudo code. +/// +/// Timestamp start = ...; +/// Timestamp end = ...; +/// Duration duration = ...; +/// +/// duration.seconds = end.seconds - start.seconds; +/// duration.nanos = end.nanos - start.nanos; +/// +/// if (duration.seconds < 0 && duration.nanos > 0) { +/// duration.seconds += 1; +/// duration.nanos -= 1000000000; +/// } else if (duration.seconds > 0 && duration.nanos < 0) { +/// duration.seconds -= 1; +/// duration.nanos += 1000000000; +/// } +/// +/// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. +/// +/// Timestamp start = ...; +/// Duration duration = ...; +/// Timestamp end = ...; +/// +/// end.seconds = start.seconds + duration.seconds; +/// end.nanos = start.nanos + duration.nanos; +/// +/// if (end.nanos < 0) { +/// end.seconds -= 1; +/// end.nanos += 1000000000; +/// } else if (end.nanos >= 1000000000) { +/// end.seconds += 1; +/// end.nanos -= 1000000000; +/// } +/// +/// Example 3: Compute Duration from datetime.timedelta in Python. +/// +/// td = datetime.timedelta(days=3, minutes=10) +/// duration = Duration() +/// duration.FromTimedelta(td) +/// +/// # JSON Mapping +/// +/// In JSON format, the Duration type is encoded as a string rather than an +/// object, where the string ends in the suffix "s" (indicating seconds) and +/// is preceded by the number of seconds, with nanoseconds expressed as +/// fractional seconds. For example, 3 seconds with 0 nanoseconds should be +/// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should +/// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 +/// microsecond should be expressed in JSON format as "3.000001s". +struct Google_Protobuf_Duration { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Signed seconds of the span of time. Must be from -315,576,000,000 + /// to +315,576,000,000 inclusive. Note: these bounds are computed from: + /// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + var seconds: Int64 = 0 + + /// Signed fractions of a second at nanosecond resolution of the span + /// of time. Durations less than one second are represented with a 0 + /// `seconds` field and a positive or negative `nanos` field. For durations + /// of one second or more, a non-zero value for the `nanos` field must be + /// of the same sign as the `seconds` field. Must be from -999,999,999 + /// to +999,999,999 inclusive. + var nanos: Int32 = 0 + + var unknownFields = UnknownStorage() + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Google_Protobuf_Duration: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "google.protobuf" + +extension Google_Protobuf_Duration: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Duration" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "seconds"), + 2: .same(proto: "nanos"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.seconds) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.nanos) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.seconds != 0 { + try visitor.visitSingularInt64Field(value: self.seconds, fieldNumber: 1) + } + if self.nanos != 0 { + try visitor.visitSingularInt32Field(value: self.nanos, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Duration, rhs: Google_Protobuf_Duration) -> Bool { + if lhs.seconds != rhs.seconds {return false} + if lhs.nanos != rhs.nanos {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/upstream/google/protobuf/empty.pb.swift b/Reference/upstream/google/protobuf/empty.pb.swift new file mode 100644 index 000000000..034904d3f --- /dev/null +++ b/Reference/upstream/google/protobuf/empty.pb.swift @@ -0,0 +1,94 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: google/protobuf/empty.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: ProtobufAPIVersionCheck { + struct _3: ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +/// A generic empty message that you can re-use to avoid defining duplicated +/// empty messages in your APIs. A typical example is to use it as the request +/// or the response type of an API method. For instance: +/// +/// service Foo { +/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +/// } +struct Google_Protobuf_Empty { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = UnknownStorage() + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Google_Protobuf_Empty: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "google.protobuf" + +extension Google_Protobuf_Empty: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Empty" + static let _protobuf_nameMap = _NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Empty, rhs: Google_Protobuf_Empty) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/upstream/google/protobuf/field_mask.pb.swift b/Reference/upstream/google/protobuf/field_mask.pb.swift new file mode 100644 index 000000000..30745f5d8 --- /dev/null +++ b/Reference/upstream/google/protobuf/field_mask.pb.swift @@ -0,0 +1,302 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: google/protobuf/field_mask.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: ProtobufAPIVersionCheck { + struct _3: ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +/// `FieldMask` represents a set of symbolic field paths, for example: +/// +/// paths: "f.a" +/// paths: "f.b.d" +/// +/// Here `f` represents a field in some root message, `a` and `b` +/// fields in the message found in `f`, and `d` a field found in the +/// message in `f.b`. +/// +/// Field masks are used to specify a subset of fields that should be +/// returned by a get operation or modified by an update operation. +/// Field masks also have a custom JSON encoding (see below). +/// +/// # Field Masks in Projections +/// +/// When used in the context of a projection, a response message or +/// sub-message is filtered by the API to only contain those fields as +/// specified in the mask. For example, if the mask in the previous +/// example is applied to a response message as follows: +/// +/// f { +/// a : 22 +/// b { +/// d : 1 +/// x : 2 +/// } +/// y : 13 +/// } +/// z: 8 +/// +/// The result will not contain specific values for fields x,y and z +/// (their value will be set to the default, and omitted in proto text +/// output): +/// +/// +/// f { +/// a : 22 +/// b { +/// d : 1 +/// } +/// } +/// +/// A repeated field is not allowed except at the last position of a +/// paths string. +/// +/// If a FieldMask object is not present in a get operation, the +/// operation applies to all fields (as if a FieldMask of all fields +/// had been specified). +/// +/// Note that a field mask does not necessarily apply to the +/// top-level response message. In case of a REST get operation, the +/// field mask applies directly to the response, but in case of a REST +/// list operation, the mask instead applies to each individual message +/// in the returned resource list. In case of a REST custom method, +/// other definitions may be used. Where the mask applies will be +/// clearly documented together with its declaration in the API. In +/// any case, the effect on the returned resource/resources is required +/// behavior for APIs. +/// +/// # Field Masks in Update Operations +/// +/// A field mask in update operations specifies which fields of the +/// targeted resource are going to be updated. The API is required +/// to only change the values of the fields as specified in the mask +/// and leave the others untouched. If a resource is passed in to +/// describe the updated values, the API ignores the values of all +/// fields not covered by the mask. +/// +/// If a repeated field is specified for an update operation, new values will +/// be appended to the existing repeated field in the target resource. Note that +/// a repeated field is only allowed in the last position of a `paths` string. +/// +/// If a sub-message is specified in the last position of the field mask for an +/// update operation, then new value will be merged into the existing sub-message +/// in the target resource. +/// +/// For example, given the target message: +/// +/// f { +/// b { +/// d: 1 +/// x: 2 +/// } +/// c: [1] +/// } +/// +/// And an update message: +/// +/// f { +/// b { +/// d: 10 +/// } +/// c: [2] +/// } +/// +/// then if the field mask is: +/// +/// paths: ["f.b", "f.c"] +/// +/// then the result will be: +/// +/// f { +/// b { +/// d: 10 +/// x: 2 +/// } +/// c: [1, 2] +/// } +/// +/// An implementation may provide options to override this default behavior for +/// repeated and message fields. +/// +/// In order to reset a field's value to the default, the field must +/// be in the mask and set to the default value in the provided resource. +/// Hence, in order to reset all fields of a resource, provide a default +/// instance of the resource and set all fields in the mask, or do +/// not provide a mask as described below. +/// +/// If a field mask is not present on update, the operation applies to +/// all fields (as if a field mask of all fields has been specified). +/// Note that in the presence of schema evolution, this may mean that +/// fields the client does not know and has therefore not filled into +/// the request will be reset to their default. If this is unwanted +/// behavior, a specific service may require a client to always specify +/// a field mask, producing an error if not. +/// +/// As with get operations, the location of the resource which +/// describes the updated values in the request message depends on the +/// operation kind. In any case, the effect of the field mask is +/// required to be honored by the API. +/// +/// ## Considerations for HTTP REST +/// +/// The HTTP kind of an update operation which uses a field mask must +/// be set to PATCH instead of PUT in order to satisfy HTTP semantics +/// (PUT must only be used for full updates). +/// +/// # JSON Encoding of Field Masks +/// +/// In JSON, a field mask is encoded as a single string where paths are +/// separated by a comma. Fields name in each path are converted +/// to/from lower-camel naming conventions. +/// +/// As an example, consider the following message declarations: +/// +/// message Profile { +/// User user = 1; +/// Photo photo = 2; +/// } +/// message User { +/// string display_name = 1; +/// string address = 2; +/// } +/// +/// In proto a field mask for `Profile` may look as such: +/// +/// mask { +/// paths: "user.display_name" +/// paths: "photo" +/// } +/// +/// In JSON, the same mask is represented as below: +/// +/// { +/// mask: "user.displayName,photo" +/// } +/// +/// # Field Masks and Oneof Fields +/// +/// Field masks treat fields in oneofs just as regular fields. Consider the +/// following message: +/// +/// message SampleMessage { +/// oneof test_oneof { +/// string name = 4; +/// SubMessage sub_message = 9; +/// } +/// } +/// +/// The field mask can be: +/// +/// mask { +/// paths: "name" +/// } +/// +/// Or: +/// +/// mask { +/// paths: "sub_message" +/// } +/// +/// Note that oneof type names ("test_oneof" in this case) cannot be used in +/// paths. +/// +/// ## Field Mask Verification +/// +/// The implementation of any API method which has a FieldMask type field in the +/// request should verify the included field paths, and return an +/// `INVALID_ARGUMENT` error if any path is unmappable. +struct Google_Protobuf_FieldMask { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The set of field mask paths. + var paths: [String] = [] + + var unknownFields = UnknownStorage() + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Google_Protobuf_FieldMask: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "google.protobuf" + +extension Google_Protobuf_FieldMask: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FieldMask" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "paths"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedStringField(value: &self.paths) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.paths.isEmpty { + try visitor.visitRepeatedStringField(value: self.paths, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_FieldMask, rhs: Google_Protobuf_FieldMask) -> Bool { + if lhs.paths != rhs.paths {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/google/protobuf/map_lite_unittest.pb.swift b/Reference/upstream/google/protobuf/map_lite_unittest.pb.swift similarity index 100% rename from Reference/google/protobuf/map_lite_unittest.pb.swift rename to Reference/upstream/google/protobuf/map_lite_unittest.pb.swift diff --git a/Reference/google/protobuf/map_proto2_unittest.pb.swift b/Reference/upstream/google/protobuf/map_proto2_unittest.pb.swift similarity index 100% rename from Reference/google/protobuf/map_proto2_unittest.pb.swift rename to Reference/upstream/google/protobuf/map_proto2_unittest.pb.swift diff --git a/Reference/google/protobuf/map_proto3_unittest.pb.swift b/Reference/upstream/google/protobuf/map_proto3_unittest.pb.swift similarity index 100% rename from Reference/google/protobuf/map_proto3_unittest.pb.swift rename to Reference/upstream/google/protobuf/map_proto3_unittest.pb.swift diff --git a/Reference/google/protobuf/map_unittest.pb.swift b/Reference/upstream/google/protobuf/map_unittest.pb.swift similarity index 100% rename from Reference/google/protobuf/map_unittest.pb.swift rename to Reference/upstream/google/protobuf/map_unittest.pb.swift diff --git a/Reference/upstream/google/protobuf/source_context.pb.swift b/Reference/upstream/google/protobuf/source_context.pb.swift new file mode 100644 index 000000000..99cac0aba --- /dev/null +++ b/Reference/upstream/google/protobuf/source_context.pb.swift @@ -0,0 +1,106 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: google/protobuf/source_context.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: ProtobufAPIVersionCheck { + struct _3: ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +/// `SourceContext` represents information about the source of a +/// protobuf element, like the file in which it is defined. +struct Google_Protobuf_SourceContext { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The path-qualified name of the .proto file that contained the associated + /// protobuf element. For example: `"google/protobuf/source_context.proto"`. + var fileName: String = String() + + var unknownFields = UnknownStorage() + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Google_Protobuf_SourceContext: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "google.protobuf" + +extension Google_Protobuf_SourceContext: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".SourceContext" + static let _protobuf_nameMap: _NameMap = [ + 1: .standard(proto: "file_name"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.fileName) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.fileName.isEmpty { + try visitor.visitSingularStringField(value: self.fileName, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_SourceContext, rhs: Google_Protobuf_SourceContext) -> Bool { + if lhs.fileName != rhs.fileName {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/upstream/google/protobuf/struct.pb.swift b/Reference/upstream/google/protobuf/struct.pb.swift new file mode 100644 index 000000000..6518e098c --- /dev/null +++ b/Reference/upstream/google/protobuf/struct.pb.swift @@ -0,0 +1,416 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: google/protobuf/struct.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: ProtobufAPIVersionCheck { + struct _3: ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +/// `NullValue` is a singleton enumeration to represent the null value for the +/// `Value` type union. +/// +/// The JSON representation for `NullValue` is JSON `null`. +enum Google_Protobuf_NullValue: Enum { + typealias RawValue = Int + + /// Null value. + case nullValue // = 0 + case UNRECOGNIZED(Int) + + init() { + self = .nullValue + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .nullValue + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .nullValue: return 0 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Google_Protobuf_NullValue] = [ + .nullValue, + ] + +} + +/// `Struct` represents a structured data value, consisting of fields +/// which map to dynamically typed values. In some languages, `Struct` +/// might be supported by a native representation. For example, in +/// scripting languages like JS a struct is represented as an +/// object. The details of that representation are described together +/// with the proto support for the language. +/// +/// The JSON representation for `Struct` is JSON object. +struct Google_Protobuf_Struct { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Unordered map of dynamically typed values. + var fields: Dictionary = [:] + + var unknownFields = UnknownStorage() + + init() {} +} + +/// `Value` represents a dynamically typed value which can be either +/// null, a number, a string, a boolean, a recursive struct value, or a +/// list of values. A producer of value is expected to set one of these +/// variants. Absence of any variant indicates an error. +/// +/// The JSON representation for `Value` is JSON value. +struct Google_Protobuf_Value { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The kind of value. + var kind: Google_Protobuf_Value.OneOf_Kind? = nil + + /// Represents a null value. + var nullValue: Google_Protobuf_NullValue { + get { + if case .nullValue(let v)? = kind {return v} + return .nullValue + } + set {kind = .nullValue(newValue)} + } + + /// Represents a double value. + var numberValue: Double { + get { + if case .numberValue(let v)? = kind {return v} + return 0 + } + set {kind = .numberValue(newValue)} + } + + /// Represents a string value. + var stringValue: String { + get { + if case .stringValue(let v)? = kind {return v} + return String() + } + set {kind = .stringValue(newValue)} + } + + /// Represents a boolean value. + var boolValue: Bool { + get { + if case .boolValue(let v)? = kind {return v} + return false + } + set {kind = .boolValue(newValue)} + } + + /// Represents a structured value. + var structValue: Google_Protobuf_Struct { + get { + if case .structValue(let v)? = kind {return v} + return Google_Protobuf_Struct() + } + set {kind = .structValue(newValue)} + } + + /// Represents a repeated `Value`. + var listValue: Google_Protobuf_ListValue { + get { + if case .listValue(let v)? = kind {return v} + return Google_Protobuf_ListValue() + } + set {kind = .listValue(newValue)} + } + + var unknownFields = UnknownStorage() + + /// The kind of value. + enum OneOf_Kind: Equatable { + /// Represents a null value. + case nullValue(Google_Protobuf_NullValue) + /// Represents a double value. + case numberValue(Double) + /// Represents a string value. + case stringValue(String) + /// Represents a boolean value. + case boolValue(Bool) + /// Represents a structured value. + case structValue(Google_Protobuf_Struct) + /// Represents a repeated `Value`. + case listValue(Google_Protobuf_ListValue) + + } + + init() {} +} + +/// `ListValue` is a wrapper around a repeated field of values. +/// +/// The JSON representation for `ListValue` is JSON array. +struct Google_Protobuf_ListValue { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Repeated field of dynamically typed values. + var values: [Google_Protobuf_Value] = [] + + var unknownFields = UnknownStorage() + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Google_Protobuf_Struct: @unchecked Sendable {} +extension Google_Protobuf_Value: @unchecked Sendable {} +extension Google_Protobuf_Value.OneOf_Kind: @unchecked Sendable {} +extension Google_Protobuf_ListValue: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "google.protobuf" + +extension Google_Protobuf_NullValue: _ProtoNameProviding { + static let _protobuf_nameMap: _NameMap = [ + 0: .same(proto: "NULL_VALUE"), + ] +} + +extension Google_Protobuf_Struct: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Struct" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "fields"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeMapField(fieldType: _ProtobufMessageMap.self, value: &self.fields) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.fields.isEmpty { + try visitor.visitMapField(fieldType: _ProtobufMessageMap.self, value: self.fields, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Struct, rhs: Google_Protobuf_Struct) -> Bool { + if lhs.fields != rhs.fields {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_Value: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Value" + static let _protobuf_nameMap: _NameMap = [ + 1: .standard(proto: "null_value"), + 2: .standard(proto: "number_value"), + 3: .standard(proto: "string_value"), + 4: .standard(proto: "bool_value"), + 5: .standard(proto: "struct_value"), + 6: .standard(proto: "list_value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { + var v: Google_Protobuf_NullValue? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if self.kind != nil {try decoder.handleConflictingOneOf()} + self.kind = .nullValue(v) + } + }() + case 2: try { + var v: Double? + try decoder.decodeSingularDoubleField(value: &v) + if let v = v { + if self.kind != nil {try decoder.handleConflictingOneOf()} + self.kind = .numberValue(v) + } + }() + case 3: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.kind != nil {try decoder.handleConflictingOneOf()} + self.kind = .stringValue(v) + } + }() + case 4: try { + var v: Bool? + try decoder.decodeSingularBoolField(value: &v) + if let v = v { + if self.kind != nil {try decoder.handleConflictingOneOf()} + self.kind = .boolValue(v) + } + }() + case 5: try { + var v: Google_Protobuf_Struct? + var hadOneofValue = false + if let current = self.kind { + hadOneofValue = true + if case .structValue(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.kind = .structValue(v) + } + }() + case 6: try { + var v: Google_Protobuf_ListValue? + var hadOneofValue = false + if let current = self.kind { + hadOneofValue = true + if case .listValue(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.kind = .listValue(v) + } + }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + switch self.kind { + case .nullValue?: try { + guard case .nullValue(let v)? = self.kind else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 1) + }() + case .numberValue?: try { + guard case .numberValue(let v)? = self.kind else { preconditionFailure() } + try visitor.visitSingularDoubleField(value: v, fieldNumber: 2) + }() + case .stringValue?: try { + guard case .stringValue(let v)? = self.kind else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + }() + case .boolValue?: try { + guard case .boolValue(let v)? = self.kind else { preconditionFailure() } + try visitor.visitSingularBoolField(value: v, fieldNumber: 4) + }() + case .structValue?: try { + guard case .structValue(let v)? = self.kind else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + }() + case .listValue?: try { + guard case .listValue(let v)? = self.kind else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Value, rhs: Google_Protobuf_Value) -> Bool { + if lhs.kind != rhs.kind {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_ListValue: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ListValue" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "values"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.values) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.values.isEmpty { + try visitor.visitRepeatedMessageField(value: self.values, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_ListValue, rhs: Google_Protobuf_ListValue) -> Bool { + if lhs.values != rhs.values {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/upstream/google/protobuf/test_messages_proto2.pb.swift b/Reference/upstream/google/protobuf/test_messages_proto2.pb.swift new file mode 100644 index 000000000..40d6130ff --- /dev/null +++ b/Reference/upstream/google/protobuf/test_messages_proto2.pb.swift @@ -0,0 +1,4500 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: google/protobuf/test_messages_proto2.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Test schema for proto2 messages. This test schema is used by: +// +// - conformance tests + +// LINT: ALLOW_GROUPS + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum ProtobufTestMessages_Proto2_ForeignEnumProto2: SwiftProtobuf.Enum { + typealias RawValue = Int + case foreignFoo // = 0 + case foreignBar // = 1 + case foreignBaz // = 2 + + init() { + self = .foreignFoo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .foreignFoo + case 1: self = .foreignBar + case 2: self = .foreignBaz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .foreignFoo: return 0 + case .foreignBar: return 1 + case .foreignBaz: return 2 + } + } + +} + +/// 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. +struct ProtobufTestMessages_Proto2_TestAllTypesProto2: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Singular + var optionalInt32: Int32 { + get {return _storage._optionalInt32 ?? 0} + set {_uniqueStorage()._optionalInt32 = newValue} + } + /// Returns true if `optionalInt32` has been explicitly set. + var hasOptionalInt32: Bool {return _storage._optionalInt32 != nil} + /// Clears the value of `optionalInt32`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt32() {_uniqueStorage()._optionalInt32 = nil} + + var optionalInt64: Int64 { + get {return _storage._optionalInt64 ?? 0} + set {_uniqueStorage()._optionalInt64 = newValue} + } + /// Returns true if `optionalInt64` has been explicitly set. + var hasOptionalInt64: Bool {return _storage._optionalInt64 != nil} + /// Clears the value of `optionalInt64`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt64() {_uniqueStorage()._optionalInt64 = nil} + + var optionalUint32: UInt32 { + get {return _storage._optionalUint32 ?? 0} + set {_uniqueStorage()._optionalUint32 = newValue} + } + /// Returns true if `optionalUint32` has been explicitly set. + var hasOptionalUint32: Bool {return _storage._optionalUint32 != nil} + /// Clears the value of `optionalUint32`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint32() {_uniqueStorage()._optionalUint32 = nil} + + var optionalUint64: UInt64 { + get {return _storage._optionalUint64 ?? 0} + set {_uniqueStorage()._optionalUint64 = newValue} + } + /// Returns true if `optionalUint64` has been explicitly set. + var hasOptionalUint64: Bool {return _storage._optionalUint64 != nil} + /// Clears the value of `optionalUint64`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint64() {_uniqueStorage()._optionalUint64 = nil} + + var optionalSint32: Int32 { + get {return _storage._optionalSint32 ?? 0} + set {_uniqueStorage()._optionalSint32 = newValue} + } + /// Returns true if `optionalSint32` has been explicitly set. + var hasOptionalSint32: Bool {return _storage._optionalSint32 != nil} + /// Clears the value of `optionalSint32`. Subsequent reads from it will return its default value. + mutating func clearOptionalSint32() {_uniqueStorage()._optionalSint32 = nil} + + var optionalSint64: Int64 { + get {return _storage._optionalSint64 ?? 0} + set {_uniqueStorage()._optionalSint64 = newValue} + } + /// Returns true if `optionalSint64` has been explicitly set. + var hasOptionalSint64: Bool {return _storage._optionalSint64 != nil} + /// Clears the value of `optionalSint64`. Subsequent reads from it will return its default value. + mutating func clearOptionalSint64() {_uniqueStorage()._optionalSint64 = nil} + + var optionalFixed32: UInt32 { + get {return _storage._optionalFixed32 ?? 0} + set {_uniqueStorage()._optionalFixed32 = newValue} + } + /// Returns true if `optionalFixed32` has been explicitly set. + var hasOptionalFixed32: Bool {return _storage._optionalFixed32 != nil} + /// Clears the value of `optionalFixed32`. Subsequent reads from it will return its default value. + mutating func clearOptionalFixed32() {_uniqueStorage()._optionalFixed32 = nil} + + var optionalFixed64: UInt64 { + get {return _storage._optionalFixed64 ?? 0} + set {_uniqueStorage()._optionalFixed64 = newValue} + } + /// Returns true if `optionalFixed64` has been explicitly set. + var hasOptionalFixed64: Bool {return _storage._optionalFixed64 != nil} + /// Clears the value of `optionalFixed64`. Subsequent reads from it will return its default value. + mutating func clearOptionalFixed64() {_uniqueStorage()._optionalFixed64 = nil} + + var optionalSfixed32: Int32 { + get {return _storage._optionalSfixed32 ?? 0} + set {_uniqueStorage()._optionalSfixed32 = newValue} + } + /// Returns true if `optionalSfixed32` has been explicitly set. + var hasOptionalSfixed32: Bool {return _storage._optionalSfixed32 != nil} + /// Clears the value of `optionalSfixed32`. Subsequent reads from it will return its default value. + mutating func clearOptionalSfixed32() {_uniqueStorage()._optionalSfixed32 = nil} + + var optionalSfixed64: Int64 { + get {return _storage._optionalSfixed64 ?? 0} + set {_uniqueStorage()._optionalSfixed64 = newValue} + } + /// Returns true if `optionalSfixed64` has been explicitly set. + var hasOptionalSfixed64: Bool {return _storage._optionalSfixed64 != nil} + /// Clears the value of `optionalSfixed64`. Subsequent reads from it will return its default value. + mutating func clearOptionalSfixed64() {_uniqueStorage()._optionalSfixed64 = nil} + + var optionalFloat: Float { + get {return _storage._optionalFloat ?? 0} + set {_uniqueStorage()._optionalFloat = newValue} + } + /// Returns true if `optionalFloat` has been explicitly set. + var hasOptionalFloat: Bool {return _storage._optionalFloat != nil} + /// Clears the value of `optionalFloat`. Subsequent reads from it will return its default value. + mutating func clearOptionalFloat() {_uniqueStorage()._optionalFloat = nil} + + var optionalDouble: Double { + get {return _storage._optionalDouble ?? 0} + set {_uniqueStorage()._optionalDouble = newValue} + } + /// Returns true if `optionalDouble` has been explicitly set. + var hasOptionalDouble: Bool {return _storage._optionalDouble != nil} + /// Clears the value of `optionalDouble`. Subsequent reads from it will return its default value. + mutating func clearOptionalDouble() {_uniqueStorage()._optionalDouble = nil} + + var optionalBool: Bool { + get {return _storage._optionalBool ?? false} + set {_uniqueStorage()._optionalBool = newValue} + } + /// Returns true if `optionalBool` has been explicitly set. + var hasOptionalBool: Bool {return _storage._optionalBool != nil} + /// Clears the value of `optionalBool`. Subsequent reads from it will return its default value. + mutating func clearOptionalBool() {_uniqueStorage()._optionalBool = nil} + + var optionalString: String { + get {return _storage._optionalString ?? String()} + set {_uniqueStorage()._optionalString = newValue} + } + /// Returns true if `optionalString` has been explicitly set. + var hasOptionalString: Bool {return _storage._optionalString != nil} + /// Clears the value of `optionalString`. Subsequent reads from it will return its default value. + mutating func clearOptionalString() {_uniqueStorage()._optionalString = nil} + + var optionalBytes: Data { + get {return _storage._optionalBytes ?? Data()} + set {_uniqueStorage()._optionalBytes = newValue} + } + /// Returns true if `optionalBytes` has been explicitly set. + var hasOptionalBytes: Bool {return _storage._optionalBytes != nil} + /// Clears the value of `optionalBytes`. Subsequent reads from it will return its default value. + mutating func clearOptionalBytes() {_uniqueStorage()._optionalBytes = nil} + + var optionalNestedMessage: ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedMessage { + get {return _storage._optionalNestedMessage ?? ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedMessage()} + set {_uniqueStorage()._optionalNestedMessage = newValue} + } + /// Returns true if `optionalNestedMessage` has been explicitly set. + var hasOptionalNestedMessage: Bool {return _storage._optionalNestedMessage != nil} + /// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedMessage() {_uniqueStorage()._optionalNestedMessage = nil} + + var optionalForeignMessage: ProtobufTestMessages_Proto2_ForeignMessageProto2 { + get {return _storage._optionalForeignMessage ?? ProtobufTestMessages_Proto2_ForeignMessageProto2()} + set {_uniqueStorage()._optionalForeignMessage = newValue} + } + /// Returns true if `optionalForeignMessage` has been explicitly set. + var hasOptionalForeignMessage: Bool {return _storage._optionalForeignMessage != nil} + /// Clears the value of `optionalForeignMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalForeignMessage() {_uniqueStorage()._optionalForeignMessage = nil} + + var optionalNestedEnum: ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedEnum { + get {return _storage._optionalNestedEnum ?? .foo} + set {_uniqueStorage()._optionalNestedEnum = newValue} + } + /// Returns true if `optionalNestedEnum` has been explicitly set. + var hasOptionalNestedEnum: Bool {return _storage._optionalNestedEnum != nil} + /// Clears the value of `optionalNestedEnum`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedEnum() {_uniqueStorage()._optionalNestedEnum = nil} + + var optionalForeignEnum: ProtobufTestMessages_Proto2_ForeignEnumProto2 { + get {return _storage._optionalForeignEnum ?? .foreignFoo} + set {_uniqueStorage()._optionalForeignEnum = newValue} + } + /// Returns true if `optionalForeignEnum` has been explicitly set. + var hasOptionalForeignEnum: Bool {return _storage._optionalForeignEnum != nil} + /// Clears the value of `optionalForeignEnum`. Subsequent reads from it will return its default value. + mutating func clearOptionalForeignEnum() {_uniqueStorage()._optionalForeignEnum = nil} + + var optionalStringPiece: String { + get {return _storage._optionalStringPiece ?? String()} + set {_uniqueStorage()._optionalStringPiece = newValue} + } + /// Returns true if `optionalStringPiece` has been explicitly set. + var hasOptionalStringPiece: Bool {return _storage._optionalStringPiece != nil} + /// Clears the value of `optionalStringPiece`. Subsequent reads from it will return its default value. + mutating func clearOptionalStringPiece() {_uniqueStorage()._optionalStringPiece = nil} + + var optionalCord: String { + get {return _storage._optionalCord ?? String()} + set {_uniqueStorage()._optionalCord = newValue} + } + /// Returns true if `optionalCord` has been explicitly set. + var hasOptionalCord: Bool {return _storage._optionalCord != nil} + /// Clears the value of `optionalCord`. Subsequent reads from it will return its default value. + mutating func clearOptionalCord() {_uniqueStorage()._optionalCord = nil} + + var recursiveMessage: ProtobufTestMessages_Proto2_TestAllTypesProto2 { + get {return _storage._recursiveMessage ?? ProtobufTestMessages_Proto2_TestAllTypesProto2()} + set {_uniqueStorage()._recursiveMessage = newValue} + } + /// Returns true if `recursiveMessage` has been explicitly set. + var hasRecursiveMessage: Bool {return _storage._recursiveMessage != nil} + /// Clears the value of `recursiveMessage`. Subsequent reads from it will return its default value. + mutating func clearRecursiveMessage() {_uniqueStorage()._recursiveMessage = nil} + + /// Repeated + var repeatedInt32: [Int32] { + get {return _storage._repeatedInt32} + set {_uniqueStorage()._repeatedInt32 = newValue} + } + + var repeatedInt64: [Int64] { + get {return _storage._repeatedInt64} + set {_uniqueStorage()._repeatedInt64 = newValue} + } + + var repeatedUint32: [UInt32] { + get {return _storage._repeatedUint32} + set {_uniqueStorage()._repeatedUint32 = newValue} + } + + var repeatedUint64: [UInt64] { + get {return _storage._repeatedUint64} + set {_uniqueStorage()._repeatedUint64 = newValue} + } + + var repeatedSint32: [Int32] { + get {return _storage._repeatedSint32} + set {_uniqueStorage()._repeatedSint32 = newValue} + } + + var repeatedSint64: [Int64] { + get {return _storage._repeatedSint64} + set {_uniqueStorage()._repeatedSint64 = newValue} + } + + var repeatedFixed32: [UInt32] { + get {return _storage._repeatedFixed32} + set {_uniqueStorage()._repeatedFixed32 = newValue} + } + + var repeatedFixed64: [UInt64] { + get {return _storage._repeatedFixed64} + set {_uniqueStorage()._repeatedFixed64 = newValue} + } + + var repeatedSfixed32: [Int32] { + get {return _storage._repeatedSfixed32} + set {_uniqueStorage()._repeatedSfixed32 = newValue} + } + + var repeatedSfixed64: [Int64] { + get {return _storage._repeatedSfixed64} + set {_uniqueStorage()._repeatedSfixed64 = newValue} + } + + var repeatedFloat: [Float] { + get {return _storage._repeatedFloat} + set {_uniqueStorage()._repeatedFloat = newValue} + } + + var repeatedDouble: [Double] { + get {return _storage._repeatedDouble} + set {_uniqueStorage()._repeatedDouble = newValue} + } + + var repeatedBool: [Bool] { + get {return _storage._repeatedBool} + set {_uniqueStorage()._repeatedBool = newValue} + } + + var repeatedString: [String] { + get {return _storage._repeatedString} + set {_uniqueStorage()._repeatedString = newValue} + } + + var repeatedBytes: [Data] { + get {return _storage._repeatedBytes} + set {_uniqueStorage()._repeatedBytes = newValue} + } + + var repeatedNestedMessage: [ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedMessage] { + get {return _storage._repeatedNestedMessage} + set {_uniqueStorage()._repeatedNestedMessage = newValue} + } + + var repeatedForeignMessage: [ProtobufTestMessages_Proto2_ForeignMessageProto2] { + get {return _storage._repeatedForeignMessage} + set {_uniqueStorage()._repeatedForeignMessage = newValue} + } + + var repeatedNestedEnum: [ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedEnum] { + get {return _storage._repeatedNestedEnum} + set {_uniqueStorage()._repeatedNestedEnum = newValue} + } + + var repeatedForeignEnum: [ProtobufTestMessages_Proto2_ForeignEnumProto2] { + get {return _storage._repeatedForeignEnum} + set {_uniqueStorage()._repeatedForeignEnum = newValue} + } + + var repeatedStringPiece: [String] { + get {return _storage._repeatedStringPiece} + set {_uniqueStorage()._repeatedStringPiece = newValue} + } + + var repeatedCord: [String] { + get {return _storage._repeatedCord} + set {_uniqueStorage()._repeatedCord = newValue} + } + + /// Packed + var packedInt32: [Int32] { + get {return _storage._packedInt32} + set {_uniqueStorage()._packedInt32 = newValue} + } + + var packedInt64: [Int64] { + get {return _storage._packedInt64} + set {_uniqueStorage()._packedInt64 = newValue} + } + + var packedUint32: [UInt32] { + get {return _storage._packedUint32} + set {_uniqueStorage()._packedUint32 = newValue} + } + + var packedUint64: [UInt64] { + get {return _storage._packedUint64} + set {_uniqueStorage()._packedUint64 = newValue} + } + + var packedSint32: [Int32] { + get {return _storage._packedSint32} + set {_uniqueStorage()._packedSint32 = newValue} + } + + var packedSint64: [Int64] { + get {return _storage._packedSint64} + set {_uniqueStorage()._packedSint64 = newValue} + } + + var packedFixed32: [UInt32] { + get {return _storage._packedFixed32} + set {_uniqueStorage()._packedFixed32 = newValue} + } + + var packedFixed64: [UInt64] { + get {return _storage._packedFixed64} + set {_uniqueStorage()._packedFixed64 = newValue} + } + + var packedSfixed32: [Int32] { + get {return _storage._packedSfixed32} + set {_uniqueStorage()._packedSfixed32 = newValue} + } + + var packedSfixed64: [Int64] { + get {return _storage._packedSfixed64} + set {_uniqueStorage()._packedSfixed64 = newValue} + } + + var packedFloat: [Float] { + get {return _storage._packedFloat} + set {_uniqueStorage()._packedFloat = newValue} + } + + var packedDouble: [Double] { + get {return _storage._packedDouble} + set {_uniqueStorage()._packedDouble = newValue} + } + + var packedBool: [Bool] { + get {return _storage._packedBool} + set {_uniqueStorage()._packedBool = newValue} + } + + var packedNestedEnum: [ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedEnum] { + get {return _storage._packedNestedEnum} + set {_uniqueStorage()._packedNestedEnum = newValue} + } + + /// Unpacked + var unpackedInt32: [Int32] { + get {return _storage._unpackedInt32} + set {_uniqueStorage()._unpackedInt32 = newValue} + } + + var unpackedInt64: [Int64] { + get {return _storage._unpackedInt64} + set {_uniqueStorage()._unpackedInt64 = newValue} + } + + var unpackedUint32: [UInt32] { + get {return _storage._unpackedUint32} + set {_uniqueStorage()._unpackedUint32 = newValue} + } + + var unpackedUint64: [UInt64] { + get {return _storage._unpackedUint64} + set {_uniqueStorage()._unpackedUint64 = newValue} + } + + var unpackedSint32: [Int32] { + get {return _storage._unpackedSint32} + set {_uniqueStorage()._unpackedSint32 = newValue} + } + + var unpackedSint64: [Int64] { + get {return _storage._unpackedSint64} + set {_uniqueStorage()._unpackedSint64 = newValue} + } + + var unpackedFixed32: [UInt32] { + get {return _storage._unpackedFixed32} + set {_uniqueStorage()._unpackedFixed32 = newValue} + } + + var unpackedFixed64: [UInt64] { + get {return _storage._unpackedFixed64} + set {_uniqueStorage()._unpackedFixed64 = newValue} + } + + var unpackedSfixed32: [Int32] { + get {return _storage._unpackedSfixed32} + set {_uniqueStorage()._unpackedSfixed32 = newValue} + } + + var unpackedSfixed64: [Int64] { + get {return _storage._unpackedSfixed64} + set {_uniqueStorage()._unpackedSfixed64 = newValue} + } + + var unpackedFloat: [Float] { + get {return _storage._unpackedFloat} + set {_uniqueStorage()._unpackedFloat = newValue} + } + + var unpackedDouble: [Double] { + get {return _storage._unpackedDouble} + set {_uniqueStorage()._unpackedDouble = newValue} + } + + var unpackedBool: [Bool] { + get {return _storage._unpackedBool} + set {_uniqueStorage()._unpackedBool = newValue} + } + + var unpackedNestedEnum: [ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedEnum] { + get {return _storage._unpackedNestedEnum} + set {_uniqueStorage()._unpackedNestedEnum = newValue} + } + + /// Map + var mapInt32Int32: Dictionary { + get {return _storage._mapInt32Int32} + set {_uniqueStorage()._mapInt32Int32 = newValue} + } + + var mapInt64Int64: Dictionary { + get {return _storage._mapInt64Int64} + set {_uniqueStorage()._mapInt64Int64 = newValue} + } + + var mapUint32Uint32: Dictionary { + get {return _storage._mapUint32Uint32} + set {_uniqueStorage()._mapUint32Uint32 = newValue} + } + + var mapUint64Uint64: Dictionary { + get {return _storage._mapUint64Uint64} + set {_uniqueStorage()._mapUint64Uint64 = newValue} + } + + var mapSint32Sint32: Dictionary { + get {return _storage._mapSint32Sint32} + set {_uniqueStorage()._mapSint32Sint32 = newValue} + } + + var mapSint64Sint64: Dictionary { + get {return _storage._mapSint64Sint64} + set {_uniqueStorage()._mapSint64Sint64 = newValue} + } + + var mapFixed32Fixed32: Dictionary { + get {return _storage._mapFixed32Fixed32} + set {_uniqueStorage()._mapFixed32Fixed32 = newValue} + } + + var mapFixed64Fixed64: Dictionary { + get {return _storage._mapFixed64Fixed64} + set {_uniqueStorage()._mapFixed64Fixed64 = newValue} + } + + var mapSfixed32Sfixed32: Dictionary { + get {return _storage._mapSfixed32Sfixed32} + set {_uniqueStorage()._mapSfixed32Sfixed32 = newValue} + } + + var mapSfixed64Sfixed64: Dictionary { + get {return _storage._mapSfixed64Sfixed64} + set {_uniqueStorage()._mapSfixed64Sfixed64 = newValue} + } + + var mapInt32Float: Dictionary { + get {return _storage._mapInt32Float} + set {_uniqueStorage()._mapInt32Float = newValue} + } + + var mapInt32Double: Dictionary { + get {return _storage._mapInt32Double} + set {_uniqueStorage()._mapInt32Double = newValue} + } + + var mapBoolBool: Dictionary { + get {return _storage._mapBoolBool} + set {_uniqueStorage()._mapBoolBool = newValue} + } + + var mapStringString: Dictionary { + get {return _storage._mapStringString} + set {_uniqueStorage()._mapStringString = newValue} + } + + var mapStringBytes: Dictionary { + get {return _storage._mapStringBytes} + set {_uniqueStorage()._mapStringBytes = newValue} + } + + var mapStringNestedMessage: Dictionary { + get {return _storage._mapStringNestedMessage} + set {_uniqueStorage()._mapStringNestedMessage = newValue} + } + + var mapStringForeignMessage: Dictionary { + get {return _storage._mapStringForeignMessage} + set {_uniqueStorage()._mapStringForeignMessage = newValue} + } + + var mapStringNestedEnum: Dictionary { + get {return _storage._mapStringNestedEnum} + set {_uniqueStorage()._mapStringNestedEnum = newValue} + } + + var mapStringForeignEnum: Dictionary { + get {return _storage._mapStringForeignEnum} + set {_uniqueStorage()._mapStringForeignEnum = newValue} + } + + var oneofField: OneOf_OneofField? { + get {return _storage._oneofField} + set {_uniqueStorage()._oneofField = newValue} + } + + var oneofUint32: UInt32 { + get { + if case .oneofUint32(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofUint32(newValue)} + } + + var oneofNestedMessage: ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedMessage { + get { + if case .oneofNestedMessage(let v)? = _storage._oneofField {return v} + return ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedMessage() + } + set {_uniqueStorage()._oneofField = .oneofNestedMessage(newValue)} + } + + var oneofString: String { + get { + if case .oneofString(let v)? = _storage._oneofField {return v} + return String() + } + set {_uniqueStorage()._oneofField = .oneofString(newValue)} + } + + var oneofBytes: Data { + get { + if case .oneofBytes(let v)? = _storage._oneofField {return v} + return Data() + } + set {_uniqueStorage()._oneofField = .oneofBytes(newValue)} + } + + var oneofBool: Bool { + get { + if case .oneofBool(let v)? = _storage._oneofField {return v} + return false + } + set {_uniqueStorage()._oneofField = .oneofBool(newValue)} + } + + var oneofUint64: UInt64 { + get { + if case .oneofUint64(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofUint64(newValue)} + } + + var oneofFloat: Float { + get { + if case .oneofFloat(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofFloat(newValue)} + } + + var oneofDouble: Double { + get { + if case .oneofDouble(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofDouble(newValue)} + } + + var oneofEnum: ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedEnum { + get { + if case .oneofEnum(let v)? = _storage._oneofField {return v} + return .foo + } + set {_uniqueStorage()._oneofField = .oneofEnum(newValue)} + } + + var data: ProtobufTestMessages_Proto2_TestAllTypesProto2.DataMessage { + get {return _storage._data ?? ProtobufTestMessages_Proto2_TestAllTypesProto2.DataMessage()} + set {_uniqueStorage()._data = newValue} + } + /// Returns true if `data` has been explicitly set. + var hasData: Bool {return _storage._data != nil} + /// Clears the value of `data`. Subsequent reads from it will return its default value. + mutating func clearData() {_uniqueStorage()._data = nil} + + /// default values + var defaultInt32: Int32 { + get {return _storage._defaultInt32 ?? -123456789} + set {_uniqueStorage()._defaultInt32 = newValue} + } + /// Returns true if `defaultInt32` has been explicitly set. + var hasDefaultInt32: Bool {return _storage._defaultInt32 != nil} + /// Clears the value of `defaultInt32`. Subsequent reads from it will return its default value. + mutating func clearDefaultInt32() {_uniqueStorage()._defaultInt32 = nil} + + var defaultInt64: Int64 { + get {return _storage._defaultInt64 ?? -9123456789123456789} + set {_uniqueStorage()._defaultInt64 = newValue} + } + /// Returns true if `defaultInt64` has been explicitly set. + var hasDefaultInt64: Bool {return _storage._defaultInt64 != nil} + /// Clears the value of `defaultInt64`. Subsequent reads from it will return its default value. + mutating func clearDefaultInt64() {_uniqueStorage()._defaultInt64 = nil} + + var defaultUint32: UInt32 { + get {return _storage._defaultUint32 ?? 2123456789} + set {_uniqueStorage()._defaultUint32 = newValue} + } + /// Returns true if `defaultUint32` has been explicitly set. + var hasDefaultUint32: Bool {return _storage._defaultUint32 != nil} + /// Clears the value of `defaultUint32`. Subsequent reads from it will return its default value. + mutating func clearDefaultUint32() {_uniqueStorage()._defaultUint32 = nil} + + var defaultUint64: UInt64 { + get {return _storage._defaultUint64 ?? 10123456789123456789} + set {_uniqueStorage()._defaultUint64 = newValue} + } + /// Returns true if `defaultUint64` has been explicitly set. + var hasDefaultUint64: Bool {return _storage._defaultUint64 != nil} + /// Clears the value of `defaultUint64`. Subsequent reads from it will return its default value. + mutating func clearDefaultUint64() {_uniqueStorage()._defaultUint64 = nil} + + var defaultSint32: Int32 { + get {return _storage._defaultSint32 ?? -123456789} + set {_uniqueStorage()._defaultSint32 = newValue} + } + /// Returns true if `defaultSint32` has been explicitly set. + var hasDefaultSint32: Bool {return _storage._defaultSint32 != nil} + /// Clears the value of `defaultSint32`. Subsequent reads from it will return its default value. + mutating func clearDefaultSint32() {_uniqueStorage()._defaultSint32 = nil} + + var defaultSint64: Int64 { + get {return _storage._defaultSint64 ?? -9123456789123456789} + set {_uniqueStorage()._defaultSint64 = newValue} + } + /// Returns true if `defaultSint64` has been explicitly set. + var hasDefaultSint64: Bool {return _storage._defaultSint64 != nil} + /// Clears the value of `defaultSint64`. Subsequent reads from it will return its default value. + mutating func clearDefaultSint64() {_uniqueStorage()._defaultSint64 = nil} + + var defaultFixed32: UInt32 { + get {return _storage._defaultFixed32 ?? 2123456789} + set {_uniqueStorage()._defaultFixed32 = newValue} + } + /// Returns true if `defaultFixed32` has been explicitly set. + var hasDefaultFixed32: Bool {return _storage._defaultFixed32 != nil} + /// Clears the value of `defaultFixed32`. Subsequent reads from it will return its default value. + mutating func clearDefaultFixed32() {_uniqueStorage()._defaultFixed32 = nil} + + var defaultFixed64: UInt64 { + get {return _storage._defaultFixed64 ?? 10123456789123456789} + set {_uniqueStorage()._defaultFixed64 = newValue} + } + /// Returns true if `defaultFixed64` has been explicitly set. + var hasDefaultFixed64: Bool {return _storage._defaultFixed64 != nil} + /// Clears the value of `defaultFixed64`. Subsequent reads from it will return its default value. + mutating func clearDefaultFixed64() {_uniqueStorage()._defaultFixed64 = nil} + + var defaultSfixed32: Int32 { + get {return _storage._defaultSfixed32 ?? -123456789} + set {_uniqueStorage()._defaultSfixed32 = newValue} + } + /// Returns true if `defaultSfixed32` has been explicitly set. + var hasDefaultSfixed32: Bool {return _storage._defaultSfixed32 != nil} + /// Clears the value of `defaultSfixed32`. Subsequent reads from it will return its default value. + mutating func clearDefaultSfixed32() {_uniqueStorage()._defaultSfixed32 = nil} + + var defaultSfixed64: Int64 { + get {return _storage._defaultSfixed64 ?? -9123456789123456789} + set {_uniqueStorage()._defaultSfixed64 = newValue} + } + /// Returns true if `defaultSfixed64` has been explicitly set. + var hasDefaultSfixed64: Bool {return _storage._defaultSfixed64 != nil} + /// Clears the value of `defaultSfixed64`. Subsequent reads from it will return its default value. + mutating func clearDefaultSfixed64() {_uniqueStorage()._defaultSfixed64 = nil} + + var defaultFloat: Float { + get {return _storage._defaultFloat ?? 9e+09} + set {_uniqueStorage()._defaultFloat = newValue} + } + /// Returns true if `defaultFloat` has been explicitly set. + var hasDefaultFloat: Bool {return _storage._defaultFloat != nil} + /// Clears the value of `defaultFloat`. Subsequent reads from it will return its default value. + mutating func clearDefaultFloat() {_uniqueStorage()._defaultFloat = nil} + + var defaultDouble: Double { + get {return _storage._defaultDouble ?? 7e+22} + set {_uniqueStorage()._defaultDouble = newValue} + } + /// Returns true if `defaultDouble` has been explicitly set. + var hasDefaultDouble: Bool {return _storage._defaultDouble != nil} + /// Clears the value of `defaultDouble`. Subsequent reads from it will return its default value. + mutating func clearDefaultDouble() {_uniqueStorage()._defaultDouble = nil} + + var defaultBool: Bool { + get {return _storage._defaultBool ?? true} + set {_uniqueStorage()._defaultBool = newValue} + } + /// Returns true if `defaultBool` has been explicitly set. + var hasDefaultBool: Bool {return _storage._defaultBool != nil} + /// Clears the value of `defaultBool`. Subsequent reads from it will return its default value. + mutating func clearDefaultBool() {_uniqueStorage()._defaultBool = nil} + + var defaultString: String { + get {return _storage._defaultString ?? "Rosebud"} + set {_uniqueStorage()._defaultString = newValue} + } + /// Returns true if `defaultString` has been explicitly set. + var hasDefaultString: Bool {return _storage._defaultString != nil} + /// Clears the value of `defaultString`. Subsequent reads from it will return its default value. + mutating func clearDefaultString() {_uniqueStorage()._defaultString = nil} + + var defaultBytes: Data { + get {return _storage._defaultBytes ?? Data([106, 111, 115, 104, 117, 97])} + set {_uniqueStorage()._defaultBytes = newValue} + } + /// Returns true if `defaultBytes` has been explicitly set. + var hasDefaultBytes: Bool {return _storage._defaultBytes != nil} + /// Clears the value of `defaultBytes`. Subsequent reads from it will return its default value. + mutating func clearDefaultBytes() {_uniqueStorage()._defaultBytes = nil} + + /// Test field-name-to-JSON-name convention. + /// (protobuf says names can be any valid C/C++ identifier.) + var fieldname1: Int32 { + get {return _storage._fieldname1 ?? 0} + set {_uniqueStorage()._fieldname1 = newValue} + } + /// Returns true if `fieldname1` has been explicitly set. + var hasFieldname1: Bool {return _storage._fieldname1 != nil} + /// Clears the value of `fieldname1`. Subsequent reads from it will return its default value. + mutating func clearFieldname1() {_uniqueStorage()._fieldname1 = nil} + + var fieldName2: Int32 { + get {return _storage._fieldName2 ?? 0} + set {_uniqueStorage()._fieldName2 = newValue} + } + /// Returns true if `fieldName2` has been explicitly set. + var hasFieldName2: Bool {return _storage._fieldName2 != nil} + /// Clears the value of `fieldName2`. Subsequent reads from it will return its default value. + mutating func clearFieldName2() {_uniqueStorage()._fieldName2 = nil} + + var fieldName3: Int32 { + get {return _storage._fieldName3 ?? 0} + set {_uniqueStorage()._fieldName3 = newValue} + } + /// Returns true if `fieldName3` has been explicitly set. + var hasFieldName3: Bool {return _storage._fieldName3 != nil} + /// Clears the value of `fieldName3`. Subsequent reads from it will return its default value. + mutating func clearFieldName3() {_uniqueStorage()._fieldName3 = nil} + + var field_Name4_: Int32 { + get {return _storage._field_Name4_ ?? 0} + set {_uniqueStorage()._field_Name4_ = newValue} + } + /// Returns true if `field_Name4_` has been explicitly set. + var hasField_Name4_: Bool {return _storage._field_Name4_ != nil} + /// Clears the value of `field_Name4_`. Subsequent reads from it will return its default value. + mutating func clearField_Name4_() {_uniqueStorage()._field_Name4_ = nil} + + var field0Name5: Int32 { + get {return _storage._field0Name5 ?? 0} + set {_uniqueStorage()._field0Name5 = newValue} + } + /// Returns true if `field0Name5` has been explicitly set. + var hasField0Name5: Bool {return _storage._field0Name5 != nil} + /// Clears the value of `field0Name5`. Subsequent reads from it will return its default value. + mutating func clearField0Name5() {_uniqueStorage()._field0Name5 = nil} + + var field0Name6: Int32 { + get {return _storage._field0Name6 ?? 0} + set {_uniqueStorage()._field0Name6 = newValue} + } + /// Returns true if `field0Name6` has been explicitly set. + var hasField0Name6: Bool {return _storage._field0Name6 != nil} + /// Clears the value of `field0Name6`. Subsequent reads from it will return its default value. + mutating func clearField0Name6() {_uniqueStorage()._field0Name6 = nil} + + var fieldName7: Int32 { + get {return _storage._fieldName7 ?? 0} + set {_uniqueStorage()._fieldName7 = newValue} + } + /// Returns true if `fieldName7` has been explicitly set. + var hasFieldName7: Bool {return _storage._fieldName7 != nil} + /// Clears the value of `fieldName7`. Subsequent reads from it will return its default value. + mutating func clearFieldName7() {_uniqueStorage()._fieldName7 = nil} + + var fieldName8: Int32 { + get {return _storage._fieldName8 ?? 0} + set {_uniqueStorage()._fieldName8 = newValue} + } + /// Returns true if `fieldName8` has been explicitly set. + var hasFieldName8: Bool {return _storage._fieldName8 != nil} + /// Clears the value of `fieldName8`. Subsequent reads from it will return its default value. + mutating func clearFieldName8() {_uniqueStorage()._fieldName8 = nil} + + var fieldName9: Int32 { + get {return _storage._fieldName9 ?? 0} + set {_uniqueStorage()._fieldName9 = newValue} + } + /// Returns true if `fieldName9` has been explicitly set. + var hasFieldName9: Bool {return _storage._fieldName9 != nil} + /// Clears the value of `fieldName9`. Subsequent reads from it will return its default value. + mutating func clearFieldName9() {_uniqueStorage()._fieldName9 = nil} + + var fieldName10: Int32 { + get {return _storage._fieldName10 ?? 0} + set {_uniqueStorage()._fieldName10 = newValue} + } + /// Returns true if `fieldName10` has been explicitly set. + var hasFieldName10: Bool {return _storage._fieldName10 != nil} + /// Clears the value of `fieldName10`. Subsequent reads from it will return its default value. + mutating func clearFieldName10() {_uniqueStorage()._fieldName10 = nil} + + var fieldName11: Int32 { + get {return _storage._fieldName11 ?? 0} + set {_uniqueStorage()._fieldName11 = newValue} + } + /// Returns true if `fieldName11` has been explicitly set. + var hasFieldName11: Bool {return _storage._fieldName11 != nil} + /// Clears the value of `fieldName11`. Subsequent reads from it will return its default value. + mutating func clearFieldName11() {_uniqueStorage()._fieldName11 = nil} + + var fieldName12: Int32 { + get {return _storage._fieldName12 ?? 0} + set {_uniqueStorage()._fieldName12 = newValue} + } + /// Returns true if `fieldName12` has been explicitly set. + var hasFieldName12: Bool {return _storage._fieldName12 != nil} + /// Clears the value of `fieldName12`. Subsequent reads from it will return its default value. + mutating func clearFieldName12() {_uniqueStorage()._fieldName12 = nil} + + var _FieldName13: Int32 { + get {return _storage.__FieldName13 ?? 0} + set {_uniqueStorage().__FieldName13 = newValue} + } + /// Returns true if `_FieldName13` has been explicitly set. + var has_FieldName13: Bool {return _storage.__FieldName13 != nil} + /// Clears the value of `_FieldName13`. Subsequent reads from it will return its default value. + mutating func clear_FieldName13() {_uniqueStorage().__FieldName13 = nil} + + var _FieldName14: Int32 { + get {return _storage.__FieldName14 ?? 0} + set {_uniqueStorage().__FieldName14 = newValue} + } + /// Returns true if `_FieldName14` has been explicitly set. + var has_FieldName14: Bool {return _storage.__FieldName14 != nil} + /// Clears the value of `_FieldName14`. Subsequent reads from it will return its default value. + mutating func clear_FieldName14() {_uniqueStorage().__FieldName14 = nil} + + var field_Name15: Int32 { + get {return _storage._field_Name15 ?? 0} + set {_uniqueStorage()._field_Name15 = newValue} + } + /// Returns true if `field_Name15` has been explicitly set. + var hasField_Name15: Bool {return _storage._field_Name15 != nil} + /// Clears the value of `field_Name15`. Subsequent reads from it will return its default value. + mutating func clearField_Name15() {_uniqueStorage()._field_Name15 = nil} + + var field_Name16: Int32 { + get {return _storage._field_Name16 ?? 0} + set {_uniqueStorage()._field_Name16 = newValue} + } + /// Returns true if `field_Name16` has been explicitly set. + var hasField_Name16: Bool {return _storage._field_Name16 != nil} + /// Clears the value of `field_Name16`. Subsequent reads from it will return its default value. + mutating func clearField_Name16() {_uniqueStorage()._field_Name16 = nil} + + var fieldName17__: Int32 { + get {return _storage._fieldName17__ ?? 0} + set {_uniqueStorage()._fieldName17__ = newValue} + } + /// Returns true if `fieldName17__` has been explicitly set. + var hasFieldName17__: Bool {return _storage._fieldName17__ != nil} + /// Clears the value of `fieldName17__`. Subsequent reads from it will return its default value. + mutating func clearFieldName17__() {_uniqueStorage()._fieldName17__ = nil} + + var fieldName18__: Int32 { + get {return _storage._fieldName18__ ?? 0} + set {_uniqueStorage()._fieldName18__ = newValue} + } + /// Returns true if `fieldName18__` has been explicitly set. + var hasFieldName18__: Bool {return _storage._fieldName18__ != nil} + /// Clears the value of `fieldName18__`. Subsequent reads from it will return its default value. + mutating func clearFieldName18__() {_uniqueStorage()._fieldName18__ = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_OneofField: Equatable { + case oneofUint32(UInt32) + case oneofNestedMessage(ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedMessage) + case oneofString(String) + case oneofBytes(Data) + case oneofBool(Bool) + case oneofUint64(UInt64) + case oneofFloat(Float) + case oneofDouble(Double) + case oneofEnum(ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedEnum) + + fileprivate var isInitialized: Bool { + guard case .oneofNestedMessage(let v) = self else {return true} + return v.isInitialized + } + + } + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 0 + case bar // = 1 + case baz // = 2 + + /// Intentionally negative. + case neg // = -1 + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case -1: self = .neg + case 0: self = .foo + case 1: self = .bar + case 2: self = .baz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .neg: return -1 + case .foo: return 0 + case .bar: return 1 + case .baz: return 2 + } + } + + } + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _storage._a ?? 0} + set {_uniqueStorage()._a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return _storage._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {_uniqueStorage()._a = nil} + + var corecursive: ProtobufTestMessages_Proto2_TestAllTypesProto2 { + get {return _storage._corecursive ?? ProtobufTestMessages_Proto2_TestAllTypesProto2()} + set {_uniqueStorage()._corecursive = newValue} + } + /// Returns true if `corecursive` has been explicitly set. + var hasCorecursive: Bool {return _storage._corecursive != nil} + /// Clears the value of `corecursive`. Subsequent reads from it will return its default value. + mutating func clearCorecursive() {_uniqueStorage()._corecursive = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance + } + + /// groups + struct DataMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var groupInt32: Int32 { + get {return _groupInt32 ?? 0} + set {_groupInt32 = newValue} + } + /// Returns true if `groupInt32` has been explicitly set. + var hasGroupInt32: Bool {return self._groupInt32 != nil} + /// Clears the value of `groupInt32`. Subsequent reads from it will return its default value. + mutating func clearGroupInt32() {self._groupInt32 = nil} + + var groupUint32: UInt32 { + get {return _groupUint32 ?? 0} + set {_groupUint32 = newValue} + } + /// Returns true if `groupUint32` has been explicitly set. + var hasGroupUint32: Bool {return self._groupUint32 != nil} + /// Clears the value of `groupUint32`. Subsequent reads from it will return its default value. + mutating func clearGroupUint32() {self._groupUint32 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _groupInt32: Int32? = nil + fileprivate var _groupUint32: UInt32? = nil + } + + /// message_set test case. + struct MessageSetCorrect: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + } + + struct MessageSetCorrectExtension1 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var str: String { + get {return _str ?? String()} + set {_str = newValue} + } + /// Returns true if `str` has been explicitly set. + var hasStr: Bool {return self._str != nil} + /// Clears the value of `str`. Subsequent reads from it will return its default value. + mutating func clearStr() {self._str = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _str: String? = nil + } + + struct MessageSetCorrectExtension2 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var i: Int32 { + get {return _i ?? 0} + set {_i = newValue} + } + /// Returns true if `i` has been explicitly set. + var hasI: Bool {return self._i != nil} + /// Clears the value of `i`. Subsequent reads from it will return its default value. + mutating func clearI() {self._i = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _i: Int32? = nil + } + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufTestMessages_Proto2_ForeignMessageProto2 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var c: Int32 { + get {return _c ?? 0} + set {_c = newValue} + } + /// Returns true if `c` has been explicitly set. + var hasC: Bool {return self._c != nil} + /// Clears the value of `c`. Subsequent reads from it will return its default value. + mutating func clearC() {self._c = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _c: Int32? = nil +} + +struct ProtobufTestMessages_Proto2_UnknownToTestAllTypes { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var optionalInt32: Int32 { + get {return _optionalInt32 ?? 0} + set {_optionalInt32 = newValue} + } + /// Returns true if `optionalInt32` has been explicitly set. + var hasOptionalInt32: Bool {return self._optionalInt32 != nil} + /// Clears the value of `optionalInt32`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt32() {self._optionalInt32 = nil} + + var optionalString: String { + get {return _optionalString ?? String()} + set {_optionalString = newValue} + } + /// Returns true if `optionalString` has been explicitly set. + var hasOptionalString: Bool {return self._optionalString != nil} + /// Clears the value of `optionalString`. Subsequent reads from it will return its default value. + mutating func clearOptionalString() {self._optionalString = nil} + + var nestedMessage: ProtobufTestMessages_Proto2_ForeignMessageProto2 { + get {return _nestedMessage ?? ProtobufTestMessages_Proto2_ForeignMessageProto2()} + set {_nestedMessage = newValue} + } + /// Returns true if `nestedMessage` has been explicitly set. + var hasNestedMessage: Bool {return self._nestedMessage != nil} + /// Clears the value of `nestedMessage`. Subsequent reads from it will return its default value. + mutating func clearNestedMessage() {self._nestedMessage = nil} + + var optionalGroup: ProtobufTestMessages_Proto2_UnknownToTestAllTypes.OptionalGroup { + get {return _optionalGroup ?? ProtobufTestMessages_Proto2_UnknownToTestAllTypes.OptionalGroup()} + set {_optionalGroup = newValue} + } + /// Returns true if `optionalGroup` has been explicitly set. + var hasOptionalGroup: Bool {return self._optionalGroup != nil} + /// Clears the value of `optionalGroup`. Subsequent reads from it will return its default value. + mutating func clearOptionalGroup() {self._optionalGroup = nil} + + var optionalBool: Bool { + get {return _optionalBool ?? false} + set {_optionalBool = newValue} + } + /// Returns true if `optionalBool` has been explicitly set. + var hasOptionalBool: Bool {return self._optionalBool != nil} + /// Clears the value of `optionalBool`. Subsequent reads from it will return its default value. + mutating func clearOptionalBool() {self._optionalBool = nil} + + var repeatedInt32: [Int32] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + struct OptionalGroup { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _a ?? 0} + set {_a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return self._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {self._a = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _a: Int32? = nil + } + + init() {} + + fileprivate var _optionalInt32: Int32? = nil + fileprivate var _optionalString: String? = nil + fileprivate var _nestedMessage: ProtobufTestMessages_Proto2_ForeignMessageProto2? = nil + fileprivate var _optionalGroup: ProtobufTestMessages_Proto2_UnknownToTestAllTypes.OptionalGroup? = nil + fileprivate var _optionalBool: Bool? = nil +} + +struct ProtobufTestMessages_Proto2_NullHypothesisProto2 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufTestMessages_Proto2_EnumOnlyProto2 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum BoolEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case kFalse // = 0 + case kTrue // = 1 + + init() { + self = .kFalse + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .kFalse + case 1: self = .kTrue + default: return nil + } + } + + var rawValue: Int { + switch self { + case .kFalse: return 0 + case .kTrue: return 1 + } + } + + } + + init() {} +} + +struct ProtobufTestMessages_Proto2_OneStringProto2 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var data: String { + get {return _data ?? String()} + set {_data = newValue} + } + /// Returns true if `data` has been explicitly set. + var hasData: Bool {return self._data != nil} + /// Clears the value of `data`. Subsequent reads from it will return its default value. + mutating func clearData() {self._data = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _data: String? = nil +} + +struct ProtobufTestMessages_Proto2_ProtoWithKeywords { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var inline: Int32 { + get {return _inline ?? 0} + set {_inline = newValue} + } + /// Returns true if `inline` has been explicitly set. + var hasInline: Bool {return self._inline != nil} + /// Clears the value of `inline`. Subsequent reads from it will return its default value. + mutating func clearInline() {self._inline = nil} + + var concept: String { + get {return _concept ?? String()} + set {_concept = newValue} + } + /// Returns true if `concept` has been explicitly set. + var hasConcept: Bool {return self._concept != nil} + /// Clears the value of `concept`. Subsequent reads from it will return its default value. + mutating func clearConcept() {self._concept = nil} + + var requires: [String] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _inline: Int32? = nil + fileprivate var _concept: String? = nil +} + +struct ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Singular + var requiredInt32: Int32 { + get {return _storage._requiredInt32 ?? 0} + set {_uniqueStorage()._requiredInt32 = newValue} + } + /// Returns true if `requiredInt32` has been explicitly set. + var hasRequiredInt32: Bool {return _storage._requiredInt32 != nil} + /// Clears the value of `requiredInt32`. Subsequent reads from it will return its default value. + mutating func clearRequiredInt32() {_uniqueStorage()._requiredInt32 = nil} + + var requiredInt64: Int64 { + get {return _storage._requiredInt64 ?? 0} + set {_uniqueStorage()._requiredInt64 = newValue} + } + /// Returns true if `requiredInt64` has been explicitly set. + var hasRequiredInt64: Bool {return _storage._requiredInt64 != nil} + /// Clears the value of `requiredInt64`. Subsequent reads from it will return its default value. + mutating func clearRequiredInt64() {_uniqueStorage()._requiredInt64 = nil} + + var requiredUint32: UInt32 { + get {return _storage._requiredUint32 ?? 0} + set {_uniqueStorage()._requiredUint32 = newValue} + } + /// Returns true if `requiredUint32` has been explicitly set. + var hasRequiredUint32: Bool {return _storage._requiredUint32 != nil} + /// Clears the value of `requiredUint32`. Subsequent reads from it will return its default value. + mutating func clearRequiredUint32() {_uniqueStorage()._requiredUint32 = nil} + + var requiredUint64: UInt64 { + get {return _storage._requiredUint64 ?? 0} + set {_uniqueStorage()._requiredUint64 = newValue} + } + /// Returns true if `requiredUint64` has been explicitly set. + var hasRequiredUint64: Bool {return _storage._requiredUint64 != nil} + /// Clears the value of `requiredUint64`. Subsequent reads from it will return its default value. + mutating func clearRequiredUint64() {_uniqueStorage()._requiredUint64 = nil} + + var requiredSint32: Int32 { + get {return _storage._requiredSint32 ?? 0} + set {_uniqueStorage()._requiredSint32 = newValue} + } + /// Returns true if `requiredSint32` has been explicitly set. + var hasRequiredSint32: Bool {return _storage._requiredSint32 != nil} + /// Clears the value of `requiredSint32`. Subsequent reads from it will return its default value. + mutating func clearRequiredSint32() {_uniqueStorage()._requiredSint32 = nil} + + var requiredSint64: Int64 { + get {return _storage._requiredSint64 ?? 0} + set {_uniqueStorage()._requiredSint64 = newValue} + } + /// Returns true if `requiredSint64` has been explicitly set. + var hasRequiredSint64: Bool {return _storage._requiredSint64 != nil} + /// Clears the value of `requiredSint64`. Subsequent reads from it will return its default value. + mutating func clearRequiredSint64() {_uniqueStorage()._requiredSint64 = nil} + + var requiredFixed32: UInt32 { + get {return _storage._requiredFixed32 ?? 0} + set {_uniqueStorage()._requiredFixed32 = newValue} + } + /// Returns true if `requiredFixed32` has been explicitly set. + var hasRequiredFixed32: Bool {return _storage._requiredFixed32 != nil} + /// Clears the value of `requiredFixed32`. Subsequent reads from it will return its default value. + mutating func clearRequiredFixed32() {_uniqueStorage()._requiredFixed32 = nil} + + var requiredFixed64: UInt64 { + get {return _storage._requiredFixed64 ?? 0} + set {_uniqueStorage()._requiredFixed64 = newValue} + } + /// Returns true if `requiredFixed64` has been explicitly set. + var hasRequiredFixed64: Bool {return _storage._requiredFixed64 != nil} + /// Clears the value of `requiredFixed64`. Subsequent reads from it will return its default value. + mutating func clearRequiredFixed64() {_uniqueStorage()._requiredFixed64 = nil} + + var requiredSfixed32: Int32 { + get {return _storage._requiredSfixed32 ?? 0} + set {_uniqueStorage()._requiredSfixed32 = newValue} + } + /// Returns true if `requiredSfixed32` has been explicitly set. + var hasRequiredSfixed32: Bool {return _storage._requiredSfixed32 != nil} + /// Clears the value of `requiredSfixed32`. Subsequent reads from it will return its default value. + mutating func clearRequiredSfixed32() {_uniqueStorage()._requiredSfixed32 = nil} + + var requiredSfixed64: Int64 { + get {return _storage._requiredSfixed64 ?? 0} + set {_uniqueStorage()._requiredSfixed64 = newValue} + } + /// Returns true if `requiredSfixed64` has been explicitly set. + var hasRequiredSfixed64: Bool {return _storage._requiredSfixed64 != nil} + /// Clears the value of `requiredSfixed64`. Subsequent reads from it will return its default value. + mutating func clearRequiredSfixed64() {_uniqueStorage()._requiredSfixed64 = nil} + + var requiredFloat: Float { + get {return _storage._requiredFloat ?? 0} + set {_uniqueStorage()._requiredFloat = newValue} + } + /// Returns true if `requiredFloat` has been explicitly set. + var hasRequiredFloat: Bool {return _storage._requiredFloat != nil} + /// Clears the value of `requiredFloat`. Subsequent reads from it will return its default value. + mutating func clearRequiredFloat() {_uniqueStorage()._requiredFloat = nil} + + var requiredDouble: Double { + get {return _storage._requiredDouble ?? 0} + set {_uniqueStorage()._requiredDouble = newValue} + } + /// Returns true if `requiredDouble` has been explicitly set. + var hasRequiredDouble: Bool {return _storage._requiredDouble != nil} + /// Clears the value of `requiredDouble`. Subsequent reads from it will return its default value. + mutating func clearRequiredDouble() {_uniqueStorage()._requiredDouble = nil} + + var requiredBool: Bool { + get {return _storage._requiredBool ?? false} + set {_uniqueStorage()._requiredBool = newValue} + } + /// Returns true if `requiredBool` has been explicitly set. + var hasRequiredBool: Bool {return _storage._requiredBool != nil} + /// Clears the value of `requiredBool`. Subsequent reads from it will return its default value. + mutating func clearRequiredBool() {_uniqueStorage()._requiredBool = nil} + + var requiredString: String { + get {return _storage._requiredString ?? String()} + set {_uniqueStorage()._requiredString = newValue} + } + /// Returns true if `requiredString` has been explicitly set. + var hasRequiredString: Bool {return _storage._requiredString != nil} + /// Clears the value of `requiredString`. Subsequent reads from it will return its default value. + mutating func clearRequiredString() {_uniqueStorage()._requiredString = nil} + + var requiredBytes: Data { + get {return _storage._requiredBytes ?? Data()} + set {_uniqueStorage()._requiredBytes = newValue} + } + /// Returns true if `requiredBytes` has been explicitly set. + var hasRequiredBytes: Bool {return _storage._requiredBytes != nil} + /// Clears the value of `requiredBytes`. Subsequent reads from it will return its default value. + mutating func clearRequiredBytes() {_uniqueStorage()._requiredBytes = nil} + + var requiredNestedMessage: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.NestedMessage { + get {return _storage._requiredNestedMessage ?? ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.NestedMessage()} + set {_uniqueStorage()._requiredNestedMessage = newValue} + } + /// Returns true if `requiredNestedMessage` has been explicitly set. + var hasRequiredNestedMessage: Bool {return _storage._requiredNestedMessage != nil} + /// Clears the value of `requiredNestedMessage`. Subsequent reads from it will return its default value. + mutating func clearRequiredNestedMessage() {_uniqueStorage()._requiredNestedMessage = nil} + + var requiredForeignMessage: ProtobufTestMessages_Proto2_ForeignMessageProto2 { + get {return _storage._requiredForeignMessage ?? ProtobufTestMessages_Proto2_ForeignMessageProto2()} + set {_uniqueStorage()._requiredForeignMessage = newValue} + } + /// Returns true if `requiredForeignMessage` has been explicitly set. + var hasRequiredForeignMessage: Bool {return _storage._requiredForeignMessage != nil} + /// Clears the value of `requiredForeignMessage`. Subsequent reads from it will return its default value. + mutating func clearRequiredForeignMessage() {_uniqueStorage()._requiredForeignMessage = nil} + + var requiredNestedEnum: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.NestedEnum { + get {return _storage._requiredNestedEnum ?? .foo} + set {_uniqueStorage()._requiredNestedEnum = newValue} + } + /// Returns true if `requiredNestedEnum` has been explicitly set. + var hasRequiredNestedEnum: Bool {return _storage._requiredNestedEnum != nil} + /// Clears the value of `requiredNestedEnum`. Subsequent reads from it will return its default value. + mutating func clearRequiredNestedEnum() {_uniqueStorage()._requiredNestedEnum = nil} + + var requiredForeignEnum: ProtobufTestMessages_Proto2_ForeignEnumProto2 { + get {return _storage._requiredForeignEnum ?? .foreignFoo} + set {_uniqueStorage()._requiredForeignEnum = newValue} + } + /// Returns true if `requiredForeignEnum` has been explicitly set. + var hasRequiredForeignEnum: Bool {return _storage._requiredForeignEnum != nil} + /// Clears the value of `requiredForeignEnum`. Subsequent reads from it will return its default value. + mutating func clearRequiredForeignEnum() {_uniqueStorage()._requiredForeignEnum = nil} + + var requiredStringPiece: String { + get {return _storage._requiredStringPiece ?? String()} + set {_uniqueStorage()._requiredStringPiece = newValue} + } + /// Returns true if `requiredStringPiece` has been explicitly set. + var hasRequiredStringPiece: Bool {return _storage._requiredStringPiece != nil} + /// Clears the value of `requiredStringPiece`. Subsequent reads from it will return its default value. + mutating func clearRequiredStringPiece() {_uniqueStorage()._requiredStringPiece = nil} + + var requiredCord: String { + get {return _storage._requiredCord ?? String()} + set {_uniqueStorage()._requiredCord = newValue} + } + /// Returns true if `requiredCord` has been explicitly set. + var hasRequiredCord: Bool {return _storage._requiredCord != nil} + /// Clears the value of `requiredCord`. Subsequent reads from it will return its default value. + mutating func clearRequiredCord() {_uniqueStorage()._requiredCord = nil} + + var recursiveMessage: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2 { + get {return _storage._recursiveMessage ?? ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2()} + set {_uniqueStorage()._recursiveMessage = newValue} + } + /// Returns true if `recursiveMessage` has been explicitly set. + var hasRecursiveMessage: Bool {return _storage._recursiveMessage != nil} + /// Clears the value of `recursiveMessage`. Subsequent reads from it will return its default value. + mutating func clearRecursiveMessage() {_uniqueStorage()._recursiveMessage = nil} + + var optionalRecursiveMessage: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2 { + get {return _storage._optionalRecursiveMessage ?? ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2()} + set {_uniqueStorage()._optionalRecursiveMessage = newValue} + } + /// Returns true if `optionalRecursiveMessage` has been explicitly set. + var hasOptionalRecursiveMessage: Bool {return _storage._optionalRecursiveMessage != nil} + /// Clears the value of `optionalRecursiveMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalRecursiveMessage() {_uniqueStorage()._optionalRecursiveMessage = nil} + + var data: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.DataMessage { + get {return _storage._data ?? ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.DataMessage()} + set {_uniqueStorage()._data = newValue} + } + /// Returns true if `data` has been explicitly set. + var hasData: Bool {return _storage._data != nil} + /// Clears the value of `data`. Subsequent reads from it will return its default value. + mutating func clearData() {_uniqueStorage()._data = nil} + + /// default values + var defaultInt32: Int32 { + get {return _storage._defaultInt32 ?? -123456789} + set {_uniqueStorage()._defaultInt32 = newValue} + } + /// Returns true if `defaultInt32` has been explicitly set. + var hasDefaultInt32: Bool {return _storage._defaultInt32 != nil} + /// Clears the value of `defaultInt32`. Subsequent reads from it will return its default value. + mutating func clearDefaultInt32() {_uniqueStorage()._defaultInt32 = nil} + + var defaultInt64: Int64 { + get {return _storage._defaultInt64 ?? -9123456789123456789} + set {_uniqueStorage()._defaultInt64 = newValue} + } + /// Returns true if `defaultInt64` has been explicitly set. + var hasDefaultInt64: Bool {return _storage._defaultInt64 != nil} + /// Clears the value of `defaultInt64`. Subsequent reads from it will return its default value. + mutating func clearDefaultInt64() {_uniqueStorage()._defaultInt64 = nil} + + var defaultUint32: UInt32 { + get {return _storage._defaultUint32 ?? 2123456789} + set {_uniqueStorage()._defaultUint32 = newValue} + } + /// Returns true if `defaultUint32` has been explicitly set. + var hasDefaultUint32: Bool {return _storage._defaultUint32 != nil} + /// Clears the value of `defaultUint32`. Subsequent reads from it will return its default value. + mutating func clearDefaultUint32() {_uniqueStorage()._defaultUint32 = nil} + + var defaultUint64: UInt64 { + get {return _storage._defaultUint64 ?? 10123456789123456789} + set {_uniqueStorage()._defaultUint64 = newValue} + } + /// Returns true if `defaultUint64` has been explicitly set. + var hasDefaultUint64: Bool {return _storage._defaultUint64 != nil} + /// Clears the value of `defaultUint64`. Subsequent reads from it will return its default value. + mutating func clearDefaultUint64() {_uniqueStorage()._defaultUint64 = nil} + + var defaultSint32: Int32 { + get {return _storage._defaultSint32 ?? -123456789} + set {_uniqueStorage()._defaultSint32 = newValue} + } + /// Returns true if `defaultSint32` has been explicitly set. + var hasDefaultSint32: Bool {return _storage._defaultSint32 != nil} + /// Clears the value of `defaultSint32`. Subsequent reads from it will return its default value. + mutating func clearDefaultSint32() {_uniqueStorage()._defaultSint32 = nil} + + var defaultSint64: Int64 { + get {return _storage._defaultSint64 ?? -9123456789123456789} + set {_uniqueStorage()._defaultSint64 = newValue} + } + /// Returns true if `defaultSint64` has been explicitly set. + var hasDefaultSint64: Bool {return _storage._defaultSint64 != nil} + /// Clears the value of `defaultSint64`. Subsequent reads from it will return its default value. + mutating func clearDefaultSint64() {_uniqueStorage()._defaultSint64 = nil} + + var defaultFixed32: UInt32 { + get {return _storage._defaultFixed32 ?? 2123456789} + set {_uniqueStorage()._defaultFixed32 = newValue} + } + /// Returns true if `defaultFixed32` has been explicitly set. + var hasDefaultFixed32: Bool {return _storage._defaultFixed32 != nil} + /// Clears the value of `defaultFixed32`. Subsequent reads from it will return its default value. + mutating func clearDefaultFixed32() {_uniqueStorage()._defaultFixed32 = nil} + + var defaultFixed64: UInt64 { + get {return _storage._defaultFixed64 ?? 10123456789123456789} + set {_uniqueStorage()._defaultFixed64 = newValue} + } + /// Returns true if `defaultFixed64` has been explicitly set. + var hasDefaultFixed64: Bool {return _storage._defaultFixed64 != nil} + /// Clears the value of `defaultFixed64`. Subsequent reads from it will return its default value. + mutating func clearDefaultFixed64() {_uniqueStorage()._defaultFixed64 = nil} + + var defaultSfixed32: Int32 { + get {return _storage._defaultSfixed32 ?? -123456789} + set {_uniqueStorage()._defaultSfixed32 = newValue} + } + /// Returns true if `defaultSfixed32` has been explicitly set. + var hasDefaultSfixed32: Bool {return _storage._defaultSfixed32 != nil} + /// Clears the value of `defaultSfixed32`. Subsequent reads from it will return its default value. + mutating func clearDefaultSfixed32() {_uniqueStorage()._defaultSfixed32 = nil} + + var defaultSfixed64: Int64 { + get {return _storage._defaultSfixed64 ?? -9123456789123456789} + set {_uniqueStorage()._defaultSfixed64 = newValue} + } + /// Returns true if `defaultSfixed64` has been explicitly set. + var hasDefaultSfixed64: Bool {return _storage._defaultSfixed64 != nil} + /// Clears the value of `defaultSfixed64`. Subsequent reads from it will return its default value. + mutating func clearDefaultSfixed64() {_uniqueStorage()._defaultSfixed64 = nil} + + var defaultFloat: Float { + get {return _storage._defaultFloat ?? 9e+09} + set {_uniqueStorage()._defaultFloat = newValue} + } + /// Returns true if `defaultFloat` has been explicitly set. + var hasDefaultFloat: Bool {return _storage._defaultFloat != nil} + /// Clears the value of `defaultFloat`. Subsequent reads from it will return its default value. + mutating func clearDefaultFloat() {_uniqueStorage()._defaultFloat = nil} + + var defaultDouble: Double { + get {return _storage._defaultDouble ?? 7e+22} + set {_uniqueStorage()._defaultDouble = newValue} + } + /// Returns true if `defaultDouble` has been explicitly set. + var hasDefaultDouble: Bool {return _storage._defaultDouble != nil} + /// Clears the value of `defaultDouble`. Subsequent reads from it will return its default value. + mutating func clearDefaultDouble() {_uniqueStorage()._defaultDouble = nil} + + var defaultBool: Bool { + get {return _storage._defaultBool ?? true} + set {_uniqueStorage()._defaultBool = newValue} + } + /// Returns true if `defaultBool` has been explicitly set. + var hasDefaultBool: Bool {return _storage._defaultBool != nil} + /// Clears the value of `defaultBool`. Subsequent reads from it will return its default value. + mutating func clearDefaultBool() {_uniqueStorage()._defaultBool = nil} + + var defaultString: String { + get {return _storage._defaultString ?? "Rosebud"} + set {_uniqueStorage()._defaultString = newValue} + } + /// Returns true if `defaultString` has been explicitly set. + var hasDefaultString: Bool {return _storage._defaultString != nil} + /// Clears the value of `defaultString`. Subsequent reads from it will return its default value. + mutating func clearDefaultString() {_uniqueStorage()._defaultString = nil} + + var defaultBytes: Data { + get {return _storage._defaultBytes ?? Data([106, 111, 115, 104, 117, 97])} + set {_uniqueStorage()._defaultBytes = newValue} + } + /// Returns true if `defaultBytes` has been explicitly set. + var hasDefaultBytes: Bool {return _storage._defaultBytes != nil} + /// Clears the value of `defaultBytes`. Subsequent reads from it will return its default value. + mutating func clearDefaultBytes() {_uniqueStorage()._defaultBytes = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 0 + case bar // = 1 + case baz // = 2 + + /// Intentionally negative. + case neg // = -1 + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case -1: self = .neg + case 0: self = .foo + case 1: self = .bar + case 2: self = .baz + default: return nil + } + } + + var rawValue: Int { + switch self { + case .neg: return -1 + case .foo: return 0 + case .bar: return 1 + case .baz: return 2 + } + } + + } + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _storage._a ?? 0} + set {_uniqueStorage()._a = newValue} + } + /// Returns true if `a` has been explicitly set. + var hasA: Bool {return _storage._a != nil} + /// Clears the value of `a`. Subsequent reads from it will return its default value. + mutating func clearA() {_uniqueStorage()._a = nil} + + var corecursive: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2 { + get {return _storage._corecursive ?? ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2()} + set {_uniqueStorage()._corecursive = newValue} + } + /// Returns true if `corecursive` has been explicitly set. + var hasCorecursive: Bool {return _storage._corecursive != nil} + /// Clears the value of `corecursive`. Subsequent reads from it will return its default value. + mutating func clearCorecursive() {_uniqueStorage()._corecursive = nil} + + var optionalCorecursive: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2 { + get {return _storage._optionalCorecursive ?? ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2()} + set {_uniqueStorage()._optionalCorecursive = newValue} + } + /// Returns true if `optionalCorecursive` has been explicitly set. + var hasOptionalCorecursive: Bool {return _storage._optionalCorecursive != nil} + /// Clears the value of `optionalCorecursive`. Subsequent reads from it will return its default value. + mutating func clearOptionalCorecursive() {_uniqueStorage()._optionalCorecursive = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance + } + + /// groups + struct DataMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var groupInt32: Int32 { + get {return _groupInt32 ?? 0} + set {_groupInt32 = newValue} + } + /// Returns true if `groupInt32` has been explicitly set. + var hasGroupInt32: Bool {return self._groupInt32 != nil} + /// Clears the value of `groupInt32`. Subsequent reads from it will return its default value. + mutating func clearGroupInt32() {self._groupInt32 = nil} + + var groupUint32: UInt32 { + get {return _groupUint32 ?? 0} + set {_groupUint32 = newValue} + } + /// Returns true if `groupUint32` has been explicitly set. + var hasGroupUint32: Bool {return self._groupUint32 != nil} + /// Clears the value of `groupUint32`. Subsequent reads from it will return its default value. + mutating func clearGroupUint32() {self._groupUint32 = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _groupInt32: Int32? = nil + fileprivate var _groupUint32: UInt32? = nil + } + + /// message_set test case. + struct MessageSetCorrect: SwiftProtobuf.ExtensibleMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + } + + struct MessageSetCorrectExtension1 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var str: String { + get {return _str ?? String()} + set {_str = newValue} + } + /// Returns true if `str` has been explicitly set. + var hasStr: Bool {return self._str != nil} + /// Clears the value of `str`. Subsequent reads from it will return its default value. + mutating func clearStr() {self._str = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _str: String? = nil + } + + struct MessageSetCorrectExtension2 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var i: Int32 { + get {return _i ?? 0} + set {_i = newValue} + } + /// Returns true if `i` has been explicitly set. + var hasI: Bool {return self._i != nil} + /// Clears the value of `i`. Subsequent reads from it will return its default value. + mutating func clearI() {self._i = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _i: Int32? = nil + } + + init() {} + + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() + fileprivate var _storage = _StorageClass.defaultInstance +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufTestMessages_Proto2_TestAllTypesProto2: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_TestAllTypesProto2.OneOf_OneofField: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedMessage: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_TestAllTypesProto2.DataMessage: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrect: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension1: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension2: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_ForeignMessageProto2: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_UnknownToTestAllTypes: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_UnknownToTestAllTypes.OptionalGroup: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_NullHypothesisProto2: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_EnumOnlyProto2: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_OneStringProto2: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_ProtoWithKeywords: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.NestedMessage: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.DataMessage: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrect: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension1: @unchecked Sendable {} +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension2: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Extension support defined in test_messages_proto2.proto. + +// MARK: - Extension Properties + +// Swift Extensions on the exteneded Messages to add easy access to the declared +// extension fields. The names are based on the extension field name from the proto +// declaration. To avoid naming collisions, the names are prefixed with the name of +// the scope where the extend directive occurs. + +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrect { + + var ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2_MessageSetCorrectExtension1_messageSetExtension: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension1 { + get {return getExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension1.Extensions.message_set_extension) ?? ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension1()} + set {setExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension1.Extensions.message_set_extension, value: newValue)} + } + /// Returns true if extension `ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension1.Extensions.message_set_extension` + /// has been explicitly set. + var hasProtobufTestMessages_Proto2_TestAllRequiredTypesProto2_MessageSetCorrectExtension1_messageSetExtension: Bool { + return hasExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension1.Extensions.message_set_extension) + } + /// Clears the value of extension `ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension1.Extensions.message_set_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufTestMessages_Proto2_TestAllRequiredTypesProto2_MessageSetCorrectExtension1_messageSetExtension() { + clearExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension1.Extensions.message_set_extension) + } + + var ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2_MessageSetCorrectExtension2_messageSetExtension: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension2 { + get {return getExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension2.Extensions.message_set_extension) ?? ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension2()} + set {setExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension2.Extensions.message_set_extension, value: newValue)} + } + /// Returns true if extension `ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension2.Extensions.message_set_extension` + /// has been explicitly set. + var hasProtobufTestMessages_Proto2_TestAllRequiredTypesProto2_MessageSetCorrectExtension2_messageSetExtension: Bool { + return hasExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension2.Extensions.message_set_extension) + } + /// Clears the value of extension `ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension2.Extensions.message_set_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufTestMessages_Proto2_TestAllRequiredTypesProto2_MessageSetCorrectExtension2_messageSetExtension() { + clearExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension2.Extensions.message_set_extension) + } +} + +extension ProtobufTestMessages_Proto2_TestAllTypesProto2 { + + var ProtobufTestMessages_Proto2_extensionInt32: Int32 { + get {return getExtensionValue(ext: ProtobufTestMessages_Proto2_Extensions_extension_int32) ?? 0} + set {setExtensionValue(ext: ProtobufTestMessages_Proto2_Extensions_extension_int32, value: newValue)} + } + /// Returns true if extension `ProtobufTestMessages_Proto2_Extensions_extension_int32` + /// has been explicitly set. + var hasProtobufTestMessages_Proto2_extensionInt32: Bool { + return hasExtensionValue(ext: ProtobufTestMessages_Proto2_Extensions_extension_int32) + } + /// Clears the value of extension `ProtobufTestMessages_Proto2_Extensions_extension_int32`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufTestMessages_Proto2_extensionInt32() { + clearExtensionValue(ext: ProtobufTestMessages_Proto2_Extensions_extension_int32) + } +} + +extension ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrect { + + var ProtobufTestMessages_Proto2_TestAllTypesProto2_MessageSetCorrectExtension1_messageSetExtension: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension1 { + get {return getExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension1.Extensions.message_set_extension) ?? ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension1()} + set {setExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension1.Extensions.message_set_extension, value: newValue)} + } + /// Returns true if extension `ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension1.Extensions.message_set_extension` + /// has been explicitly set. + var hasProtobufTestMessages_Proto2_TestAllTypesProto2_MessageSetCorrectExtension1_messageSetExtension: Bool { + return hasExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension1.Extensions.message_set_extension) + } + /// Clears the value of extension `ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension1.Extensions.message_set_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufTestMessages_Proto2_TestAllTypesProto2_MessageSetCorrectExtension1_messageSetExtension() { + clearExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension1.Extensions.message_set_extension) + } + + var ProtobufTestMessages_Proto2_TestAllTypesProto2_MessageSetCorrectExtension2_messageSetExtension: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension2 { + get {return getExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension2.Extensions.message_set_extension) ?? ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension2()} + set {setExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension2.Extensions.message_set_extension, value: newValue)} + } + /// Returns true if extension `ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension2.Extensions.message_set_extension` + /// has been explicitly set. + var hasProtobufTestMessages_Proto2_TestAllTypesProto2_MessageSetCorrectExtension2_messageSetExtension: Bool { + return hasExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension2.Extensions.message_set_extension) + } + /// Clears the value of extension `ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension2.Extensions.message_set_extension`. + /// Subsequent reads from it will return its default value. + mutating func clearProtobufTestMessages_Proto2_TestAllTypesProto2_MessageSetCorrectExtension2_messageSetExtension() { + clearExtensionValue(ext: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension2.Extensions.message_set_extension) + } + +} + +// MARK: - File's ExtensionMap: ProtobufTestMessages_Proto2_TestMessagesProto2_Extensions + +/// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by +/// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed +/// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create +/// a larger `SwiftProtobuf.SimpleExtensionMap`. +let ProtobufTestMessages_Proto2_TestMessagesProto2_Extensions: SwiftProtobuf.SimpleExtensionMap = [ + ProtobufTestMessages_Proto2_Extensions_extension_int32, + ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension1.Extensions.message_set_extension, + ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension2.Extensions.message_set_extension, + ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension1.Extensions.message_set_extension, + ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension2.Extensions.message_set_extension +] + +// Extension Objects - The only reason these might be needed is when manually +// constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_ +// accessors for the extension fields on the messages directly. + +let ProtobufTestMessages_Proto2_Extensions_extension_int32 = SwiftProtobuf.MessageExtension, ProtobufTestMessages_Proto2_TestAllTypesProto2>( + _protobuf_fieldNumber: 120, + fieldName: "protobuf_test_messages.proto2.extension_int32" +) + +extension ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension1 { + enum Extensions { + static let message_set_extension = SwiftProtobuf.MessageExtension, ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrect>( + _protobuf_fieldNumber: 1547769, + fieldName: "protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension1" + ) + } +} + +extension ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension2 { + enum Extensions { + static let message_set_extension = SwiftProtobuf.MessageExtension, ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrect>( + _protobuf_fieldNumber: 4135312, + fieldName: "protobuf_test_messages.proto2.TestAllTypesProto2.MessageSetCorrectExtension2" + ) + } +} + +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension1 { + enum Extensions { + static let message_set_extension = SwiftProtobuf.MessageExtension, ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrect>( + _protobuf_fieldNumber: 1547769, + fieldName: "protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrectExtension1" + ) + } +} + +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension2 { + enum Extensions { + static let message_set_extension = SwiftProtobuf.MessageExtension, ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrect>( + _protobuf_fieldNumber: 4135312, + fieldName: "protobuf_test_messages.proto2.TestAllRequiredTypesProto2.MessageSetCorrectExtension2" + ) + } +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_test_messages.proto2" + +extension ProtobufTestMessages_Proto2_ForeignEnumProto2: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FOREIGN_FOO"), + 1: .same(proto: "FOREIGN_BAR"), + 2: .same(proto: "FOREIGN_BAZ"), + ] +} + +extension ProtobufTestMessages_Proto2_TestAllTypesProto2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestAllTypesProto2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_int32"), + 2: .standard(proto: "optional_int64"), + 3: .standard(proto: "optional_uint32"), + 4: .standard(proto: "optional_uint64"), + 5: .standard(proto: "optional_sint32"), + 6: .standard(proto: "optional_sint64"), + 7: .standard(proto: "optional_fixed32"), + 8: .standard(proto: "optional_fixed64"), + 9: .standard(proto: "optional_sfixed32"), + 10: .standard(proto: "optional_sfixed64"), + 11: .standard(proto: "optional_float"), + 12: .standard(proto: "optional_double"), + 13: .standard(proto: "optional_bool"), + 14: .standard(proto: "optional_string"), + 15: .standard(proto: "optional_bytes"), + 18: .standard(proto: "optional_nested_message"), + 19: .standard(proto: "optional_foreign_message"), + 21: .standard(proto: "optional_nested_enum"), + 22: .standard(proto: "optional_foreign_enum"), + 24: .standard(proto: "optional_string_piece"), + 25: .standard(proto: "optional_cord"), + 27: .standard(proto: "recursive_message"), + 31: .standard(proto: "repeated_int32"), + 32: .standard(proto: "repeated_int64"), + 33: .standard(proto: "repeated_uint32"), + 34: .standard(proto: "repeated_uint64"), + 35: .standard(proto: "repeated_sint32"), + 36: .standard(proto: "repeated_sint64"), + 37: .standard(proto: "repeated_fixed32"), + 38: .standard(proto: "repeated_fixed64"), + 39: .standard(proto: "repeated_sfixed32"), + 40: .standard(proto: "repeated_sfixed64"), + 41: .standard(proto: "repeated_float"), + 42: .standard(proto: "repeated_double"), + 43: .standard(proto: "repeated_bool"), + 44: .standard(proto: "repeated_string"), + 45: .standard(proto: "repeated_bytes"), + 48: .standard(proto: "repeated_nested_message"), + 49: .standard(proto: "repeated_foreign_message"), + 51: .standard(proto: "repeated_nested_enum"), + 52: .standard(proto: "repeated_foreign_enum"), + 54: .standard(proto: "repeated_string_piece"), + 55: .standard(proto: "repeated_cord"), + 75: .standard(proto: "packed_int32"), + 76: .standard(proto: "packed_int64"), + 77: .standard(proto: "packed_uint32"), + 78: .standard(proto: "packed_uint64"), + 79: .standard(proto: "packed_sint32"), + 80: .standard(proto: "packed_sint64"), + 81: .standard(proto: "packed_fixed32"), + 82: .standard(proto: "packed_fixed64"), + 83: .standard(proto: "packed_sfixed32"), + 84: .standard(proto: "packed_sfixed64"), + 85: .standard(proto: "packed_float"), + 86: .standard(proto: "packed_double"), + 87: .standard(proto: "packed_bool"), + 88: .standard(proto: "packed_nested_enum"), + 89: .standard(proto: "unpacked_int32"), + 90: .standard(proto: "unpacked_int64"), + 91: .standard(proto: "unpacked_uint32"), + 92: .standard(proto: "unpacked_uint64"), + 93: .standard(proto: "unpacked_sint32"), + 94: .standard(proto: "unpacked_sint64"), + 95: .standard(proto: "unpacked_fixed32"), + 96: .standard(proto: "unpacked_fixed64"), + 97: .standard(proto: "unpacked_sfixed32"), + 98: .standard(proto: "unpacked_sfixed64"), + 99: .standard(proto: "unpacked_float"), + 100: .standard(proto: "unpacked_double"), + 101: .standard(proto: "unpacked_bool"), + 102: .standard(proto: "unpacked_nested_enum"), + 56: .standard(proto: "map_int32_int32"), + 57: .standard(proto: "map_int64_int64"), + 58: .standard(proto: "map_uint32_uint32"), + 59: .standard(proto: "map_uint64_uint64"), + 60: .standard(proto: "map_sint32_sint32"), + 61: .standard(proto: "map_sint64_sint64"), + 62: .standard(proto: "map_fixed32_fixed32"), + 63: .standard(proto: "map_fixed64_fixed64"), + 64: .standard(proto: "map_sfixed32_sfixed32"), + 65: .standard(proto: "map_sfixed64_sfixed64"), + 66: .standard(proto: "map_int32_float"), + 67: .standard(proto: "map_int32_double"), + 68: .standard(proto: "map_bool_bool"), + 69: .standard(proto: "map_string_string"), + 70: .standard(proto: "map_string_bytes"), + 71: .standard(proto: "map_string_nested_message"), + 72: .standard(proto: "map_string_foreign_message"), + 73: .standard(proto: "map_string_nested_enum"), + 74: .standard(proto: "map_string_foreign_enum"), + 111: .standard(proto: "oneof_uint32"), + 112: .standard(proto: "oneof_nested_message"), + 113: .standard(proto: "oneof_string"), + 114: .standard(proto: "oneof_bytes"), + 115: .standard(proto: "oneof_bool"), + 116: .standard(proto: "oneof_uint64"), + 117: .standard(proto: "oneof_float"), + 118: .standard(proto: "oneof_double"), + 119: .standard(proto: "oneof_enum"), + 201: .unique(proto: "Data", json: "data"), + 241: .standard(proto: "default_int32"), + 242: .standard(proto: "default_int64"), + 243: .standard(proto: "default_uint32"), + 244: .standard(proto: "default_uint64"), + 245: .standard(proto: "default_sint32"), + 246: .standard(proto: "default_sint64"), + 247: .standard(proto: "default_fixed32"), + 248: .standard(proto: "default_fixed64"), + 249: .standard(proto: "default_sfixed32"), + 250: .standard(proto: "default_sfixed64"), + 251: .standard(proto: "default_float"), + 252: .standard(proto: "default_double"), + 253: .standard(proto: "default_bool"), + 254: .standard(proto: "default_string"), + 255: .standard(proto: "default_bytes"), + 401: .same(proto: "fieldname1"), + 402: .standard(proto: "field_name2"), + 403: .standard(proto: "_field_name3"), + 404: .standard(proto: "field__name4_"), + 405: .same(proto: "field0name5"), + 406: .standard(proto: "field_0_name6"), + 407: .same(proto: "fieldName7"), + 408: .same(proto: "FieldName8"), + 409: .standard(proto: "field_Name9"), + 410: .standard(proto: "Field_Name10"), + 411: .standard(proto: "FIELD_NAME11"), + 412: .standard(proto: "FIELD_name12"), + 413: .standard(proto: "__field_name13"), + 414: .standard(proto: "__Field_name14"), + 415: .standard(proto: "field__name15"), + 416: .standard(proto: "field__Name16"), + 417: .standard(proto: "field_name17__"), + 418: .standard(proto: "Field_name18__"), + ] + + fileprivate class _StorageClass { + var _optionalInt32: Int32? = nil + var _optionalInt64: Int64? = nil + var _optionalUint32: UInt32? = nil + var _optionalUint64: UInt64? = nil + var _optionalSint32: Int32? = nil + var _optionalSint64: Int64? = nil + var _optionalFixed32: UInt32? = nil + var _optionalFixed64: UInt64? = nil + var _optionalSfixed32: Int32? = nil + var _optionalSfixed64: Int64? = nil + var _optionalFloat: Float? = nil + var _optionalDouble: Double? = nil + var _optionalBool: Bool? = nil + var _optionalString: String? = nil + var _optionalBytes: Data? = nil + var _optionalNestedMessage: ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedMessage? = nil + var _optionalForeignMessage: ProtobufTestMessages_Proto2_ForeignMessageProto2? = nil + var _optionalNestedEnum: ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedEnum? = nil + var _optionalForeignEnum: ProtobufTestMessages_Proto2_ForeignEnumProto2? = nil + var _optionalStringPiece: String? = nil + var _optionalCord: String? = nil + var _recursiveMessage: ProtobufTestMessages_Proto2_TestAllTypesProto2? = nil + var _repeatedInt32: [Int32] = [] + var _repeatedInt64: [Int64] = [] + var _repeatedUint32: [UInt32] = [] + var _repeatedUint64: [UInt64] = [] + var _repeatedSint32: [Int32] = [] + var _repeatedSint64: [Int64] = [] + var _repeatedFixed32: [UInt32] = [] + var _repeatedFixed64: [UInt64] = [] + var _repeatedSfixed32: [Int32] = [] + var _repeatedSfixed64: [Int64] = [] + var _repeatedFloat: [Float] = [] + var _repeatedDouble: [Double] = [] + var _repeatedBool: [Bool] = [] + var _repeatedString: [String] = [] + var _repeatedBytes: [Data] = [] + var _repeatedNestedMessage: [ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedMessage] = [] + var _repeatedForeignMessage: [ProtobufTestMessages_Proto2_ForeignMessageProto2] = [] + var _repeatedNestedEnum: [ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedEnum] = [] + var _repeatedForeignEnum: [ProtobufTestMessages_Proto2_ForeignEnumProto2] = [] + var _repeatedStringPiece: [String] = [] + var _repeatedCord: [String] = [] + var _packedInt32: [Int32] = [] + var _packedInt64: [Int64] = [] + var _packedUint32: [UInt32] = [] + var _packedUint64: [UInt64] = [] + var _packedSint32: [Int32] = [] + var _packedSint64: [Int64] = [] + var _packedFixed32: [UInt32] = [] + var _packedFixed64: [UInt64] = [] + var _packedSfixed32: [Int32] = [] + var _packedSfixed64: [Int64] = [] + var _packedFloat: [Float] = [] + var _packedDouble: [Double] = [] + var _packedBool: [Bool] = [] + var _packedNestedEnum: [ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedEnum] = [] + var _unpackedInt32: [Int32] = [] + var _unpackedInt64: [Int64] = [] + var _unpackedUint32: [UInt32] = [] + var _unpackedUint64: [UInt64] = [] + var _unpackedSint32: [Int32] = [] + var _unpackedSint64: [Int64] = [] + var _unpackedFixed32: [UInt32] = [] + var _unpackedFixed64: [UInt64] = [] + var _unpackedSfixed32: [Int32] = [] + var _unpackedSfixed64: [Int64] = [] + var _unpackedFloat: [Float] = [] + var _unpackedDouble: [Double] = [] + var _unpackedBool: [Bool] = [] + var _unpackedNestedEnum: [ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedEnum] = [] + var _mapInt32Int32: Dictionary = [:] + var _mapInt64Int64: Dictionary = [:] + var _mapUint32Uint32: Dictionary = [:] + var _mapUint64Uint64: Dictionary = [:] + var _mapSint32Sint32: Dictionary = [:] + var _mapSint64Sint64: Dictionary = [:] + var _mapFixed32Fixed32: Dictionary = [:] + var _mapFixed64Fixed64: Dictionary = [:] + var _mapSfixed32Sfixed32: Dictionary = [:] + var _mapSfixed64Sfixed64: Dictionary = [:] + var _mapInt32Float: Dictionary = [:] + var _mapInt32Double: Dictionary = [:] + var _mapBoolBool: Dictionary = [:] + var _mapStringString: Dictionary = [:] + var _mapStringBytes: Dictionary = [:] + var _mapStringNestedMessage: Dictionary = [:] + var _mapStringForeignMessage: Dictionary = [:] + var _mapStringNestedEnum: Dictionary = [:] + var _mapStringForeignEnum: Dictionary = [:] + var _oneofField: ProtobufTestMessages_Proto2_TestAllTypesProto2.OneOf_OneofField? + var _data: ProtobufTestMessages_Proto2_TestAllTypesProto2.DataMessage? = nil + var _defaultInt32: Int32? = nil + var _defaultInt64: Int64? = nil + var _defaultUint32: UInt32? = nil + var _defaultUint64: UInt64? = nil + var _defaultSint32: Int32? = nil + var _defaultSint64: Int64? = nil + var _defaultFixed32: UInt32? = nil + var _defaultFixed64: UInt64? = nil + var _defaultSfixed32: Int32? = nil + var _defaultSfixed64: Int64? = nil + var _defaultFloat: Float? = nil + var _defaultDouble: Double? = nil + var _defaultBool: Bool? = nil + var _defaultString: String? = nil + var _defaultBytes: Data? = nil + var _fieldname1: Int32? = nil + var _fieldName2: Int32? = nil + var _fieldName3: Int32? = nil + var _field_Name4_: Int32? = nil + var _field0Name5: Int32? = nil + var _field0Name6: Int32? = nil + var _fieldName7: Int32? = nil + var _fieldName8: Int32? = nil + var _fieldName9: Int32? = nil + var _fieldName10: Int32? = nil + var _fieldName11: Int32? = nil + var _fieldName12: Int32? = nil + var __FieldName13: Int32? = nil + var __FieldName14: Int32? = nil + var _field_Name15: Int32? = nil + var _field_Name16: Int32? = nil + var _fieldName17__: Int32? = nil + var _fieldName18__: Int32? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _optionalInt32 = source._optionalInt32 + _optionalInt64 = source._optionalInt64 + _optionalUint32 = source._optionalUint32 + _optionalUint64 = source._optionalUint64 + _optionalSint32 = source._optionalSint32 + _optionalSint64 = source._optionalSint64 + _optionalFixed32 = source._optionalFixed32 + _optionalFixed64 = source._optionalFixed64 + _optionalSfixed32 = source._optionalSfixed32 + _optionalSfixed64 = source._optionalSfixed64 + _optionalFloat = source._optionalFloat + _optionalDouble = source._optionalDouble + _optionalBool = source._optionalBool + _optionalString = source._optionalString + _optionalBytes = source._optionalBytes + _optionalNestedMessage = source._optionalNestedMessage + _optionalForeignMessage = source._optionalForeignMessage + _optionalNestedEnum = source._optionalNestedEnum + _optionalForeignEnum = source._optionalForeignEnum + _optionalStringPiece = source._optionalStringPiece + _optionalCord = source._optionalCord + _recursiveMessage = source._recursiveMessage + _repeatedInt32 = source._repeatedInt32 + _repeatedInt64 = source._repeatedInt64 + _repeatedUint32 = source._repeatedUint32 + _repeatedUint64 = source._repeatedUint64 + _repeatedSint32 = source._repeatedSint32 + _repeatedSint64 = source._repeatedSint64 + _repeatedFixed32 = source._repeatedFixed32 + _repeatedFixed64 = source._repeatedFixed64 + _repeatedSfixed32 = source._repeatedSfixed32 + _repeatedSfixed64 = source._repeatedSfixed64 + _repeatedFloat = source._repeatedFloat + _repeatedDouble = source._repeatedDouble + _repeatedBool = source._repeatedBool + _repeatedString = source._repeatedString + _repeatedBytes = source._repeatedBytes + _repeatedNestedMessage = source._repeatedNestedMessage + _repeatedForeignMessage = source._repeatedForeignMessage + _repeatedNestedEnum = source._repeatedNestedEnum + _repeatedForeignEnum = source._repeatedForeignEnum + _repeatedStringPiece = source._repeatedStringPiece + _repeatedCord = source._repeatedCord + _packedInt32 = source._packedInt32 + _packedInt64 = source._packedInt64 + _packedUint32 = source._packedUint32 + _packedUint64 = source._packedUint64 + _packedSint32 = source._packedSint32 + _packedSint64 = source._packedSint64 + _packedFixed32 = source._packedFixed32 + _packedFixed64 = source._packedFixed64 + _packedSfixed32 = source._packedSfixed32 + _packedSfixed64 = source._packedSfixed64 + _packedFloat = source._packedFloat + _packedDouble = source._packedDouble + _packedBool = source._packedBool + _packedNestedEnum = source._packedNestedEnum + _unpackedInt32 = source._unpackedInt32 + _unpackedInt64 = source._unpackedInt64 + _unpackedUint32 = source._unpackedUint32 + _unpackedUint64 = source._unpackedUint64 + _unpackedSint32 = source._unpackedSint32 + _unpackedSint64 = source._unpackedSint64 + _unpackedFixed32 = source._unpackedFixed32 + _unpackedFixed64 = source._unpackedFixed64 + _unpackedSfixed32 = source._unpackedSfixed32 + _unpackedSfixed64 = source._unpackedSfixed64 + _unpackedFloat = source._unpackedFloat + _unpackedDouble = source._unpackedDouble + _unpackedBool = source._unpackedBool + _unpackedNestedEnum = source._unpackedNestedEnum + _mapInt32Int32 = source._mapInt32Int32 + _mapInt64Int64 = source._mapInt64Int64 + _mapUint32Uint32 = source._mapUint32Uint32 + _mapUint64Uint64 = source._mapUint64Uint64 + _mapSint32Sint32 = source._mapSint32Sint32 + _mapSint64Sint64 = source._mapSint64Sint64 + _mapFixed32Fixed32 = source._mapFixed32Fixed32 + _mapFixed64Fixed64 = source._mapFixed64Fixed64 + _mapSfixed32Sfixed32 = source._mapSfixed32Sfixed32 + _mapSfixed64Sfixed64 = source._mapSfixed64Sfixed64 + _mapInt32Float = source._mapInt32Float + _mapInt32Double = source._mapInt32Double + _mapBoolBool = source._mapBoolBool + _mapStringString = source._mapStringString + _mapStringBytes = source._mapStringBytes + _mapStringNestedMessage = source._mapStringNestedMessage + _mapStringForeignMessage = source._mapStringForeignMessage + _mapStringNestedEnum = source._mapStringNestedEnum + _mapStringForeignEnum = source._mapStringForeignEnum + _oneofField = source._oneofField + _data = source._data + _defaultInt32 = source._defaultInt32 + _defaultInt64 = source._defaultInt64 + _defaultUint32 = source._defaultUint32 + _defaultUint64 = source._defaultUint64 + _defaultSint32 = source._defaultSint32 + _defaultSint64 = source._defaultSint64 + _defaultFixed32 = source._defaultFixed32 + _defaultFixed64 = source._defaultFixed64 + _defaultSfixed32 = source._defaultSfixed32 + _defaultSfixed64 = source._defaultSfixed64 + _defaultFloat = source._defaultFloat + _defaultDouble = source._defaultDouble + _defaultBool = source._defaultBool + _defaultString = source._defaultString + _defaultBytes = source._defaultBytes + _fieldname1 = source._fieldname1 + _fieldName2 = source._fieldName2 + _fieldName3 = source._fieldName3 + _field_Name4_ = source._field_Name4_ + _field0Name5 = source._field0Name5 + _field0Name6 = source._field0Name6 + _fieldName7 = source._fieldName7 + _fieldName8 = source._fieldName8 + _fieldName9 = source._fieldName9 + _fieldName10 = source._fieldName10 + _fieldName11 = source._fieldName11 + _fieldName12 = source._fieldName12 + __FieldName13 = source.__FieldName13 + __FieldName14 = source.__FieldName14 + _field_Name15 = source._field_Name15 + _field_Name16 = source._field_Name16 + _fieldName17__ = source._fieldName17__ + _fieldName18__ = source._fieldName18__ + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if let v = _storage._optionalNestedMessage, !v.isInitialized {return false} + if let v = _storage._recursiveMessage, !v.isInitialized {return false} + if !SwiftProtobuf.Internal.areAllInitialized(_storage._repeatedNestedMessage) {return false} + if !SwiftProtobuf.Internal.areAllInitialized(_storage._mapStringNestedMessage) {return false} + if let v = _storage._oneofField, !v.isInitialized {return false} + return true + } + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._optionalInt32) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._optionalInt64) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint32) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._optionalUint64) }() + case 5: try { try decoder.decodeSingularSInt32Field(value: &_storage._optionalSint32) }() + case 6: try { try decoder.decodeSingularSInt64Field(value: &_storage._optionalSint64) }() + case 7: try { try decoder.decodeSingularFixed32Field(value: &_storage._optionalFixed32) }() + case 8: try { try decoder.decodeSingularFixed64Field(value: &_storage._optionalFixed64) }() + case 9: try { try decoder.decodeSingularSFixed32Field(value: &_storage._optionalSfixed32) }() + case 10: try { try decoder.decodeSingularSFixed64Field(value: &_storage._optionalSfixed64) }() + case 11: try { try decoder.decodeSingularFloatField(value: &_storage._optionalFloat) }() + case 12: try { try decoder.decodeSingularDoubleField(value: &_storage._optionalDouble) }() + case 13: try { try decoder.decodeSingularBoolField(value: &_storage._optionalBool) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._optionalString) }() + case 15: try { try decoder.decodeSingularBytesField(value: &_storage._optionalBytes) }() + case 18: try { try decoder.decodeSingularMessageField(value: &_storage._optionalNestedMessage) }() + case 19: try { try decoder.decodeSingularMessageField(value: &_storage._optionalForeignMessage) }() + case 21: try { try decoder.decodeSingularEnumField(value: &_storage._optionalNestedEnum) }() + case 22: try { try decoder.decodeSingularEnumField(value: &_storage._optionalForeignEnum) }() + case 24: try { try decoder.decodeSingularStringField(value: &_storage._optionalStringPiece) }() + case 25: try { try decoder.decodeSingularStringField(value: &_storage._optionalCord) }() + case 27: try { try decoder.decodeSingularMessageField(value: &_storage._recursiveMessage) }() + case 31: try { try decoder.decodeRepeatedInt32Field(value: &_storage._repeatedInt32) }() + case 32: try { try decoder.decodeRepeatedInt64Field(value: &_storage._repeatedInt64) }() + case 33: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._repeatedUint32) }() + case 34: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._repeatedUint64) }() + case 35: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._repeatedSint32) }() + case 36: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._repeatedSint64) }() + case 37: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._repeatedFixed32) }() + case 38: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._repeatedFixed64) }() + case 39: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._repeatedSfixed32) }() + case 40: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._repeatedSfixed64) }() + case 41: try { try decoder.decodeRepeatedFloatField(value: &_storage._repeatedFloat) }() + case 42: try { try decoder.decodeRepeatedDoubleField(value: &_storage._repeatedDouble) }() + case 43: try { try decoder.decodeRepeatedBoolField(value: &_storage._repeatedBool) }() + case 44: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedString) }() + case 45: try { try decoder.decodeRepeatedBytesField(value: &_storage._repeatedBytes) }() + case 48: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedNestedMessage) }() + case 49: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedForeignMessage) }() + case 51: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedNestedEnum) }() + case 52: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedForeignEnum) }() + case 54: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedStringPiece) }() + case 55: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedCord) }() + case 56: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Int32) }() + case 57: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt64Int64) }() + case 58: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapUint32Uint32) }() + case 59: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapUint64Uint64) }() + case 60: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSint32Sint32) }() + case 61: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSint64Sint64) }() + case 62: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapFixed32Fixed32) }() + case 63: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapFixed64Fixed64) }() + case 64: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSfixed32Sfixed32) }() + case 65: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSfixed64Sfixed64) }() + case 66: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Float) }() + case 67: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Double) }() + case 68: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapBoolBool) }() + case 69: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapStringString) }() + case 70: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapStringBytes) }() + case 71: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._mapStringNestedMessage) }() + case 72: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._mapStringForeignMessage) }() + case 73: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &_storage._mapStringNestedEnum) }() + case 74: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &_storage._mapStringForeignEnum) }() + case 75: try { try decoder.decodeRepeatedInt32Field(value: &_storage._packedInt32) }() + case 76: try { try decoder.decodeRepeatedInt64Field(value: &_storage._packedInt64) }() + case 77: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._packedUint32) }() + case 78: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._packedUint64) }() + case 79: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._packedSint32) }() + case 80: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._packedSint64) }() + case 81: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._packedFixed32) }() + case 82: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._packedFixed64) }() + case 83: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._packedSfixed32) }() + case 84: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._packedSfixed64) }() + case 85: try { try decoder.decodeRepeatedFloatField(value: &_storage._packedFloat) }() + case 86: try { try decoder.decodeRepeatedDoubleField(value: &_storage._packedDouble) }() + case 87: try { try decoder.decodeRepeatedBoolField(value: &_storage._packedBool) }() + case 88: try { try decoder.decodeRepeatedEnumField(value: &_storage._packedNestedEnum) }() + case 89: try { try decoder.decodeRepeatedInt32Field(value: &_storage._unpackedInt32) }() + case 90: try { try decoder.decodeRepeatedInt64Field(value: &_storage._unpackedInt64) }() + case 91: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._unpackedUint32) }() + case 92: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._unpackedUint64) }() + case 93: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._unpackedSint32) }() + case 94: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._unpackedSint64) }() + case 95: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._unpackedFixed32) }() + case 96: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._unpackedFixed64) }() + case 97: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._unpackedSfixed32) }() + case 98: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._unpackedSfixed64) }() + case 99: try { try decoder.decodeRepeatedFloatField(value: &_storage._unpackedFloat) }() + case 100: try { try decoder.decodeRepeatedDoubleField(value: &_storage._unpackedDouble) }() + case 101: try { try decoder.decodeRepeatedBoolField(value: &_storage._unpackedBool) }() + case 102: try { try decoder.decodeRepeatedEnumField(value: &_storage._unpackedNestedEnum) }() + case 111: try { + var v: UInt32? + try decoder.decodeSingularUInt32Field(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofUint32(v) + } + }() + case 112: try { + var v: ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedMessage? + var hadOneofValue = false + if let current = _storage._oneofField { + hadOneofValue = true + if case .oneofNestedMessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofNestedMessage(v) + } + }() + case 113: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofString(v) + } + }() + case 114: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofBytes(v) + } + }() + case 115: try { + var v: Bool? + try decoder.decodeSingularBoolField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofBool(v) + } + }() + case 116: try { + var v: UInt64? + try decoder.decodeSingularUInt64Field(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofUint64(v) + } + }() + case 117: try { + var v: Float? + try decoder.decodeSingularFloatField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofFloat(v) + } + }() + case 118: try { + var v: Double? + try decoder.decodeSingularDoubleField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofDouble(v) + } + }() + case 119: try { + var v: ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedEnum? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofEnum(v) + } + }() + case 201: try { try decoder.decodeSingularGroupField(value: &_storage._data) }() + case 241: try { try decoder.decodeSingularInt32Field(value: &_storage._defaultInt32) }() + case 242: try { try decoder.decodeSingularInt64Field(value: &_storage._defaultInt64) }() + case 243: try { try decoder.decodeSingularUInt32Field(value: &_storage._defaultUint32) }() + case 244: try { try decoder.decodeSingularUInt64Field(value: &_storage._defaultUint64) }() + case 245: try { try decoder.decodeSingularSInt32Field(value: &_storage._defaultSint32) }() + case 246: try { try decoder.decodeSingularSInt64Field(value: &_storage._defaultSint64) }() + case 247: try { try decoder.decodeSingularFixed32Field(value: &_storage._defaultFixed32) }() + case 248: try { try decoder.decodeSingularFixed64Field(value: &_storage._defaultFixed64) }() + case 249: try { try decoder.decodeSingularSFixed32Field(value: &_storage._defaultSfixed32) }() + case 250: try { try decoder.decodeSingularSFixed64Field(value: &_storage._defaultSfixed64) }() + case 251: try { try decoder.decodeSingularFloatField(value: &_storage._defaultFloat) }() + case 252: try { try decoder.decodeSingularDoubleField(value: &_storage._defaultDouble) }() + case 253: try { try decoder.decodeSingularBoolField(value: &_storage._defaultBool) }() + case 254: try { try decoder.decodeSingularStringField(value: &_storage._defaultString) }() + case 255: try { try decoder.decodeSingularBytesField(value: &_storage._defaultBytes) }() + case 401: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldname1) }() + case 402: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName2) }() + case 403: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName3) }() + case 404: try { try decoder.decodeSingularInt32Field(value: &_storage._field_Name4_) }() + case 405: try { try decoder.decodeSingularInt32Field(value: &_storage._field0Name5) }() + case 406: try { try decoder.decodeSingularInt32Field(value: &_storage._field0Name6) }() + case 407: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName7) }() + case 408: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName8) }() + case 409: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName9) }() + case 410: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName10) }() + case 411: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName11) }() + case 412: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName12) }() + case 413: try { try decoder.decodeSingularInt32Field(value: &_storage.__FieldName13) }() + case 414: try { try decoder.decodeSingularInt32Field(value: &_storage.__FieldName14) }() + case 415: try { try decoder.decodeSingularInt32Field(value: &_storage._field_Name15) }() + case 416: try { try decoder.decodeSingularInt32Field(value: &_storage._field_Name16) }() + case 417: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName17__) }() + case 418: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName18__) }() + case 120..<201: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufTestMessages_Proto2_TestAllTypesProto2.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._optionalInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._optionalInt64 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._optionalUint32 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._optionalUint64 { + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._optionalSint32 { + try visitor.visitSingularSInt32Field(value: v, fieldNumber: 5) + } }() + try { if let v = _storage._optionalSint64 { + try visitor.visitSingularSInt64Field(value: v, fieldNumber: 6) + } }() + try { if let v = _storage._optionalFixed32 { + try visitor.visitSingularFixed32Field(value: v, fieldNumber: 7) + } }() + try { if let v = _storage._optionalFixed64 { + try visitor.visitSingularFixed64Field(value: v, fieldNumber: 8) + } }() + try { if let v = _storage._optionalSfixed32 { + try visitor.visitSingularSFixed32Field(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._optionalSfixed64 { + try visitor.visitSingularSFixed64Field(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._optionalFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 11) + } }() + try { if let v = _storage._optionalDouble { + try visitor.visitSingularDoubleField(value: v, fieldNumber: 12) + } }() + try { if let v = _storage._optionalBool { + try visitor.visitSingularBoolField(value: v, fieldNumber: 13) + } }() + try { if let v = _storage._optionalString { + try visitor.visitSingularStringField(value: v, fieldNumber: 14) + } }() + try { if let v = _storage._optionalBytes { + try visitor.visitSingularBytesField(value: v, fieldNumber: 15) + } }() + try { if let v = _storage._optionalNestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._optionalForeignMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + } }() + try { if let v = _storage._optionalNestedEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 21) + } }() + try { if let v = _storage._optionalForeignEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 22) + } }() + try { if let v = _storage._optionalStringPiece { + try visitor.visitSingularStringField(value: v, fieldNumber: 24) + } }() + try { if let v = _storage._optionalCord { + try visitor.visitSingularStringField(value: v, fieldNumber: 25) + } }() + try { if let v = _storage._recursiveMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 27) + } }() + if !_storage._repeatedInt32.isEmpty { + try visitor.visitRepeatedInt32Field(value: _storage._repeatedInt32, fieldNumber: 31) + } + if !_storage._repeatedInt64.isEmpty { + try visitor.visitRepeatedInt64Field(value: _storage._repeatedInt64, fieldNumber: 32) + } + if !_storage._repeatedUint32.isEmpty { + try visitor.visitRepeatedUInt32Field(value: _storage._repeatedUint32, fieldNumber: 33) + } + if !_storage._repeatedUint64.isEmpty { + try visitor.visitRepeatedUInt64Field(value: _storage._repeatedUint64, fieldNumber: 34) + } + if !_storage._repeatedSint32.isEmpty { + try visitor.visitRepeatedSInt32Field(value: _storage._repeatedSint32, fieldNumber: 35) + } + if !_storage._repeatedSint64.isEmpty { + try visitor.visitRepeatedSInt64Field(value: _storage._repeatedSint64, fieldNumber: 36) + } + if !_storage._repeatedFixed32.isEmpty { + try visitor.visitRepeatedFixed32Field(value: _storage._repeatedFixed32, fieldNumber: 37) + } + if !_storage._repeatedFixed64.isEmpty { + try visitor.visitRepeatedFixed64Field(value: _storage._repeatedFixed64, fieldNumber: 38) + } + if !_storage._repeatedSfixed32.isEmpty { + try visitor.visitRepeatedSFixed32Field(value: _storage._repeatedSfixed32, fieldNumber: 39) + } + if !_storage._repeatedSfixed64.isEmpty { + try visitor.visitRepeatedSFixed64Field(value: _storage._repeatedSfixed64, fieldNumber: 40) + } + if !_storage._repeatedFloat.isEmpty { + try visitor.visitRepeatedFloatField(value: _storage._repeatedFloat, fieldNumber: 41) + } + if !_storage._repeatedDouble.isEmpty { + try visitor.visitRepeatedDoubleField(value: _storage._repeatedDouble, fieldNumber: 42) + } + if !_storage._repeatedBool.isEmpty { + try visitor.visitRepeatedBoolField(value: _storage._repeatedBool, fieldNumber: 43) + } + if !_storage._repeatedString.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedString, fieldNumber: 44) + } + if !_storage._repeatedBytes.isEmpty { + try visitor.visitRepeatedBytesField(value: _storage._repeatedBytes, fieldNumber: 45) + } + if !_storage._repeatedNestedMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedNestedMessage, fieldNumber: 48) + } + if !_storage._repeatedForeignMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedForeignMessage, fieldNumber: 49) + } + if !_storage._repeatedNestedEnum.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedNestedEnum, fieldNumber: 51) + } + if !_storage._repeatedForeignEnum.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._repeatedForeignEnum, fieldNumber: 52) + } + if !_storage._repeatedStringPiece.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedStringPiece, fieldNumber: 54) + } + if !_storage._repeatedCord.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedCord, fieldNumber: 55) + } + if !_storage._mapInt32Int32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Int32, fieldNumber: 56) + } + if !_storage._mapInt64Int64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt64Int64, fieldNumber: 57) + } + if !_storage._mapUint32Uint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapUint32Uint32, fieldNumber: 58) + } + if !_storage._mapUint64Uint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapUint64Uint64, fieldNumber: 59) + } + if !_storage._mapSint32Sint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSint32Sint32, fieldNumber: 60) + } + if !_storage._mapSint64Sint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSint64Sint64, fieldNumber: 61) + } + if !_storage._mapFixed32Fixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapFixed32Fixed32, fieldNumber: 62) + } + if !_storage._mapFixed64Fixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapFixed64Fixed64, fieldNumber: 63) + } + if !_storage._mapSfixed32Sfixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSfixed32Sfixed32, fieldNumber: 64) + } + if !_storage._mapSfixed64Sfixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSfixed64Sfixed64, fieldNumber: 65) + } + if !_storage._mapInt32Float.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Float, fieldNumber: 66) + } + if !_storage._mapInt32Double.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Double, fieldNumber: 67) + } + if !_storage._mapBoolBool.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapBoolBool, fieldNumber: 68) + } + if !_storage._mapStringString.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapStringString, fieldNumber: 69) + } + if !_storage._mapStringBytes.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapStringBytes, fieldNumber: 70) + } + if !_storage._mapStringNestedMessage.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._mapStringNestedMessage, fieldNumber: 71) + } + if !_storage._mapStringForeignMessage.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._mapStringForeignMessage, fieldNumber: 72) + } + if !_storage._mapStringNestedEnum.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: _storage._mapStringNestedEnum, fieldNumber: 73) + } + if !_storage._mapStringForeignEnum.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: _storage._mapStringForeignEnum, fieldNumber: 74) + } + if !_storage._packedInt32.isEmpty { + try visitor.visitPackedInt32Field(value: _storage._packedInt32, fieldNumber: 75) + } + if !_storage._packedInt64.isEmpty { + try visitor.visitPackedInt64Field(value: _storage._packedInt64, fieldNumber: 76) + } + if !_storage._packedUint32.isEmpty { + try visitor.visitPackedUInt32Field(value: _storage._packedUint32, fieldNumber: 77) + } + if !_storage._packedUint64.isEmpty { + try visitor.visitPackedUInt64Field(value: _storage._packedUint64, fieldNumber: 78) + } + if !_storage._packedSint32.isEmpty { + try visitor.visitPackedSInt32Field(value: _storage._packedSint32, fieldNumber: 79) + } + if !_storage._packedSint64.isEmpty { + try visitor.visitPackedSInt64Field(value: _storage._packedSint64, fieldNumber: 80) + } + if !_storage._packedFixed32.isEmpty { + try visitor.visitPackedFixed32Field(value: _storage._packedFixed32, fieldNumber: 81) + } + if !_storage._packedFixed64.isEmpty { + try visitor.visitPackedFixed64Field(value: _storage._packedFixed64, fieldNumber: 82) + } + if !_storage._packedSfixed32.isEmpty { + try visitor.visitPackedSFixed32Field(value: _storage._packedSfixed32, fieldNumber: 83) + } + if !_storage._packedSfixed64.isEmpty { + try visitor.visitPackedSFixed64Field(value: _storage._packedSfixed64, fieldNumber: 84) + } + if !_storage._packedFloat.isEmpty { + try visitor.visitPackedFloatField(value: _storage._packedFloat, fieldNumber: 85) + } + if !_storage._packedDouble.isEmpty { + try visitor.visitPackedDoubleField(value: _storage._packedDouble, fieldNumber: 86) + } + if !_storage._packedBool.isEmpty { + try visitor.visitPackedBoolField(value: _storage._packedBool, fieldNumber: 87) + } + if !_storage._packedNestedEnum.isEmpty { + try visitor.visitPackedEnumField(value: _storage._packedNestedEnum, fieldNumber: 88) + } + if !_storage._unpackedInt32.isEmpty { + try visitor.visitRepeatedInt32Field(value: _storage._unpackedInt32, fieldNumber: 89) + } + if !_storage._unpackedInt64.isEmpty { + try visitor.visitRepeatedInt64Field(value: _storage._unpackedInt64, fieldNumber: 90) + } + if !_storage._unpackedUint32.isEmpty { + try visitor.visitRepeatedUInt32Field(value: _storage._unpackedUint32, fieldNumber: 91) + } + if !_storage._unpackedUint64.isEmpty { + try visitor.visitRepeatedUInt64Field(value: _storage._unpackedUint64, fieldNumber: 92) + } + if !_storage._unpackedSint32.isEmpty { + try visitor.visitRepeatedSInt32Field(value: _storage._unpackedSint32, fieldNumber: 93) + } + if !_storage._unpackedSint64.isEmpty { + try visitor.visitRepeatedSInt64Field(value: _storage._unpackedSint64, fieldNumber: 94) + } + if !_storage._unpackedFixed32.isEmpty { + try visitor.visitRepeatedFixed32Field(value: _storage._unpackedFixed32, fieldNumber: 95) + } + if !_storage._unpackedFixed64.isEmpty { + try visitor.visitRepeatedFixed64Field(value: _storage._unpackedFixed64, fieldNumber: 96) + } + if !_storage._unpackedSfixed32.isEmpty { + try visitor.visitRepeatedSFixed32Field(value: _storage._unpackedSfixed32, fieldNumber: 97) + } + if !_storage._unpackedSfixed64.isEmpty { + try visitor.visitRepeatedSFixed64Field(value: _storage._unpackedSfixed64, fieldNumber: 98) + } + if !_storage._unpackedFloat.isEmpty { + try visitor.visitRepeatedFloatField(value: _storage._unpackedFloat, fieldNumber: 99) + } + if !_storage._unpackedDouble.isEmpty { + try visitor.visitRepeatedDoubleField(value: _storage._unpackedDouble, fieldNumber: 100) + } + if !_storage._unpackedBool.isEmpty { + try visitor.visitRepeatedBoolField(value: _storage._unpackedBool, fieldNumber: 101) + } + if !_storage._unpackedNestedEnum.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._unpackedNestedEnum, fieldNumber: 102) + } + switch _storage._oneofField { + case .oneofUint32?: try { + guard case .oneofUint32(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 111) + }() + case .oneofNestedMessage?: try { + guard case .oneofNestedMessage(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 112) + }() + case .oneofString?: try { + guard case .oneofString(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 113) + }() + case .oneofBytes?: try { + guard case .oneofBytes(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 114) + }() + case .oneofBool?: try { + guard case .oneofBool(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularBoolField(value: v, fieldNumber: 115) + }() + case .oneofUint64?: try { + guard case .oneofUint64(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 116) + }() + case .oneofFloat?: try { + guard case .oneofFloat(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularFloatField(value: v, fieldNumber: 117) + }() + case .oneofDouble?: try { + guard case .oneofDouble(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularDoubleField(value: v, fieldNumber: 118) + }() + case .oneofEnum?: try { + guard case .oneofEnum(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 119) + }() + case nil: break + } + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 120, end: 201) + try { if let v = _storage._data { + try visitor.visitSingularGroupField(value: v, fieldNumber: 201) + } }() + try { if let v = _storage._defaultInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 241) + } }() + try { if let v = _storage._defaultInt64 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 242) + } }() + try { if let v = _storage._defaultUint32 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 243) + } }() + try { if let v = _storage._defaultUint64 { + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 244) + } }() + try { if let v = _storage._defaultSint32 { + try visitor.visitSingularSInt32Field(value: v, fieldNumber: 245) + } }() + try { if let v = _storage._defaultSint64 { + try visitor.visitSingularSInt64Field(value: v, fieldNumber: 246) + } }() + try { if let v = _storage._defaultFixed32 { + try visitor.visitSingularFixed32Field(value: v, fieldNumber: 247) + } }() + try { if let v = _storage._defaultFixed64 { + try visitor.visitSingularFixed64Field(value: v, fieldNumber: 248) + } }() + try { if let v = _storage._defaultSfixed32 { + try visitor.visitSingularSFixed32Field(value: v, fieldNumber: 249) + } }() + try { if let v = _storage._defaultSfixed64 { + try visitor.visitSingularSFixed64Field(value: v, fieldNumber: 250) + } }() + try { if let v = _storage._defaultFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 251) + } }() + try { if let v = _storage._defaultDouble { + try visitor.visitSingularDoubleField(value: v, fieldNumber: 252) + } }() + try { if let v = _storage._defaultBool { + try visitor.visitSingularBoolField(value: v, fieldNumber: 253) + } }() + try { if let v = _storage._defaultString { + try visitor.visitSingularStringField(value: v, fieldNumber: 254) + } }() + try { if let v = _storage._defaultBytes { + try visitor.visitSingularBytesField(value: v, fieldNumber: 255) + } }() + try { if let v = _storage._fieldname1 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 401) + } }() + try { if let v = _storage._fieldName2 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 402) + } }() + try { if let v = _storage._fieldName3 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 403) + } }() + try { if let v = _storage._field_Name4_ { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 404) + } }() + try { if let v = _storage._field0Name5 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 405) + } }() + try { if let v = _storage._field0Name6 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 406) + } }() + try { if let v = _storage._fieldName7 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 407) + } }() + try { if let v = _storage._fieldName8 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 408) + } }() + try { if let v = _storage._fieldName9 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 409) + } }() + try { if let v = _storage._fieldName10 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 410) + } }() + try { if let v = _storage._fieldName11 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 411) + } }() + try { if let v = _storage._fieldName12 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 412) + } }() + try { if let v = _storage.__FieldName13 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 413) + } }() + try { if let v = _storage.__FieldName14 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 414) + } }() + try { if let v = _storage._field_Name15 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 415) + } }() + try { if let v = _storage._field_Name16 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 416) + } }() + try { if let v = _storage._fieldName17__ { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 417) + } }() + try { if let v = _storage._fieldName18__ { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 418) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_TestAllTypesProto2, rhs: ProtobufTestMessages_Proto2_TestAllTypesProto2) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._optionalInt32 != rhs_storage._optionalInt32 {return false} + if _storage._optionalInt64 != rhs_storage._optionalInt64 {return false} + if _storage._optionalUint32 != rhs_storage._optionalUint32 {return false} + if _storage._optionalUint64 != rhs_storage._optionalUint64 {return false} + if _storage._optionalSint32 != rhs_storage._optionalSint32 {return false} + if _storage._optionalSint64 != rhs_storage._optionalSint64 {return false} + if _storage._optionalFixed32 != rhs_storage._optionalFixed32 {return false} + if _storage._optionalFixed64 != rhs_storage._optionalFixed64 {return false} + if _storage._optionalSfixed32 != rhs_storage._optionalSfixed32 {return false} + if _storage._optionalSfixed64 != rhs_storage._optionalSfixed64 {return false} + if _storage._optionalFloat != rhs_storage._optionalFloat {return false} + if _storage._optionalDouble != rhs_storage._optionalDouble {return false} + if _storage._optionalBool != rhs_storage._optionalBool {return false} + if _storage._optionalString != rhs_storage._optionalString {return false} + if _storage._optionalBytes != rhs_storage._optionalBytes {return false} + if _storage._optionalNestedMessage != rhs_storage._optionalNestedMessage {return false} + if _storage._optionalForeignMessage != rhs_storage._optionalForeignMessage {return false} + if _storage._optionalNestedEnum != rhs_storage._optionalNestedEnum {return false} + if _storage._optionalForeignEnum != rhs_storage._optionalForeignEnum {return false} + if _storage._optionalStringPiece != rhs_storage._optionalStringPiece {return false} + if _storage._optionalCord != rhs_storage._optionalCord {return false} + if _storage._recursiveMessage != rhs_storage._recursiveMessage {return false} + if _storage._repeatedInt32 != rhs_storage._repeatedInt32 {return false} + if _storage._repeatedInt64 != rhs_storage._repeatedInt64 {return false} + if _storage._repeatedUint32 != rhs_storage._repeatedUint32 {return false} + if _storage._repeatedUint64 != rhs_storage._repeatedUint64 {return false} + if _storage._repeatedSint32 != rhs_storage._repeatedSint32 {return false} + if _storage._repeatedSint64 != rhs_storage._repeatedSint64 {return false} + if _storage._repeatedFixed32 != rhs_storage._repeatedFixed32 {return false} + if _storage._repeatedFixed64 != rhs_storage._repeatedFixed64 {return false} + if _storage._repeatedSfixed32 != rhs_storage._repeatedSfixed32 {return false} + if _storage._repeatedSfixed64 != rhs_storage._repeatedSfixed64 {return false} + if _storage._repeatedFloat != rhs_storage._repeatedFloat {return false} + if _storage._repeatedDouble != rhs_storage._repeatedDouble {return false} + if _storage._repeatedBool != rhs_storage._repeatedBool {return false} + if _storage._repeatedString != rhs_storage._repeatedString {return false} + if _storage._repeatedBytes != rhs_storage._repeatedBytes {return false} + if _storage._repeatedNestedMessage != rhs_storage._repeatedNestedMessage {return false} + if _storage._repeatedForeignMessage != rhs_storage._repeatedForeignMessage {return false} + if _storage._repeatedNestedEnum != rhs_storage._repeatedNestedEnum {return false} + if _storage._repeatedForeignEnum != rhs_storage._repeatedForeignEnum {return false} + if _storage._repeatedStringPiece != rhs_storage._repeatedStringPiece {return false} + if _storage._repeatedCord != rhs_storage._repeatedCord {return false} + if _storage._packedInt32 != rhs_storage._packedInt32 {return false} + if _storage._packedInt64 != rhs_storage._packedInt64 {return false} + if _storage._packedUint32 != rhs_storage._packedUint32 {return false} + if _storage._packedUint64 != rhs_storage._packedUint64 {return false} + if _storage._packedSint32 != rhs_storage._packedSint32 {return false} + if _storage._packedSint64 != rhs_storage._packedSint64 {return false} + if _storage._packedFixed32 != rhs_storage._packedFixed32 {return false} + if _storage._packedFixed64 != rhs_storage._packedFixed64 {return false} + if _storage._packedSfixed32 != rhs_storage._packedSfixed32 {return false} + if _storage._packedSfixed64 != rhs_storage._packedSfixed64 {return false} + if _storage._packedFloat != rhs_storage._packedFloat {return false} + if _storage._packedDouble != rhs_storage._packedDouble {return false} + if _storage._packedBool != rhs_storage._packedBool {return false} + if _storage._packedNestedEnum != rhs_storage._packedNestedEnum {return false} + if _storage._unpackedInt32 != rhs_storage._unpackedInt32 {return false} + if _storage._unpackedInt64 != rhs_storage._unpackedInt64 {return false} + if _storage._unpackedUint32 != rhs_storage._unpackedUint32 {return false} + if _storage._unpackedUint64 != rhs_storage._unpackedUint64 {return false} + if _storage._unpackedSint32 != rhs_storage._unpackedSint32 {return false} + if _storage._unpackedSint64 != rhs_storage._unpackedSint64 {return false} + if _storage._unpackedFixed32 != rhs_storage._unpackedFixed32 {return false} + if _storage._unpackedFixed64 != rhs_storage._unpackedFixed64 {return false} + if _storage._unpackedSfixed32 != rhs_storage._unpackedSfixed32 {return false} + if _storage._unpackedSfixed64 != rhs_storage._unpackedSfixed64 {return false} + if _storage._unpackedFloat != rhs_storage._unpackedFloat {return false} + if _storage._unpackedDouble != rhs_storage._unpackedDouble {return false} + if _storage._unpackedBool != rhs_storage._unpackedBool {return false} + if _storage._unpackedNestedEnum != rhs_storage._unpackedNestedEnum {return false} + if _storage._mapInt32Int32 != rhs_storage._mapInt32Int32 {return false} + if _storage._mapInt64Int64 != rhs_storage._mapInt64Int64 {return false} + if _storage._mapUint32Uint32 != rhs_storage._mapUint32Uint32 {return false} + if _storage._mapUint64Uint64 != rhs_storage._mapUint64Uint64 {return false} + if _storage._mapSint32Sint32 != rhs_storage._mapSint32Sint32 {return false} + if _storage._mapSint64Sint64 != rhs_storage._mapSint64Sint64 {return false} + if _storage._mapFixed32Fixed32 != rhs_storage._mapFixed32Fixed32 {return false} + if _storage._mapFixed64Fixed64 != rhs_storage._mapFixed64Fixed64 {return false} + if _storage._mapSfixed32Sfixed32 != rhs_storage._mapSfixed32Sfixed32 {return false} + if _storage._mapSfixed64Sfixed64 != rhs_storage._mapSfixed64Sfixed64 {return false} + if _storage._mapInt32Float != rhs_storage._mapInt32Float {return false} + if _storage._mapInt32Double != rhs_storage._mapInt32Double {return false} + if _storage._mapBoolBool != rhs_storage._mapBoolBool {return false} + if _storage._mapStringString != rhs_storage._mapStringString {return false} + if _storage._mapStringBytes != rhs_storage._mapStringBytes {return false} + if _storage._mapStringNestedMessage != rhs_storage._mapStringNestedMessage {return false} + if _storage._mapStringForeignMessage != rhs_storage._mapStringForeignMessage {return false} + if _storage._mapStringNestedEnum != rhs_storage._mapStringNestedEnum {return false} + if _storage._mapStringForeignEnum != rhs_storage._mapStringForeignEnum {return false} + if _storage._oneofField != rhs_storage._oneofField {return false} + if _storage._data != rhs_storage._data {return false} + if _storage._defaultInt32 != rhs_storage._defaultInt32 {return false} + if _storage._defaultInt64 != rhs_storage._defaultInt64 {return false} + if _storage._defaultUint32 != rhs_storage._defaultUint32 {return false} + if _storage._defaultUint64 != rhs_storage._defaultUint64 {return false} + if _storage._defaultSint32 != rhs_storage._defaultSint32 {return false} + if _storage._defaultSint64 != rhs_storage._defaultSint64 {return false} + if _storage._defaultFixed32 != rhs_storage._defaultFixed32 {return false} + if _storage._defaultFixed64 != rhs_storage._defaultFixed64 {return false} + if _storage._defaultSfixed32 != rhs_storage._defaultSfixed32 {return false} + if _storage._defaultSfixed64 != rhs_storage._defaultSfixed64 {return false} + if _storage._defaultFloat != rhs_storage._defaultFloat {return false} + if _storage._defaultDouble != rhs_storage._defaultDouble {return false} + if _storage._defaultBool != rhs_storage._defaultBool {return false} + if _storage._defaultString != rhs_storage._defaultString {return false} + if _storage._defaultBytes != rhs_storage._defaultBytes {return false} + if _storage._fieldname1 != rhs_storage._fieldname1 {return false} + if _storage._fieldName2 != rhs_storage._fieldName2 {return false} + if _storage._fieldName3 != rhs_storage._fieldName3 {return false} + if _storage._field_Name4_ != rhs_storage._field_Name4_ {return false} + if _storage._field0Name5 != rhs_storage._field0Name5 {return false} + if _storage._field0Name6 != rhs_storage._field0Name6 {return false} + if _storage._fieldName7 != rhs_storage._fieldName7 {return false} + if _storage._fieldName8 != rhs_storage._fieldName8 {return false} + if _storage._fieldName9 != rhs_storage._fieldName9 {return false} + if _storage._fieldName10 != rhs_storage._fieldName10 {return false} + if _storage._fieldName11 != rhs_storage._fieldName11 {return false} + if _storage._fieldName12 != rhs_storage._fieldName12 {return false} + if _storage.__FieldName13 != rhs_storage.__FieldName13 {return false} + if _storage.__FieldName14 != rhs_storage.__FieldName14 {return false} + if _storage._field_Name15 != rhs_storage._field_Name15 {return false} + if _storage._field_Name16 != rhs_storage._field_Name16 {return false} + if _storage._fieldName17__ != rhs_storage._fieldName17__ {return false} + if _storage._fieldName18__ != rhs_storage._fieldName18__ {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + -1: .same(proto: "NEG"), + 0: .same(proto: "FOO"), + 1: .same(proto: "BAR"), + 2: .same(proto: "BAZ"), + ] +} + +extension ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufTestMessages_Proto2_TestAllTypesProto2.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 2: .same(proto: "corecursive"), + ] + + fileprivate class _StorageClass { + var _a: Int32? = nil + var _corecursive: ProtobufTestMessages_Proto2_TestAllTypesProto2? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _a = source._a + _corecursive = source._corecursive + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + public var isInitialized: Bool { + return withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if let v = _storage._corecursive, !v.isInitialized {return false} + return true + } + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._a) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._corecursive) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._corecursive { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedMessage, rhs: ProtobufTestMessages_Proto2_TestAllTypesProto2.NestedMessage) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._a != rhs_storage._a {return false} + if _storage._corecursive != rhs_storage._corecursive {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_TestAllTypesProto2.DataMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufTestMessages_Proto2_TestAllTypesProto2.protoMessageName + ".Data" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 202: .standard(proto: "group_int32"), + 203: .standard(proto: "group_uint32"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 202: try { try decoder.decodeSingularInt32Field(value: &self._groupInt32) }() + case 203: try { try decoder.decodeSingularUInt32Field(value: &self._groupUint32) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._groupInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 202) + } }() + try { if let v = self._groupUint32 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 203) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_TestAllTypesProto2.DataMessage, rhs: ProtobufTestMessages_Proto2_TestAllTypesProto2.DataMessage) -> Bool { + if lhs._groupInt32 != rhs._groupInt32 {return false} + if lhs._groupUint32 != rhs._groupUint32 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrect: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufTestMessages_Proto2_TestAllTypesProto2.protoMessageName + ".MessageSetCorrect" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + try decoder.decodeExtensionFieldsAsMessageSet(values: &_protobuf_extensionFieldValues, messageType: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrect.self) + } + + func traverse(visitor: inout V) throws { + try visitor.visitExtensionFieldsAsMessageSet(fields: _protobuf_extensionFieldValues, start: 4, end: 2147483647) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrect, rhs: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrect) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension1: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufTestMessages_Proto2_TestAllTypesProto2.protoMessageName + ".MessageSetCorrectExtension1" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 25: .same(proto: "str"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 25: try { try decoder.decodeSingularStringField(value: &self._str) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._str { + try visitor.visitSingularStringField(value: v, fieldNumber: 25) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension1, rhs: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension1) -> Bool { + if lhs._str != rhs._str {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufTestMessages_Proto2_TestAllTypesProto2.protoMessageName + ".MessageSetCorrectExtension2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 9: .same(proto: "i"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 9: try { try decoder.decodeSingularInt32Field(value: &self._i) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._i { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 9) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension2, rhs: ProtobufTestMessages_Proto2_TestAllTypesProto2.MessageSetCorrectExtension2) -> Bool { + if lhs._i != rhs._i {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_ForeignMessageProto2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ForeignMessageProto2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "c"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._c) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._c { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_ForeignMessageProto2, rhs: ProtobufTestMessages_Proto2_ForeignMessageProto2) -> Bool { + if lhs._c != rhs._c {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_UnknownToTestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".UnknownToTestAllTypes" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1001: .standard(proto: "optional_int32"), + 1002: .standard(proto: "optional_string"), + 1003: .standard(proto: "nested_message"), + 1004: .unique(proto: "OptionalGroup", json: "optionalgroup"), + 1006: .standard(proto: "optional_bool"), + 1011: .standard(proto: "repeated_int32"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1001: try { try decoder.decodeSingularInt32Field(value: &self._optionalInt32) }() + case 1002: try { try decoder.decodeSingularStringField(value: &self._optionalString) }() + case 1003: try { try decoder.decodeSingularMessageField(value: &self._nestedMessage) }() + case 1004: try { try decoder.decodeSingularGroupField(value: &self._optionalGroup) }() + case 1006: try { try decoder.decodeSingularBoolField(value: &self._optionalBool) }() + case 1011: try { try decoder.decodeRepeatedInt32Field(value: &self.repeatedInt32) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._optionalInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1001) + } }() + try { if let v = self._optionalString { + try visitor.visitSingularStringField(value: v, fieldNumber: 1002) + } }() + try { if let v = self._nestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1003) + } }() + try { if let v = self._optionalGroup { + try visitor.visitSingularGroupField(value: v, fieldNumber: 1004) + } }() + try { if let v = self._optionalBool { + try visitor.visitSingularBoolField(value: v, fieldNumber: 1006) + } }() + if !self.repeatedInt32.isEmpty { + try visitor.visitRepeatedInt32Field(value: self.repeatedInt32, fieldNumber: 1011) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_UnknownToTestAllTypes, rhs: ProtobufTestMessages_Proto2_UnknownToTestAllTypes) -> Bool { + if lhs._optionalInt32 != rhs._optionalInt32 {return false} + if lhs._optionalString != rhs._optionalString {return false} + if lhs._nestedMessage != rhs._nestedMessage {return false} + if lhs._optionalGroup != rhs._optionalGroup {return false} + if lhs._optionalBool != rhs._optionalBool {return false} + if lhs.repeatedInt32 != rhs.repeatedInt32 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_UnknownToTestAllTypes.OptionalGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufTestMessages_Proto2_UnknownToTestAllTypes.protoMessageName + ".OptionalGroup" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_UnknownToTestAllTypes.OptionalGroup, rhs: ProtobufTestMessages_Proto2_UnknownToTestAllTypes.OptionalGroup) -> Bool { + if lhs._a != rhs._a {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_NullHypothesisProto2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".NullHypothesisProto2" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_NullHypothesisProto2, rhs: ProtobufTestMessages_Proto2_NullHypothesisProto2) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_EnumOnlyProto2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".EnumOnlyProto2" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_EnumOnlyProto2, rhs: ProtobufTestMessages_Proto2_EnumOnlyProto2) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_EnumOnlyProto2.BoolEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "kFalse"), + 1: .same(proto: "kTrue"), + ] +} + +extension ProtobufTestMessages_Proto2_OneStringProto2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".OneStringProto2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "data"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._data) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._data { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_OneStringProto2, rhs: ProtobufTestMessages_Proto2_OneStringProto2) -> Bool { + if lhs._data != rhs._data {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_ProtoWithKeywords: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ProtoWithKeywords" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "inline"), + 2: .same(proto: "concept"), + 3: .same(proto: "requires"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._inline) }() + case 2: try { try decoder.decodeSingularStringField(value: &self._concept) }() + case 3: try { try decoder.decodeRepeatedStringField(value: &self.requires) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._inline { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._concept { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + if !self.requires.isEmpty { + try visitor.visitRepeatedStringField(value: self.requires, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_ProtoWithKeywords, rhs: ProtobufTestMessages_Proto2_ProtoWithKeywords) -> Bool { + if lhs._inline != rhs._inline {return false} + if lhs._concept != rhs._concept {return false} + if lhs.requires != rhs.requires {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestAllRequiredTypesProto2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "required_int32"), + 2: .standard(proto: "required_int64"), + 3: .standard(proto: "required_uint32"), + 4: .standard(proto: "required_uint64"), + 5: .standard(proto: "required_sint32"), + 6: .standard(proto: "required_sint64"), + 7: .standard(proto: "required_fixed32"), + 8: .standard(proto: "required_fixed64"), + 9: .standard(proto: "required_sfixed32"), + 10: .standard(proto: "required_sfixed64"), + 11: .standard(proto: "required_float"), + 12: .standard(proto: "required_double"), + 13: .standard(proto: "required_bool"), + 14: .standard(proto: "required_string"), + 15: .standard(proto: "required_bytes"), + 18: .standard(proto: "required_nested_message"), + 19: .standard(proto: "required_foreign_message"), + 21: .standard(proto: "required_nested_enum"), + 22: .standard(proto: "required_foreign_enum"), + 24: .standard(proto: "required_string_piece"), + 25: .standard(proto: "required_cord"), + 27: .standard(proto: "recursive_message"), + 28: .standard(proto: "optional_recursive_message"), + 201: .unique(proto: "Data", json: "data"), + 241: .standard(proto: "default_int32"), + 242: .standard(proto: "default_int64"), + 243: .standard(proto: "default_uint32"), + 244: .standard(proto: "default_uint64"), + 245: .standard(proto: "default_sint32"), + 246: .standard(proto: "default_sint64"), + 247: .standard(proto: "default_fixed32"), + 248: .standard(proto: "default_fixed64"), + 249: .standard(proto: "default_sfixed32"), + 250: .standard(proto: "default_sfixed64"), + 251: .standard(proto: "default_float"), + 252: .standard(proto: "default_double"), + 253: .standard(proto: "default_bool"), + 254: .standard(proto: "default_string"), + 255: .standard(proto: "default_bytes"), + ] + + fileprivate class _StorageClass { + var _requiredInt32: Int32? = nil + var _requiredInt64: Int64? = nil + var _requiredUint32: UInt32? = nil + var _requiredUint64: UInt64? = nil + var _requiredSint32: Int32? = nil + var _requiredSint64: Int64? = nil + var _requiredFixed32: UInt32? = nil + var _requiredFixed64: UInt64? = nil + var _requiredSfixed32: Int32? = nil + var _requiredSfixed64: Int64? = nil + var _requiredFloat: Float? = nil + var _requiredDouble: Double? = nil + var _requiredBool: Bool? = nil + var _requiredString: String? = nil + var _requiredBytes: Data? = nil + var _requiredNestedMessage: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.NestedMessage? = nil + var _requiredForeignMessage: ProtobufTestMessages_Proto2_ForeignMessageProto2? = nil + var _requiredNestedEnum: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.NestedEnum? = nil + var _requiredForeignEnum: ProtobufTestMessages_Proto2_ForeignEnumProto2? = nil + var _requiredStringPiece: String? = nil + var _requiredCord: String? = nil + var _recursiveMessage: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2? = nil + var _optionalRecursiveMessage: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2? = nil + var _data: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.DataMessage? = nil + var _defaultInt32: Int32? = nil + var _defaultInt64: Int64? = nil + var _defaultUint32: UInt32? = nil + var _defaultUint64: UInt64? = nil + var _defaultSint32: Int32? = nil + var _defaultSint64: Int64? = nil + var _defaultFixed32: UInt32? = nil + var _defaultFixed64: UInt64? = nil + var _defaultSfixed32: Int32? = nil + var _defaultSfixed64: Int64? = nil + var _defaultFloat: Float? = nil + var _defaultDouble: Double? = nil + var _defaultBool: Bool? = nil + var _defaultString: String? = nil + var _defaultBytes: Data? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _requiredInt32 = source._requiredInt32 + _requiredInt64 = source._requiredInt64 + _requiredUint32 = source._requiredUint32 + _requiredUint64 = source._requiredUint64 + _requiredSint32 = source._requiredSint32 + _requiredSint64 = source._requiredSint64 + _requiredFixed32 = source._requiredFixed32 + _requiredFixed64 = source._requiredFixed64 + _requiredSfixed32 = source._requiredSfixed32 + _requiredSfixed64 = source._requiredSfixed64 + _requiredFloat = source._requiredFloat + _requiredDouble = source._requiredDouble + _requiredBool = source._requiredBool + _requiredString = source._requiredString + _requiredBytes = source._requiredBytes + _requiredNestedMessage = source._requiredNestedMessage + _requiredForeignMessage = source._requiredForeignMessage + _requiredNestedEnum = source._requiredNestedEnum + _requiredForeignEnum = source._requiredForeignEnum + _requiredStringPiece = source._requiredStringPiece + _requiredCord = source._requiredCord + _recursiveMessage = source._recursiveMessage + _optionalRecursiveMessage = source._optionalRecursiveMessage + _data = source._data + _defaultInt32 = source._defaultInt32 + _defaultInt64 = source._defaultInt64 + _defaultUint32 = source._defaultUint32 + _defaultUint64 = source._defaultUint64 + _defaultSint32 = source._defaultSint32 + _defaultSint64 = source._defaultSint64 + _defaultFixed32 = source._defaultFixed32 + _defaultFixed64 = source._defaultFixed64 + _defaultSfixed32 = source._defaultSfixed32 + _defaultSfixed64 = source._defaultSfixed64 + _defaultFloat = source._defaultFloat + _defaultDouble = source._defaultDouble + _defaultBool = source._defaultBool + _defaultString = source._defaultString + _defaultBytes = source._defaultBytes + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if _storage._requiredInt32 == nil {return false} + if _storage._requiredInt64 == nil {return false} + if _storage._requiredUint32 == nil {return false} + if _storage._requiredUint64 == nil {return false} + if _storage._requiredSint32 == nil {return false} + if _storage._requiredSint64 == nil {return false} + if _storage._requiredFixed32 == nil {return false} + if _storage._requiredFixed64 == nil {return false} + if _storage._requiredSfixed32 == nil {return false} + if _storage._requiredSfixed64 == nil {return false} + if _storage._requiredFloat == nil {return false} + if _storage._requiredDouble == nil {return false} + if _storage._requiredBool == nil {return false} + if _storage._requiredString == nil {return false} + if _storage._requiredBytes == nil {return false} + if _storage._requiredNestedMessage == nil {return false} + if _storage._requiredForeignMessage == nil {return false} + if _storage._requiredNestedEnum == nil {return false} + if _storage._requiredForeignEnum == nil {return false} + if _storage._requiredStringPiece == nil {return false} + if _storage._requiredCord == nil {return false} + if _storage._recursiveMessage == nil {return false} + if _storage._data == nil {return false} + if _storage._defaultInt32 == nil {return false} + if _storage._defaultInt64 == nil {return false} + if _storage._defaultUint32 == nil {return false} + if _storage._defaultUint64 == nil {return false} + if _storage._defaultSint32 == nil {return false} + if _storage._defaultSint64 == nil {return false} + if _storage._defaultFixed32 == nil {return false} + if _storage._defaultFixed64 == nil {return false} + if _storage._defaultSfixed32 == nil {return false} + if _storage._defaultSfixed64 == nil {return false} + if _storage._defaultFloat == nil {return false} + if _storage._defaultDouble == nil {return false} + if _storage._defaultBool == nil {return false} + if _storage._defaultString == nil {return false} + if _storage._defaultBytes == nil {return false} + if let v = _storage._requiredNestedMessage, !v.isInitialized {return false} + if let v = _storage._recursiveMessage, !v.isInitialized {return false} + if let v = _storage._optionalRecursiveMessage, !v.isInitialized {return false} + if let v = _storage._data, !v.isInitialized {return false} + return true + } + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._requiredInt32) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._requiredInt64) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &_storage._requiredUint32) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._requiredUint64) }() + case 5: try { try decoder.decodeSingularSInt32Field(value: &_storage._requiredSint32) }() + case 6: try { try decoder.decodeSingularSInt64Field(value: &_storage._requiredSint64) }() + case 7: try { try decoder.decodeSingularFixed32Field(value: &_storage._requiredFixed32) }() + case 8: try { try decoder.decodeSingularFixed64Field(value: &_storage._requiredFixed64) }() + case 9: try { try decoder.decodeSingularSFixed32Field(value: &_storage._requiredSfixed32) }() + case 10: try { try decoder.decodeSingularSFixed64Field(value: &_storage._requiredSfixed64) }() + case 11: try { try decoder.decodeSingularFloatField(value: &_storage._requiredFloat) }() + case 12: try { try decoder.decodeSingularDoubleField(value: &_storage._requiredDouble) }() + case 13: try { try decoder.decodeSingularBoolField(value: &_storage._requiredBool) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._requiredString) }() + case 15: try { try decoder.decodeSingularBytesField(value: &_storage._requiredBytes) }() + case 18: try { try decoder.decodeSingularMessageField(value: &_storage._requiredNestedMessage) }() + case 19: try { try decoder.decodeSingularMessageField(value: &_storage._requiredForeignMessage) }() + case 21: try { try decoder.decodeSingularEnumField(value: &_storage._requiredNestedEnum) }() + case 22: try { try decoder.decodeSingularEnumField(value: &_storage._requiredForeignEnum) }() + case 24: try { try decoder.decodeSingularStringField(value: &_storage._requiredStringPiece) }() + case 25: try { try decoder.decodeSingularStringField(value: &_storage._requiredCord) }() + case 27: try { try decoder.decodeSingularMessageField(value: &_storage._recursiveMessage) }() + case 28: try { try decoder.decodeSingularMessageField(value: &_storage._optionalRecursiveMessage) }() + case 201: try { try decoder.decodeSingularGroupField(value: &_storage._data) }() + case 241: try { try decoder.decodeSingularInt32Field(value: &_storage._defaultInt32) }() + case 242: try { try decoder.decodeSingularInt64Field(value: &_storage._defaultInt64) }() + case 243: try { try decoder.decodeSingularUInt32Field(value: &_storage._defaultUint32) }() + case 244: try { try decoder.decodeSingularUInt64Field(value: &_storage._defaultUint64) }() + case 245: try { try decoder.decodeSingularSInt32Field(value: &_storage._defaultSint32) }() + case 246: try { try decoder.decodeSingularSInt64Field(value: &_storage._defaultSint64) }() + case 247: try { try decoder.decodeSingularFixed32Field(value: &_storage._defaultFixed32) }() + case 248: try { try decoder.decodeSingularFixed64Field(value: &_storage._defaultFixed64) }() + case 249: try { try decoder.decodeSingularSFixed32Field(value: &_storage._defaultSfixed32) }() + case 250: try { try decoder.decodeSingularSFixed64Field(value: &_storage._defaultSfixed64) }() + case 251: try { try decoder.decodeSingularFloatField(value: &_storage._defaultFloat) }() + case 252: try { try decoder.decodeSingularDoubleField(value: &_storage._defaultDouble) }() + case 253: try { try decoder.decodeSingularBoolField(value: &_storage._defaultBool) }() + case 254: try { try decoder.decodeSingularStringField(value: &_storage._defaultString) }() + case 255: try { try decoder.decodeSingularBytesField(value: &_storage._defaultBytes) }() + case 120..<201: + try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.self, fieldNumber: fieldNumber) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._requiredInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._requiredInt64 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._requiredUint32 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._requiredUint64 { + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._requiredSint32 { + try visitor.visitSingularSInt32Field(value: v, fieldNumber: 5) + } }() + try { if let v = _storage._requiredSint64 { + try visitor.visitSingularSInt64Field(value: v, fieldNumber: 6) + } }() + try { if let v = _storage._requiredFixed32 { + try visitor.visitSingularFixed32Field(value: v, fieldNumber: 7) + } }() + try { if let v = _storage._requiredFixed64 { + try visitor.visitSingularFixed64Field(value: v, fieldNumber: 8) + } }() + try { if let v = _storage._requiredSfixed32 { + try visitor.visitSingularSFixed32Field(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._requiredSfixed64 { + try visitor.visitSingularSFixed64Field(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._requiredFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 11) + } }() + try { if let v = _storage._requiredDouble { + try visitor.visitSingularDoubleField(value: v, fieldNumber: 12) + } }() + try { if let v = _storage._requiredBool { + try visitor.visitSingularBoolField(value: v, fieldNumber: 13) + } }() + try { if let v = _storage._requiredString { + try visitor.visitSingularStringField(value: v, fieldNumber: 14) + } }() + try { if let v = _storage._requiredBytes { + try visitor.visitSingularBytesField(value: v, fieldNumber: 15) + } }() + try { if let v = _storage._requiredNestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._requiredForeignMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + } }() + try { if let v = _storage._requiredNestedEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 21) + } }() + try { if let v = _storage._requiredForeignEnum { + try visitor.visitSingularEnumField(value: v, fieldNumber: 22) + } }() + try { if let v = _storage._requiredStringPiece { + try visitor.visitSingularStringField(value: v, fieldNumber: 24) + } }() + try { if let v = _storage._requiredCord { + try visitor.visitSingularStringField(value: v, fieldNumber: 25) + } }() + try { if let v = _storage._recursiveMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 27) + } }() + try { if let v = _storage._optionalRecursiveMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 28) + } }() + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 120, end: 201) + try { if let v = _storage._data { + try visitor.visitSingularGroupField(value: v, fieldNumber: 201) + } }() + try { if let v = _storage._defaultInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 241) + } }() + try { if let v = _storage._defaultInt64 { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 242) + } }() + try { if let v = _storage._defaultUint32 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 243) + } }() + try { if let v = _storage._defaultUint64 { + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 244) + } }() + try { if let v = _storage._defaultSint32 { + try visitor.visitSingularSInt32Field(value: v, fieldNumber: 245) + } }() + try { if let v = _storage._defaultSint64 { + try visitor.visitSingularSInt64Field(value: v, fieldNumber: 246) + } }() + try { if let v = _storage._defaultFixed32 { + try visitor.visitSingularFixed32Field(value: v, fieldNumber: 247) + } }() + try { if let v = _storage._defaultFixed64 { + try visitor.visitSingularFixed64Field(value: v, fieldNumber: 248) + } }() + try { if let v = _storage._defaultSfixed32 { + try visitor.visitSingularSFixed32Field(value: v, fieldNumber: 249) + } }() + try { if let v = _storage._defaultSfixed64 { + try visitor.visitSingularSFixed64Field(value: v, fieldNumber: 250) + } }() + try { if let v = _storage._defaultFloat { + try visitor.visitSingularFloatField(value: v, fieldNumber: 251) + } }() + try { if let v = _storage._defaultDouble { + try visitor.visitSingularDoubleField(value: v, fieldNumber: 252) + } }() + try { if let v = _storage._defaultBool { + try visitor.visitSingularBoolField(value: v, fieldNumber: 253) + } }() + try { if let v = _storage._defaultString { + try visitor.visitSingularStringField(value: v, fieldNumber: 254) + } }() + try { if let v = _storage._defaultBytes { + try visitor.visitSingularBytesField(value: v, fieldNumber: 255) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2, rhs: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._requiredInt32 != rhs_storage._requiredInt32 {return false} + if _storage._requiredInt64 != rhs_storage._requiredInt64 {return false} + if _storage._requiredUint32 != rhs_storage._requiredUint32 {return false} + if _storage._requiredUint64 != rhs_storage._requiredUint64 {return false} + if _storage._requiredSint32 != rhs_storage._requiredSint32 {return false} + if _storage._requiredSint64 != rhs_storage._requiredSint64 {return false} + if _storage._requiredFixed32 != rhs_storage._requiredFixed32 {return false} + if _storage._requiredFixed64 != rhs_storage._requiredFixed64 {return false} + if _storage._requiredSfixed32 != rhs_storage._requiredSfixed32 {return false} + if _storage._requiredSfixed64 != rhs_storage._requiredSfixed64 {return false} + if _storage._requiredFloat != rhs_storage._requiredFloat {return false} + if _storage._requiredDouble != rhs_storage._requiredDouble {return false} + if _storage._requiredBool != rhs_storage._requiredBool {return false} + if _storage._requiredString != rhs_storage._requiredString {return false} + if _storage._requiredBytes != rhs_storage._requiredBytes {return false} + if _storage._requiredNestedMessage != rhs_storage._requiredNestedMessage {return false} + if _storage._requiredForeignMessage != rhs_storage._requiredForeignMessage {return false} + if _storage._requiredNestedEnum != rhs_storage._requiredNestedEnum {return false} + if _storage._requiredForeignEnum != rhs_storage._requiredForeignEnum {return false} + if _storage._requiredStringPiece != rhs_storage._requiredStringPiece {return false} + if _storage._requiredCord != rhs_storage._requiredCord {return false} + if _storage._recursiveMessage != rhs_storage._recursiveMessage {return false} + if _storage._optionalRecursiveMessage != rhs_storage._optionalRecursiveMessage {return false} + if _storage._data != rhs_storage._data {return false} + if _storage._defaultInt32 != rhs_storage._defaultInt32 {return false} + if _storage._defaultInt64 != rhs_storage._defaultInt64 {return false} + if _storage._defaultUint32 != rhs_storage._defaultUint32 {return false} + if _storage._defaultUint64 != rhs_storage._defaultUint64 {return false} + if _storage._defaultSint32 != rhs_storage._defaultSint32 {return false} + if _storage._defaultSint64 != rhs_storage._defaultSint64 {return false} + if _storage._defaultFixed32 != rhs_storage._defaultFixed32 {return false} + if _storage._defaultFixed64 != rhs_storage._defaultFixed64 {return false} + if _storage._defaultSfixed32 != rhs_storage._defaultSfixed32 {return false} + if _storage._defaultSfixed64 != rhs_storage._defaultSfixed64 {return false} + if _storage._defaultFloat != rhs_storage._defaultFloat {return false} + if _storage._defaultDouble != rhs_storage._defaultDouble {return false} + if _storage._defaultBool != rhs_storage._defaultBool {return false} + if _storage._defaultString != rhs_storage._defaultString {return false} + if _storage._defaultBytes != rhs_storage._defaultBytes {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + -1: .same(proto: "NEG"), + 0: .same(proto: "FOO"), + 1: .same(proto: "BAR"), + 2: .same(proto: "BAZ"), + ] +} + +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 2: .same(proto: "corecursive"), + 3: .standard(proto: "optional_corecursive"), + ] + + fileprivate class _StorageClass { + var _a: Int32? = nil + var _corecursive: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2? = nil + var _optionalCorecursive: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _a = source._a + _corecursive = source._corecursive + _optionalCorecursive = source._optionalCorecursive + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + public var isInitialized: Bool { + return withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if _storage._a == nil {return false} + if _storage._corecursive == nil {return false} + if let v = _storage._corecursive, !v.isInitialized {return false} + if let v = _storage._optionalCorecursive, !v.isInitialized {return false} + return true + } + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._a) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._corecursive) }() + case 3: try { try decoder.decodeSingularMessageField(value: &_storage._optionalCorecursive) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._a { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._corecursive { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._optionalCorecursive { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.NestedMessage, rhs: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.NestedMessage) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._a != rhs_storage._a {return false} + if _storage._corecursive != rhs_storage._corecursive {return false} + if _storage._optionalCorecursive != rhs_storage._optionalCorecursive {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.DataMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.protoMessageName + ".Data" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 202: .standard(proto: "group_int32"), + 203: .standard(proto: "group_uint32"), + ] + + public var isInitialized: Bool { + if self._groupInt32 == nil {return false} + if self._groupUint32 == nil {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 202: try { try decoder.decodeSingularInt32Field(value: &self._groupInt32) }() + case 203: try { try decoder.decodeSingularUInt32Field(value: &self._groupUint32) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._groupInt32 { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 202) + } }() + try { if let v = self._groupUint32 { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 203) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.DataMessage, rhs: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.DataMessage) -> Bool { + if lhs._groupInt32 != rhs._groupInt32 {return false} + if lhs._groupUint32 != rhs._groupUint32 {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrect: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.protoMessageName + ".MessageSetCorrect" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + public var isInitialized: Bool { + if !_protobuf_extensionFieldValues.isInitialized {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + try decoder.decodeExtensionFieldsAsMessageSet(values: &_protobuf_extensionFieldValues, messageType: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrect.self) + } + + func traverse(visitor: inout V) throws { + try visitor.visitExtensionFieldsAsMessageSet(fields: _protobuf_extensionFieldValues, start: 4, end: 2147483647) + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrect, rhs: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrect) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension1: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.protoMessageName + ".MessageSetCorrectExtension1" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 25: .same(proto: "str"), + ] + + public var isInitialized: Bool { + if self._str == nil {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 25: try { try decoder.decodeSingularStringField(value: &self._str) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._str { + try visitor.visitSingularStringField(value: v, fieldNumber: 25) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension1, rhs: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension1) -> Bool { + if lhs._str != rhs._str {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.protoMessageName + ".MessageSetCorrectExtension2" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 9: .same(proto: "i"), + ] + + public var isInitialized: Bool { + if self._i == nil {return false} + return true + } + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 9: try { try decoder.decodeSingularInt32Field(value: &self._i) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._i { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 9) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension2, rhs: ProtobufTestMessages_Proto2_TestAllRequiredTypesProto2.MessageSetCorrectExtension2) -> Bool { + if lhs._i != rhs._i {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/upstream/google/protobuf/test_messages_proto3.pb.swift b/Reference/upstream/google/protobuf/test_messages_proto3.pb.swift new file mode 100644 index 000000000..6c290ddc3 --- /dev/null +++ b/Reference/upstream/google/protobuf/test_messages_proto3.pb.swift @@ -0,0 +1,2694 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: google/protobuf/test_messages_proto3.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Test schema for proto3 messages. This test schema is used by: +// +// - benchmarks +// - fuzz tests +// - conformance tests + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _3: SwiftProtobuf.ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +enum ProtobufTestMessages_Proto3_ForeignEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foreignFoo // = 0 + case foreignBar // = 1 + case foreignBaz // = 2 + case UNRECOGNIZED(Int) + + init() { + self = .foreignFoo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .foreignFoo + case 1: self = .foreignBar + case 2: self = .foreignBaz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .foreignFoo: return 0 + case .foreignBar: return 1 + case .foreignBaz: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [ProtobufTestMessages_Proto3_ForeignEnum] = [ + .foreignFoo, + .foreignBar, + .foreignBaz, + ] + +} + +/// 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. +struct ProtobufTestMessages_Proto3_TestAllTypesProto3 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Singular + var optionalInt32: Int32 { + get {return _storage._optionalInt32} + set {_uniqueStorage()._optionalInt32 = newValue} + } + + var optionalInt64: Int64 { + get {return _storage._optionalInt64} + set {_uniqueStorage()._optionalInt64 = newValue} + } + + var optionalUint32: UInt32 { + get {return _storage._optionalUint32} + set {_uniqueStorage()._optionalUint32 = newValue} + } + + var optionalUint64: UInt64 { + get {return _storage._optionalUint64} + set {_uniqueStorage()._optionalUint64 = newValue} + } + + var optionalSint32: Int32 { + get {return _storage._optionalSint32} + set {_uniqueStorage()._optionalSint32 = newValue} + } + + var optionalSint64: Int64 { + get {return _storage._optionalSint64} + set {_uniqueStorage()._optionalSint64 = newValue} + } + + var optionalFixed32: UInt32 { + get {return _storage._optionalFixed32} + set {_uniqueStorage()._optionalFixed32 = newValue} + } + + var optionalFixed64: UInt64 { + get {return _storage._optionalFixed64} + set {_uniqueStorage()._optionalFixed64 = newValue} + } + + var optionalSfixed32: Int32 { + get {return _storage._optionalSfixed32} + set {_uniqueStorage()._optionalSfixed32 = newValue} + } + + var optionalSfixed64: Int64 { + get {return _storage._optionalSfixed64} + set {_uniqueStorage()._optionalSfixed64 = newValue} + } + + var optionalFloat: Float { + get {return _storage._optionalFloat} + set {_uniqueStorage()._optionalFloat = newValue} + } + + var optionalDouble: Double { + get {return _storage._optionalDouble} + set {_uniqueStorage()._optionalDouble = newValue} + } + + var optionalBool: Bool { + get {return _storage._optionalBool} + set {_uniqueStorage()._optionalBool = newValue} + } + + var optionalString: String { + get {return _storage._optionalString} + set {_uniqueStorage()._optionalString = newValue} + } + + var optionalBytes: Data { + get {return _storage._optionalBytes} + set {_uniqueStorage()._optionalBytes = newValue} + } + + var optionalNestedMessage: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage { + get {return _storage._optionalNestedMessage ?? ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage()} + set {_uniqueStorage()._optionalNestedMessage = newValue} + } + /// Returns true if `optionalNestedMessage` has been explicitly set. + var hasOptionalNestedMessage: Bool {return _storage._optionalNestedMessage != nil} + /// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalNestedMessage() {_uniqueStorage()._optionalNestedMessage = nil} + + var optionalForeignMessage: ProtobufTestMessages_Proto3_ForeignMessage { + get {return _storage._optionalForeignMessage ?? ProtobufTestMessages_Proto3_ForeignMessage()} + set {_uniqueStorage()._optionalForeignMessage = newValue} + } + /// Returns true if `optionalForeignMessage` has been explicitly set. + var hasOptionalForeignMessage: Bool {return _storage._optionalForeignMessage != nil} + /// Clears the value of `optionalForeignMessage`. Subsequent reads from it will return its default value. + mutating func clearOptionalForeignMessage() {_uniqueStorage()._optionalForeignMessage = nil} + + var optionalNestedEnum: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum { + get {return _storage._optionalNestedEnum} + set {_uniqueStorage()._optionalNestedEnum = newValue} + } + + var optionalForeignEnum: ProtobufTestMessages_Proto3_ForeignEnum { + get {return _storage._optionalForeignEnum} + set {_uniqueStorage()._optionalForeignEnum = newValue} + } + + var optionalAliasedEnum: ProtobufTestMessages_Proto3_TestAllTypesProto3.AliasedEnum { + get {return _storage._optionalAliasedEnum} + set {_uniqueStorage()._optionalAliasedEnum = newValue} + } + + var optionalStringPiece: String { + get {return _storage._optionalStringPiece} + set {_uniqueStorage()._optionalStringPiece = newValue} + } + + var optionalCord: String { + get {return _storage._optionalCord} + set {_uniqueStorage()._optionalCord = newValue} + } + + var recursiveMessage: ProtobufTestMessages_Proto3_TestAllTypesProto3 { + get {return _storage._recursiveMessage ?? ProtobufTestMessages_Proto3_TestAllTypesProto3()} + set {_uniqueStorage()._recursiveMessage = newValue} + } + /// Returns true if `recursiveMessage` has been explicitly set. + var hasRecursiveMessage: Bool {return _storage._recursiveMessage != nil} + /// Clears the value of `recursiveMessage`. Subsequent reads from it will return its default value. + mutating func clearRecursiveMessage() {_uniqueStorage()._recursiveMessage = nil} + + /// Repeated + var repeatedInt32: [Int32] { + get {return _storage._repeatedInt32} + set {_uniqueStorage()._repeatedInt32 = newValue} + } + + var repeatedInt64: [Int64] { + get {return _storage._repeatedInt64} + set {_uniqueStorage()._repeatedInt64 = newValue} + } + + var repeatedUint32: [UInt32] { + get {return _storage._repeatedUint32} + set {_uniqueStorage()._repeatedUint32 = newValue} + } + + var repeatedUint64: [UInt64] { + get {return _storage._repeatedUint64} + set {_uniqueStorage()._repeatedUint64 = newValue} + } + + var repeatedSint32: [Int32] { + get {return _storage._repeatedSint32} + set {_uniqueStorage()._repeatedSint32 = newValue} + } + + var repeatedSint64: [Int64] { + get {return _storage._repeatedSint64} + set {_uniqueStorage()._repeatedSint64 = newValue} + } + + var repeatedFixed32: [UInt32] { + get {return _storage._repeatedFixed32} + set {_uniqueStorage()._repeatedFixed32 = newValue} + } + + var repeatedFixed64: [UInt64] { + get {return _storage._repeatedFixed64} + set {_uniqueStorage()._repeatedFixed64 = newValue} + } + + var repeatedSfixed32: [Int32] { + get {return _storage._repeatedSfixed32} + set {_uniqueStorage()._repeatedSfixed32 = newValue} + } + + var repeatedSfixed64: [Int64] { + get {return _storage._repeatedSfixed64} + set {_uniqueStorage()._repeatedSfixed64 = newValue} + } + + var repeatedFloat: [Float] { + get {return _storage._repeatedFloat} + set {_uniqueStorage()._repeatedFloat = newValue} + } + + var repeatedDouble: [Double] { + get {return _storage._repeatedDouble} + set {_uniqueStorage()._repeatedDouble = newValue} + } + + var repeatedBool: [Bool] { + get {return _storage._repeatedBool} + set {_uniqueStorage()._repeatedBool = newValue} + } + + var repeatedString: [String] { + get {return _storage._repeatedString} + set {_uniqueStorage()._repeatedString = newValue} + } + + var repeatedBytes: [Data] { + get {return _storage._repeatedBytes} + set {_uniqueStorage()._repeatedBytes = newValue} + } + + var repeatedNestedMessage: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage] { + get {return _storage._repeatedNestedMessage} + set {_uniqueStorage()._repeatedNestedMessage = newValue} + } + + var repeatedForeignMessage: [ProtobufTestMessages_Proto3_ForeignMessage] { + get {return _storage._repeatedForeignMessage} + set {_uniqueStorage()._repeatedForeignMessage = newValue} + } + + var repeatedNestedEnum: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum] { + get {return _storage._repeatedNestedEnum} + set {_uniqueStorage()._repeatedNestedEnum = newValue} + } + + var repeatedForeignEnum: [ProtobufTestMessages_Proto3_ForeignEnum] { + get {return _storage._repeatedForeignEnum} + set {_uniqueStorage()._repeatedForeignEnum = newValue} + } + + var repeatedStringPiece: [String] { + get {return _storage._repeatedStringPiece} + set {_uniqueStorage()._repeatedStringPiece = newValue} + } + + var repeatedCord: [String] { + get {return _storage._repeatedCord} + set {_uniqueStorage()._repeatedCord = newValue} + } + + /// Packed + var packedInt32: [Int32] { + get {return _storage._packedInt32} + set {_uniqueStorage()._packedInt32 = newValue} + } + + var packedInt64: [Int64] { + get {return _storage._packedInt64} + set {_uniqueStorage()._packedInt64 = newValue} + } + + var packedUint32: [UInt32] { + get {return _storage._packedUint32} + set {_uniqueStorage()._packedUint32 = newValue} + } + + var packedUint64: [UInt64] { + get {return _storage._packedUint64} + set {_uniqueStorage()._packedUint64 = newValue} + } + + var packedSint32: [Int32] { + get {return _storage._packedSint32} + set {_uniqueStorage()._packedSint32 = newValue} + } + + var packedSint64: [Int64] { + get {return _storage._packedSint64} + set {_uniqueStorage()._packedSint64 = newValue} + } + + var packedFixed32: [UInt32] { + get {return _storage._packedFixed32} + set {_uniqueStorage()._packedFixed32 = newValue} + } + + var packedFixed64: [UInt64] { + get {return _storage._packedFixed64} + set {_uniqueStorage()._packedFixed64 = newValue} + } + + var packedSfixed32: [Int32] { + get {return _storage._packedSfixed32} + set {_uniqueStorage()._packedSfixed32 = newValue} + } + + var packedSfixed64: [Int64] { + get {return _storage._packedSfixed64} + set {_uniqueStorage()._packedSfixed64 = newValue} + } + + var packedFloat: [Float] { + get {return _storage._packedFloat} + set {_uniqueStorage()._packedFloat = newValue} + } + + var packedDouble: [Double] { + get {return _storage._packedDouble} + set {_uniqueStorage()._packedDouble = newValue} + } + + var packedBool: [Bool] { + get {return _storage._packedBool} + set {_uniqueStorage()._packedBool = newValue} + } + + var packedNestedEnum: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum] { + get {return _storage._packedNestedEnum} + set {_uniqueStorage()._packedNestedEnum = newValue} + } + + /// Unpacked + var unpackedInt32: [Int32] { + get {return _storage._unpackedInt32} + set {_uniqueStorage()._unpackedInt32 = newValue} + } + + var unpackedInt64: [Int64] { + get {return _storage._unpackedInt64} + set {_uniqueStorage()._unpackedInt64 = newValue} + } + + var unpackedUint32: [UInt32] { + get {return _storage._unpackedUint32} + set {_uniqueStorage()._unpackedUint32 = newValue} + } + + var unpackedUint64: [UInt64] { + get {return _storage._unpackedUint64} + set {_uniqueStorage()._unpackedUint64 = newValue} + } + + var unpackedSint32: [Int32] { + get {return _storage._unpackedSint32} + set {_uniqueStorage()._unpackedSint32 = newValue} + } + + var unpackedSint64: [Int64] { + get {return _storage._unpackedSint64} + set {_uniqueStorage()._unpackedSint64 = newValue} + } + + var unpackedFixed32: [UInt32] { + get {return _storage._unpackedFixed32} + set {_uniqueStorage()._unpackedFixed32 = newValue} + } + + var unpackedFixed64: [UInt64] { + get {return _storage._unpackedFixed64} + set {_uniqueStorage()._unpackedFixed64 = newValue} + } + + var unpackedSfixed32: [Int32] { + get {return _storage._unpackedSfixed32} + set {_uniqueStorage()._unpackedSfixed32 = newValue} + } + + var unpackedSfixed64: [Int64] { + get {return _storage._unpackedSfixed64} + set {_uniqueStorage()._unpackedSfixed64 = newValue} + } + + var unpackedFloat: [Float] { + get {return _storage._unpackedFloat} + set {_uniqueStorage()._unpackedFloat = newValue} + } + + var unpackedDouble: [Double] { + get {return _storage._unpackedDouble} + set {_uniqueStorage()._unpackedDouble = newValue} + } + + var unpackedBool: [Bool] { + get {return _storage._unpackedBool} + set {_uniqueStorage()._unpackedBool = newValue} + } + + var unpackedNestedEnum: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum] { + get {return _storage._unpackedNestedEnum} + set {_uniqueStorage()._unpackedNestedEnum = newValue} + } + + /// Map + var mapInt32Int32: Dictionary { + get {return _storage._mapInt32Int32} + set {_uniqueStorage()._mapInt32Int32 = newValue} + } + + var mapInt64Int64: Dictionary { + get {return _storage._mapInt64Int64} + set {_uniqueStorage()._mapInt64Int64 = newValue} + } + + var mapUint32Uint32: Dictionary { + get {return _storage._mapUint32Uint32} + set {_uniqueStorage()._mapUint32Uint32 = newValue} + } + + var mapUint64Uint64: Dictionary { + get {return _storage._mapUint64Uint64} + set {_uniqueStorage()._mapUint64Uint64 = newValue} + } + + var mapSint32Sint32: Dictionary { + get {return _storage._mapSint32Sint32} + set {_uniqueStorage()._mapSint32Sint32 = newValue} + } + + var mapSint64Sint64: Dictionary { + get {return _storage._mapSint64Sint64} + set {_uniqueStorage()._mapSint64Sint64 = newValue} + } + + var mapFixed32Fixed32: Dictionary { + get {return _storage._mapFixed32Fixed32} + set {_uniqueStorage()._mapFixed32Fixed32 = newValue} + } + + var mapFixed64Fixed64: Dictionary { + get {return _storage._mapFixed64Fixed64} + set {_uniqueStorage()._mapFixed64Fixed64 = newValue} + } + + var mapSfixed32Sfixed32: Dictionary { + get {return _storage._mapSfixed32Sfixed32} + set {_uniqueStorage()._mapSfixed32Sfixed32 = newValue} + } + + var mapSfixed64Sfixed64: Dictionary { + get {return _storage._mapSfixed64Sfixed64} + set {_uniqueStorage()._mapSfixed64Sfixed64 = newValue} + } + + var mapInt32Float: Dictionary { + get {return _storage._mapInt32Float} + set {_uniqueStorage()._mapInt32Float = newValue} + } + + var mapInt32Double: Dictionary { + get {return _storage._mapInt32Double} + set {_uniqueStorage()._mapInt32Double = newValue} + } + + var mapBoolBool: Dictionary { + get {return _storage._mapBoolBool} + set {_uniqueStorage()._mapBoolBool = newValue} + } + + var mapStringString: Dictionary { + get {return _storage._mapStringString} + set {_uniqueStorage()._mapStringString = newValue} + } + + var mapStringBytes: Dictionary { + get {return _storage._mapStringBytes} + set {_uniqueStorage()._mapStringBytes = newValue} + } + + var mapStringNestedMessage: Dictionary { + get {return _storage._mapStringNestedMessage} + set {_uniqueStorage()._mapStringNestedMessage = newValue} + } + + var mapStringForeignMessage: Dictionary { + get {return _storage._mapStringForeignMessage} + set {_uniqueStorage()._mapStringForeignMessage = newValue} + } + + var mapStringNestedEnum: Dictionary { + get {return _storage._mapStringNestedEnum} + set {_uniqueStorage()._mapStringNestedEnum = newValue} + } + + var mapStringForeignEnum: Dictionary { + get {return _storage._mapStringForeignEnum} + set {_uniqueStorage()._mapStringForeignEnum = newValue} + } + + var oneofField: OneOf_OneofField? { + get {return _storage._oneofField} + set {_uniqueStorage()._oneofField = newValue} + } + + var oneofUint32: UInt32 { + get { + if case .oneofUint32(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofUint32(newValue)} + } + + var oneofNestedMessage: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage { + get { + if case .oneofNestedMessage(let v)? = _storage._oneofField {return v} + return ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage() + } + set {_uniqueStorage()._oneofField = .oneofNestedMessage(newValue)} + } + + var oneofString: String { + get { + if case .oneofString(let v)? = _storage._oneofField {return v} + return String() + } + set {_uniqueStorage()._oneofField = .oneofString(newValue)} + } + + var oneofBytes: Data { + get { + if case .oneofBytes(let v)? = _storage._oneofField {return v} + return Data() + } + set {_uniqueStorage()._oneofField = .oneofBytes(newValue)} + } + + var oneofBool: Bool { + get { + if case .oneofBool(let v)? = _storage._oneofField {return v} + return false + } + set {_uniqueStorage()._oneofField = .oneofBool(newValue)} + } + + var oneofUint64: UInt64 { + get { + if case .oneofUint64(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofUint64(newValue)} + } + + var oneofFloat: Float { + get { + if case .oneofFloat(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofFloat(newValue)} + } + + var oneofDouble: Double { + get { + if case .oneofDouble(let v)? = _storage._oneofField {return v} + return 0 + } + set {_uniqueStorage()._oneofField = .oneofDouble(newValue)} + } + + var oneofEnum: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum { + get { + if case .oneofEnum(let v)? = _storage._oneofField {return v} + return .foo + } + set {_uniqueStorage()._oneofField = .oneofEnum(newValue)} + } + + var oneofNullValue: SwiftProtobuf.Google_Protobuf_NullValue { + get { + if case .oneofNullValue(let v)? = _storage._oneofField {return v} + return .nullValue + } + set {_uniqueStorage()._oneofField = .oneofNullValue(newValue)} + } + + /// Well-known types + var optionalBoolWrapper: SwiftProtobuf.Google_Protobuf_BoolValue { + get {return _storage._optionalBoolWrapper ?? SwiftProtobuf.Google_Protobuf_BoolValue()} + set {_uniqueStorage()._optionalBoolWrapper = newValue} + } + /// Returns true if `optionalBoolWrapper` has been explicitly set. + var hasOptionalBoolWrapper: Bool {return _storage._optionalBoolWrapper != nil} + /// Clears the value of `optionalBoolWrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalBoolWrapper() {_uniqueStorage()._optionalBoolWrapper = nil} + + var optionalInt32Wrapper: SwiftProtobuf.Google_Protobuf_Int32Value { + get {return _storage._optionalInt32Wrapper ?? SwiftProtobuf.Google_Protobuf_Int32Value()} + set {_uniqueStorage()._optionalInt32Wrapper = newValue} + } + /// Returns true if `optionalInt32Wrapper` has been explicitly set. + var hasOptionalInt32Wrapper: Bool {return _storage._optionalInt32Wrapper != nil} + /// Clears the value of `optionalInt32Wrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt32Wrapper() {_uniqueStorage()._optionalInt32Wrapper = nil} + + var optionalInt64Wrapper: SwiftProtobuf.Google_Protobuf_Int64Value { + get {return _storage._optionalInt64Wrapper ?? SwiftProtobuf.Google_Protobuf_Int64Value()} + set {_uniqueStorage()._optionalInt64Wrapper = newValue} + } + /// Returns true if `optionalInt64Wrapper` has been explicitly set. + var hasOptionalInt64Wrapper: Bool {return _storage._optionalInt64Wrapper != nil} + /// Clears the value of `optionalInt64Wrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalInt64Wrapper() {_uniqueStorage()._optionalInt64Wrapper = nil} + + var optionalUint32Wrapper: SwiftProtobuf.Google_Protobuf_UInt32Value { + get {return _storage._optionalUint32Wrapper ?? SwiftProtobuf.Google_Protobuf_UInt32Value()} + set {_uniqueStorage()._optionalUint32Wrapper = newValue} + } + /// Returns true if `optionalUint32Wrapper` has been explicitly set. + var hasOptionalUint32Wrapper: Bool {return _storage._optionalUint32Wrapper != nil} + /// Clears the value of `optionalUint32Wrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint32Wrapper() {_uniqueStorage()._optionalUint32Wrapper = nil} + + var optionalUint64Wrapper: SwiftProtobuf.Google_Protobuf_UInt64Value { + get {return _storage._optionalUint64Wrapper ?? SwiftProtobuf.Google_Protobuf_UInt64Value()} + set {_uniqueStorage()._optionalUint64Wrapper = newValue} + } + /// Returns true if `optionalUint64Wrapper` has been explicitly set. + var hasOptionalUint64Wrapper: Bool {return _storage._optionalUint64Wrapper != nil} + /// Clears the value of `optionalUint64Wrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalUint64Wrapper() {_uniqueStorage()._optionalUint64Wrapper = nil} + + var optionalFloatWrapper: SwiftProtobuf.Google_Protobuf_FloatValue { + get {return _storage._optionalFloatWrapper ?? SwiftProtobuf.Google_Protobuf_FloatValue()} + set {_uniqueStorage()._optionalFloatWrapper = newValue} + } + /// Returns true if `optionalFloatWrapper` has been explicitly set. + var hasOptionalFloatWrapper: Bool {return _storage._optionalFloatWrapper != nil} + /// Clears the value of `optionalFloatWrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalFloatWrapper() {_uniqueStorage()._optionalFloatWrapper = nil} + + var optionalDoubleWrapper: SwiftProtobuf.Google_Protobuf_DoubleValue { + get {return _storage._optionalDoubleWrapper ?? SwiftProtobuf.Google_Protobuf_DoubleValue()} + set {_uniqueStorage()._optionalDoubleWrapper = newValue} + } + /// Returns true if `optionalDoubleWrapper` has been explicitly set. + var hasOptionalDoubleWrapper: Bool {return _storage._optionalDoubleWrapper != nil} + /// Clears the value of `optionalDoubleWrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalDoubleWrapper() {_uniqueStorage()._optionalDoubleWrapper = nil} + + var optionalStringWrapper: SwiftProtobuf.Google_Protobuf_StringValue { + get {return _storage._optionalStringWrapper ?? SwiftProtobuf.Google_Protobuf_StringValue()} + set {_uniqueStorage()._optionalStringWrapper = newValue} + } + /// Returns true if `optionalStringWrapper` has been explicitly set. + var hasOptionalStringWrapper: Bool {return _storage._optionalStringWrapper != nil} + /// Clears the value of `optionalStringWrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalStringWrapper() {_uniqueStorage()._optionalStringWrapper = nil} + + var optionalBytesWrapper: SwiftProtobuf.Google_Protobuf_BytesValue { + get {return _storage._optionalBytesWrapper ?? SwiftProtobuf.Google_Protobuf_BytesValue()} + set {_uniqueStorage()._optionalBytesWrapper = newValue} + } + /// Returns true if `optionalBytesWrapper` has been explicitly set. + var hasOptionalBytesWrapper: Bool {return _storage._optionalBytesWrapper != nil} + /// Clears the value of `optionalBytesWrapper`. Subsequent reads from it will return its default value. + mutating func clearOptionalBytesWrapper() {_uniqueStorage()._optionalBytesWrapper = nil} + + var repeatedBoolWrapper: [SwiftProtobuf.Google_Protobuf_BoolValue] { + get {return _storage._repeatedBoolWrapper} + set {_uniqueStorage()._repeatedBoolWrapper = newValue} + } + + var repeatedInt32Wrapper: [SwiftProtobuf.Google_Protobuf_Int32Value] { + get {return _storage._repeatedInt32Wrapper} + set {_uniqueStorage()._repeatedInt32Wrapper = newValue} + } + + var repeatedInt64Wrapper: [SwiftProtobuf.Google_Protobuf_Int64Value] { + get {return _storage._repeatedInt64Wrapper} + set {_uniqueStorage()._repeatedInt64Wrapper = newValue} + } + + var repeatedUint32Wrapper: [SwiftProtobuf.Google_Protobuf_UInt32Value] { + get {return _storage._repeatedUint32Wrapper} + set {_uniqueStorage()._repeatedUint32Wrapper = newValue} + } + + var repeatedUint64Wrapper: [SwiftProtobuf.Google_Protobuf_UInt64Value] { + get {return _storage._repeatedUint64Wrapper} + set {_uniqueStorage()._repeatedUint64Wrapper = newValue} + } + + var repeatedFloatWrapper: [SwiftProtobuf.Google_Protobuf_FloatValue] { + get {return _storage._repeatedFloatWrapper} + set {_uniqueStorage()._repeatedFloatWrapper = newValue} + } + + var repeatedDoubleWrapper: [SwiftProtobuf.Google_Protobuf_DoubleValue] { + get {return _storage._repeatedDoubleWrapper} + set {_uniqueStorage()._repeatedDoubleWrapper = newValue} + } + + var repeatedStringWrapper: [SwiftProtobuf.Google_Protobuf_StringValue] { + get {return _storage._repeatedStringWrapper} + set {_uniqueStorage()._repeatedStringWrapper = newValue} + } + + var repeatedBytesWrapper: [SwiftProtobuf.Google_Protobuf_BytesValue] { + get {return _storage._repeatedBytesWrapper} + set {_uniqueStorage()._repeatedBytesWrapper = newValue} + } + + var optionalDuration: SwiftProtobuf.Google_Protobuf_Duration { + get {return _storage._optionalDuration ?? SwiftProtobuf.Google_Protobuf_Duration()} + set {_uniqueStorage()._optionalDuration = newValue} + } + /// Returns true if `optionalDuration` has been explicitly set. + var hasOptionalDuration: Bool {return _storage._optionalDuration != nil} + /// Clears the value of `optionalDuration`. Subsequent reads from it will return its default value. + mutating func clearOptionalDuration() {_uniqueStorage()._optionalDuration = nil} + + var optionalTimestamp: SwiftProtobuf.Google_Protobuf_Timestamp { + get {return _storage._optionalTimestamp ?? SwiftProtobuf.Google_Protobuf_Timestamp()} + set {_uniqueStorage()._optionalTimestamp = newValue} + } + /// Returns true if `optionalTimestamp` has been explicitly set. + var hasOptionalTimestamp: Bool {return _storage._optionalTimestamp != nil} + /// Clears the value of `optionalTimestamp`. Subsequent reads from it will return its default value. + mutating func clearOptionalTimestamp() {_uniqueStorage()._optionalTimestamp = nil} + + var optionalFieldMask: SwiftProtobuf.Google_Protobuf_FieldMask { + get {return _storage._optionalFieldMask ?? SwiftProtobuf.Google_Protobuf_FieldMask()} + set {_uniqueStorage()._optionalFieldMask = newValue} + } + /// Returns true if `optionalFieldMask` has been explicitly set. + var hasOptionalFieldMask: Bool {return _storage._optionalFieldMask != nil} + /// Clears the value of `optionalFieldMask`. Subsequent reads from it will return its default value. + mutating func clearOptionalFieldMask() {_uniqueStorage()._optionalFieldMask = nil} + + var optionalStruct: SwiftProtobuf.Google_Protobuf_Struct { + get {return _storage._optionalStruct ?? SwiftProtobuf.Google_Protobuf_Struct()} + set {_uniqueStorage()._optionalStruct = newValue} + } + /// Returns true if `optionalStruct` has been explicitly set. + var hasOptionalStruct: Bool {return _storage._optionalStruct != nil} + /// Clears the value of `optionalStruct`. Subsequent reads from it will return its default value. + mutating func clearOptionalStruct() {_uniqueStorage()._optionalStruct = nil} + + var optionalAny: SwiftProtobuf.Google_Protobuf_Any { + get {return _storage._optionalAny ?? SwiftProtobuf.Google_Protobuf_Any()} + set {_uniqueStorage()._optionalAny = newValue} + } + /// Returns true if `optionalAny` has been explicitly set. + var hasOptionalAny: Bool {return _storage._optionalAny != nil} + /// Clears the value of `optionalAny`. Subsequent reads from it will return its default value. + mutating func clearOptionalAny() {_uniqueStorage()._optionalAny = nil} + + var optionalValue: SwiftProtobuf.Google_Protobuf_Value { + get {return _storage._optionalValue ?? SwiftProtobuf.Google_Protobuf_Value()} + set {_uniqueStorage()._optionalValue = newValue} + } + /// Returns true if `optionalValue` has been explicitly set. + var hasOptionalValue: Bool {return _storage._optionalValue != nil} + /// Clears the value of `optionalValue`. Subsequent reads from it will return its default value. + mutating func clearOptionalValue() {_uniqueStorage()._optionalValue = nil} + + var optionalNullValue: SwiftProtobuf.Google_Protobuf_NullValue { + get {return _storage._optionalNullValue} + set {_uniqueStorage()._optionalNullValue = newValue} + } + + var repeatedDuration: [SwiftProtobuf.Google_Protobuf_Duration] { + get {return _storage._repeatedDuration} + set {_uniqueStorage()._repeatedDuration = newValue} + } + + var repeatedTimestamp: [SwiftProtobuf.Google_Protobuf_Timestamp] { + get {return _storage._repeatedTimestamp} + set {_uniqueStorage()._repeatedTimestamp = newValue} + } + + var repeatedFieldmask: [SwiftProtobuf.Google_Protobuf_FieldMask] { + get {return _storage._repeatedFieldmask} + set {_uniqueStorage()._repeatedFieldmask = newValue} + } + + var repeatedStruct: [SwiftProtobuf.Google_Protobuf_Struct] { + get {return _storage._repeatedStruct} + set {_uniqueStorage()._repeatedStruct = newValue} + } + + var repeatedAny: [SwiftProtobuf.Google_Protobuf_Any] { + get {return _storage._repeatedAny} + set {_uniqueStorage()._repeatedAny = newValue} + } + + var repeatedValue: [SwiftProtobuf.Google_Protobuf_Value] { + get {return _storage._repeatedValue} + set {_uniqueStorage()._repeatedValue = newValue} + } + + var repeatedListValue: [SwiftProtobuf.Google_Protobuf_ListValue] { + get {return _storage._repeatedListValue} + set {_uniqueStorage()._repeatedListValue = newValue} + } + + /// Test field-name-to-JSON-name convention. + /// (protobuf says names can be any valid C/C++ identifier.) + var fieldname1: Int32 { + get {return _storage._fieldname1} + set {_uniqueStorage()._fieldname1 = newValue} + } + + var fieldName2: Int32 { + get {return _storage._fieldName2} + set {_uniqueStorage()._fieldName2 = newValue} + } + + var fieldName3: Int32 { + get {return _storage._fieldName3} + set {_uniqueStorage()._fieldName3 = newValue} + } + + var field_Name4_: Int32 { + get {return _storage._field_Name4_} + set {_uniqueStorage()._field_Name4_ = newValue} + } + + var field0Name5: Int32 { + get {return _storage._field0Name5} + set {_uniqueStorage()._field0Name5 = newValue} + } + + var field0Name6: Int32 { + get {return _storage._field0Name6} + set {_uniqueStorage()._field0Name6 = newValue} + } + + var fieldName7: Int32 { + get {return _storage._fieldName7} + set {_uniqueStorage()._fieldName7 = newValue} + } + + var fieldName8: Int32 { + get {return _storage._fieldName8} + set {_uniqueStorage()._fieldName8 = newValue} + } + + var fieldName9: Int32 { + get {return _storage._fieldName9} + set {_uniqueStorage()._fieldName9 = newValue} + } + + var fieldName10: Int32 { + get {return _storage._fieldName10} + set {_uniqueStorage()._fieldName10 = newValue} + } + + var fieldName11: Int32 { + get {return _storage._fieldName11} + set {_uniqueStorage()._fieldName11 = newValue} + } + + var fieldName12: Int32 { + get {return _storage._fieldName12} + set {_uniqueStorage()._fieldName12 = newValue} + } + + var _FieldName13: Int32 { + get {return _storage.__FieldName13} + set {_uniqueStorage().__FieldName13 = newValue} + } + + var _FieldName14: Int32 { + get {return _storage.__FieldName14} + set {_uniqueStorage().__FieldName14 = newValue} + } + + var field_Name15: Int32 { + get {return _storage._field_Name15} + set {_uniqueStorage()._field_Name15 = newValue} + } + + var field_Name16: Int32 { + get {return _storage._field_Name16} + set {_uniqueStorage()._field_Name16 = newValue} + } + + var fieldName17__: Int32 { + get {return _storage._fieldName17__} + set {_uniqueStorage()._fieldName17__ = newValue} + } + + var fieldName18__: Int32 { + get {return _storage._fieldName18__} + set {_uniqueStorage()._fieldName18__ = newValue} + } + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum OneOf_OneofField: Equatable { + case oneofUint32(UInt32) + case oneofNestedMessage(ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage) + case oneofString(String) + case oneofBytes(Data) + case oneofBool(Bool) + case oneofUint64(UInt64) + case oneofFloat(Float) + case oneofDouble(Double) + case oneofEnum(ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum) + case oneofNullValue(SwiftProtobuf.Google_Protobuf_NullValue) + + } + + enum NestedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case foo // = 0 + case bar // = 1 + case baz // = 2 + + /// Intentionally negative. + case neg // = -1 + case UNRECOGNIZED(Int) + + init() { + self = .foo + } + + init?(rawValue: Int) { + switch rawValue { + case -1: self = .neg + case 0: self = .foo + case 1: self = .bar + case 2: self = .baz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .neg: return -1 + case .foo: return 0 + case .bar: return 1 + case .baz: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum] = [ + .foo, + .bar, + .baz, + .neg, + ] + + } + + enum AliasedEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case aliasFoo // = 0 + case aliasBar // = 1 + case aliasBaz // = 2 + static let moo = aliasBaz + static let bAz = aliasBaz + case UNRECOGNIZED(Int) + + init() { + self = .aliasFoo + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .aliasFoo + case 1: self = .aliasBar + case 2: self = .aliasBaz + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .aliasFoo: return 0 + case .aliasBar: return 1 + case .aliasBaz: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [ProtobufTestMessages_Proto3_TestAllTypesProto3.AliasedEnum] = [ + .aliasFoo, + .aliasBar, + .aliasBaz, + ] + + } + + struct NestedMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var a: Int32 { + get {return _storage._a} + set {_uniqueStorage()._a = newValue} + } + + var corecursive: ProtobufTestMessages_Proto3_TestAllTypesProto3 { + get {return _storage._corecursive ?? ProtobufTestMessages_Proto3_TestAllTypesProto3()} + set {_uniqueStorage()._corecursive = newValue} + } + /// Returns true if `corecursive` has been explicitly set. + var hasCorecursive: Bool {return _storage._corecursive != nil} + /// Clears the value of `corecursive`. Subsequent reads from it will return its default value. + mutating func clearCorecursive() {_uniqueStorage()._corecursive = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance + } + + init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +struct ProtobufTestMessages_Proto3_ForeignMessage { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var c: Int32 = 0 + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufTestMessages_Proto3_NullHypothesisProto3 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +struct ProtobufTestMessages_Proto3_EnumOnlyProto3 { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum BoolEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case kFalse // = 0 + case kTrue // = 1 + case UNRECOGNIZED(Int) + + init() { + self = .kFalse + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .kFalse + case 1: self = .kTrue + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .kFalse: return 0 + case .kTrue: return 1 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [ProtobufTestMessages_Proto3_EnumOnlyProto3.BoolEnum] = [ + .kFalse, + .kTrue, + ] + + } + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension ProtobufTestMessages_Proto3_TestAllTypesProto3: @unchecked Sendable {} +extension ProtobufTestMessages_Proto3_TestAllTypesProto3.OneOf_OneofField: @unchecked Sendable {} +extension ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage: @unchecked Sendable {} +extension ProtobufTestMessages_Proto3_ForeignMessage: @unchecked Sendable {} +extension ProtobufTestMessages_Proto3_NullHypothesisProto3: @unchecked Sendable {} +extension ProtobufTestMessages_Proto3_EnumOnlyProto3: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_test_messages.proto3" + +extension ProtobufTestMessages_Proto3_ForeignEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FOREIGN_FOO"), + 1: .same(proto: "FOREIGN_BAR"), + 2: .same(proto: "FOREIGN_BAZ"), + ] +} + +extension ProtobufTestMessages_Proto3_TestAllTypesProto3: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".TestAllTypesProto3" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "optional_int32"), + 2: .standard(proto: "optional_int64"), + 3: .standard(proto: "optional_uint32"), + 4: .standard(proto: "optional_uint64"), + 5: .standard(proto: "optional_sint32"), + 6: .standard(proto: "optional_sint64"), + 7: .standard(proto: "optional_fixed32"), + 8: .standard(proto: "optional_fixed64"), + 9: .standard(proto: "optional_sfixed32"), + 10: .standard(proto: "optional_sfixed64"), + 11: .standard(proto: "optional_float"), + 12: .standard(proto: "optional_double"), + 13: .standard(proto: "optional_bool"), + 14: .standard(proto: "optional_string"), + 15: .standard(proto: "optional_bytes"), + 18: .standard(proto: "optional_nested_message"), + 19: .standard(proto: "optional_foreign_message"), + 21: .standard(proto: "optional_nested_enum"), + 22: .standard(proto: "optional_foreign_enum"), + 23: .standard(proto: "optional_aliased_enum"), + 24: .standard(proto: "optional_string_piece"), + 25: .standard(proto: "optional_cord"), + 27: .standard(proto: "recursive_message"), + 31: .standard(proto: "repeated_int32"), + 32: .standard(proto: "repeated_int64"), + 33: .standard(proto: "repeated_uint32"), + 34: .standard(proto: "repeated_uint64"), + 35: .standard(proto: "repeated_sint32"), + 36: .standard(proto: "repeated_sint64"), + 37: .standard(proto: "repeated_fixed32"), + 38: .standard(proto: "repeated_fixed64"), + 39: .standard(proto: "repeated_sfixed32"), + 40: .standard(proto: "repeated_sfixed64"), + 41: .standard(proto: "repeated_float"), + 42: .standard(proto: "repeated_double"), + 43: .standard(proto: "repeated_bool"), + 44: .standard(proto: "repeated_string"), + 45: .standard(proto: "repeated_bytes"), + 48: .standard(proto: "repeated_nested_message"), + 49: .standard(proto: "repeated_foreign_message"), + 51: .standard(proto: "repeated_nested_enum"), + 52: .standard(proto: "repeated_foreign_enum"), + 54: .standard(proto: "repeated_string_piece"), + 55: .standard(proto: "repeated_cord"), + 75: .standard(proto: "packed_int32"), + 76: .standard(proto: "packed_int64"), + 77: .standard(proto: "packed_uint32"), + 78: .standard(proto: "packed_uint64"), + 79: .standard(proto: "packed_sint32"), + 80: .standard(proto: "packed_sint64"), + 81: .standard(proto: "packed_fixed32"), + 82: .standard(proto: "packed_fixed64"), + 83: .standard(proto: "packed_sfixed32"), + 84: .standard(proto: "packed_sfixed64"), + 85: .standard(proto: "packed_float"), + 86: .standard(proto: "packed_double"), + 87: .standard(proto: "packed_bool"), + 88: .standard(proto: "packed_nested_enum"), + 89: .standard(proto: "unpacked_int32"), + 90: .standard(proto: "unpacked_int64"), + 91: .standard(proto: "unpacked_uint32"), + 92: .standard(proto: "unpacked_uint64"), + 93: .standard(proto: "unpacked_sint32"), + 94: .standard(proto: "unpacked_sint64"), + 95: .standard(proto: "unpacked_fixed32"), + 96: .standard(proto: "unpacked_fixed64"), + 97: .standard(proto: "unpacked_sfixed32"), + 98: .standard(proto: "unpacked_sfixed64"), + 99: .standard(proto: "unpacked_float"), + 100: .standard(proto: "unpacked_double"), + 101: .standard(proto: "unpacked_bool"), + 102: .standard(proto: "unpacked_nested_enum"), + 56: .standard(proto: "map_int32_int32"), + 57: .standard(proto: "map_int64_int64"), + 58: .standard(proto: "map_uint32_uint32"), + 59: .standard(proto: "map_uint64_uint64"), + 60: .standard(proto: "map_sint32_sint32"), + 61: .standard(proto: "map_sint64_sint64"), + 62: .standard(proto: "map_fixed32_fixed32"), + 63: .standard(proto: "map_fixed64_fixed64"), + 64: .standard(proto: "map_sfixed32_sfixed32"), + 65: .standard(proto: "map_sfixed64_sfixed64"), + 66: .standard(proto: "map_int32_float"), + 67: .standard(proto: "map_int32_double"), + 68: .standard(proto: "map_bool_bool"), + 69: .standard(proto: "map_string_string"), + 70: .standard(proto: "map_string_bytes"), + 71: .standard(proto: "map_string_nested_message"), + 72: .standard(proto: "map_string_foreign_message"), + 73: .standard(proto: "map_string_nested_enum"), + 74: .standard(proto: "map_string_foreign_enum"), + 111: .standard(proto: "oneof_uint32"), + 112: .standard(proto: "oneof_nested_message"), + 113: .standard(proto: "oneof_string"), + 114: .standard(proto: "oneof_bytes"), + 115: .standard(proto: "oneof_bool"), + 116: .standard(proto: "oneof_uint64"), + 117: .standard(proto: "oneof_float"), + 118: .standard(proto: "oneof_double"), + 119: .standard(proto: "oneof_enum"), + 120: .standard(proto: "oneof_null_value"), + 201: .standard(proto: "optional_bool_wrapper"), + 202: .standard(proto: "optional_int32_wrapper"), + 203: .standard(proto: "optional_int64_wrapper"), + 204: .standard(proto: "optional_uint32_wrapper"), + 205: .standard(proto: "optional_uint64_wrapper"), + 206: .standard(proto: "optional_float_wrapper"), + 207: .standard(proto: "optional_double_wrapper"), + 208: .standard(proto: "optional_string_wrapper"), + 209: .standard(proto: "optional_bytes_wrapper"), + 211: .standard(proto: "repeated_bool_wrapper"), + 212: .standard(proto: "repeated_int32_wrapper"), + 213: .standard(proto: "repeated_int64_wrapper"), + 214: .standard(proto: "repeated_uint32_wrapper"), + 215: .standard(proto: "repeated_uint64_wrapper"), + 216: .standard(proto: "repeated_float_wrapper"), + 217: .standard(proto: "repeated_double_wrapper"), + 218: .standard(proto: "repeated_string_wrapper"), + 219: .standard(proto: "repeated_bytes_wrapper"), + 301: .standard(proto: "optional_duration"), + 302: .standard(proto: "optional_timestamp"), + 303: .standard(proto: "optional_field_mask"), + 304: .standard(proto: "optional_struct"), + 305: .standard(proto: "optional_any"), + 306: .standard(proto: "optional_value"), + 307: .standard(proto: "optional_null_value"), + 311: .standard(proto: "repeated_duration"), + 312: .standard(proto: "repeated_timestamp"), + 313: .standard(proto: "repeated_fieldmask"), + 324: .standard(proto: "repeated_struct"), + 315: .standard(proto: "repeated_any"), + 316: .standard(proto: "repeated_value"), + 317: .standard(proto: "repeated_list_value"), + 401: .same(proto: "fieldname1"), + 402: .standard(proto: "field_name2"), + 403: .standard(proto: "_field_name3"), + 404: .standard(proto: "field__name4_"), + 405: .same(proto: "field0name5"), + 406: .standard(proto: "field_0_name6"), + 407: .same(proto: "fieldName7"), + 408: .same(proto: "FieldName8"), + 409: .standard(proto: "field_Name9"), + 410: .standard(proto: "Field_Name10"), + 411: .standard(proto: "FIELD_NAME11"), + 412: .standard(proto: "FIELD_name12"), + 413: .standard(proto: "__field_name13"), + 414: .standard(proto: "__Field_name14"), + 415: .standard(proto: "field__name15"), + 416: .standard(proto: "field__Name16"), + 417: .standard(proto: "field_name17__"), + 418: .standard(proto: "Field_name18__"), + ] + + fileprivate class _StorageClass { + var _optionalInt32: Int32 = 0 + var _optionalInt64: Int64 = 0 + var _optionalUint32: UInt32 = 0 + var _optionalUint64: UInt64 = 0 + var _optionalSint32: Int32 = 0 + var _optionalSint64: Int64 = 0 + var _optionalFixed32: UInt32 = 0 + var _optionalFixed64: UInt64 = 0 + var _optionalSfixed32: Int32 = 0 + var _optionalSfixed64: Int64 = 0 + var _optionalFloat: Float = 0 + var _optionalDouble: Double = 0 + var _optionalBool: Bool = false + var _optionalString: String = String() + var _optionalBytes: Data = Data() + var _optionalNestedMessage: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage? = nil + var _optionalForeignMessage: ProtobufTestMessages_Proto3_ForeignMessage? = nil + var _optionalNestedEnum: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum = .foo + var _optionalForeignEnum: ProtobufTestMessages_Proto3_ForeignEnum = .foreignFoo + var _optionalAliasedEnum: ProtobufTestMessages_Proto3_TestAllTypesProto3.AliasedEnum = .aliasFoo + var _optionalStringPiece: String = String() + var _optionalCord: String = String() + var _recursiveMessage: ProtobufTestMessages_Proto3_TestAllTypesProto3? = nil + var _repeatedInt32: [Int32] = [] + var _repeatedInt64: [Int64] = [] + var _repeatedUint32: [UInt32] = [] + var _repeatedUint64: [UInt64] = [] + var _repeatedSint32: [Int32] = [] + var _repeatedSint64: [Int64] = [] + var _repeatedFixed32: [UInt32] = [] + var _repeatedFixed64: [UInt64] = [] + var _repeatedSfixed32: [Int32] = [] + var _repeatedSfixed64: [Int64] = [] + var _repeatedFloat: [Float] = [] + var _repeatedDouble: [Double] = [] + var _repeatedBool: [Bool] = [] + var _repeatedString: [String] = [] + var _repeatedBytes: [Data] = [] + var _repeatedNestedMessage: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage] = [] + var _repeatedForeignMessage: [ProtobufTestMessages_Proto3_ForeignMessage] = [] + var _repeatedNestedEnum: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum] = [] + var _repeatedForeignEnum: [ProtobufTestMessages_Proto3_ForeignEnum] = [] + var _repeatedStringPiece: [String] = [] + var _repeatedCord: [String] = [] + var _packedInt32: [Int32] = [] + var _packedInt64: [Int64] = [] + var _packedUint32: [UInt32] = [] + var _packedUint64: [UInt64] = [] + var _packedSint32: [Int32] = [] + var _packedSint64: [Int64] = [] + var _packedFixed32: [UInt32] = [] + var _packedFixed64: [UInt64] = [] + var _packedSfixed32: [Int32] = [] + var _packedSfixed64: [Int64] = [] + var _packedFloat: [Float] = [] + var _packedDouble: [Double] = [] + var _packedBool: [Bool] = [] + var _packedNestedEnum: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum] = [] + var _unpackedInt32: [Int32] = [] + var _unpackedInt64: [Int64] = [] + var _unpackedUint32: [UInt32] = [] + var _unpackedUint64: [UInt64] = [] + var _unpackedSint32: [Int32] = [] + var _unpackedSint64: [Int64] = [] + var _unpackedFixed32: [UInt32] = [] + var _unpackedFixed64: [UInt64] = [] + var _unpackedSfixed32: [Int32] = [] + var _unpackedSfixed64: [Int64] = [] + var _unpackedFloat: [Float] = [] + var _unpackedDouble: [Double] = [] + var _unpackedBool: [Bool] = [] + var _unpackedNestedEnum: [ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum] = [] + var _mapInt32Int32: Dictionary = [:] + var _mapInt64Int64: Dictionary = [:] + var _mapUint32Uint32: Dictionary = [:] + var _mapUint64Uint64: Dictionary = [:] + var _mapSint32Sint32: Dictionary = [:] + var _mapSint64Sint64: Dictionary = [:] + var _mapFixed32Fixed32: Dictionary = [:] + var _mapFixed64Fixed64: Dictionary = [:] + var _mapSfixed32Sfixed32: Dictionary = [:] + var _mapSfixed64Sfixed64: Dictionary = [:] + var _mapInt32Float: Dictionary = [:] + var _mapInt32Double: Dictionary = [:] + var _mapBoolBool: Dictionary = [:] + var _mapStringString: Dictionary = [:] + var _mapStringBytes: Dictionary = [:] + var _mapStringNestedMessage: Dictionary = [:] + var _mapStringForeignMessage: Dictionary = [:] + var _mapStringNestedEnum: Dictionary = [:] + var _mapStringForeignEnum: Dictionary = [:] + var _oneofField: ProtobufTestMessages_Proto3_TestAllTypesProto3.OneOf_OneofField? + var _optionalBoolWrapper: SwiftProtobuf.Google_Protobuf_BoolValue? = nil + var _optionalInt32Wrapper: SwiftProtobuf.Google_Protobuf_Int32Value? = nil + var _optionalInt64Wrapper: SwiftProtobuf.Google_Protobuf_Int64Value? = nil + var _optionalUint32Wrapper: SwiftProtobuf.Google_Protobuf_UInt32Value? = nil + var _optionalUint64Wrapper: SwiftProtobuf.Google_Protobuf_UInt64Value? = nil + var _optionalFloatWrapper: SwiftProtobuf.Google_Protobuf_FloatValue? = nil + var _optionalDoubleWrapper: SwiftProtobuf.Google_Protobuf_DoubleValue? = nil + var _optionalStringWrapper: SwiftProtobuf.Google_Protobuf_StringValue? = nil + var _optionalBytesWrapper: SwiftProtobuf.Google_Protobuf_BytesValue? = nil + var _repeatedBoolWrapper: [SwiftProtobuf.Google_Protobuf_BoolValue] = [] + var _repeatedInt32Wrapper: [SwiftProtobuf.Google_Protobuf_Int32Value] = [] + var _repeatedInt64Wrapper: [SwiftProtobuf.Google_Protobuf_Int64Value] = [] + var _repeatedUint32Wrapper: [SwiftProtobuf.Google_Protobuf_UInt32Value] = [] + var _repeatedUint64Wrapper: [SwiftProtobuf.Google_Protobuf_UInt64Value] = [] + var _repeatedFloatWrapper: [SwiftProtobuf.Google_Protobuf_FloatValue] = [] + var _repeatedDoubleWrapper: [SwiftProtobuf.Google_Protobuf_DoubleValue] = [] + var _repeatedStringWrapper: [SwiftProtobuf.Google_Protobuf_StringValue] = [] + var _repeatedBytesWrapper: [SwiftProtobuf.Google_Protobuf_BytesValue] = [] + var _optionalDuration: SwiftProtobuf.Google_Protobuf_Duration? = nil + var _optionalTimestamp: SwiftProtobuf.Google_Protobuf_Timestamp? = nil + var _optionalFieldMask: SwiftProtobuf.Google_Protobuf_FieldMask? = nil + var _optionalStruct: SwiftProtobuf.Google_Protobuf_Struct? = nil + var _optionalAny: SwiftProtobuf.Google_Protobuf_Any? = nil + var _optionalValue: SwiftProtobuf.Google_Protobuf_Value? = nil + var _optionalNullValue: SwiftProtobuf.Google_Protobuf_NullValue = .nullValue + var _repeatedDuration: [SwiftProtobuf.Google_Protobuf_Duration] = [] + var _repeatedTimestamp: [SwiftProtobuf.Google_Protobuf_Timestamp] = [] + var _repeatedFieldmask: [SwiftProtobuf.Google_Protobuf_FieldMask] = [] + var _repeatedStruct: [SwiftProtobuf.Google_Protobuf_Struct] = [] + var _repeatedAny: [SwiftProtobuf.Google_Protobuf_Any] = [] + var _repeatedValue: [SwiftProtobuf.Google_Protobuf_Value] = [] + var _repeatedListValue: [SwiftProtobuf.Google_Protobuf_ListValue] = [] + var _fieldname1: Int32 = 0 + var _fieldName2: Int32 = 0 + var _fieldName3: Int32 = 0 + var _field_Name4_: Int32 = 0 + var _field0Name5: Int32 = 0 + var _field0Name6: Int32 = 0 + var _fieldName7: Int32 = 0 + var _fieldName8: Int32 = 0 + var _fieldName9: Int32 = 0 + var _fieldName10: Int32 = 0 + var _fieldName11: Int32 = 0 + var _fieldName12: Int32 = 0 + var __FieldName13: Int32 = 0 + var __FieldName14: Int32 = 0 + var _field_Name15: Int32 = 0 + var _field_Name16: Int32 = 0 + var _fieldName17__: Int32 = 0 + var _fieldName18__: Int32 = 0 + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _optionalInt32 = source._optionalInt32 + _optionalInt64 = source._optionalInt64 + _optionalUint32 = source._optionalUint32 + _optionalUint64 = source._optionalUint64 + _optionalSint32 = source._optionalSint32 + _optionalSint64 = source._optionalSint64 + _optionalFixed32 = source._optionalFixed32 + _optionalFixed64 = source._optionalFixed64 + _optionalSfixed32 = source._optionalSfixed32 + _optionalSfixed64 = source._optionalSfixed64 + _optionalFloat = source._optionalFloat + _optionalDouble = source._optionalDouble + _optionalBool = source._optionalBool + _optionalString = source._optionalString + _optionalBytes = source._optionalBytes + _optionalNestedMessage = source._optionalNestedMessage + _optionalForeignMessage = source._optionalForeignMessage + _optionalNestedEnum = source._optionalNestedEnum + _optionalForeignEnum = source._optionalForeignEnum + _optionalAliasedEnum = source._optionalAliasedEnum + _optionalStringPiece = source._optionalStringPiece + _optionalCord = source._optionalCord + _recursiveMessage = source._recursiveMessage + _repeatedInt32 = source._repeatedInt32 + _repeatedInt64 = source._repeatedInt64 + _repeatedUint32 = source._repeatedUint32 + _repeatedUint64 = source._repeatedUint64 + _repeatedSint32 = source._repeatedSint32 + _repeatedSint64 = source._repeatedSint64 + _repeatedFixed32 = source._repeatedFixed32 + _repeatedFixed64 = source._repeatedFixed64 + _repeatedSfixed32 = source._repeatedSfixed32 + _repeatedSfixed64 = source._repeatedSfixed64 + _repeatedFloat = source._repeatedFloat + _repeatedDouble = source._repeatedDouble + _repeatedBool = source._repeatedBool + _repeatedString = source._repeatedString + _repeatedBytes = source._repeatedBytes + _repeatedNestedMessage = source._repeatedNestedMessage + _repeatedForeignMessage = source._repeatedForeignMessage + _repeatedNestedEnum = source._repeatedNestedEnum + _repeatedForeignEnum = source._repeatedForeignEnum + _repeatedStringPiece = source._repeatedStringPiece + _repeatedCord = source._repeatedCord + _packedInt32 = source._packedInt32 + _packedInt64 = source._packedInt64 + _packedUint32 = source._packedUint32 + _packedUint64 = source._packedUint64 + _packedSint32 = source._packedSint32 + _packedSint64 = source._packedSint64 + _packedFixed32 = source._packedFixed32 + _packedFixed64 = source._packedFixed64 + _packedSfixed32 = source._packedSfixed32 + _packedSfixed64 = source._packedSfixed64 + _packedFloat = source._packedFloat + _packedDouble = source._packedDouble + _packedBool = source._packedBool + _packedNestedEnum = source._packedNestedEnum + _unpackedInt32 = source._unpackedInt32 + _unpackedInt64 = source._unpackedInt64 + _unpackedUint32 = source._unpackedUint32 + _unpackedUint64 = source._unpackedUint64 + _unpackedSint32 = source._unpackedSint32 + _unpackedSint64 = source._unpackedSint64 + _unpackedFixed32 = source._unpackedFixed32 + _unpackedFixed64 = source._unpackedFixed64 + _unpackedSfixed32 = source._unpackedSfixed32 + _unpackedSfixed64 = source._unpackedSfixed64 + _unpackedFloat = source._unpackedFloat + _unpackedDouble = source._unpackedDouble + _unpackedBool = source._unpackedBool + _unpackedNestedEnum = source._unpackedNestedEnum + _mapInt32Int32 = source._mapInt32Int32 + _mapInt64Int64 = source._mapInt64Int64 + _mapUint32Uint32 = source._mapUint32Uint32 + _mapUint64Uint64 = source._mapUint64Uint64 + _mapSint32Sint32 = source._mapSint32Sint32 + _mapSint64Sint64 = source._mapSint64Sint64 + _mapFixed32Fixed32 = source._mapFixed32Fixed32 + _mapFixed64Fixed64 = source._mapFixed64Fixed64 + _mapSfixed32Sfixed32 = source._mapSfixed32Sfixed32 + _mapSfixed64Sfixed64 = source._mapSfixed64Sfixed64 + _mapInt32Float = source._mapInt32Float + _mapInt32Double = source._mapInt32Double + _mapBoolBool = source._mapBoolBool + _mapStringString = source._mapStringString + _mapStringBytes = source._mapStringBytes + _mapStringNestedMessage = source._mapStringNestedMessage + _mapStringForeignMessage = source._mapStringForeignMessage + _mapStringNestedEnum = source._mapStringNestedEnum + _mapStringForeignEnum = source._mapStringForeignEnum + _oneofField = source._oneofField + _optionalBoolWrapper = source._optionalBoolWrapper + _optionalInt32Wrapper = source._optionalInt32Wrapper + _optionalInt64Wrapper = source._optionalInt64Wrapper + _optionalUint32Wrapper = source._optionalUint32Wrapper + _optionalUint64Wrapper = source._optionalUint64Wrapper + _optionalFloatWrapper = source._optionalFloatWrapper + _optionalDoubleWrapper = source._optionalDoubleWrapper + _optionalStringWrapper = source._optionalStringWrapper + _optionalBytesWrapper = source._optionalBytesWrapper + _repeatedBoolWrapper = source._repeatedBoolWrapper + _repeatedInt32Wrapper = source._repeatedInt32Wrapper + _repeatedInt64Wrapper = source._repeatedInt64Wrapper + _repeatedUint32Wrapper = source._repeatedUint32Wrapper + _repeatedUint64Wrapper = source._repeatedUint64Wrapper + _repeatedFloatWrapper = source._repeatedFloatWrapper + _repeatedDoubleWrapper = source._repeatedDoubleWrapper + _repeatedStringWrapper = source._repeatedStringWrapper + _repeatedBytesWrapper = source._repeatedBytesWrapper + _optionalDuration = source._optionalDuration + _optionalTimestamp = source._optionalTimestamp + _optionalFieldMask = source._optionalFieldMask + _optionalStruct = source._optionalStruct + _optionalAny = source._optionalAny + _optionalValue = source._optionalValue + _optionalNullValue = source._optionalNullValue + _repeatedDuration = source._repeatedDuration + _repeatedTimestamp = source._repeatedTimestamp + _repeatedFieldmask = source._repeatedFieldmask + _repeatedStruct = source._repeatedStruct + _repeatedAny = source._repeatedAny + _repeatedValue = source._repeatedValue + _repeatedListValue = source._repeatedListValue + _fieldname1 = source._fieldname1 + _fieldName2 = source._fieldName2 + _fieldName3 = source._fieldName3 + _field_Name4_ = source._field_Name4_ + _field0Name5 = source._field0Name5 + _field0Name6 = source._field0Name6 + _fieldName7 = source._fieldName7 + _fieldName8 = source._fieldName8 + _fieldName9 = source._fieldName9 + _fieldName10 = source._fieldName10 + _fieldName11 = source._fieldName11 + _fieldName12 = source._fieldName12 + __FieldName13 = source.__FieldName13 + __FieldName14 = source.__FieldName14 + _field_Name15 = source._field_Name15 + _field_Name16 = source._field_Name16 + _fieldName17__ = source._fieldName17__ + _fieldName18__ = source._fieldName18__ + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._optionalInt32) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._optionalInt64) }() + case 3: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint32) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._optionalUint64) }() + case 5: try { try decoder.decodeSingularSInt32Field(value: &_storage._optionalSint32) }() + case 6: try { try decoder.decodeSingularSInt64Field(value: &_storage._optionalSint64) }() + case 7: try { try decoder.decodeSingularFixed32Field(value: &_storage._optionalFixed32) }() + case 8: try { try decoder.decodeSingularFixed64Field(value: &_storage._optionalFixed64) }() + case 9: try { try decoder.decodeSingularSFixed32Field(value: &_storage._optionalSfixed32) }() + case 10: try { try decoder.decodeSingularSFixed64Field(value: &_storage._optionalSfixed64) }() + case 11: try { try decoder.decodeSingularFloatField(value: &_storage._optionalFloat) }() + case 12: try { try decoder.decodeSingularDoubleField(value: &_storage._optionalDouble) }() + case 13: try { try decoder.decodeSingularBoolField(value: &_storage._optionalBool) }() + case 14: try { try decoder.decodeSingularStringField(value: &_storage._optionalString) }() + case 15: try { try decoder.decodeSingularBytesField(value: &_storage._optionalBytes) }() + case 18: try { try decoder.decodeSingularMessageField(value: &_storage._optionalNestedMessage) }() + case 19: try { try decoder.decodeSingularMessageField(value: &_storage._optionalForeignMessage) }() + case 21: try { try decoder.decodeSingularEnumField(value: &_storage._optionalNestedEnum) }() + case 22: try { try decoder.decodeSingularEnumField(value: &_storage._optionalForeignEnum) }() + case 23: try { try decoder.decodeSingularEnumField(value: &_storage._optionalAliasedEnum) }() + case 24: try { try decoder.decodeSingularStringField(value: &_storage._optionalStringPiece) }() + case 25: try { try decoder.decodeSingularStringField(value: &_storage._optionalCord) }() + case 27: try { try decoder.decodeSingularMessageField(value: &_storage._recursiveMessage) }() + case 31: try { try decoder.decodeRepeatedInt32Field(value: &_storage._repeatedInt32) }() + case 32: try { try decoder.decodeRepeatedInt64Field(value: &_storage._repeatedInt64) }() + case 33: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._repeatedUint32) }() + case 34: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._repeatedUint64) }() + case 35: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._repeatedSint32) }() + case 36: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._repeatedSint64) }() + case 37: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._repeatedFixed32) }() + case 38: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._repeatedFixed64) }() + case 39: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._repeatedSfixed32) }() + case 40: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._repeatedSfixed64) }() + case 41: try { try decoder.decodeRepeatedFloatField(value: &_storage._repeatedFloat) }() + case 42: try { try decoder.decodeRepeatedDoubleField(value: &_storage._repeatedDouble) }() + case 43: try { try decoder.decodeRepeatedBoolField(value: &_storage._repeatedBool) }() + case 44: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedString) }() + case 45: try { try decoder.decodeRepeatedBytesField(value: &_storage._repeatedBytes) }() + case 48: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedNestedMessage) }() + case 49: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedForeignMessage) }() + case 51: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedNestedEnum) }() + case 52: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedForeignEnum) }() + case 54: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedStringPiece) }() + case 55: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedCord) }() + case 56: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Int32) }() + case 57: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt64Int64) }() + case 58: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapUint32Uint32) }() + case 59: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapUint64Uint64) }() + case 60: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSint32Sint32) }() + case 61: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSint64Sint64) }() + case 62: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapFixed32Fixed32) }() + case 63: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapFixed64Fixed64) }() + case 64: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSfixed32Sfixed32) }() + case 65: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapSfixed64Sfixed64) }() + case 66: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Float) }() + case 67: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapInt32Double) }() + case 68: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapBoolBool) }() + case 69: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapStringString) }() + case 70: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._mapStringBytes) }() + case 71: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._mapStringNestedMessage) }() + case 72: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &_storage._mapStringForeignMessage) }() + case 73: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &_storage._mapStringNestedEnum) }() + case 74: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: &_storage._mapStringForeignEnum) }() + case 75: try { try decoder.decodeRepeatedInt32Field(value: &_storage._packedInt32) }() + case 76: try { try decoder.decodeRepeatedInt64Field(value: &_storage._packedInt64) }() + case 77: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._packedUint32) }() + case 78: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._packedUint64) }() + case 79: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._packedSint32) }() + case 80: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._packedSint64) }() + case 81: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._packedFixed32) }() + case 82: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._packedFixed64) }() + case 83: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._packedSfixed32) }() + case 84: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._packedSfixed64) }() + case 85: try { try decoder.decodeRepeatedFloatField(value: &_storage._packedFloat) }() + case 86: try { try decoder.decodeRepeatedDoubleField(value: &_storage._packedDouble) }() + case 87: try { try decoder.decodeRepeatedBoolField(value: &_storage._packedBool) }() + case 88: try { try decoder.decodeRepeatedEnumField(value: &_storage._packedNestedEnum) }() + case 89: try { try decoder.decodeRepeatedInt32Field(value: &_storage._unpackedInt32) }() + case 90: try { try decoder.decodeRepeatedInt64Field(value: &_storage._unpackedInt64) }() + case 91: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._unpackedUint32) }() + case 92: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._unpackedUint64) }() + case 93: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._unpackedSint32) }() + case 94: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._unpackedSint64) }() + case 95: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._unpackedFixed32) }() + case 96: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._unpackedFixed64) }() + case 97: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._unpackedSfixed32) }() + case 98: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._unpackedSfixed64) }() + case 99: try { try decoder.decodeRepeatedFloatField(value: &_storage._unpackedFloat) }() + case 100: try { try decoder.decodeRepeatedDoubleField(value: &_storage._unpackedDouble) }() + case 101: try { try decoder.decodeRepeatedBoolField(value: &_storage._unpackedBool) }() + case 102: try { try decoder.decodeRepeatedEnumField(value: &_storage._unpackedNestedEnum) }() + case 111: try { + var v: UInt32? + try decoder.decodeSingularUInt32Field(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofUint32(v) + } + }() + case 112: try { + var v: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage? + var hadOneofValue = false + if let current = _storage._oneofField { + hadOneofValue = true + if case .oneofNestedMessage(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofNestedMessage(v) + } + }() + case 113: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofString(v) + } + }() + case 114: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofBytes(v) + } + }() + case 115: try { + var v: Bool? + try decoder.decodeSingularBoolField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofBool(v) + } + }() + case 116: try { + var v: UInt64? + try decoder.decodeSingularUInt64Field(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofUint64(v) + } + }() + case 117: try { + var v: Float? + try decoder.decodeSingularFloatField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofFloat(v) + } + }() + case 118: try { + var v: Double? + try decoder.decodeSingularDoubleField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofDouble(v) + } + }() + case 119: try { + var v: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofEnum(v) + } + }() + case 120: try { + var v: SwiftProtobuf.Google_Protobuf_NullValue? + try decoder.decodeSingularEnumField(value: &v) + if let v = v { + if _storage._oneofField != nil {try decoder.handleConflictingOneOf()} + _storage._oneofField = .oneofNullValue(v) + } + }() + case 201: try { try decoder.decodeSingularMessageField(value: &_storage._optionalBoolWrapper) }() + case 202: try { try decoder.decodeSingularMessageField(value: &_storage._optionalInt32Wrapper) }() + case 203: try { try decoder.decodeSingularMessageField(value: &_storage._optionalInt64Wrapper) }() + case 204: try { try decoder.decodeSingularMessageField(value: &_storage._optionalUint32Wrapper) }() + case 205: try { try decoder.decodeSingularMessageField(value: &_storage._optionalUint64Wrapper) }() + case 206: try { try decoder.decodeSingularMessageField(value: &_storage._optionalFloatWrapper) }() + case 207: try { try decoder.decodeSingularMessageField(value: &_storage._optionalDoubleWrapper) }() + case 208: try { try decoder.decodeSingularMessageField(value: &_storage._optionalStringWrapper) }() + case 209: try { try decoder.decodeSingularMessageField(value: &_storage._optionalBytesWrapper) }() + case 211: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedBoolWrapper) }() + case 212: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedInt32Wrapper) }() + case 213: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedInt64Wrapper) }() + case 214: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedUint32Wrapper) }() + case 215: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedUint64Wrapper) }() + case 216: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedFloatWrapper) }() + case 217: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedDoubleWrapper) }() + case 218: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedStringWrapper) }() + case 219: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedBytesWrapper) }() + case 301: try { try decoder.decodeSingularMessageField(value: &_storage._optionalDuration) }() + case 302: try { try decoder.decodeSingularMessageField(value: &_storage._optionalTimestamp) }() + case 303: try { try decoder.decodeSingularMessageField(value: &_storage._optionalFieldMask) }() + case 304: try { try decoder.decodeSingularMessageField(value: &_storage._optionalStruct) }() + case 305: try { try decoder.decodeSingularMessageField(value: &_storage._optionalAny) }() + case 306: try { try decoder.decodeSingularMessageField(value: &_storage._optionalValue) }() + case 307: try { try decoder.decodeSingularEnumField(value: &_storage._optionalNullValue) }() + case 311: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedDuration) }() + case 312: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedTimestamp) }() + case 313: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedFieldmask) }() + case 315: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedAny) }() + case 316: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedValue) }() + case 317: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedListValue) }() + case 324: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedStruct) }() + case 401: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldname1) }() + case 402: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName2) }() + case 403: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName3) }() + case 404: try { try decoder.decodeSingularInt32Field(value: &_storage._field_Name4_) }() + case 405: try { try decoder.decodeSingularInt32Field(value: &_storage._field0Name5) }() + case 406: try { try decoder.decodeSingularInt32Field(value: &_storage._field0Name6) }() + case 407: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName7) }() + case 408: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName8) }() + case 409: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName9) }() + case 410: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName10) }() + case 411: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName11) }() + case 412: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName12) }() + case 413: try { try decoder.decodeSingularInt32Field(value: &_storage.__FieldName13) }() + case 414: try { try decoder.decodeSingularInt32Field(value: &_storage.__FieldName14) }() + case 415: try { try decoder.decodeSingularInt32Field(value: &_storage._field_Name15) }() + case 416: try { try decoder.decodeSingularInt32Field(value: &_storage._field_Name16) }() + case 417: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName17__) }() + case 418: try { try decoder.decodeSingularInt32Field(value: &_storage._fieldName18__) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if _storage._optionalInt32 != 0 { + try visitor.visitSingularInt32Field(value: _storage._optionalInt32, fieldNumber: 1) + } + if _storage._optionalInt64 != 0 { + try visitor.visitSingularInt64Field(value: _storage._optionalInt64, fieldNumber: 2) + } + if _storage._optionalUint32 != 0 { + try visitor.visitSingularUInt32Field(value: _storage._optionalUint32, fieldNumber: 3) + } + if _storage._optionalUint64 != 0 { + try visitor.visitSingularUInt64Field(value: _storage._optionalUint64, fieldNumber: 4) + } + if _storage._optionalSint32 != 0 { + try visitor.visitSingularSInt32Field(value: _storage._optionalSint32, fieldNumber: 5) + } + if _storage._optionalSint64 != 0 { + try visitor.visitSingularSInt64Field(value: _storage._optionalSint64, fieldNumber: 6) + } + if _storage._optionalFixed32 != 0 { + try visitor.visitSingularFixed32Field(value: _storage._optionalFixed32, fieldNumber: 7) + } + if _storage._optionalFixed64 != 0 { + try visitor.visitSingularFixed64Field(value: _storage._optionalFixed64, fieldNumber: 8) + } + if _storage._optionalSfixed32 != 0 { + try visitor.visitSingularSFixed32Field(value: _storage._optionalSfixed32, fieldNumber: 9) + } + if _storage._optionalSfixed64 != 0 { + try visitor.visitSingularSFixed64Field(value: _storage._optionalSfixed64, fieldNumber: 10) + } + if _storage._optionalFloat != 0 { + try visitor.visitSingularFloatField(value: _storage._optionalFloat, fieldNumber: 11) + } + if _storage._optionalDouble != 0 { + try visitor.visitSingularDoubleField(value: _storage._optionalDouble, fieldNumber: 12) + } + if _storage._optionalBool != false { + try visitor.visitSingularBoolField(value: _storage._optionalBool, fieldNumber: 13) + } + if !_storage._optionalString.isEmpty { + try visitor.visitSingularStringField(value: _storage._optionalString, fieldNumber: 14) + } + if !_storage._optionalBytes.isEmpty { + try visitor.visitSingularBytesField(value: _storage._optionalBytes, fieldNumber: 15) + } + try { if let v = _storage._optionalNestedMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + } }() + try { if let v = _storage._optionalForeignMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + } }() + if _storage._optionalNestedEnum != .foo { + try visitor.visitSingularEnumField(value: _storage._optionalNestedEnum, fieldNumber: 21) + } + if _storage._optionalForeignEnum != .foreignFoo { + try visitor.visitSingularEnumField(value: _storage._optionalForeignEnum, fieldNumber: 22) + } + if _storage._optionalAliasedEnum != .aliasFoo { + try visitor.visitSingularEnumField(value: _storage._optionalAliasedEnum, fieldNumber: 23) + } + if !_storage._optionalStringPiece.isEmpty { + try visitor.visitSingularStringField(value: _storage._optionalStringPiece, fieldNumber: 24) + } + if !_storage._optionalCord.isEmpty { + try visitor.visitSingularStringField(value: _storage._optionalCord, fieldNumber: 25) + } + try { if let v = _storage._recursiveMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 27) + } }() + if !_storage._repeatedInt32.isEmpty { + try visitor.visitPackedInt32Field(value: _storage._repeatedInt32, fieldNumber: 31) + } + if !_storage._repeatedInt64.isEmpty { + try visitor.visitPackedInt64Field(value: _storage._repeatedInt64, fieldNumber: 32) + } + if !_storage._repeatedUint32.isEmpty { + try visitor.visitPackedUInt32Field(value: _storage._repeatedUint32, fieldNumber: 33) + } + if !_storage._repeatedUint64.isEmpty { + try visitor.visitPackedUInt64Field(value: _storage._repeatedUint64, fieldNumber: 34) + } + if !_storage._repeatedSint32.isEmpty { + try visitor.visitPackedSInt32Field(value: _storage._repeatedSint32, fieldNumber: 35) + } + if !_storage._repeatedSint64.isEmpty { + try visitor.visitPackedSInt64Field(value: _storage._repeatedSint64, fieldNumber: 36) + } + if !_storage._repeatedFixed32.isEmpty { + try visitor.visitPackedFixed32Field(value: _storage._repeatedFixed32, fieldNumber: 37) + } + if !_storage._repeatedFixed64.isEmpty { + try visitor.visitPackedFixed64Field(value: _storage._repeatedFixed64, fieldNumber: 38) + } + if !_storage._repeatedSfixed32.isEmpty { + try visitor.visitPackedSFixed32Field(value: _storage._repeatedSfixed32, fieldNumber: 39) + } + if !_storage._repeatedSfixed64.isEmpty { + try visitor.visitPackedSFixed64Field(value: _storage._repeatedSfixed64, fieldNumber: 40) + } + if !_storage._repeatedFloat.isEmpty { + try visitor.visitPackedFloatField(value: _storage._repeatedFloat, fieldNumber: 41) + } + if !_storage._repeatedDouble.isEmpty { + try visitor.visitPackedDoubleField(value: _storage._repeatedDouble, fieldNumber: 42) + } + if !_storage._repeatedBool.isEmpty { + try visitor.visitPackedBoolField(value: _storage._repeatedBool, fieldNumber: 43) + } + if !_storage._repeatedString.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedString, fieldNumber: 44) + } + if !_storage._repeatedBytes.isEmpty { + try visitor.visitRepeatedBytesField(value: _storage._repeatedBytes, fieldNumber: 45) + } + if !_storage._repeatedNestedMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedNestedMessage, fieldNumber: 48) + } + if !_storage._repeatedForeignMessage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedForeignMessage, fieldNumber: 49) + } + if !_storage._repeatedNestedEnum.isEmpty { + try visitor.visitPackedEnumField(value: _storage._repeatedNestedEnum, fieldNumber: 51) + } + if !_storage._repeatedForeignEnum.isEmpty { + try visitor.visitPackedEnumField(value: _storage._repeatedForeignEnum, fieldNumber: 52) + } + if !_storage._repeatedStringPiece.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedStringPiece, fieldNumber: 54) + } + if !_storage._repeatedCord.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._repeatedCord, fieldNumber: 55) + } + if !_storage._mapInt32Int32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Int32, fieldNumber: 56) + } + if !_storage._mapInt64Int64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt64Int64, fieldNumber: 57) + } + if !_storage._mapUint32Uint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapUint32Uint32, fieldNumber: 58) + } + if !_storage._mapUint64Uint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapUint64Uint64, fieldNumber: 59) + } + if !_storage._mapSint32Sint32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSint32Sint32, fieldNumber: 60) + } + if !_storage._mapSint64Sint64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSint64Sint64, fieldNumber: 61) + } + if !_storage._mapFixed32Fixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapFixed32Fixed32, fieldNumber: 62) + } + if !_storage._mapFixed64Fixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapFixed64Fixed64, fieldNumber: 63) + } + if !_storage._mapSfixed32Sfixed32.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSfixed32Sfixed32, fieldNumber: 64) + } + if !_storage._mapSfixed64Sfixed64.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapSfixed64Sfixed64, fieldNumber: 65) + } + if !_storage._mapInt32Float.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Float, fieldNumber: 66) + } + if !_storage._mapInt32Double.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapInt32Double, fieldNumber: 67) + } + if !_storage._mapBoolBool.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapBoolBool, fieldNumber: 68) + } + if !_storage._mapStringString.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapStringString, fieldNumber: 69) + } + if !_storage._mapStringBytes.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._mapStringBytes, fieldNumber: 70) + } + if !_storage._mapStringNestedMessage.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._mapStringNestedMessage, fieldNumber: 71) + } + if !_storage._mapStringForeignMessage.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: _storage._mapStringForeignMessage, fieldNumber: 72) + } + if !_storage._mapStringNestedEnum.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: _storage._mapStringNestedEnum, fieldNumber: 73) + } + if !_storage._mapStringForeignEnum.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap.self, value: _storage._mapStringForeignEnum, fieldNumber: 74) + } + if !_storage._packedInt32.isEmpty { + try visitor.visitPackedInt32Field(value: _storage._packedInt32, fieldNumber: 75) + } + if !_storage._packedInt64.isEmpty { + try visitor.visitPackedInt64Field(value: _storage._packedInt64, fieldNumber: 76) + } + if !_storage._packedUint32.isEmpty { + try visitor.visitPackedUInt32Field(value: _storage._packedUint32, fieldNumber: 77) + } + if !_storage._packedUint64.isEmpty { + try visitor.visitPackedUInt64Field(value: _storage._packedUint64, fieldNumber: 78) + } + if !_storage._packedSint32.isEmpty { + try visitor.visitPackedSInt32Field(value: _storage._packedSint32, fieldNumber: 79) + } + if !_storage._packedSint64.isEmpty { + try visitor.visitPackedSInt64Field(value: _storage._packedSint64, fieldNumber: 80) + } + if !_storage._packedFixed32.isEmpty { + try visitor.visitPackedFixed32Field(value: _storage._packedFixed32, fieldNumber: 81) + } + if !_storage._packedFixed64.isEmpty { + try visitor.visitPackedFixed64Field(value: _storage._packedFixed64, fieldNumber: 82) + } + if !_storage._packedSfixed32.isEmpty { + try visitor.visitPackedSFixed32Field(value: _storage._packedSfixed32, fieldNumber: 83) + } + if !_storage._packedSfixed64.isEmpty { + try visitor.visitPackedSFixed64Field(value: _storage._packedSfixed64, fieldNumber: 84) + } + if !_storage._packedFloat.isEmpty { + try visitor.visitPackedFloatField(value: _storage._packedFloat, fieldNumber: 85) + } + if !_storage._packedDouble.isEmpty { + try visitor.visitPackedDoubleField(value: _storage._packedDouble, fieldNumber: 86) + } + if !_storage._packedBool.isEmpty { + try visitor.visitPackedBoolField(value: _storage._packedBool, fieldNumber: 87) + } + if !_storage._packedNestedEnum.isEmpty { + try visitor.visitPackedEnumField(value: _storage._packedNestedEnum, fieldNumber: 88) + } + if !_storage._unpackedInt32.isEmpty { + try visitor.visitRepeatedInt32Field(value: _storage._unpackedInt32, fieldNumber: 89) + } + if !_storage._unpackedInt64.isEmpty { + try visitor.visitRepeatedInt64Field(value: _storage._unpackedInt64, fieldNumber: 90) + } + if !_storage._unpackedUint32.isEmpty { + try visitor.visitRepeatedUInt32Field(value: _storage._unpackedUint32, fieldNumber: 91) + } + if !_storage._unpackedUint64.isEmpty { + try visitor.visitRepeatedUInt64Field(value: _storage._unpackedUint64, fieldNumber: 92) + } + if !_storage._unpackedSint32.isEmpty { + try visitor.visitRepeatedSInt32Field(value: _storage._unpackedSint32, fieldNumber: 93) + } + if !_storage._unpackedSint64.isEmpty { + try visitor.visitRepeatedSInt64Field(value: _storage._unpackedSint64, fieldNumber: 94) + } + if !_storage._unpackedFixed32.isEmpty { + try visitor.visitRepeatedFixed32Field(value: _storage._unpackedFixed32, fieldNumber: 95) + } + if !_storage._unpackedFixed64.isEmpty { + try visitor.visitRepeatedFixed64Field(value: _storage._unpackedFixed64, fieldNumber: 96) + } + if !_storage._unpackedSfixed32.isEmpty { + try visitor.visitRepeatedSFixed32Field(value: _storage._unpackedSfixed32, fieldNumber: 97) + } + if !_storage._unpackedSfixed64.isEmpty { + try visitor.visitRepeatedSFixed64Field(value: _storage._unpackedSfixed64, fieldNumber: 98) + } + if !_storage._unpackedFloat.isEmpty { + try visitor.visitRepeatedFloatField(value: _storage._unpackedFloat, fieldNumber: 99) + } + if !_storage._unpackedDouble.isEmpty { + try visitor.visitRepeatedDoubleField(value: _storage._unpackedDouble, fieldNumber: 100) + } + if !_storage._unpackedBool.isEmpty { + try visitor.visitRepeatedBoolField(value: _storage._unpackedBool, fieldNumber: 101) + } + if !_storage._unpackedNestedEnum.isEmpty { + try visitor.visitRepeatedEnumField(value: _storage._unpackedNestedEnum, fieldNumber: 102) + } + switch _storage._oneofField { + case .oneofUint32?: try { + guard case .oneofUint32(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 111) + }() + case .oneofNestedMessage?: try { + guard case .oneofNestedMessage(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 112) + }() + case .oneofString?: try { + guard case .oneofString(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 113) + }() + case .oneofBytes?: try { + guard case .oneofBytes(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 114) + }() + case .oneofBool?: try { + guard case .oneofBool(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularBoolField(value: v, fieldNumber: 115) + }() + case .oneofUint64?: try { + guard case .oneofUint64(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularUInt64Field(value: v, fieldNumber: 116) + }() + case .oneofFloat?: try { + guard case .oneofFloat(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularFloatField(value: v, fieldNumber: 117) + }() + case .oneofDouble?: try { + guard case .oneofDouble(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularDoubleField(value: v, fieldNumber: 118) + }() + case .oneofEnum?: try { + guard case .oneofEnum(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 119) + }() + case .oneofNullValue?: try { + guard case .oneofNullValue(let v)? = _storage._oneofField else { preconditionFailure() } + try visitor.visitSingularEnumField(value: v, fieldNumber: 120) + }() + case nil: break + } + try { if let v = _storage._optionalBoolWrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 201) + } }() + try { if let v = _storage._optionalInt32Wrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 202) + } }() + try { if let v = _storage._optionalInt64Wrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 203) + } }() + try { if let v = _storage._optionalUint32Wrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 204) + } }() + try { if let v = _storage._optionalUint64Wrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 205) + } }() + try { if let v = _storage._optionalFloatWrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 206) + } }() + try { if let v = _storage._optionalDoubleWrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 207) + } }() + try { if let v = _storage._optionalStringWrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 208) + } }() + try { if let v = _storage._optionalBytesWrapper { + try visitor.visitSingularMessageField(value: v, fieldNumber: 209) + } }() + if !_storage._repeatedBoolWrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedBoolWrapper, fieldNumber: 211) + } + if !_storage._repeatedInt32Wrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedInt32Wrapper, fieldNumber: 212) + } + if !_storage._repeatedInt64Wrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedInt64Wrapper, fieldNumber: 213) + } + if !_storage._repeatedUint32Wrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedUint32Wrapper, fieldNumber: 214) + } + if !_storage._repeatedUint64Wrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedUint64Wrapper, fieldNumber: 215) + } + if !_storage._repeatedFloatWrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedFloatWrapper, fieldNumber: 216) + } + if !_storage._repeatedDoubleWrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedDoubleWrapper, fieldNumber: 217) + } + if !_storage._repeatedStringWrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedStringWrapper, fieldNumber: 218) + } + if !_storage._repeatedBytesWrapper.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedBytesWrapper, fieldNumber: 219) + } + try { if let v = _storage._optionalDuration { + try visitor.visitSingularMessageField(value: v, fieldNumber: 301) + } }() + try { if let v = _storage._optionalTimestamp { + try visitor.visitSingularMessageField(value: v, fieldNumber: 302) + } }() + try { if let v = _storage._optionalFieldMask { + try visitor.visitSingularMessageField(value: v, fieldNumber: 303) + } }() + try { if let v = _storage._optionalStruct { + try visitor.visitSingularMessageField(value: v, fieldNumber: 304) + } }() + try { if let v = _storage._optionalAny { + try visitor.visitSingularMessageField(value: v, fieldNumber: 305) + } }() + try { if let v = _storage._optionalValue { + try visitor.visitSingularMessageField(value: v, fieldNumber: 306) + } }() + if _storage._optionalNullValue != .nullValue { + try visitor.visitSingularEnumField(value: _storage._optionalNullValue, fieldNumber: 307) + } + if !_storage._repeatedDuration.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedDuration, fieldNumber: 311) + } + if !_storage._repeatedTimestamp.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedTimestamp, fieldNumber: 312) + } + if !_storage._repeatedFieldmask.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedFieldmask, fieldNumber: 313) + } + if !_storage._repeatedAny.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedAny, fieldNumber: 315) + } + if !_storage._repeatedValue.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedValue, fieldNumber: 316) + } + if !_storage._repeatedListValue.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedListValue, fieldNumber: 317) + } + if !_storage._repeatedStruct.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._repeatedStruct, fieldNumber: 324) + } + if _storage._fieldname1 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldname1, fieldNumber: 401) + } + if _storage._fieldName2 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName2, fieldNumber: 402) + } + if _storage._fieldName3 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName3, fieldNumber: 403) + } + if _storage._field_Name4_ != 0 { + try visitor.visitSingularInt32Field(value: _storage._field_Name4_, fieldNumber: 404) + } + if _storage._field0Name5 != 0 { + try visitor.visitSingularInt32Field(value: _storage._field0Name5, fieldNumber: 405) + } + if _storage._field0Name6 != 0 { + try visitor.visitSingularInt32Field(value: _storage._field0Name6, fieldNumber: 406) + } + if _storage._fieldName7 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName7, fieldNumber: 407) + } + if _storage._fieldName8 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName8, fieldNumber: 408) + } + if _storage._fieldName9 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName9, fieldNumber: 409) + } + if _storage._fieldName10 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName10, fieldNumber: 410) + } + if _storage._fieldName11 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName11, fieldNumber: 411) + } + if _storage._fieldName12 != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName12, fieldNumber: 412) + } + if _storage.__FieldName13 != 0 { + try visitor.visitSingularInt32Field(value: _storage.__FieldName13, fieldNumber: 413) + } + if _storage.__FieldName14 != 0 { + try visitor.visitSingularInt32Field(value: _storage.__FieldName14, fieldNumber: 414) + } + if _storage._field_Name15 != 0 { + try visitor.visitSingularInt32Field(value: _storage._field_Name15, fieldNumber: 415) + } + if _storage._field_Name16 != 0 { + try visitor.visitSingularInt32Field(value: _storage._field_Name16, fieldNumber: 416) + } + if _storage._fieldName17__ != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName17__, fieldNumber: 417) + } + if _storage._fieldName18__ != 0 { + try visitor.visitSingularInt32Field(value: _storage._fieldName18__, fieldNumber: 418) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto3_TestAllTypesProto3, rhs: ProtobufTestMessages_Proto3_TestAllTypesProto3) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._optionalInt32 != rhs_storage._optionalInt32 {return false} + if _storage._optionalInt64 != rhs_storage._optionalInt64 {return false} + if _storage._optionalUint32 != rhs_storage._optionalUint32 {return false} + if _storage._optionalUint64 != rhs_storage._optionalUint64 {return false} + if _storage._optionalSint32 != rhs_storage._optionalSint32 {return false} + if _storage._optionalSint64 != rhs_storage._optionalSint64 {return false} + if _storage._optionalFixed32 != rhs_storage._optionalFixed32 {return false} + if _storage._optionalFixed64 != rhs_storage._optionalFixed64 {return false} + if _storage._optionalSfixed32 != rhs_storage._optionalSfixed32 {return false} + if _storage._optionalSfixed64 != rhs_storage._optionalSfixed64 {return false} + if _storage._optionalFloat != rhs_storage._optionalFloat {return false} + if _storage._optionalDouble != rhs_storage._optionalDouble {return false} + if _storage._optionalBool != rhs_storage._optionalBool {return false} + if _storage._optionalString != rhs_storage._optionalString {return false} + if _storage._optionalBytes != rhs_storage._optionalBytes {return false} + if _storage._optionalNestedMessage != rhs_storage._optionalNestedMessage {return false} + if _storage._optionalForeignMessage != rhs_storage._optionalForeignMessage {return false} + if _storage._optionalNestedEnum != rhs_storage._optionalNestedEnum {return false} + if _storage._optionalForeignEnum != rhs_storage._optionalForeignEnum {return false} + if _storage._optionalAliasedEnum != rhs_storage._optionalAliasedEnum {return false} + if _storage._optionalStringPiece != rhs_storage._optionalStringPiece {return false} + if _storage._optionalCord != rhs_storage._optionalCord {return false} + if _storage._recursiveMessage != rhs_storage._recursiveMessage {return false} + if _storage._repeatedInt32 != rhs_storage._repeatedInt32 {return false} + if _storage._repeatedInt64 != rhs_storage._repeatedInt64 {return false} + if _storage._repeatedUint32 != rhs_storage._repeatedUint32 {return false} + if _storage._repeatedUint64 != rhs_storage._repeatedUint64 {return false} + if _storage._repeatedSint32 != rhs_storage._repeatedSint32 {return false} + if _storage._repeatedSint64 != rhs_storage._repeatedSint64 {return false} + if _storage._repeatedFixed32 != rhs_storage._repeatedFixed32 {return false} + if _storage._repeatedFixed64 != rhs_storage._repeatedFixed64 {return false} + if _storage._repeatedSfixed32 != rhs_storage._repeatedSfixed32 {return false} + if _storage._repeatedSfixed64 != rhs_storage._repeatedSfixed64 {return false} + if _storage._repeatedFloat != rhs_storage._repeatedFloat {return false} + if _storage._repeatedDouble != rhs_storage._repeatedDouble {return false} + if _storage._repeatedBool != rhs_storage._repeatedBool {return false} + if _storage._repeatedString != rhs_storage._repeatedString {return false} + if _storage._repeatedBytes != rhs_storage._repeatedBytes {return false} + if _storage._repeatedNestedMessage != rhs_storage._repeatedNestedMessage {return false} + if _storage._repeatedForeignMessage != rhs_storage._repeatedForeignMessage {return false} + if _storage._repeatedNestedEnum != rhs_storage._repeatedNestedEnum {return false} + if _storage._repeatedForeignEnum != rhs_storage._repeatedForeignEnum {return false} + if _storage._repeatedStringPiece != rhs_storage._repeatedStringPiece {return false} + if _storage._repeatedCord != rhs_storage._repeatedCord {return false} + if _storage._packedInt32 != rhs_storage._packedInt32 {return false} + if _storage._packedInt64 != rhs_storage._packedInt64 {return false} + if _storage._packedUint32 != rhs_storage._packedUint32 {return false} + if _storage._packedUint64 != rhs_storage._packedUint64 {return false} + if _storage._packedSint32 != rhs_storage._packedSint32 {return false} + if _storage._packedSint64 != rhs_storage._packedSint64 {return false} + if _storage._packedFixed32 != rhs_storage._packedFixed32 {return false} + if _storage._packedFixed64 != rhs_storage._packedFixed64 {return false} + if _storage._packedSfixed32 != rhs_storage._packedSfixed32 {return false} + if _storage._packedSfixed64 != rhs_storage._packedSfixed64 {return false} + if _storage._packedFloat != rhs_storage._packedFloat {return false} + if _storage._packedDouble != rhs_storage._packedDouble {return false} + if _storage._packedBool != rhs_storage._packedBool {return false} + if _storage._packedNestedEnum != rhs_storage._packedNestedEnum {return false} + if _storage._unpackedInt32 != rhs_storage._unpackedInt32 {return false} + if _storage._unpackedInt64 != rhs_storage._unpackedInt64 {return false} + if _storage._unpackedUint32 != rhs_storage._unpackedUint32 {return false} + if _storage._unpackedUint64 != rhs_storage._unpackedUint64 {return false} + if _storage._unpackedSint32 != rhs_storage._unpackedSint32 {return false} + if _storage._unpackedSint64 != rhs_storage._unpackedSint64 {return false} + if _storage._unpackedFixed32 != rhs_storage._unpackedFixed32 {return false} + if _storage._unpackedFixed64 != rhs_storage._unpackedFixed64 {return false} + if _storage._unpackedSfixed32 != rhs_storage._unpackedSfixed32 {return false} + if _storage._unpackedSfixed64 != rhs_storage._unpackedSfixed64 {return false} + if _storage._unpackedFloat != rhs_storage._unpackedFloat {return false} + if _storage._unpackedDouble != rhs_storage._unpackedDouble {return false} + if _storage._unpackedBool != rhs_storage._unpackedBool {return false} + if _storage._unpackedNestedEnum != rhs_storage._unpackedNestedEnum {return false} + if _storage._mapInt32Int32 != rhs_storage._mapInt32Int32 {return false} + if _storage._mapInt64Int64 != rhs_storage._mapInt64Int64 {return false} + if _storage._mapUint32Uint32 != rhs_storage._mapUint32Uint32 {return false} + if _storage._mapUint64Uint64 != rhs_storage._mapUint64Uint64 {return false} + if _storage._mapSint32Sint32 != rhs_storage._mapSint32Sint32 {return false} + if _storage._mapSint64Sint64 != rhs_storage._mapSint64Sint64 {return false} + if _storage._mapFixed32Fixed32 != rhs_storage._mapFixed32Fixed32 {return false} + if _storage._mapFixed64Fixed64 != rhs_storage._mapFixed64Fixed64 {return false} + if _storage._mapSfixed32Sfixed32 != rhs_storage._mapSfixed32Sfixed32 {return false} + if _storage._mapSfixed64Sfixed64 != rhs_storage._mapSfixed64Sfixed64 {return false} + if _storage._mapInt32Float != rhs_storage._mapInt32Float {return false} + if _storage._mapInt32Double != rhs_storage._mapInt32Double {return false} + if _storage._mapBoolBool != rhs_storage._mapBoolBool {return false} + if _storage._mapStringString != rhs_storage._mapStringString {return false} + if _storage._mapStringBytes != rhs_storage._mapStringBytes {return false} + if _storage._mapStringNestedMessage != rhs_storage._mapStringNestedMessage {return false} + if _storage._mapStringForeignMessage != rhs_storage._mapStringForeignMessage {return false} + if _storage._mapStringNestedEnum != rhs_storage._mapStringNestedEnum {return false} + if _storage._mapStringForeignEnum != rhs_storage._mapStringForeignEnum {return false} + if _storage._oneofField != rhs_storage._oneofField {return false} + if _storage._optionalBoolWrapper != rhs_storage._optionalBoolWrapper {return false} + if _storage._optionalInt32Wrapper != rhs_storage._optionalInt32Wrapper {return false} + if _storage._optionalInt64Wrapper != rhs_storage._optionalInt64Wrapper {return false} + if _storage._optionalUint32Wrapper != rhs_storage._optionalUint32Wrapper {return false} + if _storage._optionalUint64Wrapper != rhs_storage._optionalUint64Wrapper {return false} + if _storage._optionalFloatWrapper != rhs_storage._optionalFloatWrapper {return false} + if _storage._optionalDoubleWrapper != rhs_storage._optionalDoubleWrapper {return false} + if _storage._optionalStringWrapper != rhs_storage._optionalStringWrapper {return false} + if _storage._optionalBytesWrapper != rhs_storage._optionalBytesWrapper {return false} + if _storage._repeatedBoolWrapper != rhs_storage._repeatedBoolWrapper {return false} + if _storage._repeatedInt32Wrapper != rhs_storage._repeatedInt32Wrapper {return false} + if _storage._repeatedInt64Wrapper != rhs_storage._repeatedInt64Wrapper {return false} + if _storage._repeatedUint32Wrapper != rhs_storage._repeatedUint32Wrapper {return false} + if _storage._repeatedUint64Wrapper != rhs_storage._repeatedUint64Wrapper {return false} + if _storage._repeatedFloatWrapper != rhs_storage._repeatedFloatWrapper {return false} + if _storage._repeatedDoubleWrapper != rhs_storage._repeatedDoubleWrapper {return false} + if _storage._repeatedStringWrapper != rhs_storage._repeatedStringWrapper {return false} + if _storage._repeatedBytesWrapper != rhs_storage._repeatedBytesWrapper {return false} + if _storage._optionalDuration != rhs_storage._optionalDuration {return false} + if _storage._optionalTimestamp != rhs_storage._optionalTimestamp {return false} + if _storage._optionalFieldMask != rhs_storage._optionalFieldMask {return false} + if _storage._optionalStruct != rhs_storage._optionalStruct {return false} + if _storage._optionalAny != rhs_storage._optionalAny {return false} + if _storage._optionalValue != rhs_storage._optionalValue {return false} + if _storage._optionalNullValue != rhs_storage._optionalNullValue {return false} + if _storage._repeatedDuration != rhs_storage._repeatedDuration {return false} + if _storage._repeatedTimestamp != rhs_storage._repeatedTimestamp {return false} + if _storage._repeatedFieldmask != rhs_storage._repeatedFieldmask {return false} + if _storage._repeatedStruct != rhs_storage._repeatedStruct {return false} + if _storage._repeatedAny != rhs_storage._repeatedAny {return false} + if _storage._repeatedValue != rhs_storage._repeatedValue {return false} + if _storage._repeatedListValue != rhs_storage._repeatedListValue {return false} + if _storage._fieldname1 != rhs_storage._fieldname1 {return false} + if _storage._fieldName2 != rhs_storage._fieldName2 {return false} + if _storage._fieldName3 != rhs_storage._fieldName3 {return false} + if _storage._field_Name4_ != rhs_storage._field_Name4_ {return false} + if _storage._field0Name5 != rhs_storage._field0Name5 {return false} + if _storage._field0Name6 != rhs_storage._field0Name6 {return false} + if _storage._fieldName7 != rhs_storage._fieldName7 {return false} + if _storage._fieldName8 != rhs_storage._fieldName8 {return false} + if _storage._fieldName9 != rhs_storage._fieldName9 {return false} + if _storage._fieldName10 != rhs_storage._fieldName10 {return false} + if _storage._fieldName11 != rhs_storage._fieldName11 {return false} + if _storage._fieldName12 != rhs_storage._fieldName12 {return false} + if _storage.__FieldName13 != rhs_storage.__FieldName13 {return false} + if _storage.__FieldName14 != rhs_storage.__FieldName14 {return false} + if _storage._field_Name15 != rhs_storage._field_Name15 {return false} + if _storage._field_Name16 != rhs_storage._field_Name16 {return false} + if _storage._fieldName17__ != rhs_storage._fieldName17__ {return false} + if _storage._fieldName18__ != rhs_storage._fieldName18__ {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + -1: .same(proto: "NEG"), + 0: .same(proto: "FOO"), + 1: .same(proto: "BAR"), + 2: .same(proto: "BAZ"), + ] +} + +extension ProtobufTestMessages_Proto3_TestAllTypesProto3.AliasedEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "ALIAS_FOO"), + 1: .same(proto: "ALIAS_BAR"), + 2: .aliased(proto: "ALIAS_BAZ", aliases: ["MOO", "moo", "bAz"]), + ] +} + +extension ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = ProtobufTestMessages_Proto3_TestAllTypesProto3.protoMessageName + ".NestedMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "a"), + 2: .same(proto: "corecursive"), + ] + + fileprivate class _StorageClass { + var _a: Int32 = 0 + var _corecursive: ProtobufTestMessages_Proto3_TestAllTypesProto3? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _a = source._a + _corecursive = source._corecursive + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + + mutating func decodeMessage(decoder: inout D) throws { + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._a) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._corecursive) }() + default: break + } + } + } + } + + func traverse(visitor: inout V) throws { + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if _storage._a != 0 { + try visitor.visitSingularInt32Field(value: _storage._a, fieldNumber: 1) + } + try { if let v = _storage._corecursive { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage, rhs: ProtobufTestMessages_Proto3_TestAllTypesProto3.NestedMessage) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._a != rhs_storage._a {return false} + if _storage._corecursive != rhs_storage._corecursive {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto3_ForeignMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ForeignMessage" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "c"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.c) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.c != 0 { + try visitor.visitSingularInt32Field(value: self.c, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto3_ForeignMessage, rhs: ProtobufTestMessages_Proto3_ForeignMessage) -> Bool { + if lhs.c != rhs.c {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto3_NullHypothesisProto3: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".NullHypothesisProto3" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto3_NullHypothesisProto3, rhs: ProtobufTestMessages_Proto3_NullHypothesisProto3) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto3_EnumOnlyProto3: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".EnumOnlyProto3" + static let _protobuf_nameMap = SwiftProtobuf._NameMap() + + mutating func decodeMessage(decoder: inout D) throws { + while let _ = try decoder.nextFieldNumber() { + } + } + + func traverse(visitor: inout V) throws { + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufTestMessages_Proto3_EnumOnlyProto3, rhs: ProtobufTestMessages_Proto3_EnumOnlyProto3) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension ProtobufTestMessages_Proto3_EnumOnlyProto3.BoolEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "kFalse"), + 1: .same(proto: "kTrue"), + ] +} diff --git a/Reference/upstream/google/protobuf/timestamp.pb.swift b/Reference/upstream/google/protobuf/timestamp.pb.swift new file mode 100644 index 000000000..1dac4e257 --- /dev/null +++ b/Reference/upstream/google/protobuf/timestamp.pb.swift @@ -0,0 +1,206 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: google/protobuf/timestamp.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: ProtobufAPIVersionCheck { + struct _3: ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +/// A Timestamp represents a point in time independent of any time zone or local +/// calendar, encoded as a count of seconds and fractions of seconds at +/// nanosecond resolution. The count is relative to an epoch at UTC midnight on +/// January 1, 1970, in the proleptic Gregorian calendar which extends the +/// Gregorian calendar backwards to year one. +/// +/// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +/// second table is needed for interpretation, using a [24-hour linear +/// smear](https://developers.google.com/time/smear). +/// +/// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +/// restricting to that range, we ensure that we can convert to and from [RFC +/// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. +/// +/// # Examples +/// +/// Example 1: Compute Timestamp from POSIX `time()`. +/// +/// Timestamp timestamp; +/// timestamp.set_seconds(time(NULL)); +/// timestamp.set_nanos(0); +/// +/// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +/// +/// struct timeval tv; +/// gettimeofday(&tv, NULL); +/// +/// Timestamp timestamp; +/// timestamp.set_seconds(tv.tv_sec); +/// timestamp.set_nanos(tv.tv_usec * 1000); +/// +/// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +/// +/// FILETIME ft; +/// GetSystemTimeAsFileTime(&ft); +/// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +/// +/// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +/// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +/// Timestamp timestamp; +/// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +/// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +/// +/// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +/// +/// long millis = System.currentTimeMillis(); +/// +/// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +/// .setNanos((int) ((millis % 1000) * 1000000)).build(); +/// +/// Example 5: Compute Timestamp from Java `Instant.now()`. +/// +/// Instant now = Instant.now(); +/// +/// Timestamp timestamp = +/// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) +/// .setNanos(now.getNano()).build(); +/// +/// Example 6: Compute Timestamp from current time in Python. +/// +/// timestamp = Timestamp() +/// timestamp.GetCurrentTime() +/// +/// # JSON Mapping +/// +/// In JSON format, the Timestamp type is encoded as a string in the +/// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +/// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +/// where {year} is always expressed using four digits while {month}, {day}, +/// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +/// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +/// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +/// is required. A proto3 JSON serializer should always use UTC (as indicated by +/// "Z") when printing the Timestamp type and a proto3 JSON parser should be +/// able to accept both UTC and other timezones (as indicated by an offset). +/// +/// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +/// 01:30 UTC on January 15, 2017. +/// +/// In JavaScript, one can convert a Date object to this format using the +/// standard +/// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) +/// method. In Python, a standard `datetime.datetime` object can be converted +/// to this format using +/// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +/// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +/// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +/// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() +/// ) to obtain a formatter capable of generating timestamps in this format. +struct Google_Protobuf_Timestamp { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Represents seconds of UTC time since Unix epoch + /// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + /// 9999-12-31T23:59:59Z inclusive. + var seconds: Int64 = 0 + + /// Non-negative fractions of a second at nanosecond resolution. Negative + /// second values with fractions must still have non-negative nanos values + /// that count forward in time. Must be from 0 to 999,999,999 + /// inclusive. + var nanos: Int32 = 0 + + var unknownFields = UnknownStorage() + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Google_Protobuf_Timestamp: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "google.protobuf" + +extension Google_Protobuf_Timestamp: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Timestamp" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "seconds"), + 2: .same(proto: "nanos"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.seconds) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.nanos) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.seconds != 0 { + try visitor.visitSingularInt64Field(value: self.seconds, fieldNumber: 1) + } + if self.nanos != 0 { + try visitor.visitSingularInt32Field(value: self.nanos, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Timestamp, rhs: Google_Protobuf_Timestamp) -> Bool { + if lhs.seconds != rhs.seconds {return false} + if lhs.nanos != rhs.nanos {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/upstream/google/protobuf/type.pb.swift b/Reference/upstream/google/protobuf/type.pb.swift new file mode 100644 index 000000000..9fbbe2113 --- /dev/null +++ b/Reference/upstream/google/protobuf/type.pb.swift @@ -0,0 +1,825 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: google/protobuf/type.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import Foundation + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: ProtobufAPIVersionCheck { + struct _3: ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +/// The syntax in which a protocol buffer element is defined. +enum Google_Protobuf_Syntax: Enum { + typealias RawValue = Int + + /// Syntax `proto2`. + case proto2 // = 0 + + /// Syntax `proto3`. + case proto3 // = 1 + + /// Syntax `editions`. + case editions // = 2 + case UNRECOGNIZED(Int) + + init() { + self = .proto2 + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .proto2 + case 1: self = .proto3 + case 2: self = .editions + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .proto2: return 0 + case .proto3: return 1 + case .editions: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Google_Protobuf_Syntax] = [ + .proto2, + .proto3, + .editions, + ] + +} + +/// A protocol buffer message type. +struct Google_Protobuf_Type { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The fully qualified message name. + var name: String = String() + + /// The list of fields. + var fields: [Google_Protobuf_Field] = [] + + /// The list of types appearing in `oneof` definitions in this type. + var oneofs: [String] = [] + + /// The protocol buffer options. + var options: [Google_Protobuf_Option] = [] + + /// The source context. + var sourceContext: Google_Protobuf_SourceContext { + get {return _sourceContext ?? Google_Protobuf_SourceContext()} + set {_sourceContext = newValue} + } + /// Returns true if `sourceContext` has been explicitly set. + var hasSourceContext: Bool {return self._sourceContext != nil} + /// Clears the value of `sourceContext`. Subsequent reads from it will return its default value. + mutating func clearSourceContext() {self._sourceContext = nil} + + /// The source syntax. + var syntax: Google_Protobuf_Syntax = .proto2 + + /// The source edition string, only valid when syntax is SYNTAX_EDITIONS. + var edition: String = String() + + var unknownFields = UnknownStorage() + + init() {} + + fileprivate var _sourceContext: Google_Protobuf_SourceContext? = nil +} + +/// A single field of a message type. +struct Google_Protobuf_Field { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The field type. + var kind: Google_Protobuf_Field.Kind = .typeUnknown + + /// The field cardinality. + var cardinality: Google_Protobuf_Field.Cardinality = .unknown + + /// The field number. + var number: Int32 = 0 + + /// The field name. + var name: String = String() + + /// The field type URL, without the scheme, for message or enumeration + /// types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + var typeURL: String = String() + + /// The index of the field type in `Type.oneofs`, for message or enumeration + /// types. The first type has index 1; zero means the type is not in the list. + var oneofIndex: Int32 = 0 + + /// Whether to use alternative packed wire representation. + var packed: Bool = false + + /// The protocol buffer options. + var options: [Google_Protobuf_Option] = [] + + /// The field JSON name. + var jsonName: String = String() + + /// The string value of the default value of this field. Proto2 syntax only. + var defaultValue: String = String() + + var unknownFields = UnknownStorage() + + /// Basic field types. + enum Kind: Enum { + typealias RawValue = Int + + /// Field type unknown. + case typeUnknown // = 0 + + /// Field type double. + case typeDouble // = 1 + + /// Field type float. + case typeFloat // = 2 + + /// Field type int64. + case typeInt64 // = 3 + + /// Field type uint64. + case typeUint64 // = 4 + + /// Field type int32. + case typeInt32 // = 5 + + /// Field type fixed64. + case typeFixed64 // = 6 + + /// Field type fixed32. + case typeFixed32 // = 7 + + /// Field type bool. + case typeBool // = 8 + + /// Field type string. + case typeString // = 9 + + /// Field type group. Proto2 syntax only, and deprecated. + case typeGroup // = 10 + + /// Field type message. + case typeMessage // = 11 + + /// Field type bytes. + case typeBytes // = 12 + + /// Field type uint32. + case typeUint32 // = 13 + + /// Field type enum. + case typeEnum // = 14 + + /// Field type sfixed32. + case typeSfixed32 // = 15 + + /// Field type sfixed64. + case typeSfixed64 // = 16 + + /// Field type sint32. + case typeSint32 // = 17 + + /// Field type sint64. + case typeSint64 // = 18 + case UNRECOGNIZED(Int) + + init() { + self = .typeUnknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .typeUnknown + case 1: self = .typeDouble + case 2: self = .typeFloat + case 3: self = .typeInt64 + case 4: self = .typeUint64 + case 5: self = .typeInt32 + case 6: self = .typeFixed64 + case 7: self = .typeFixed32 + case 8: self = .typeBool + case 9: self = .typeString + case 10: self = .typeGroup + case 11: self = .typeMessage + case 12: self = .typeBytes + case 13: self = .typeUint32 + case 14: self = .typeEnum + case 15: self = .typeSfixed32 + case 16: self = .typeSfixed64 + case 17: self = .typeSint32 + case 18: self = .typeSint64 + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .typeUnknown: return 0 + case .typeDouble: return 1 + case .typeFloat: return 2 + case .typeInt64: return 3 + case .typeUint64: return 4 + case .typeInt32: return 5 + case .typeFixed64: return 6 + case .typeFixed32: return 7 + case .typeBool: return 8 + case .typeString: return 9 + case .typeGroup: return 10 + case .typeMessage: return 11 + case .typeBytes: return 12 + case .typeUint32: return 13 + case .typeEnum: return 14 + case .typeSfixed32: return 15 + case .typeSfixed64: return 16 + case .typeSint32: return 17 + case .typeSint64: return 18 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Google_Protobuf_Field.Kind] = [ + .typeUnknown, + .typeDouble, + .typeFloat, + .typeInt64, + .typeUint64, + .typeInt32, + .typeFixed64, + .typeFixed32, + .typeBool, + .typeString, + .typeGroup, + .typeMessage, + .typeBytes, + .typeUint32, + .typeEnum, + .typeSfixed32, + .typeSfixed64, + .typeSint32, + .typeSint64, + ] + + } + + /// Whether a field is optional, required, or repeated. + enum Cardinality: Enum { + typealias RawValue = Int + + /// For fields with unknown cardinality. + case unknown // = 0 + + /// For optional fields. + case `optional` // = 1 + + /// For required fields. Proto2 syntax only. + case `required` // = 2 + + /// For repeated fields. + case repeated // = 3 + case UNRECOGNIZED(Int) + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .optional + case 2: self = .required + case 3: self = .repeated + default: self = .UNRECOGNIZED(rawValue) + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .optional: return 1 + case .required: return 2 + case .repeated: return 3 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + static let allCases: [Google_Protobuf_Field.Cardinality] = [ + .unknown, + .optional, + .required, + .repeated, + ] + + } + + init() {} +} + +/// Enum type definition. +struct Google_Protobuf_Enum { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Enum type name. + var name: String = String() + + /// Enum value definitions. + var enumvalue: [Google_Protobuf_EnumValue] = [] + + /// Protocol buffer options. + var options: [Google_Protobuf_Option] = [] + + /// The source context. + var sourceContext: Google_Protobuf_SourceContext { + get {return _sourceContext ?? Google_Protobuf_SourceContext()} + set {_sourceContext = newValue} + } + /// Returns true if `sourceContext` has been explicitly set. + var hasSourceContext: Bool {return self._sourceContext != nil} + /// Clears the value of `sourceContext`. Subsequent reads from it will return its default value. + mutating func clearSourceContext() {self._sourceContext = nil} + + /// The source syntax. + var syntax: Google_Protobuf_Syntax = .proto2 + + /// The source edition string, only valid when syntax is SYNTAX_EDITIONS. + var edition: String = String() + + var unknownFields = UnknownStorage() + + init() {} + + fileprivate var _sourceContext: Google_Protobuf_SourceContext? = nil +} + +/// Enum value definition. +struct Google_Protobuf_EnumValue { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Enum value name. + var name: String = String() + + /// Enum value number. + var number: Int32 = 0 + + /// Protocol buffer options. + var options: [Google_Protobuf_Option] = [] + + var unknownFields = UnknownStorage() + + init() {} +} + +/// A protocol buffer option, which can be attached to a message, field, +/// enumeration, etc. +struct Google_Protobuf_Option { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The option's name. For protobuf built-in options (options defined in + /// descriptor.proto), this is the short name. For example, `"map_entry"`. + /// For custom options, it should be the fully-qualified name. For example, + /// `"google.api.http"`. + var name: String = String() + + /// The option's value packed in an Any message. If the value is a primitive, + /// the corresponding wrapper type defined in google/protobuf/wrappers.proto + /// should be used. If the value is an enum, it should be stored as an int32 + /// value using the google.protobuf.Int32Value type. + var value: Google_Protobuf_Any { + get {return _value ?? Google_Protobuf_Any()} + set {_value = newValue} + } + /// Returns true if `value` has been explicitly set. + var hasValue: Bool {return self._value != nil} + /// Clears the value of `value`. Subsequent reads from it will return its default value. + mutating func clearValue() {self._value = nil} + + var unknownFields = UnknownStorage() + + init() {} + + fileprivate var _value: Google_Protobuf_Any? = nil +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Google_Protobuf_Type: @unchecked Sendable {} +extension Google_Protobuf_Field: @unchecked Sendable {} +extension Google_Protobuf_Enum: @unchecked Sendable {} +extension Google_Protobuf_EnumValue: @unchecked Sendable {} +extension Google_Protobuf_Option: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "google.protobuf" + +extension Google_Protobuf_Syntax: _ProtoNameProviding { + static let _protobuf_nameMap: _NameMap = [ + 0: .same(proto: "SYNTAX_PROTO2"), + 1: .same(proto: "SYNTAX_PROTO3"), + 2: .same(proto: "SYNTAX_EDITIONS"), + ] +} + +extension Google_Protobuf_Type: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Type" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "fields"), + 3: .same(proto: "oneofs"), + 4: .same(proto: "options"), + 5: .standard(proto: "source_context"), + 6: .same(proto: "syntax"), + 7: .same(proto: "edition"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.fields) }() + case 3: try { try decoder.decodeRepeatedStringField(value: &self.oneofs) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.options) }() + case 5: try { try decoder.decodeSingularMessageField(value: &self._sourceContext) }() + case 6: try { try decoder.decodeSingularEnumField(value: &self.syntax) }() + case 7: try { try decoder.decodeSingularStringField(value: &self.edition) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + if !self.fields.isEmpty { + try visitor.visitRepeatedMessageField(value: self.fields, fieldNumber: 2) + } + if !self.oneofs.isEmpty { + try visitor.visitRepeatedStringField(value: self.oneofs, fieldNumber: 3) + } + if !self.options.isEmpty { + try visitor.visitRepeatedMessageField(value: self.options, fieldNumber: 4) + } + try { if let v = self._sourceContext { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + if self.syntax != .proto2 { + try visitor.visitSingularEnumField(value: self.syntax, fieldNumber: 6) + } + if !self.edition.isEmpty { + try visitor.visitSingularStringField(value: self.edition, fieldNumber: 7) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Type, rhs: Google_Protobuf_Type) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.fields != rhs.fields {return false} + if lhs.oneofs != rhs.oneofs {return false} + if lhs.options != rhs.options {return false} + if lhs._sourceContext != rhs._sourceContext {return false} + if lhs.syntax != rhs.syntax {return false} + if lhs.edition != rhs.edition {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_Field: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Field" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "kind"), + 2: .same(proto: "cardinality"), + 3: .same(proto: "number"), + 4: .same(proto: "name"), + 6: .standard(proto: "type_url"), + 7: .standard(proto: "oneof_index"), + 8: .same(proto: "packed"), + 9: .same(proto: "options"), + 10: .standard(proto: "json_name"), + 11: .standard(proto: "default_value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.kind) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self.cardinality) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self.number) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 6: try { try decoder.decodeSingularStringField(value: &self.typeURL) }() + case 7: try { try decoder.decodeSingularInt32Field(value: &self.oneofIndex) }() + case 8: try { try decoder.decodeSingularBoolField(value: &self.packed) }() + case 9: try { try decoder.decodeRepeatedMessageField(value: &self.options) }() + case 10: try { try decoder.decodeSingularStringField(value: &self.jsonName) }() + case 11: try { try decoder.decodeSingularStringField(value: &self.defaultValue) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.kind != .typeUnknown { + try visitor.visitSingularEnumField(value: self.kind, fieldNumber: 1) + } + if self.cardinality != .unknown { + try visitor.visitSingularEnumField(value: self.cardinality, fieldNumber: 2) + } + if self.number != 0 { + try visitor.visitSingularInt32Field(value: self.number, fieldNumber: 3) + } + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 4) + } + if !self.typeURL.isEmpty { + try visitor.visitSingularStringField(value: self.typeURL, fieldNumber: 6) + } + if self.oneofIndex != 0 { + try visitor.visitSingularInt32Field(value: self.oneofIndex, fieldNumber: 7) + } + if self.packed != false { + try visitor.visitSingularBoolField(value: self.packed, fieldNumber: 8) + } + if !self.options.isEmpty { + try visitor.visitRepeatedMessageField(value: self.options, fieldNumber: 9) + } + if !self.jsonName.isEmpty { + try visitor.visitSingularStringField(value: self.jsonName, fieldNumber: 10) + } + if !self.defaultValue.isEmpty { + try visitor.visitSingularStringField(value: self.defaultValue, fieldNumber: 11) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Field, rhs: Google_Protobuf_Field) -> Bool { + if lhs.kind != rhs.kind {return false} + if lhs.cardinality != rhs.cardinality {return false} + if lhs.number != rhs.number {return false} + if lhs.name != rhs.name {return false} + if lhs.typeURL != rhs.typeURL {return false} + if lhs.oneofIndex != rhs.oneofIndex {return false} + if lhs.packed != rhs.packed {return false} + if lhs.options != rhs.options {return false} + if lhs.jsonName != rhs.jsonName {return false} + if lhs.defaultValue != rhs.defaultValue {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_Field.Kind: _ProtoNameProviding { + static let _protobuf_nameMap: _NameMap = [ + 0: .same(proto: "TYPE_UNKNOWN"), + 1: .same(proto: "TYPE_DOUBLE"), + 2: .same(proto: "TYPE_FLOAT"), + 3: .same(proto: "TYPE_INT64"), + 4: .same(proto: "TYPE_UINT64"), + 5: .same(proto: "TYPE_INT32"), + 6: .same(proto: "TYPE_FIXED64"), + 7: .same(proto: "TYPE_FIXED32"), + 8: .same(proto: "TYPE_BOOL"), + 9: .same(proto: "TYPE_STRING"), + 10: .same(proto: "TYPE_GROUP"), + 11: .same(proto: "TYPE_MESSAGE"), + 12: .same(proto: "TYPE_BYTES"), + 13: .same(proto: "TYPE_UINT32"), + 14: .same(proto: "TYPE_ENUM"), + 15: .same(proto: "TYPE_SFIXED32"), + 16: .same(proto: "TYPE_SFIXED64"), + 17: .same(proto: "TYPE_SINT32"), + 18: .same(proto: "TYPE_SINT64"), + ] +} + +extension Google_Protobuf_Field.Cardinality: _ProtoNameProviding { + static let _protobuf_nameMap: _NameMap = [ + 0: .same(proto: "CARDINALITY_UNKNOWN"), + 1: .same(proto: "CARDINALITY_OPTIONAL"), + 2: .same(proto: "CARDINALITY_REQUIRED"), + 3: .same(proto: "CARDINALITY_REPEATED"), + ] +} + +extension Google_Protobuf_Enum: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Enum" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "enumvalue"), + 3: .same(proto: "options"), + 4: .standard(proto: "source_context"), + 5: .same(proto: "syntax"), + 6: .same(proto: "edition"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.enumvalue) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.options) }() + case 4: try { try decoder.decodeSingularMessageField(value: &self._sourceContext) }() + case 5: try { try decoder.decodeSingularEnumField(value: &self.syntax) }() + case 6: try { try decoder.decodeSingularStringField(value: &self.edition) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + if !self.enumvalue.isEmpty { + try visitor.visitRepeatedMessageField(value: self.enumvalue, fieldNumber: 2) + } + if !self.options.isEmpty { + try visitor.visitRepeatedMessageField(value: self.options, fieldNumber: 3) + } + try { if let v = self._sourceContext { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + if self.syntax != .proto2 { + try visitor.visitSingularEnumField(value: self.syntax, fieldNumber: 5) + } + if !self.edition.isEmpty { + try visitor.visitSingularStringField(value: self.edition, fieldNumber: 6) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Enum, rhs: Google_Protobuf_Enum) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.enumvalue != rhs.enumvalue {return false} + if lhs.options != rhs.options {return false} + if lhs._sourceContext != rhs._sourceContext {return false} + if lhs.syntax != rhs.syntax {return false} + if lhs.edition != rhs.edition {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_EnumValue: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".EnumValue" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "number"), + 3: .same(proto: "options"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.number) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.options) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + if self.number != 0 { + try visitor.visitSingularInt32Field(value: self.number, fieldNumber: 2) + } + if !self.options.isEmpty { + try visitor.visitRepeatedMessageField(value: self.options, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_EnumValue, rhs: Google_Protobuf_EnumValue) -> Bool { + if lhs.name != rhs.name {return false} + if lhs.number != rhs.number {return false} + if lhs.options != rhs.options {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_Option: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Option" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "name"), + 2: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.name.isEmpty { + try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) + } + try { if let v = self._value { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Option, rhs: Google_Protobuf_Option) -> Bool { + if lhs.name != rhs.name {return false} + if lhs._value != rhs._value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Reference/google/protobuf/unittest.pb.swift b/Reference/upstream/google/protobuf/unittest.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest.pb.swift rename to Reference/upstream/google/protobuf/unittest.pb.swift diff --git a/Reference/google/protobuf/unittest_arena.pb.swift b/Reference/upstream/google/protobuf/unittest_arena.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_arena.pb.swift rename to Reference/upstream/google/protobuf/unittest_arena.pb.swift diff --git a/Reference/google/protobuf/unittest_custom_options.pb.swift b/Reference/upstream/google/protobuf/unittest_custom_options.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_custom_options.pb.swift rename to Reference/upstream/google/protobuf/unittest_custom_options.pb.swift diff --git a/Reference/google/protobuf/unittest_drop_unknown_fields.pb.swift b/Reference/upstream/google/protobuf/unittest_drop_unknown_fields.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_drop_unknown_fields.pb.swift rename to Reference/upstream/google/protobuf/unittest_drop_unknown_fields.pb.swift diff --git a/Reference/google/protobuf/unittest_embed_optimize_for.pb.swift b/Reference/upstream/google/protobuf/unittest_embed_optimize_for.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_embed_optimize_for.pb.swift rename to Reference/upstream/google/protobuf/unittest_embed_optimize_for.pb.swift diff --git a/Reference/google/protobuf/unittest_empty.pb.swift b/Reference/upstream/google/protobuf/unittest_empty.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_empty.pb.swift rename to Reference/upstream/google/protobuf/unittest_empty.pb.swift diff --git a/Reference/google/protobuf/unittest_enormous_descriptor.pb.swift b/Reference/upstream/google/protobuf/unittest_enormous_descriptor.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_enormous_descriptor.pb.swift rename to Reference/upstream/google/protobuf/unittest_enormous_descriptor.pb.swift diff --git a/Reference/google/protobuf/unittest_import.pb.swift b/Reference/upstream/google/protobuf/unittest_import.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_import.pb.swift rename to Reference/upstream/google/protobuf/unittest_import.pb.swift diff --git a/Reference/google/protobuf/unittest_import_lite.pb.swift b/Reference/upstream/google/protobuf/unittest_import_lite.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_import_lite.pb.swift rename to Reference/upstream/google/protobuf/unittest_import_lite.pb.swift diff --git a/Reference/google/protobuf/unittest_import_public.pb.swift b/Reference/upstream/google/protobuf/unittest_import_public.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_import_public.pb.swift rename to Reference/upstream/google/protobuf/unittest_import_public.pb.swift diff --git a/Reference/google/protobuf/unittest_import_public_lite.pb.swift b/Reference/upstream/google/protobuf/unittest_import_public_lite.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_import_public_lite.pb.swift rename to Reference/upstream/google/protobuf/unittest_import_public_lite.pb.swift diff --git a/Reference/google/protobuf/unittest_lazy_dependencies.pb.swift b/Reference/upstream/google/protobuf/unittest_lazy_dependencies.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_lazy_dependencies.pb.swift rename to Reference/upstream/google/protobuf/unittest_lazy_dependencies.pb.swift diff --git a/Reference/google/protobuf/unittest_lazy_dependencies_custom_option.pb.swift b/Reference/upstream/google/protobuf/unittest_lazy_dependencies_custom_option.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_lazy_dependencies_custom_option.pb.swift rename to Reference/upstream/google/protobuf/unittest_lazy_dependencies_custom_option.pb.swift diff --git a/Reference/google/protobuf/unittest_lazy_dependencies_enum.pb.swift b/Reference/upstream/google/protobuf/unittest_lazy_dependencies_enum.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_lazy_dependencies_enum.pb.swift rename to Reference/upstream/google/protobuf/unittest_lazy_dependencies_enum.pb.swift diff --git a/Reference/google/protobuf/unittest_lite.pb.swift b/Reference/upstream/google/protobuf/unittest_lite.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_lite.pb.swift rename to Reference/upstream/google/protobuf/unittest_lite.pb.swift diff --git a/Reference/google/protobuf/unittest_lite_imports_nonlite.pb.swift b/Reference/upstream/google/protobuf/unittest_lite_imports_nonlite.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_lite_imports_nonlite.pb.swift rename to Reference/upstream/google/protobuf/unittest_lite_imports_nonlite.pb.swift diff --git a/Reference/google/protobuf/unittest_mset.pb.swift b/Reference/upstream/google/protobuf/unittest_mset.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_mset.pb.swift rename to Reference/upstream/google/protobuf/unittest_mset.pb.swift diff --git a/Reference/google/protobuf/unittest_mset_wire_format.pb.swift b/Reference/upstream/google/protobuf/unittest_mset_wire_format.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_mset_wire_format.pb.swift rename to Reference/upstream/google/protobuf/unittest_mset_wire_format.pb.swift diff --git a/Reference/google/protobuf/unittest_no_field_presence.pb.swift b/Reference/upstream/google/protobuf/unittest_no_field_presence.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_no_field_presence.pb.swift rename to Reference/upstream/google/protobuf/unittest_no_field_presence.pb.swift diff --git a/Reference/google/protobuf/unittest_no_generic_services.pb.swift b/Reference/upstream/google/protobuf/unittest_no_generic_services.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_no_generic_services.pb.swift rename to Reference/upstream/google/protobuf/unittest_no_generic_services.pb.swift diff --git a/Reference/google/protobuf/unittest_optimize_for.pb.swift b/Reference/upstream/google/protobuf/unittest_optimize_for.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_optimize_for.pb.swift rename to Reference/upstream/google/protobuf/unittest_optimize_for.pb.swift diff --git a/Reference/google/protobuf/unittest_preserve_unknown_enum.pb.swift b/Reference/upstream/google/protobuf/unittest_preserve_unknown_enum.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_preserve_unknown_enum.pb.swift rename to Reference/upstream/google/protobuf/unittest_preserve_unknown_enum.pb.swift diff --git a/Reference/google/protobuf/unittest_preserve_unknown_enum2.pb.swift b/Reference/upstream/google/protobuf/unittest_preserve_unknown_enum2.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_preserve_unknown_enum2.pb.swift rename to Reference/upstream/google/protobuf/unittest_preserve_unknown_enum2.pb.swift diff --git a/Reference/google/protobuf/unittest_proto3.pb.swift b/Reference/upstream/google/protobuf/unittest_proto3.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_proto3.pb.swift rename to Reference/upstream/google/protobuf/unittest_proto3.pb.swift diff --git a/Reference/google/protobuf/unittest_proto3_arena.pb.swift b/Reference/upstream/google/protobuf/unittest_proto3_arena.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_proto3_arena.pb.swift rename to Reference/upstream/google/protobuf/unittest_proto3_arena.pb.swift diff --git a/Reference/google/protobuf/unittest_proto3_arena_lite.pb.swift b/Reference/upstream/google/protobuf/unittest_proto3_arena_lite.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_proto3_arena_lite.pb.swift rename to Reference/upstream/google/protobuf/unittest_proto3_arena_lite.pb.swift diff --git a/Reference/google/protobuf/unittest_proto3_bad_macros.pb.swift b/Reference/upstream/google/protobuf/unittest_proto3_bad_macros.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_proto3_bad_macros.pb.swift rename to Reference/upstream/google/protobuf/unittest_proto3_bad_macros.pb.swift diff --git a/Reference/google/protobuf/unittest_proto3_lite.pb.swift b/Reference/upstream/google/protobuf/unittest_proto3_lite.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_proto3_lite.pb.swift rename to Reference/upstream/google/protobuf/unittest_proto3_lite.pb.swift diff --git a/Reference/google/protobuf/unittest_proto3_optional.pb.swift b/Reference/upstream/google/protobuf/unittest_proto3_optional.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_proto3_optional.pb.swift rename to Reference/upstream/google/protobuf/unittest_proto3_optional.pb.swift diff --git a/Reference/google/protobuf/unittest_retention.pb.swift b/Reference/upstream/google/protobuf/unittest_retention.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_retention.pb.swift rename to Reference/upstream/google/protobuf/unittest_retention.pb.swift diff --git a/Reference/google/protobuf/unittest_well_known_types.pb.swift b/Reference/upstream/google/protobuf/unittest_well_known_types.pb.swift similarity index 100% rename from Reference/google/protobuf/unittest_well_known_types.pb.swift rename to Reference/upstream/google/protobuf/unittest_well_known_types.pb.swift diff --git a/Reference/upstream/google/protobuf/wrappers.pb.swift b/Reference/upstream/google/protobuf/wrappers.pb.swift new file mode 100644 index 000000000..e76419352 --- /dev/null +++ b/Reference/upstream/google/protobuf/wrappers.pb.swift @@ -0,0 +1,508 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: google/protobuf/wrappers.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Wrappers for primitive (non-message) types. These types are useful +// for embedding primitives in the `google.protobuf.Any` type and for places +// where we need to distinguish between the absence of a primitive +// typed field and its default value. +// +// These wrappers have no meaningful use within repeated fields as they lack +// the ability to detect presence on individual elements. +// These wrappers have no meaningful use within a map or a oneof since +// individual entries of a map or fields of a oneof can already detect presence. + +import Foundation + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: ProtobufAPIVersionCheck { + struct _3: ProtobufAPIVersion_3 {} + typealias Version = _3 +} + +/// Wrapper message for `double`. +/// +/// The JSON representation for `DoubleValue` is JSON number. +struct Google_Protobuf_DoubleValue { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The double value. + var value: Double = 0 + + var unknownFields = UnknownStorage() + + init() {} +} + +/// Wrapper message for `float`. +/// +/// The JSON representation for `FloatValue` is JSON number. +struct Google_Protobuf_FloatValue { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The float value. + var value: Float = 0 + + var unknownFields = UnknownStorage() + + init() {} +} + +/// Wrapper message for `int64`. +/// +/// The JSON representation for `Int64Value` is JSON string. +struct Google_Protobuf_Int64Value { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The int64 value. + var value: Int64 = 0 + + var unknownFields = UnknownStorage() + + init() {} +} + +/// Wrapper message for `uint64`. +/// +/// The JSON representation for `UInt64Value` is JSON string. +struct Google_Protobuf_UInt64Value { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The uint64 value. + var value: UInt64 = 0 + + var unknownFields = UnknownStorage() + + init() {} +} + +/// Wrapper message for `int32`. +/// +/// The JSON representation for `Int32Value` is JSON number. +struct Google_Protobuf_Int32Value { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The int32 value. + var value: Int32 = 0 + + var unknownFields = UnknownStorage() + + init() {} +} + +/// Wrapper message for `uint32`. +/// +/// The JSON representation for `UInt32Value` is JSON number. +struct Google_Protobuf_UInt32Value { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The uint32 value. + var value: UInt32 = 0 + + var unknownFields = UnknownStorage() + + init() {} +} + +/// Wrapper message for `bool`. +/// +/// The JSON representation for `BoolValue` is JSON `true` and `false`. +struct Google_Protobuf_BoolValue { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The bool value. + var value: Bool = false + + var unknownFields = UnknownStorage() + + init() {} +} + +/// Wrapper message for `string`. +/// +/// The JSON representation for `StringValue` is JSON string. +struct Google_Protobuf_StringValue { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The string value. + var value: String = String() + + var unknownFields = UnknownStorage() + + init() {} +} + +/// Wrapper message for `bytes`. +/// +/// The JSON representation for `BytesValue` is JSON string. +struct Google_Protobuf_BytesValue { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The bytes value. + var value: Data = Data() + + var unknownFields = UnknownStorage() + + init() {} +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Google_Protobuf_DoubleValue: @unchecked Sendable {} +extension Google_Protobuf_FloatValue: @unchecked Sendable {} +extension Google_Protobuf_Int64Value: @unchecked Sendable {} +extension Google_Protobuf_UInt64Value: @unchecked Sendable {} +extension Google_Protobuf_Int32Value: @unchecked Sendable {} +extension Google_Protobuf_UInt32Value: @unchecked Sendable {} +extension Google_Protobuf_BoolValue: @unchecked Sendable {} +extension Google_Protobuf_StringValue: @unchecked Sendable {} +extension Google_Protobuf_BytesValue: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "google.protobuf" + +extension Google_Protobuf_DoubleValue: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".DoubleValue" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularDoubleField(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.value != 0 { + try visitor.visitSingularDoubleField(value: self.value, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_DoubleValue, rhs: Google_Protobuf_DoubleValue) -> Bool { + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_FloatValue: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FloatValue" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFloatField(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.value != 0 { + try visitor.visitSingularFloatField(value: self.value, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_FloatValue, rhs: Google_Protobuf_FloatValue) -> Bool { + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_Int64Value: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Int64Value" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.value != 0 { + try visitor.visitSingularInt64Field(value: self.value, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Int64Value, rhs: Google_Protobuf_Int64Value) -> Bool { + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_UInt64Value: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".UInt64Value" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt64Field(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.value != 0 { + try visitor.visitSingularUInt64Field(value: self.value, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_UInt64Value, rhs: Google_Protobuf_UInt64Value) -> Bool { + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_Int32Value: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".Int32Value" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.value != 0 { + try visitor.visitSingularInt32Field(value: self.value, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_Int32Value, rhs: Google_Protobuf_Int32Value) -> Bool { + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_UInt32Value: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".UInt32Value" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt32Field(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.value != 0 { + try visitor.visitSingularUInt32Field(value: self.value, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_UInt32Value, rhs: Google_Protobuf_UInt32Value) -> Bool { + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_BoolValue: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".BoolValue" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if self.value != false { + try visitor.visitSingularBoolField(value: self.value, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_BoolValue, rhs: Google_Protobuf_BoolValue) -> Bool { + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_StringValue: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".StringValue" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.value.isEmpty { + try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_StringValue, rhs: Google_Protobuf_StringValue) -> Bool { + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Google_Protobuf_BytesValue: Message, _MessageImplementationBase, _ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".BytesValue" + static let _protobuf_nameMap: _NameMap = [ + 1: .same(proto: "value"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.value.isEmpty { + try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Google_Protobuf_BytesValue, rhs: Google_Protobuf_BytesValue) -> Bool { + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Sources/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.pb.swift b/Sources/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.pb.swift index 720f5788e..2668a683d 100644 --- a/Sources/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.pb.swift +++ b/Sources/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto +// Source: swift_protobuf_module_mappings.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufPluginLibraryTests/DescriptorTestData.swift b/Tests/SwiftProtobufPluginLibraryTests/DescriptorTestData.swift index c1008d078..2d458dc5e 100644 --- a/Tests/SwiftProtobufPluginLibraryTests/DescriptorTestData.swift +++ b/Tests/SwiftProtobufPluginLibraryTests/DescriptorTestData.swift @@ -1171,29 +1171,27 @@ let fileDescriptorSetBytes: [UInt8] = [ 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, 0x0a, 0x92, 0x02, 0x0a, 0x3f, 0x53, 0x77, 0x69, 0x66, - 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2f, 0x73, - 0x77, 0x69, 0x66, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6d, 0x61, 0x70, - 0x70, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x18, 0x73, 0x77, 0x69, 0x66, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x74, 0x6f, 0x33, 0x0a, 0xf7, 0x01, 0x0a, 0x24, 0x73, 0x77, 0x69, 0x66, + 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, + 0x67, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x73, 0x77, + 0x69, 0x66, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x67, 0x65, 0x6e, 0x5f, 0x73, 0x77, 0x69, 0x66, 0x74, 0x22, 0xac, + 0x01, 0x0a, 0x0e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4d, 0x61, 0x70, + 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x48, 0x0a, 0x07, 0x6d, 0x61, 0x70, + 0x70, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, + 0x2e, 0x73, 0x77, 0x69, 0x66, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x67, 0x65, 0x6e, 0x5f, 0x73, 0x77, 0x69, 0x66, - 0x74, 0x22, 0xac, 0x01, 0x0a, 0x0e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x48, 0x0a, 0x07, - 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2e, 0x2e, 0x73, 0x77, 0x69, 0x66, 0x74, 0x5f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x67, 0x65, 0x6e, 0x5f, 0x73, - 0x77, 0x69, 0x66, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4d, - 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x07, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x1a, 0x50, - 0x0a, 0x05, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x46, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33 + 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4d, 0x61, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, + 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x1a, 0x50, 0x0a, 0x05, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x66, + 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, + 0x65, 0x50, 0x61, 0x74, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33 ] let fileDescriptorSetData = Data(fileDescriptorSetBytes) diff --git a/Tests/SwiftProtobufPluginLibraryTests/Test_Descriptor.swift b/Tests/SwiftProtobufPluginLibraryTests/Test_Descriptor.swift index c18b593ed..339a25e4c 100644 --- a/Tests/SwiftProtobufPluginLibraryTests/Test_Descriptor.swift +++ b/Tests/SwiftProtobufPluginLibraryTests/Test_Descriptor.swift @@ -25,7 +25,7 @@ class Test_Descriptor: XCTestCase { XCTAssertEqual(descriptorSet.files[1].name, "google/protobuf/compiler/plugin.proto") XCTAssertEqual(descriptorSet.files[2].name, "pluginlib_descriptor_test.proto") XCTAssertEqual(descriptorSet.files[3].name, "pluginlib_descriptor_test2.proto") - XCTAssertEqual(descriptorSet.files[4].name, "SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto") + XCTAssertEqual(descriptorSet.files[4].name, "swift_protobuf_module_mappings.proto") let pluginFileDescriptor = descriptorSet.files[1] diff --git a/Tests/SwiftProtobufTests/any_test.pb.swift b/Tests/SwiftProtobufTests/any_test.pb.swift index 8f938722a..07d97e762 100644 --- a/Tests/SwiftProtobufTests/any_test.pb.swift +++ b/Tests/SwiftProtobufTests/any_test.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/any_test.proto +// Source: any_test.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/map_proto2_unittest.pb.swift b/Tests/SwiftProtobufTests/map_proto2_unittest.pb.swift index 82320d5b9..65258eeb1 100644 --- a/Tests/SwiftProtobufTests/map_proto2_unittest.pb.swift +++ b/Tests/SwiftProtobufTests/map_proto2_unittest.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/map_proto2_unittest.proto +// Source: map_proto2_unittest.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/map_unittest.pb.swift b/Tests/SwiftProtobufTests/map_unittest.pb.swift index b8ff310a6..61a1b4faa 100644 --- a/Tests/SwiftProtobufTests/map_unittest.pb.swift +++ b/Tests/SwiftProtobufTests/map_unittest.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/map_unittest.proto +// Source: map_unittest.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/test_messages_proto3.pb.swift b/Tests/SwiftProtobufTests/test_messages_proto3.pb.swift index 6c290ddc3..551e04128 100644 --- a/Tests/SwiftProtobufTests/test_messages_proto3.pb.swift +++ b/Tests/SwiftProtobufTests/test_messages_proto3.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/test_messages_proto3.proto +// Source: test_messages_proto3.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest.pb.swift b/Tests/SwiftProtobufTests/unittest.pb.swift index e7e2f0423..7b1d005b7 100644 --- a/Tests/SwiftProtobufTests/unittest.pb.swift +++ b/Tests/SwiftProtobufTests/unittest.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest.proto +// Source: unittest.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_arena.pb.swift b/Tests/SwiftProtobufTests/unittest_arena.pb.swift index adcefaf46..fb32b7f36 100644 --- a/Tests/SwiftProtobufTests/unittest_arena.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_arena.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_arena.proto +// Source: unittest_arena.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_custom_options.pb.swift b/Tests/SwiftProtobufTests/unittest_custom_options.pb.swift index 91e1f931a..fa25c45ed 100644 --- a/Tests/SwiftProtobufTests/unittest_custom_options.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_custom_options.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_custom_options.proto +// Source: unittest_custom_options.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_drop_unknown_fields.pb.swift b/Tests/SwiftProtobufTests/unittest_drop_unknown_fields.pb.swift index 1c5716483..91919fe4b 100644 --- a/Tests/SwiftProtobufTests/unittest_drop_unknown_fields.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_drop_unknown_fields.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_drop_unknown_fields.proto +// Source: unittest_drop_unknown_fields.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_embed_optimize_for.pb.swift b/Tests/SwiftProtobufTests/unittest_embed_optimize_for.pb.swift index 92b2614a8..57fedcb0d 100644 --- a/Tests/SwiftProtobufTests/unittest_embed_optimize_for.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_embed_optimize_for.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_embed_optimize_for.proto +// Source: unittest_embed_optimize_for.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_empty.pb.swift b/Tests/SwiftProtobufTests/unittest_empty.pb.swift index 927a8472e..bfc5c7e6b 100644 --- a/Tests/SwiftProtobufTests/unittest_empty.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_empty.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_empty.proto +// Source: unittest_empty.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_import.pb.swift b/Tests/SwiftProtobufTests/unittest_import.pb.swift index d105542d3..a64829a78 100644 --- a/Tests/SwiftProtobufTests/unittest_import.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_import.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_import.proto +// Source: unittest_import.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_import_lite.pb.swift b/Tests/SwiftProtobufTests/unittest_import_lite.pb.swift index 1b392d174..32541731b 100644 --- a/Tests/SwiftProtobufTests/unittest_import_lite.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_import_lite.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_import_lite.proto +// Source: unittest_import_lite.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_import_public.pb.swift b/Tests/SwiftProtobufTests/unittest_import_public.pb.swift index f23697597..242ef1369 100644 --- a/Tests/SwiftProtobufTests/unittest_import_public.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_import_public.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_import_public.proto +// Source: unittest_import_public.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_import_public_lite.pb.swift b/Tests/SwiftProtobufTests/unittest_import_public_lite.pb.swift index 99cf5a304..b252d56d2 100644 --- a/Tests/SwiftProtobufTests/unittest_import_public_lite.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_import_public_lite.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_import_public_lite.proto +// Source: unittest_import_public_lite.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_lite.pb.swift b/Tests/SwiftProtobufTests/unittest_lite.pb.swift index c6c35f32c..ac1b08d3c 100644 --- a/Tests/SwiftProtobufTests/unittest_lite.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_lite.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_lite.proto +// Source: unittest_lite.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_lite_imports_nonlite.pb.swift b/Tests/SwiftProtobufTests/unittest_lite_imports_nonlite.pb.swift index fdb539da1..d44127ef3 100644 --- a/Tests/SwiftProtobufTests/unittest_lite_imports_nonlite.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_lite_imports_nonlite.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_lite_imports_nonlite.proto +// Source: unittest_lite_imports_nonlite.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_mset.pb.swift b/Tests/SwiftProtobufTests/unittest_mset.pb.swift index 04d40ff56..2d1127d22 100644 --- a/Tests/SwiftProtobufTests/unittest_mset.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_mset.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_mset.proto +// Source: unittest_mset.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_mset_wire_format.pb.swift b/Tests/SwiftProtobufTests/unittest_mset_wire_format.pb.swift index cea62062c..cb3ea4806 100644 --- a/Tests/SwiftProtobufTests/unittest_mset_wire_format.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_mset_wire_format.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_mset_wire_format.proto +// Source: unittest_mset_wire_format.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_no_field_presence.pb.swift b/Tests/SwiftProtobufTests/unittest_no_field_presence.pb.swift index 7fe3519cd..aab2c4ae1 100644 --- a/Tests/SwiftProtobufTests/unittest_no_field_presence.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_no_field_presence.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_no_field_presence.proto +// Source: unittest_no_field_presence.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_no_generic_services.pb.swift b/Tests/SwiftProtobufTests/unittest_no_generic_services.pb.swift index 434770226..41ad8ebe8 100644 --- a/Tests/SwiftProtobufTests/unittest_no_generic_services.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_no_generic_services.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_no_generic_services.proto +// Source: unittest_no_generic_services.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_optimize_for.pb.swift b/Tests/SwiftProtobufTests/unittest_optimize_for.pb.swift index 0c6b78ec0..2dff3e3f3 100644 --- a/Tests/SwiftProtobufTests/unittest_optimize_for.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_optimize_for.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_optimize_for.proto +// Source: unittest_optimize_for.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_preserve_unknown_enum.pb.swift b/Tests/SwiftProtobufTests/unittest_preserve_unknown_enum.pb.swift index eb5c4ef5e..76178a0ac 100644 --- a/Tests/SwiftProtobufTests/unittest_preserve_unknown_enum.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_preserve_unknown_enum.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_preserve_unknown_enum.proto +// Source: unittest_preserve_unknown_enum.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_preserve_unknown_enum2.pb.swift b/Tests/SwiftProtobufTests/unittest_preserve_unknown_enum2.pb.swift index c4044ffa4..8d64f12f9 100644 --- a/Tests/SwiftProtobufTests/unittest_preserve_unknown_enum2.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_preserve_unknown_enum2.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_preserve_unknown_enum2.proto +// Source: unittest_preserve_unknown_enum2.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_proto3.pb.swift b/Tests/SwiftProtobufTests/unittest_proto3.pb.swift index 4bd975395..261410083 100644 --- a/Tests/SwiftProtobufTests/unittest_proto3.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_proto3.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_proto3.proto +// Source: unittest_proto3.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_proto3_arena.pb.swift b/Tests/SwiftProtobufTests/unittest_proto3_arena.pb.swift index bde8e03f3..7fd0719ac 100644 --- a/Tests/SwiftProtobufTests/unittest_proto3_arena.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_proto3_arena.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_proto3_arena.proto +// Source: unittest_proto3_arena.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_proto3_optional.pb.swift b/Tests/SwiftProtobufTests/unittest_proto3_optional.pb.swift index 84e339745..c2cbfe36b 100644 --- a/Tests/SwiftProtobufTests/unittest_proto3_optional.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_proto3_optional.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_proto3_optional.proto +// Source: unittest_proto3_optional.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ diff --git a/Tests/SwiftProtobufTests/unittest_well_known_types.pb.swift b/Tests/SwiftProtobufTests/unittest_well_known_types.pb.swift index d347cecf8..8ee8719d9 100644 --- a/Tests/SwiftProtobufTests/unittest_well_known_types.pb.swift +++ b/Tests/SwiftProtobufTests/unittest_well_known_types.pb.swift @@ -2,7 +2,7 @@ // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: google/protobuf/unittest_well_known_types.proto +// Source: unittest_well_known_types.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/