diff --git a/.github/workflows/buf.yaml b/.github/workflows/buf.yaml index 8e5ed48..a7390bc 100644 --- a/.github/workflows/buf.yaml +++ b/.github/workflows/buf.yaml @@ -8,26 +8,23 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1.27.2 - with: - github_token: ${{ github.token }} - - uses: bufbuild/buf-push-action@v1.1.1 + - uses: bufbuild/buf-action@v1 with: input: 'limit-output-types' - buf_token: ${{ secrets.BUF_TOKEN }} - - uses: bufbuild/buf-push-action@v1.1.1 + token: ${{ secrets.BUF_TOKEN }} + - uses: bufbuild/buf-action@v1 with: input: 'linting/bad' - buf_token: ${{ secrets.BUF_TOKEN }} - - uses: bufbuild/buf-push-action@v1.1.1 + token: ${{ secrets.BUF_TOKEN }} + - uses: bufbuild/buf-action@v1 with: input: 'linting/good' - buf_token: ${{ secrets.BUF_TOKEN }} - - uses: bufbuild/buf-push-action@v1.1.1 + token: ${{ secrets.BUF_TOKEN }} + - uses: bufbuild/buf-action@v1 with: input: 'workspace/observabilitytypes' - buf_token: ${{ secrets.BUF_TOKEN }} - - uses: bufbuild/buf-push-action@v1.1.1 + token: ${{ secrets.BUF_TOKEN }} + - uses: bufbuild/buf-action@v1 with: input: 'workspace/observabilityapi' - buf_token: ${{ secrets.BUF_TOKEN }} + token: ${{ secrets.BUF_TOKEN }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5a041c8..a408f19 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,23 +4,10 @@ jobs: lint-and-breaking-change-detection: runs-on: ubuntu-latest steps: - # Run `git checkout` - name: Checkout uses: actions/checkout@v4 - # Install the `buf` CLI - - name: Setup - uses: bufbuild/buf-setup-action@v1.27.2 - with: - github_token: ${{ github.token }} - # Lint the Buf module in the `github-actions` directory - - name: Lint - uses: bufbuild/buf-lint-action@v1 - with: - input: github-actions - # Detect breaking changes for the Buf module in the `github-actions` directory - # against the current `main` branch - - name: Breaking change detection against `main` - uses: bufbuild/buf-breaking-action@v1 + - name: Buf Action + uses: bufbuild/buf-action@v1 with: input: github-actions - against: https://github.com/bufbuild/buf-examples.git#branch=main,ref=HEAD~1,subdir=github-actions + token: ${{ secrets.BUF_TOKEN }} diff --git a/README.md b/README.md index 4ea2acd..3dc2938 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,14 @@ This repo houses example projects for learning how to use [Buf]. For more inform ## Version -The examples in this repo currently use version [1.8.0][version] of the [`buf` CLI][cli]. +The examples in this repo use [v2 `buf.yaml`][v2-buf-yaml] and [v2 `buf.gen.yaml`][v2-buf-gen-yaml] +configurations. All examples require the `buf` CLI at version [v1.32.0][min-version] or higher. ## Projects Project | Directory | Category :-------|:----------|:-------- -Buf [workspace] | [`workspace-modules`](./workspace) | Code organization +Buf [workspace] | [`workspace`](./workspace) | Code organization [Linting][lint] Protobuf sources | [`linting`](./linting) | Maintenance [Breaking change detection][breaking] | [`breaking-change-detection`](./breaking-change-detection) | Maintenance [Remote plugin execution][remote] | [`plugin-execution-remote`](./plugin-execution-remote) | Code generation @@ -36,5 +37,7 @@ Several of these projects available as modules on the [Buf Schema Registry][bsr] [modules]: https://docs.buf.build/bsr/overview#modules [plugin]: https://docs.buf.build/bsr/remote-generation/concepts#plugins [remote]: https://docs.buf.build/bsr/remote-generation/remote-plugin-execution -[version]: https://github.com/bufbuild/buf/releases/tag/v1.8.0 [workspace]: https://docs.buf.build/reference/workspaces +[min-version]: https://github.com/bufbuild/buf/releases/tag/v1.32.0 +[v2-buf-yaml]: https://buf.build/docs/configuration/v2/buf-yaml +[v2-buf-gen-yaml]: https://buf.build/docs/configuration/v2/buf-gen-yaml diff --git a/breaking-change-detection/README.md b/breaking-change-detection/README.md index bdb8424..eed464f 100644 --- a/breaking-change-detection/README.md +++ b/breaking-change-detection/README.md @@ -1,5 +1,6 @@ # Breaking change detection +> [!NOTE] > You need to have the [`buf` CLI][install] installed to follow along with this example. This project shows Buf [breaking change detection][breaking] in action. There are three different [Buf inputs][inputs] in play here: diff --git a/breaking-change-detection/compatible/buf.yaml b/breaking-change-detection/compatible/buf.yaml index bb28665..73fc580 100644 --- a/breaking-change-detection/compatible/buf.yaml +++ b/breaking-change-detection/compatible/buf.yaml @@ -1,8 +1,15 @@ -version: v1 +version: v2 name: buf.build/acme/weather -breaking: - use: - - FILE lint: use: - DEFAULT + except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE + disallow_comment_ignores: true +breaking: + use: + - FILE + except: + - EXTENSION_NO_DELETE + - FIELD_SAME_DEFAULT diff --git a/breaking-change-detection/incompatible/buf.yaml b/breaking-change-detection/incompatible/buf.yaml index bb28665..73fc580 100644 --- a/breaking-change-detection/incompatible/buf.yaml +++ b/breaking-change-detection/incompatible/buf.yaml @@ -1,8 +1,15 @@ -version: v1 +version: v2 name: buf.build/acme/weather -breaking: - use: - - FILE lint: use: - DEFAULT + except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE + disallow_comment_ignores: true +breaking: + use: + - FILE + except: + - EXTENSION_NO_DELETE + - FIELD_SAME_DEFAULT diff --git a/breaking-change-detection/initial/buf.yaml b/breaking-change-detection/initial/buf.yaml index bb28665..73fc580 100644 --- a/breaking-change-detection/initial/buf.yaml +++ b/breaking-change-detection/initial/buf.yaml @@ -1,8 +1,15 @@ -version: v1 +version: v2 name: buf.build/acme/weather -breaking: - use: - - FILE lint: use: - DEFAULT + except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE + disallow_comment_ignores: true +breaking: + use: + - FILE + except: + - EXTENSION_NO_DELETE + - FIELD_SAME_DEFAULT diff --git a/github-actions/README.md b/github-actions/README.md index 518dc4c..c066210 100644 --- a/github-actions/README.md +++ b/github-actions/README.md @@ -2,18 +2,11 @@ [![GitHub Actions](https://github.com/bufbuild/buf-examples/workflows/CI/badge.svg)](https://github.com/bufbuild/buf-examples/actions?workflow=CI) -This example project shows you how to use Buf in a [GitHub Actions][actions] setting. The Actions pipeline here involves three Buf-specific GitHub Actions: - -* [`buf-setup-action`][buf-setup] installs the [`buf` CLI][cli] -* [`buf-lint-action`][buf-lint] [lints][lint] this Protobuf module -* [`buf-breaking-action`][buf-breaking] runs [breaking change detection][breaking] against the current `main` branch +This example project shows you how to use Buf in a [GitHub Actions][actions] setting. +This uses the [Buf Action][buf-action]. > The configuration for [GitHub Actions][actions] is in the [`.github`](../.github) directory in the root, as that's where GitHub expects it to be. [actions]: https://docs.github.com/actions -[breaking]: https://docs.buf.build/breaking -[buf-breaking]: https://github.com/bufbuild/buf-breaking-action -[buf-lint]: https://github.com/bufbuild/buf-lint-action -[buf-setup]: https://github.com/bufbuild/buf-setup-action +[buf-action]: https://github.com/marketplace/actions/buf-action [cli]: https://github.com/bufbuild/buf -[lint]: https://docs.buf.build/lint diff --git a/github-actions/buf.work.yaml b/github-actions/buf.work.yaml deleted file mode 100644 index 1878b34..0000000 --- a/github-actions/buf.work.yaml +++ /dev/null @@ -1,3 +0,0 @@ -version: v1 -directories: - - proto diff --git a/github-actions/buf.yaml b/github-actions/buf.yaml new file mode 100644 index 0000000..5cc4289 --- /dev/null +++ b/github-actions/buf.yaml @@ -0,0 +1,16 @@ +version: v2 +modules: + - path: proto +lint: + use: + - DEFAULT + except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE + disallow_comment_ignores: true +breaking: + use: + - FILE + except: + - EXTENSION_NO_DELETE + - FIELD_SAME_DEFAULT diff --git a/github-actions/proto/buf.yaml b/github-actions/proto/buf.yaml deleted file mode 100644 index 1a51945..0000000 --- a/github-actions/proto/buf.yaml +++ /dev/null @@ -1,7 +0,0 @@ -version: v1 -breaking: - use: - - FILE -lint: - use: - - DEFAULT diff --git a/limit-output-types/README.md b/limit-output-types/README.md index 75c68ca..a697245 100644 --- a/limit-output-types/README.md +++ b/limit-output-types/README.md @@ -1,7 +1,7 @@ # Limit types -> You need to install the [`buf` CLI][install] and [jq] to follow along with this example. Requires -> v1.1.0 or above. +> [!NOTE] +> You need to install the [`buf` CLI][install] and [jq] to follow along with this example. The [`buf build`][build] command creates a [Buf image][image] (or [`FileDescriptorSet`][filedescriptorset]) out of a [Buf input][input]. By default, the image or diff --git a/limit-output-types/buf.yaml b/limit-output-types/buf.yaml index ff561f2..21c601e 100644 --- a/limit-output-types/buf.yaml +++ b/limit-output-types/buf.yaml @@ -1,8 +1,15 @@ -version: v1 +version: v2 name: buf.build/buf-examples/limit-output-types -breaking: - use: - - FILE lint: use: - DEFAULT + except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE + disallow_comment_ignores: true +breaking: + use: + - FILE + except: + - EXTENSION_NO_DELETE + - FIELD_SAME_DEFAULT diff --git a/linting/README.md b/linting/README.md index d3be7a2..02f1adc 100644 --- a/linting/README.md +++ b/linting/README.md @@ -1,5 +1,6 @@ # Protobuf linting +> [!NOTE] > You need to have the [`buf` CLI][install] installed to follow along with this example. Buf enables you to [lint] Protobuf sources in accordance with [lint rules][rules] that you specify in your [`buf.yaml`][buf-yaml] configuration file. This project shows linting in action with two different [Buf inputs][inputs]: @@ -50,7 +51,7 @@ buf lint ./good [bsr]: https://docs.buf.build/bsr [bsr-bad]: https://buf.build/buf-examples/linting-bad [bsr-good]: https://buf.build/buf-examples/linting-good -[buf-yaml]: https://docs.buf.build/configuration/v1/buf-yaml +[buf-yaml]: https://docs.buf.build/configuration/v2/buf-yaml [default]: https://docs.buf.build/lint/rules#default [inputs]: https://docs.buf.build/reference/inputs [install]: https://docs.buf.build/installation diff --git a/linting/bad/buf.lock b/linting/bad/buf.lock index f5c25d7..bd230ac 100644 --- a/linting/bad/buf.lock +++ b/linting/bad/buf.lock @@ -1,7 +1,6 @@ # Generated by buf. DO NOT EDIT. -version: v1 +version: v2 deps: - - remote: buf.build - owner: googleapis - repository: googleapis + - name: buf.build/googleapis/googleapis commit: 783e4b5374fa488ab068d08af9658438 + digest: b5:2d674e2936711677a6c4572193f1cfb204f28f01366d570b617bf308fa59869f64be0407880451df2888cc371c7e1069b813c5450b4d8719d639c4a4f7889efe diff --git a/linting/bad/buf.yaml b/linting/bad/buf.yaml index 74ec902..e6d4d8a 100644 --- a/linting/bad/buf.yaml +++ b/linting/bad/buf.yaml @@ -1,10 +1,17 @@ -version: v1 +version: v2 name: buf.build/buf-examples/linting-bad deps: - buf.build/googleapis/googleapis:783e4b5374fa488ab068d08af9658438 -breaking: - use: - - FILE lint: use: - DEFAULT + except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE + disallow_comment_ignores: true +breaking: + use: + - FILE + except: + - EXTENSION_NO_DELETE + - FIELD_SAME_DEFAULT diff --git a/linting/good/buf.lock b/linting/good/buf.lock index f5c25d7..bd230ac 100644 --- a/linting/good/buf.lock +++ b/linting/good/buf.lock @@ -1,7 +1,6 @@ # Generated by buf. DO NOT EDIT. -version: v1 +version: v2 deps: - - remote: buf.build - owner: googleapis - repository: googleapis + - name: buf.build/googleapis/googleapis commit: 783e4b5374fa488ab068d08af9658438 + digest: b5:2d674e2936711677a6c4572193f1cfb204f28f01366d570b617bf308fa59869f64be0407880451df2888cc371c7e1069b813c5450b4d8719d639c4a4f7889efe diff --git a/linting/good/buf.yaml b/linting/good/buf.yaml index efc629b..4b70d47 100644 --- a/linting/good/buf.yaml +++ b/linting/good/buf.yaml @@ -1,10 +1,17 @@ -version: v1 +version: v2 name: buf.build/buf-examples/linting-good deps: - buf.build/googleapis/googleapis:783e4b5374fa488ab068d08af9658438 -breaking: - use: - - FILE lint: use: - DEFAULT + except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE + disallow_comment_ignores: true +breaking: + use: + - FILE + except: + - EXTENSION_NO_DELETE + - FIELD_SAME_DEFAULT diff --git a/managed-mode/README.md b/managed-mode/README.md index 3956c2a..f9f6b06 100644 --- a/managed-mode/README.md +++ b/managed-mode/README.md @@ -21,7 +21,7 @@ When you run this command, the `buf` CLI uses the configuration in [`buf.gen.yam * [Ruby](./gen/proto/ruby) [arena]: https://developers.google.com/protocol-buffers/docs/reference/arenas -[buf-gen-yaml]: https://docs.buf.build/configuration/v1/buf-gen-yaml#managed +[buf-gen-yaml]: https://docs.buf.build/configuration/v2/buf-gen-yaml#managed [install]: https://docs.buf.build/installation [managed]: https://docs.buf.build/generate/managed-mode [plugins]: https://docs.buf.build/bsr/remote-generation/overview#hosted-plugins diff --git a/managed-mode/buf.gen.yaml b/managed-mode/buf.gen.yaml index e503e1a..32f7dd7 100644 --- a/managed-mode/buf.gen.yaml +++ b/managed-mode/buf.gen.yaml @@ -1,31 +1,31 @@ -version: v1 +version: v2 managed: enabled: true - optimize_for: CODE_SIZE - - # C++ - cc_enable_arenas: true - - # Go - go_package_prefix: - default: github.com/acme/weather/v1 - - # Java - java_multiple_files: false - java_package_prefix: io - java_string_check_utf8: false + override: + - file_option: cc_enable_arenas + value: true + - file_option: java_multiple_files + value: false + - file_option: java_string_check_utf8 + value: false + - file_option: java_package_prefix + value: io + - file_option: optimize_for + value: CODE_SIZE + - file_option: go_package_prefix + value: github.com/acme/weather/v1 plugins: - - plugin: buf.build/protocolbuffers/cpp + - remote: buf.build/protocolbuffers/cpp out: gen/proto/cpp - - plugin: buf.build/protocolbuffers/csharp + - remote: buf.build/protocolbuffers/csharp out: gen/proto/csharp - - plugin: buf.build/protocolbuffers/go + - remote: buf.build/protocolbuffers/go out: gen/proto/go - - plugin: buf.build/protocolbuffers/java + - remote: buf.build/protocolbuffers/java out: gen/proto/java - - plugin: buf.build/protocolbuffers/objc + - remote: buf.build/protocolbuffers/objc out: gen/proto/objc - - plugin: buf.build/protocolbuffers/php + - remote: buf.build/protocolbuffers/php out: gen/proto/php - - plugin: buf.build/protocolbuffers/ruby + - remote: buf.build/protocolbuffers/ruby out: gen/proto/ruby diff --git a/managed-mode/buf.yaml b/managed-mode/buf.yaml index 2059796..b838b96 100644 --- a/managed-mode/buf.yaml +++ b/managed-mode/buf.yaml @@ -1,9 +1,16 @@ -version: v1 +version: v2 name: buf.build/acme/weather lint: use: - DEFAULT + except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE enum_zero_value_suffix: _UNKNOWN + disallow_comment_ignores: true breaking: use: - - FILE + - FILE + except: + - EXTENSION_NO_DELETE + - FIELD_SAME_DEFAULT diff --git a/managed-mode/gen/proto/cpp/acme/weather/v1/weather.pb.cc b/managed-mode/gen/proto/cpp/acme/weather/v1/weather.pb.cc index 1de0e3d..ef92a77 100644 --- a/managed-mode/gen/proto/cpp/acme/weather/v1/weather.pb.cc +++ b/managed-mode/gen/proto/cpp/acme/weather/v1/weather.pb.cc @@ -1,305 +1,473 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: acme/weather/v1/weather.proto +// Protobuf C++ Version: 5.28.2 #include "acme/weather/v1/weather.pb.h" #include - -#include -#include -#include -#include -#include -#include -#include +#include +#include "google/protobuf/io/coded_stream.h" +#include "google/protobuf/generated_message_tctable_impl.h" +#include "google/protobuf/extension_set.h" +#include "google/protobuf/wire_format_lite.h" +#include "google/protobuf/descriptor.h" +#include "google/protobuf/generated_message_reflection.h" +#include "google/protobuf/reflection_ops.h" +#include "google/protobuf/wire_format.h" // @@protoc_insertion_point(includes) -#include +// Must be included last. +#include "google/protobuf/port_def.inc" PROTOBUF_PRAGMA_INIT_SEG - -namespace _pb = ::PROTOBUF_NAMESPACE_ID; -namespace _pbi = _pb::internal; - +namespace _pb = ::google::protobuf; +namespace _pbi = ::google::protobuf::internal; +namespace _fl = ::google::protobuf::internal::field_layout; namespace acme { namespace weather { namespace v1 { -PROTOBUF_CONSTEXPR Location::Location( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.latitude_)*/0 - , /*decltype(_impl_.longitude_)*/0 - , /*decltype(_impl_._cached_size_)*/{}} {} + +inline constexpr Location::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : latitude_{0}, + longitude_{0}, + _cached_size_{0} {} + +template +PROTOBUF_CONSTEXPR Location::Location(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} struct LocationDefaultTypeInternal { - PROTOBUF_CONSTEXPR LocationDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR LocationDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} ~LocationDefaultTypeInternal() {} union { Location _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LocationDefaultTypeInternal _Location_default_instance_; -PROTOBUF_CONSTEXPR Weather::Weather( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.location_)*/nullptr - , /*decltype(_impl_.temperature_)*/0 - , /*decltype(_impl_.wind_speed_)*/0 - , /*decltype(_impl_.condition_)*/0 - , /*decltype(_impl_._cached_size_)*/{}} {} + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LocationDefaultTypeInternal _Location_default_instance_; + +inline constexpr Weather::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + location_{nullptr}, + temperature_{0}, + wind_speed_{0}, + condition_{static_cast< ::acme::weather::v1::Condition >(0)} {} + +template +PROTOBUF_CONSTEXPR Weather::Weather(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} struct WeatherDefaultTypeInternal { - PROTOBUF_CONSTEXPR WeatherDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} + PROTOBUF_CONSTEXPR WeatherDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} ~WeatherDefaultTypeInternal() {} union { Weather _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WeatherDefaultTypeInternal _Weather_default_instance_; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WeatherDefaultTypeInternal _Weather_default_instance_; } // namespace v1 } // namespace weather } // namespace acme -static ::_pb::Metadata file_level_metadata_acme_2fweather_2fv1_2fweather_2eproto[2]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_acme_2fweather_2fv1_2fweather_2eproto[1]; -static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_acme_2fweather_2fv1_2fweather_2eproto = nullptr; - -const uint32_t TableStruct_acme_2fweather_2fv1_2fweather_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Location, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Location, _impl_.latitude_), - PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Location, _impl_.longitude_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Weather, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Weather, _impl_.location_), - PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Weather, _impl_.temperature_), - PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Weather, _impl_.wind_speed_), - PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Weather, _impl_.condition_), -}; -static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, -1, sizeof(::acme::weather::v1::Location)}, - { 8, -1, -1, sizeof(::acme::weather::v1::Weather)}, +static constexpr const ::_pb::ServiceDescriptor** + file_level_service_descriptors_acme_2fweather_2fv1_2fweather_2eproto = nullptr; +const ::uint32_t + TableStruct_acme_2fweather_2fv1_2fweather_2eproto::offsets[] ABSL_ATTRIBUTE_SECTION_VARIABLE( + protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Location, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Location, _impl_.latitude_), + PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Location, _impl_.longitude_), + PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Weather, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Weather, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Weather, _impl_.location_), + PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Weather, _impl_.temperature_), + PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Weather, _impl_.wind_speed_), + PROTOBUF_FIELD_OFFSET(::acme::weather::v1::Weather, _impl_.condition_), + 0, + ~0u, + ~0u, + ~0u, }; +static const ::_pbi::MigrationSchema + schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + {0, -1, -1, sizeof(::acme::weather::v1::Location)}, + {10, 22, -1, sizeof(::acme::weather::v1::Weather)}, +}; static const ::_pb::Message* const file_default_instances[] = { - &::acme::weather::v1::_Location_default_instance_._instance, - &::acme::weather::v1::_Weather_default_instance_._instance, + &::acme::weather::v1::_Location_default_instance_._instance, + &::acme::weather::v1::_Weather_default_instance_._instance, }; - -const char descriptor_table_protodef_acme_2fweather_2fv1_2fweather_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\035acme/weather/v1/weather.proto\022\017acme.we" - "ather.v1\"D\n\010Location\022\032\n\010latitude\030\001 \001(\002R\010" - "latitude\022\034\n\tlongitude\030\002 \001(\002R\tlongitude\"\273" - "\001\n\007Weather\0225\n\010location\030\001 \001(\0132\031.acme.weat" - "her.v1.LocationR\010location\022 \n\013temperature" - "\030\002 \001(\002R\013temperature\022\035\n\nwind_speed\030\003 \001(\002R" - "\twindSpeed\0228\n\tcondition\030\004 \001(\0162\032.acme.wea" - "ther.v1.ConditionR\tcondition*b\n\tConditio" - "n\022\025\n\021CONDITION_UNKNOWN\020\000\022\023\n\017CONDITION_RA" - "INY\020\001\022\023\n\017CONDITION_SUNNY\020\002\022\024\n\020CONDITION_" - "CLOUDY\020\003B\266\001\n\022io.acme.weather.v1B\014Weather" - "ProtoH\002Z4github.com/acme/weather/v1/acme" - "/weather/v1;weatherv1\242\002\003AWX\252\002\017Acme.Weath" - "er.V1\312\002\017Acme\\Weather\\V1\342\002\033Acme\\Weather\\V" - "1\\GPBMetadata\352\002\021Acme::Weather::V1b\006proto" - "3" - ; -static ::_pbi::once_flag descriptor_table_acme_2fweather_2fv1_2fweather_2eproto_once; -const ::_pbi::DescriptorTable descriptor_table_acme_2fweather_2fv1_2fweather_2eproto = { - false, false, 601, descriptor_table_protodef_acme_2fweather_2fv1_2fweather_2eproto, +const char descriptor_table_protodef_acme_2fweather_2fv1_2fweather_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE( + protodesc_cold) = { + "\n\035acme/weather/v1/weather.proto\022\017acme.we" + "ather.v1\"D\n\010Location\022\032\n\010latitude\030\001 \001(\002R\010" + "latitude\022\034\n\tlongitude\030\002 \001(\002R\tlongitude\"\273" + "\001\n\007Weather\0225\n\010location\030\001 \001(\0132\031.acme.weat" + "her.v1.LocationR\010location\022 \n\013temperature" + "\030\002 \001(\002R\013temperature\022\035\n\nwind_speed\030\003 \001(\002R" + "\twindSpeed\0228\n\tcondition\030\004 \001(\0162\032.acme.wea" + "ther.v1.ConditionR\tcondition*b\n\tConditio" + "n\022\025\n\021CONDITION_UNKNOWN\020\000\022\023\n\017CONDITION_RA" + "INY\020\001\022\023\n\017CONDITION_SUNNY\020\002\022\024\n\020CONDITION_" + "CLOUDY\020\003B\266\001\n\022io.acme.weather.v1B\014Weather" + "ProtoH\002Z4github.com/acme/weather/v1/acme" + "/weather/v1;weatherv1\242\002\003AWX\252\002\017Acme.Weath" + "er.V1\312\002\017Acme\\Weather\\V1\342\002\033Acme\\Weather\\V" + "1\\GPBMetadata\352\002\021Acme::Weather::V1b\006proto" + "3" +}; +static ::absl::once_flag descriptor_table_acme_2fweather_2fv1_2fweather_2eproto_once; +PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_acme_2fweather_2fv1_2fweather_2eproto = { + false, + false, + 601, + descriptor_table_protodef_acme_2fweather_2fv1_2fweather_2eproto, "acme/weather/v1/weather.proto", - &descriptor_table_acme_2fweather_2fv1_2fweather_2eproto_once, nullptr, 0, 2, - schemas, file_default_instances, TableStruct_acme_2fweather_2fv1_2fweather_2eproto::offsets, - file_level_metadata_acme_2fweather_2fv1_2fweather_2eproto, file_level_enum_descriptors_acme_2fweather_2fv1_2fweather_2eproto, + &descriptor_table_acme_2fweather_2fv1_2fweather_2eproto_once, + nullptr, + 0, + 2, + schemas, + file_default_instances, + TableStruct_acme_2fweather_2fv1_2fweather_2eproto::offsets, + file_level_enum_descriptors_acme_2fweather_2fv1_2fweather_2eproto, file_level_service_descriptors_acme_2fweather_2fv1_2fweather_2eproto, }; -PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_acme_2fweather_2fv1_2fweather_2eproto_getter() { - return &descriptor_table_acme_2fweather_2fv1_2fweather_2eproto; -} - -// Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_acme_2fweather_2fv1_2fweather_2eproto(&descriptor_table_acme_2fweather_2fv1_2fweather_2eproto); namespace acme { namespace weather { namespace v1 { -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Condition_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_acme_2fweather_2fv1_2fweather_2eproto); +const ::google::protobuf::EnumDescriptor* Condition_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_acme_2fweather_2fv1_2fweather_2eproto); return file_level_enum_descriptors_acme_2fweather_2fv1_2fweather_2eproto[0]; } +PROTOBUF_CONSTINIT const uint32_t Condition_internal_data_[] = { + 262144u, 0u, }; bool Condition_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - return true; - default: - return false; - } + return 0 <= value && value <= 3; } - - // =================================================================== class Location::_Internal { public: }; -Location::Location(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +Location::Location(::google::protobuf::Arena* arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, _class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); // @@protoc_insertion_point(arena_constructor:acme.weather.v1.Location) } -Location::Location(const Location& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - Location* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.latitude_){} - , decltype(_impl_.longitude_){} - , /*decltype(_impl_._cached_size_)*/{}}; - - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.latitude_, &from._impl_.latitude_, - static_cast(reinterpret_cast(&_impl_.longitude_) - - reinterpret_cast(&_impl_.latitude_)) + sizeof(_impl_.longitude_)); - // @@protoc_insertion_point(copy_constructor:acme.weather.v1.Location) +Location::Location( + ::google::protobuf::Arena* arena, const Location& from) + : Location(arena) { + MergeFrom(from); } - -inline void Location::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.latitude_){0} - , decltype(_impl_.longitude_){0} - , /*decltype(_impl_._cached_size_)*/{} - }; +inline PROTOBUF_NDEBUG_INLINE Location::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena) + : _cached_size_{0} {} + +inline void Location::SharedCtor(::_pb::Arena* arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, latitude_), + 0, + offsetof(Impl_, longitude_) - + offsetof(Impl_, latitude_) + + sizeof(Impl_::longitude_)); } - Location::~Location() { // @@protoc_insertion_point(destructor:acme.weather.v1.Location) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } - inline void Location::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + ABSL_DCHECK(GetArena() == nullptr); + _impl_.~Impl_(); } -void Location::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::google::protobuf::MessageLite::ClassDataFull + Location::_class_data_ = { + ::google::protobuf::Message::ClassData{ + &_Location_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &Location::MergeImpl, +#if defined(PROTOBUF_CUSTOM_VTABLE) + ::google::protobuf::Message::GetDeleteImpl(), + ::google::protobuf::Message::GetNewImpl(), + ::google::protobuf::Message::ClearImpl, ::google::protobuf::Message::ByteSizeLongImpl, + ::google::protobuf::Message::_InternalSerializeImpl, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(Location, _impl_._cached_size_), + false, + }, + &Location::kDescriptorMethods, + &descriptor_table_acme_2fweather_2fv1_2fweather_2eproto, + nullptr, // tracker +}; +const ::google::protobuf::MessageLite::ClassData* Location::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_class_data_.tc_table); + return _class_data_.base(); } +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 0, 0, 2> Location::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + _class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::acme::weather::v1::Location>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // float longitude = 2 [json_name = "longitude"]; + {::_pbi::TcParser::FastF32S1, + {21, 63, 0, PROTOBUF_FIELD_OFFSET(Location, _impl_.longitude_)}}, + // float latitude = 1 [json_name = "latitude"]; + {::_pbi::TcParser::FastF32S1, + {13, 63, 0, PROTOBUF_FIELD_OFFSET(Location, _impl_.latitude_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // float latitude = 1 [json_name = "latitude"]; + {PROTOBUF_FIELD_OFFSET(Location, _impl_.latitude_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kFloat)}, + // float longitude = 2 [json_name = "longitude"]; + {PROTOBUF_FIELD_OFFSET(Location, _impl_.longitude_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kFloat)}, + }}, + // no aux_entries + {{ + }}, +}; -void Location::InternalSwap(Location* other) { +void Location::InternalSwap(Location* PROTOBUF_RESTRICT other) { using std::swap; GetReflection()->Swap(this, other);} -::PROTOBUF_NAMESPACE_ID::Metadata Location::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_acme_2fweather_2fv1_2fweather_2eproto_getter, &descriptor_table_acme_2fweather_2fv1_2fweather_2eproto_once, - file_level_metadata_acme_2fweather_2fv1_2fweather_2eproto[0]); +::google::protobuf::Metadata Location::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); } - // =================================================================== class Weather::_Internal { public: - static const ::acme::weather::v1::Location& location(const Weather* msg); + using HasBits = + decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Weather, _impl_._has_bits_); }; -const ::acme::weather::v1::Location& -Weather::_Internal::location(const Weather* msg) { - return *msg->_impl_.location_; -} -Weather::Weather(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +Weather::Weather(::google::protobuf::Arena* arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, _class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); // @@protoc_insertion_point(arena_constructor:acme.weather.v1.Weather) } -Weather::Weather(const Weather& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - Weather* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.location_){nullptr} - , decltype(_impl_.temperature_){} - , decltype(_impl_.wind_speed_){} - , decltype(_impl_.condition_){} - , /*decltype(_impl_._cached_size_)*/{}}; +inline PROTOBUF_NDEBUG_INLINE Weather::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, + const Impl_& from, const ::acme::weather::v1::Weather& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0} {} + +Weather::Weather( + ::google::protobuf::Arena* arena, + const Weather& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, _class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + Weather* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.location_ = (cached_has_bits & 0x00000001u) ? ::google::protobuf::Message::CopyConstruct<::acme::weather::v1::Location>( + arena, *from._impl_.location_) + : nullptr; + ::memcpy(reinterpret_cast(&_impl_) + + offsetof(Impl_, temperature_), + reinterpret_cast(&from._impl_) + + offsetof(Impl_, temperature_), + offsetof(Impl_, condition_) - + offsetof(Impl_, temperature_) + + sizeof(Impl_::condition_)); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - if (from._internal_has_location()) { - _this->_impl_.location_ = new ::acme::weather::v1::Location(*from._impl_.location_); - } - ::memcpy(&_impl_.temperature_, &from._impl_.temperature_, - static_cast(reinterpret_cast(&_impl_.condition_) - - reinterpret_cast(&_impl_.temperature_)) + sizeof(_impl_.condition_)); // @@protoc_insertion_point(copy_constructor:acme.weather.v1.Weather) } - -inline void Weather::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.location_){nullptr} - , decltype(_impl_.temperature_){0} - , decltype(_impl_.wind_speed_){0} - , decltype(_impl_.condition_){0} - , /*decltype(_impl_._cached_size_)*/{} - }; +inline PROTOBUF_NDEBUG_INLINE Weather::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena) + : _cached_size_{0} {} + +inline void Weather::SharedCtor(::_pb::Arena* arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, location_), + 0, + offsetof(Impl_, condition_) - + offsetof(Impl_, location_) + + sizeof(Impl_::condition_)); } - Weather::~Weather() { // @@protoc_insertion_point(destructor:acme.weather.v1.Weather) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); SharedDtor(); } - inline void Weather::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (this != internal_default_instance()) delete _impl_.location_; + ABSL_DCHECK(GetArena() == nullptr); + delete _impl_.location_; + _impl_.~Impl_(); } -void Weather::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::google::protobuf::MessageLite::ClassDataFull + Weather::_class_data_ = { + ::google::protobuf::Message::ClassData{ + &_Weather_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &Weather::MergeImpl, +#if defined(PROTOBUF_CUSTOM_VTABLE) + ::google::protobuf::Message::GetDeleteImpl(), + ::google::protobuf::Message::GetNewImpl(), + ::google::protobuf::Message::ClearImpl, ::google::protobuf::Message::ByteSizeLongImpl, + ::google::protobuf::Message::_InternalSerializeImpl, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(Weather, _impl_._cached_size_), + false, + }, + &Weather::kDescriptorMethods, + &descriptor_table_acme_2fweather_2fv1_2fweather_2eproto, + nullptr, // tracker +}; +const ::google::protobuf::MessageLite::ClassData* Weather::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_class_data_.tc_table); + return _class_data_.base(); } +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<2, 4, 1, 0, 2> Weather::_table_ = { + { + PROTOBUF_FIELD_OFFSET(Weather, _impl_._has_bits_), + 0, // no _extensions_ + 4, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967280, // skipmap + offsetof(decltype(_table_), field_entries), + 4, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + _class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::acme::weather::v1::Weather>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // .acme.weather.v1.Condition condition = 4 [json_name = "condition"]; + {::_pbi::TcParser::FastV32S1, + {32, 63, 0, PROTOBUF_FIELD_OFFSET(Weather, _impl_.condition_)}}, + // .acme.weather.v1.Location location = 1 [json_name = "location"]; + {::_pbi::TcParser::FastMtS1, + {10, 0, 0, PROTOBUF_FIELD_OFFSET(Weather, _impl_.location_)}}, + // float temperature = 2 [json_name = "temperature"]; + {::_pbi::TcParser::FastF32S1, + {21, 63, 0, PROTOBUF_FIELD_OFFSET(Weather, _impl_.temperature_)}}, + // float wind_speed = 3 [json_name = "windSpeed"]; + {::_pbi::TcParser::FastF32S1, + {29, 63, 0, PROTOBUF_FIELD_OFFSET(Weather, _impl_.wind_speed_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // .acme.weather.v1.Location location = 1 [json_name = "location"]; + {PROTOBUF_FIELD_OFFSET(Weather, _impl_.location_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + // float temperature = 2 [json_name = "temperature"]; + {PROTOBUF_FIELD_OFFSET(Weather, _impl_.temperature_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kFloat)}, + // float wind_speed = 3 [json_name = "windSpeed"]; + {PROTOBUF_FIELD_OFFSET(Weather, _impl_.wind_speed_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kFloat)}, + // .acme.weather.v1.Condition condition = 4 [json_name = "condition"]; + {PROTOBUF_FIELD_OFFSET(Weather, _impl_.condition_), -1, 0, + (0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)}, + }}, {{ + {::_pbi::TcParser::GetTable<::acme::weather::v1::Location>()}, + }}, {{ + }}, +}; -void Weather::InternalSwap(Weather* other) { +void Weather::InternalSwap(Weather* PROTOBUF_RESTRICT other) { using std::swap; GetReflection()->Swap(this, other);} -::PROTOBUF_NAMESPACE_ID::Metadata Weather::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_acme_2fweather_2fv1_2fweather_2eproto_getter, &descriptor_table_acme_2fweather_2fv1_2fweather_2eproto_once, - file_level_metadata_acme_2fweather_2fv1_2fweather_2eproto[1]); +::google::protobuf::Metadata Weather::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); } - // @@protoc_insertion_point(namespace_scope) } // namespace v1 } // namespace weather } // namespace acme -PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::acme::weather::v1::Location* -Arena::CreateMaybeMessage< ::acme::weather::v1::Location >(Arena* arena) { - return Arena::CreateMessageInternal< ::acme::weather::v1::Location >(arena); -} -template<> PROTOBUF_NOINLINE ::acme::weather::v1::Weather* -Arena::CreateMaybeMessage< ::acme::weather::v1::Weather >(Arena* arena) { - return Arena::CreateMessageInternal< ::acme::weather::v1::Weather >(arena); -} -PROTOBUF_NAMESPACE_CLOSE - +namespace google { +namespace protobuf { +} // namespace protobuf +} // namespace google // @@protoc_insertion_point(global_scope) -#include +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::std::false_type + _static_init2_ PROTOBUF_UNUSED = + (::_pbi::AddDescriptors(&descriptor_table_acme_2fweather_2fv1_2fweather_2eproto), + ::std::false_type{}); +#include "google/protobuf/port_undef.inc" diff --git a/managed-mode/gen/proto/cpp/acme/weather/v1/weather.pb.h b/managed-mode/gen/proto/cpp/acme/weather/v1/weather.pb.h index 9ea0406..39dd329 100644 --- a/managed-mode/gen/proto/cpp/acme/weather/v1/weather.pb.h +++ b/managed-mode/gen/proto/cpp/acme/weather/v1/weather.pb.h @@ -1,50 +1,54 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: acme/weather/v1/weather.proto +// Protobuf C++ Version: 5.28.2 -#ifndef GOOGLE_PROTOBUF_INCLUDED_acme_2fweather_2fv1_2fweather_2eproto -#define GOOGLE_PROTOBUF_INCLUDED_acme_2fweather_2fv1_2fweather_2eproto +#ifndef GOOGLE_PROTOBUF_INCLUDED_acme_2fweather_2fv1_2fweather_2eproto_2epb_2eh +#define GOOGLE_PROTOBUF_INCLUDED_acme_2fweather_2fv1_2fweather_2eproto_2epb_2eh #include #include - -#include -#if PROTOBUF_VERSION < 3021000 -#error This file was generated by a newer version of protoc which is -#error incompatible with your Protocol Buffer headers. Please update -#error your headers. -#endif -#if 3021009 < PROTOBUF_MIN_PROTOC_VERSION -#error This file was generated by an older version of protoc which is -#error incompatible with your Protocol Buffer headers. Please -#error regenerate this file with a newer version of protoc. +#include +#include + +#include "google/protobuf/runtime_version.h" +#if PROTOBUF_VERSION != 5028002 +#error "Protobuf C++ gencode is built with an incompatible version of" +#error "Protobuf C++ headers/runtime. See" +#error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp" #endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: export -#include // IWYU pragma: export -#include -#include +#include "google/protobuf/io/coded_stream.h" +#include "google/protobuf/arena.h" +#include "google/protobuf/arenastring.h" +#include "google/protobuf/generated_message_util.h" +#include "google/protobuf/metadata_lite.h" +#include "google/protobuf/generated_message_reflection.h" +#include "google/protobuf/message.h" +#include "google/protobuf/repeated_field.h" // IWYU pragma: export +#include "google/protobuf/extension_set.h" // IWYU pragma: export +#include "google/protobuf/generated_enum_reflection.h" +#include "google/protobuf/unknown_field_set.h" // @@protoc_insertion_point(includes) -#include + +// Must be included last. +#include "google/protobuf/port_def.inc" + #define PROTOBUF_INTERNAL_EXPORT_acme_2fweather_2fv1_2fweather_2eproto -PROTOBUF_NAMESPACE_OPEN + +namespace google { +namespace protobuf { namespace internal { class AnyMetadata; } // namespace internal -PROTOBUF_NAMESPACE_CLOSE +} // namespace protobuf +} // namespace google // Internal implementation detail -- do not use these members. struct TableStruct_acme_2fweather_2fv1_2fweather_2eproto { - static const uint32_t offsets[]; + static const ::uint32_t offsets[]; }; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_acme_2fweather_2fv1_2fweather_2eproto; +extern const ::google::protobuf::internal::DescriptorTable + descriptor_table_acme_2fweather_2fv1_2fweather_2eproto; namespace acme { namespace weather { namespace v1 { @@ -57,66 +61,77 @@ extern WeatherDefaultTypeInternal _Weather_default_instance_; } // namespace v1 } // namespace weather } // namespace acme -PROTOBUF_NAMESPACE_OPEN -template<> ::acme::weather::v1::Location* Arena::CreateMaybeMessage<::acme::weather::v1::Location>(Arena*); -template<> ::acme::weather::v1::Weather* Arena::CreateMaybeMessage<::acme::weather::v1::Weather>(Arena*); -PROTOBUF_NAMESPACE_CLOSE +namespace google { +namespace protobuf { +} // namespace protobuf +} // namespace google + namespace acme { namespace weather { namespace v1 { - enum Condition : int { CONDITION_UNKNOWN = 0, CONDITION_RAINY = 1, CONDITION_SUNNY = 2, CONDITION_CLOUDY = 3, - Condition_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), - Condition_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() + Condition_INT_MIN_SENTINEL_DO_NOT_USE_ = + std::numeric_limits<::int32_t>::min(), + Condition_INT_MAX_SENTINEL_DO_NOT_USE_ = + std::numeric_limits<::int32_t>::max(), }; + bool Condition_IsValid(int value); -constexpr Condition Condition_MIN = CONDITION_UNKNOWN; -constexpr Condition Condition_MAX = CONDITION_CLOUDY; -constexpr int Condition_ARRAYSIZE = Condition_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Condition_descriptor(); -template -inline const std::string& Condition_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Condition_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - Condition_descriptor(), enum_t_value); -} -inline bool Condition_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Condition* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - Condition_descriptor(), name, value); +extern const uint32_t Condition_internal_data_[]; +constexpr Condition Condition_MIN = static_cast(0); +constexpr Condition Condition_MAX = static_cast(3); +constexpr int Condition_ARRAYSIZE = 3 + 1; +const ::google::protobuf::EnumDescriptor* +Condition_descriptor(); +template +const std::string& Condition_Name(T value) { + static_assert(std::is_same::value || + std::is_integral::value, + "Incorrect type passed to Condition_Name()."); + return Condition_Name(static_cast(value)); +} +template <> +inline const std::string& Condition_Name(Condition value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +inline bool Condition_Parse(absl::string_view name, Condition* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Condition_descriptor(), name, value); } + // =================================================================== -class Location final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:acme.weather.v1.Location) */ { - public: - inline Location() : Location(nullptr) {} - ~Location() override; - explicit PROTOBUF_CONSTEXPR Location(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - Location(const Location& from); - Location(Location&& from) noexcept - : Location() { - *this = ::std::move(from); - } +// ------------------------------------------------------------------- +class Location final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:acme.weather.v1.Location) */ { + public: + inline Location() : Location(nullptr) {} + ~Location() PROTOBUF_FINAL; + template + explicit PROTOBUF_CONSTEXPR Location( + ::google::protobuf::internal::ConstantInitialized); + + inline Location(const Location& from) : Location(nullptr, from) {} + inline Location(Location&& from) noexcept + : Location(nullptr, std::move(from)) {} inline Location& operator=(const Location& from) { CopyFrom(from); return *this; } inline Location& operator=(Location&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + if (GetArena() == from.GetArena() +#ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetArena() != nullptr +#endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); } else { @@ -125,13 +140,22 @@ class Location final : return *this; } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { return GetDescriptor(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + static const ::google::protobuf::Descriptor* GetDescriptor() { return default_instance().GetMetadata().descriptor; } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } static const Location& default_instance() { @@ -139,124 +163,140 @@ class Location final : } static inline const Location* internal_default_instance() { return reinterpret_cast( - &_Location_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(Location& a, Location& b) { - a.Swap(&b); + &_Location_default_instance_); } + static constexpr int kIndexInFileMessages = 0; + friend void swap(Location& a, Location& b) { a.Swap(&b); } inline void Swap(Location* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP +#ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() != nullptr && GetArena() == other->GetArena()) { +#else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { +#endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + ::google::protobuf::internal::GenericSwap(this, other); } } void UnsafeArenaSwap(Location* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - Location* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Location* New(::google::protobuf::Arena* arena = nullptr) const PROTOBUF_FINAL { + return ::google::protobuf::Message::DefaultConstruct(arena); } - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + int GetCachedSize() const { return _impl_._cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); - void SetCachedSize(int size) const final; void InternalSwap(Location* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "acme.weather.v1.Location"; + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { return "acme.weather.v1.Location"; } + + protected: + explicit Location(::google::protobuf::Arena* arena); + Location(::google::protobuf::Arena* arena, const Location& from); + Location(::google::protobuf::Arena* arena, Location&& from) noexcept + : Location(arena) { + *this = ::std::move(from); } - protected: - explicit Location(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + const ::google::protobuf::Message::ClassData* GetClassData() const PROTOBUF_FINAL; + static const ::google::protobuf::Message::ClassDataFull _class_data_; + public: + ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- - enum : int { kLatitudeFieldNumber = 1, kLongitudeFieldNumber = 2, }; // float latitude = 1 [json_name = "latitude"]; - void clear_latitude(); + void clear_latitude() ; float latitude() const; void set_latitude(float value); + private: float _internal_latitude() const; void _internal_set_latitude(float value); - public: + public: // float longitude = 2 [json_name = "longitude"]; - void clear_longitude(); + void clear_longitude() ; float longitude() const; void set_longitude(float value); + private: float _internal_longitude() const; void _internal_set_longitude(float value); - public: + public: // @@protoc_insertion_point(class_scope:acme.weather.v1.Location) private: class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable< + 1, 2, 0, + 0, 2> + _table_; + + static constexpr const void* _raw_default_instance_ = + &_Location_default_instance_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; struct Impl_ { + inline explicit constexpr Impl_( + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena); + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena, const Impl_& from, + const Location& from_msg); float latitude_; float longitude_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_acme_2fweather_2fv1_2fweather_2eproto; }; // ------------------------------------------------------------------- -class Weather final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:acme.weather.v1.Weather) */ { +class Weather final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:acme.weather.v1.Weather) */ { public: inline Weather() : Weather(nullptr) {} - ~Weather() override; - explicit PROTOBUF_CONSTEXPR Weather(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - - Weather(const Weather& from); - Weather(Weather&& from) noexcept - : Weather() { - *this = ::std::move(from); - } - + ~Weather() PROTOBUF_FINAL; + template + explicit PROTOBUF_CONSTEXPR Weather( + ::google::protobuf::internal::ConstantInitialized); + + inline Weather(const Weather& from) : Weather(nullptr, from) {} + inline Weather(Weather&& from) noexcept + : Weather(nullptr, std::move(from)) {} inline Weather& operator=(const Weather& from) { CopyFrom(from); return *this; } inline Weather& operator=(Weather&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + if (GetArena() == from.GetArena() +#ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetArena() != nullptr +#endif // !PROTOBUF_FORCE_COPY_IN_MOVE ) { InternalSwap(&from); } else { @@ -265,13 +305,22 @@ class Weather final : return *this; } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { return GetDescriptor(); } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + static const ::google::protobuf::Descriptor* GetDescriptor() { return default_instance().GetMetadata().descriptor; } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + static const ::google::protobuf::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } static const Weather& default_instance() { @@ -279,62 +328,58 @@ class Weather final : } static inline const Weather* internal_default_instance() { return reinterpret_cast( - &_Weather_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(Weather& a, Weather& b) { - a.Swap(&b); + &_Weather_default_instance_); } + static constexpr int kIndexInFileMessages = 1; + friend void swap(Weather& a, Weather& b) { a.Swap(&b); } inline void Swap(Weather* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP +#ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() != nullptr && GetArena() == other->GetArena()) { +#else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { +#endif // !PROTOBUF_FORCE_COPY_IN_SWAP InternalSwap(other); } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + ::google::protobuf::internal::GenericSwap(this, other); } } void UnsafeArenaSwap(Weather* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - Weather* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + Weather* New(::google::protobuf::Arena* arena = nullptr) const PROTOBUF_FINAL { + return ::google::protobuf::Message::DefaultConstruct(arena); } - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + int GetCachedSize() const { return _impl_._cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedCtor(::google::protobuf::Arena* arena); void SharedDtor(); - void SetCachedSize(int size) const final; void InternalSwap(Weather* other); - - private: - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "acme.weather.v1.Weather"; + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { return "acme.weather.v1.Weather"; } + + protected: + explicit Weather(::google::protobuf::Arena* arena); + Weather(::google::protobuf::Arena* arena, const Weather& from); + Weather(::google::protobuf::Arena* arena, Weather&& from) noexcept + : Weather(arena) { + *this = ::std::move(from); } - protected: - explicit Weather(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + const ::google::protobuf::Message::ClassData* GetClassData() const PROTOBUF_FINAL; + static const ::google::protobuf::Message::ClassDataFull _class_data_; + public: + ::google::protobuf::Metadata GetMetadata() const; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- - enum : int { kLocationFieldNumber = 1, kTemperatureFieldNumber = 2, @@ -343,294 +388,338 @@ class Weather final : }; // .acme.weather.v1.Location location = 1 [json_name = "location"]; bool has_location() const; - private: - bool _internal_has_location() const; - public: - void clear_location(); + void clear_location() ; const ::acme::weather::v1::Location& location() const; PROTOBUF_NODISCARD ::acme::weather::v1::Location* release_location(); ::acme::weather::v1::Location* mutable_location(); - void set_allocated_location(::acme::weather::v1::Location* location); + void set_allocated_location(::acme::weather::v1::Location* value); + void unsafe_arena_set_allocated_location(::acme::weather::v1::Location* value); + ::acme::weather::v1::Location* unsafe_arena_release_location(); + private: const ::acme::weather::v1::Location& _internal_location() const; ::acme::weather::v1::Location* _internal_mutable_location(); - public: - void unsafe_arena_set_allocated_location( - ::acme::weather::v1::Location* location); - ::acme::weather::v1::Location* unsafe_arena_release_location(); + public: // float temperature = 2 [json_name = "temperature"]; - void clear_temperature(); + void clear_temperature() ; float temperature() const; void set_temperature(float value); + private: float _internal_temperature() const; void _internal_set_temperature(float value); - public: + public: // float wind_speed = 3 [json_name = "windSpeed"]; - void clear_wind_speed(); + void clear_wind_speed() ; float wind_speed() const; void set_wind_speed(float value); + private: float _internal_wind_speed() const; void _internal_set_wind_speed(float value); - public: + public: // .acme.weather.v1.Condition condition = 4 [json_name = "condition"]; - void clear_condition(); + void clear_condition() ; ::acme::weather::v1::Condition condition() const; void set_condition(::acme::weather::v1::Condition value); + private: ::acme::weather::v1::Condition _internal_condition() const; void _internal_set_condition(::acme::weather::v1::Condition value); - public: + public: // @@protoc_insertion_point(class_scope:acme.weather.v1.Weather) private: class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable< + 2, 4, 1, + 0, 2> + _table_; + + static constexpr const void* _raw_default_instance_ = + &_Weather_default_instance_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; struct Impl_ { + inline explicit constexpr Impl_( + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena); + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena, const Impl_& from, + const Weather& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; ::acme::weather::v1::Location* location_; float temperature_; float wind_speed_; int condition_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_acme_2fweather_2fv1_2fweather_2eproto; }; + // =================================================================== + + // =================================================================== + #ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ +// ------------------------------------------------------------------- + // Location // float latitude = 1 [json_name = "latitude"]; inline void Location::clear_latitude() { + ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.latitude_ = 0; } -inline float Location::_internal_latitude() const { - return _impl_.latitude_; -} inline float Location::latitude() const { // @@protoc_insertion_point(field_get:acme.weather.v1.Location.latitude) return _internal_latitude(); } -inline void Location::_internal_set_latitude(float value) { - - _impl_.latitude_ = value; -} inline void Location::set_latitude(float value) { _internal_set_latitude(value); // @@protoc_insertion_point(field_set:acme.weather.v1.Location.latitude) } +inline float Location::_internal_latitude() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.latitude_; +} +inline void Location::_internal_set_latitude(float value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.latitude_ = value; +} // float longitude = 2 [json_name = "longitude"]; inline void Location::clear_longitude() { + ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.longitude_ = 0; } -inline float Location::_internal_longitude() const { - return _impl_.longitude_; -} inline float Location::longitude() const { // @@protoc_insertion_point(field_get:acme.weather.v1.Location.longitude) return _internal_longitude(); } -inline void Location::_internal_set_longitude(float value) { - - _impl_.longitude_ = value; -} inline void Location::set_longitude(float value) { _internal_set_longitude(value); // @@protoc_insertion_point(field_set:acme.weather.v1.Location.longitude) } +inline float Location::_internal_longitude() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.longitude_; +} +inline void Location::_internal_set_longitude(float value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.longitude_ = value; +} // ------------------------------------------------------------------- // Weather // .acme.weather.v1.Location location = 1 [json_name = "location"]; -inline bool Weather::_internal_has_location() const { - return this != internal_default_instance() && _impl_.location_ != nullptr; -} inline bool Weather::has_location() const { - return _internal_has_location(); + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.location_ != nullptr); + return value; } inline void Weather::clear_location() { - if (GetArenaForAllocation() == nullptr && _impl_.location_ != nullptr) { - delete _impl_.location_; - } - _impl_.location_ = nullptr; + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.location_ != nullptr) _impl_.location_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; } inline const ::acme::weather::v1::Location& Weather::_internal_location() const { + ::google::protobuf::internal::TSanRead(&_impl_); const ::acme::weather::v1::Location* p = _impl_.location_; - return p != nullptr ? *p : reinterpret_cast( - ::acme::weather::v1::_Location_default_instance_); + return p != nullptr ? *p : reinterpret_cast(::acme::weather::v1::_Location_default_instance_); } -inline const ::acme::weather::v1::Location& Weather::location() const { +inline const ::acme::weather::v1::Location& Weather::location() const ABSL_ATTRIBUTE_LIFETIME_BOUND { // @@protoc_insertion_point(field_get:acme.weather.v1.Weather.location) return _internal_location(); } -inline void Weather::unsafe_arena_set_allocated_location( - ::acme::weather::v1::Location* location) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.location_); +inline void Weather::unsafe_arena_set_allocated_location(::acme::weather::v1::Location* value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.location_); } - _impl_.location_ = location; - if (location) { - + _impl_.location_ = reinterpret_cast<::acme::weather::v1::Location*>(value); + if (value != nullptr) { + _impl_._has_bits_[0] |= 0x00000001u; } else { - + _impl_._has_bits_[0] &= ~0x00000001u; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:acme.weather.v1.Weather.location) } inline ::acme::weather::v1::Location* Weather::release_location() { - - ::acme::weather::v1::Location* temp = _impl_.location_; + ::google::protobuf::internal::TSanWrite(&_impl_); + + _impl_._has_bits_[0] &= ~0x00000001u; + ::acme::weather::v1::Location* released = _impl_.location_; _impl_.location_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); } #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE - return temp; + return released; } inline ::acme::weather::v1::Location* Weather::unsafe_arena_release_location() { + ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:acme.weather.v1.Weather.location) - + + _impl_._has_bits_[0] &= ~0x00000001u; ::acme::weather::v1::Location* temp = _impl_.location_; _impl_.location_ = nullptr; return temp; } inline ::acme::weather::v1::Location* Weather::_internal_mutable_location() { - + ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.location_ == nullptr) { - auto* p = CreateMaybeMessage<::acme::weather::v1::Location>(GetArenaForAllocation()); - _impl_.location_ = p; + auto* p = ::google::protobuf::Message::DefaultConstruct<::acme::weather::v1::Location>(GetArena()); + _impl_.location_ = reinterpret_cast<::acme::weather::v1::Location*>(p); } return _impl_.location_; } -inline ::acme::weather::v1::Location* Weather::mutable_location() { +inline ::acme::weather::v1::Location* Weather::mutable_location() ABSL_ATTRIBUTE_LIFETIME_BOUND { + _impl_._has_bits_[0] |= 0x00000001u; ::acme::weather::v1::Location* _msg = _internal_mutable_location(); // @@protoc_insertion_point(field_mutable:acme.weather.v1.Weather.location) return _msg; } -inline void Weather::set_allocated_location(::acme::weather::v1::Location* location) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); +inline void Weather::set_allocated_location(::acme::weather::v1::Location* value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); if (message_arena == nullptr) { - delete _impl_.location_; + delete (_impl_.location_); } - if (location) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(location); + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = (value)->GetArena(); if (message_arena != submessage_arena) { - location = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, location, submessage_arena); + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - + _impl_._has_bits_[0] |= 0x00000001u; } else { - + _impl_._has_bits_[0] &= ~0x00000001u; } - _impl_.location_ = location; + + _impl_.location_ = reinterpret_cast<::acme::weather::v1::Location*>(value); // @@protoc_insertion_point(field_set_allocated:acme.weather.v1.Weather.location) } // float temperature = 2 [json_name = "temperature"]; inline void Weather::clear_temperature() { + ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.temperature_ = 0; } -inline float Weather::_internal_temperature() const { - return _impl_.temperature_; -} inline float Weather::temperature() const { // @@protoc_insertion_point(field_get:acme.weather.v1.Weather.temperature) return _internal_temperature(); } -inline void Weather::_internal_set_temperature(float value) { - - _impl_.temperature_ = value; -} inline void Weather::set_temperature(float value) { _internal_set_temperature(value); // @@protoc_insertion_point(field_set:acme.weather.v1.Weather.temperature) } +inline float Weather::_internal_temperature() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.temperature_; +} +inline void Weather::_internal_set_temperature(float value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.temperature_ = value; +} // float wind_speed = 3 [json_name = "windSpeed"]; inline void Weather::clear_wind_speed() { + ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.wind_speed_ = 0; } -inline float Weather::_internal_wind_speed() const { - return _impl_.wind_speed_; -} inline float Weather::wind_speed() const { // @@protoc_insertion_point(field_get:acme.weather.v1.Weather.wind_speed) return _internal_wind_speed(); } -inline void Weather::_internal_set_wind_speed(float value) { - - _impl_.wind_speed_ = value; -} inline void Weather::set_wind_speed(float value) { _internal_set_wind_speed(value); // @@protoc_insertion_point(field_set:acme.weather.v1.Weather.wind_speed) } +inline float Weather::_internal_wind_speed() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.wind_speed_; +} +inline void Weather::_internal_set_wind_speed(float value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.wind_speed_ = value; +} // .acme.weather.v1.Condition condition = 4 [json_name = "condition"]; inline void Weather::clear_condition() { + ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.condition_ = 0; } -inline ::acme::weather::v1::Condition Weather::_internal_condition() const { - return static_cast< ::acme::weather::v1::Condition >(_impl_.condition_); -} inline ::acme::weather::v1::Condition Weather::condition() const { // @@protoc_insertion_point(field_get:acme.weather.v1.Weather.condition) return _internal_condition(); } -inline void Weather::_internal_set_condition(::acme::weather::v1::Condition value) { - - _impl_.condition_ = value; -} inline void Weather::set_condition(::acme::weather::v1::Condition value) { _internal_set_condition(value); // @@protoc_insertion_point(field_set:acme.weather.v1.Weather.condition) } +inline ::acme::weather::v1::Condition Weather::_internal_condition() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::acme::weather::v1::Condition>(_impl_.condition_); +} +inline void Weather::_internal_set_condition(::acme::weather::v1::Condition value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.condition_ = value; +} #ifdef __GNUC__ - #pragma GCC diagnostic pop +#pragma GCC diagnostic pop #endif // __GNUC__ -// ------------------------------------------------------------------- - // @@protoc_insertion_point(namespace_scope) - } // namespace v1 } // namespace weather } // namespace acme -PROTOBUF_NAMESPACE_OPEN -template <> struct is_proto_enum< ::acme::weather::v1::Condition> : ::std::true_type {}; +namespace google { +namespace protobuf { + template <> -inline const EnumDescriptor* GetEnumDescriptor< ::acme::weather::v1::Condition>() { +struct is_proto_enum<::acme::weather::v1::Condition> : std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor<::acme::weather::v1::Condition>() { return ::acme::weather::v1::Condition_descriptor(); } -PROTOBUF_NAMESPACE_CLOSE +} // namespace protobuf +} // namespace google // @@protoc_insertion_point(global_scope) -#include -#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_acme_2fweather_2fv1_2fweather_2eproto +#include "google/protobuf/port_undef.inc" + +#endif // GOOGLE_PROTOBUF_INCLUDED_acme_2fweather_2fv1_2fweather_2eproto_2epb_2eh diff --git a/managed-mode/gen/proto/csharp/Weather.cs b/managed-mode/gen/proto/csharp/Weather.cs index 78c45d3..46b803d 100644 --- a/managed-mode/gen/proto/csharp/Weather.cs +++ b/managed-mode/gen/proto/csharp/Weather.cs @@ -59,6 +59,7 @@ public enum Condition { #endregion #region Messages + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Location : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -243,7 +244,11 @@ public void MergeFrom(pb::CodedInputStream input) { #else uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; @@ -266,7 +271,11 @@ public void MergeFrom(pb::CodedInputStream input) { void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; @@ -285,6 +294,7 @@ public void MergeFrom(pb::CodedInputStream input) { } + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class Weather : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage @@ -530,7 +540,11 @@ public void MergeFrom(pb::CodedInputStream input) { #else uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; @@ -564,7 +578,11 @@ public void MergeFrom(pb::CodedInputStream input) { void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { - switch(tag) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; diff --git a/managed-mode/gen/proto/go/github.com/acme/weather/v1/acme/weather/v1/weather.pb.go b/managed-mode/gen/proto/go/github.com/acme/weather/v1/acme/weather/v1/weather.pb.go new file mode 100644 index 0000000..c589ca5 --- /dev/null +++ b/managed-mode/gen/proto/go/github.com/acme/weather/v1/acme/weather/v1/weather.pb.go @@ -0,0 +1,293 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc (unknown) +// source: acme/weather/v1/weather.proto + +package weatherv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Condition int32 + +const ( + Condition_CONDITION_UNKNOWN Condition = 0 + Condition_CONDITION_RAINY Condition = 1 + Condition_CONDITION_SUNNY Condition = 2 + Condition_CONDITION_CLOUDY Condition = 3 +) + +// Enum value maps for Condition. +var ( + Condition_name = map[int32]string{ + 0: "CONDITION_UNKNOWN", + 1: "CONDITION_RAINY", + 2: "CONDITION_SUNNY", + 3: "CONDITION_CLOUDY", + } + Condition_value = map[string]int32{ + "CONDITION_UNKNOWN": 0, + "CONDITION_RAINY": 1, + "CONDITION_SUNNY": 2, + "CONDITION_CLOUDY": 3, + } +) + +func (x Condition) Enum() *Condition { + p := new(Condition) + *p = x + return p +} + +func (x Condition) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Condition) Descriptor() protoreflect.EnumDescriptor { + return file_acme_weather_v1_weather_proto_enumTypes[0].Descriptor() +} + +func (Condition) Type() protoreflect.EnumType { + return &file_acme_weather_v1_weather_proto_enumTypes[0] +} + +func (x Condition) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Condition.Descriptor instead. +func (Condition) EnumDescriptor() ([]byte, []int) { + return file_acme_weather_v1_weather_proto_rawDescGZIP(), []int{0} +} + +type Location struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Latitude float32 `protobuf:"fixed32,1,opt,name=latitude,proto3" json:"latitude,omitempty"` + Longitude float32 `protobuf:"fixed32,2,opt,name=longitude,proto3" json:"longitude,omitempty"` +} + +func (x *Location) Reset() { + *x = Location{} + mi := &file_acme_weather_v1_weather_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Location) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Location) ProtoMessage() {} + +func (x *Location) ProtoReflect() protoreflect.Message { + mi := &file_acme_weather_v1_weather_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Location.ProtoReflect.Descriptor instead. +func (*Location) Descriptor() ([]byte, []int) { + return file_acme_weather_v1_weather_proto_rawDescGZIP(), []int{0} +} + +func (x *Location) GetLatitude() float32 { + if x != nil { + return x.Latitude + } + return 0 +} + +func (x *Location) GetLongitude() float32 { + if x != nil { + return x.Longitude + } + return 0 +} + +type Weather struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Location *Location `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"` + Temperature float32 `protobuf:"fixed32,2,opt,name=temperature,proto3" json:"temperature,omitempty"` + WindSpeed float32 `protobuf:"fixed32,3,opt,name=wind_speed,json=windSpeed,proto3" json:"wind_speed,omitempty"` + Condition Condition `protobuf:"varint,4,opt,name=condition,proto3,enum=acme.weather.v1.Condition" json:"condition,omitempty"` +} + +func (x *Weather) Reset() { + *x = Weather{} + mi := &file_acme_weather_v1_weather_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Weather) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Weather) ProtoMessage() {} + +func (x *Weather) ProtoReflect() protoreflect.Message { + mi := &file_acme_weather_v1_weather_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Weather.ProtoReflect.Descriptor instead. +func (*Weather) Descriptor() ([]byte, []int) { + return file_acme_weather_v1_weather_proto_rawDescGZIP(), []int{1} +} + +func (x *Weather) GetLocation() *Location { + if x != nil { + return x.Location + } + return nil +} + +func (x *Weather) GetTemperature() float32 { + if x != nil { + return x.Temperature + } + return 0 +} + +func (x *Weather) GetWindSpeed() float32 { + if x != nil { + return x.WindSpeed + } + return 0 +} + +func (x *Weather) GetCondition() Condition { + if x != nil { + return x.Condition + } + return Condition_CONDITION_UNKNOWN +} + +var File_acme_weather_v1_weather_proto protoreflect.FileDescriptor + +var file_acme_weather_v1_weather_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x61, 0x63, 0x6d, 0x65, 0x2f, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2f, 0x76, + 0x31, 0x2f, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x0f, 0x61, 0x63, 0x6d, 0x65, 0x2e, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x31, + 0x22, 0x44, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, + 0x6c, 0x61, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, + 0x6c, 0x61, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, + 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x6c, 0x6f, 0x6e, + 0x67, 0x69, 0x74, 0x75, 0x64, 0x65, 0x22, 0xbb, 0x01, 0x0a, 0x07, 0x57, 0x65, 0x61, 0x74, 0x68, + 0x65, 0x72, 0x12, 0x35, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x63, 0x6d, 0x65, 0x2e, 0x77, 0x65, 0x61, 0x74, + 0x68, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x65, 0x6d, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, + 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x77, + 0x69, 0x6e, 0x64, 0x5f, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, + 0x09, 0x77, 0x69, 0x6e, 0x64, 0x53, 0x70, 0x65, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x63, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, + 0x61, 0x63, 0x6d, 0x65, 0x2e, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x62, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x4f, 0x4e, 0x44, + 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x41, 0x49, 0x4e, 0x59, 0x10, 0x01, 0x12, 0x13, 0x0a, + 0x0f, 0x43, 0x4f, 0x4e, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x55, 0x4e, 0x4e, 0x59, + 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x4f, 0x4e, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x43, 0x4c, 0x4f, 0x55, 0x44, 0x59, 0x10, 0x03, 0x42, 0xb6, 0x01, 0x0a, 0x12, 0x69, 0x6f, 0x2e, + 0x61, 0x63, 0x6d, 0x65, 0x2e, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x42, + 0x0c, 0x57, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x48, 0x02, 0x5a, + 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x63, 0x6d, 0x65, + 0x2f, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x6d, 0x65, + 0x2f, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x77, 0x65, 0x61, 0x74, + 0x68, 0x65, 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x57, 0x58, 0xaa, 0x02, 0x0f, 0x41, 0x63, + 0x6d, 0x65, 0x2e, 0x57, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, + 0x41, 0x63, 0x6d, 0x65, 0x5c, 0x57, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x1b, 0x41, 0x63, 0x6d, 0x65, 0x5c, 0x57, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, + 0x41, 0x63, 0x6d, 0x65, 0x3a, 0x3a, 0x57, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_acme_weather_v1_weather_proto_rawDescOnce sync.Once + file_acme_weather_v1_weather_proto_rawDescData = file_acme_weather_v1_weather_proto_rawDesc +) + +func file_acme_weather_v1_weather_proto_rawDescGZIP() []byte { + file_acme_weather_v1_weather_proto_rawDescOnce.Do(func() { + file_acme_weather_v1_weather_proto_rawDescData = protoimpl.X.CompressGZIP(file_acme_weather_v1_weather_proto_rawDescData) + }) + return file_acme_weather_v1_weather_proto_rawDescData +} + +var file_acme_weather_v1_weather_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_acme_weather_v1_weather_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_acme_weather_v1_weather_proto_goTypes = []any{ + (Condition)(0), // 0: acme.weather.v1.Condition + (*Location)(nil), // 1: acme.weather.v1.Location + (*Weather)(nil), // 2: acme.weather.v1.Weather +} +var file_acme_weather_v1_weather_proto_depIdxs = []int32{ + 1, // 0: acme.weather.v1.Weather.location:type_name -> acme.weather.v1.Location + 0, // 1: acme.weather.v1.Weather.condition:type_name -> acme.weather.v1.Condition + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_acme_weather_v1_weather_proto_init() } +func file_acme_weather_v1_weather_proto_init() { + if File_acme_weather_v1_weather_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_acme_weather_v1_weather_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_acme_weather_v1_weather_proto_goTypes, + DependencyIndexes: file_acme_weather_v1_weather_proto_depIdxs, + EnumInfos: file_acme_weather_v1_weather_proto_enumTypes, + MessageInfos: file_acme_weather_v1_weather_proto_msgTypes, + }.Build() + File_acme_weather_v1_weather_proto = out.File + file_acme_weather_v1_weather_proto_rawDesc = nil + file_acme_weather_v1_weather_proto_goTypes = nil + file_acme_weather_v1_weather_proto_depIdxs = nil +} diff --git a/managed-mode/gen/proto/java/io/acme/weather/v1/WeatherProto.java b/managed-mode/gen/proto/java/io/acme/weather/v1/WeatherProto.java index fd62973..8ea7db7 100644 --- a/managed-mode/gen/proto/java/io/acme/weather/v1/WeatherProto.java +++ b/managed-mode/gen/proto/java/io/acme/weather/v1/WeatherProto.java @@ -1,10 +1,21 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: acme/weather/v1/weather.proto +// Protobuf Java Version: 4.28.2 package io.acme.weather.v1; public final class WeatherProto { private WeatherProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 2, + /* suffix= */ "", + WeatherProto.class.getName()); + } public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } @@ -38,6 +49,15 @@ public enum Condition UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 2, + /* suffix= */ "", + Condition.class.getName()); + } /** * CONDITION_UNKNOWN = 0; */ @@ -160,36 +180,33 @@ public interface LocationOrBuilder extends * Protobuf type {@code acme.weather.v1.Location} */ public static final class Location extends - com.google.protobuf.GeneratedMessageV3 implements + com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:acme.weather.v1.Location) LocationOrBuilder { private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 2, + /* suffix= */ "", + Location.class.getName()); + } // Use Location.newBuilder() to construct. - private Location(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Location(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Location() { } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Location(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.acme.weather.v1.WeatherProto.internal_static_acme_weather_v1_Location_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return io.acme.weather.v1.WeatherProto.internal_static_acme_weather_v1_Location_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -197,7 +214,7 @@ protected java.lang.Object newInstance( } public static final int LATITUDE_FIELD_NUMBER = 1; - private float latitude_; + private float latitude_ = 0F; /** * float latitude = 1 [json_name = "latitude"]; * @return The latitude. @@ -208,7 +225,7 @@ public float getLatitude() { } public static final int LONGITUDE_FIELD_NUMBER = 2; - private float longitude_; + private float longitude_ = 0F; /** * float longitude = 2 [json_name = "longitude"]; * @return The longitude. @@ -252,39 +269,41 @@ public static io.acme.weather.v1.WeatherProto.Location parseFrom( } public static io.acme.weather.v1.WeatherProto.Location parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 + return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } public static io.acme.weather.v1.WeatherProto.Location parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 + return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input, extensionRegistry); } + public static io.acme.weather.v1.WeatherProto.Location parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 + return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } + public static io.acme.weather.v1.WeatherProto.Location parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 + return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static io.acme.weather.v1.WeatherProto.Location parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 + return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } public static io.acme.weather.v1.WeatherProto.Location parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 + return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input, extensionRegistry); } @@ -304,7 +323,7 @@ public Builder toBuilder() { @java.lang.Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } @@ -312,7 +331,7 @@ protected Builder newBuilderForType( * Protobuf type {@code acme.weather.v1.Location} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements + com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:acme.weather.v1.Location) io.acme.weather.v1.WeatherProto.LocationOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -321,7 +340,7 @@ public static final class Builder extends } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return io.acme.weather.v1.WeatherProto.internal_static_acme_weather_v1_Location_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -334,17 +353,16 @@ private Builder() { } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; latitude_ = 0F; - longitude_ = 0F; - return this; } @@ -371,45 +389,23 @@ public io.acme.weather.v1.WeatherProto.Location build() { @java.lang.Override public io.acme.weather.v1.WeatherProto.Location buildPartial() { io.acme.weather.v1.WeatherProto.Location result = new io.acme.weather.v1.WeatherProto.Location(this); - result.latitude_ = latitude_; - result.longitude_ = longitude_; + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(io.acme.weather.v1.WeatherProto.Location result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.latitude_ = latitude_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.longitude_ = longitude_; + } } + private int bitField0_; + private float latitude_ ; /** * float latitude = 1 [json_name = "latitude"]; @@ -425,8 +421,9 @@ public float getLatitude() { * @return This builder for chaining. */ public Builder setLatitude(float value) { - + latitude_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -435,7 +432,7 @@ public Builder setLatitude(float value) { * @return This builder for chaining. */ public Builder clearLatitude() { - + bitField0_ = (bitField0_ & ~0x00000001); latitude_ = 0F; onChanged(); return this; @@ -456,8 +453,9 @@ public float getLongitude() { * @return This builder for chaining. */ public Builder setLongitude(float value) { - + longitude_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -466,23 +464,11 @@ public Builder setLongitude(float value) { * @return This builder for chaining. */ public Builder clearLongitude() { - + bitField0_ = (bitField0_ & ~0x00000002); longitude_ = 0F; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:acme.weather.v1.Location) } @@ -581,43 +567,41 @@ public interface WeatherOrBuilder extends * Protobuf type {@code acme.weather.v1.Weather} */ public static final class Weather extends - com.google.protobuf.GeneratedMessageV3 implements + com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:acme.weather.v1.Weather) WeatherOrBuilder { private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 2, + /* suffix= */ "", + Weather.class.getName()); + } // Use Weather.newBuilder() to construct. - private Weather(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Weather(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Weather() { condition_ = 0; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Weather(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.acme.weather.v1.WeatherProto.internal_static_acme_weather_v1_Weather_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return io.acme.weather.v1.WeatherProto.internal_static_acme_weather_v1_Weather_fieldAccessorTable .ensureFieldAccessorsInitialized( io.acme.weather.v1.WeatherProto.Weather.class, io.acme.weather.v1.WeatherProto.Weather.Builder.class); } + private int bitField0_; public static final int LOCATION_FIELD_NUMBER = 1; private io.acme.weather.v1.WeatherProto.Location location_; /** @@ -626,7 +610,7 @@ protected java.lang.Object newInstance( */ @java.lang.Override public boolean hasLocation() { - return location_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * .acme.weather.v1.Location location = 1 [json_name = "location"]; @@ -641,11 +625,11 @@ public io.acme.weather.v1.WeatherProto.Location getLocation() { */ @java.lang.Override public io.acme.weather.v1.WeatherProto.LocationOrBuilder getLocationOrBuilder() { - return getLocation(); + return location_ == null ? io.acme.weather.v1.WeatherProto.Location.getDefaultInstance() : location_; } public static final int TEMPERATURE_FIELD_NUMBER = 2; - private float temperature_; + private float temperature_ = 0F; /** * float temperature = 2 [json_name = "temperature"]; * @return The temperature. @@ -656,7 +640,7 @@ public float getTemperature() { } public static final int WIND_SPEED_FIELD_NUMBER = 3; - private float windSpeed_; + private float windSpeed_ = 0F; /** * float wind_speed = 3 [json_name = "windSpeed"]; * @return The windSpeed. @@ -667,7 +651,7 @@ public float getWindSpeed() { } public static final int CONDITION_FIELD_NUMBER = 4; - private int condition_; + private int condition_ = 0; /** * .acme.weather.v1.Condition condition = 4 [json_name = "condition"]; * @return The enum numeric value on the wire for condition. @@ -680,8 +664,7 @@ public float getWindSpeed() { * @return The condition. */ @java.lang.Override public io.acme.weather.v1.WeatherProto.Condition getCondition() { - @SuppressWarnings("deprecation") - io.acme.weather.v1.WeatherProto.Condition result = io.acme.weather.v1.WeatherProto.Condition.valueOf(condition_); + io.acme.weather.v1.WeatherProto.Condition result = io.acme.weather.v1.WeatherProto.Condition.forNumber(condition_); return result == null ? io.acme.weather.v1.WeatherProto.Condition.UNRECOGNIZED : result; } @@ -719,39 +702,41 @@ public static io.acme.weather.v1.WeatherProto.Weather parseFrom( } public static io.acme.weather.v1.WeatherProto.Weather parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 + return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } public static io.acme.weather.v1.WeatherProto.Weather parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 + return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input, extensionRegistry); } + public static io.acme.weather.v1.WeatherProto.Weather parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 + return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input); } + public static io.acme.weather.v1.WeatherProto.Weather parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 + return com.google.protobuf.GeneratedMessage .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static io.acme.weather.v1.WeatherProto.Weather parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 + return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input); } public static io.acme.weather.v1.WeatherProto.Weather parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 + return com.google.protobuf.GeneratedMessage .parseWithIOException(PARSER, input, extensionRegistry); } @@ -771,7 +756,7 @@ public Builder toBuilder() { @java.lang.Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } @@ -779,7 +764,7 @@ protected Builder newBuilderForType( * Protobuf type {@code acme.weather.v1.Weather} */ public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements + com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:acme.weather.v1.Weather) io.acme.weather.v1.WeatherProto.WeatherOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor @@ -788,7 +773,7 @@ public static final class Builder extends } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return io.acme.weather.v1.WeatherProto.internal_static_acme_weather_v1_Weather_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -797,29 +782,32 @@ public static final class Builder extends // Construct using io.acme.weather.v1.WeatherProto.Weather.newBuilder() private Builder() { - + maybeForceBuilderInitialization(); } private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getLocationFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (locationBuilder_ == null) { - location_ = null; - } else { - location_ = null; + bitField0_ = 0; + location_ = null; + if (locationBuilder_ != null) { + locationBuilder_.dispose(); locationBuilder_ = null; } temperature_ = 0F; - windSpeed_ = 0F; - condition_ = 0; - return this; } @@ -846,60 +834,43 @@ public io.acme.weather.v1.WeatherProto.Weather build() { @java.lang.Override public io.acme.weather.v1.WeatherProto.Weather buildPartial() { io.acme.weather.v1.WeatherProto.Weather result = new io.acme.weather.v1.WeatherProto.Weather(this); - if (locationBuilder_ == null) { - result.location_ = location_; - } else { - result.location_ = locationBuilder_.build(); - } - result.temperature_ = temperature_; - result.windSpeed_ = windSpeed_; - result.condition_ = condition_; + if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(io.acme.weather.v1.WeatherProto.Weather result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.location_ = locationBuilder_ == null + ? location_ + : locationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.temperature_ = temperature_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.windSpeed_ = windSpeed_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.condition_ = condition_; + } + result.bitField0_ |= to_bitField0_; } + private int bitField0_; + private io.acme.weather.v1.WeatherProto.Location location_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< io.acme.weather.v1.WeatherProto.Location, io.acme.weather.v1.WeatherProto.Location.Builder, io.acme.weather.v1.WeatherProto.LocationOrBuilder> locationBuilder_; /** * .acme.weather.v1.Location location = 1 [json_name = "location"]; * @return Whether the location field is set. */ public boolean hasLocation() { - return locationBuilder_ != null || location_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * .acme.weather.v1.Location location = 1 [json_name = "location"]; @@ -921,11 +892,11 @@ public Builder setLocation(io.acme.weather.v1.WeatherProto.Location value) { throw new NullPointerException(); } location_ = value; - onChanged(); } else { locationBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } /** @@ -935,11 +906,11 @@ public Builder setLocation( io.acme.weather.v1.WeatherProto.Location.Builder builderForValue) { if (locationBuilder_ == null) { location_ = builderForValue.build(); - onChanged(); } else { locationBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } /** @@ -947,38 +918,40 @@ public Builder setLocation( */ public Builder mergeLocation(io.acme.weather.v1.WeatherProto.Location value) { if (locationBuilder_ == null) { - if (location_ != null) { - location_ = - io.acme.weather.v1.WeatherProto.Location.newBuilder(location_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000001) != 0) && + location_ != null && + location_ != io.acme.weather.v1.WeatherProto.Location.getDefaultInstance()) { + getLocationBuilder().mergeFrom(value); } else { location_ = value; } - onChanged(); } else { locationBuilder_.mergeFrom(value); } - + if (location_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } /** * .acme.weather.v1.Location location = 1 [json_name = "location"]; */ public Builder clearLocation() { - if (locationBuilder_ == null) { - location_ = null; - onChanged(); - } else { - location_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + location_ = null; + if (locationBuilder_ != null) { + locationBuilder_.dispose(); locationBuilder_ = null; } - + onChanged(); return this; } /** * .acme.weather.v1.Location location = 1 [json_name = "location"]; */ public io.acme.weather.v1.WeatherProto.Location.Builder getLocationBuilder() { - + bitField0_ |= 0x00000001; onChanged(); return getLocationFieldBuilder().getBuilder(); } @@ -996,11 +969,11 @@ public io.acme.weather.v1.WeatherProto.LocationOrBuilder getLocationOrBuilder() /** * .acme.weather.v1.Location location = 1 [json_name = "location"]; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< io.acme.weather.v1.WeatherProto.Location, io.acme.weather.v1.WeatherProto.Location.Builder, io.acme.weather.v1.WeatherProto.LocationOrBuilder> getLocationFieldBuilder() { if (locationBuilder_ == null) { - locationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + locationBuilder_ = new com.google.protobuf.SingleFieldBuilder< io.acme.weather.v1.WeatherProto.Location, io.acme.weather.v1.WeatherProto.Location.Builder, io.acme.weather.v1.WeatherProto.LocationOrBuilder>( getLocation(), getParentForChildren(), @@ -1025,8 +998,9 @@ public float getTemperature() { * @return This builder for chaining. */ public Builder setTemperature(float value) { - + temperature_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1035,7 +1009,7 @@ public Builder setTemperature(float value) { * @return This builder for chaining. */ public Builder clearTemperature() { - + bitField0_ = (bitField0_ & ~0x00000002); temperature_ = 0F; onChanged(); return this; @@ -1056,8 +1030,9 @@ public float getWindSpeed() { * @return This builder for chaining. */ public Builder setWindSpeed(float value) { - + windSpeed_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1066,7 +1041,7 @@ public Builder setWindSpeed(float value) { * @return This builder for chaining. */ public Builder clearWindSpeed() { - + bitField0_ = (bitField0_ & ~0x00000004); windSpeed_ = 0F; onChanged(); return this; @@ -1086,8 +1061,8 @@ public Builder clearWindSpeed() { * @return This builder for chaining. */ public Builder setConditionValue(int value) { - condition_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1097,8 +1072,7 @@ public Builder setConditionValue(int value) { */ @java.lang.Override public io.acme.weather.v1.WeatherProto.Condition getCondition() { - @SuppressWarnings("deprecation") - io.acme.weather.v1.WeatherProto.Condition result = io.acme.weather.v1.WeatherProto.Condition.valueOf(condition_); + io.acme.weather.v1.WeatherProto.Condition result = io.acme.weather.v1.WeatherProto.Condition.forNumber(condition_); return result == null ? io.acme.weather.v1.WeatherProto.Condition.UNRECOGNIZED : result; } /** @@ -1110,7 +1084,7 @@ public Builder setCondition(io.acme.weather.v1.WeatherProto.Condition value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000008; condition_ = value.getNumber(); onChanged(); return this; @@ -1120,23 +1094,11 @@ public Builder setCondition(io.acme.weather.v1.WeatherProto.Condition value) { * @return This builder for chaining. */ public Builder clearCondition() { - + bitField0_ = (bitField0_ & ~0x00000008); condition_ = 0; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:acme.weather.v1.Weather) } @@ -1192,12 +1154,12 @@ public io.acme.weather.v1.WeatherProto.Weather getDefaultInstanceForType() { private static final com.google.protobuf.Descriptors.Descriptor internal_static_acme_weather_v1_Location_descriptor; private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_acme_weather_v1_Location_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_acme_weather_v1_Weather_descriptor; private static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_acme_weather_v1_Weather_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor @@ -1232,15 +1194,16 @@ public io.acme.weather.v1.WeatherProto.Weather getDefaultInstanceForType() { internal_static_acme_weather_v1_Location_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_acme_weather_v1_Location_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_acme_weather_v1_Location_descriptor, new java.lang.String[] { "Latitude", "Longitude", }); internal_static_acme_weather_v1_Weather_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_acme_weather_v1_Weather_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_acme_weather_v1_Weather_descriptor, new java.lang.String[] { "Location", "Temperature", "WindSpeed", "Condition", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/managed-mode/gen/proto/objc/acme/weather/v1/Weather.pbobjc.h b/managed-mode/gen/proto/objc/acme/weather/v1/Weather.pbobjc.h index 09b4f93..394b31c 100644 --- a/managed-mode/gen/proto/objc/acme/weather/v1/Weather.pbobjc.h +++ b/managed-mode/gen/proto/objc/acme/weather/v1/Weather.pbobjc.h @@ -1,4 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// clang-format off // source: acme/weather/v1/weather.proto // This CPP symbol can be defined to use imports that match up to the framework @@ -13,10 +15,10 @@ #import "GPBProtocolBuffers.h" #endif -#if GOOGLE_PROTOBUF_OBJC_VERSION < 30004 +#if GOOGLE_PROTOBUF_OBJC_VERSION < 30007 #error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. #endif -#if 30004 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION +#if 30007 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION #error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. #endif @@ -126,3 +128,5 @@ CF_EXTERN_C_END #pragma clang diagnostic pop // @@protoc_insertion_point(global_scope) + +// clang-format on diff --git a/managed-mode/gen/proto/objc/acme/weather/v1/Weather.pbobjc.m b/managed-mode/gen/proto/objc/acme/weather/v1/Weather.pbobjc.m index f728611..2a07810 100644 --- a/managed-mode/gen/proto/objc/acme/weather/v1/Weather.pbobjc.m +++ b/managed-mode/gen/proto/objc/acme/weather/v1/Weather.pbobjc.m @@ -1,4 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// clang-format off // source: acme/weather/v1/weather.proto // This CPP symbol can be defined to use imports that match up to the framework @@ -13,6 +15,13 @@ #import "GPBProtocolBuffers_RuntimeSupport.h" #endif +#if GOOGLE_PROTOBUF_OBJC_VERSION < 30007 +#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. +#endif +#if 30007 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION +#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. +#endif + #import #import "acme/weather/v1/Weather.pbobjc.h" @@ -22,41 +31,34 @@ #pragma clang diagnostic ignored "-Wdeprecated-declarations" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" -#pragma mark - Objective C Class declarations -// Forward declarations of Objective C classes that we can use as +#pragma mark - Objective-C Class declarations +// Forward declarations of Objective-C classes that we can use as // static values in struct initializers. // We don't use [Foo class] because it is not a static value. GPBObjCClassDeclaration(AWXLocation); +GPBObjCClassDeclaration(AWXWeather); #pragma mark - AWXWeatherRoot @implementation AWXWeatherRoot -// No extensions in the file and no imports, so no need to generate -// +extensionRegistry. +// No extensions in the file and no imports or none of the imports (direct or +// indirect) defined extensions, so no need to generate +extensionRegistry. @end -#pragma mark - AWXWeatherRoot_FileDescriptor - -static GPBFileDescriptor *AWXWeatherRoot_FileDescriptor(void) { - // This is called by +initialize so there is no need to worry - // about thread safety of the singleton. - static GPBFileDescriptor *descriptor = NULL; - if (!descriptor) { - GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); - descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"acme.weather.v1" - objcPrefix:@"AWX" - syntax:GPBFileSyntaxProto3]; - } - return descriptor; -} +static GPBFileDescription AWXWeatherRoot_FileDescription = { + .package = "acme.weather.v1", + .prefix = "AWX", + .syntax = GPBFileSyntaxProto3 +}; #pragma mark - Enum AWXCondition GPBEnumDescriptor *AWXCondition_EnumDescriptor(void) { static _Atomic(GPBEnumDescriptor*) descriptor = nil; if (!descriptor) { + GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); static const char *valueNames = "ConditionUnknown\000ConditionRainy\000Conditio" "nSunny\000ConditionCloudy\000"; @@ -71,7 +73,8 @@ @implementation AWXWeatherRoot valueNames:valueNames values:values count:(uint32_t)(sizeof(values) / sizeof(int32_t)) - enumVerifier:AWXCondition_IsValidValue]; + enumVerifier:AWXCondition_IsValidValue + flags:GPBEnumDescriptorInitializationFlag_None]; GPBEnumDescriptor *expected = nil; if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { [worker release]; @@ -110,6 +113,7 @@ @implementation AWXLocation + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { + GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); static GPBMessageFieldDescription fields[] = { { .name = "latitude", @@ -131,13 +135,13 @@ + (GPBDescriptor *)descriptor { }, }; GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[AWXLocation class] - rootClass:[AWXWeatherRoot class] - file:AWXWeatherRoot_FileDescriptor() + [GPBDescriptor allocDescriptorForClass:GPBObjCClass(AWXLocation) + messageName:@"Location" + fileDescription:&AWXWeatherRoot_FileDescription fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(AWXLocation__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG @@ -170,6 +174,7 @@ @implementation AWXWeather + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { + GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); static GPBMessageFieldDescription fields[] = { { .name = "location", @@ -209,13 +214,13 @@ + (GPBDescriptor *)descriptor { }, }; GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[AWXWeather class] - rootClass:[AWXWeatherRoot class] - file:AWXWeatherRoot_FileDescriptor() + [GPBDescriptor allocDescriptorForClass:GPBObjCClass(AWXWeather) + messageName:@"Weather" + fileDescription:&AWXWeatherRoot_FileDescription fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) storageSize:sizeof(AWXWeather__storage_) - flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); #endif // DEBUG @@ -242,3 +247,5 @@ void SetAWXWeather_Condition_RawValue(AWXWeather *message, int32_t value) { #pragma clang diagnostic pop // @@protoc_insertion_point(global_scope) + +// clang-format on diff --git a/managed-mode/gen/proto/php/Acme/Weather/V1/Condition.php b/managed-mode/gen/proto/php/Acme/Weather/V1/Condition.php index 122a9fe..64f1c93 100644 --- a/managed-mode/gen/proto/php/Acme/Weather/V1/Condition.php +++ b/managed-mode/gen/proto/php/Acme/Weather/V1/Condition.php @@ -1,5 +1,6 @@ :proto3) do - add_message "acme.weather.v1.Location" do - optional :latitude, :float, 1, json_name: "latitude" - optional :longitude, :float, 2, json_name: "longitude" - end - add_message "acme.weather.v1.Weather" do - optional :location, :message, 1, "acme.weather.v1.Location", json_name: "location" - optional :temperature, :float, 2, json_name: "temperature" - optional :wind_speed, :float, 3, json_name: "windSpeed" - optional :condition, :enum, 4, "acme.weather.v1.Condition", json_name: "condition" - end - add_enum "acme.weather.v1.Condition" do - value :CONDITION_UNKNOWN, 0 - value :CONDITION_RAINY, 1 - value :CONDITION_SUNNY, 2 - value :CONDITION_CLOUDY, 3 - end - end -end + +descriptor_data = "\n\x1d\x61\x63me/weather/v1/weather.proto\x12\x0f\x61\x63me.weather.v1\"D\n\x08Location\x12\x1a\n\x08latitude\x18\x01 \x01(\x02R\x08latitude\x12\x1c\n\tlongitude\x18\x02 \x01(\x02R\tlongitude\"\xbb\x01\n\x07Weather\x12\x35\n\x08location\x18\x01 \x01(\x0b\x32\x19.acme.weather.v1.LocationR\x08location\x12 \n\x0btemperature\x18\x02 \x01(\x02R\x0btemperature\x12\x1d\n\nwind_speed\x18\x03 \x01(\x02R\twindSpeed\x12\x38\n\tcondition\x18\x04 \x01(\x0e\x32\x1a.acme.weather.v1.ConditionR\tcondition*b\n\tCondition\x12\x15\n\x11\x43ONDITION_UNKNOWN\x10\x00\x12\x13\n\x0f\x43ONDITION_RAINY\x10\x01\x12\x13\n\x0f\x43ONDITION_SUNNY\x10\x02\x12\x14\n\x10\x43ONDITION_CLOUDY\x10\x03\x42\xb6\x01\n\x12io.acme.weather.v1B\x0cWeatherProtoH\x02Z4github.com/acme/weather/v1/acme/weather/v1;weatherv1\xa2\x02\x03\x41WX\xaa\x02\x0f\x41\x63me.Weather.V1\xca\x02\x0f\x41\x63me\\Weather\\V1\xe2\x02\x1b\x41\x63me\\Weather\\V1\\GPBMetadata\xea\x02\x11\x41\x63me::Weather::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) module Acme module Weather diff --git a/plugin-execution-local/README.md b/plugin-execution-local/README.md index 4d86e32..7d4693c 100644 --- a/plugin-execution-local/README.md +++ b/plugin-execution-local/README.md @@ -1,6 +1,9 @@ # Local plugin execution +> [!NOTE] > You need to have the [`buf` CLI][install] installed to follow along with this example. +> You will also need to have [`protoc-gen-go`][protoc-gen-go] and [`protoc-gen-rust`][protoc-gen-rust] +> installed locally. This directory provides an example of generating code stubs from a [Buf input][input] using Protobuf plugins. Here, we'll use two locally installed plugins: diff --git a/plugin-execution-local/buf.gen.yaml b/plugin-execution-local/buf.gen.yaml index f74eacb..6fa133d 100644 --- a/plugin-execution-local/buf.gen.yaml +++ b/plugin-execution-local/buf.gen.yaml @@ -1,12 +1,11 @@ -version: v1 +version: v2 managed: enabled: true - - # Go - go_package_prefix: - default: github.com/buf-examples/observabilityapi + override: + - file_option: go_package_prefix + value: github.com/buf-examples/observabilityapi plugins: - - plugin: go # Invokes the protoc-gen-go executable + - local: protoc-gen-go out: gen/proto/go - - plugin: rust # Invokes the protoc-gen-rust executable + - protoc_builtin: rust out: gen/proto/rust diff --git a/plugin-execution-remote/README.md b/plugin-execution-remote/README.md index a87bbce..97cafef 100644 --- a/plugin-execution-remote/README.md +++ b/plugin-execution-remote/README.md @@ -1,5 +1,6 @@ # Remote plugin execution +> [!NOTE] > You need to have the [`buf` CLI][install] installed to follow along with this example. This directory provides an example of generating code stubs from a [Buf input][input] using Protobuf plugins. Here, we'll use two remote plugins hosted on the [Buf Schema Registry][bsr]: diff --git a/plugin-execution-remote/buf.gen.yaml b/plugin-execution-remote/buf.gen.yaml index fe411c7..313748f 100644 --- a/plugin-execution-remote/buf.gen.yaml +++ b/plugin-execution-remote/buf.gen.yaml @@ -1,16 +1,15 @@ -version: v1 +version: v2 managed: enabled: true - - # Go - go_package_prefix: - default: github.com/buf-examples/observabilityapi - - # Java - java_multiple_files: false - java_string_check_utf8: false + override: + - file_option: java_multiple_files + value: false + - file_option: java_string_check_utf8 + value: false + - file_option: go_package_prefix + value: github.com/buf-examples/observabilityapi plugins: - - plugin: buf.build/protocolbuffers/go:v1.28.1 + - remote: buf.build/protocolbuffers/go:v1.28.1 out: gen/proto/go - - plugin: buf.build/protocolbuffers/java:v21.9 + - remote: buf.build/protocolbuffers/java:v21.9 out: gen/proto/java diff --git a/workspace/README.md b/workspace/README.md index 34d5f13..e03254a 100644 --- a/workspace/README.md +++ b/workspace/README.md @@ -1,8 +1,10 @@ # Buf workspace example +> [!NOTE] > You need to have the [`buf` CLI][install] installed to follow along with this example. -This directory provides an example of a Buf [workspace] that contains multiple Buf [modules] that are meant to be consumed as dependencies by other Protobuf projects. There are two modules in this workspace: +This directory provides an example of a Buf [workspace][modules-and-workspaces] that contains multiple Buf [modules][modules-and-workspaces] that are meant to be consumed as dependencies by other Protobuf projects. +There are two modules in this workspace: * [`observabilityapi`](./observabilityapi) defines an observability-related service. * [`observabilitytypes`](./observabilitytypes) defines many of the types used by the service in the `observabilityapi` module. @@ -19,16 +21,14 @@ The basic structure of this workspace: ``` . ├── buf.gen.yaml -├── buf.work.yaml +├── buf.yaml ├── observabilityapi │   ├── api │   │   ├── v1 │   │   │   └── api.proto │   │   └── v2 │   │   └── api.proto -│   └── buf.yaml └── observabilitytypes - ├── buf.yaml ├── log │   ├── v1 │   │   └── log.proto @@ -41,7 +41,7 @@ The basic structure of this workspace: └── metric.proto ``` -The [workspace configuration][buf-work-yaml] is defined in [`buf.work.yaml`](./buf.work.yaml). +The workspace configuration is defined in [`buf.yaml`](./buf.yaml). ## Linting @@ -100,9 +100,7 @@ buf generate observabilitytypes [bsr]: https://docs.buf.build/bsr [bsr-api]: https://buf.build/buf-examples/observabilityapi [bsr-types]: https://buf.build/buf-examples/observabilitytypes -[buf-work-yaml]: https://docs.buf.build/configuration/v1/buf-work-yaml [generate]: https://docs.buf.build/generate [install]: https://docs.buf.build/installation [lint]: https://docs.buf.build/lint -[modules]: https://docs.buf.build/bsr/overview#module -[workspace]: https://docs.buf.build/reference/workspaces +[modules-and-workspaces]: https://buf.build/docs/concepts/modules-workspaces diff --git a/workspace/buf.gen.yaml b/workspace/buf.gen.yaml index 60feb36..7af302f 100644 --- a/workspace/buf.gen.yaml +++ b/workspace/buf.gen.yaml @@ -1,12 +1,13 @@ -version: v1 +version: v2 managed: enabled: true - go_package_prefix: - default: github.com/bufbuild/buf-examples/workspace/gen/proto/go + override: + - file_option: go_package_prefix + value: github.com/bufbuild/buf-examples/workspace/gen/proto/go plugins: - - plugin: buf.build/protocolbuffers/go:v1.28.1 - opt: paths=source_relative + - remote: buf.build/protocolbuffers/go:v1.28.1 out: gen/proto/go - - plugin: buf.build/bufbuild/connect-go:v1.7.0 opt: paths=source_relative + - remote: buf.build/bufbuild/connect-go:v1.7.0 out: gen/proto/go + opt: paths=source_relative diff --git a/workspace/observabilitytypes/buf.lock b/workspace/buf.lock similarity index 73% rename from workspace/observabilitytypes/buf.lock rename to workspace/buf.lock index c91b581..4f98143 100644 --- a/workspace/observabilitytypes/buf.lock +++ b/workspace/buf.lock @@ -1,2 +1,2 @@ # Generated by buf. DO NOT EDIT. -version: v1 +version: v2 diff --git a/workspace/buf.work.yaml b/workspace/buf.work.yaml deleted file mode 100644 index 4a0b027..0000000 --- a/workspace/buf.work.yaml +++ /dev/null @@ -1,4 +0,0 @@ -version: v1 -directories: - - observabilityapi - - observabilitytypes diff --git a/workspace/buf.yaml b/workspace/buf.yaml new file mode 100644 index 0000000..ebf9407 --- /dev/null +++ b/workspace/buf.yaml @@ -0,0 +1,34 @@ +version: v2 +modules: + - path: observabilityapi + name: buf.build/buf-examples/observabilityapi + lint: + use: + - DEFAULT + except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE + rpc_allow_google_protobuf_empty_responses: true + disallow_comment_ignores: true + breaking: + use: + - FILE + except: + - EXTENSION_NO_DELETE + - FIELD_SAME_DEFAULT + - path: observabilitytypes + name: buf.build/buf-examples/observabilitytypes + lint: + use: + - DEFAULT + except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE + enum_zero_value_suffix: _UNKNOWN + disallow_comment_ignores: true + breaking: + use: + - FILE + except: + - EXTENSION_NO_DELETE + - FIELD_SAME_DEFAULT diff --git a/workspace/observabilityapi/buf.lock b/workspace/observabilityapi/buf.lock deleted file mode 100644 index 08f52d8..0000000 --- a/workspace/observabilityapi/buf.lock +++ /dev/null @@ -1,7 +0,0 @@ -# Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: buf-examples - repository: observabilitytypes - commit: 2e068ce171164238955ba2774eec628f diff --git a/workspace/observabilityapi/buf.yaml b/workspace/observabilityapi/buf.yaml deleted file mode 100644 index 3f6bb3c..0000000 --- a/workspace/observabilityapi/buf.yaml +++ /dev/null @@ -1,11 +0,0 @@ -version: v1 -name: buf.build/buf-examples/observabilityapi -deps: - - buf.build/buf-examples/observabilitytypes -breaking: - use: - - FILE -lint: - use: - - DEFAULT - rpc_allow_google_protobuf_empty_responses: true diff --git a/workspace/observabilitytypes/buf.yaml b/workspace/observabilitytypes/buf.yaml deleted file mode 100644 index 2949a80..0000000 --- a/workspace/observabilitytypes/buf.yaml +++ /dev/null @@ -1,9 +0,0 @@ -version: v1 -name: buf.build/buf-examples/observabilitytypes -breaking: - use: - - FILE -lint: - use: - - DEFAULT - enum_zero_value_suffix: _UNKNOWN