diff --git a/CHANGELOG.md b/CHANGELOG.md index 61240ca5b9560..d0537e4709bbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ breaking changes in the upcoming 3.x release. This release is scheduled for ## v2.42.0 - TBD +### New Libraries + +We are happy to announce the following GA libraries. Unless specifically noted, +the APIs in these libraries are stable, and are ready for production use. + +- [Config Delivery API](/google/cloud/configdelivery/README.md) + ## v2.41.0 - 2025-08-14 ### [Bigtable](/google/cloud/bigtable/README.md) diff --git a/README.md b/README.md index 64f25099db52a..90e7bcb67d11c 100644 --- a/README.md +++ b/README.md @@ -185,6 +185,9 @@ See each library's `README.md` file for more information about: - [Infrastructure Manager API](google/cloud/config/README.md) [[quickstart]](google/cloud/config/quickstart/README.md) [[reference]](https://cloud.google.com/cpp/docs/reference/config/latest) +- [Config Delivery API](google/cloud/configdelivery/README.md) + [[quickstart]](google/cloud/configdelivery/quickstart/README.md) + [[reference]](https://cloud.google.com/cpp/docs/reference/configdelivery/latest) - [Connectors API](google/cloud/connectors/README.md) [[quickstart]](google/cloud/connectors/quickstart/README.md) [[reference]](https://cloud.google.com/cpp/docs/reference/connectors/latest) diff --git a/ci/abi-dumps/google_cloud_cpp_configdelivery.expected.abi.dump.gz b/ci/abi-dumps/google_cloud_cpp_configdelivery.expected.abi.dump.gz new file mode 100644 index 0000000000000..c83ba4b1a1632 Binary files /dev/null and b/ci/abi-dumps/google_cloud_cpp_configdelivery.expected.abi.dump.gz differ diff --git a/ci/etc/expected_install_directories b/ci/etc/expected_install_directories index 42676d67b9068..8edad6f016e2a 100644 --- a/ci/etc/expected_install_directories +++ b/ci/etc/expected_install_directories @@ -647,6 +647,10 @@ ./include/google/cloud/config/v1 ./include/google/cloud/config/v1/internal ./include/google/cloud/config/v1/mocks +./include/google/cloud/configdelivery +./include/google/cloud/configdelivery/v1 +./include/google/cloud/configdelivery/v1/internal +./include/google/cloud/configdelivery/v1/mocks ./include/google/cloud/connectors ./include/google/cloud/connectors/mocks ./include/google/cloud/connectors/v1 @@ -1397,6 +1401,8 @@ ./lib64/cmake/google_cloud_cpp_confidentialcomputing_mocks ./lib64/cmake/google_cloud_cpp_config ./lib64/cmake/google_cloud_cpp_config_mocks +./lib64/cmake/google_cloud_cpp_configdelivery +./lib64/cmake/google_cloud_cpp_configdelivery_mocks ./lib64/cmake/google_cloud_cpp_connectors ./lib64/cmake/google_cloud_cpp_connectors_mocks ./lib64/cmake/google_cloud_cpp_contactcenterinsights diff --git a/cmake/GoogleCloudCppFeatures.cmake b/cmake/GoogleCloudCppFeatures.cmake index b68eed35ed438..748f16a270be0 100644 --- a/cmake/GoogleCloudCppFeatures.cmake +++ b/cmake/GoogleCloudCppFeatures.cmake @@ -75,6 +75,7 @@ set(GOOGLE_CLOUD_CPP_GA_LIBRARIES "compute" "confidentialcomputing" "config" + "configdelivery" "connectors" "contactcenterinsights" "container" diff --git a/external/googleapis/protodeps/configdelivery.deps b/external/googleapis/protodeps/configdelivery.deps new file mode 100644 index 0000000000000..3797f67d24463 --- /dev/null +++ b/external/googleapis/protodeps/configdelivery.deps @@ -0,0 +1,9 @@ +@com_google_googleapis//google/api:annotations_proto +@com_google_googleapis//google/api:client_proto +@com_google_googleapis//google/api:field_behavior_proto +@com_google_googleapis//google/api:field_info_proto +@com_google_googleapis//google/api:http_proto +@com_google_googleapis//google/api:launch_stage_proto +@com_google_googleapis//google/api:resource_proto +@com_google_googleapis//google/longrunning:operations_proto +@com_google_googleapis//google/rpc:status_proto diff --git a/external/googleapis/protolists/configdelivery.list b/external/googleapis/protolists/configdelivery.list new file mode 100644 index 0000000000000..5188314ee93f1 --- /dev/null +++ b/external/googleapis/protolists/configdelivery.list @@ -0,0 +1 @@ +@com_google_googleapis//google/cloud/configdelivery/v1:config_delivery.proto diff --git a/external/googleapis/update_libraries.sh b/external/googleapis/update_libraries.sh index d34e21196aba1..438b079e57be1 100755 --- a/external/googleapis/update_libraries.sh +++ b/external/googleapis/update_libraries.sh @@ -105,6 +105,7 @@ declare -A -r LIBRARIES=( ["composer"]="@com_google_googleapis//google/cloud/orchestration/airflow/service/v1:service_cc_grpc" ["confidentialcomputing"]="@com_google_googleapis//google/cloud/confidentialcomputing/v1:confidentialcomputing_cc_grpc" ["config"]="@com_google_googleapis//google/cloud/config/v1:config_cc_grpc" + ["configdelivery"]="@com_google_googleapis//google/cloud/configdelivery/v1:configdelivery_cc_grpc" ["connectors"]="@com_google_googleapis//google/cloud/connectors/v1:connectors_cc_grpc" ["contactcenterinsights"]="@com_google_googleapis//google/cloud/contactcenterinsights/v1:contactcenterinsights_cc_grpc" ["container"]="@com_google_googleapis//google/container/v1:container_cc_grpc" diff --git a/generator/generator_config.textproto b/generator/generator_config.textproto index b58fa2f90f210..00dc1c288aead 100644 --- a/generator/generator_config.textproto +++ b/generator/generator_config.textproto @@ -1762,6 +1762,14 @@ service { retryable_status_codes: ["kUnavailable"] } +# Config Delivery +service { + service_proto_path: "google/cloud/configdelivery/v1/config_delivery.proto" + product_path: "google/cloud/configdelivery/v1" + initial_copyright_year: "2025" + retryable_status_codes: ["kUnavailable"] +} + # Connectors service { service_proto_path: "google/cloud/connectors/v1/connectors_service.proto" diff --git a/google/cloud/configdelivery/BUILD.bazel b/google/cloud/configdelivery/BUILD.bazel new file mode 100644 index 0000000000000..1444e57dd280f --- /dev/null +++ b/google/cloud/configdelivery/BUILD.bazel @@ -0,0 +1,31 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("//bazel:gapic.bzl", "cc_gapic_library") + +package(default_visibility = ["//visibility:private"]) + +licenses(["notice"]) # Apache 2.0 + +service_dirs = ["v1/"] + +googleapis_deps = [ + "@com_google_googleapis//google/cloud/configdelivery/v1:configdelivery_cc_grpc", +] + +cc_gapic_library( + name = "configdelivery", + googleapis_deps = googleapis_deps, + service_dirs = service_dirs, +) diff --git a/google/cloud/configdelivery/CMakeLists.txt b/google/cloud/configdelivery/CMakeLists.txt new file mode 100644 index 0000000000000..7696297aa0a3e --- /dev/null +++ b/google/cloud/configdelivery/CMakeLists.txt @@ -0,0 +1,39 @@ +# ~~~ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ~~~ + +include(GoogleCloudCppLibrary) + +google_cloud_cpp_add_gapic_library(configdelivery "Config Delivery API" + SERVICE_DIRS "v1/") + +if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) + add_executable(configdelivery_quickstart "quickstart/quickstart.cc") + target_link_libraries(configdelivery_quickstart + PRIVATE google-cloud-cpp::configdelivery) + google_cloud_cpp_add_common_options(configdelivery_quickstart) + add_test( + NAME configdelivery_quickstart + COMMAND + cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake" + $ GOOGLE_CLOUD_PROJECT + GOOGLE_CLOUD_CPP_TEST_REGION # EDIT HERE + ) + set_tests_properties( + configdelivery_quickstart + PROPERTIES + LABELS "integration-test;quickstart" PASS_REGULAR_EXPRESSION + "Permanent error.*gcloud-cpp.retry.function=ListFleetPackages") +endif () diff --git a/google/cloud/configdelivery/README.md b/google/cloud/configdelivery/README.md new file mode 100644 index 0000000000000..70619bc450e3a --- /dev/null +++ b/google/cloud/configdelivery/README.md @@ -0,0 +1,62 @@ +# Config Delivery API C++ Client Library + +This directory contains an idiomatic C++ client library for the +[Config Delivery API][cloud-service-docs]. + +ConfigDelivery service manages the deployment of kubernetes configuration to a +fleet of kubernetes clusters. + +While this library is **GA**, please note that the Google Cloud C++ client +libraries do **not** follow [Semantic Versioning](https://semver.org/). + +## Quickstart + +The [quickstart/](quickstart/README.md) directory contains a minimal environment +to get started using this client library in a larger project. The following +"Hello World" program is used in this quickstart, and should give you a taste of +this library. + + + +```cc +#include "google/cloud/configdelivery/v1/config_delivery_client.h" +#include "google/cloud/location.h" +#include + +int main(int argc, char* argv[]) try { + if (argc != 3) { + std::cerr << "Usage: " << argv[0] << " project-id location-id\n"; + return 1; + } + + auto const location = google::cloud::Location(argv[1], argv[2]); + + namespace configdelivery = ::google::cloud::configdelivery_v1; + auto client = configdelivery::ConfigDeliveryClient( + configdelivery::MakeConfigDeliveryConnection()); + + for (auto r : client.ListFleetPackages(location.FullName())) { + if (!r) throw std::move(r).status(); + std::cout << r->DebugString() << "\n"; + } + + return 0; +} catch (google::cloud::Status const& status) { + std::cerr << "google::cloud::Status thrown: " << status << "\n"; + return 1; +} +``` + + + +## More Information + +- Official documentation about the [Config Delivery API][cloud-service-docs] + service +- [Reference doxygen documentation][doxygen-link] for each release of this + client library +- Detailed header comments in our [public `.h`][source-link] files + +[cloud-service-docs]: https://cloud.google.com/kubernetes-engine/enterprise/config-sync/docs/concepts/fleet-packages +[doxygen-link]: https://cloud.google.com/kubernetes-engine/enterprise/config-sync/docs/concepts/fleet-packages +[source-link]: https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/configdelivery diff --git a/google/cloud/configdelivery/doc/environment-variables.dox b/google/cloud/configdelivery/doc/environment-variables.dox new file mode 100644 index 0000000000000..dab5bc9a3d7b3 --- /dev/null +++ b/google/cloud/configdelivery/doc/environment-variables.dox @@ -0,0 +1,50 @@ +/*! + +@page configdelivery-env Environment Variables + +A number of environment variables can be used to configure the behavior of +the library. There are also functions to configure this behavior in code. The +environment variables are convenient when troubleshooting problems. + +@section configdelivery-env-endpoint Endpoint Overrides + + + +- `GOOGLE_CLOUD_CPP_CONFIG_DELIVERY_ENDPOINT=...` overrides the + `EndpointOption` (which defaults to "configdelivery.googleapis.com") + used by `MakeConfigDeliveryConnection()`. + + + +@see google::cloud::EndpointOption + +@section configdelivery-env-logging Logging + +`GOOGLE_CLOUD_CPP_ENABLE_TRACING=rpc`: turns on tracing for most gRPC +calls. The library injects an additional Stub decorator that prints each gRPC +request and response. Unless you have configured your own logging backend, +you should also set `GOOGLE_CLOUD_CPP_ENABLE_CLOG` to produce any output on +the program's console. + +@see google::cloud::LoggingComponentsOption + +`GOOGLE_CLOUD_CPP_TRACING_OPTIONS=...`: modifies the behavior of gRPC tracing, +including whether messages will be output on multiple lines, or whether +string/bytes fields will be truncated. + +@see google::cloud::GrpcTracingOptionsOption + +`GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes`: turns on logging in the library, basically +the library always "logs" but the logging infrastructure has no backend to +actually print anything until the application sets a backend or they set this +environment variable. + +@see google::cloud::LogBackend +@see google::cloud::LogSink + +@section configdelivery-env-project Setting the Default Project + +`GOOGLE_CLOUD_PROJECT=...`: is used in examples and integration tests to +configure the GCP project. This has no effect in the library. + +*/ diff --git a/google/cloud/configdelivery/doc/main.dox b/google/cloud/configdelivery/doc/main.dox new file mode 100644 index 0000000000000..9d9ac5529f33f --- /dev/null +++ b/google/cloud/configdelivery/doc/main.dox @@ -0,0 +1,48 @@ +/*! + +@mainpage Config Delivery API C++ Client Library + +An idiomatic C++ client library for the [Config Delivery API][cloud-service-docs]. + +ConfigDelivery service manages the deployment of kubernetes configuration +to a fleet of kubernetes clusters. + +While this library is **GA**, please note that the Google Cloud C++ client libraries do **not** follow +[Semantic Versioning](https://semver.org/). + +@tableofcontents{HTML:2} + +## Quickstart + +The following shows the code that you'll run in the +`google/cloud/configdelivery/quickstart/` directory, +which should give you a taste of the Config Delivery API C++ client library API. + +@snippet quickstart.cc all + +## Main classes + + +The main class in this library is +[`configdelivery_v1::ConfigDeliveryClient`](@ref google::cloud::configdelivery_v1::ConfigDeliveryClient). All RPCs are exposed +as member functions of this class. Other classes provide helpers, configuration +parameters, and infrastructure to mock +[`configdelivery_v1::ConfigDeliveryClient`](@ref google::cloud::configdelivery_v1::ConfigDeliveryClient) when testing your +application. + + +## More Information + +- @ref common-error-handling - describes how the library reports errors. +- @ref configdelivery-override-endpoint - describes how to override the default + endpoint. +- @ref configdelivery-override-authentication - describes how to change the + authentication credentials used by the library. +- @ref configdelivery-override-retry - describes how to change the default retry + policies. +- @ref configdelivery-env - describes environment variables that can configure the + behavior of the library. + +[cloud-service-docs]: https://cloud.google.com/kubernetes-engine/enterprise/config-sync/docs/concepts/fleet-packages + +*/ diff --git a/google/cloud/configdelivery/doc/options.dox b/google/cloud/configdelivery/doc/options.dox new file mode 100644 index 0000000000000..204de54b14e28 --- /dev/null +++ b/google/cloud/configdelivery/doc/options.dox @@ -0,0 +1,10 @@ +/*! +@defgroup google-cloud-configdelivery-options Config Delivery API Configuration Options + +This library uses the same mechanism (`google::cloud::Options`) and the common +[options](@ref options) as all other C++ client libraries for its configuration. +Some `*Option` classes, which are only used in this library, are documented in +this page. + +@see @ref options - for an overview of client library configuration. +*/ diff --git a/google/cloud/configdelivery/doc/override-authentication.dox b/google/cloud/configdelivery/doc/override-authentication.dox new file mode 100644 index 0000000000000..446179fdb0176 --- /dev/null +++ b/google/cloud/configdelivery/doc/override-authentication.dox @@ -0,0 +1,35 @@ +/*! +@page configdelivery-override-authentication How to Override the Authentication Credentials + +Unless otherwise configured, the client libraries use +[Application Default Credentials] to authenticate with Google Cloud Services. +While this works for most applications, in some cases you may need to override +this default. You can do so by providing the +[UnifiedCredentialsOption](@ref google::cloud::UnifiedCredentialsOption) +The following example shows how to explicitly load a service account key file: + + +@snippet config_delivery_client_samples.cc with-service-account + + + +Keep in mind that we chose this as an example because it is relatively easy to +understand. Consult the [Best practices for managing service account keys] +guide for more details. + +@see @ref guac - for more information on the factory functions to create +`google::cloud::Credentials` objects. + +[Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys +[Application Default Credentials]: https://cloud.google.com/docs/authentication#adc + +*/ + +// + +/*! @page configdelivery_v1::ConfigDeliveryClient-service-account-snippet Override configdelivery_v1::ConfigDeliveryClient Authentication Defaults + +@snippet google/cloud/configdelivery/v1/samples/config_delivery_client_samples.cc with-service-account + +*/ +// diff --git a/google/cloud/configdelivery/doc/override-endpoint.dox b/google/cloud/configdelivery/doc/override-endpoint.dox new file mode 100644 index 0000000000000..1da9745b37468 --- /dev/null +++ b/google/cloud/configdelivery/doc/override-endpoint.dox @@ -0,0 +1,25 @@ +/*! +@page configdelivery-override-endpoint How to Override the Default Endpoint + +In some cases, you may need to override the default endpoint used by the client +library. Use the +[EndpointOption](@ref google::cloud::EndpointOption) when initializing the +client library to change this default. + + +For example, this will override the default endpoint for `configdelivery_v1::ConfigDeliveryClient`: + +@snippet config_delivery_client_samples.cc set-client-endpoint + + + +*/ + +// + +/*! @page configdelivery_v1::ConfigDeliveryClient-endpoint-snippet Override configdelivery_v1::ConfigDeliveryClient Endpoint Configuration + +@snippet google/cloud/configdelivery/v1/samples/config_delivery_client_samples.cc set-client-endpoint + +*/ +// diff --git a/google/cloud/configdelivery/doc/override-retry-policies.dox b/google/cloud/configdelivery/doc/override-retry-policies.dox new file mode 100644 index 0000000000000..848e61cd86987 --- /dev/null +++ b/google/cloud/configdelivery/doc/override-retry-policies.dox @@ -0,0 +1,108 @@ +/*! +@page configdelivery-override-retry Override Retry, Backoff, and Idempotency Policies + +When it is safe to do so, the library automatically retries requests that fail +due to a transient error. The library then uses [exponential backoff] to backoff +before trying again. Which operations are considered safe to retry, which +errors are treated as transient failures, the details of the exponential backoff +algorithm, and for how long the library retries are all configurable via +policies. + +This document provides examples showing how to override the default policies. + +The policies can be set when the `*Connection` object is created. The library +provides default policies for any policy that is not set. The application can +also override some (or all) policies when the `*Client` object is created. This +can be useful if multiple `*Client` objects share the same `*Connection` object, +but you want different retry behavior in some of the clients. Finally, the +application can override some retry policies when calling a specific member +function. + +The library uses three different options to control the retry loop. The options +have per-client names. + +@section configdelivery-override-retry-retry-policy Configuring the transient errors and retry duration + +The `*RetryPolicyOption` controls: + +- Which errors are to be treated as transient errors. +- How long the library will keep retrying transient errors. + +You can provide your own class for this option. The library also provides two +built-in policies: + +- `*LimitedErrorCountRetryPolicy`: stops retrying after a specified number + of transient errors. +- `*LimitedTimeRetryPolicy`: stops retrying after a specified time. + +Note that a library may have more than one version of these classes. Their name +match the `*Client` and `*Connection` object they are intended to be used +with. Some `*Client` objects treat different error codes as transient errors. +In most cases, only [kUnavailable](@ref google::cloud::StatusCode) is treated +as a transient error. + +@section configdelivery-override-retry-backoff-policy Controlling the backoff algorithm + +The `*BackoffPolicyOption` controls how long the client library will wait +before retrying a request that failed with a transient error. You can provide +your own class for this option. + +The only built-in backoff policy is +[`ExponentialBackoffPolicy`](@ref google::cloud::ExponentialBackoffPolicy). +This class implements a truncated exponential backoff algorithm, with jitter. +In summary, it doubles the current backoff time after each failure. The actual +backoff time for an RPC is chosen at random, but never exceeds the current +backoff. The current backoff is doubled after each failure, but never exceeds +(or is "truncated") if it reaches a prescribed maximum. + +@section configdelivery-override-retry-idempotency-policy Controlling which operations are retryable + +The `*IdempotencyPolicyOption` controls which requests are retryable, as some +requests are never safe to retry. + +Only one built-in idempotency policy is provided by the library. The name +matches the name of the client it is intended for. For example, `FooBarClient` +will use `FooBarIdempotencyPolicy`. This policy is very conservative. + +@section configdelivery-override-retry-example Example + + +For example, this will override the retry policies for `configdelivery_v1::ConfigDeliveryClient`: + +@snippet config_delivery_client_samples.cc set-retry-policy + +This assumes you have created a custom idempotency policy. Such as: + +@snippet config_delivery_client_samples.cc custom-idempotency-policy + +This will override the polling policies for `configdelivery_v1::ConfigDeliveryClient` + +@snippet config_delivery_client_samples.cc set-polling-policy + + + + +@section configdelivery-override-retry-more-information More Information + +@see google::cloud::Options +@see google::cloud::BackoffPolicy +@see google::cloud::ExponentialBackoffPolicy + +[exponential backoff]: https://en.wikipedia.org/wiki/Exponential_backoff + +*/ + +// + +/*! @page configdelivery_v1::ConfigDeliveryClient-retry-snippet Override configdelivery_v1::ConfigDeliveryClient Retry Policies + +This shows how to override the retry policies for configdelivery_v1::ConfigDeliveryClient: + +@snippet google/cloud/configdelivery/v1/samples/config_delivery_client_samples.cc set-retry-policy + +Assuming you have created a custom idempotency policy. Such as: + +@snippet google/cloud/configdelivery/v1/samples/config_delivery_client_samples.cc custom-idempotency-policy + +*/ +// diff --git a/google/cloud/configdelivery/quickstart/.bazelrc b/google/cloud/configdelivery/quickstart/.bazelrc new file mode 100644 index 0000000000000..8431873b6fcba --- /dev/null +++ b/google/cloud/configdelivery/quickstart/.bazelrc @@ -0,0 +1,30 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Use host-OS-specific config lines from bazelrc files. +build --enable_platform_specific_config=true + +# The project requires C++ >= 14. By default Bazel adds `-std=c++0x` which +# disables C++14 features, even if the compilers defaults to C++ >= 14 +build:linux --cxxopt=-std=c++14 +build:macos --cxxopt=-std=c++14 +# Protobuf and gRPC require (or soon will require) C++14 to compile the "host" +# targets, such as protoc and the grpc plugin. +build:linux --host_cxxopt=-std=c++14 +build:macos --host_cxxopt=-std=c++14 + +# Do not create the convenience links. They are inconvenient when the build +# runs inside a docker image or if one builds a quickstart and then builds +# the project separately. +build --experimental_convenience_symlinks=ignore diff --git a/google/cloud/configdelivery/quickstart/BUILD.bazel b/google/cloud/configdelivery/quickstart/BUILD.bazel new file mode 100644 index 0000000000000..db855214c528f --- /dev/null +++ b/google/cloud/configdelivery/quickstart/BUILD.bazel @@ -0,0 +1,25 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache 2.0 + +cc_binary( + name = "quickstart", + srcs = [ + "quickstart.cc", + ], + deps = [ + "@google_cloud_cpp//:configdelivery", + ], +) diff --git a/google/cloud/configdelivery/quickstart/CMakeLists.txt b/google/cloud/configdelivery/quickstart/CMakeLists.txt new file mode 100644 index 0000000000000..38bba03e73b83 --- /dev/null +++ b/google/cloud/configdelivery/quickstart/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# This file shows how to use the Config Delivery API C++ client library from a +# larger CMake project. + +cmake_minimum_required(VERSION 3.10...3.24) +project(google-cloud-cpp-configdelivery-quickstart CXX) + +find_package(google_cloud_cpp_configdelivery REQUIRED) + +# MSVC requires some additional code to select the correct runtime library +if (VCPKG_TARGET_TRIPLET MATCHES "-static$") + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +else () + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") +endif () + +# Define your targets. +add_executable(quickstart quickstart.cc) +target_link_libraries(quickstart google-cloud-cpp::configdelivery) diff --git a/google/cloud/configdelivery/quickstart/Makefile b/google/cloud/configdelivery/quickstart/Makefile new file mode 100644 index 0000000000000..5e2bcb351f1aa --- /dev/null +++ b/google/cloud/configdelivery/quickstart/Makefile @@ -0,0 +1,35 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This is a minimal Makefile to show how to use the Config Delivery API C++ client +# for developers who use make(1) as their build system. + +# The CXX, CXXFLAGS and CXXLD variables are hard-coded. These values work for +# our tests, but applications would typically make them configurable parameters. +CXX=g++ +CXXFLAGS= +CXXLD=$(CXX) +BIN=. + +all: $(BIN)/quickstart + +# Configuration variables to compile and link against the Config Delivery API C++ +# client library. +CLIENT_MODULE := google_cloud_cpp_configdelivery +CLIENT_CXXFLAGS := $(shell pkg-config $(CLIENT_MODULE) --cflags) +CLIENT_CXXLDFLAGS := $(shell pkg-config $(CLIENT_MODULE) --libs-only-L) +CLIENT_LIBS := $(shell pkg-config $(CLIENT_MODULE) --libs-only-l) + +$(BIN)/quickstart: quickstart.cc + $(CXXLD) $(CXXFLAGS) $(CLIENT_CXXFLAGS) $(CLIENT_CXXLDFLAGS) -o $@ $^ $(CLIENT_LIBS) diff --git a/google/cloud/configdelivery/quickstart/README.md b/google/cloud/configdelivery/quickstart/README.md new file mode 100644 index 0000000000000..108b93e35499e --- /dev/null +++ b/google/cloud/configdelivery/quickstart/README.md @@ -0,0 +1,135 @@ +# HOWTO: using the Config Delivery API C++ client in your project + +This directory contains small examples showing how to use the Config Delivery +API C++ client library in your own project. These instructions assume that you +have some experience as a C++ developer and that you have a working C++ +toolchain (compiler, linker, etc.) installed on your platform. + +- Packaging maintainers or developers who prefer to install the library in a + fixed directory (such as `/usr/local` or `/opt`) should consult the + [packaging guide](/doc/packaging.md). +- Developers who prefer using a package manager such as + [vcpkg](https://vcpkg.io), or [Conda](https://conda.io), should follow the + instructions for their package manager. +- Developers wanting to use the libraries as part of a larger CMake or Bazel + project should consult the current document. Note that there are similar + documents for each library in their corresponding directories. +- Developers wanting to compile the library just to run some examples or tests + should consult the + [building and installing](/README.md#building-and-installing) section of the + top-level README file. +- Contributors and developers to `google-cloud-cpp` should consult the guide to + [set up a development workstation][howto-setup-dev-workstation]. + +## Before you begin + +To run the quickstart examples you will need a working Google Cloud Platform +(GCP) project. + +## Configuring authentication for the C++ Client Library + +Like most Google Cloud Platform (GCP) services, Config Delivery API requires +that your application authenticates with the service before accessing any data. +If you are not familiar with GCP authentication please take this opportunity to +review the [Authentication methods at Google][authentication-quickstart]. + +## Using with Bazel + +> :warning: If you are using Windows or macOS there are additional instructions +> at the end of this document. + +1. Install Bazel using [the instructions][bazel-install] from the `bazel.build` + website. + +1. Compile this example using Bazel: + + ```bash + cd $HOME/google-cloud-cpp/google/cloud/configdelivery/quickstart + bazel build ... + ``` + + Note that Bazel automatically downloads and compiles all dependencies of the + project. As it is often the case with C++ libraries, compiling these + dependencies may take several minutes. + +1. Run the example, changing the placeholder(s) to appropriate values: + + ```bash + bazel run :quickstart -- [...] + ``` + +## Using with CMake + +> :warning: If you are using Windows or macOS there are additional instructions +> at the end of this document. + +1. Install CMake. The package managers for most Linux distributions include a + package for CMake. Likewise, you can install CMake on Windows using a package + manager such as [chocolatey][choco-cmake-link], and on macOS using + [homebrew][homebrew-cmake-link]. You can also obtain the software directly + from the [cmake.org](https://cmake.org/download/). + +1. Install the dependencies with your favorite tools. As an example, if you use + [vcpkg](https://github.com/Microsoft/vcpkg.git): + + ```bash + cd $HOME/vcpkg + ./vcpkg install google-cloud-cpp[core,configdelivery] + ``` + + Note that, as it is often the case with C++ libraries, compiling these + dependencies may take several minutes. + +1. Configure CMake, if necessary, configure the directory where you installed + the dependencies: + + ```bash + cd $HOME/google-cloud-cpp/google/cloud/configdelivery/quickstart + cmake -S . -B .build -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake + cmake --build .build + ``` + +1. Run the example, changing the placeholder(s) to appropriate values: + + ```bash + .build/quickstart [...] + ``` + +## Platform Specific Notes + +### macOS + +gRPC [requires][grpc-roots-pem-bug] an environment variable to configure the +trust store for SSL certificates, you can download and configure this using: + +```bash +curl -Lo roots.pem https://pki.google.com/roots.pem +export GRPC_DEFAULT_SSL_ROOTS_FILE_PATH="$PWD/roots.pem" +``` + +### Windows + +Bazel tends to create very long file names and paths. You may need to use a +short directory to store the build output, such as `c:\b`, and instruct Bazel to +use it via: + +```shell +bazel --output_user_root=c:\b build ... +``` + +gRPC [requires][grpc-roots-pem-bug] an environment variable to configure the +trust store for SSL certificates, you can download and configure this using: + +```console +@powershell -NoProfile -ExecutionPolicy unrestricted -Command ^ + (new-object System.Net.WebClient).Downloadfile( ^ + 'https://pki.google.com/roots.pem', 'roots.pem') +set GRPC_DEFAULT_SSL_ROOTS_FILE_PATH=%cd%\roots.pem +``` + +[authentication-quickstart]: https://cloud.google.com/docs/authentication/client-libraries "Authenticate for using client libraries" +[bazel-install]: https://docs.bazel.build/versions/main/install.html +[choco-cmake-link]: https://chocolatey.org/packages/cmake +[grpc-roots-pem-bug]: https://github.com/grpc/grpc/issues/16571 +[homebrew-cmake-link]: https://formulae.brew.sh/formula/cmake +[howto-setup-dev-workstation]: /doc/contributor/howto-guide-setup-development-workstation.md diff --git a/google/cloud/configdelivery/quickstart/WORKSPACE.bazel b/google/cloud/configdelivery/quickstart/WORKSPACE.bazel new file mode 100644 index 0000000000000..5888fdf04ff97 --- /dev/null +++ b/google/cloud/configdelivery/quickstart/WORKSPACE.bazel @@ -0,0 +1,53 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A minimal WORKSPACE file showing how to use the Config Delivery API +# C++ client library in Bazel-based projects. +workspace(name = "qs") + +# Add the necessary Starlark functions to fetch google-cloud-cpp. +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +# Fetch the Google Cloud C++ libraries. +# NOTE: Update this version and SHA256 as needed. +http_archive( + name = "google_cloud_cpp", + sha256 = "2072880320cbd5a4690d6bbaa6e4c4b1dd32be22b2ff42b0cbe30db4b2642df4", + strip_prefix = "google-cloud-cpp-2.41.0", + url = "https://github.com/googleapis/google-cloud-cpp/archive/v2.41.0.tar.gz", +) + +load("@google_cloud_cpp//bazel:workspace0.bzl", "gl_cpp_workspace0") + +gl_cpp_workspace0() + +load("@google_cloud_cpp//bazel:workspace1.bzl", "gl_cpp_workspace1") + +gl_cpp_workspace1() + +load("@google_cloud_cpp//bazel:workspace2.bzl", "gl_cpp_workspace2") + +gl_cpp_workspace2() + +load("@google_cloud_cpp//bazel:workspace3.bzl", "gl_cpp_workspace3") + +gl_cpp_workspace3() + +load("@google_cloud_cpp//bazel:workspace4.bzl", "gl_cpp_workspace4") + +gl_cpp_workspace4() + +load("@google_cloud_cpp//bazel:workspace5.bzl", "gl_cpp_workspace5") + +gl_cpp_workspace5() diff --git a/google/cloud/configdelivery/quickstart/quickstart.cc b/google/cloud/configdelivery/quickstart/quickstart.cc new file mode 100644 index 0000000000000..7de52791ebdcc --- /dev/null +++ b/google/cloud/configdelivery/quickstart/quickstart.cc @@ -0,0 +1,42 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! [all] +#include "google/cloud/configdelivery/v1/config_delivery_client.h" +#include "google/cloud/location.h" +#include + +int main(int argc, char* argv[]) try { + if (argc != 3) { + std::cerr << "Usage: " << argv[0] << " project-id location-id\n"; + return 1; + } + + auto const location = google::cloud::Location(argv[1], argv[2]); + + namespace configdelivery = ::google::cloud::configdelivery_v1; + auto client = configdelivery::ConfigDeliveryClient( + configdelivery::MakeConfigDeliveryConnection()); + + for (auto r : client.ListFleetPackages(location.FullName())) { + if (!r) throw std::move(r).status(); + std::cout << r->DebugString() << "\n"; + } + + return 0; +} catch (google::cloud::Status const& status) { + std::cerr << "google::cloud::Status thrown: " << status << "\n"; + return 1; +} +//! [all] diff --git a/google/cloud/configdelivery/v1/.repo-metadata.json b/google/cloud/configdelivery/v1/.repo-metadata.json new file mode 100644 index 0000000000000..ec12f999fa881 --- /dev/null +++ b/google/cloud/configdelivery/v1/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "api_id": "configdelivery.googleapis.com", + "api_shortname": "configdelivery", + "client_documentation": "https://cloud.google.com/cpp/docs/reference/configdelivery/latest", + "distribution_name": "google-cloud-cpp", + "issue_tracker": "https://issuetracker.google.com/issues?q=componentid:1400250%20status=open", + "language": "cpp", + "library_type": "GAPIC_AUTO", + "name_pretty": "Config Delivery API", + "product_documentation": "https://cloud.google.com/kubernetes-engine/enterprise/config-sync/docs/concepts/fleet-packages", + "release_level": "stable", + "repo": "googleapis/google-cloud-cpp", + "requires_billing": true +} diff --git a/google/cloud/configdelivery/v1/config_delivery_client.cc b/google/cloud/configdelivery/v1/config_delivery_client.cc new file mode 100644 index 0000000000000..7d42acc3d6663 --- /dev/null +++ b/google/cloud/configdelivery/v1/config_delivery_client.cc @@ -0,0 +1,935 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#include "google/cloud/configdelivery/v1/config_delivery_client.h" +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ConfigDeliveryClient::ConfigDeliveryClient( + std::shared_ptr connection, Options opts) + : connection_(std::move(connection)), + options_( + internal::MergeOptions(std::move(opts), connection_->options())) {} +ConfigDeliveryClient::~ConfigDeliveryClient() = default; + +StreamRange +ConfigDeliveryClient::ListResourceBundles(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::ListResourceBundlesRequest request; + request.set_parent(parent); + return connection_->ListResourceBundles(request); +} + +StreamRange +ConfigDeliveryClient::ListResourceBundles( + google::cloud::configdelivery::v1::ListResourceBundlesRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListResourceBundles(std::move(request)); +} + +StatusOr +ConfigDeliveryClient::GetResourceBundle(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::GetResourceBundleRequest request; + request.set_name(name); + return connection_->GetResourceBundle(request); +} + +StatusOr +ConfigDeliveryClient::GetResourceBundle( + google::cloud::configdelivery::v1::GetResourceBundleRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetResourceBundle(request); +} + +future> +ConfigDeliveryClient::CreateResourceBundle( + std::string const& parent, + google::cloud::configdelivery::v1::ResourceBundle const& resource_bundle, + std::string const& resource_bundle_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::CreateResourceBundleRequest request; + request.set_parent(parent); + *request.mutable_resource_bundle() = resource_bundle; + request.set_resource_bundle_id(resource_bundle_id); + return connection_->CreateResourceBundle(request); +} + +StatusOr +ConfigDeliveryClient::CreateResourceBundle( + NoAwaitTag, std::string const& parent, + google::cloud::configdelivery::v1::ResourceBundle const& resource_bundle, + std::string const& resource_bundle_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::CreateResourceBundleRequest request; + request.set_parent(parent); + *request.mutable_resource_bundle() = resource_bundle; + request.set_resource_bundle_id(resource_bundle_id); + return connection_->CreateResourceBundle(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::CreateResourceBundle( + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateResourceBundle(request); +} + +StatusOr +ConfigDeliveryClient::CreateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateResourceBundle(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::CreateResourceBundle( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateResourceBundle(operation); +} + +future> +ConfigDeliveryClient::UpdateResourceBundle( + google::cloud::configdelivery::v1::ResourceBundle const& resource_bundle, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::UpdateResourceBundleRequest request; + *request.mutable_resource_bundle() = resource_bundle; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateResourceBundle(request); +} + +StatusOr +ConfigDeliveryClient::UpdateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::ResourceBundle const& resource_bundle, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::UpdateResourceBundleRequest request; + *request.mutable_resource_bundle() = resource_bundle; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateResourceBundle(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::UpdateResourceBundle( + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateResourceBundle(request); +} + +StatusOr +ConfigDeliveryClient::UpdateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateResourceBundle(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::UpdateResourceBundle( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateResourceBundle(operation); +} + +future> +ConfigDeliveryClient::DeleteResourceBundle(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::DeleteResourceBundleRequest request; + request.set_name(name); + return connection_->DeleteResourceBundle(request); +} + +StatusOr +ConfigDeliveryClient::DeleteResourceBundle(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::DeleteResourceBundleRequest request; + request.set_name(name); + return connection_->DeleteResourceBundle(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::DeleteResourceBundle( + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteResourceBundle(request); +} + +StatusOr +ConfigDeliveryClient::DeleteResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteResourceBundle(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::DeleteResourceBundle( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteResourceBundle(operation); +} + +StreamRange +ConfigDeliveryClient::ListFleetPackages(std::string const& parent, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::ListFleetPackagesRequest request; + request.set_parent(parent); + return connection_->ListFleetPackages(request); +} + +StreamRange +ConfigDeliveryClient::ListFleetPackages( + google::cloud::configdelivery::v1::ListFleetPackagesRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListFleetPackages(std::move(request)); +} + +StatusOr +ConfigDeliveryClient::GetFleetPackage(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::GetFleetPackageRequest request; + request.set_name(name); + return connection_->GetFleetPackage(request); +} + +StatusOr +ConfigDeliveryClient::GetFleetPackage( + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetFleetPackage(request); +} + +future> +ConfigDeliveryClient::CreateFleetPackage( + std::string const& parent, + google::cloud::configdelivery::v1::FleetPackage const& fleet_package, + std::string const& fleet_package_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::CreateFleetPackageRequest request; + request.set_parent(parent); + *request.mutable_fleet_package() = fleet_package; + request.set_fleet_package_id(fleet_package_id); + return connection_->CreateFleetPackage(request); +} + +StatusOr +ConfigDeliveryClient::CreateFleetPackage( + NoAwaitTag, std::string const& parent, + google::cloud::configdelivery::v1::FleetPackage const& fleet_package, + std::string const& fleet_package_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::CreateFleetPackageRequest request; + request.set_parent(parent); + *request.mutable_fleet_package() = fleet_package; + request.set_fleet_package_id(fleet_package_id); + return connection_->CreateFleetPackage(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::CreateFleetPackage( + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateFleetPackage(request); +} + +StatusOr +ConfigDeliveryClient::CreateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateFleetPackage(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::CreateFleetPackage( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateFleetPackage(operation); +} + +future> +ConfigDeliveryClient::UpdateFleetPackage( + google::cloud::configdelivery::v1::FleetPackage const& fleet_package, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::UpdateFleetPackageRequest request; + *request.mutable_fleet_package() = fleet_package; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateFleetPackage(request); +} + +StatusOr +ConfigDeliveryClient::UpdateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::FleetPackage const& fleet_package, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::UpdateFleetPackageRequest request; + *request.mutable_fleet_package() = fleet_package; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateFleetPackage(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::UpdateFleetPackage( + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateFleetPackage(request); +} + +StatusOr +ConfigDeliveryClient::UpdateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateFleetPackage(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::UpdateFleetPackage( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateFleetPackage(operation); +} + +future> +ConfigDeliveryClient::DeleteFleetPackage(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::DeleteFleetPackageRequest request; + request.set_name(name); + return connection_->DeleteFleetPackage(request); +} + +StatusOr +ConfigDeliveryClient::DeleteFleetPackage(NoAwaitTag, std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::DeleteFleetPackageRequest request; + request.set_name(name); + return connection_->DeleteFleetPackage(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::DeleteFleetPackage( + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteFleetPackage(request); +} + +StatusOr +ConfigDeliveryClient::DeleteFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteFleetPackage(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::DeleteFleetPackage( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteFleetPackage(operation); +} + +StreamRange +ConfigDeliveryClient::ListReleases(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::ListReleasesRequest request; + request.set_parent(parent); + return connection_->ListReleases(request); +} + +StreamRange +ConfigDeliveryClient::ListReleases( + google::cloud::configdelivery::v1::ListReleasesRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListReleases(std::move(request)); +} + +StatusOr +ConfigDeliveryClient::GetRelease(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::GetReleaseRequest request; + request.set_name(name); + return connection_->GetRelease(request); +} + +StatusOr +ConfigDeliveryClient::GetRelease( + google::cloud::configdelivery::v1::GetReleaseRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetRelease(request); +} + +future> +ConfigDeliveryClient::CreateRelease( + std::string const& parent, + google::cloud::configdelivery::v1::Release const& release, + std::string const& release_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::CreateReleaseRequest request; + request.set_parent(parent); + *request.mutable_release() = release; + request.set_release_id(release_id); + return connection_->CreateRelease(request); +} + +StatusOr ConfigDeliveryClient::CreateRelease( + NoAwaitTag, std::string const& parent, + google::cloud::configdelivery::v1::Release const& release, + std::string const& release_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::CreateReleaseRequest request; + request.set_parent(parent); + *request.mutable_release() = release; + request.set_release_id(release_id); + return connection_->CreateRelease(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::CreateRelease( + google::cloud::configdelivery::v1::CreateReleaseRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateRelease(request); +} + +StatusOr ConfigDeliveryClient::CreateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateRelease(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::CreateRelease( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateRelease(operation); +} + +future> +ConfigDeliveryClient::UpdateRelease( + google::cloud::configdelivery::v1::Release const& release, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::UpdateReleaseRequest request; + *request.mutable_release() = release; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateRelease(request); +} + +StatusOr ConfigDeliveryClient::UpdateRelease( + NoAwaitTag, google::cloud::configdelivery::v1::Release const& release, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::UpdateReleaseRequest request; + *request.mutable_release() = release; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateRelease(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::UpdateRelease( + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateRelease(request); +} + +StatusOr ConfigDeliveryClient::UpdateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateRelease(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::UpdateRelease( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateRelease(operation); +} + +future> +ConfigDeliveryClient::DeleteRelease(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::DeleteReleaseRequest request; + request.set_name(name); + return connection_->DeleteRelease(request); +} + +StatusOr ConfigDeliveryClient::DeleteRelease( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::DeleteReleaseRequest request; + request.set_name(name); + return connection_->DeleteRelease(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::DeleteRelease( + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteRelease(request); +} + +StatusOr ConfigDeliveryClient::DeleteRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteRelease(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::DeleteRelease( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteRelease(operation); +} + +StreamRange +ConfigDeliveryClient::ListVariants(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::ListVariantsRequest request; + request.set_parent(parent); + return connection_->ListVariants(request); +} + +StreamRange +ConfigDeliveryClient::ListVariants( + google::cloud::configdelivery::v1::ListVariantsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListVariants(std::move(request)); +} + +StatusOr +ConfigDeliveryClient::GetVariant(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::GetVariantRequest request; + request.set_name(name); + return connection_->GetVariant(request); +} + +StatusOr +ConfigDeliveryClient::GetVariant( + google::cloud::configdelivery::v1::GetVariantRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetVariant(request); +} + +future> +ConfigDeliveryClient::CreateVariant( + std::string const& parent, + google::cloud::configdelivery::v1::Variant const& variant, + std::string const& variant_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::CreateVariantRequest request; + request.set_parent(parent); + *request.mutable_variant() = variant; + request.set_variant_id(variant_id); + return connection_->CreateVariant(request); +} + +StatusOr ConfigDeliveryClient::CreateVariant( + NoAwaitTag, std::string const& parent, + google::cloud::configdelivery::v1::Variant const& variant, + std::string const& variant_id, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::CreateVariantRequest request; + request.set_parent(parent); + *request.mutable_variant() = variant; + request.set_variant_id(variant_id); + return connection_->CreateVariant(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::CreateVariant( + google::cloud::configdelivery::v1::CreateVariantRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateVariant(request); +} + +StatusOr ConfigDeliveryClient::CreateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateVariantRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateVariant(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::CreateVariant( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CreateVariant(operation); +} + +future> +ConfigDeliveryClient::UpdateVariant( + google::cloud::configdelivery::v1::Variant const& variant, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::UpdateVariantRequest request; + *request.mutable_variant() = variant; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateVariant(request); +} + +StatusOr ConfigDeliveryClient::UpdateVariant( + NoAwaitTag, google::cloud::configdelivery::v1::Variant const& variant, + google::protobuf::FieldMask const& update_mask, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::UpdateVariantRequest request; + *request.mutable_variant() = variant; + *request.mutable_update_mask() = update_mask; + return connection_->UpdateVariant(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::UpdateVariant( + google::cloud::configdelivery::v1::UpdateVariantRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateVariant(request); +} + +StatusOr ConfigDeliveryClient::UpdateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateVariant(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::UpdateVariant( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->UpdateVariant(operation); +} + +future> +ConfigDeliveryClient::DeleteVariant(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::DeleteVariantRequest request; + request.set_name(name); + return connection_->DeleteVariant(request); +} + +StatusOr ConfigDeliveryClient::DeleteVariant( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::DeleteVariantRequest request; + request.set_name(name); + return connection_->DeleteVariant(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::DeleteVariant( + google::cloud::configdelivery::v1::DeleteVariantRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteVariant(request); +} + +StatusOr ConfigDeliveryClient::DeleteVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteVariant(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::DeleteVariant( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteVariant(operation); +} + +StreamRange +ConfigDeliveryClient::ListRollouts(std::string const& parent, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::ListRolloutsRequest request; + request.set_parent(parent); + return connection_->ListRollouts(request); +} + +StreamRange +ConfigDeliveryClient::ListRollouts( + google::cloud::configdelivery::v1::ListRolloutsRequest request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListRollouts(std::move(request)); +} + +StatusOr +ConfigDeliveryClient::GetRollout(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::GetRolloutRequest request; + request.set_name(name); + return connection_->GetRollout(request); +} + +StatusOr +ConfigDeliveryClient::GetRollout( + google::cloud::configdelivery::v1::GetRolloutRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetRollout(request); +} + +future> +ConfigDeliveryClient::SuspendRollout(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::SuspendRolloutRequest request; + request.set_name(name); + return connection_->SuspendRollout(request); +} + +StatusOr ConfigDeliveryClient::SuspendRollout( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::SuspendRolloutRequest request; + request.set_name(name); + return connection_->SuspendRollout(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::SuspendRollout( + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->SuspendRollout(request); +} + +StatusOr ConfigDeliveryClient::SuspendRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->SuspendRollout(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::SuspendRollout( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->SuspendRollout(operation); +} + +future> +ConfigDeliveryClient::ResumeRollout(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::ResumeRolloutRequest request; + request.set_name(name); + return connection_->ResumeRollout(request); +} + +StatusOr ConfigDeliveryClient::ResumeRollout( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::ResumeRolloutRequest request; + request.set_name(name); + return connection_->ResumeRollout(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::ResumeRollout( + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ResumeRollout(request); +} + +StatusOr ConfigDeliveryClient::ResumeRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ResumeRollout(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::ResumeRollout( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ResumeRollout(operation); +} + +future> +ConfigDeliveryClient::AbortRollout(std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::AbortRolloutRequest request; + request.set_name(name); + return connection_->AbortRollout(request); +} + +StatusOr ConfigDeliveryClient::AbortRollout( + NoAwaitTag, std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::cloud::configdelivery::v1::AbortRolloutRequest request; + request.set_name(name); + return connection_->AbortRollout(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::AbortRollout( + google::cloud::configdelivery::v1::AbortRolloutRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AbortRollout(request); +} + +StatusOr ConfigDeliveryClient::AbortRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AbortRollout(NoAwaitTag{}, request); +} + +future> +ConfigDeliveryClient::AbortRollout( + google::longrunning::Operation const& operation, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->AbortRollout(operation); +} + +StreamRange +ConfigDeliveryClient::ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListLocations(std::move(request)); +} + +StatusOr ConfigDeliveryClient::GetLocation( + google::cloud::location::GetLocationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetLocation(request); +} + +StreamRange +ConfigDeliveryClient::ListOperations(std::string const& name, + std::string const& filter, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::longrunning::ListOperationsRequest request; + request.set_name(name); + request.set_filter(filter); + return connection_->ListOperations(request); +} + +StreamRange +ConfigDeliveryClient::ListOperations( + google::longrunning::ListOperationsRequest request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->ListOperations(std::move(request)); +} + +StatusOr ConfigDeliveryClient::GetOperation( + std::string const& name, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::longrunning::GetOperationRequest request; + request.set_name(name); + return connection_->GetOperation(request); +} + +StatusOr ConfigDeliveryClient::GetOperation( + google::longrunning::GetOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->GetOperation(request); +} + +Status ConfigDeliveryClient::DeleteOperation(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::longrunning::DeleteOperationRequest request; + request.set_name(name); + return connection_->DeleteOperation(request); +} + +Status ConfigDeliveryClient::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->DeleteOperation(request); +} + +Status ConfigDeliveryClient::CancelOperation(std::string const& name, + Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + google::longrunning::CancelOperationRequest request; + request.set_name(name); + return connection_->CancelOperation(request); +} + +Status ConfigDeliveryClient::CancelOperation( + google::longrunning::CancelOperationRequest const& request, Options opts) { + internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_)); + return connection_->CancelOperation(request); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/configdelivery/v1/config_delivery_client.h b/google/cloud/configdelivery/v1/config_delivery_client.h new file mode 100644 index 0000000000000..b7a288481aad0 --- /dev/null +++ b/google/cloud/configdelivery/v1/config_delivery_client.h @@ -0,0 +1,2866 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_CLIENT_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_CLIENT_H + +#include "google/cloud/configdelivery/v1/config_delivery_connection.h" +#include "google/cloud/future.h" +#include "google/cloud/no_await_tag.h" +#include "google/cloud/options.h" +#include "google/cloud/polling_policy.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// +/// ConfigDelivery service manages the deployment of kubernetes configuration to +/// a fleet of kubernetes clusters. +/// +/// @par Equality +/// +/// Instances of this class created via copy-construction or copy-assignment +/// always compare equal. Instances created with equal +/// `std::shared_ptr<*Connection>` objects compare equal. Objects that compare +/// equal share the same underlying resources. +/// +/// @par Performance +/// +/// Creating a new instance of this class is a relatively expensive operation, +/// new objects establish new connections to the service. In contrast, +/// copy-construction, move-construction, and the corresponding assignment +/// operations are relatively efficient as the copies share all underlying +/// resources. +/// +/// @par Thread Safety +/// +/// Concurrent access to different instances of this class, even if they compare +/// equal, is guaranteed to work. Two or more threads operating on the same +/// instance of this class is not guaranteed to work. Since copy-construction +/// and move-construction is a relatively efficient operation, consider using +/// such a copy when using this class from multiple threads. +/// +class ConfigDeliveryClient { + public: + explicit ConfigDeliveryClient( + std::shared_ptr connection, Options opts = {}); + ~ConfigDeliveryClient(); + + ///@{ + /// @name Copy and move support + ConfigDeliveryClient(ConfigDeliveryClient const&) = default; + ConfigDeliveryClient& operator=(ConfigDeliveryClient const&) = default; + ConfigDeliveryClient(ConfigDeliveryClient&&) = default; + ConfigDeliveryClient& operator=(ConfigDeliveryClient&&) = default; + ///@} + + ///@{ + /// @name Equality + friend bool operator==(ConfigDeliveryClient const& a, + ConfigDeliveryClient const& b) { + return a.connection_ == b.connection_; + } + friend bool operator!=(ConfigDeliveryClient const& a, + ConfigDeliveryClient const& b) { + return !(a == b); + } + ///@} + + // clang-format off + /// + /// Lists ResourceBundles in a given project and location. + /// + /// @param parent Required. Parent value for ListResourceBundlesRequest. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.configdelivery.v1.ResourceBundle], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.ListResourceBundlesRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L389} + /// [google.cloud.configdelivery.v1.ResourceBundle]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L360} + /// + // clang-format on + StreamRange + ListResourceBundles(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists ResourceBundles in a given project and location. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.ListResourceBundlesRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.configdelivery.v1.ResourceBundle], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.ListResourceBundlesRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L389} + /// [google.cloud.configdelivery.v1.ResourceBundle]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L360} + /// + // clang-format on + StreamRange + ListResourceBundles( + google::cloud::configdelivery::v1::ListResourceBundlesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single ResourceBundle. + /// + /// @param name Required. Name of the resource. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.configdelivery.v1.ResourceBundle]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.GetResourceBundleRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L426} + /// [google.cloud.configdelivery.v1.ResourceBundle]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L360} + /// + // clang-format on + StatusOr GetResourceBundle( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single ResourceBundle. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.GetResourceBundleRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.configdelivery.v1.ResourceBundle]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.GetResourceBundleRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L426} + /// [google.cloud.configdelivery.v1.ResourceBundle]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L360} + /// + // clang-format on + StatusOr GetResourceBundle( + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new ResourceBundle in a given project and location. + /// + /// @param parent Required. Value for parent. + /// @param resource_bundle Required. The resource being created + /// @param resource_bundle_id Required. Id of the requesting object + /// If auto-generating Id server-side, remove this field and + /// resource_bundle_id from the method_signature of Create RPC + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.ResourceBundle] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.CreateResourceBundleRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L437} + /// [google.cloud.configdelivery.v1.ResourceBundle]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L360} + /// + // clang-format on + future> + CreateResourceBundle( + std::string const& parent, + google::cloud::configdelivery::v1::ResourceBundle const& resource_bundle, + std::string const& resource_bundle_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateResourceBundle + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateResourceBundle( + NoAwaitTag, std::string const& parent, + google::cloud::configdelivery::v1::ResourceBundle const& resource_bundle, + std::string const& resource_bundle_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new ResourceBundle in a given project and location. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.CreateResourceBundleRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.ResourceBundle] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.CreateResourceBundleRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L437} + /// [google.cloud.configdelivery.v1.ResourceBundle]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L360} + /// + // clang-format on + future> + CreateResourceBundle( + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateResourceBundle + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateResourceBundle + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + CreateResourceBundle(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single ResourceBundle. + /// + /// @param resource_bundle Required. The resource being updated + /// @param update_mask Required. Field mask is used to specify the fields to be overwritten in the + /// ResourceBundle resource by the update. + /// The fields specified in the update_mask are relative to the resource, not + /// the full request. A field will be overwritten if it is in the mask. If the + /// user does not provide a mask then all fields will be overwritten. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.ResourceBundle] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.ResourceBundle]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L360} + /// [google.cloud.configdelivery.v1.UpdateResourceBundleRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L474} + /// + // clang-format on + future> + UpdateResourceBundle( + google::cloud::configdelivery::v1::ResourceBundle const& resource_bundle, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateResourceBundle + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::ResourceBundle const& resource_bundle, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single ResourceBundle. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.UpdateResourceBundleRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.ResourceBundle] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.ResourceBundle]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L360} + /// [google.cloud.configdelivery.v1.UpdateResourceBundleRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L474} + /// + // clang-format on + future> + UpdateResourceBundle( + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateResourceBundle + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateResourceBundle + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + UpdateResourceBundle(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deletes a single ResourceBundle. + /// + /// @param name Required. Name of the resource + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.OperationMetadata] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.DeleteResourceBundleRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L506} + /// [google.cloud.configdelivery.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1154} + /// + // clang-format on + future> + DeleteResourceBundle(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteResourceBundle + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteResourceBundle( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single ResourceBundle. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.DeleteResourceBundleRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.OperationMetadata] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.DeleteResourceBundleRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L506} + /// [google.cloud.configdelivery.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1154} + /// + // clang-format on + future> + DeleteResourceBundle( + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteResourceBundle + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteResourceBundle + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + DeleteResourceBundle(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists FleetPackages in a given project and location. + /// + /// @param parent Required. Parent value for ListFleetPackagesRequest. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.configdelivery.v1.FleetPackage], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.FleetPackage]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L543} + /// [google.cloud.configdelivery.v1.ListFleetPackagesRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L999} + /// + // clang-format on + StreamRange + ListFleetPackages(std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists FleetPackages in a given project and location. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.ListFleetPackagesRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.configdelivery.v1.FleetPackage], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.FleetPackage]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L543} + /// [google.cloud.configdelivery.v1.ListFleetPackagesRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L999} + /// + // clang-format on + StreamRange + ListFleetPackages( + google::cloud::configdelivery::v1::ListFleetPackagesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single FleetPackage. + /// + /// @param name Required. Name of the resource + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.configdelivery.v1.FleetPackage]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.FleetPackage]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L543} + /// [google.cloud.configdelivery.v1.GetFleetPackageRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1036} + /// + // clang-format on + StatusOr GetFleetPackage( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single FleetPackage. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.GetFleetPackageRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.configdelivery.v1.FleetPackage]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.FleetPackage]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L543} + /// [google.cloud.configdelivery.v1.GetFleetPackageRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1036} + /// + // clang-format on + StatusOr GetFleetPackage( + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new FleetPackage in a given project and location. + /// + /// @param parent Required. Value for parent. + /// @param fleet_package Required. The resource being created. + /// @param fleet_package_id Required. Id of the requesting object + /// If auto-generating Id server-side, remove this field and + /// fleet_package_id from the method_signature of Create RPC + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.FleetPackage] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.CreateFleetPackageRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1047} + /// [google.cloud.configdelivery.v1.FleetPackage]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L543} + /// + // clang-format on + future> + CreateFleetPackage( + std::string const& parent, + google::cloud::configdelivery::v1::FleetPackage const& fleet_package, + std::string const& fleet_package_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateFleetPackage + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateFleetPackage( + NoAwaitTag, std::string const& parent, + google::cloud::configdelivery::v1::FleetPackage const& fleet_package, + std::string const& fleet_package_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new FleetPackage in a given project and location. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.CreateFleetPackageRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.FleetPackage] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.CreateFleetPackageRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1047} + /// [google.cloud.configdelivery.v1.FleetPackage]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L543} + /// + // clang-format on + future> + CreateFleetPackage( + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateFleetPackage + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateFleetPackage + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + CreateFleetPackage(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single FleetPackage. + /// + /// @param fleet_package Required. The resource being updated + /// @param update_mask Required. Field mask is used to specify the fields to be overwritten in the + /// FleetPackage resource by the update. + /// The fields specified in the update_mask are relative to the resource, not + /// the full request. A field will be overwritten if it is in the mask. If the + /// user does not provide a mask then all fields will be overwritten. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.FleetPackage] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.FleetPackage]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L543} + /// [google.cloud.configdelivery.v1.UpdateFleetPackageRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1084} + /// + // clang-format on + future> + UpdateFleetPackage( + google::cloud::configdelivery::v1::FleetPackage const& fleet_package, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateFleetPackage + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::FleetPackage const& fleet_package, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single FleetPackage. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.UpdateFleetPackageRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.FleetPackage] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.FleetPackage]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L543} + /// [google.cloud.configdelivery.v1.UpdateFleetPackageRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1084} + /// + // clang-format on + future> + UpdateFleetPackage( + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateFleetPackage + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateFleetPackage + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + UpdateFleetPackage(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Deletes a single FleetPackage. + /// + /// @param name Required. Name of the resource + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.OperationMetadata] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.DeleteFleetPackageRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1116} + /// [google.cloud.configdelivery.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1154} + /// + // clang-format on + future> + DeleteFleetPackage(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteFleetPackage + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteFleetPackage( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single FleetPackage. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.DeleteFleetPackageRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.OperationMetadata] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.DeleteFleetPackageRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1116} + /// [google.cloud.configdelivery.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1154} + /// + // clang-format on + future> + DeleteFleetPackage( + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteFleetPackage + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteFleetPackage + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + DeleteFleetPackage(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists Releases in a given project and location. + /// + /// @param parent Required. Parent value for ListReleasesRequest. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.configdelivery.v1.Release], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.ListReleasesRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1428} + /// [google.cloud.configdelivery.v1.Release]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1185} + /// + // clang-format on + StreamRange ListReleases( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Releases in a given project and location. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.ListReleasesRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.configdelivery.v1.Release], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.ListReleasesRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1428} + /// [google.cloud.configdelivery.v1.Release]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1185} + /// + // clang-format on + StreamRange ListReleases( + google::cloud::configdelivery::v1::ListReleasesRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Release. + /// + /// @param name Required. Name of the resource + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.configdelivery.v1.Release]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.GetReleaseRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1465} + /// [google.cloud.configdelivery.v1.Release]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1185} + /// + // clang-format on + StatusOr GetRelease( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Release. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.GetReleaseRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.configdelivery.v1.Release]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.GetReleaseRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1465} + /// [google.cloud.configdelivery.v1.Release]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1185} + /// + // clang-format on + StatusOr GetRelease( + google::cloud::configdelivery::v1::GetReleaseRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Release in a given project, location and resource bundle. + /// + /// @param parent Required. Value for parent. + /// @param release Required. The resource being created + /// @param release_id Required. Id of the requesting object + /// If auto-generating Id server-side, remove this field and + /// release_id from the method_signature of Create RPC + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.Release] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.CreateReleaseRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1476} + /// [google.cloud.configdelivery.v1.Release]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1185} + /// + // clang-format on + future> CreateRelease( + std::string const& parent, + google::cloud::configdelivery::v1::Release const& release, + std::string const& release_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateRelease + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateRelease( + NoAwaitTag, std::string const& parent, + google::cloud::configdelivery::v1::Release const& release, + std::string const& release_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Release in a given project, location and resource bundle. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.CreateReleaseRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.Release] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.CreateReleaseRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1476} + /// [google.cloud.configdelivery.v1.Release]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1185} + /// + // clang-format on + future> CreateRelease( + google::cloud::configdelivery::v1::CreateReleaseRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateRelease + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateRelease + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> CreateRelease( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Release. + /// + /// @param release Required. The resource being updated + /// @param update_mask Required. Field mask is used to specify the fields to be overwritten in the + /// Release resource by the update. + /// The fields specified in the update_mask are relative to the resource, not + /// the full request. A field will be overwritten if it is in the mask. If the + /// user does not provide a mask then all fields will be overwritten. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.Release] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.Release]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1185} + /// [google.cloud.configdelivery.v1.UpdateReleaseRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1513} + /// + // clang-format on + future> UpdateRelease( + google::cloud::configdelivery::v1::Release const& release, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateRelease + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateRelease( + NoAwaitTag, google::cloud::configdelivery::v1::Release const& release, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Release. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.UpdateReleaseRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.Release] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.Release]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1185} + /// [google.cloud.configdelivery.v1.UpdateReleaseRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1513} + /// + // clang-format on + future> UpdateRelease( + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateRelease + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateRelease + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> UpdateRelease( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Release. + /// + /// @param name Required. Name of the resource + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.OperationMetadata] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.DeleteReleaseRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1545} + /// [google.cloud.configdelivery.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1154} + /// + // clang-format on + future> + DeleteRelease(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteRelease + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteRelease( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Release. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.DeleteReleaseRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.OperationMetadata] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.DeleteReleaseRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1545} + /// [google.cloud.configdelivery.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1154} + /// + // clang-format on + future> + DeleteRelease( + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteRelease + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteRelease + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + DeleteRelease(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists Variants in a given project and location. + /// + /// @param parent Required. Parent value for ListVariantsRequest. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.configdelivery.v1.Variant], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.ListVariantsRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1271} + /// [google.cloud.configdelivery.v1.Variant]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1238} + /// + // clang-format on + StreamRange ListVariants( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Variants in a given project and location. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.ListVariantsRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.configdelivery.v1.Variant], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.ListVariantsRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1271} + /// [google.cloud.configdelivery.v1.Variant]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1238} + /// + // clang-format on + StreamRange ListVariants( + google::cloud::configdelivery::v1::ListVariantsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Variant. + /// + /// @param name Required. Name of the resource + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.configdelivery.v1.Variant]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.GetVariantRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1308} + /// [google.cloud.configdelivery.v1.Variant]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1238} + /// + // clang-format on + StatusOr GetVariant( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Variant. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.GetVariantRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.configdelivery.v1.Variant]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.GetVariantRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1308} + /// [google.cloud.configdelivery.v1.Variant]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1238} + /// + // clang-format on + StatusOr GetVariant( + google::cloud::configdelivery::v1::GetVariantRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Creates a new Variant in a given project, location, resource bundle, and + /// release. + /// + /// @param parent Required. Value for parent. + /// @param variant Required. The resource being created + /// @param variant_id Required. Id of the requesting object + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.Variant] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.CreateVariantRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1319} + /// [google.cloud.configdelivery.v1.Variant]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1238} + /// + // clang-format on + future> CreateVariant( + std::string const& parent, + google::cloud::configdelivery::v1::Variant const& variant, + std::string const& variant_id, Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateVariant + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateVariant( + NoAwaitTag, std::string const& parent, + google::cloud::configdelivery::v1::Variant const& variant, + std::string const& variant_id, Options opts = {}); + + // clang-format off + /// + /// Creates a new Variant in a given project, location, resource bundle, and + /// release. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.CreateVariantRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.Variant] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.CreateVariantRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1319} + /// [google.cloud.configdelivery.v1.Variant]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1238} + /// + // clang-format on + future> CreateVariant( + google::cloud::configdelivery::v1::CreateVariantRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateVariant + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr CreateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateVariantRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief CreateVariant + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> CreateVariant( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Variant. + /// + /// @param variant Required. The resource being updated + /// @param update_mask Optional. Field mask is used to specify the fields to be overwritten in the + /// Variant resource by the update. + /// The fields specified in the update_mask are relative to the resource, not + /// the full request. A field will be overwritten if it is in the mask. If the + /// user does not provide a mask then all fields will be overwritten. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.Variant] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.UpdateVariantRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1354} + /// [google.cloud.configdelivery.v1.Variant]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1238} + /// + // clang-format on + future> UpdateVariant( + google::cloud::configdelivery::v1::Variant const& variant, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateVariant + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateVariant( + NoAwaitTag, google::cloud::configdelivery::v1::Variant const& variant, + google::protobuf::FieldMask const& update_mask, Options opts = {}); + + // clang-format off + /// + /// Updates the parameters of a single Variant. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.UpdateVariantRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.Variant] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.UpdateVariantRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1354} + /// [google.cloud.configdelivery.v1.Variant]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1238} + /// + // clang-format on + future> UpdateVariant( + google::cloud::configdelivery::v1::UpdateVariantRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateVariant + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr UpdateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief UpdateVariant + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> UpdateVariant( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Variant. + /// + /// @param name Required. Name of the resource + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.OperationMetadata] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.DeleteVariantRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1386} + /// [google.cloud.configdelivery.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1154} + /// + // clang-format on + future> + DeleteVariant(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteVariant + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteVariant( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a single Variant. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.DeleteVariantRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.OperationMetadata] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.DeleteVariantRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1386} + /// [google.cloud.configdelivery.v1.OperationMetadata]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1154} + /// + // clang-format on + future> + DeleteVariant( + google::cloud::configdelivery::v1::DeleteVariantRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteVariant + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr DeleteVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief DeleteVariant + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> + DeleteVariant(google::longrunning::Operation const& operation, + Options opts = {}); + + // clang-format off + /// + /// Lists Rollouts in a given project, location, and Fleet Package. + /// + /// @param parent Required. Parent value for ListRolloutsRequest + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.configdelivery.v1.Rollout], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.ListRolloutsRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1579} + /// [google.cloud.configdelivery.v1.Rollout]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1681} + /// + // clang-format on + StreamRange ListRollouts( + std::string const& parent, Options opts = {}); + + // clang-format off + /// + /// Lists Rollouts in a given project, location, and Fleet Package. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.ListRolloutsRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.configdelivery.v1.Rollout], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.ListRolloutsRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1579} + /// [google.cloud.configdelivery.v1.Rollout]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1681} + /// + // clang-format on + StreamRange ListRollouts( + google::cloud::configdelivery::v1::ListRolloutsRequest request, + Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Rollout. + /// + /// @param name Required. Name of the resource + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.configdelivery.v1.Rollout]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.GetRolloutRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1616} + /// [google.cloud.configdelivery.v1.Rollout]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1681} + /// + // clang-format on + StatusOr GetRollout( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Gets details of a single Rollout. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.GetRolloutRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.configdelivery.v1.Rollout]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.GetRolloutRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1616} + /// [google.cloud.configdelivery.v1.Rollout]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1681} + /// + // clang-format on + StatusOr GetRollout( + google::cloud::configdelivery::v1::GetRolloutRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Suspend a Rollout. + /// + /// @param name Required. Name of the Rollout. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.Rollout] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.Rollout]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1681} + /// [google.cloud.configdelivery.v1.SuspendRolloutRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1717} + /// + // clang-format on + future> SuspendRollout( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief SuspendRollout + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr SuspendRollout( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Suspend a Rollout. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.SuspendRolloutRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.Rollout] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.Rollout]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1681} + /// [google.cloud.configdelivery.v1.SuspendRolloutRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1717} + /// + // clang-format on + future> SuspendRollout( + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief SuspendRollout + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr SuspendRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief SuspendRollout + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> SuspendRollout( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Resume a Rollout. + /// + /// @param name Required. Name of the Rollout. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.Rollout] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.ResumeRolloutRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1731} + /// [google.cloud.configdelivery.v1.Rollout]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1681} + /// + // clang-format on + future> ResumeRollout( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief ResumeRollout + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr ResumeRollout( + NoAwaitTag, std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Resume a Rollout. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.ResumeRolloutRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.Rollout] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.ResumeRolloutRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1731} + /// [google.cloud.configdelivery.v1.Rollout]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1681} + /// + // clang-format on + future> ResumeRollout( + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ResumeRollout + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr ResumeRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief ResumeRollout + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> ResumeRollout( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Abort a Rollout. + /// + /// @param name Required. Name of the Rollout. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.Rollout] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.AbortRolloutRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1745} + /// [google.cloud.configdelivery.v1.Rollout]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1681} + /// + // clang-format on + future> AbortRollout( + std::string const& name, Options opts = {}); + + // clang-format off + /// + /// @copybrief AbortRollout + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr AbortRollout(NoAwaitTag, + std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Abort a Rollout. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.configdelivery.v1.AbortRolloutRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return A [`future`] that becomes satisfied when the LRO + /// ([Long Running Operation]) completes or the polling policy in effect + /// for this call is exhausted. The future is satisfied with an error if + /// the LRO completes with an error or the polling policy is exhausted. + /// In this case the [`StatusOr`] returned by the future contains the + /// error. If the LRO completes successfully the value of the future + /// contains the LRO's result. For this RPC the result is a + /// [google.cloud.configdelivery.v1.Rollout] proto message. + /// The C++ class representing this message is created by Protobuf, using + /// the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [Long Running Operation]: https://google.aip.dev/151 + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.configdelivery.v1.AbortRolloutRequest]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1745} + /// [google.cloud.configdelivery.v1.Rollout]: @googleapis_reference_link{google/cloud/configdelivery/v1/config_delivery.proto#L1681} + /// + // clang-format on + future> AbortRollout( + google::cloud::configdelivery::v1::AbortRolloutRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief AbortRollout + /// + /// Specifying the [`NoAwaitTag`] immediately returns the + /// [`google::longrunning::Operation`] that corresponds to the Long Running + /// Operation that has been started. No polling for operation status occurs. + /// + /// [`NoAwaitTag`]: @ref google::cloud::NoAwaitTag + /// + // clang-format on + StatusOr AbortRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// @copybrief AbortRollout + /// + /// This method accepts a `google::longrunning::Operation` that corresponds + /// to a previously started Long Running Operation (LRO) and polls the status + /// of the LRO in the background. + /// + // clang-format on + future> AbortRollout( + google::longrunning::Operation const& operation, Options opts = {}); + + // clang-format off + /// + /// Lists information about the supported locations for this service. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.location.ListLocationsRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.cloud.location.Location], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.location.ListLocationsRequest]: @googleapis_reference_link{google/cloud/location/locations.proto#L58} + /// [google.cloud.location.Location]: @googleapis_reference_link{google/cloud/location/locations.proto#L88} + /// + // clang-format on + StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request, Options opts = {}); + + // clang-format off + /// + /// Gets information about a location. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.cloud.location.GetLocationRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.cloud.location.Location]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.cloud.location.GetLocationRequest]: @googleapis_reference_link{google/cloud/location/locations.proto#L82} + /// [google.cloud.location.Location]: @googleapis_reference_link{google/cloud/location/locations.proto#L88} + /// + // clang-format on + StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Lists operations that match the specified filter in the request. If the + /// server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// @param name The name of the operation's parent resource. + /// @param filter The standard list filter. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.longrunning.Operation], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.ListOperationsRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L167} + /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L121} + /// + // clang-format on + StreamRange ListOperations( + std::string const& name, std::string const& filter, Options opts = {}); + + // clang-format off + /// + /// Lists operations that match the specified filter in the request. If the + /// server doesn't support this method, it returns `UNIMPLEMENTED`. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.longrunning.ListOperationsRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [StreamRange](@ref google::cloud::StreamRange) + /// to iterate of the results. See the documentation of this type for + /// details. In brief, this class has `begin()` and `end()` member + /// functions returning a iterator class meeting the + /// [input iterator requirements]. The value type for this iterator is a + /// [`StatusOr`] as the iteration may fail even after some values are + /// retrieved successfully, for example, if there is a network disconnect. + /// An empty set of results does not indicate an error, it indicates + /// that there are no resources meeting the request criteria. + /// On a successful iteration the `StatusOr` contains elements of type + /// [google.longrunning.Operation], or rather, + /// the C++ class generated by Protobuf from that type. Please consult the + /// Protobuf documentation for details on the [Protobuf mapping rules]. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.ListOperationsRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L167} + /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L121} + /// + // clang-format on + StreamRange ListOperations( + google::longrunning::ListOperationsRequest request, Options opts = {}); + + // clang-format off + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// @param name The name of the operation resource. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.longrunning.Operation]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.GetOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L160} + /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L121} + /// + // clang-format on + StatusOr GetOperation(std::string const& name, + Options opts = {}); + + // clang-format off + /// + /// Gets the latest state of a long-running operation. Clients can use this + /// method to poll the operation result at intervals as recommended by the API + /// service. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.longrunning.GetOperationRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return the result of the RPC. The response message type + /// ([google.longrunning.Operation]) + /// is mapped to a C++ class using the [Protobuf mapping rules]. + /// If the request fails, the [`StatusOr`] contains the error details. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.GetOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L160} + /// [google.longrunning.Operation]: @googleapis_reference_link{google/longrunning/operations.proto#L121} + /// + // clang-format on + StatusOr GetOperation( + google::longrunning::GetOperationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Deletes a long-running operation. This method indicates that the client is + /// no longer interested in the operation result. It does not cancel the + /// operation. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. + /// + /// @param name The name of the operation resource to be deleted. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [`Status`] object. If the request failed, the + /// status contains the details of the failure. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.DeleteOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L200} + /// + // clang-format on + Status DeleteOperation(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Deletes a long-running operation. This method indicates that the client is + /// no longer interested in the operation result. It does not cancel the + /// operation. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.longrunning.DeleteOperationRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [`Status`] object. If the request failed, the + /// status contains the details of the failure. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.DeleteOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L200} + /// + // clang-format on + Status DeleteOperation( + google::longrunning::DeleteOperationRequest const& request, + Options opts = {}); + + // clang-format off + /// + /// Starts asynchronous cancellation on a long-running operation. The server + /// makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use + /// [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + /// other methods to check whether the cancellation succeeded or whether the + /// operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with + /// an [Operation.error][google.longrunning.Operation.error] value with a + /// [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + /// `Code.CANCELLED`. + /// + /// @param name The name of the operation resource to be cancelled. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [`Status`] object. If the request failed, the + /// status contains the details of the failure. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L193} + /// [google.longrunning.Operation.error]: @googleapis_reference_link{google/longrunning/operations.proto#L144} + /// [google.longrunning.Operations.GetOperation]: @googleapis_reference_link{google/longrunning/operations.proto#L70} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// + // clang-format on + Status CancelOperation(std::string const& name, Options opts = {}); + + // clang-format off + /// + /// Starts asynchronous cancellation on a long-running operation. The server + /// makes a best effort to cancel the operation, but success is not + /// guaranteed. If the server doesn't support this method, it returns + /// `google.rpc.Code.UNIMPLEMENTED`. Clients can use + /// [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + /// other methods to check whether the cancellation succeeded or whether the + /// operation completed despite cancellation. On successful cancellation, + /// the operation is not deleted; instead, it becomes an operation with + /// an [Operation.error][google.longrunning.Operation.error] value with a + /// [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + /// `Code.CANCELLED`. + /// + /// @param request Unary RPCs, such as the one wrapped by this + /// function, receive a single `request` proto message which includes all + /// the inputs for the RPC. In this case, the proto message is a + /// [google.longrunning.CancelOperationRequest]. + /// Proto messages are converted to C++ classes by Protobuf, using the + /// [Protobuf mapping rules]. + /// @param opts Optional. Override the class-level options, such as retry and + /// backoff policies. + /// @return a [`Status`] object. If the request failed, the + /// status contains the details of the failure. + /// + /// [Protobuf mapping rules]: https://protobuf.dev/reference/cpp/cpp-generated/ + /// [input iterator requirements]: https://en.cppreference.com/w/cpp/named_req/InputIterator + /// [`std::string`]: https://en.cppreference.com/w/cpp/string/basic_string + /// [`future`]: @ref google::cloud::future + /// [`StatusOr`]: @ref google::cloud::StatusOr + /// [`Status`]: @ref google::cloud::Status + /// [google.longrunning.CancelOperationRequest]: @googleapis_reference_link{google/longrunning/operations.proto#L193} + /// [google.longrunning.Operation.error]: @googleapis_reference_link{google/longrunning/operations.proto#L144} + /// [google.longrunning.Operations.GetOperation]: @googleapis_reference_link{google/longrunning/operations.proto#L70} + /// [google.rpc.Status.code]: @googleapis_reference_link{google/rpc/status.proto#L38} + /// + // clang-format on + Status CancelOperation( + google::longrunning::CancelOperationRequest const& request, + Options opts = {}); + + private: + std::shared_ptr connection_; + Options options_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_CLIENT_H diff --git a/google/cloud/configdelivery/v1/config_delivery_connection.cc b/google/cloud/configdelivery/v1/config_delivery_connection.cc new file mode 100644 index 0000000000000..e622f6d8e2e66 --- /dev/null +++ b/google/cloud/configdelivery/v1/config_delivery_connection.cc @@ -0,0 +1,519 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#include "google/cloud/configdelivery/v1/config_delivery_connection.h" +#include "google/cloud/configdelivery/v1/config_delivery_options.h" +#include "google/cloud/configdelivery/v1/internal/config_delivery_connection_impl.h" +#include "google/cloud/configdelivery/v1/internal/config_delivery_option_defaults.h" +#include "google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.h" +#include "google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.h" +#include "google/cloud/background_threads.h" +#include "google/cloud/common_options.h" +#include "google/cloud/credentials.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/pagination_range.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ConfigDeliveryConnection::~ConfigDeliveryConnection() = default; + +StreamRange +ConfigDeliveryConnection::ListResourceBundles( + google::cloud::configdelivery::v1:: + ListResourceBundlesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +ConfigDeliveryConnection::GetResourceBundle( + google::cloud::configdelivery::v1::GetResourceBundleRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +ConfigDeliveryConnection::CreateResourceBundle( + google::cloud::configdelivery::v1::CreateResourceBundleRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +ConfigDeliveryConnection::CreateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::CreateResourceBundle( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::UpdateResourceBundle( + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +ConfigDeliveryConnection::UpdateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::UpdateResourceBundle( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::DeleteResourceBundle( + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +ConfigDeliveryConnection::DeleteResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::DeleteResourceBundle( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +ConfigDeliveryConnection::ListFleetPackages( + google::cloud::configdelivery::v1:: + ListFleetPackagesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +ConfigDeliveryConnection::GetFleetPackage( + google::cloud::configdelivery::v1::GetFleetPackageRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +ConfigDeliveryConnection::CreateFleetPackage( + google::cloud::configdelivery::v1::CreateFleetPackageRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +ConfigDeliveryConnection::CreateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::CreateFleetPackage( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::UpdateFleetPackage( + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +ConfigDeliveryConnection::UpdateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::UpdateFleetPackage( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::DeleteFleetPackage( + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +ConfigDeliveryConnection::DeleteFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::DeleteFleetPackage( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +ConfigDeliveryConnection::ListReleases( + google::cloud::configdelivery::v1:: + ListReleasesRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +ConfigDeliveryConnection::GetRelease( + google::cloud::configdelivery::v1::GetReleaseRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +ConfigDeliveryConnection::CreateRelease( + google::cloud::configdelivery::v1::CreateReleaseRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +ConfigDeliveryConnection::CreateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateReleaseRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::CreateRelease(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::UpdateRelease( + google::cloud::configdelivery::v1::UpdateReleaseRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +ConfigDeliveryConnection::UpdateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateReleaseRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::UpdateRelease(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::DeleteRelease( + google::cloud::configdelivery::v1::DeleteReleaseRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +ConfigDeliveryConnection::DeleteRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteReleaseRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::DeleteRelease(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +ConfigDeliveryConnection::ListVariants( + google::cloud::configdelivery::v1:: + ListVariantsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +ConfigDeliveryConnection::GetVariant( + google::cloud::configdelivery::v1::GetVariantRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +ConfigDeliveryConnection::CreateVariant( + google::cloud::configdelivery::v1::CreateVariantRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +ConfigDeliveryConnection::CreateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateVariantRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::CreateVariant(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::UpdateVariant( + google::cloud::configdelivery::v1::UpdateVariantRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +ConfigDeliveryConnection::UpdateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateVariantRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::UpdateVariant(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::DeleteVariant( + google::cloud::configdelivery::v1::DeleteVariantRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +ConfigDeliveryConnection::DeleteVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteVariantRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::DeleteVariant(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +ConfigDeliveryConnection::ListRollouts( + google::cloud::configdelivery::v1:: + ListRolloutsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +ConfigDeliveryConnection::GetRollout( + google::cloud::configdelivery::v1::GetRolloutRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +future> +ConfigDeliveryConnection::SuspendRollout( + google::cloud::configdelivery::v1::SuspendRolloutRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +ConfigDeliveryConnection::SuspendRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::SuspendRolloutRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::SuspendRollout( + google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::ResumeRollout( + google::cloud::configdelivery::v1::ResumeRolloutRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr +ConfigDeliveryConnection::ResumeRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::ResumeRolloutRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::ResumeRollout(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::AbortRollout( + google::cloud::configdelivery::v1::AbortRolloutRequest const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StatusOr ConfigDeliveryConnection::AbortRollout( + NoAwaitTag, google::cloud::configdelivery::v1::AbortRolloutRequest const&) { + return StatusOr( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +future> +ConfigDeliveryConnection::AbortRollout(google::longrunning::Operation const&) { + return google::cloud::make_ready_future< + StatusOr>( + Status(StatusCode::kUnimplemented, "not implemented")); +} + +StreamRange +ConfigDeliveryConnection::ListLocations( + google::cloud::location:: + ListLocationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr +ConfigDeliveryConnection::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +StreamRange +ConfigDeliveryConnection::ListOperations( + google::longrunning:: + ListOperationsRequest) { // NOLINT(performance-unnecessary-value-param) + return google::cloud::internal::MakeUnimplementedPaginationRange< + StreamRange>(); +} + +StatusOr ConfigDeliveryConnection::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status ConfigDeliveryConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +Status ConfigDeliveryConnection::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Status(StatusCode::kUnimplemented, "not implemented"); +} + +std::shared_ptr MakeConfigDeliveryConnection( + Options options) { + internal::CheckExpectedOptions(options, + __func__); + options = configdelivery_v1_internal::ConfigDeliveryDefaultOptions( + std::move(options)); + auto background = internal::MakeBackgroundThreadsFactory(options)(); + auto auth = internal::CreateAuthenticationStrategy(background->cq(), options); + auto stub = configdelivery_v1_internal::CreateDefaultConfigDeliveryStub( + std::move(auth), options); + return configdelivery_v1_internal::MakeConfigDeliveryTracingConnection( + std::make_shared< + configdelivery_v1_internal::ConfigDeliveryConnectionImpl>( + std::move(background), std::move(stub), std::move(options))); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/configdelivery/v1/config_delivery_connection.h b/google/cloud/configdelivery/v1/config_delivery_connection.h new file mode 100644 index 0000000000000..d462068e43eec --- /dev/null +++ b/google/cloud/configdelivery/v1/config_delivery_connection.h @@ -0,0 +1,449 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_CONNECTION_H + +#include "google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.h" +#include "google/cloud/configdelivery/v1/internal/config_delivery_retry_traits.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/future.h" +#include "google/cloud/internal/retry_policy_impl.h" +#include "google/cloud/no_await_tag.h" +#include "google/cloud/options.h" +#include "google/cloud/polling_policy.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// The retry policy for `ConfigDeliveryConnection`. +class ConfigDeliveryRetryPolicy : public ::google::cloud::RetryPolicy { + public: + /// Creates a new instance of the policy, reset to the initial state. + virtual std::unique_ptr clone() const = 0; +}; + +/** + * A retry policy for `ConfigDeliveryConnection` based on counting errors. + * + * This policy stops retrying if: + * - An RPC returns a non-transient error. + * - More than a prescribed number of transient failures is detected. + * + * In this class the following status codes are treated as transient errors: + * - [`kUnavailable`](@ref google::cloud::StatusCode) + */ +class ConfigDeliveryLimitedErrorCountRetryPolicy + : public ConfigDeliveryRetryPolicy { + public: + /** + * Create an instance that tolerates up to @p maximum_failures transient + * errors. + * + * @note Disable the retry loop by providing an instance of this policy with + * @p maximum_failures == 0. + */ + explicit ConfigDeliveryLimitedErrorCountRetryPolicy(int maximum_failures) + : impl_(maximum_failures) {} + + ConfigDeliveryLimitedErrorCountRetryPolicy( + ConfigDeliveryLimitedErrorCountRetryPolicy&& rhs) noexcept + : ConfigDeliveryLimitedErrorCountRetryPolicy(rhs.maximum_failures()) {} + ConfigDeliveryLimitedErrorCountRetryPolicy( + ConfigDeliveryLimitedErrorCountRetryPolicy const& rhs) noexcept + : ConfigDeliveryLimitedErrorCountRetryPolicy(rhs.maximum_failures()) {} + + int maximum_failures() const { return impl_.maximum_failures(); } + + bool OnFailure(Status const& status) override { + return impl_.OnFailure(status); + } + bool IsExhausted() const override { return impl_.IsExhausted(); } + bool IsPermanentFailure(Status const& status) const override { + return impl_.IsPermanentFailure(status); + } + std::unique_ptr clone() const override { + return std::make_unique( + maximum_failures()); + } + + // This is provided only for backwards compatibility. + using BaseType = ConfigDeliveryRetryPolicy; + + private: + google::cloud::internal::LimitedErrorCountRetryPolicy< + configdelivery_v1_internal::ConfigDeliveryRetryTraits> + impl_; +}; + +/** + * A retry policy for `ConfigDeliveryConnection` based on elapsed time. + * + * This policy stops retrying if: + * - An RPC returns a non-transient error. + * - The elapsed time in the retry loop exceeds a prescribed duration. + * + * In this class the following status codes are treated as transient errors: + * - [`kUnavailable`](@ref google::cloud::StatusCode) + */ +class ConfigDeliveryLimitedTimeRetryPolicy : public ConfigDeliveryRetryPolicy { + public: + /** + * Constructor given a `std::chrono::duration<>` object. + * + * @tparam DurationRep a placeholder to match the `Rep` tparam for @p + * duration's type. The semantics of this template parameter are + * documented in `std::chrono::duration<>`. In brief, the underlying + * arithmetic type used to store the number of ticks. For our purposes it + * is simply a formal parameter. + * @tparam DurationPeriod a placeholder to match the `Period` tparam for @p + * duration's type. The semantics of this template parameter are + * documented in `std::chrono::duration<>`. In brief, the length of the + * tick in seconds, expressed as a `std::ratio<>`. For our purposes it is + * simply a formal parameter. + * @param maximum_duration the maximum time allowed before the policy expires. + * While the application can express this time in any units they desire, + * the class truncates to milliseconds. + * + * @see https://en.cppreference.com/w/cpp/chrono/duration for more information + * about `std::chrono::duration`. + */ + template + explicit ConfigDeliveryLimitedTimeRetryPolicy( + std::chrono::duration maximum_duration) + : impl_(maximum_duration) {} + + ConfigDeliveryLimitedTimeRetryPolicy( + ConfigDeliveryLimitedTimeRetryPolicy&& rhs) noexcept + : ConfigDeliveryLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + ConfigDeliveryLimitedTimeRetryPolicy( + ConfigDeliveryLimitedTimeRetryPolicy const& rhs) noexcept + : ConfigDeliveryLimitedTimeRetryPolicy(rhs.maximum_duration()) {} + + std::chrono::milliseconds maximum_duration() const { + return impl_.maximum_duration(); + } + + bool OnFailure(Status const& status) override { + return impl_.OnFailure(status); + } + bool IsExhausted() const override { return impl_.IsExhausted(); } + bool IsPermanentFailure(Status const& status) const override { + return impl_.IsPermanentFailure(status); + } + std::unique_ptr clone() const override { + return std::make_unique( + maximum_duration()); + } + + // This is provided only for backwards compatibility. + using BaseType = ConfigDeliveryRetryPolicy; + + private: + google::cloud::internal::LimitedTimeRetryPolicy< + configdelivery_v1_internal::ConfigDeliveryRetryTraits> + impl_; +}; + +/** + * The `ConfigDeliveryConnection` object for `ConfigDeliveryClient`. + * + * This interface defines virtual methods for each of the user-facing overload + * sets in `ConfigDeliveryClient`. This allows users to inject custom behavior + * (e.g., with a Google Mock object) when writing tests that use objects of type + * `ConfigDeliveryClient`. + * + * To create a concrete instance, see `MakeConfigDeliveryConnection()`. + * + * For mocking, see `configdelivery_v1_mocks::MockConfigDeliveryConnection`. + */ +class ConfigDeliveryConnection { + public: + virtual ~ConfigDeliveryConnection() = 0; + + virtual Options options() { return Options{}; } + + virtual StreamRange + ListResourceBundles( + google::cloud::configdelivery::v1::ListResourceBundlesRequest request); + + virtual StatusOr + GetResourceBundle( + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request); + + virtual future> + CreateResourceBundle( + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request); + + virtual StatusOr CreateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request); + + virtual future> + CreateResourceBundle(google::longrunning::Operation const& operation); + + virtual future> + UpdateResourceBundle( + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request); + + virtual StatusOr UpdateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request); + + virtual future> + UpdateResourceBundle(google::longrunning::Operation const& operation); + + virtual future> + DeleteResourceBundle( + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request); + + virtual StatusOr DeleteResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request); + + virtual future> + DeleteResourceBundle(google::longrunning::Operation const& operation); + + virtual StreamRange + ListFleetPackages( + google::cloud::configdelivery::v1::ListFleetPackagesRequest request); + + virtual StatusOr + GetFleetPackage( + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request); + + virtual future> + CreateFleetPackage( + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request); + + virtual StatusOr CreateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request); + + virtual future> + CreateFleetPackage(google::longrunning::Operation const& operation); + + virtual future> + UpdateFleetPackage( + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request); + + virtual StatusOr UpdateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request); + + virtual future> + UpdateFleetPackage(google::longrunning::Operation const& operation); + + virtual future> + DeleteFleetPackage( + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request); + + virtual StatusOr DeleteFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request); + + virtual future> + DeleteFleetPackage(google::longrunning::Operation const& operation); + + virtual StreamRange ListReleases( + google::cloud::configdelivery::v1::ListReleasesRequest request); + + virtual StatusOr GetRelease( + google::cloud::configdelivery::v1::GetReleaseRequest const& request); + + virtual future> + CreateRelease( + google::cloud::configdelivery::v1::CreateReleaseRequest const& request); + + virtual StatusOr CreateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request); + + virtual future> + CreateRelease(google::longrunning::Operation const& operation); + + virtual future> + UpdateRelease( + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request); + + virtual StatusOr UpdateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request); + + virtual future> + UpdateRelease(google::longrunning::Operation const& operation); + + virtual future> + DeleteRelease( + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request); + + virtual StatusOr DeleteRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request); + + virtual future> + DeleteRelease(google::longrunning::Operation const& operation); + + virtual StreamRange ListVariants( + google::cloud::configdelivery::v1::ListVariantsRequest request); + + virtual StatusOr GetVariant( + google::cloud::configdelivery::v1::GetVariantRequest const& request); + + virtual future> + CreateVariant( + google::cloud::configdelivery::v1::CreateVariantRequest const& request); + + virtual StatusOr CreateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateVariantRequest const& request); + + virtual future> + CreateVariant(google::longrunning::Operation const& operation); + + virtual future> + UpdateVariant( + google::cloud::configdelivery::v1::UpdateVariantRequest const& request); + + virtual StatusOr UpdateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request); + + virtual future> + UpdateVariant(google::longrunning::Operation const& operation); + + virtual future> + DeleteVariant( + google::cloud::configdelivery::v1::DeleteVariantRequest const& request); + + virtual StatusOr DeleteVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request); + + virtual future> + DeleteVariant(google::longrunning::Operation const& operation); + + virtual StreamRange ListRollouts( + google::cloud::configdelivery::v1::ListRolloutsRequest request); + + virtual StatusOr GetRollout( + google::cloud::configdelivery::v1::GetRolloutRequest const& request); + + virtual future> + SuspendRollout( + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request); + + virtual StatusOr SuspendRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request); + + virtual future> + SuspendRollout(google::longrunning::Operation const& operation); + + virtual future> + ResumeRollout( + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request); + + virtual StatusOr ResumeRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request); + + virtual future> + ResumeRollout(google::longrunning::Operation const& operation); + + virtual future> + AbortRollout( + google::cloud::configdelivery::v1::AbortRolloutRequest const& request); + + virtual StatusOr AbortRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request); + + virtual future> + AbortRollout(google::longrunning::Operation const& operation); + + virtual StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request); + + virtual StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request); + + virtual StreamRange ListOperations( + google::longrunning::ListOperationsRequest request); + + virtual StatusOr GetOperation( + google::longrunning::GetOperationRequest const& request); + + virtual Status DeleteOperation( + google::longrunning::DeleteOperationRequest const& request); + + virtual Status CancelOperation( + google::longrunning::CancelOperationRequest const& request); +}; + +/** + * A factory function to construct an object of type `ConfigDeliveryConnection`. + * + * The returned connection object should not be used directly; instead it + * should be passed as an argument to the constructor of ConfigDeliveryClient. + * + * The optional @p options argument may be used to configure aspects of the + * returned `ConfigDeliveryConnection`. Expected options are any of the types in + * the following option lists: + * + * - `google::cloud::CommonOptionList` + * - `google::cloud::GrpcOptionList` + * - `google::cloud::UnifiedCredentialsOptionList` + * - `google::cloud::configdelivery_v1::ConfigDeliveryPolicyOptionList` + * + * @note Unexpected options will be ignored. To log unexpected options instead, + * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment. + * + * @param options (optional) Configure the `ConfigDeliveryConnection` created by + * this function. + */ +std::shared_ptr MakeConfigDeliveryConnection( + Options options = {}); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_CONNECTION_H diff --git a/google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.cc b/google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.cc new file mode 100644 index 0000000000000..27cb47503cf54 --- /dev/null +++ b/google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.cc @@ -0,0 +1,200 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#include "google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.h" +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +using ::google::cloud::Idempotency; + +ConfigDeliveryConnectionIdempotencyPolicy:: + ~ConfigDeliveryConnectionIdempotencyPolicy() = default; + +std::unique_ptr +ConfigDeliveryConnectionIdempotencyPolicy::clone() const { + return std::make_unique(*this); +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::ListResourceBundles( + google::cloud::configdelivery::v1::ListResourceBundlesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::GetResourceBundle( + google::cloud::configdelivery::v1::GetResourceBundleRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::CreateResourceBundle( + google::cloud::configdelivery::v1::CreateResourceBundleRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::UpdateResourceBundle( + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::DeleteResourceBundle( + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::ListFleetPackages( + google::cloud::configdelivery::v1::ListFleetPackagesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::GetFleetPackage( + google::cloud::configdelivery::v1::GetFleetPackageRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::CreateFleetPackage( + google::cloud::configdelivery::v1::CreateFleetPackageRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::UpdateFleetPackage( + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::DeleteFleetPackage( + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::ListReleases( + google::cloud::configdelivery::v1::ListReleasesRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::GetRelease( + google::cloud::configdelivery::v1::GetReleaseRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::CreateRelease( + google::cloud::configdelivery::v1::CreateReleaseRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::UpdateRelease( + google::cloud::configdelivery::v1::UpdateReleaseRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::DeleteRelease( + google::cloud::configdelivery::v1::DeleteReleaseRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::ListVariants( + google::cloud::configdelivery::v1::ListVariantsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::GetVariant( + google::cloud::configdelivery::v1::GetVariantRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::CreateVariant( + google::cloud::configdelivery::v1::CreateVariantRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::UpdateVariant( + google::cloud::configdelivery::v1::UpdateVariantRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::DeleteVariant( + google::cloud::configdelivery::v1::DeleteVariantRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::ListRollouts( + google::cloud::configdelivery::v1::ListRolloutsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::GetRollout( + google::cloud::configdelivery::v1::GetRolloutRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::SuspendRollout( + google::cloud::configdelivery::v1::SuspendRolloutRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::ResumeRollout( + google::cloud::configdelivery::v1::ResumeRolloutRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::AbortRollout( + google::cloud::configdelivery::v1::AbortRolloutRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::ListLocations( + google::cloud::location::ListLocationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::GetLocation( + google::cloud::location::GetLocationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::ListOperations( + google::longrunning::ListOperationsRequest) { // NOLINT + return Idempotency::kIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::GetOperation( + google::longrunning::GetOperationRequest const&) { + return Idempotency::kIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::DeleteOperation( + google::longrunning::DeleteOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +Idempotency ConfigDeliveryConnectionIdempotencyPolicy::CancelOperation( + google::longrunning::CancelOperationRequest const&) { + return Idempotency::kNonIdempotent; +} + +std::unique_ptr +MakeDefaultConfigDeliveryConnectionIdempotencyPolicy() { + return std::make_unique(); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1 +} // namespace cloud +} // namespace google diff --git a/google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.h b/google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.h new file mode 100644 index 0000000000000..b0326d395f790 --- /dev/null +++ b/google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.h @@ -0,0 +1,151 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_CONNECTION_IDEMPOTENCY_POLICY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_CONNECTION_IDEMPOTENCY_POLICY_H + +#include "google/cloud/idempotency.h" +#include "google/cloud/version.h" +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ConfigDeliveryConnectionIdempotencyPolicy { + public: + virtual ~ConfigDeliveryConnectionIdempotencyPolicy(); + + /// Create a new copy of this object. + virtual std::unique_ptr clone() + const; + + virtual google::cloud::Idempotency ListResourceBundles( + google::cloud::configdelivery::v1::ListResourceBundlesRequest request); + + virtual google::cloud::Idempotency GetResourceBundle( + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request); + + virtual google::cloud::Idempotency CreateResourceBundle( + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request); + + virtual google::cloud::Idempotency UpdateResourceBundle( + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request); + + virtual google::cloud::Idempotency DeleteResourceBundle( + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request); + + virtual google::cloud::Idempotency ListFleetPackages( + google::cloud::configdelivery::v1::ListFleetPackagesRequest request); + + virtual google::cloud::Idempotency GetFleetPackage( + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request); + + virtual google::cloud::Idempotency CreateFleetPackage( + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request); + + virtual google::cloud::Idempotency UpdateFleetPackage( + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request); + + virtual google::cloud::Idempotency DeleteFleetPackage( + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request); + + virtual google::cloud::Idempotency ListReleases( + google::cloud::configdelivery::v1::ListReleasesRequest request); + + virtual google::cloud::Idempotency GetRelease( + google::cloud::configdelivery::v1::GetReleaseRequest const& request); + + virtual google::cloud::Idempotency CreateRelease( + google::cloud::configdelivery::v1::CreateReleaseRequest const& request); + + virtual google::cloud::Idempotency UpdateRelease( + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request); + + virtual google::cloud::Idempotency DeleteRelease( + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request); + + virtual google::cloud::Idempotency ListVariants( + google::cloud::configdelivery::v1::ListVariantsRequest request); + + virtual google::cloud::Idempotency GetVariant( + google::cloud::configdelivery::v1::GetVariantRequest const& request); + + virtual google::cloud::Idempotency CreateVariant( + google::cloud::configdelivery::v1::CreateVariantRequest const& request); + + virtual google::cloud::Idempotency UpdateVariant( + google::cloud::configdelivery::v1::UpdateVariantRequest const& request); + + virtual google::cloud::Idempotency DeleteVariant( + google::cloud::configdelivery::v1::DeleteVariantRequest const& request); + + virtual google::cloud::Idempotency ListRollouts( + google::cloud::configdelivery::v1::ListRolloutsRequest request); + + virtual google::cloud::Idempotency GetRollout( + google::cloud::configdelivery::v1::GetRolloutRequest const& request); + + virtual google::cloud::Idempotency SuspendRollout( + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request); + + virtual google::cloud::Idempotency ResumeRollout( + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request); + + virtual google::cloud::Idempotency AbortRollout( + google::cloud::configdelivery::v1::AbortRolloutRequest const& request); + + virtual google::cloud::Idempotency ListLocations( + google::cloud::location::ListLocationsRequest request); + + virtual google::cloud::Idempotency GetLocation( + google::cloud::location::GetLocationRequest const& request); + + virtual google::cloud::Idempotency ListOperations( + google::longrunning::ListOperationsRequest request); + + virtual google::cloud::Idempotency GetOperation( + google::longrunning::GetOperationRequest const& request); + + virtual google::cloud::Idempotency DeleteOperation( + google::longrunning::DeleteOperationRequest const& request); + + virtual google::cloud::Idempotency CancelOperation( + google::longrunning::CancelOperationRequest const& request); +}; + +std::unique_ptr +MakeDefaultConfigDeliveryConnectionIdempotencyPolicy(); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_CONNECTION_IDEMPOTENCY_POLICY_H diff --git a/google/cloud/configdelivery/v1/config_delivery_options.h b/google/cloud/configdelivery/v1/config_delivery_options.h new file mode 100644 index 0000000000000..71b8dcb5d56bc --- /dev/null +++ b/google/cloud/configdelivery/v1/config_delivery_options.h @@ -0,0 +1,87 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_OPTIONS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_OPTIONS_H + +#include "google/cloud/configdelivery/v1/config_delivery_connection.h" +#include "google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1 { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * Use with `google::cloud::Options` to configure the retry policy. + * + * @ingroup google-cloud-configdelivery-options + */ +struct ConfigDeliveryRetryPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the backoff policy. + * + * @ingroup google-cloud-configdelivery-options + */ +struct ConfigDeliveryBackoffPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure which operations are retried. + * + * @ingroup google-cloud-configdelivery-options + */ +struct ConfigDeliveryConnectionIdempotencyPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * Use with `google::cloud::Options` to configure the long-running operations + * polling policy. + * + * @ingroup google-cloud-configdelivery-options + */ +struct ConfigDeliveryPollingPolicyOption { + using Type = std::shared_ptr; +}; + +/** + * The options applicable to ConfigDelivery. + * + * @ingroup google-cloud-configdelivery-options + */ +using ConfigDeliveryPolicyOptionList = + OptionList; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1 +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_CONFIG_DELIVERY_OPTIONS_H diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.cc b/google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.cc new file mode 100644 index 0000000000000..f09273505ba3d --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.cc @@ -0,0 +1,651 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#include "google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.h" +#include +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ConfigDeliveryAuth::ConfigDeliveryAuth( + std::shared_ptr auth, + std::shared_ptr child) + : auth_(std::move(auth)), child_(std::move(child)) {} + +StatusOr +ConfigDeliveryAuth::ListResourceBundles( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListResourceBundlesRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListResourceBundles(context, options, request); +} + +StatusOr +ConfigDeliveryAuth::GetResourceBundle( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetResourceBundle(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncCreateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncCreateResourceBundle(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +ConfigDeliveryAuth::CreateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateResourceBundle(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncUpdateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncUpdateResourceBundle(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +ConfigDeliveryAuth::UpdateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateResourceBundle(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncDeleteResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncDeleteResourceBundle(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr +ConfigDeliveryAuth::DeleteResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteResourceBundle(context, options, request); +} + +StatusOr +ConfigDeliveryAuth::ListFleetPackages( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListFleetPackagesRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListFleetPackages(context, options, request); +} + +StatusOr +ConfigDeliveryAuth::GetFleetPackage( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetFleetPackage(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncCreateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncCreateFleetPackage(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr ConfigDeliveryAuth::CreateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateFleetPackage(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncUpdateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncUpdateFleetPackage(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr ConfigDeliveryAuth::UpdateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateFleetPackage(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncDeleteFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncDeleteFleetPackage(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr ConfigDeliveryAuth::DeleteFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteFleetPackage(context, options, request); +} + +StatusOr +ConfigDeliveryAuth::ListReleases( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListReleasesRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListReleases(context, options, request); +} + +StatusOr +ConfigDeliveryAuth::GetRelease( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetReleaseRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetRelease(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncCreateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncCreateRelease(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr ConfigDeliveryAuth::CreateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateRelease(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncUpdateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncUpdateRelease(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr ConfigDeliveryAuth::UpdateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateRelease(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncDeleteRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncDeleteRelease(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr ConfigDeliveryAuth::DeleteRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteRelease(context, options, request); +} + +StatusOr +ConfigDeliveryAuth::ListVariants( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListVariantsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListVariants(context, options, request); +} + +StatusOr +ConfigDeliveryAuth::GetVariant( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetVariantRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetVariant(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncCreateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncCreateVariant(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr ConfigDeliveryAuth::CreateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CreateVariant(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncUpdateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncUpdateVariant(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr ConfigDeliveryAuth::UpdateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->UpdateVariant(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncDeleteVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncDeleteVariant(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr ConfigDeliveryAuth::DeleteVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteVariant(context, options, request); +} + +StatusOr +ConfigDeliveryAuth::ListRollouts( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListRolloutsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListRollouts(context, options, request); +} + +StatusOr +ConfigDeliveryAuth::GetRollout( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetRolloutRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetRollout(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncSuspendRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncSuspendRollout(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr ConfigDeliveryAuth::SuspendRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->SuspendRollout(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncResumeRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncResumeRollout(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr ConfigDeliveryAuth::ResumeRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ResumeRollout(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncAbortRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncAbortRollout(cq, *std::move(context), + std::move(options), request); + }); +} + +StatusOr ConfigDeliveryAuth::AbortRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->AbortRollout(context, options, request); +} + +StatusOr +ConfigDeliveryAuth::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListLocations(context, options, request); +} + +StatusOr ConfigDeliveryAuth::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetLocation(context, options, request); +} + +StatusOr +ConfigDeliveryAuth::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->ListOperations(context, options, request); +} + +StatusOr ConfigDeliveryAuth::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->GetOperation(context, options, request); +} + +Status ConfigDeliveryAuth::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->DeleteOperation(context, options, request); +} + +Status ConfigDeliveryAuth::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto status = auth_->ConfigureContext(context); + if (!status.ok()) return status; + return child_->CancelOperation(context, options, request); +} + +future> +ConfigDeliveryAuth::AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + using ReturnType = StatusOr; + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) { + return make_ready_future(ReturnType(std::move(context).status())); + } + return child->AsyncGetOperation(cq, *std::move(context), + std::move(options), request); + }); +} + +future ConfigDeliveryAuth::AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return auth_->AsyncConfigureContext(std::move(context)) + .then([cq, child = child_, options = std::move(options), + request](future>> + f) mutable { + auto context = f.get(); + if (!context) return make_ready_future(std::move(context).status()); + return child->AsyncCancelOperation(cq, *std::move(context), + std::move(options), request); + }); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.h b/google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.h new file mode 100644 index 0000000000000..81e7e338c201c --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.h @@ -0,0 +1,320 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_AUTH_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_AUTH_DECORATOR_H + +#include "google/cloud/configdelivery/v1/internal/config_delivery_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/version.h" +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ConfigDeliveryAuth : public ConfigDeliveryStub { + public: + ~ConfigDeliveryAuth() override = default; + ConfigDeliveryAuth( + std::shared_ptr auth, + std::shared_ptr child); + + StatusOr + ListResourceBundles( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListResourceBundlesRequest const& + request) override; + + StatusOr GetResourceBundle( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) override; + + future> AsyncCreateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) override; + + StatusOr CreateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) override; + + future> AsyncUpdateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) override; + + StatusOr UpdateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) override; + + future> AsyncDeleteResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) override; + + StatusOr DeleteResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) override; + + StatusOr + ListFleetPackages( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListFleetPackagesRequest const& + request) override; + + StatusOr GetFleetPackage( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request) + override; + + future> AsyncCreateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) override; + + StatusOr CreateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) override; + + future> AsyncUpdateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) override; + + StatusOr UpdateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) override; + + future> AsyncDeleteFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) override; + + StatusOr DeleteFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) override; + + StatusOr + ListReleases(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListReleasesRequest const& + request) override; + + StatusOr GetRelease( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetReleaseRequest const& request) + override; + + future> AsyncCreateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) + override; + + StatusOr CreateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) + override; + + future> AsyncUpdateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) + override; + + StatusOr UpdateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) + override; + + future> AsyncDeleteRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) + override; + + StatusOr DeleteRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) + override; + + StatusOr + ListVariants(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListVariantsRequest const& + request) override; + + StatusOr GetVariant( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetVariantRequest const& request) + override; + + future> AsyncCreateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) + override; + + StatusOr CreateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) + override; + + future> AsyncUpdateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) + override; + + StatusOr UpdateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) + override; + + future> AsyncDeleteVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) + override; + + StatusOr DeleteVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) + override; + + StatusOr + ListRollouts(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListRolloutsRequest const& + request) override; + + StatusOr GetRollout( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetRolloutRequest const& request) + override; + + future> AsyncSuspendRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) + override; + + StatusOr SuspendRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) + override; + + future> AsyncResumeRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) + override; + + StatusOr ResumeRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) + override; + + future> AsyncAbortRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) + override; + + StatusOr AbortRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) + override; + + StatusOr ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) override; + + StatusOr GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) override; + + StatusOr GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) override; + + Status DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) override; + + future> AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) override; + + future AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) override; + + private: + std::shared_ptr auth_; + std::shared_ptr child_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_AUTH_DECORATOR_H diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_connection_impl.cc b/google/cloud/configdelivery/v1/internal/config_delivery_connection_impl.cc new file mode 100644 index 0000000000000..621d2b9918310 --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_connection_impl.cc @@ -0,0 +1,1867 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#include "google/cloud/configdelivery/v1/internal/config_delivery_connection_impl.h" +#include "google/cloud/configdelivery/v1/internal/config_delivery_option_defaults.h" +#include "google/cloud/background_threads.h" +#include "google/cloud/common_options.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/async_long_running_operation.h" +#include "google/cloud/internal/pagination_range.h" +#include "google/cloud/internal/retry_loop.h" +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN +namespace { + +std::unique_ptr retry_policy( + Options const& options) { + return options.get() + ->clone(); +} + +std::unique_ptr backoff_policy(Options const& options) { + return options.get() + ->clone(); +} + +std::unique_ptr +idempotency_policy(Options const& options) { + return options + .get() + ->clone(); +} + +std::unique_ptr polling_policy(Options const& options) { + return options.get() + ->clone(); +} + +} // namespace + +ConfigDeliveryConnectionImpl::ConfigDeliveryConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options) + : background_(std::move(background)), + stub_(std::move(stub)), + options_(internal::MergeOptions(std::move(options), + ConfigDeliveryConnection::options())) {} + +StreamRange +ConfigDeliveryConnectionImpl::ListResourceBundles( + google::cloud::configdelivery::v1::ListResourceBundlesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListResourceBundles(request); + char const* function_name = __func__; + return google::cloud::internal::MakePaginationRange< + StreamRange>( + current, std::move(request), + [idempotency, function_name, stub = stub_, + retry = std::shared_ptr( + retry_policy(*current)), + backoff = std::shared_ptr(backoff_policy(*current))]( + Options const& options, + google::cloud::configdelivery::v1::ListResourceBundlesRequest const& + r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1:: + ListResourceBundlesRequest const& request) { + return stub->ListResourceBundles(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::configdelivery::v1::ListResourceBundlesResponse r) { + std::vector result( + r.resource_bundles().size()); + auto& messages = *r.mutable_resource_bundles(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +ConfigDeliveryConnectionImpl::GetResourceBundle( + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetResourceBundle(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) { + return stub_->GetResourceBundle(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::CreateResourceBundle( + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateResourceBundle(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::configdelivery::v1::ResourceBundle>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + return stub->AsyncCreateResourceBundle(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::ResourceBundle>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +ConfigDeliveryConnectionImpl::CreateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateResourceBundle(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + return stub_->CreateResourceBundle(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::CreateResourceBundle( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future< + StatusOr>( + internal::InvalidArgumentError( + "operation does not correspond to CreateResourceBundle", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::configdelivery::v1::ResourceBundle>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::ResourceBundle>, + polling_policy(*current), __func__); +} + +future> +ConfigDeliveryConnectionImpl::UpdateResourceBundle( + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateResourceBundle(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::configdelivery::v1::ResourceBundle>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + return stub->AsyncUpdateResourceBundle(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::ResourceBundle>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +ConfigDeliveryConnectionImpl::UpdateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateResourceBundle(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + return stub_->UpdateResourceBundle(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::UpdateResourceBundle( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future< + StatusOr>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateResourceBundle", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::configdelivery::v1::ResourceBundle>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::ResourceBundle>, + polling_policy(*current), __func__); +} + +future> +ConfigDeliveryConnectionImpl::DeleteResourceBundle( + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteResourceBundle(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::configdelivery::v1::OperationMetadata>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + return stub->AsyncDeleteResourceBundle(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultMetadata< + google::cloud::configdelivery::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +ConfigDeliveryConnectionImpl::DeleteResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteResourceBundle(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + return stub_->DeleteResourceBundle(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::DeleteResourceBundle( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future< + StatusOr>( + internal::InvalidArgumentError( + "operation does not correspond to DeleteResourceBundle", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::configdelivery::v1::OperationMetadata>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultMetadata< + google::cloud::configdelivery::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +ConfigDeliveryConnectionImpl::ListFleetPackages( + google::cloud::configdelivery::v1::ListFleetPackagesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListFleetPackages(request); + char const* function_name = __func__; + return google::cloud::internal::MakePaginationRange< + StreamRange>( + current, std::move(request), + [idempotency, function_name, stub = stub_, + retry = std::shared_ptr( + retry_policy(*current)), + backoff = std::shared_ptr(backoff_policy(*current))]( + Options const& options, + google::cloud::configdelivery::v1::ListFleetPackagesRequest const& + r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1:: + ListFleetPackagesRequest const& request) { + return stub->ListFleetPackages(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::configdelivery::v1::ListFleetPackagesResponse r) { + std::vector result( + r.fleet_packages().size()); + auto& messages = *r.mutable_fleet_packages(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +ConfigDeliveryConnectionImpl::GetFleetPackage( + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetFleetPackage(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetFleetPackageRequest const& + request) { + return stub_->GetFleetPackage(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::CreateFleetPackage( + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateFleetPackage(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::configdelivery::v1::FleetPackage>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + return stub->AsyncCreateFleetPackage(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::FleetPackage>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +ConfigDeliveryConnectionImpl::CreateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateFleetPackage(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + return stub_->CreateFleetPackage(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::CreateFleetPackage( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future< + StatusOr>( + internal::InvalidArgumentError( + "operation does not correspond to CreateFleetPackage", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::configdelivery::v1::FleetPackage>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::FleetPackage>, + polling_policy(*current), __func__); +} + +future> +ConfigDeliveryConnectionImpl::UpdateFleetPackage( + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateFleetPackage(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::configdelivery::v1::FleetPackage>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + return stub->AsyncUpdateFleetPackage(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::FleetPackage>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +ConfigDeliveryConnectionImpl::UpdateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateFleetPackage(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + return stub_->UpdateFleetPackage(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::UpdateFleetPackage( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future< + StatusOr>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateFleetPackage", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::configdelivery::v1::FleetPackage>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::FleetPackage>, + polling_policy(*current), __func__); +} + +future> +ConfigDeliveryConnectionImpl::DeleteFleetPackage( + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteFleetPackage(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::configdelivery::v1::OperationMetadata>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + return stub->AsyncDeleteFleetPackage(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultMetadata< + google::cloud::configdelivery::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +ConfigDeliveryConnectionImpl::DeleteFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteFleetPackage(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + return stub_->DeleteFleetPackage(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::DeleteFleetPackage( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future< + StatusOr>( + internal::InvalidArgumentError( + "operation does not correspond to DeleteFleetPackage", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::configdelivery::v1::OperationMetadata>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultMetadata< + google::cloud::configdelivery::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +ConfigDeliveryConnectionImpl::ListReleases( + google::cloud::configdelivery::v1::ListReleasesRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListReleases(request); + char const* function_name = __func__; + return google::cloud::internal::MakePaginationRange< + StreamRange>( + current, std::move(request), + [idempotency, function_name, stub = stub_, + retry = std::shared_ptr( + retry_policy(*current)), + backoff = std::shared_ptr(backoff_policy(*current))]( + Options const& options, + google::cloud::configdelivery::v1::ListReleasesRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListReleasesRequest const& + request) { + return stub->ListReleases(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::configdelivery::v1::ListReleasesResponse r) { + std::vector result( + r.releases().size()); + auto& messages = *r.mutable_releases(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +ConfigDeliveryConnectionImpl::GetRelease( + google::cloud::configdelivery::v1::GetReleaseRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetRelease(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetReleaseRequest const& request) { + return stub_->GetRelease(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::CreateRelease( + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateRelease(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::configdelivery::v1::Release>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& + request) { + return stub->AsyncCreateRelease(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::Release>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +ConfigDeliveryConnectionImpl::CreateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateRelease(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& + request) { + return stub_->CreateRelease(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::CreateRelease( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future< + StatusOr>( + internal::InvalidArgumentError( + "operation does not correspond to CreateRelease", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::configdelivery::v1::Release>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::Release>, + polling_policy(*current), __func__); +} + +future> +ConfigDeliveryConnectionImpl::UpdateRelease( + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateRelease(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::configdelivery::v1::Release>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& + request) { + return stub->AsyncUpdateRelease(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::Release>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +ConfigDeliveryConnectionImpl::UpdateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateRelease(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& + request) { + return stub_->UpdateRelease(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::UpdateRelease( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future< + StatusOr>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateRelease", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::configdelivery::v1::Release>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::Release>, + polling_policy(*current), __func__); +} + +future> +ConfigDeliveryConnectionImpl::DeleteRelease( + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteRelease(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::configdelivery::v1::OperationMetadata>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& + request) { + return stub->AsyncDeleteRelease(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultMetadata< + google::cloud::configdelivery::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +ConfigDeliveryConnectionImpl::DeleteRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteRelease(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& + request) { + return stub_->DeleteRelease(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::DeleteRelease( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future< + StatusOr>( + internal::InvalidArgumentError( + "operation does not correspond to DeleteRelease", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::configdelivery::v1::OperationMetadata>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultMetadata< + google::cloud::configdelivery::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +ConfigDeliveryConnectionImpl::ListVariants( + google::cloud::configdelivery::v1::ListVariantsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListVariants(request); + char const* function_name = __func__; + return google::cloud::internal::MakePaginationRange< + StreamRange>( + current, std::move(request), + [idempotency, function_name, stub = stub_, + retry = std::shared_ptr( + retry_policy(*current)), + backoff = std::shared_ptr(backoff_policy(*current))]( + Options const& options, + google::cloud::configdelivery::v1::ListVariantsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListVariantsRequest const& + request) { + return stub->ListVariants(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::configdelivery::v1::ListVariantsResponse r) { + std::vector result( + r.variants().size()); + auto& messages = *r.mutable_variants(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +ConfigDeliveryConnectionImpl::GetVariant( + google::cloud::configdelivery::v1::GetVariantRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetVariant(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetVariantRequest const& request) { + return stub_->GetVariant(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::CreateVariant( + google::cloud::configdelivery::v1::CreateVariantRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->CreateVariant(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::configdelivery::v1::Variant>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateVariantRequest const& + request) { + return stub->AsyncCreateVariant(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::Variant>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +ConfigDeliveryConnectionImpl::CreateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CreateVariant(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::CreateVariantRequest const& + request) { + return stub_->CreateVariant(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::CreateVariant( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future< + StatusOr>( + internal::InvalidArgumentError( + "operation does not correspond to CreateVariant", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::configdelivery::v1::Variant>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::Variant>, + polling_policy(*current), __func__); +} + +future> +ConfigDeliveryConnectionImpl::UpdateVariant( + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->UpdateVariant(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::configdelivery::v1::Variant>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& + request) { + return stub->AsyncUpdateVariant(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::Variant>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +ConfigDeliveryConnectionImpl::UpdateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->UpdateVariant(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& + request) { + return stub_->UpdateVariant(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::UpdateVariant( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future< + StatusOr>( + internal::InvalidArgumentError( + "operation does not correspond to UpdateVariant", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::configdelivery::v1::Variant>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::Variant>, + polling_policy(*current), __func__); +} + +future> +ConfigDeliveryConnectionImpl::DeleteVariant( + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->DeleteVariant(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::configdelivery::v1::OperationMetadata>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& + request) { + return stub->AsyncDeleteVariant(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultMetadata< + google::cloud::configdelivery::v1::OperationMetadata>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +ConfigDeliveryConnectionImpl::DeleteVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteVariant(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& + request) { + return stub_->DeleteVariant(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::DeleteVariant( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future< + StatusOr>( + internal::InvalidArgumentError( + "operation does not correspond to DeleteVariant", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::configdelivery::v1::OperationMetadata>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultMetadata< + google::cloud::configdelivery::v1::OperationMetadata>, + polling_policy(*current), __func__); +} + +StreamRange +ConfigDeliveryConnectionImpl::ListRollouts( + google::cloud::configdelivery::v1::ListRolloutsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListRollouts(request); + char const* function_name = __func__; + return google::cloud::internal::MakePaginationRange< + StreamRange>( + current, std::move(request), + [idempotency, function_name, stub = stub_, + retry = std::shared_ptr( + retry_policy(*current)), + backoff = std::shared_ptr(backoff_policy(*current))]( + Options const& options, + google::cloud::configdelivery::v1::ListRolloutsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListRolloutsRequest const& + request) { + return stub->ListRollouts(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::configdelivery::v1::ListRolloutsResponse r) { + std::vector result( + r.rollouts().size()); + auto& messages = *r.mutable_rollouts(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +ConfigDeliveryConnectionImpl::GetRollout( + google::cloud::configdelivery::v1::GetRolloutRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetRollout(request), + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetRolloutRequest const& request) { + return stub_->GetRollout(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::SuspendRollout( + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->SuspendRollout(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::configdelivery::v1::Rollout>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& + request) { + return stub->AsyncSuspendRollout(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::Rollout>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +ConfigDeliveryConnectionImpl::SuspendRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->SuspendRollout(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& + request) { + return stub_->SuspendRollout(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::SuspendRollout( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future< + StatusOr>( + internal::InvalidArgumentError( + "operation does not correspond to SuspendRollout", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::configdelivery::v1::Rollout>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::Rollout>, + polling_policy(*current), __func__); +} + +future> +ConfigDeliveryConnectionImpl::ResumeRollout( + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->ResumeRollout(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::configdelivery::v1::Rollout>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& + request) { + return stub->AsyncResumeRollout(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::Rollout>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +ConfigDeliveryConnectionImpl::ResumeRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->ResumeRollout(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& + request) { + return stub_->ResumeRollout(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::ResumeRollout( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future< + StatusOr>( + internal::InvalidArgumentError( + "operation does not correspond to ResumeRollout", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::configdelivery::v1::Rollout>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::Rollout>, + polling_policy(*current), __func__); +} + +future> +ConfigDeliveryConnectionImpl::AbortRollout( + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + auto request_copy = request; + auto const idempotent = + idempotency_policy(*current)->AbortRollout(request_copy); + return google::cloud::internal::AsyncLongRunningOperation< + google::cloud::configdelivery::v1::Rollout>( + background_->cq(), current, std::move(request_copy), + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& + request) { + return stub->AsyncAbortRollout(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::Rollout>, + retry_policy(*current), backoff_policy(*current), idempotent, + polling_policy(*current), __func__); +} + +StatusOr +ConfigDeliveryConnectionImpl::AbortRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->AbortRollout(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& + request) { + return stub_->AbortRollout(context, options, request); + }, + *current, request, __func__); +} + +future> +ConfigDeliveryConnectionImpl::AbortRollout( + google::longrunning::Operation const& operation) { + auto current = google::cloud::internal::SaveCurrentOptions(); + if (!operation.metadata() + .Is()) { + return make_ready_future< + StatusOr>( + internal::InvalidArgumentError( + "operation does not correspond to AbortRollout", + GCP_ERROR_INFO().WithMetadata("operation", + operation.metadata().DebugString()))); + } + + return google::cloud::internal::AsyncAwaitLongRunningOperation< + google::cloud::configdelivery::v1::Rollout>( + background_->cq(), current, operation, + [stub = stub_](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return stub->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + [stub = stub_]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return stub->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + &google::cloud::internal::ExtractLongRunningResultResponse< + google::cloud::configdelivery::v1::Rollout>, + polling_policy(*current), __func__); +} + +StreamRange +ConfigDeliveryConnectionImpl::ListLocations( + google::cloud::location::ListLocationsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListLocations(request); + char const* function_name = __func__; + return google::cloud::internal::MakePaginationRange< + StreamRange>( + current, std::move(request), + [idempotency, function_name, stub = stub_, + retry = std::shared_ptr( + retry_policy(*current)), + backoff = std::shared_ptr(backoff_policy(*current))]( + Options const& options, + google::cloud::location::ListLocationsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub]( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + return stub->ListLocations(context, options, request); + }, + options, r, function_name); + }, + [](google::cloud::location::ListLocationsResponse r) { + std::vector result( + r.locations().size()); + auto& messages = *r.mutable_locations(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +ConfigDeliveryConnectionImpl::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetLocation(request), + [this](grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + return stub_->GetLocation(context, options, request); + }, + *current, request, __func__); +} + +StreamRange +ConfigDeliveryConnectionImpl::ListOperations( + google::longrunning::ListOperationsRequest request) { + request.clear_page_token(); + auto current = google::cloud::internal::SaveCurrentOptions(); + auto idempotency = idempotency_policy(*current)->ListOperations(request); + char const* function_name = __func__; + return google::cloud::internal::MakePaginationRange< + StreamRange>( + current, std::move(request), + [idempotency, function_name, stub = stub_, + retry = std::shared_ptr( + retry_policy(*current)), + backoff = std::shared_ptr(backoff_policy(*current))]( + Options const& options, + google::longrunning::ListOperationsRequest const& r) { + return google::cloud::internal::RetryLoop( + retry->clone(), backoff->clone(), idempotency, + [stub](grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + return stub->ListOperations(context, options, request); + }, + options, r, function_name); + }, + [](google::longrunning::ListOperationsResponse r) { + std::vector result( + r.operations().size()); + auto& messages = *r.mutable_operations(); + std::move(messages.begin(), messages.end(), result.begin()); + return result; + }); +} + +StatusOr +ConfigDeliveryConnectionImpl::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->GetOperation(request), + [this](grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + return stub_->GetOperation(context, options, request); + }, + *current, request, __func__); +} + +Status ConfigDeliveryConnectionImpl::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->DeleteOperation(request), + [this](grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + return stub_->DeleteOperation(context, options, request); + }, + *current, request, __func__); +} + +Status ConfigDeliveryConnectionImpl::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto current = google::cloud::internal::SaveCurrentOptions(); + return google::cloud::internal::RetryLoop( + retry_policy(*current), backoff_policy(*current), + idempotency_policy(*current)->CancelOperation(request), + [this](grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + return stub_->CancelOperation(context, options, request); + }, + *current, request, __func__); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_connection_impl.h b/google/cloud/configdelivery/v1/internal/config_delivery_connection_impl.h new file mode 100644 index 0000000000000..4aa8dda1309a4 --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_connection_impl.h @@ -0,0 +1,311 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_CONNECTION_IMPL_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_CONNECTION_IMPL_H + +#include "google/cloud/configdelivery/v1/config_delivery_connection.h" +#include "google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.h" +#include "google/cloud/configdelivery/v1/config_delivery_options.h" +#include "google/cloud/configdelivery/v1/internal/config_delivery_retry_traits.h" +#include "google/cloud/configdelivery/v1/internal/config_delivery_stub.h" +#include "google/cloud/background_threads.h" +#include "google/cloud/backoff_policy.h" +#include "google/cloud/future.h" +#include "google/cloud/options.h" +#include "google/cloud/polling_policy.h" +#include "google/cloud/status_or.h" +#include "google/cloud/stream_range.h" +#include "google/cloud/version.h" +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ConfigDeliveryConnectionImpl + : public configdelivery_v1::ConfigDeliveryConnection { + public: + ~ConfigDeliveryConnectionImpl() override = default; + + ConfigDeliveryConnectionImpl( + std::unique_ptr background, + std::shared_ptr stub, + Options options); + + Options options() override { return options_; } + + StreamRange + ListResourceBundles( + google::cloud::configdelivery::v1::ListResourceBundlesRequest request) + override; + + StatusOr GetResourceBundle( + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) override; + + future> + CreateResourceBundle( + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) override; + + StatusOr CreateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) override; + + future> + CreateResourceBundle( + google::longrunning::Operation const& operation) override; + + future> + UpdateResourceBundle( + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) override; + + StatusOr UpdateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) override; + + future> + UpdateResourceBundle( + google::longrunning::Operation const& operation) override; + + future> + DeleteResourceBundle( + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) override; + + StatusOr DeleteResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) override; + + future> + DeleteResourceBundle( + google::longrunning::Operation const& operation) override; + + StreamRange + ListFleetPackages(google::cloud::configdelivery::v1::ListFleetPackagesRequest + request) override; + + StatusOr GetFleetPackage( + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request) + override; + + future> + CreateFleetPackage( + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) override; + + StatusOr CreateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) override; + + future> + CreateFleetPackage(google::longrunning::Operation const& operation) override; + + future> + UpdateFleetPackage( + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) override; + + StatusOr UpdateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) override; + + future> + UpdateFleetPackage(google::longrunning::Operation const& operation) override; + + future> + DeleteFleetPackage( + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) override; + + StatusOr DeleteFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) override; + + future> + DeleteFleetPackage(google::longrunning::Operation const& operation) override; + + StreamRange ListReleases( + google::cloud::configdelivery::v1::ListReleasesRequest request) override; + + StatusOr GetRelease( + google::cloud::configdelivery::v1::GetReleaseRequest const& request) + override; + + future> CreateRelease( + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) + override; + + StatusOr CreateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) + override; + + future> CreateRelease( + google::longrunning::Operation const& operation) override; + + future> UpdateRelease( + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) + override; + + StatusOr UpdateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) + override; + + future> UpdateRelease( + google::longrunning::Operation const& operation) override; + + future> + DeleteRelease(google::cloud::configdelivery::v1::DeleteReleaseRequest const& + request) override; + + StatusOr DeleteRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) + override; + + future> + DeleteRelease(google::longrunning::Operation const& operation) override; + + StreamRange ListVariants( + google::cloud::configdelivery::v1::ListVariantsRequest request) override; + + StatusOr GetVariant( + google::cloud::configdelivery::v1::GetVariantRequest const& request) + override; + + future> CreateVariant( + google::cloud::configdelivery::v1::CreateVariantRequest const& request) + override; + + StatusOr CreateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) + override; + + future> CreateVariant( + google::longrunning::Operation const& operation) override; + + future> UpdateVariant( + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) + override; + + StatusOr UpdateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) + override; + + future> UpdateVariant( + google::longrunning::Operation const& operation) override; + + future> + DeleteVariant(google::cloud::configdelivery::v1::DeleteVariantRequest const& + request) override; + + StatusOr DeleteVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) + override; + + future> + DeleteVariant(google::longrunning::Operation const& operation) override; + + StreamRange ListRollouts( + google::cloud::configdelivery::v1::ListRolloutsRequest request) override; + + StatusOr GetRollout( + google::cloud::configdelivery::v1::GetRolloutRequest const& request) + override; + + future> SuspendRollout( + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) + override; + + StatusOr SuspendRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) + override; + + future> SuspendRollout( + google::longrunning::Operation const& operation) override; + + future> ResumeRollout( + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) + override; + + StatusOr ResumeRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) + override; + + future> ResumeRollout( + google::longrunning::Operation const& operation) override; + + future> AbortRollout( + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) + override; + + StatusOr AbortRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) + override; + + future> AbortRollout( + google::longrunning::Operation const& operation) override; + + StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request) override; + + StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request) override; + + StreamRange ListOperations( + google::longrunning::ListOperationsRequest request) override; + + StatusOr GetOperation( + google::longrunning::GetOperationRequest const& request) override; + + Status DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + google::longrunning::CancelOperationRequest const& request) override; + + private: + std::unique_ptr background_; + std::shared_ptr stub_; + Options options_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_CONNECTION_IMPL_H diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.cc b/google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.cc new file mode 100644 index 0000000000000..989c51757fb60 --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.cc @@ -0,0 +1,767 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#include "google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.h" +#include "google/cloud/internal/log_wrapper.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ConfigDeliveryLogging::ConfigDeliveryLogging( + std::shared_ptr child, TracingOptions tracing_options, + std::set const&) + : child_(std::move(child)), tracing_options_(std::move(tracing_options)) {} + +StatusOr +ConfigDeliveryLogging::ListResourceBundles( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListResourceBundlesRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListResourceBundlesRequest const& + request) { + return child_->ListResourceBundles(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::GetResourceBundle( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) { + return child_->GetResourceBundle(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncCreateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + return child_->AsyncCreateResourceBundle(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::CreateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + return child_->CreateResourceBundle(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncUpdateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + return child_->AsyncUpdateResourceBundle(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::UpdateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + return child_->UpdateResourceBundle(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncDeleteResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + return child_->AsyncDeleteResourceBundle(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::DeleteResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + return child_->DeleteResourceBundle(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::ListFleetPackages( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListFleetPackagesRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListFleetPackagesRequest const& + request) { + return child_->ListFleetPackages(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::GetFleetPackage( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetFleetPackageRequest const& + request) { + return child_->GetFleetPackage(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncCreateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + return child_->AsyncCreateFleetPackage(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::CreateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + return child_->CreateFleetPackage(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncUpdateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + return child_->AsyncUpdateFleetPackage(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::UpdateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + return child_->UpdateFleetPackage(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncDeleteFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + return child_->AsyncDeleteFleetPackage(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::DeleteFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + return child_->DeleteFleetPackage(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::ListReleases( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListReleasesRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListReleasesRequest const& + request) { + return child_->ListReleases(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::GetRelease( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetReleaseRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetReleaseRequest const& request) { + return child_->GetRelease(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncCreateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& + request) { + return child_->AsyncCreateRelease(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr ConfigDeliveryLogging::CreateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& + request) { + return child_->CreateRelease(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncUpdateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& + request) { + return child_->AsyncUpdateRelease(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr ConfigDeliveryLogging::UpdateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& + request) { + return child_->UpdateRelease(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncDeleteRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& + request) { + return child_->AsyncDeleteRelease(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr ConfigDeliveryLogging::DeleteRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& + request) { + return child_->DeleteRelease(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::ListVariants( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListVariantsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListVariantsRequest const& + request) { + return child_->ListVariants(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::GetVariant( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetVariantRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetVariantRequest const& request) { + return child_->GetVariant(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncCreateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateVariantRequest const& + request) { + return child_->AsyncCreateVariant(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr ConfigDeliveryLogging::CreateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::CreateVariantRequest const& + request) { + return child_->CreateVariant(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncUpdateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& + request) { + return child_->AsyncUpdateVariant(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr ConfigDeliveryLogging::UpdateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& + request) { + return child_->UpdateVariant(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncDeleteVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& + request) { + return child_->AsyncDeleteVariant(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr ConfigDeliveryLogging::DeleteVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& + request) { + return child_->DeleteVariant(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::ListRollouts( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListRolloutsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListRolloutsRequest const& + request) { + return child_->ListRollouts(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::GetRollout( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetRolloutRequest const& request) { + return google::cloud::internal::LogWrapper( + [this]( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetRolloutRequest const& request) { + return child_->GetRollout(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncSuspendRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& + request) { + return child_->AsyncSuspendRollout(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr ConfigDeliveryLogging::SuspendRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& + request) { + return child_->SuspendRollout(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncResumeRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& + request) { + return child_->AsyncResumeRollout(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr ConfigDeliveryLogging::ResumeRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& + request) { + return child_->ResumeRollout(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncAbortRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& + request) { + return child_->AsyncAbortRollout(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +StatusOr ConfigDeliveryLogging::AbortRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& + request) { + return child_->AbortRollout(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + return child_->ListLocations(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr ConfigDeliveryLogging::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + return child_->GetLocation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr +ConfigDeliveryLogging::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + return child_->ListOperations(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +StatusOr ConfigDeliveryLogging::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + return child_->GetOperation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status ConfigDeliveryLogging::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + return child_->DeleteOperation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +Status ConfigDeliveryLogging::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + return child_->CancelOperation(context, options, request); + }, + context, options, request, __func__, tracing_options_); +} + +future> +ConfigDeliveryLogging::AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + return child_->AsyncGetOperation(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +future ConfigDeliveryLogging::AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return google::cloud::internal::LogWrapper( + [this](google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + return child_->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); + }, + cq, std::move(context), std::move(options), request, __func__, + tracing_options_); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.h b/google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.h new file mode 100644 index 0000000000000..821fa4e395ecd --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.h @@ -0,0 +1,320 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_LOGGING_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_LOGGING_DECORATOR_H + +#include "google/cloud/configdelivery/v1/internal/config_delivery_stub.h" +#include "google/cloud/tracing_options.h" +#include "google/cloud/version.h" +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ConfigDeliveryLogging : public ConfigDeliveryStub { + public: + ~ConfigDeliveryLogging() override = default; + ConfigDeliveryLogging(std::shared_ptr child, + TracingOptions tracing_options, + std::set const& components); + + StatusOr + ListResourceBundles( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListResourceBundlesRequest const& + request) override; + + StatusOr GetResourceBundle( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) override; + + future> AsyncCreateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) override; + + StatusOr CreateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) override; + + future> AsyncUpdateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) override; + + StatusOr UpdateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) override; + + future> AsyncDeleteResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) override; + + StatusOr DeleteResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) override; + + StatusOr + ListFleetPackages( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListFleetPackagesRequest const& + request) override; + + StatusOr GetFleetPackage( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request) + override; + + future> AsyncCreateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) override; + + StatusOr CreateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) override; + + future> AsyncUpdateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) override; + + StatusOr UpdateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) override; + + future> AsyncDeleteFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) override; + + StatusOr DeleteFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) override; + + StatusOr + ListReleases(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListReleasesRequest const& + request) override; + + StatusOr GetRelease( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetReleaseRequest const& request) + override; + + future> AsyncCreateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) + override; + + StatusOr CreateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) + override; + + future> AsyncUpdateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) + override; + + StatusOr UpdateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) + override; + + future> AsyncDeleteRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) + override; + + StatusOr DeleteRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) + override; + + StatusOr + ListVariants(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListVariantsRequest const& + request) override; + + StatusOr GetVariant( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetVariantRequest const& request) + override; + + future> AsyncCreateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) + override; + + StatusOr CreateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) + override; + + future> AsyncUpdateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) + override; + + StatusOr UpdateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) + override; + + future> AsyncDeleteVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) + override; + + StatusOr DeleteVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) + override; + + StatusOr + ListRollouts(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListRolloutsRequest const& + request) override; + + StatusOr GetRollout( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetRolloutRequest const& request) + override; + + future> AsyncSuspendRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) + override; + + StatusOr SuspendRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) + override; + + future> AsyncResumeRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) + override; + + StatusOr ResumeRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) + override; + + future> AsyncAbortRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) + override; + + StatusOr AbortRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) + override; + + StatusOr ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) override; + + StatusOr GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) override; + + StatusOr GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) override; + + Status DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) override; + + future> AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) override; + + future AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) override; + + private: + std::shared_ptr child_; + TracingOptions tracing_options_; +}; // ConfigDeliveryLogging + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_LOGGING_DECORATOR_H diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.cc b/google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.cc new file mode 100644 index 0000000000000..8276552cbc883 --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.cc @@ -0,0 +1,559 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#include "google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/absl_str_cat_quiet.h" +#include "google/cloud/internal/api_client_header.h" +#include "google/cloud/internal/url_encode.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ConfigDeliveryMetadata::ConfigDeliveryMetadata( + std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header) + : child_(std::move(child)), + fixed_metadata_(std::move(fixed_metadata)), + api_client_header_( + api_client_header.empty() + ? google::cloud::internal::GeneratedLibClientHeader() + : std::move(api_client_header)) {} + +StatusOr +ConfigDeliveryMetadata::ListResourceBundles( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListResourceBundlesRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListResourceBundles(context, options, request); +} + +StatusOr +ConfigDeliveryMetadata::GetResourceBundle( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetResourceBundle(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncCreateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateResourceBundle(cq, std::move(context), + std::move(options), request); +} + +StatusOr +ConfigDeliveryMetadata::CreateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateResourceBundle(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncUpdateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + SetMetadata( + *context, *options, + absl::StrCat("resource_bundle.name=", + internal::UrlEncode(request.resource_bundle().name()))); + return child_->AsyncUpdateResourceBundle(cq, std::move(context), + std::move(options), request); +} + +StatusOr +ConfigDeliveryMetadata::UpdateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + SetMetadata( + context, options, + absl::StrCat("resource_bundle.name=", + internal::UrlEncode(request.resource_bundle().name()))); + return child_->UpdateResourceBundle(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncDeleteResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteResourceBundle(cq, std::move(context), + std::move(options), request); +} + +StatusOr +ConfigDeliveryMetadata::DeleteResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteResourceBundle(context, options, request); +} + +StatusOr +ConfigDeliveryMetadata::ListFleetPackages( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListFleetPackagesRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListFleetPackages(context, options, request); +} + +StatusOr +ConfigDeliveryMetadata::GetFleetPackage( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetFleetPackage(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncCreateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateFleetPackage(cq, std::move(context), + std::move(options), request); +} + +StatusOr +ConfigDeliveryMetadata::CreateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateFleetPackage(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncUpdateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + SetMetadata( + *context, *options, + absl::StrCat("fleet_package.name=", + internal::UrlEncode(request.fleet_package().name()))); + return child_->AsyncUpdateFleetPackage(cq, std::move(context), + std::move(options), request); +} + +StatusOr +ConfigDeliveryMetadata::UpdateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + SetMetadata( + context, options, + absl::StrCat("fleet_package.name=", + internal::UrlEncode(request.fleet_package().name()))); + return child_->UpdateFleetPackage(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncDeleteFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteFleetPackage(cq, std::move(context), + std::move(options), request); +} + +StatusOr +ConfigDeliveryMetadata::DeleteFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteFleetPackage(context, options, request); +} + +StatusOr +ConfigDeliveryMetadata::ListReleases( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListReleasesRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListReleases(context, options, request); +} + +StatusOr +ConfigDeliveryMetadata::GetRelease( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetReleaseRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetRelease(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncCreateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateRelease(cq, std::move(context), std::move(options), + request); +} + +StatusOr ConfigDeliveryMetadata::CreateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateRelease(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncUpdateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("release.name=", + internal::UrlEncode(request.release().name()))); + return child_->AsyncUpdateRelease(cq, std::move(context), std::move(options), + request); +} + +StatusOr ConfigDeliveryMetadata::UpdateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) { + SetMetadata(context, options, + absl::StrCat("release.name=", + internal::UrlEncode(request.release().name()))); + return child_->UpdateRelease(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncDeleteRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteRelease(cq, std::move(context), std::move(options), + request); +} + +StatusOr ConfigDeliveryMetadata::DeleteRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteRelease(context, options, request); +} + +StatusOr +ConfigDeliveryMetadata::ListVariants( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListVariantsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListVariants(context, options, request); +} + +StatusOr +ConfigDeliveryMetadata::GetVariant( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetVariantRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetVariant(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncCreateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->AsyncCreateVariant(cq, std::move(context), std::move(options), + request); +} + +StatusOr ConfigDeliveryMetadata::CreateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->CreateVariant(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncUpdateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("variant.name=", + internal::UrlEncode(request.variant().name()))); + return child_->AsyncUpdateVariant(cq, std::move(context), std::move(options), + request); +} + +StatusOr ConfigDeliveryMetadata::UpdateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) { + SetMetadata(context, options, + absl::StrCat("variant.name=", + internal::UrlEncode(request.variant().name()))); + return child_->UpdateVariant(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncDeleteVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncDeleteVariant(cq, std::move(context), std::move(options), + request); +} + +StatusOr ConfigDeliveryMetadata::DeleteVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteVariant(context, options, request); +} + +StatusOr +ConfigDeliveryMetadata::ListRollouts( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListRolloutsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("parent=", internal::UrlEncode(request.parent()))); + return child_->ListRollouts(context, options, request); +} + +StatusOr +ConfigDeliveryMetadata::GetRollout( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetRolloutRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetRollout(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncSuspendRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncSuspendRollout(cq, std::move(context), std::move(options), + request); +} + +StatusOr ConfigDeliveryMetadata::SuspendRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->SuspendRollout(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncResumeRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncResumeRollout(cq, std::move(context), std::move(options), + request); +} + +StatusOr ConfigDeliveryMetadata::ResumeRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->ResumeRollout(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncAbortRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncAbortRollout(cq, std::move(context), std::move(options), + request); +} + +StatusOr ConfigDeliveryMetadata::AbortRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AbortRollout(context, options, request); +} + +StatusOr +ConfigDeliveryMetadata::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->ListLocations(context, options, request); +} + +StatusOr ConfigDeliveryMetadata::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetLocation(context, options, request); +} + +StatusOr +ConfigDeliveryMetadata::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->ListOperations(context, options, request); +} + +StatusOr ConfigDeliveryMetadata::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->GetOperation(context, options, request); +} + +Status ConfigDeliveryMetadata::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->DeleteOperation(context, options, request); +} + +Status ConfigDeliveryMetadata::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + SetMetadata(context, options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->CancelOperation(context, options, request); +} + +future> +ConfigDeliveryMetadata::AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncGetOperation(cq, std::move(context), std::move(options), + request); +} + +future ConfigDeliveryMetadata::AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + SetMetadata(*context, *options, + absl::StrCat("name=", internal::UrlEncode(request.name()))); + return child_->AsyncCancelOperation(cq, std::move(context), + std::move(options), request); +} + +void ConfigDeliveryMetadata::SetMetadata(grpc::ClientContext& context, + Options const& options, + std::string const& request_params) { + context.AddMetadata("x-goog-request-params", request_params); + SetMetadata(context, options); +} + +void ConfigDeliveryMetadata::SetMetadata(grpc::ClientContext& context, + Options const& options) { + google::cloud::internal::SetMetadata(context, options, fixed_metadata_, + api_client_header_); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.h b/google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.h new file mode 100644 index 0000000000000..f76fe9f041eb5 --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.h @@ -0,0 +1,325 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_METADATA_DECORATOR_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_METADATA_DECORATOR_H + +#include "google/cloud/configdelivery/v1/internal/config_delivery_stub.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ConfigDeliveryMetadata : public ConfigDeliveryStub { + public: + ~ConfigDeliveryMetadata() override = default; + ConfigDeliveryMetadata(std::shared_ptr child, + std::multimap fixed_metadata, + std::string api_client_header = ""); + + StatusOr + ListResourceBundles( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListResourceBundlesRequest const& + request) override; + + StatusOr GetResourceBundle( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) override; + + future> AsyncCreateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) override; + + StatusOr CreateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) override; + + future> AsyncUpdateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) override; + + StatusOr UpdateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) override; + + future> AsyncDeleteResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) override; + + StatusOr DeleteResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) override; + + StatusOr + ListFleetPackages( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListFleetPackagesRequest const& + request) override; + + StatusOr GetFleetPackage( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request) + override; + + future> AsyncCreateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) override; + + StatusOr CreateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) override; + + future> AsyncUpdateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) override; + + StatusOr UpdateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) override; + + future> AsyncDeleteFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) override; + + StatusOr DeleteFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) override; + + StatusOr + ListReleases(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListReleasesRequest const& + request) override; + + StatusOr GetRelease( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetReleaseRequest const& request) + override; + + future> AsyncCreateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) + override; + + StatusOr CreateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) + override; + + future> AsyncUpdateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) + override; + + StatusOr UpdateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) + override; + + future> AsyncDeleteRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) + override; + + StatusOr DeleteRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) + override; + + StatusOr + ListVariants(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListVariantsRequest const& + request) override; + + StatusOr GetVariant( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetVariantRequest const& request) + override; + + future> AsyncCreateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) + override; + + StatusOr CreateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) + override; + + future> AsyncUpdateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) + override; + + StatusOr UpdateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) + override; + + future> AsyncDeleteVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) + override; + + StatusOr DeleteVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) + override; + + StatusOr + ListRollouts(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListRolloutsRequest const& + request) override; + + StatusOr GetRollout( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetRolloutRequest const& request) + override; + + future> AsyncSuspendRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) + override; + + StatusOr SuspendRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) + override; + + future> AsyncResumeRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) + override; + + StatusOr ResumeRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) + override; + + future> AsyncAbortRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) + override; + + StatusOr AbortRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) + override; + + StatusOr ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) override; + + StatusOr GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) override; + + StatusOr GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) override; + + Status DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) override; + + future> AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) override; + + future AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) override; + + private: + void SetMetadata(grpc::ClientContext& context, Options const& options, + std::string const& request_params); + void SetMetadata(grpc::ClientContext& context, Options const& options); + + std::shared_ptr child_; + std::multimap fixed_metadata_; + std::string api_client_header_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_METADATA_DECORATOR_H diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_option_defaults.cc b/google/cloud/configdelivery/v1/internal/config_delivery_option_defaults.cc new file mode 100644 index 0000000000000..d287ef68e5c5f --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_option_defaults.cc @@ -0,0 +1,81 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#include "google/cloud/configdelivery/v1/internal/config_delivery_option_defaults.h" +#include "google/cloud/configdelivery/v1/config_delivery_connection.h" +#include "google/cloud/configdelivery/v1/config_delivery_options.h" +#include "google/cloud/internal/populate_common_options.h" +#include "google/cloud/internal/populate_grpc_options.h" +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +namespace { +auto constexpr kBackoffScaling = 2.0; +} // namespace + +Options ConfigDeliveryDefaultOptions(Options options) { + options = internal::PopulateCommonOptions( + std::move(options), "GOOGLE_CLOUD_CPP_CONFIG_DELIVERY_ENDPOINT", "", + "GOOGLE_CLOUD_CPP_CONFIG_DELIVERY_AUTHORITY", + "configdelivery.googleapis.com"); + options = internal::PopulateGrpcOptions(std::move(options)); + if (!options.has()) { + options.set( + configdelivery_v1::ConfigDeliveryLimitedTimeRetryPolicy( + std::chrono::minutes(30)) + .clone()); + } + if (!options.has()) { + options.set( + ExponentialBackoffPolicy( + std::chrono::seconds(0), std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling, kBackoffScaling) + .clone()); + } + if (!options.has()) { + options.set( + GenericPollingPolicy< + configdelivery_v1::ConfigDeliveryRetryPolicyOption::Type, + configdelivery_v1::ConfigDeliveryBackoffPolicyOption::Type>( + options.get() + ->clone(), + ExponentialBackoffPolicy(std::chrono::seconds(1), + std::chrono::minutes(5), kBackoffScaling) + .clone()) + .clone()); + } + if (!options.has()) { + options.set< + configdelivery_v1::ConfigDeliveryConnectionIdempotencyPolicyOption>( + configdelivery_v1:: + MakeDefaultConfigDeliveryConnectionIdempotencyPolicy()); + } + + return options; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_option_defaults.h b/google/cloud/configdelivery/v1/internal/config_delivery_option_defaults.h new file mode 100644 index 0000000000000..6aa9216d9d689 --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_option_defaults.h @@ -0,0 +1,37 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_OPTION_DEFAULTS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_OPTION_DEFAULTS_H + +#include "google/cloud/options.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +Options ConfigDeliveryDefaultOptions(Options options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_OPTION_DEFAULTS_H diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_retry_traits.h b/google/cloud/configdelivery/v1/internal/config_delivery_retry_traits.h new file mode 100644 index 0000000000000..d290fb41489cb --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_retry_traits.h @@ -0,0 +1,43 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_RETRY_TRAITS_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_RETRY_TRAITS_H + +#include "google/cloud/status.h" +#include "google/cloud/version.h" + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/// Define the gRPC status code semantics for retrying requests. +struct ConfigDeliveryRetryTraits { + static bool IsPermanentFailure(google::cloud::Status const& status) { + return status.code() != StatusCode::kOk && + status.code() != StatusCode::kUnavailable; + } +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_RETRY_TRAITS_H diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_sources.cc b/google/cloud/configdelivery/v1/internal/config_delivery_sources.cc new file mode 100644 index 0000000000000..9e7e3d222fbd5 --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_sources.cc @@ -0,0 +1,32 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +// NOLINTBEGIN(bugprone-suspicious-include) +#include "google/cloud/configdelivery/v1/config_delivery_client.cc" +#include "google/cloud/configdelivery/v1/config_delivery_connection.cc" +#include "google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.cc" +#include "google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.cc" +#include "google/cloud/configdelivery/v1/internal/config_delivery_connection_impl.cc" +#include "google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.cc" +#include "google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.cc" +#include "google/cloud/configdelivery/v1/internal/config_delivery_option_defaults.cc" +#include "google/cloud/configdelivery/v1/internal/config_delivery_stub.cc" +#include "google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.cc" +#include "google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.cc" +#include "google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.cc" +// NOLINTEND(bugprone-suspicious-include) diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_stub.cc b/google/cloud/configdelivery/v1/internal/config_delivery_stub.cc new file mode 100644 index 0000000000000..78339da67a3e8 --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_stub.cc @@ -0,0 +1,749 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#include "google/cloud/configdelivery/v1/internal/config_delivery_stub.h" +#include "google/cloud/grpc_error_delegate.h" +#include "google/cloud/status_or.h" +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +ConfigDeliveryStub::~ConfigDeliveryStub() = default; + +StatusOr +DefaultConfigDeliveryStub::ListResourceBundles( + grpc::ClientContext& context, Options const&, + google::cloud::configdelivery::v1::ListResourceBundlesRequest const& + request) { + google::cloud::configdelivery::v1::ListResourceBundlesResponse response; + auto status = grpc_stub_->ListResourceBundles(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultConfigDeliveryStub::GetResourceBundle( + grpc::ClientContext& context, Options const&, + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) { + google::cloud::configdelivery::v1::ResourceBundle response; + auto status = grpc_stub_->GetResourceBundle(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultConfigDeliveryStub::AsyncCreateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::configdelivery::v1::CreateResourceBundleRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateResourceBundle(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultConfigDeliveryStub::CreateResourceBundle( + grpc::ClientContext& context, Options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateResourceBundle(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultConfigDeliveryStub::AsyncUpdateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::configdelivery::v1::UpdateResourceBundleRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateResourceBundle(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultConfigDeliveryStub::UpdateResourceBundle( + grpc::ClientContext& context, Options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateResourceBundle(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultConfigDeliveryStub::AsyncDeleteResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::configdelivery::v1::DeleteResourceBundleRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteResourceBundle(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultConfigDeliveryStub::DeleteResourceBundle( + grpc::ClientContext& context, Options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteResourceBundle(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultConfigDeliveryStub::ListFleetPackages( + grpc::ClientContext& context, Options const&, + google::cloud::configdelivery::v1::ListFleetPackagesRequest const& + request) { + google::cloud::configdelivery::v1::ListFleetPackagesResponse response; + auto status = grpc_stub_->ListFleetPackages(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultConfigDeliveryStub::GetFleetPackage( + grpc::ClientContext& context, Options const&, + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request) { + google::cloud::configdelivery::v1::FleetPackage response; + auto status = grpc_stub_->GetFleetPackage(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultConfigDeliveryStub::AsyncCreateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::configdelivery::v1::CreateFleetPackageRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateFleetPackage(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultConfigDeliveryStub::CreateFleetPackage( + grpc::ClientContext& context, Options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateFleetPackage(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultConfigDeliveryStub::AsyncUpdateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::configdelivery::v1::UpdateFleetPackageRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateFleetPackage(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultConfigDeliveryStub::UpdateFleetPackage( + grpc::ClientContext& context, Options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateFleetPackage(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultConfigDeliveryStub::AsyncDeleteFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + return internal::MakeUnaryRpcImpl< + google::cloud::configdelivery::v1::DeleteFleetPackageRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteFleetPackage(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultConfigDeliveryStub::DeleteFleetPackage( + grpc::ClientContext& context, Options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteFleetPackage(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultConfigDeliveryStub::ListReleases( + grpc::ClientContext& context, Options const&, + google::cloud::configdelivery::v1::ListReleasesRequest const& request) { + google::cloud::configdelivery::v1::ListReleasesResponse response; + auto status = grpc_stub_->ListReleases(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultConfigDeliveryStub::GetRelease( + grpc::ClientContext& context, Options const&, + google::cloud::configdelivery::v1::GetReleaseRequest const& request) { + google::cloud::configdelivery::v1::Release response; + auto status = grpc_stub_->GetRelease(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultConfigDeliveryStub::AsyncCreateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::configdelivery::v1::CreateReleaseRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::configdelivery::v1::CreateReleaseRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateRelease(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultConfigDeliveryStub::CreateRelease( + grpc::ClientContext& context, Options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateRelease(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultConfigDeliveryStub::AsyncUpdateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::configdelivery::v1::UpdateReleaseRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateRelease(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultConfigDeliveryStub::UpdateRelease( + grpc::ClientContext& context, Options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateRelease(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultConfigDeliveryStub::AsyncDeleteRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::configdelivery::v1::DeleteReleaseRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteRelease(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultConfigDeliveryStub::DeleteRelease( + grpc::ClientContext& context, Options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteRelease(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultConfigDeliveryStub::ListVariants( + grpc::ClientContext& context, Options const&, + google::cloud::configdelivery::v1::ListVariantsRequest const& request) { + google::cloud::configdelivery::v1::ListVariantsResponse response; + auto status = grpc_stub_->ListVariants(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultConfigDeliveryStub::GetVariant( + grpc::ClientContext& context, Options const&, + google::cloud::configdelivery::v1::GetVariantRequest const& request) { + google::cloud::configdelivery::v1::Variant response; + auto status = grpc_stub_->GetVariant(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultConfigDeliveryStub::AsyncCreateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::configdelivery::v1::CreateVariantRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::configdelivery::v1::CreateVariantRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncCreateVariant(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultConfigDeliveryStub::CreateVariant( + grpc::ClientContext& context, Options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->CreateVariant(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultConfigDeliveryStub::AsyncUpdateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::configdelivery::v1::UpdateVariantRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::configdelivery::v1::UpdateVariantRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncUpdateVariant(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultConfigDeliveryStub::UpdateVariant( + grpc::ClientContext& context, Options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->UpdateVariant(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultConfigDeliveryStub::AsyncDeleteVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::configdelivery::v1::DeleteVariantRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::configdelivery::v1::DeleteVariantRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncDeleteVariant(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultConfigDeliveryStub::DeleteVariant( + grpc::ClientContext& context, Options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->DeleteVariant(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultConfigDeliveryStub::ListRollouts( + grpc::ClientContext& context, Options const&, + google::cloud::configdelivery::v1::ListRolloutsRequest const& request) { + google::cloud::configdelivery::v1::ListRolloutsResponse response; + auto status = grpc_stub_->ListRollouts(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultConfigDeliveryStub::GetRollout( + grpc::ClientContext& context, Options const&, + google::cloud::configdelivery::v1::GetRolloutRequest const& request) { + google::cloud::configdelivery::v1::Rollout response; + auto status = grpc_stub_->GetRollout(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultConfigDeliveryStub::AsyncSuspendRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::configdelivery::v1::SuspendRolloutRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncSuspendRollout(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultConfigDeliveryStub::SuspendRollout( + grpc::ClientContext& context, Options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->SuspendRollout(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultConfigDeliveryStub::AsyncResumeRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::configdelivery::v1::ResumeRolloutRequest, + google::longrunning::Operation>( + cq, + [this](grpc::ClientContext* context, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& + request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncResumeRollout(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultConfigDeliveryStub::ResumeRollout( + grpc::ClientContext& context, Options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->ResumeRollout(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +future> +DefaultConfigDeliveryStub::AsyncAbortRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) { + return internal::MakeUnaryRpcImpl< + google::cloud::configdelivery::v1::AbortRolloutRequest, + google::longrunning::Operation>( + cq, + [this]( + grpc::ClientContext* context, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request, + grpc::CompletionQueue* cq) { + return grpc_stub_->AsyncAbortRollout(context, request, cq); + }, + request, std::move(context)); +} + +StatusOr +DefaultConfigDeliveryStub::AbortRollout( + grpc::ClientContext& context, Options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) { + google::longrunning::Operation response; + auto status = grpc_stub_->AbortRollout(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultConfigDeliveryStub::ListLocations( + grpc::ClientContext& context, Options const&, + google::cloud::location::ListLocationsRequest const& request) { + google::cloud::location::ListLocationsResponse response; + auto status = locations_stub_->ListLocations(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultConfigDeliveryStub::GetLocation( + grpc::ClientContext& context, Options const&, + google::cloud::location::GetLocationRequest const& request) { + google::cloud::location::Location response; + auto status = locations_stub_->GetLocation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultConfigDeliveryStub::ListOperations( + grpc::ClientContext& context, Options const&, + google::longrunning::ListOperationsRequest const& request) { + google::longrunning::ListOperationsResponse response; + auto status = operations_stub_->ListOperations(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +StatusOr +DefaultConfigDeliveryStub::GetOperation( + grpc::ClientContext& context, Options const&, + google::longrunning::GetOperationRequest const& request) { + google::longrunning::Operation response; + auto status = operations_stub_->GetOperation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return response; +} + +Status DefaultConfigDeliveryStub::DeleteOperation( + grpc::ClientContext& context, Options const&, + google::longrunning::DeleteOperationRequest const& request) { + google::protobuf::Empty response; + auto status = operations_stub_->DeleteOperation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +Status DefaultConfigDeliveryStub::CancelOperation( + grpc::ClientContext& context, Options const&, + google::longrunning::CancelOperationRequest const& request) { + google::protobuf::Empty response; + auto status = operations_stub_->CancelOperation(&context, request, &response); + if (!status.ok()) { + return google::cloud::MakeStatusFromRpcError(status); + } + return google::cloud::Status(); +} + +future> +DefaultConfigDeliveryStub::AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + // NOLINTNEXTLINE(performance-unnecessary-value-param) + google::cloud::internal::ImmutableOptions, + google::longrunning::GetOperationRequest const& request) { + return internal::MakeUnaryRpcImpl( + cq, + [this](grpc::ClientContext* context, + google::longrunning::GetOperationRequest const& request, + grpc::CompletionQueue* cq) { + return operations_stub_->AsyncGetOperation(context, request, cq); + }, + request, std::move(context)); +} + +future DefaultConfigDeliveryStub::AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + // NOLINTNEXTLINE(performance-unnecessary-value-param) + google::cloud::internal::ImmutableOptions, + google::longrunning::CancelOperationRequest const& request) { + return internal::MakeUnaryRpcImpl( + cq, + [this](grpc::ClientContext* context, + google::longrunning::CancelOperationRequest const& request, + grpc::CompletionQueue* cq) { + return operations_stub_->AsyncCancelOperation(context, request, + cq); + }, + request, std::move(context)) + .then([](future> f) { + return f.get().status(); + }); +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_stub.h b/google/cloud/configdelivery/v1/internal/config_delivery_stub.h new file mode 100644 index 0000000000000..265ae3c757927 --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_stub.h @@ -0,0 +1,615 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_STUB_H + +#include "google/cloud/completion_queue.h" +#include "google/cloud/future.h" +#include "google/cloud/options.h" +#include "google/cloud/status_or.h" +#include "google/cloud/version.h" +#include +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +class ConfigDeliveryStub { + public: + virtual ~ConfigDeliveryStub() = 0; + + virtual StatusOr< + google::cloud::configdelivery::v1::ListResourceBundlesResponse> + ListResourceBundles( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListResourceBundlesRequest const& + request) = 0; + + virtual StatusOr + GetResourceBundle( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) = 0; + + virtual future> + AsyncCreateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) = 0; + + virtual StatusOr CreateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) = 0; + + virtual future> + AsyncUpdateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) = 0; + + virtual StatusOr UpdateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) = 0; + + virtual future> + AsyncDeleteResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) = 0; + + virtual StatusOr DeleteResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) = 0; + + virtual StatusOr + ListFleetPackages( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListFleetPackagesRequest const& + request) = 0; + + virtual StatusOr + GetFleetPackage( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetFleetPackageRequest const& + request) = 0; + + virtual future> + AsyncCreateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) = 0; + + virtual StatusOr CreateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) = 0; + + virtual future> + AsyncUpdateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) = 0; + + virtual StatusOr UpdateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) = 0; + + virtual future> + AsyncDeleteFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) = 0; + + virtual StatusOr DeleteFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) = 0; + + virtual StatusOr + ListReleases(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListReleasesRequest const& + request) = 0; + + virtual StatusOr GetRelease( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetReleaseRequest const& request) = 0; + + virtual future> AsyncCreateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& + request) = 0; + + virtual StatusOr CreateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& + request) = 0; + + virtual future> AsyncUpdateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& + request) = 0; + + virtual StatusOr UpdateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& + request) = 0; + + virtual future> AsyncDeleteRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& + request) = 0; + + virtual StatusOr DeleteRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& + request) = 0; + + virtual StatusOr + ListVariants(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListVariantsRequest const& + request) = 0; + + virtual StatusOr GetVariant( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetVariantRequest const& request) = 0; + + virtual future> AsyncCreateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateVariantRequest const& + request) = 0; + + virtual StatusOr CreateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateVariantRequest const& + request) = 0; + + virtual future> AsyncUpdateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& + request) = 0; + + virtual StatusOr UpdateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& + request) = 0; + + virtual future> AsyncDeleteVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& + request) = 0; + + virtual StatusOr DeleteVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& + request) = 0; + + virtual StatusOr + ListRollouts(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListRolloutsRequest const& + request) = 0; + + virtual StatusOr GetRollout( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetRolloutRequest const& request) = 0; + + virtual future> AsyncSuspendRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& + request) = 0; + + virtual StatusOr SuspendRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& + request) = 0; + + virtual future> AsyncResumeRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& + request) = 0; + + virtual StatusOr ResumeRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& + request) = 0; + + virtual future> AsyncAbortRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& + request) = 0; + + virtual StatusOr AbortRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& + request) = 0; + + virtual StatusOr + ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) = 0; + + virtual StatusOr GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) = 0; + + virtual StatusOr ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) = 0; + + virtual StatusOr GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) = 0; + + virtual Status DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) = 0; + + virtual Status CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) = 0; + + virtual future> AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) = 0; + + virtual future AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) = 0; +}; + +class DefaultConfigDeliveryStub : public ConfigDeliveryStub { + public: + DefaultConfigDeliveryStub( + std::unique_ptr< + google::cloud::configdelivery::v1::ConfigDelivery::StubInterface> + grpc_stub, + std::unique_ptr + locations_stub, + std::unique_ptr + operations_stub) + : grpc_stub_(std::move(grpc_stub)), + locations_stub_(std::move(locations_stub)), + operations_stub_(std::move(operations_stub)) {} + + StatusOr + ListResourceBundles( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListResourceBundlesRequest const& + request) override; + + StatusOr GetResourceBundle( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) override; + + future> AsyncCreateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) override; + + StatusOr CreateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) override; + + future> AsyncUpdateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) override; + + StatusOr UpdateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) override; + + future> AsyncDeleteResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) override; + + StatusOr DeleteResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) override; + + StatusOr + ListFleetPackages( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListFleetPackagesRequest const& + request) override; + + StatusOr GetFleetPackage( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request) + override; + + future> AsyncCreateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) override; + + StatusOr CreateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) override; + + future> AsyncUpdateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) override; + + StatusOr UpdateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) override; + + future> AsyncDeleteFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) override; + + StatusOr DeleteFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) override; + + StatusOr + ListReleases(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListReleasesRequest const& + request) override; + + StatusOr GetRelease( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetReleaseRequest const& request) + override; + + future> AsyncCreateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) + override; + + StatusOr CreateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) + override; + + future> AsyncUpdateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) + override; + + StatusOr UpdateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) + override; + + future> AsyncDeleteRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) + override; + + StatusOr DeleteRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) + override; + + StatusOr + ListVariants(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListVariantsRequest const& + request) override; + + StatusOr GetVariant( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetVariantRequest const& request) + override; + + future> AsyncCreateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) + override; + + StatusOr CreateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) + override; + + future> AsyncUpdateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) + override; + + StatusOr UpdateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) + override; + + future> AsyncDeleteVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) + override; + + StatusOr DeleteVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) + override; + + StatusOr + ListRollouts(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListRolloutsRequest const& + request) override; + + StatusOr GetRollout( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetRolloutRequest const& request) + override; + + future> AsyncSuspendRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) + override; + + StatusOr SuspendRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) + override; + + future> AsyncResumeRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) + override; + + StatusOr ResumeRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) + override; + + future> AsyncAbortRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) + override; + + StatusOr AbortRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) + override; + + StatusOr ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) override; + + StatusOr GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) override; + + StatusOr GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) override; + + Status DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) override; + + future> AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) override; + + future AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) override; + + private: + std::unique_ptr< + google::cloud::configdelivery::v1::ConfigDelivery::StubInterface> + grpc_stub_; + std::unique_ptr + locations_stub_; + std::unique_ptr + operations_stub_; +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_STUB_H diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.cc b/google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.cc new file mode 100644 index 0000000000000..ebdd64aa64bb7 --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.cc @@ -0,0 +1,77 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#include "google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.h" +#include "google/cloud/configdelivery/v1/internal/config_delivery_auth_decorator.h" +#include "google/cloud/configdelivery/v1/internal/config_delivery_logging_decorator.h" +#include "google/cloud/configdelivery/v1/internal/config_delivery_metadata_decorator.h" +#include "google/cloud/configdelivery/v1/internal/config_delivery_stub.h" +#include "google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.h" +#include "google/cloud/common_options.h" +#include "google/cloud/grpc_options.h" +#include "google/cloud/internal/algorithm.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/log.h" +#include "google/cloud/options.h" +#include +#include +#include +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultConfigDeliveryStub( + std::shared_ptr auth, + Options const& options) { + auto channel = auth->CreateChannel(options.get(), + internal::MakeChannelArguments(options)); + auto service_grpc_stub = + google::cloud::configdelivery::v1::ConfigDelivery::NewStub(channel); + auto service_locations_stub = + google::cloud::location::Locations::NewStub(channel); + std::shared_ptr stub = + std::make_shared( + std::move(service_grpc_stub), std::move(service_locations_stub), + google::longrunning::Operations::NewStub(channel)); + + if (auth->RequiresConfigureContext()) { + stub = + std::make_shared(std::move(auth), std::move(stub)); + } + stub = std::make_shared( + std::move(stub), std::multimap{}); + if (internal::Contains(options.get(), "rpc")) { + GCP_LOG(INFO) << "Enabled logging for gRPC calls"; + stub = std::make_shared( + std::move(stub), options.get(), + options.get()); + } + if (internal::TracingEnabled(options)) { + stub = MakeConfigDeliveryTracingStub(std::move(stub)); + } + return stub; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.h b/google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.h new file mode 100644 index 0000000000000..aa9c8ea4bb0fb --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_stub_factory.h @@ -0,0 +1,42 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_STUB_FACTORY_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_STUB_FACTORY_H + +#include "google/cloud/configdelivery/v1/internal/config_delivery_stub.h" +#include "google/cloud/internal/unified_grpc_credentials.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +std::shared_ptr CreateDefaultConfigDeliveryStub( + std::shared_ptr auth, + Options const& options); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_STUB_FACTORY_H diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.cc b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.cc new file mode 100644 index 0000000000000..fa6ff7c7415be --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.cc @@ -0,0 +1,665 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#include "google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.h" +#include "google/cloud/internal/opentelemetry.h" +#include "google/cloud/internal/traced_stream_range.h" +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +ConfigDeliveryTracingConnection::ConfigDeliveryTracingConnection( + std::shared_ptr child) + : child_(std::move(child)) {} + +StreamRange +ConfigDeliveryTracingConnection::ListResourceBundles( + google::cloud::configdelivery::v1::ListResourceBundlesRequest request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::ListResourceBundles"); + internal::OTelScope scope(span); + auto sr = child_->ListResourceBundles(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::configdelivery::v1::ResourceBundle>(std::move(span), + std::move(sr)); +} + +StatusOr +ConfigDeliveryTracingConnection::GetResourceBundle( + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::GetResourceBundle"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetResourceBundle(request)); +} + +future> +ConfigDeliveryTracingConnection::CreateResourceBundle( + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::CreateResourceBundle"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateResourceBundle(request)); +} + +StatusOr +ConfigDeliveryTracingConnection::CreateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::CreateResourceBundle"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateResourceBundle(NoAwaitTag{}, request)); +} + +future> +ConfigDeliveryTracingConnection::CreateResourceBundle( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::CreateResourceBundle"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateResourceBundle(operation)); +} + +future> +ConfigDeliveryTracingConnection::UpdateResourceBundle( + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::UpdateResourceBundle"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateResourceBundle(request)); +} + +StatusOr +ConfigDeliveryTracingConnection::UpdateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::UpdateResourceBundle"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateResourceBundle(NoAwaitTag{}, request)); +} + +future> +ConfigDeliveryTracingConnection::UpdateResourceBundle( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::UpdateResourceBundle"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateResourceBundle(operation)); +} + +future> +ConfigDeliveryTracingConnection::DeleteResourceBundle( + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::DeleteResourceBundle"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteResourceBundle(request)); +} + +StatusOr +ConfigDeliveryTracingConnection::DeleteResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::DeleteResourceBundle"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteResourceBundle(NoAwaitTag{}, request)); +} + +future> +ConfigDeliveryTracingConnection::DeleteResourceBundle( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::DeleteResourceBundle"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteResourceBundle(operation)); +} + +StreamRange +ConfigDeliveryTracingConnection::ListFleetPackages( + google::cloud::configdelivery::v1::ListFleetPackagesRequest request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::ListFleetPackages"); + internal::OTelScope scope(span); + auto sr = child_->ListFleetPackages(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::configdelivery::v1::FleetPackage>(std::move(span), + std::move(sr)); +} + +StatusOr +ConfigDeliveryTracingConnection::GetFleetPackage( + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::GetFleetPackage"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetFleetPackage(request)); +} + +future> +ConfigDeliveryTracingConnection::CreateFleetPackage( + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::CreateFleetPackage"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateFleetPackage(request)); +} + +StatusOr +ConfigDeliveryTracingConnection::CreateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::CreateFleetPackage"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->CreateFleetPackage(NoAwaitTag{}, request)); +} + +future> +ConfigDeliveryTracingConnection::CreateFleetPackage( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::CreateFleetPackage"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->CreateFleetPackage(operation)); +} + +future> +ConfigDeliveryTracingConnection::UpdateFleetPackage( + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::UpdateFleetPackage"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateFleetPackage(request)); +} + +StatusOr +ConfigDeliveryTracingConnection::UpdateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::UpdateFleetPackage"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->UpdateFleetPackage(NoAwaitTag{}, request)); +} + +future> +ConfigDeliveryTracingConnection::UpdateFleetPackage( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::UpdateFleetPackage"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->UpdateFleetPackage(operation)); +} + +future> +ConfigDeliveryTracingConnection::DeleteFleetPackage( + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::DeleteFleetPackage"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteFleetPackage(request)); +} + +StatusOr +ConfigDeliveryTracingConnection::DeleteFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::DeleteFleetPackage"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->DeleteFleetPackage(NoAwaitTag{}, request)); +} + +future> +ConfigDeliveryTracingConnection::DeleteFleetPackage( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::DeleteFleetPackage"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), + child_->DeleteFleetPackage(operation)); +} + +StreamRange +ConfigDeliveryTracingConnection::ListReleases( + google::cloud::configdelivery::v1::ListReleasesRequest request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::ListReleases"); + internal::OTelScope scope(span); + auto sr = child_->ListReleases(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::configdelivery::v1::Release>(std::move(span), + std::move(sr)); +} + +StatusOr +ConfigDeliveryTracingConnection::GetRelease( + google::cloud::configdelivery::v1::GetReleaseRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::GetRelease"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetRelease(request)); +} + +future> +ConfigDeliveryTracingConnection::CreateRelease( + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::CreateRelease"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateRelease(request)); +} + +StatusOr +ConfigDeliveryTracingConnection::CreateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::CreateRelease"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateRelease(NoAwaitTag{}, request)); +} + +future> +ConfigDeliveryTracingConnection::CreateRelease( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::CreateRelease"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateRelease(operation)); +} + +future> +ConfigDeliveryTracingConnection::UpdateRelease( + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::UpdateRelease"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateRelease(request)); +} + +StatusOr +ConfigDeliveryTracingConnection::UpdateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::UpdateRelease"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UpdateRelease(NoAwaitTag{}, request)); +} + +future> +ConfigDeliveryTracingConnection::UpdateRelease( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::UpdateRelease"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateRelease(operation)); +} + +future> +ConfigDeliveryTracingConnection::DeleteRelease( + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::DeleteRelease"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteRelease(request)); +} + +StatusOr +ConfigDeliveryTracingConnection::DeleteRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::DeleteRelease"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteRelease(NoAwaitTag{}, request)); +} + +future> +ConfigDeliveryTracingConnection::DeleteRelease( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::DeleteRelease"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteRelease(operation)); +} + +StreamRange +ConfigDeliveryTracingConnection::ListVariants( + google::cloud::configdelivery::v1::ListVariantsRequest request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::ListVariants"); + internal::OTelScope scope(span); + auto sr = child_->ListVariants(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::configdelivery::v1::Variant>(std::move(span), + std::move(sr)); +} + +StatusOr +ConfigDeliveryTracingConnection::GetVariant( + google::cloud::configdelivery::v1::GetVariantRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::GetVariant"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetVariant(request)); +} + +future> +ConfigDeliveryTracingConnection::CreateVariant( + google::cloud::configdelivery::v1::CreateVariantRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::CreateVariant"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateVariant(request)); +} + +StatusOr +ConfigDeliveryTracingConnection::CreateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::CreateVariant"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->CreateVariant(NoAwaitTag{}, request)); +} + +future> +ConfigDeliveryTracingConnection::CreateVariant( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::CreateVariant"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->CreateVariant(operation)); +} + +future> +ConfigDeliveryTracingConnection::UpdateVariant( + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::UpdateVariant"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateVariant(request)); +} + +StatusOr +ConfigDeliveryTracingConnection::UpdateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::UpdateVariant"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->UpdateVariant(NoAwaitTag{}, request)); +} + +future> +ConfigDeliveryTracingConnection::UpdateVariant( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::UpdateVariant"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->UpdateVariant(operation)); +} + +future> +ConfigDeliveryTracingConnection::DeleteVariant( + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::DeleteVariant"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteVariant(request)); +} + +StatusOr +ConfigDeliveryTracingConnection::DeleteVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::DeleteVariant"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->DeleteVariant(NoAwaitTag{}, request)); +} + +future> +ConfigDeliveryTracingConnection::DeleteVariant( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::DeleteVariant"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->DeleteVariant(operation)); +} + +StreamRange +ConfigDeliveryTracingConnection::ListRollouts( + google::cloud::configdelivery::v1::ListRolloutsRequest request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::ListRollouts"); + internal::OTelScope scope(span); + auto sr = child_->ListRollouts(std::move(request)); + return internal::MakeTracedStreamRange< + google::cloud::configdelivery::v1::Rollout>(std::move(span), + std::move(sr)); +} + +StatusOr +ConfigDeliveryTracingConnection::GetRollout( + google::cloud::configdelivery::v1::GetRolloutRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::GetRollout"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetRollout(request)); +} + +future> +ConfigDeliveryTracingConnection::SuspendRollout( + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::SuspendRollout"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->SuspendRollout(request)); +} + +StatusOr +ConfigDeliveryTracingConnection::SuspendRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::SuspendRollout"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, + child_->SuspendRollout(NoAwaitTag{}, request)); +} + +future> +ConfigDeliveryTracingConnection::SuspendRollout( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::SuspendRollout"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->SuspendRollout(operation)); +} + +future> +ConfigDeliveryTracingConnection::ResumeRollout( + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::ResumeRollout"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->ResumeRollout(request)); +} + +StatusOr +ConfigDeliveryTracingConnection::ResumeRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::ResumeRollout"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->ResumeRollout(NoAwaitTag{}, request)); +} + +future> +ConfigDeliveryTracingConnection::ResumeRollout( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::ResumeRollout"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->ResumeRollout(operation)); +} + +future> +ConfigDeliveryTracingConnection::AbortRollout( + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::AbortRollout"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->AbortRollout(request)); +} + +StatusOr +ConfigDeliveryTracingConnection::AbortRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::AbortRollout"); + opentelemetry::trace::Scope scope(span); + return internal::EndSpan(*span, child_->AbortRollout(NoAwaitTag{}, request)); +} + +future> +ConfigDeliveryTracingConnection::AbortRollout( + google::longrunning::Operation const& operation) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::AbortRollout"); + internal::OTelScope scope(span); + return internal::EndSpan(std::move(span), child_->AbortRollout(operation)); +} + +StreamRange +ConfigDeliveryTracingConnection::ListLocations( + google::cloud::location::ListLocationsRequest request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::ListLocations"); + internal::OTelScope scope(span); + auto sr = child_->ListLocations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +ConfigDeliveryTracingConnection::GetLocation( + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetLocation(request)); +} + +StreamRange +ConfigDeliveryTracingConnection::ListOperations( + google::longrunning::ListOperationsRequest request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::ListOperations"); + internal::OTelScope scope(span); + auto sr = child_->ListOperations(std::move(request)); + return internal::MakeTracedStreamRange( + std::move(span), std::move(sr)); +} + +StatusOr +ConfigDeliveryTracingConnection::GetOperation( + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->GetOperation(request)); +} + +Status ConfigDeliveryTracingConnection::DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->DeleteOperation(request)); +} + +Status ConfigDeliveryTracingConnection::CancelOperation( + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpan( + "configdelivery_v1::ConfigDeliveryConnection::CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + return internal::EndSpan(*span, child_->CancelOperation(request)); +} + +#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +std::shared_ptr +MakeConfigDeliveryTracingConnection( + std::shared_ptr conn) { +#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + if (internal::TracingEnabled(conn->options())) { + conn = std::make_shared(std::move(conn)); + } +#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + return conn; +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.h b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.h new file mode 100644 index 0000000000000..10878523305e3 --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_connection.h @@ -0,0 +1,309 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_TRACING_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_TRACING_CONNECTION_H + +#include "google/cloud/configdelivery/v1/config_delivery_connection.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +class ConfigDeliveryTracingConnection + : public configdelivery_v1::ConfigDeliveryConnection { + public: + ~ConfigDeliveryTracingConnection() override = default; + + explicit ConfigDeliveryTracingConnection( + std::shared_ptr child); + + Options options() override { return child_->options(); } + + StreamRange + ListResourceBundles( + google::cloud::configdelivery::v1::ListResourceBundlesRequest request) + override; + + StatusOr GetResourceBundle( + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) override; + + future> + CreateResourceBundle( + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) override; + + StatusOr CreateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) override; + + future> + CreateResourceBundle( + google::longrunning::Operation const& operation) override; + + future> + UpdateResourceBundle( + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) override; + + StatusOr UpdateResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) override; + + future> + UpdateResourceBundle( + google::longrunning::Operation const& operation) override; + + future> + DeleteResourceBundle( + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) override; + + StatusOr DeleteResourceBundle( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) override; + + future> + DeleteResourceBundle( + google::longrunning::Operation const& operation) override; + + StreamRange + ListFleetPackages(google::cloud::configdelivery::v1::ListFleetPackagesRequest + request) override; + + StatusOr GetFleetPackage( + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request) + override; + + future> + CreateFleetPackage( + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) override; + + StatusOr CreateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) override; + + future> + CreateFleetPackage(google::longrunning::Operation const& operation) override; + + future> + UpdateFleetPackage( + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) override; + + StatusOr UpdateFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) override; + + future> + UpdateFleetPackage(google::longrunning::Operation const& operation) override; + + future> + DeleteFleetPackage( + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) override; + + StatusOr DeleteFleetPackage( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) override; + + future> + DeleteFleetPackage(google::longrunning::Operation const& operation) override; + + StreamRange ListReleases( + google::cloud::configdelivery::v1::ListReleasesRequest request) override; + + StatusOr GetRelease( + google::cloud::configdelivery::v1::GetReleaseRequest const& request) + override; + + future> CreateRelease( + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) + override; + + StatusOr CreateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) + override; + + future> CreateRelease( + google::longrunning::Operation const& operation) override; + + future> UpdateRelease( + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) + override; + + StatusOr UpdateRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) + override; + + future> UpdateRelease( + google::longrunning::Operation const& operation) override; + + future> + DeleteRelease(google::cloud::configdelivery::v1::DeleteReleaseRequest const& + request) override; + + StatusOr DeleteRelease( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) + override; + + future> + DeleteRelease(google::longrunning::Operation const& operation) override; + + StreamRange ListVariants( + google::cloud::configdelivery::v1::ListVariantsRequest request) override; + + StatusOr GetVariant( + google::cloud::configdelivery::v1::GetVariantRequest const& request) + override; + + future> CreateVariant( + google::cloud::configdelivery::v1::CreateVariantRequest const& request) + override; + + StatusOr CreateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) + override; + + future> CreateVariant( + google::longrunning::Operation const& operation) override; + + future> UpdateVariant( + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) + override; + + StatusOr UpdateVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) + override; + + future> UpdateVariant( + google::longrunning::Operation const& operation) override; + + future> + DeleteVariant(google::cloud::configdelivery::v1::DeleteVariantRequest const& + request) override; + + StatusOr DeleteVariant( + NoAwaitTag, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) + override; + + future> + DeleteVariant(google::longrunning::Operation const& operation) override; + + StreamRange ListRollouts( + google::cloud::configdelivery::v1::ListRolloutsRequest request) override; + + StatusOr GetRollout( + google::cloud::configdelivery::v1::GetRolloutRequest const& request) + override; + + future> SuspendRollout( + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) + override; + + StatusOr SuspendRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) + override; + + future> SuspendRollout( + google::longrunning::Operation const& operation) override; + + future> ResumeRollout( + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) + override; + + StatusOr ResumeRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) + override; + + future> ResumeRollout( + google::longrunning::Operation const& operation) override; + + future> AbortRollout( + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) + override; + + StatusOr AbortRollout( + NoAwaitTag, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) + override; + + future> AbortRollout( + google::longrunning::Operation const& operation) override; + + StreamRange ListLocations( + google::cloud::location::ListLocationsRequest request) override; + + StatusOr GetLocation( + google::cloud::location::GetLocationRequest const& request) override; + + StreamRange ListOperations( + google::longrunning::ListOperationsRequest request) override; + + StatusOr GetOperation( + google::longrunning::GetOperationRequest const& request) override; + + Status DeleteOperation( + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + google::longrunning::CancelOperationRequest const& request) override; + + private: + std::shared_ptr child_; +}; + +#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +/** + * Conditionally applies the tracing decorator to the given connection. + * + * The connection is only decorated if tracing is enabled (as determined by the + * connection's options). + */ +std::shared_ptr +MakeConfigDeliveryTracingConnection( + std::shared_ptr conn); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_TRACING_CONNECTION_H diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.cc b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.cc new file mode 100644 index 0000000000000..74263bff488b0 --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.cc @@ -0,0 +1,679 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#include "google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.h" +#include "google/cloud/internal/grpc_opentelemetry.h" +#include +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +ConfigDeliveryTracingStub::ConfigDeliveryTracingStub( + std::shared_ptr child) + : child_(std::move(child)), propagator_(internal::MakePropagator()) {} + +StatusOr +ConfigDeliveryTracingStub::ListResourceBundles( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListResourceBundlesRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "ListResourceBundles"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListResourceBundles(context, options, request)); +} + +StatusOr +ConfigDeliveryTracingStub::GetResourceBundle( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "GetResourceBundle"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->GetResourceBundle(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncCreateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "CreateResourceBundle"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateResourceBundle(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +ConfigDeliveryTracingStub::CreateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "CreateResourceBundle"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->CreateResourceBundle(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncUpdateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "UpdateResourceBundle"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateResourceBundle(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +ConfigDeliveryTracingStub::UpdateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "UpdateResourceBundle"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->UpdateResourceBundle(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncDeleteResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "DeleteResourceBundle"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteResourceBundle(cq, context, std::move(options), + request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +ConfigDeliveryTracingStub::DeleteResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "DeleteResourceBundle"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteResourceBundle(context, options, request)); +} + +StatusOr +ConfigDeliveryTracingStub::ListFleetPackages( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListFleetPackagesRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "ListFleetPackages"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->ListFleetPackages(context, options, request)); +} + +StatusOr +ConfigDeliveryTracingStub::GetFleetPackage( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "GetFleetPackage"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetFleetPackage(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncCreateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "CreateFleetPackage"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCreateFleetPackage(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +ConfigDeliveryTracingStub::CreateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "CreateFleetPackage"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->CreateFleetPackage(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncUpdateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "UpdateFleetPackage"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncUpdateFleetPackage(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +ConfigDeliveryTracingStub::UpdateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "UpdateFleetPackage"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->UpdateFleetPackage(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncDeleteFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "DeleteFleetPackage"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncDeleteFleetPackage(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +ConfigDeliveryTracingStub::DeleteFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "DeleteFleetPackage"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan( + context, *span, child_->DeleteFleetPackage(context, options, request)); +} + +StatusOr +ConfigDeliveryTracingStub::ListReleases( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListReleasesRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "ListReleases"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListReleases(context, options, request)); +} + +StatusOr +ConfigDeliveryTracingStub::GetRelease( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetReleaseRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "GetRelease"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetRelease(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncCreateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "CreateRelease"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateRelease(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +ConfigDeliveryTracingStub::CreateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "CreateRelease"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateRelease(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncUpdateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "UpdateRelease"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateRelease(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +ConfigDeliveryTracingStub::UpdateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "UpdateRelease"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateRelease(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncDeleteRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "DeleteRelease"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteRelease(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +ConfigDeliveryTracingStub::DeleteRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "DeleteRelease"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteRelease(context, options, request)); +} + +StatusOr +ConfigDeliveryTracingStub::ListVariants( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListVariantsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "ListVariants"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListVariants(context, options, request)); +} + +StatusOr +ConfigDeliveryTracingStub::GetVariant( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetVariantRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "GetVariant"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetVariant(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncCreateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "CreateVariant"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncCreateVariant(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +ConfigDeliveryTracingStub::CreateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "CreateVariant"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CreateVariant(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncUpdateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "UpdateVariant"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncUpdateVariant(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +ConfigDeliveryTracingStub::UpdateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "UpdateVariant"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->UpdateVariant(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncDeleteVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "DeleteVariant"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncDeleteVariant(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +ConfigDeliveryTracingStub::DeleteVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "DeleteVariant"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteVariant(context, options, request)); +} + +StatusOr +ConfigDeliveryTracingStub::ListRollouts( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListRolloutsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "ListRollouts"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListRollouts(context, options, request)); +} + +StatusOr +ConfigDeliveryTracingStub::GetRollout( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetRolloutRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "GetRollout"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetRollout(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncSuspendRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "SuspendRollout"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncSuspendRollout(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +ConfigDeliveryTracingStub::SuspendRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "SuspendRollout"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->SuspendRollout(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncResumeRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "ResumeRollout"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncResumeRollout(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +ConfigDeliveryTracingStub::ResumeRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "ResumeRollout"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ResumeRollout(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncAbortRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "AbortRollout"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncAbortRollout(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +StatusOr +ConfigDeliveryTracingStub::AbortRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "AbortRollout"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->AbortRollout(context, options, request)); +} + +StatusOr +ConfigDeliveryTracingStub::ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "ListLocations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListLocations(context, options, request)); +} + +StatusOr +ConfigDeliveryTracingStub::GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "GetLocation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetLocation(context, options, request)); +} + +StatusOr +ConfigDeliveryTracingStub::ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "ListOperations"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->ListOperations(context, options, request)); +} + +StatusOr +ConfigDeliveryTracingStub::GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "GetOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->GetOperation(context, options, request)); +} + +Status ConfigDeliveryTracingStub::DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "DeleteOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->DeleteOperation(context, options, request)); +} + +Status ConfigDeliveryTracingStub::CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc( + "google.cloud.configdelivery.v1.ConfigDelivery", "CancelOperation"); + auto scope = opentelemetry::trace::Scope(span); + internal::InjectTraceContext(context, *propagator_); + return internal::EndSpan(context, *span, + child_->CancelOperation(context, options, request)); +} + +future> +ConfigDeliveryTracingStub::AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) { + auto span = + internal::MakeSpanGrpc("google.longrunning.Operations", "GetOperation"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = child_->AsyncGetOperation(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +future ConfigDeliveryTracingStub::AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) { + auto span = internal::MakeSpanGrpc("google.longrunning.Operations", + "CancelOperation"); + internal::OTelScope scope(span); + internal::InjectTraceContext(*context, *propagator_); + auto f = + child_->AsyncCancelOperation(cq, context, std::move(options), request); + return internal::EndSpan(std::move(context), std::move(span), std::move(f)); +} + +#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +std::shared_ptr MakeConfigDeliveryTracingStub( + std::shared_ptr stub) { +#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + return std::make_shared(std::move(stub)); +#else + return stub; +#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY +} + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google diff --git a/google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.h b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.h new file mode 100644 index 0000000000000..1aa34c1a8688b --- /dev/null +++ b/google/cloud/configdelivery/v1/internal/config_delivery_tracing_stub.h @@ -0,0 +1,331 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_TRACING_STUB_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_TRACING_STUB_H + +#include "google/cloud/configdelivery/v1/internal/config_delivery_stub.h" +#include "google/cloud/internal/trace_propagator.h" +#include "google/cloud/options.h" +#include "google/cloud/version.h" +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_internal { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +class ConfigDeliveryTracingStub : public ConfigDeliveryStub { + public: + ~ConfigDeliveryTracingStub() override = default; + + explicit ConfigDeliveryTracingStub(std::shared_ptr child); + + StatusOr + ListResourceBundles( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListResourceBundlesRequest const& + request) override; + + StatusOr GetResourceBundle( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request) override; + + future> AsyncCreateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) override; + + StatusOr CreateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request) override; + + future> AsyncUpdateResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) override; + + StatusOr UpdateResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request) override; + + future> AsyncDeleteResourceBundle( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) override; + + StatusOr DeleteResourceBundle( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request) override; + + StatusOr + ListFleetPackages( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListFleetPackagesRequest const& + request) override; + + StatusOr GetFleetPackage( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetFleetPackageRequest const& request) + override; + + future> AsyncCreateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) override; + + StatusOr CreateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request) override; + + future> AsyncUpdateFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) override; + + StatusOr UpdateFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request) override; + + future> AsyncDeleteFleetPackage( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) override; + + StatusOr DeleteFleetPackage( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request) override; + + StatusOr + ListReleases(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListReleasesRequest const& + request) override; + + StatusOr GetRelease( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetReleaseRequest const& request) + override; + + future> AsyncCreateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) + override; + + StatusOr CreateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request) + override; + + future> AsyncUpdateRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) + override; + + StatusOr UpdateRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request) + override; + + future> AsyncDeleteRelease( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) + override; + + StatusOr DeleteRelease( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request) + override; + + StatusOr + ListVariants(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListVariantsRequest const& + request) override; + + StatusOr GetVariant( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetVariantRequest const& request) + override; + + future> AsyncCreateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) + override; + + StatusOr CreateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::CreateVariantRequest const& request) + override; + + future> AsyncUpdateVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) + override; + + StatusOr UpdateVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request) + override; + + future> AsyncDeleteVariant( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) + override; + + StatusOr DeleteVariant( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request) + override; + + StatusOr + ListRollouts(grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::ListRolloutsRequest const& + request) override; + + StatusOr GetRollout( + grpc::ClientContext& context, Options const& options, + google::cloud::configdelivery::v1::GetRolloutRequest const& request) + override; + + future> AsyncSuspendRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) + override; + + StatusOr SuspendRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request) + override; + + future> AsyncResumeRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) + override; + + StatusOr ResumeRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request) + override; + + future> AsyncAbortRollout( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) + override; + + StatusOr AbortRollout( + grpc::ClientContext& context, Options options, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request) + override; + + StatusOr ListLocations( + grpc::ClientContext& context, Options const& options, + google::cloud::location::ListLocationsRequest const& request) override; + + StatusOr GetLocation( + grpc::ClientContext& context, Options const& options, + google::cloud::location::GetLocationRequest const& request) override; + + StatusOr ListOperations( + grpc::ClientContext& context, Options const& options, + google::longrunning::ListOperationsRequest const& request) override; + + StatusOr GetOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::GetOperationRequest const& request) override; + + Status DeleteOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::DeleteOperationRequest const& request) override; + + Status CancelOperation( + grpc::ClientContext& context, Options const& options, + google::longrunning::CancelOperationRequest const& request) override; + + future> AsyncGetOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::GetOperationRequest const& request) override; + + future AsyncCancelOperation( + google::cloud::CompletionQueue& cq, + std::shared_ptr context, + google::cloud::internal::ImmutableOptions options, + google::longrunning::CancelOperationRequest const& request) override; + + private: + std::shared_ptr child_; + std::shared_ptr + propagator_; +}; + +#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY + +/** + * Applies the tracing decorator to the given stub. + * + * The stub is only decorated if the library has been compiled with + * OpenTelemetry. + */ +std::shared_ptr MakeConfigDeliveryTracingStub( + std::shared_ptr stub); + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_internal +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_INTERNAL_CONFIG_DELIVERY_TRACING_STUB_H diff --git a/google/cloud/configdelivery/v1/mocks/mock_config_delivery_connection.h b/google/cloud/configdelivery/v1/mocks/mock_config_delivery_connection.h new file mode 100644 index 0000000000000..7346fa8847028 --- /dev/null +++ b/google/cloud/configdelivery/v1/mocks/mock_config_delivery_connection.h @@ -0,0 +1,737 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_MOCKS_MOCK_CONFIG_DELIVERY_CONNECTION_H +#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_MOCKS_MOCK_CONFIG_DELIVERY_CONNECTION_H + +#include "google/cloud/configdelivery/v1/config_delivery_connection.h" +#include + +namespace google { +namespace cloud { +namespace configdelivery_v1_mocks { +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN + +/** + * A class to mock `ConfigDeliveryConnection`. + * + * Application developers may want to test their code with simulated responses, + * including errors, from an object of type `ConfigDeliveryClient`. To do so, + * construct an object of type `ConfigDeliveryClient` with an instance of this + * class. Then use the Google Test framework functions to program the behavior + * of this mock. + * + * @see [This example][bq-mock] for how to test your application with GoogleTest. + * While the example showcases types from the BigQuery library, the underlying + * principles apply for any pair of `*Client` and `*Connection`. + * + * [bq-mock]: @cloud_cpp_docs_link{bigquery,bigquery-read-mock} + */ +class MockConfigDeliveryConnection + : public configdelivery_v1::ConfigDeliveryConnection { + public: + MOCK_METHOD(Options, options, (), (override)); + + MOCK_METHOD( + (StreamRange), + ListResourceBundles, + (google::cloud::configdelivery::v1::ListResourceBundlesRequest request), + (override)); + + MOCK_METHOD( + StatusOr, + GetResourceBundle, + (google::cloud::configdelivery::v1::GetResourceBundleRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateResourceBundle(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateResourceBundle, + (google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateResourceBundle(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateResourceBundle, + (NoAwaitTag, + google::cloud::configdelivery::v1::CreateResourceBundleRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateResourceBundle(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateResourceBundle, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateResourceBundle(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateResourceBundle, + (google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateResourceBundle(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateResourceBundle, + (NoAwaitTag, + google::cloud::configdelivery::v1::UpdateResourceBundleRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateResourceBundle(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateResourceBundle, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteResourceBundle(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteResourceBundle, + (google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteResourceBundle(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteResourceBundle, + (NoAwaitTag, + google::cloud::configdelivery::v1::DeleteResourceBundleRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteResourceBundle(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteResourceBundle, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD( + (StreamRange), + ListFleetPackages, + (google::cloud::configdelivery::v1::ListFleetPackagesRequest request), + (override)); + + MOCK_METHOD(StatusOr, + GetFleetPackage, + (google::cloud::configdelivery::v1::GetFleetPackageRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateFleetPackage(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateFleetPackage, + (google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateFleetPackage(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateFleetPackage, + (NoAwaitTag, + google::cloud::configdelivery::v1::CreateFleetPackageRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateFleetPackage(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateFleetPackage, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateFleetPackage(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateFleetPackage, + (google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateFleetPackage(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateFleetPackage, + (NoAwaitTag, + google::cloud::configdelivery::v1::UpdateFleetPackageRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateFleetPackage(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateFleetPackage, + (google::longrunning::Operation const& operation), (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteFleetPackage(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteFleetPackage, + (google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteFleetPackage(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteFleetPackage, + (NoAwaitTag, + google::cloud::configdelivery::v1::DeleteFleetPackageRequest const& + request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteFleetPackage(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteFleetPackage, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), + ListReleases, + (google::cloud::configdelivery::v1::ListReleasesRequest request), + (override)); + + MOCK_METHOD( + StatusOr, GetRelease, + (google::cloud::configdelivery::v1::GetReleaseRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateRelease(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateRelease, + (google::cloud::configdelivery::v1::CreateReleaseRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateRelease(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateRelease, + (NoAwaitTag, + google::cloud::configdelivery::v1::CreateReleaseRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateRelease(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateRelease, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateRelease(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateRelease, + (google::cloud::configdelivery::v1::UpdateReleaseRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateRelease(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateRelease, + (NoAwaitTag, + google::cloud::configdelivery::v1::UpdateReleaseRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateRelease(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateRelease, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteRelease(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteRelease, + (google::cloud::configdelivery::v1::DeleteReleaseRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteRelease(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteRelease, + (NoAwaitTag, + google::cloud::configdelivery::v1::DeleteReleaseRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteRelease(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteRelease, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), + ListVariants, + (google::cloud::configdelivery::v1::ListVariantsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, GetVariant, + (google::cloud::configdelivery::v1::GetVariantRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// CreateVariant(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + CreateVariant, + (google::cloud::configdelivery::v1::CreateVariantRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, CreateVariant(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, CreateVariant, + (NoAwaitTag, + google::cloud::configdelivery::v1::CreateVariantRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, CreateVariant(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + CreateVariant, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// UpdateVariant(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + UpdateVariant, + (google::cloud::configdelivery::v1::UpdateVariantRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, UpdateVariant(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, UpdateVariant, + (NoAwaitTag, + google::cloud::configdelivery::v1::UpdateVariantRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, UpdateVariant(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + UpdateVariant, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// DeleteVariant(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteVariant, + (google::cloud::configdelivery::v1::DeleteVariantRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, DeleteVariant(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, DeleteVariant, + (NoAwaitTag, + google::cloud::configdelivery::v1::DeleteVariantRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, DeleteVariant(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + DeleteVariant, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), + ListRollouts, + (google::cloud::configdelivery::v1::ListRolloutsRequest request), + (override)); + + MOCK_METHOD( + StatusOr, GetRollout, + (google::cloud::configdelivery::v1::GetRolloutRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// SuspendRollout(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + SuspendRollout, + (google::cloud::configdelivery::v1::SuspendRolloutRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, SuspendRollout(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, SuspendRollout, + (NoAwaitTag, + google::cloud::configdelivery::v1::SuspendRolloutRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, SuspendRollout(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + SuspendRollout, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// ResumeRollout(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + ResumeRollout, + (google::cloud::configdelivery::v1::ResumeRolloutRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, ResumeRollout(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, ResumeRollout, + (NoAwaitTag, + google::cloud::configdelivery::v1::ResumeRolloutRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, ResumeRollout(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + ResumeRollout, (google::longrunning::Operation const& operation), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, + /// AbortRollout(Matcher(_))) + /// @endcode + MOCK_METHOD( + future>, + AbortRollout, + (google::cloud::configdelivery::v1::AbortRolloutRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// EXPECT_CALL(*mock, AbortRollout(_, _)) + /// @endcode + MOCK_METHOD( + StatusOr, AbortRollout, + (NoAwaitTag, + google::cloud::configdelivery::v1::AbortRolloutRequest const& request), + (override)); + + /// To disambiguate calls, use: + /// + /// @code + /// using ::testing::_; + /// using ::testing::Matcher; + /// EXPECT_CALL(*mock, AbortRollout(Matcher(_))) + /// @endcode + MOCK_METHOD(future>, + AbortRollout, (google::longrunning::Operation const& operation), + (override)); + + MOCK_METHOD((StreamRange), ListLocations, + (google::cloud::location::ListLocationsRequest request), + (override)); + + MOCK_METHOD(StatusOr, GetLocation, + (google::cloud::location::GetLocationRequest const& request), + (override)); + + MOCK_METHOD((StreamRange), ListOperations, + (google::longrunning::ListOperationsRequest request), (override)); + + MOCK_METHOD(StatusOr, GetOperation, + (google::longrunning::GetOperationRequest const& request), + (override)); + + MOCK_METHOD(Status, DeleteOperation, + (google::longrunning::DeleteOperationRequest const& request), + (override)); + + MOCK_METHOD(Status, CancelOperation, + (google::longrunning::CancelOperationRequest const& request), + (override)); +}; + +GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END +} // namespace configdelivery_v1_mocks +} // namespace cloud +} // namespace google + +#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_CONFIGDELIVERY_V1_MOCKS_MOCK_CONFIG_DELIVERY_CONNECTION_H diff --git a/google/cloud/configdelivery/v1/samples/config_delivery_client_samples.cc b/google/cloud/configdelivery/v1/samples/config_delivery_client_samples.cc new file mode 100644 index 0000000000000..541cf01279783 --- /dev/null +++ b/google/cloud/configdelivery/v1/samples/config_delivery_client_samples.cc @@ -0,0 +1,206 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Generated by the Codegen C++ plugin. +// If you make any local changes, they will be lost. +// source: google/cloud/configdelivery/v1/config_delivery.proto + +#include "google/cloud/configdelivery/v1/config_delivery_client.h" +#include "google/cloud/configdelivery/v1/config_delivery_connection_idempotency_policy.h" +#include "google/cloud/configdelivery/v1/config_delivery_options.h" +#include "google/cloud/common_options.h" +#include "google/cloud/credentials.h" +#include "google/cloud/internal/getenv.h" +#include "google/cloud/polling_policy.h" +#include "google/cloud/testing_util/example_driver.h" +#include +#include +#include +#include + +// clang-format off +// main-dox-marker: configdelivery_v1::ConfigDeliveryClient +// lro-marker: true +// clang-format on +namespace { + +void SetClientEndpoint(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-endpoint"}; + } + //! [set-client-endpoint] + // This configuration is common with Private Google Access: + // https://cloud.google.com/vpc/docs/private-google-access + auto options = google::cloud::Options{}.set( + "private.googleapis.com"); + auto vpc_client = google::cloud::configdelivery_v1::ConfigDeliveryClient( + google::cloud::configdelivery_v1::MakeConfigDeliveryConnection(options)); + //! [set-client-endpoint] +} + +//! [custom-idempotency-policy] +class CustomIdempotencyPolicy : public google::cloud::configdelivery_v1:: + ConfigDeliveryConnectionIdempotencyPolicy { + public: + ~CustomIdempotencyPolicy() override = default; + std::unique_ptr + clone() const override { + return std::make_unique(*this); + } + // Override inherited functions to define as needed. +}; +//! [custom-idempotency-policy] + +void SetRetryPolicy(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-retry-policy"}; + } + //! [set-retry-policy] + auto options = google::cloud::Options{} + .set( + CustomIdempotencyPolicy().clone()) + .set( + google::cloud::configdelivery_v1:: + ConfigDeliveryLimitedErrorCountRetryPolicy(3) + .clone()) + .set( + google::cloud::ExponentialBackoffPolicy( + /*initial_delay=*/std::chrono::milliseconds(200), + /*maximum_delay=*/std::chrono::seconds(45), + /*scaling=*/2.0) + .clone()); + auto connection = + google::cloud::configdelivery_v1::MakeConfigDeliveryConnection(options); + + // c1 and c2 share the same retry policies + auto c1 = google::cloud::configdelivery_v1::ConfigDeliveryClient(connection); + auto c2 = google::cloud::configdelivery_v1::ConfigDeliveryClient(connection); + + // You can override any of the policies in a new client. This new client + // will share the policies from c1 (or c2) *except* for the retry policy. + auto c3 = google::cloud::configdelivery_v1::ConfigDeliveryClient( + connection, + google::cloud::Options{} + .set( + google::cloud::configdelivery_v1:: + ConfigDeliveryLimitedTimeRetryPolicy(std::chrono::minutes(5)) + .clone())); + + // You can also override the policies in a single call: + // c3.SomeRpc(..., google::cloud::Options{} + // .set( + // google::cloud::configdelivery_v1::ConfigDeliveryLimitedErrorCountRetryPolicy(10).clone())); + //! [set-retry-policy] +} + +void SetPollingPolicy(std::vector const& argv) { + if (!argv.empty()) { + throw google::cloud::testing_util::Usage{"set-client-policy-policy"}; + } + //! [set-polling-policy] + + // The polling policy controls how the client waits for long-running + // operations. `GenericPollingPolicy<>` combines existing policies. + // In this case, keep polling until the operation completes (with success + // or error) or 45 minutes, whichever happens first. Initially pause for + // 10 seconds between polling requests, increasing the pause by a factor + // of 4 until it becomes 2 minutes. + auto options = + google::cloud::Options{} + .set( + google::cloud::GenericPollingPolicy< + google::cloud::configdelivery_v1:: + ConfigDeliveryRetryPolicyOption::Type, + google::cloud::configdelivery_v1:: + ConfigDeliveryBackoffPolicyOption::Type>( + google::cloud::configdelivery_v1:: + ConfigDeliveryLimitedTimeRetryPolicy( + /*maximum_duration=*/std::chrono::minutes(45)) + .clone(), + google::cloud::ExponentialBackoffPolicy( + /*initial_delay=*/std::chrono::seconds(10), + /*maximum_delay=*/std::chrono::minutes(2), + /*scaling=*/4.0) + .clone()) + .clone()); + + auto connection = + google::cloud::configdelivery_v1::MakeConfigDeliveryConnection(options); + + // c1 and c2 share the same polling policies. + auto c1 = google::cloud::configdelivery_v1::ConfigDeliveryClient(connection); + auto c2 = google::cloud::configdelivery_v1::ConfigDeliveryClient(connection); + //! [set-polling-policy] +} + +void WithServiceAccount(std::vector const& argv) { + if (argv.size() != 1 || argv[0] == "--help") { + throw google::cloud::testing_util::Usage{"with-service-account "}; + } + //! [with-service-account] + [](std::string const& keyfile) { + auto is = std::ifstream(keyfile); + is.exceptions(std::ios::badbit); // Minimal error handling in examples + auto contents = std::string(std::istreambuf_iterator(is.rdbuf()), {}); + auto options = + google::cloud::Options{}.set( + google::cloud::MakeServiceAccountCredentials(contents)); + return google::cloud::configdelivery_v1::ConfigDeliveryClient( + google::cloud::configdelivery_v1::MakeConfigDeliveryConnection( + options)); + } + //! [with-service-account] + (argv.at(0)); +} + +void AutoRun(std::vector const& argv) { + namespace examples = ::google::cloud::testing_util; + using ::google::cloud::internal::GetEnv; + if (!argv.empty()) throw examples::Usage{"auto"}; + examples::CheckEnvironmentVariablesAreSet( + {"GOOGLE_CLOUD_CPP_TEST_SERVICE_ACCOUNT_KEYFILE"}); + auto const keyfile = + GetEnv("GOOGLE_CLOUD_CPP_TEST_SERVICE_ACCOUNT_KEYFILE").value(); + + std::cout << "\nRunning SetClientEndpoint() example" << std::endl; + SetClientEndpoint({}); + + std::cout << "\nRunning SetRetryPolicy() example" << std::endl; + SetRetryPolicy({}); + + std::cout << "\nRunning SetPollingPolicy() example" << std::endl; + SetPollingPolicy({}); + + std::cout << "\nRunning WithServiceAccount() example" << std::endl; + WithServiceAccount({keyfile}); +} + +} // namespace + +int main(int argc, char* argv[]) { // NOLINT(bugprone-exception-escape) + google::cloud::testing_util::Example example({ + {"set-client-endpoint", SetClientEndpoint}, + {"set-retry-policy", SetRetryPolicy}, + {"set-polling-policy", SetPollingPolicy}, + {"with-service-account", WithServiceAccount}, + {"auto", AutoRun}, + }); + return example.Run(argc, argv); +} diff --git a/libraries.bzl b/libraries.bzl index 1778d281f9480..a6ed42672a85f 100644 --- a/libraries.bzl +++ b/libraries.bzl @@ -135,6 +135,7 @@ GOOGLE_CLOUD_CPP_GA_LIBRARIES = [ "compute_zones", "confidentialcomputing", "config", + "configdelivery", "connectors", "contactcenterinsights", "container",